akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
int N;
vector<int> a, b;
int recursive(int i) {
    if(b[i] >= 0) return b[i];
    int x = 0;
    for(int k = 2; i * k <= N; k++) {
        x += recursive(i * k);
    }
    return b[i] = (a[i] + x) & 1;
}
int main() {
    cin >> N;
    a = vector<int>(N + 1);
    b = vector<int>(N + 1, -1);
    for(int i = 1; i <= N; i++) cin >> a[i];
    recursive(1);
    vector<int> ans;
    for (int i = 1; i <= N; i++) {
        if(b[i]) ans.push_back(i);
    }
    cout << ans.size() << endl;
    for(int i = 0; i < ans.size(); i++) {
        cout << (i ? " " : "") << ans[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 3064
//Tuvshee
 
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<cctype>
#include<vector>
#include<queue>
using namespace std;
#define I int
#define D double
#define F float
#define C char
#define S string
#define B bool
#define L long long
#define rep(n) for(int i=0;i<n;i++)
#define reps(m,n,c) for(int c=m;c<n;c++)
#define repd(m,n,j) for(int j=n;j>m;j--)
#define whL while
#define eL endl
#define oR ||
#define anD &&
#define rtn return
#define pause system("PAUSE")
#define Max 300
#define max(m,n) ((n<m)?m:n)
#define min(m,n) ((n>m)?m:n)
 
I main()
{
    I a,b,c;
	cin>>a>>b>>c;
	if(a<b anD b<c)cout<<"Yes"<<eL;
	else cout<<"No"<<eL;
    rtn 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>

using namespace std;

namespace {

    typedef long long ll;

    int N;
    void input() {
        cin >> N;
    }

    void solve() {
        if (N == 0) cout << 1 << endl;
        else if (N == 1) cout << 2 << endl;
        else if (N == 2) cout << 1 << endl;
        else cout << 0 << endl;
    }
}

int main() {
    input(); solve();
    return 0;
}

Measured memory_bytes: 1164
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int mxN = 2e5 + 5;
const int INF = 1e9 + 7;

int n;

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n;
	int ans = 0;
	for (int i = 1; i <= n - 1; i++)
	{
		ans -= (n % i == 0);
		ans += n / i;
	}
	cout << ans;
	return 0;
}
//19-09-2020 17:49:47

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll          long long
#define pb          push_back
#define mp 	    make_pair
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define fi          first
#define si          second
#define sz(x)       (ll)x.size()
#define endl        '\n'
#define mod        1000000007
#define mset(m,v) memset(m,v,sizeof(m))
using namespace std;
ll power(ll a , ll b,ll modi)
{
    a%=modi;
    ll res = 1 ;
    while(b)
    {
        if(b%2) {
            res = (res * a) % modi ;
        }
        b/=2 ;
        a = (a*a) % modi ;
    }
    return res ;
}
//ll a[200001];
//bool mark[200001];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t=1;
	//cin>>t;
	while(t--)
	{
	    ll n,m,x;
	    cin>>n>>m>>x;
	    ll c[n+1];
	    ll a[n+1][m+1];
	    for(ll i=1;i<=n;i++){
            cin>>c[i];
            for(ll j=1;j<=m;j++)
                cin>>a[i][j];
	    }
	    ll mini=1000000000000000000;
	    for(ll j=1;j<(1<<n);j++){
            bool mark[n+1]={0};
            ll k=j;
            ll ci=1;
            ll cost=0;
            ll value[n+1]={0};
            while(k>0){
                if(k%2){
                    for(ll i=1;i<=m;i++)
                        value[i]+=a[ci][i];
                    cost+=c[ci];
                }
                k/=2;
                ci++;
            }
            bool flag=true;
            for(ll i=1;i<=m;i++)
            if(value[i]<x){
                    flag=false;
                break;
            }
            if(flag){
                mini=min(cost,mini);
            }
	    }
	    if(mini==1000000000000000000)
            cout<<-1;
        else
            cout<<mini;
	}
return 0;
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
#define REP(i,n) for (long long i=0;i<(n);i++)
#define FOR(i,a,b) for (long long i=(a);i<(b);i++)
#define RREP(i,n) for(long long i=n;i>=0;i--)
#define RFOR(i,a,b) for(long long i=(a);i>(b);i--)
#define dump1d_arr(array) REP(i,array.size()) cerr << #array << "[" << (i) << "] ==> " << (array[i]) << endl
#define dump2d_arr(array) REP(i,array.size()) REP(j,array[i].size()) cerr << #array << "[" << (i) << "]" << "[" << (j) << "] ==> " << (array[i][j]) << endl
#define dump(x)  cerr << #x << " => " << (x) << endl


#define dumpP(p) cerr << "( " << p.first << " , " << p.second << " )" << ends
#define SORT(c) sort((c).begin(),(c).end())
#define MIN(vec) *min_element(vec.begin(), vec.end())
#define MAX(vec) *max_element(vec.begin(), vec.end())
#define UNIQ(vec) vec.erase(unique(vec.begin(), vec.end()),vec.end()) //ソートの必要あり
#define IN(n,m)  (!(m.find(n) == m.end()))
#define ENUM(m) for (auto itr = m.begin(); itr != m.end(); ++itr)
#define dump_MAP(m) for(auto itr = m.begin(); itr != m.end(); ++itr) { cerr << itr->first << " --> "  << itr->second << endl; }
#define FINDL(vec,x) (lower_bound(vec.begin(),vec.end(),x) - vec.begin())
#define FINDU(vec,x) (upper_bound(vec.begin(),vec.end(),x) - vec.begin())
#define ROUND(N) setprecision(N)
#define ROUND_PRINT(N,val) cout << fixed;cout << setprecision(N) << val << endl
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define INARR(h,w,x,y) (0 <= y && y < h && 0 <= x && x < w)
#define EQ(a,b) (abs(a - b) < 1e-10)
using namespace std;
constexpr int dx[4] = {0,1,0,-1};
constexpr int dy[4] = {1,0,-1,0};
constexpr long double pi = M_PI;
constexpr double eps = 1e-10;
constexpr long mod = 1000000007;
constexpr short shINF = 32767;
constexpr long loINF = 2147483647;
constexpr long long llINF = 9223372036854775807;
typedef long long LL;
typedef vector<LL> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<LL,LL> pr;
typedef vector<bool> VB;
typedef vector<pr> VP;
typedef priority_queue<pr,vector<pr>,greater<pr>> pq;

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	long N;
	cin >> N;
	VI A(N);
	REP(i,N) cin >> A[i];
	int right = 0;LL sum = 0;LL res = 0;
	for (int left = 0;left < N;left ++) {
		while (right < N && (sum^A[right]) == (sum+A[right])) {
			sum ^=  A[right];
			++right;
		}
	/* example */
	/* パターン数 */
		res += (right - left);
		if (right == left) ++right;
		else sum ^= A[left];
	}
	cout << res << endl;
}



Measured memory_bytes: 1792
class Node
  attr_accessor :parent, :rank

  def initialize
    @parent = -1
    @rank = 0
  end
end

class UnionFindTree
  def initialize(n)
    @nodes = (0..n).to_a.map { |i| Node.new }
  end

  def find(x)
    return @nodes[x].parent < 0 ? x : @nodes[x].parent = find(@nodes[x].parent)
  end

  def unite(a, b)
    a = find(a)
    b = find(b)
    return if a == b

    if @nodes[a].rank < @nodes[b].rank
      # p [@nodes[a].parent , @nodes[b].parent]
      @nodes[b].parent += @nodes[a].parent
      @nodes[a].parent = b
    else
      # p [@nodes[a].parent , @nodes[b].parent]
      @nodes[a].parent += @nodes[b].parent
      @nodes[b].parent = a
      @nodes[a].rank += 1 if @nodes[a].rank == @nodes[b].rank
    end
  end

  def same?(a, b)
    find(a) == find(b)
  end
  
  def size(a)
    -@nodes[find(a)].parent
  end

  # 確認用。アルゴリズムとは関係無い
  def parents
    @nodes.map(&:parent)
  end
end

# n, q = gets.split.map(&:to_i)

# uft = UnionFindTree.new(n)
# q.times do |i|
  
#   com, x, y = gets.split.map(&:to_i)
  
#   if com == 0
#     uft.unite(x, y)
#   else
#     puts uft.same?(x, y) ? "Yes" : "No"
#     p [uft.size(x), uft.size(y)]
#   end
# end


N, M = gets.split.map(&:to_i)

class Bridge
  attr_accessor :first, :second

  def initialize
    @first = nil
    @second = nil
  end
  
  def nodes=(a)
    a[0], a[1] = a[1], a[0] if a[0] > a[1]
    @first = a[0]
    @second = a[1]
  end
  
end

bridges = (0...M).to_a.map { Bridge.new }

M.times do |i|
  tmp = gets.split.map(&:to_i)
  a = tmp[0]
  b = tmp[1]
  a -= 1
  b -= 1
  # a, b = b, a if a > b
  bridges[i].nodes = [a,b]
end
# p bridges

f = Array.new(N, N)
ans = Array.new(M, 0)

inco = N * ( N - 1 ) / 2 # inconvenience
# p ["inco", inco]

n = N
q = M

uft = UnionFindTree.new(n)
# p [uft.find(0), uft.find(1), uft.find(2), uft.find(3)]

q.times do |i|
  
  j = (M-1)-i
  ans[j] = inco
  
  x, y = bridges[j].first, bridges[j].second
  
  # p uft.same?(x, y)

  if !uft.same?(x, y)
    
    # p q = uft.find(x)
    # p r = uft.find(y)
    
    inco -= uft.size(x) * uft.size(y)
  
  end
  
  break if inco == 0
  
  uft.unite(x, y)
  
end

puts ans


Measured memory_bytes: 20220
n,v=map(int,input().split())
p_array=[]
total_num=0
i_cnt=0
for i in range(n):
    p_array.append(list(input().split()))
    p_array[i][1]=int(p_array[i][1])
while len(p_array) != 0:
    for i in range(n):
        if v < p_array[i-i_cnt][1]:
            p_array[i-i_cnt][1] -= v
            total_num += v
        else:
            total_num+=p_array[i-i_cnt][1]
            print(p_array[i-i_cnt][0],total_num)
            p_array.pop(i-i_cnt)
            i_cnt += 1
            n -= 1
    i_cnt=0





Measured memory_bytes: 14272
using System;

class Reversing_Numbers
{
  public static void Main()
  {
    int n = int.Parse(Console.ReadLine());
    string number_str = Console.ReadLine();
    string[] tmp_number = number_str.Split();
    
    
    for(int i=n-1;i>=0;i--)
    {
      int number = int.Parse(tmp_number[i]);
      Console.Write("{0}",number);
      if(i!=0) Console.Write(" ");
    }
    
    Console.WriteLine();
    
  }
}

Measured memory_bytes: 9204
#include <iostream>
using namespace std;
int a, b;
int main() {
	cin >> a >> b;
	if (a < b){
		cout << "a < b" <<endl;
	} else if (a > b){
		cout << "a > b" << endl ;
	} else{
		cout << "a == b" << endl;
	} 
}


Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;

constexpr int MAX_N = 1000;

int n, m;
vector<int> children[MAX_N];
int parent[MAX_N];

int memo[MAX_N];
pair<bool, int> memo2[MAX_N][MAX_N];
vector<int> nodes[MAX_N];

vector<int> calc(int v) {
  auto &res = nodes[v];
  if(!res.empty()) return res;

  res.emplace_back(v);
  for(const auto &c : children[v]) {
    const auto vec = calc(c);
    res.insert(res.end(), vec.begin(), vec.end());
  }
  return res;
}

int grundy(int v);
pair<bool, int> dfs(int v, int u) {
  auto &res = memo2[v][u];
  if(res.second != -1) return res;

  bool reach = false;
  int value = 0;
  if(v == u) {
    reach = true;
    for(const auto &c : children[v]) {
      value ^= grundy(c);
    }
  }
  else {
    vector<pair<bool, int>> buf;
    buf.reserve(children[v].size());
    for(const auto &c : children[v]) {
      buf.emplace_back(dfs(c, u));
      reach |= buf.back().first;
    }

    if(reach) {
      for(const auto &e : buf) {
	value ^= e.second;
      }
    }
    else {
      value = grundy(v);
    }
  }

  return res = make_pair(reach, value);
}

int grundy(int v) {
  int &res = memo[v];
  if(res != -1) return res;

  set<int> S;
  for(const auto &u : nodes[v]) {
    S.insert(dfs(v, u).second);
  }

  res = 0;
  while(S.count(res)) ++res;
  return res;
}

int main() {
  cin.tie(NULL);
  ios::sync_with_stdio(false);

  cin >> n >> m;

  memset(parent, -1, sizeof(parent));

  for(int i = 0; i < m; ++i) {
    int p;
    cin >> p;
    --p;

    parent[i] = p;
    children[p].emplace_back(i);
  }

  memset(memo, -1, sizeof(memo));
  for(int i = 0; i < n; ++i) {
    for(int j = 0; j < n; ++j) {
      memo2[i][j] = make_pair(false, -1);
    }
  }

  int x = 0;
  for(int v = 0; v < n; ++v) {
    if(parent[v] == -1) {
      calc(v);
      x ^= grundy(v);
    }
  }

  cout << (x != 0 ? "Alice" : "Bob") << endl;

  return 0;
}


Measured memory_bytes: 11404
/* -> Written by <-
   -----------
  |K_A_Z_A_M_A|
  |___________|
  |    ___    |
  |   (^_^)   |
  |  /( | )\  |
  |____|_|____|
    H O A N G
*/

// i hope i get better

// Task name:
#define Task ""
using namespace std;

// Include
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <string>
#include <sstream>
#include <cstdio>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <unordered_map>
#include <stack>

// Define
#define reset(x, value) memset((x), (value) ,sizeof((x)))
#define fr(i,a,b) for(int i = (a); i <= (b); i++)
#define FR(i,a,b) for(int i = (a); i < (b); i++)
#define frr(i,a,b) for(int i = (a); i >= (b); i--)
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define nl "\n"
#define bit(x,i) (x >> i) & 1
#define all(x) (x).begin(), (x).end()
#define optimize(x) (x).resize(unique(all(x)) - (x).begin())
#define Inpf freopen(Task".inp","r",stdin)
#define Outf freopen(Task".out","w",stdout)
#define fasterIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

// typedef
typedef long long ll;
typedef double db;
typedef long double ldb;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vii;
typedef vector<ll> vll;

const int base = 131;
const int MOD = 1e9 + 7;
const ll MM = 1ll * MOD * MOD;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;

void AddMOD(int &x, int y)
{
    x += y;
    if (x >= MOD)
        x -= MOD;
}
int Gcd(int x, int y)
{
    if (y == 0)
        return x;
    return Gcd(y, x % y);
}
template <class T> inline void Gmax(T &x,T y)
{
    x = max((x), (y));
}
template <class T> inline void Gmin(T &x,T y)
{
    x = min((x), (y));
}

void exit_with_runtime()
{
    db x = 1.0 * clock() / CLOCKS_PER_SEC;
	cerr << "\n\n---------------------\nTime elapsed: " << x << " s.\n\n";
	if (x > 1) cerr << "TIME LIMIT EXCEEDED!\n\n";
	exit(0);
}

// --------------------------------------------------------------------
const int maxn = 2e5 + 5;
// --------------------------------------------------------------------
void Solve()
{
    int k, a, b;
    cin >> k >> a >> b;
    if (b / k - (a-1) / k) cout << "OK";
    else cout << "NG";
}

int main()
{
#ifndef ONLINE_JUDGE
    Inpf;
    Outf;
#endif // ONLINE_JUDGE
    fasterIO;
    int test = 1;
//    cin >> test;
    while (test --)
        Solve();

    // Did you check with the special test case n = 0, n = 1??
    exit_with_runtime();
}

// Goodbye, see u again


Measured memory_bytes: 3784
#include <bits/stdc++.h>
using namespace std ;
#define ll long long 

ll dp[100005];
int main(){
ll n ; 
cin >> n;
ll arr[n+1];
for(ll i=0; i< n;i++){
 cin >> arr[i+1];
    
}

for(ll i=1;i<=n ;i++){
if(i==1){ dp[i]= 0;}
else if(i==2){ dp[i] = abs(arr[i] - arr[1]);}
else {
    ll minni= min(dp[i-1]+ abs(arr[i]- arr[i-1]), dp[i-2]+ abs(arr[i]-arr[i-2]));
    dp[i]= minni;
}
}
 cout << dp[n] << endl;

}

Measured memory_bytes: 5132
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


#define NUM 4005

enum Type{
	type_A,
	type_B,
};

int dp[NUM][NUM];
int len_A,len_B;
int next_0[2][NUM],next_1[2][NUM];
char A[NUM],B[NUM];


int dfs(int loc_A,int loc_B){

	if(loc_A == len_A && loc_B == len_B){

		return 0;
	}

	if(dp[loc_A][loc_B] != -1){

		return dp[loc_A][loc_B];
	}

	int min_length = BIG_NUM;
	int next_loc_A,next_loc_B;

	//0
	if(loc_A >= len_A){

		next_loc_A = len_A;
	}else{

		next_loc_A = next_0[type_A][loc_A];
	}

	if(loc_B >= len_B){

		next_loc_B = len_B;
	}else{

		next_loc_B = next_0[type_B][loc_B];
	}

	min_length = min(min_length,dfs(next_loc_A,next_loc_B));

	//1
	if(loc_A >= len_A){

		next_loc_A = len_A;
	}else{

		next_loc_A = next_1[type_A][loc_A];
	}

	if(loc_B >= len_B){

		next_loc_B = len_B;
	}else{

		next_loc_B = next_1[type_B][loc_B];
	}

	min_length = min(min_length,dfs(next_loc_A,next_loc_B));

	return dp[loc_A][loc_B] = min_length+1;
}

void recursive(int loc_A,int loc_B){

	if(loc_A >= len_A && loc_B >= len_B)return;

	if(dfs(min(len_A,next_0[type_A][loc_A]),min(len_B,next_0[type_B][loc_B]))+1
			== dfs(loc_A,loc_B)){
		printf("0");
		recursive(min(len_A,next_0[type_A][loc_A]),min(len_B,next_0[type_B][loc_B]));
		return;
	}

	//1
	if(dfs(min(len_A,next_1[type_A][loc_A]),min(len_B,next_1[type_B][loc_B]))+1
				== dfs(loc_A,loc_B)){
		printf("1");
		recursive(min(len_A,next_1[type_A][loc_A]),min(len_B,next_1[type_B][loc_B]));
		return;
	}
}

int main(){

	scanf("%s",A);
	scanf("%s",B);

	for(len_A = 0; A[len_A] != '\0'; len_A++);
	for(int i = len_A; i >= 1; i--){
		A[i] = A[i-1];
	}
	A[0] = '@';
	len_A++;

	for(len_B = 0; B[len_B] != '\0'; len_B++);
	for(int i = len_B; i >= 1; i--){

		B[i] = B[i-1];
	}
	B[0] = '@';
	len_B++;


	for(int i = 0; i <= len_A; i++){
		for(int k = 0; k <= len_B; k++){

			dp[i][k] = -1;
		}
	}

	next_0[type_A][len_A] = len_A;
	next_1[type_A][len_A] = len_A;
	next_0[type_A][len_A-1] = len_A;
	next_1[type_A][len_A-1] = len_A;

	for(int loc = len_A-2; loc >= 0; loc--){

		if(A[loc+1] == '0'){

			next_0[type_A][loc] = loc+1;
			next_1[type_A][loc] = next_1[type_A][loc+1];

		}else{ //A[loc+1] == '1'

			next_0[type_A][loc] = next_0[type_A][loc+1];
			next_1[type_A][loc] = loc+1;
		}
	}

	next_0[type_B][len_B] = len_B;
	next_1[type_B][len_B] = len_B;
	next_0[type_B][len_B-1] = len_B;
	next_1[type_B][len_B-1] = len_B;

	for(int loc = len_B-2; loc >= 0; loc--){

		if(B[loc+1] == '0'){

			next_0[type_B][loc] = loc+1;
			next_1[type_B][loc] = next_1[type_B][loc+1];

		}else{ //B[loc+1] == '1'

			next_0[type_B][loc] = next_0[type_B][loc+1];
			next_1[type_B][loc] = loc+1;
		}
	}

	recursive(0,0);
	printf("\n");

	return 0;
}



Measured memory_bytes: 65892
#include<bits/stdc++.h>
#define rep(i, n) for (int i=0;i<(n);i++)
using namespace std;
#define vecout(V) for(int i=0;i<V.size();i++) {cout<<V[i]<<endl;}
typedef long long ll;
ll INF=1e15;
int main(void){
    int n, k;
    cin>>n>>k;
    vector<ll> v(n);
    rep(i, n) cin>>v[i];
    ll ans=INF;
    for(int i=0;i+k-1<n;i++){
        int l=i;
        int r=i+k-1;
        ll tmp=min(abs(v[l])+abs(v[l]-v[r]), abs(v[r])+abs(v[l]-v[r]));
        ans=min(tmp, ans);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1024
N = int(input())

x_list=[]
y_list=[]
h_list=[]


def all_same(items):
	return all(map(lambda x: x == items[0], items))

for i in range(N):
	x,y,h=map(int, input().split())
	x_list.append(x)
	y_list.append(y)
	h_list.append(h)
		
for cy in range(101):
	for cx in range(101):
		n = -1	
		for h in h_list:
			n += 1
			if h >= 1:
				H = abs(cx - x_list[n])+abs(cy - y_list[n])+h
				h_now_list=[]
				break
		for i in range(N):
			h_now = max((H-abs(cx - x_list[i])-abs(cy - y_list[i])), 0)
			h_now_list.append(h_now)
			if h_now != h_list[i]:
				break	
			else:
				if len(h_now_list)==N:
					print(str(cx)+' '+str(cy)+' '+str(H))
					break
	else:
		continue
	break

Measured memory_bytes: 3188
#include <stdio.h>
int main ()
{
	int a,b,c1,c2,c3;
	scanf("%i%i",&a,&b);
	c1=a+b;
	c2=a-b;
	c3=a*b;
	if (c1>c2 && c1>c3)
	{
		printf("%i",c1);
	}
	else if(c2>c3 && c2>c1)
	{
		printf ("%i",c2);
	}
	else if(c3>c2 && c3>c1)
	{
		printf("%i",c3);
	}
	else if (c1==c2 && c2==c3)
	{
		printf("%i",c1);
	}
	else if (c1==c2 && c1>c3)
	{
		printf("%i",c1);
	}
	else if (c1==c3 && c1>c2)
	{
		printf("%i",c1);
	}
	else if (c2==c3 && c2>c1)
	{
		printf("%i",c2);
	}
	return 0;
}


Measured memory_bytes: 128
#include <stdio.h>

int main(int argc, char const *argv[])
{
    int A,B,C;
    scanf("%d%d%d",&A,&B,&C);
    if (A<C && C<B)
    {
        printf("Yes");
    }else if (B<C && C<A)
    {
        printf("Yes");
    }else
    {
        printf("No");
    }
    return 0;
}


Measured memory_bytes: 128
def selectionSort(A,N):
    cnt = 0
    for i in range(N-1):
        minj = i
        flag = 0
        for j in range(i,N):
            if A[j] < A[minj]:
                minj = j
                flag = 1
        tmp = A[i]
        A[i] = A[minj]
        A[minj] = tmp
        if flag: cnt+=1

    print(*A)
    print(cnt)

n = int(input())
ls = list(map(int,input().split()))
selectionSort(ls,n)        



Measured memory_bytes: 5612
#include <bits/stdc++.h>
#define FxZ ;
#define gby {
#define nMC }
#define suS /=
#define Shy +=
#define LJT -=
#define KUT *=
#define ckx !=
#define sNQ %=
#define imn ^=
#define sut |=
#define pJE &=
#define uVK ||
#define dSG &&
#define YFo *
#define Tfe /
#define EMl ++
#define Lih --
#define nea +
#define mFp -
#define Amc %
#define sBS ^
#define qhd ?
#define fyd &
#define ToM |
#define ouJ !
#define NXM ==
#define uGz >>
#define XvM <<
#define QTF <=
#define Ocl >=
#define AcB ->
#define OBL =
#define rGP <
#define VaS >


using namespace std FxZ 
long a[200005],n,k FxZ 
bool check(int m)
 gby 
 int sl OBL 0 FxZ 
 for(int i OBL 1 FxZ i QTF n FxZ i EMl )
 gby 
 sl OBL sl nea (a[i] Tfe m) FxZ 
 if(a[i] Amc m NXM 0) sl Lih FxZ 
 nMC 
 return (sl QTF k) FxZ 
 nMC 
int main()
 gby 
 long dau OBL 1,cuoi,giua,M FxZ 
 cin uGz n uGz k FxZ 
 for(int i OBL 1 FxZ i QTF n FxZ i EMl )
 gby 
 cin uGz a[i] FxZ 
 cuoi OBL max(cuoi,a[i]) FxZ 
 nMC 
 while(dau QTF cuoi)
 gby 
 giua OBL (dau nea cuoi) Tfe 2 FxZ 
 if(check(giua) NXM true)
 gby 
 M OBL giua FxZ 
 cuoi OBL giua mFp 1 FxZ 
 nMC 
 else dau OBL giua nea 1 FxZ 
 nMC 
 cout XvM M FxZ 
 nMC 


Measured memory_bytes: 5192
from itertools import permutations

N = int(input())

if N < 10:
    print(N)
    exit()


def cnt(s, e):
    ans = 0
    for i in range(0,10):
        num = s * 10**(i+1) + e

        if num > N:
            return ans

        if i == 0:
            ans += 1
            continue

        x = 10**i - 1
        if num + x * 10 <= N:
            ans += x + 1
            continue

        for j in range(10**i-1, -1, -1):
            if num + 10 * j <= N:
                ans += j + 1
                break 
        
        return ans

    return ans

ans = 0
for s, e in permutations([i for i in range(1,10)], 2):
   ans += cnt(s, e) * cnt(e, s)

# 先頭と末尾が同じ場合
for i in range(1, 10):
    ans += (cnt(i, i) + 1) ** 2

print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = 1e9 + 7;
const double EPS = 1e-8;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int p, q; cin >> p >> q;
    int target = q / __gcd(p, q);
    for(int i = 2; i * i <= target; i++)
    {
        while(target % (i * i) == 0) target /= i;
    }
    cout << target << endl;
    return 0;
}




Measured memory_bytes: 3116
#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;


int main() {
int a,b,h;
cin >> a >> b >> h;
int ans;
ans = (a+b)*h/2;
cout << ans << endl;
return 0;
}


Measured memory_bytes: 256
N, K = map(int, input().split())
X = list(map(int, input().split()))

zeroi = 0
while zeroi < N:
    if X[zeroi] >= 0:
        break
    zeroi += 1
if zeroi < N and X[zeroi] == 0:
    K -= 1
    N -= 1
    del X[zeroi]

xl = list(reversed(X[:zeroi]))
xr = list(X[zeroi:])

def solve():
    if K == 0:
        return 0
    minval = 2**60
    for i, x in enumerate(xl):
        r = K - (i+1)
        if r <= 0:
            d = -x
        elif r > len(xr):
            continue
        else:
            d = -x + 2 * xr[r-1]
        if minval > d:
            minval = d
    for i, x in enumerate(xr):
        l = K - (i+1)
        if l <= 0:
            d = x
        elif l > len(xl):
            continue
        else:
            d = x - 2 * xl[l-1]
        if minval > d:
            minval = d
    return minval

print(solve())

Measured memory_bytes: 62576
N = int(input())
A = list(map(int, input().split()))

min = 10**9
minus = 0
for i in range(len(A)):
    if A[i] < 0:
        minus += 1
    if abs(A[i]) < min:
        min = abs(A[i])
    A[i] = abs(A[i])

if minus % 2 == 0:
    print(sum(A))
else:
    print(sum(A) - 2 * min)


Measured memory_bytes: 14332
//clear adj and visited vector declared globally after each test case
//check for long long overflow
//while adding and subs check if mod becomes -ve
//while using an integer directly in a builtin function add ll

#include <bits/stdc++.h>
#define int long long
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);cout.precision(dbl::max_digits10);
#define pb push_back
#define mod 1000000007 //998244353
#define lld long double
#define mii map<int, int>
#define mci map<char, int>
#define msi map<string, int>
#define pii pair<int, int>
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define setbits(x) __builtin_popcountll(x)
typedef std::numeric_limits< double > dbl;
using namespace std;
const long long N=200005, INF=2000000000000000000;
int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }

int32_t main()
{
    IOS;
    int n;
    cin>>n;
    while(n)
    {
        if(n%10==7)
        {
            cout<<"Yes";
            return 0;
        }
        n/=10;
    }
    cout<<"No";
}

Measured memory_bytes: 3652
import heapq

n, m = map(int, input().split())
a = [-int(i) for i in input().split()]

heapq.heapify(a)

for _ in range(m):
    tmp = heapq.heappop(a)
    heapq.heappush(a, -(-tmp // 2))

print(-sum(a))

Measured memory_bytes: 72216
C753 = ['7', '5', '3'].freeze

def is753?(s)
  C753.each do |c|
    return false if !s.include?(c)
  end
  true
end

# 文字列 s で始まり、upper以下の 753数 の数を返す
# s自身が 753数ならそれも含む
def dfs(s, upper)
  cnt = 0
  return 0 if upper < s.to_i

  cnt += 1 if is753?(s)

  C753.each do |c|
    cnt += dfs(s + c, upper)
  end
  cnt
end

def main
  n = gets.chomp.to_i
  puts dfs("", n)
end

if __FILE__ == $0
  main
end


Measured memory_bytes: 1788
#include <bits/stdc++.h>

using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;

#define ALL(x) x.begin(), x.end()

template<typename T>
constexpr T inf = static_cast<T>(pow(10, static_cast<int>(log10(numeric_limits<T>::max())))) + 7;
constexpr llong mod = 1e9+7;

struct node {
  llong place;
  llong money;
  llong cost;

  node() = default;
  node(llong p, llong m, llong c) :
    place(p),
    money(m),
    cost(c)
  {}

  bool operator>(const node &ri) const {
    return cost > ri.cost;
  }
  bool operator<(const node &ri) const {
    return cost < ri.cost;
  }
  bool operator>=(const node &ri) const {
    return cost >= ri.cost;
  }
};

llong N, M, S;
llong maxi = -1;
vector<vector<node>> edges;
vector<node> change;

vector<node> dijkstra(int start) {
  vector<node> ret(edges.size(), node(-1, 0, inf<llong>));
  vector<vector<node>> dis(edges.size(), vector<node>(maxi * N + 1, node(-1, 0, inf<llong>)));
  priority_queue<node, vector<node>, greater<node>> que;

  dis[start][min(S, maxi*N)] = node(start, min(S, maxi*N), 0);
  que.push(dis[start][min(S, maxi*N)]);
  while (que.size()) {
    node now = que.top();
    que.pop();
    if (dis[now.place][now.money] < now) continue;
    for (auto edge: edges[now.place]) {
      node next(edge.place, now.money - edge.money, now.cost + edge.cost);
      while (next.money <= maxi * N) {
        if (next.money >= 0 && dis[next.place][next.money] > next) {
          dis[next.place][next.money] = next;
          que.push(next);
        }
        next.money += change[now.place].money;
        next.cost += change[now.place].cost;
      }
    }
  }

  for (int i = 2; i <= N; ++i) {
    for (int j = 0; j <= maxi * N; ++j) {
      ret[i] = min(ret[i], dis[i][j]);
    }
  }

  return ret;
}

int main() {
  cin >> N >> M >> S;
  edges.resize(N + 1);
  change.resize(N + 1);

  for (int i = 0; i < M; ++i) {
    llong U, V, A, B;
    cin >> U >> V >> A >> B;
    maxi = max(maxi, A);
    edges[U].push_back(node(V, A, B));
    edges[V].push_back(node(U, A, B));
  }
  for (int i = 1; i <= N; ++i) {
    cin >> change[i].money >> change[i].cost;
  }

  auto ans = dijkstra(1);
  for (int i = 2; i <= N; ++i) {
    cout << ans[i].cost << endl;
  }

  return 0;
}

Measured memory_bytes: 55352
#include<bits/stdc++.h>
using namespace std;

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

string vow = "aeiou";

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

const int dx[] = { -1 , 0 , 0 , 1 } ;
const int dy[] = { 0 , -1 , 1 , 0 } ;

const ld pie = 3.14159265358979 ;
const ll mod = 1e9 + 7 ;

void solve ( int test_case )
{
    ll n ; cin >> n ;
    if ( n%2 ) { cout << 0 ; line ; R ; }

    n >>= 1 ;

    ll ans = 0 ;
    ll f = 5 ;

    while ( true )
    {
        ans += (n/f) ;
        f *= 5 ;

        if ( n/f == 0 )
            break ;
    }

    cout << ans ; line
}

int main()
{
    int t = 1;
    // cin >> t;

    for ( int i=0 ; i < t ; i++ ) solve(i);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main(){
  ll n,m=0,a=0,r=0,c=0,h=0,i;
  cin >> n;
  vector<string> s(n);
  for(i=0;i<n;i++){
    cin >> s.at(i);
    if(s.at(i).at(0)=='M'){
      m++;
    }else if(s.at(i).at(0)=='A'){
      a++;
    }else if(s.at(i).at(0)=='R'){
      r++;
    }else if(s.at(i).at(0)=='C'){
      c++;
    }else if(s.at(i).at(0)=='H'){
      h++;
    }
  }
  
  cout << m*a*r+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h << endl;
}

Measured memory_bytes: 6344
#include<bits/stdc++.h>

using namespace std;

int main(){
	
	string a,b;
	cin>>a>>b;
	int n,m;
	n=a.size(),m=b.size();
	
	vector<vector<int> >dp(n+1,vector<int>(m+1));
	vector<vector<int> >rev(n+1,vector<int>(m+1,-1));
	
	for(int i=n-1;i>=0;i--){
		
		for(int j=m-1;j>=0;j--){
			
			if(a[i]==b[j]){
				dp[i][j]=1+(i+1<n&&j+1<m?dp[i+1][j+1]:0);
				rev[i][j]=0;
			}
			else{
				
				int u=(i+1<n?dp[i+1][j]:0),v=(j+1<m?dp[i][j+1]:0);
				if(u>v)
					dp[i][j]=u,rev[i][j]=1;
				else
					dp[i][j]=v,rev[i][j]=2;
			}
			
			//cout<<dp[i][j]<<" ";
		}
		//cout<<"\n";
	}
	int x=0,y=0;
	string s="";
	while(x<n&&y<m){
		
		if(rev[x][y]==0){
			s+=a[x];
			x++,y++;
		}
		else if(rev[x][y]==1)
			x++;
		else
			y++;
	}
	
	cout<<s;
}


Measured memory_bytes: 70784
#include<iostream>
#include<vector>
#include<stack>
#include<string>
#include<algorithm>
using namespace std;

int main(){
    stack<int> S1;
    stack<pair<int,int> > S2;
    char ch;
    int sum = 0;
    for (int i=0; cin >> ch; i++){
        if (ch == '\\') S1.push(i);
        else if (ch == '/' && S1.size() > 0){
            int j = S1.top(); S1.pop();
            sum += i - j;
            int a = i - j;
            while (S2.size() > 0 && S2.top().first > j){
                a += S2.top().second; S2.pop(); 
            }
            S2.push(make_pair(j,a));
        }
    }

    vector<int> ans;
    while (S2.size() > 0){
        ans.push_back(S2.top().second);S2.pop();
    }
    reverse(ans.begin(),ans.end());
    cout << sum << endl;
    cout << ans.size();
    for (int i = 0; i < ans.size(); i++ ){
        cout << " ";
        cout << ans[i];
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 3168
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	/*/TODO:!!!!!!!テスト用!!!!!!!!!
	sc = bufio.NewScanner(strings.NewReader(`
										`))
	//TODO:!!!!!!!テスト用!!!!!!!!!*/

	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()
	/* --- code --- */
	//fmt.Fprintln(out, "[DEBUG]", time.Now())

	n := nextInt()
	d := nextInt()

	ans := 0
	d2 := d * d

	for i := 0; i < n; i++ {
		x := nextInt()
		y := nextInt()
		if x*x+y*y <= d2 {
			ans++
		}
	}

	//fmt.Fprintln(out, "[DEBUG]", a)
	fmt.Fprintln(out, ans)

}

// 挿入ソート配列
type slist struct {
	l []int
}

func makeSlist() slist {
	return slist{[]int{}}
}

func (s *slist) add(a int) {
	pos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })
	if pos < len(s.l) {
		s.l = append(s.l[:pos+1], s.l[pos:]...)
		s.l[pos] = a
	} else {
		s.l = append(s.l, a)
	}
}
func (s slist) contains(a int) bool {
	pos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })
	return pos < len(s.l) && s.l[pos] == a
}

//------------------------------------------------------------------------------

// -*-*-*-*-*-*-*-*-
// * I/O utilities *
// -*-*-*-*-*-*-*-*-

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextFloat64() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func chars(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}

func printArray(a []int) {
	for i := 0; i < len(a); i++ {
		if i >= 1 {
			fmt.Fprint(out, " ")
		}
		fmt.Fprint(out, a[i])
	}
	fmt.Fprintln(out)
}

func absInt(x int) int {
	return int(math.Abs(float64(x)))
}
func minInt(x, y int) int {
	if x < y {
		return x
	}
	return y
}
func maxInt(x, y int) int {
	if x > y {
		return x
	}
	return y
}
func log10(x int) float64 {
	return math.Log10(float64(x))
}


Measured memory_bytes: 5868
n,t=map(int,input().split())
tl=list(map(int, input().split()))

out = 0


#最後のだけ残す
for i in range(n-1):
    if tl[i+1] < tl[i]+t:
        out += tl[i+1]-tl[i]
    elif tl[i+1] >= tl[i]+t:
        out += t

out += t

#1回の時はできる
if n == 1:
    out = t

print(out)

Measured memory_bytes: 26836
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
typedef long long ll;
#define N 200020
inline int read(){
    int x=0,f=1;
    char c=getchar();
    while(c<'0'||c>'9'){
        if(c=='-')f=-1;
        c=getchar();
    }
    while(c>='0'&&c<='9'){
        x=(x<<3)+(x<<1)+c-'0';
        c=getchar();
    }
    return x*f;
}
int n,p,cnt[10010],a[N];
ll p10[N],x,ans;
char s[N];
int main(){
	n=read(),p=read();
	scanf("%s",s+1);
	if(p==2){
		for(int i=1;i<=n;i++){
			if((s[i]-'0')%2==0){
				ans+=i;
			}
		}
	}
	else if(p==5){
		for(int i=1;i<=n;i++){
			if((s[i]-'0')%5==0){
				ans+=i;
			}
		}
	}
	else{
		p10[0]=1;
		for(int i=1;i<=n;i++){
			p10[i]=p10[i-1]*10LL%p;
		}
		for(int i=1;i<=n;i++){
			a[i]=(a[i-1]+p10[n-i]*(s[i]-'0')%p)%p;
		}
		++cnt[0];
		for(int i=1;i<=n;i++){
			ans+=cnt[a[i]],++cnt[a[i]];
		}
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 2816
#include<bits/stdc++.h>
using namespace std;
int main() {
  	set<int> s;
	int n; cin >> n;
  	for (int i = 0; i < n; i ++) {
    	int x; cin >> x;
     	s.insert(x);
    }
  	if (s.size() == n) cout << "YES";
  	else cout << "NO";
}

Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b;
  cin >> a >> b;
 
  if ((a * b) % 2 == 1) {
    cout << "Odd" << endl;
  }
  else {
    cout << "Even" <<endl;
  }
  // ここにプログラムを追記
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>


int main(){
	int N;

	std::cin >> N;
	int a,b,c,d;
	a=N/1000;
	b=(N%1000)/100;
	c=((N%1000)%100)/10;
	d=((N%1000)%100)%10;
	if((a==b&&c==b)||(b==c&&c==d)){
		std::cout << "Yes" << std::endl;
	}else{
	std::cout << "No" << std::endl;
	}


	return 0;

} 

Measured memory_bytes: 256
/* Author : Aaryan Srivastava ^__^ */ 
#include <bits/stdc++.h>
#include <random>
#include <chrono>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define pb push_back
#define popb pop_back
#define mt make_tuple 
#define eb emplace_back
#define mp make_pair
#define ff first
#define ss second 
#define ull unsigned long long  
#define pii pair<int, int>
#define piii pair<int,pii>
#define beg begin
#define rep(i,n) for(int (i) = 0 ; i < (n) ; i++)
#define repA(i,x,y) for(int i = (x) ; i <= (y) ; i++)
#define repD(i,x,y) for(int i = (x) ; i >= (y) ; i--)
#define all(c) (c).begin(),(c).end()
#define fill(a,val) memset(a,val,sizeof(a))
#define Randomize mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define int ll
using ll = long long;
const int N = 3*1e5 +5 ;
const int mod = 1e9 + 7 ;
const int inf = 1e18 ;
const int SZ = 101 ;
const double eps = 1e-9 ;
using namespace __gnu_pbds;
using namespace std;
using ordered_set =  tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ;

#ifdef AaryanS
#define mycout cout
#define mycerr cerr 
#endif

#ifndef AaryanS
#define mycout if(false) cout
#define mycerr if(false) cerr
#endif


void solve()
{
    int q,p ;
    cin >> q >> p ;
    q *= 3 ;
    cout << (q + p)/2 ;
}   

     
int32_t main(int32_t argc, char *argv[])
{
    double t1 = clock() ;
    ios::sync_with_stdio(0);    
    cin.tie(0); cout.tie(0);
    int TC = 1, t = 0;
    //cin >> TC ;
    while(t++ < TC)
    {
        //cout << "Case #" << t << ": " ;
        solve();
        //cout << endl ;
    }
    mycerr << "Time : " << 1000 *(clock() - t1)/CLOCKS_PER_SEC << " ms\n" ;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);

        char moji = sc.next().charAt(0);

        String ans = null;

        if(Character.isUpperCase(moji)){
            ans = "A";
        }else {
            ans = "a";
        }

        System.out.println(ans);

    }
}


Measured memory_bytes: 35772
#include<vector>
#include<iostream>
#include<algorithm>
#include<functional>
#include<string>
#include<limits.h>
#include<cmath>
#include<queue>
#include<map>
#define rep(i,n) for (int i=0; i<n; i++)
using namespace std;
typedef long long ll;

ll gcd(ll a,ll b){
  ll r;
  while ((r=a%b)){a=b;b=r;}
  return b;
}

int main(){

  int n; cin >> n;
  vector<int> l(n); rep(i,n){ cin >> l[i]; }
  
  sort(l.begin(),l.end());
  int ans=0;
  
  rep(i,n){
    for (int j=i+1; j<n; j++){
      for (int k=j+1; k<n; k++){
        if (l[i]+l[j]>l[k]){ans++;}
      }
    }
  }
  
  cout << ans;
  
  return 0;
}


Measured memory_bytes: 384
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase

/*
cout<<fixed<<setprecision(20);
cin.tie(0);
ios::sync_with_stdio(false);
*/
const llint mod=1000000007;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}

int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,bi,i,j,ans=-mod;cin>>n;
	vector<array<bool,10>>F(n);
	for(i=0;i<n;i++){for(j=0;j<10;j++){cin>>F[i][j];}}
	vector<array<int,11>>P(n);
	for(i=0;i<n;i++){for(j=0;j<=10;j++){cin>>P[i][j];}}
	for(int bi=1;bi<1024;bi++){
		int gen=0;
		for(i=0;i<n;i++){
			int k=0;
			for(j=0;j<10;j++){
				if((bi&(1<<j))&&F[i][j]){k++;}
			}
			gen+=P[i][k];
		}
		maxeq(ans,gen);
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#pragma region include
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <cstdio>
#include <tuple>
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(int i = 0; i < (n); i++)
#define REPR(i, n) for(int i = (n); i >= 0; i--)
#define FOR(i,n,m) for(int i = (n); i < (m); i++)
#define MOD 1000000007
#define INF 1000000000
#define LLINF 4000000000000000000
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
#pragma endregion

int main() {
    int N, K; cin >> N >> K;
    VI a(N);
    // dp[i][j] := i番目までの子供にj個配る場合の数
    vector<vector<ll>> dp(N + 1, vector<ll>(K + 1, 0));
    REP(i, N) cin >> a[i];
    dp[0][0] = 1;
    REP(i, N) {
        vector<ll> sum(K+1);
        sum[0] = dp[i][0];
        FOR(j, 1, K+1) {
            sum[j] = sum[j-1] + dp[i][j];
        }
        REP(j, K + 1) {
            // dp[i][j-a[i]]からdp[i][j]までの和
            if (j-a[i]-1 >= 0) dp[i + 1][j] = sum[j] - sum[j-a[i]-1];
            else dp[i + 1][j] = sum[j];
            dp[i + 1][j] %= MOD;
            /*
            REP(k, a[i]+1) {
                if (j - k >= 0) dp[i + 1][j] += dp[i][j - k];
                else break;
            }
            */
        }
    }
    cout << dp[N][K] << endl;
    getchar(); getchar();
}

Measured memory_bytes: 80256
#include <bits/stdc++.h>
using namespace std;

int main(){
    vector<vector<int>> A(3, vector<int>(10,0));
    vector<vector<int>> B(3, vector<int>(10,0));
    vector<vector<int>> C(3, vector<int>(10,0));
    vector<vector<int>> D(3, vector<int>(10,0));
    int n;
    cin >> n;
    for (int i=0; i<n; i++){
        int b,f,r,v;
        cin >> b >> f >> r >> v;
        if (b==1) {A.at(f-1).at(r-1)+=v;}
        else if (b==2) {B.at(f-1).at(r-1)+=v;}
        else if (b==3) {C.at(f-1).at(r-1)+=v;}
        else {D.at(f-1).at(r-1)+=v;}
    }
    for (int i=0; i<3; i++){
        for (int j=0; j<10; j++){
            cout << " " << A.at(i).at(j);
            if (j==9) {cout << endl;}
        }
    }
    cout << "####################" << endl;
    for (int i=0; i<3; i++){
        for (int j=0; j<10; j++){
            cout << " " << B.at(i).at(j);
            if (j==9) {cout << endl;}
        }
    }
    cout << "####################" << endl;
    for (int i=0; i<3; i++){
        for (int j=0; j<10; j++){
            cout << " " << C.at(i).at(j);
            if (j==9) {cout << endl;}
        }
    }
    cout << "####################" << endl;
    for (int i=0; i<3; i++){
        for (int j=0; j<10; j++){
            cout << " " << D.at(i).at(j);
            if (j==9) {cout << endl;}
        }
    }
}


Measured memory_bytes: 3108
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

const long long INF = 1e18;
//const ll mod = 1000000007;
ll N;
ll A[201000];
map<l_l, ll> mp[201000];

int main() {
    cin >> N;
    for(int i = 0; i < N; i++) cin >> A[i];
    //mp[0][{0, 1}] = 1e15;
    mp[0][{0, 1}] = 0;
    for(int i = 0; i < N; i++) {
        for(auto tmp : mp[i]) {
            ll num = tmp.first.first;
            ll ok = tmp.first.second;
            ll val = tmp.second;
            //cerr << i << " " << num << " " << ok << " " << (ll)(val - 1e15) << endl;
            //cerr << i << " " << num << " " << ok << " " << (ll)(val) << endl;
            if(ok) {
                ll newnum = num + 1;
                ll newok = 0;
                ll newval = val + A[i];
                if(abs(i/2 - newnum) <= 3) {
                    //cerr << "new: " << newnum << " " << newok << " " << newval << endl;
                    if(mp[i+1].count({newnum, newok})) chmax(mp[i+1][{newnum, newok}], newval);
                    else mp[i+1][{newnum, newok}] = newval;
                }
            }
            if(abs(i/2 - num) <= 3) {
                if(mp[i+1].count({num, 1})) chmax(mp[i+1][{num, 1}], val);
                else mp[i+1][{num, 1}] = val;
            }
        }
    }
    ll ans = mp[N][{N/2, 0}];
    chmax(ans, mp[N][{N/2, 1}]);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 127132