akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>

typedef long long ll;
using namespace std;

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define print(x) cout<<(x)<<endl
#define rep(i,n) for(int i = 0;i < ((int)(n));++i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SUM(vec) accumulate(all(vec),0LL)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define test(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

const int INF = 1e9+7;
const ll INFL = 9*1e18;

ll inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;}
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);}
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;}
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;}


bool isOk(ll key,ll value){
  return key >= value;
}

ll binary_search(vector<ll> a,ll key){
  ll ok = a.size()-1;
  ll ng = 0;

  while(abs(ok - ng) > 1){
    ll mid = (ok + ng) / 2;
    if(isOk(key,a[mid]))ok = mid;
    else ng = mid;
  }
  return ok;
}

int prime(int n) {
	int primes;
	for (int i = 2; n >= i * i; ++i) {
		if(!(n % i))return 0;
		
	}
  return 1;
}

int main() {
  cin.tie(0); ios::sync_with_stdio(0);
  int x;cin>>x;
  while(1){
    
    if(prime(x)){
      print(x);
      break;
    };
    x++;
  }
  return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

N = I()
B = IL()[::-1]

A = [0 for i in range(N)]
A[0] = B[0]

for i in range(1,N-1):
  A[i] = min(B[i-1],B[i])
A[-1] = B[-1]

P(sum(A))


Measured memory_bytes: 38256
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;

map<pair<int, int>, int> ma;

int dfs(int x, int y) {
  int res = 0;
  if (x > y || y == 0) {
    return 0;
  }
  if (ma.find({x, y}) != ma.end()) {
    return ma[{x, y}];
  }
  res = 1 + dfs(x + 1, y - x);
  res = max(res, dfs(x + 1, y));
  ma.insert({{x, y}, res});
  return res;
}

int main() {
  ll n;
  int ans = 0;
  vector<int> v;
  cin >> n;
  ll nn = n;
  ll cnt;
  for (ll i = 2; i <= 1000000; i++) {
    cnt = 0;
    while (nn % i == 0) {
      cnt++;
      nn /= i;
    }
    if (cnt) {
      v.push_back(cnt);
    }
  }
  if (nn != 1LL) {
    v.push_back(1);
  }
  for (int i = 0; i < v.size(); i++) {
    ans += dfs(1, v[i]);
  }
  cout << ans << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = pow(10, 9) + 7;
//const int MOD = 998244353;
//const int MOD = ;
int mod(int A, int M) {return (A % M + M) % M;}
const int INF = 1LL << 60;
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const string abc = "abcdefghijklmnopqrstuvwxyz";
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}

signed main()
{
  int N, M;
  cin >> N >> M;
  if (N > M) swap(N, M);

  int ans = 0;
  if (N == M)
  {
    ans = 2;
    for (int i = 1; i <= N; i++)
    {
      ans *= i;
      ans %= MOD;
      ans *= i;
      ans %= MOD;
    }
  }
  else if (M - N == 1)
  {
    ans = 1;
    for (int i = 1; i <= N; i++)
    {
      ans *= i;
      ans %= MOD;
      ans *= i;
      ans %= MOD;
    }
    ans *= M;
    ans %= MOD;
  }

  cout << ans << endl;
}

Measured memory_bytes: 256
import itertools
N,K = map(int,input().split())
A = list(map(int,input().split()))
for i in range(K):
    newA = [0]*N
    for j in range(N):
        newA[max(0,j-A[j])] += 1
        if j+A[j]+1 < N:
            newA[min(N-1,j+A[j]+1)] -= 1
    A = list(itertools.accumulate(newA))
    if A == [N]*N:
        break
print(*A)


Measured memory_bytes: 177456
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define PI acos(-1)
typedef  long long ll;
ll gcd(ll x,ll y){
   if(y==0) return x;
   else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
   return x/gcd(x,y)*y;
}
using namespace std;

int main(){
   int n;
   cin>>n;
   
   pair<int,int> a[n];

   rep(i,n){
      a[i].second=i+1;
      cin>>a[i].first;
   }
   sort(a,a+n);
   
   rep(i,n){
      cout<<a[i].second<<" ";
   }


return 0;
}



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

int main() {
  int N;
  cin >> N;

  string S;
  cin >> S;

  int count = 0;
  for (int i = 0; i < 1000; i++) {
    ostringstream sout;
    sout << setfill('0') << setw(3) << i;
    string pin = sout.str();
    int j = 0;
    while (j < N) {
      if (pin[0] == S[j]) {
        j++;
        while (j < N) {
          if (pin[1] == S[j]) {
            j++;
            while (j < N) {
              if (pin[2] == S[j]) {
                count++;
                j = N;
              }
              j++;
            }
          }
          j++;
        }
      }
      j++;
    }
  }

  cout << count << endl;

  return 0;
}


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

int main(){
  int N; int M;cin>>N>>M;
  int homework[M];
  for(int i=0;i<M;i++){
      int k;cin>>k;
      homework[i]=k;
  }  
  int sum=0;
  for(int i=0;i<M;i++){
      sum+=homework[i];
  }
  if(sum>N){
      cout<<-1<<endl;
      return 0;
  }
  cout<<N-sum<<endl;
}

Measured memory_bytes: 3664
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

int main()
{
        long long int N, D;
        cin >> N >> D;

        long long int DD = D * 2 + 1;
        long long int NN = N / DD;
        if(N % DD != 0) NN++;

        cout << NN << endl;

        return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pi 3.141592653589793238
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MOD 1000000007
int main(){
	fast;
	double n,d,a,b;
	cin>>n>>d;
	double ans=0;
	while(n--)
	{
		cin>>a>>b;
		if(sqrt(a*a+b*b)<=d)
			ans++;
	}
	cout<<ans;
	return 0;
}



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

///Author:Refat(BSMRSTU)///

#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define vi vector<int>
#define pii pair<int,int>
#define pil pair<int,ll>
const int N = 1e5 + 5;
const int M = 1e9 + 7;
const double pi=2*acos(0.0);
const double esp=1e-9;
int Set(int N,int pos) {
    return N=N | (1<<pos);
}
int reset(int N,int pos) {
    return N= N & ~(1<<pos);
}
bool check(int N,int pos) {
    return (bool)(N & (1<<pos));
}
int main() {
    /// freopen("input.txt","r",stdin);
    /// freopen("output.txt","w",stdout);
    int test=1;
    ///scanf("%d",&test);
    for(int cs=1; cs<=test; cs++) {
       int n,m;
       scanf("%d %d",&n,&m);
       if((n>=1&&n<=9)&&(m>=1&&m<=9)){
        printf("%d\n",n*m);
       }
       else{
        printf("-1\n");
       }
    }
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
struct FastIO {FastIO() { cin.tie(0); ios::sync_with_stdio(0); }}fastiofastio;
#ifdef DEBUG_ 
#include "../program_contest_library/memo/dump.hpp"
#else
#define dump(...)
#endif
const ll INF = 1LL<<60;

int main(void) {
    ll h, w, n;
    cin >> h >> w >> n;
    vector<string> s(h);
    REP(i, h) cin >> s[i];

    ll cnt = 1;
    vector<vector<ll>> ans(h, vector<ll>(w, -1));
    REP(i, h) {
        bool first = true, exist = false;
        REP(j, w) {
            if(s[i][j] == '#') {
                if(!first) cnt++;
                first = false;
                exist = true;
            }
            ans[i][j] = cnt;
        }
        if(!exist) {
            REP(j, w) ans[i][j] = -1;
        } else {
            cnt++;
        }
    }

    FOR(i, 1, h) {
        if(ans[i][0] == -1) {
            REP(j, w) {
                ans[i][j] = ans[i-1][j];
            }
        }
    }

    for(ll i=h-2; i>=0; --i) {
        if(ans[i][0] == -1) {
            REP(j, w) {
                ans[i][j] = ans[i+1][j];
            }
        }
    }

    REP(i, h) {
        REP(j, w) cout << ans[i][j] << (j==w-1?'\n':' ');
    }
    cout << flush;

    return 0;
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
 
#define array_sort_asc(array,size) sort(array, array+size);
#define array_sort_desc(array,size) sort(array, array+size,greater<>());
 
int main() {
    // input
    int n, d;
    cin >> n >> d;
 
    // logic
    int watchar = (n + ((d * 2) + 1) -1) / ((d * 2) + 1);

    cout << watchar << endl;
}

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

inline int read(){
	re int ans = 0;re bool f = 1;re char ch = getchar();
	while(ch<'0'||ch>'9'){if (ch=='-')f = 0;ch = getchar();}
	while(ch>='0'&&ch<='9'){
		ans = (ans<<3)+(ans<<1)+(ch^48);
		ch = getchar();
	}
	return f?ans:~(ans-1);
}
int num[2048];
signed main(void){
	int n,m,p,cnt = 0;double sum;
	n = read();m = read();
	for(re int i=1;i<=n;++i){
		num[i]=read();
		sum+=num[i];
	}
	p = ceil(sum/(m*4.0));
	for(re int i=1;i<=n;++i){
		if(num[i]>=p)cnt++;
		if(cnt==m){
			printf("Yes\n");
			return 0;
		}
	}
	printf("No\n");
	return 0;
}

Measured memory_bytes: 256
n,x = map(int,input().split())
l_lis = list(map(int,input().split()))
l_sum = [0]
i = 0
for l in l_lis:
  i += l
  l_sum.append(i)
  
for i in range(n+1):
  if x < l_sum[i]:
    print(i)
    break
else:
  print(n+1)
  





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


void solve(long long X){
    long long ans=100,tot=0;
    while(ans<X)
    {
        ans=ans+ans/100;
        tot++;
    }
    cout<<tot<<endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long X;
    scanf("%lld",&X);
    solve(X);
    return 0;
}


Measured memory_bytes: 3764
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <cmath>
#include <map>

int main(void) {

	long long a, b, c, k;

	std::cin >> a >> b >> c >> k;

	if (a < b) {
		std::swap(a, b);
	}

	if (b < c) {
		std::swap(b, c);
	}

	if (a < b) {
		std::swap(a, b);
	}

	for (size_t i = 0; i < k; i++) {
		a *= 2;
	}

	std::cout << a + b + c << std::endl;

	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S[3];
    rep(i, 3) cin >> S[i];
    stack<char> st[3];
    rep(i, 3) {
        RREP(j, (int)S[i].length() - 1, 0) {
            st[i].push(S[i][j]);
        }
    }
    char state = 'a';
    while(st[state - 'a'].size()) {
        char prev = state;
        state = st[prev - 'a'].top(); 
        st[prev - 'a'].pop();
        //cout << state << " " << st[0].size() << " " << st[1].size() << " " << st[2].size() << endl;
    }
    cout << (char)(state + ('A' - 'a')) << endl;

    return 0;
}


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

def get_sum(n):
    ans = 0
    while True:
        ans += n % 10
        if n // 10 > 0:
            n = n // 10
        else:
            break
    return ans

total = 0
for i in range(1, N + 1):
    ans = get_sum(i)
    if A <= ans <= B:
        total += i
print(total)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <vector>
#include <cmath>
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP2(i, m, n) for (int i = (m); i < (int)(n); ++i)
#define REPR(i, n) for (int i = (n)-1; i >= 0; --i)
#define REPR2(i, m, n) for (int i = (n)-1; i >= (m); --i)
#define REPx(x, a) for(auto x : a)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define SORTR(a) sort(ALL(a), greater<int>())
#define REVERSE(a) reverse(ALL(a))
#define bit_search(bit, n) REP(bit, 1<<(n))
#define bit_check(bit, i) (bit>>(i)) & 1
#define setpre(n) fixed << setprecision((n))
#define UNIQUE(a) do {SORT(a); (a).erase(unique(ALL(a)), (a).end());} while(0)
#define MAX(a) *max_element(ALL(a))
#define MIN(a) *min_element(ALL(a))
#define bisect_left(a, x) lower_bound(ALL(a), (x)) - a.begin()
#define bisect_right(a, x) upper_bound(ALL(a), (x)) - a.begin()
#define INPUT(a) REP(i, a.size()) cin >> a[i];
#define INPUTP(a) REP(i, a.size()) cin >> a[i].first >> a[i].second;
#define ENDL cout << endl;
using namespace std;
using LL = long long;
using LD = long double;
using PII = pair<int, int>;
using VPII = vector<PII>;
using PLL = pair<LL, LL>;
using VPLL = vector<PLL>;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VC = vector<char>;
using VS = vector<string>;
using VB = vector<bool>;
const int INF = 1e9;
const LL MOD = 1e9 + 7;

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

vector<VB> check(202, VB(202, false));
VVI G(202, VI());

bool dfs(auto now, auto n, int v)
{
  static VI color(v, -1);
  if (now == 0) color[now] = 0;
  REPx(x, G[now])
  {
    if (color[x] != -1)
    {
      if (abs(color[now]-color[x]) != 1 && abs(color[now]-color[x]) != n-1) return false;
      continue;
    }
    color[x] = (color[now] + 1) % n;
    if (!dfs(x, n, v)) return false;
  }
  return true;
}

void warshall_floyd(VVI &GG)
{
  int V = GG.size();
  REP(i, V) GG[i][i] = 0;
  REP(k, V) REP(i, V) REP(j, V) chmin(GG[i][j], GG[i][k] + GG[k][j]);
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  VVI GG(n, VI(n));
  REP(i, n) REP(j, n)
  {
    char s;
    cin >> s;
    GG[i][j] = s - '0' ? 1 : INF;
    if (check[i][j] || check[j][i]) continue;
    if (s == '1')
    {
      G[i].emplace_back(j);
      G[j].emplace_back(i);
      check[i][j] = true;
    }
  }
  int ans = -1;
  if (dfs(0, 2, n))
  {
    warshall_floyd(GG);
    REP(i, n) chmax(ans, MAX(GG[i]));
    ans++;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int n; cin >> n;
    long a[55]; for(int i=0; i < n; ++i) cin >> a[i];

    long cnt = 0, idx = 0, tmp = 0;
    for(int i=0; i < n; ++i) {
        if(tmp < abs(a[i])) {
            tmp = abs(a[i]);
            idx = i;
        }
    }

    vector<pair<int, int>> ans;

    if(a[idx] >= 0) {
        for(int i=0; i < n-1; ++i) {
            if(a[i] > a[i+1]) {
                a[i+1] += a[idx];
                ans.emplace_back(idx+1, i+2);
                if(a[i] > a[i+1]) {
                    a[i+1] += a[idx];
                    ans.emplace_back(idx+1, i+2);
                }

                if(a[i+1] > a[idx]) idx = i+1;
            }
        }
    } else {
        for(int i=n-1; i > 0; --i) {
            if(a[i-1] > a[i]) {
                a[i-1] += a[idx];
                ans.emplace_back(idx+1, i);
                if(a[i-1] > a[i]) {
                    a[i-1] += a[idx];
                    ans.emplace_back(idx+1, i);
                }
                if(a[i-1] < a[idx]) idx = i-1;
            }
        }
    }

    cout << ans.size() << '\n';
    for(auto p : ans) cout << p.first << " " << p.second << '\n';
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const double pi = acos(-1);

int main() {
    ll n;
    cin >> n;

    ll ma = 0;
    ll mi = n;
    vl a(n);
    rep(i, n) {
        cin >> a[i];
        chmax(ma, a[i]);
        chmin(mi, a[i]);
    }

    if(ma - mi >= 2) {
        out("No");
        re0;
    }

    if(ma == mi) {
        if(ma == n-1) {
            out("Yes");
        }
        else if(2*ma <= n) {
            out("Yes");
        }
        else {
            out("No");
        }
        re0;
    }

    // 以下、ma - mi = 1
    ll cntmi = 0;
    rep(i, n) {
        if(a[i] == mi) {
            cntmi++;
        }
    }
    
    if(cntmi < ma && 2*(ma - cntmi) <= n - cntmi) {
        out("Yes");
    }
    else {
        out("No");
    }

    re0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int a[100010];
int main(){
    int n, m;
    while(cin>>n>>m){
        if(n<=9 && m<=9){
            cout<<n*m<<endl;
        }
        else{
            cout<<-1<<endl;
        }

    }
  return 0;
}




Measured memory_bytes: 256
s = list(input())
a = 200000
z = 0
# a>i , z<i　を加える事で1文字目にZが来ることと最後の文字にAが来ることを除外している。と思われる。
for i in range(len(s)):
    if s[i] == "A" and a>i:
        a = i
    elif s[i] == "Z" and z<i:
        z = i
print(z - a + 1)

Measured memory_bytes: 4840
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const ll MOD = ll(1e9) + 7;

int main() {
  ll n;
  ll a;
  ll wa = 0;
  ll seki = 0;
  cin >> n;
  rep(i, n) {
    cin >> a;
    wa = (wa + a) % MOD;
    seki = (seki + a * a) % MOD;
  }
  ll ans = (wa * wa - seki + MOD) % MOD;
  if (ans % 2 == 0) {
    ans /= 2;
  } else {
    ans = (ans + MOD) / 2;
  }
  cout << ans << endl;

  return 0;
}

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

using ll = long long;
using ull = unsigned long long;
using st = string;
using db = double;
using vll = vector<long long>;
using vdb = vector<db>;
using vvll = vector<vll>;
using vst = vector<st>;
using vchar = vector<char>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
#define rep(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define vrep(i, vec) for(auto& i : vec)
#define vin(vec) for(auto& i : vec) cin >> i
#define all(v) v.begin(), v.end()
template<class T> inline bool chmin(T& a, T b){if(a > b){a = b;return true;} return false;}
template<class T> inline bool chmax(T& a, T b){if(a < b){a = b;return true;} return false;}
const ll mod = 1000000007;
const ll inf = 1LL << 60;

int main() {
  ll n, m;
  cin >> n >> m;
  vll a(n);
  vin(a);
  vpll chn(m);
  rep(i, 0, m){
    ll b, c;
    cin >> c >> b;
    chn.at(i) = make_pair(b, c);
  }

  sort(all(a));
  sort(all(chn), greater<pll>());
  ll now = 0;
  vrep(i, chn){
    ll value = i.first, j = i.second;
    while(j > 0){
      if(now < n && a.at(now) < value){
        a.at(now) = value;
        j--;
        now++;
      }
      else goto out;
    } 
  }
  out:
  cout << accumulate(all(a), 0ll) << endl;
}

Measured memory_bytes: 2560
#include <stdio.h>
#include <math.h>
int main() {
	int n,i;
	long a;
	long ret = 0;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &a);
		while (a % 2 == 0) {
			ret++;
			a = a / 2;
		}
	}
	printf("%ld", ret);
	return 0;
}


Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClassLibrary1
{
    public class ListNode
    {
        public int val;
        public ListNode next;
        public ListNode(int x) { val = x; }
    }


    public class Class1
    {
        static int[][] mtx ;
        static List<int>[] tm;
        static int n;
        static int[] results;
        static List<string> cons = new List<string>();
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] s1 = Console.ReadLine().Split(' ');
            string[] s2 = Console.ReadLine().Split(' ');
            string[] s3 = Console.ReadLine().Split(' ');

            int[] n1 = new int[n];
            int[] n2 = new int[n];
            int[] n3 = new int[n];

            for(int i=0;i<n;i++)
            {
                n1[i] = int.Parse(s1[i]);
                n2[i] = int.Parse(s2[i]);
            }
            for (int i = 0; i < n-1; i++)
            {
                n3[i] = int.Parse(s3[i]);
            }

            var score = 0;

            int prev = -1;
            for (int i = 0; i < n; i++)
            {
                int cur = n1[i];
                score += n2[cur-1];
                if( cur == prev + 1 )
                {
                    score += n3[prev-1];
                }
                prev = cur;
            }

            Console.WriteLine(score);
        }

 

    }

}

Measured memory_bytes: 11092
#![allow(
    non_snake_case,
    unused_variables,
    unused_assignments,
    unused_mut,
    dead_code
)]
use proconio::input;
//use proconio::marker::Usize1;
//use proconio::marker::Chars;
//use std::collections::HashSet;
use std::cmp::*;
fn main() {
    input! {
        a:u64, b:u64,n:u64
    }
    let mut ans = 0;
    if b <= n {
        // x=b-1のケース
        ans = a * (b - 1) / b;
    } else {
        // x=nのケース
        ans = a * n / b;
    }
    println!("{}", ans);
}


Measured memory_bytes: 2060
//dlang template---{{{
import std.stdio;
import std.conv;
import std.string;
import std.array;
import std.algorithm;
import std.typecons;
import std.math;
import std.range;

// MIT-License https://github.com/kurokoji/nephele
class Scanner
{
  import std.stdio : File, stdin;
  import std.conv : to;
  import std.array : split;
  import std.string;
  import std.traits : isSomeString;

  private File file;
  private char[][] str;
  private size_t idx;

  this(File file = stdin)
  {
    this.file = file;
    this.idx = 0;
  }

  this(StrType)(StrType s, File file = stdin) if (isSomeString!(StrType))
  {
    this.file = file;
    this.idx = 0;
    fromString(s);
  }

  private char[] next()
  {
    if (idx < str.length)
    {
      return str[idx++];
    }

    char[] s;
    while (s.length == 0)
    {
      s = file.readln.strip.to!(char[]);
    }

    str = s.split;
    idx = 0;

    return str[idx++];
  }

  T next(T)()
  {
    return next.to!(T);
  }

  T[] nextArray(T)(size_t len)
  {
    T[] ret = new T[len];

    foreach (ref c; ret)
    {
      c = next!(T);
    }

    return ret;
  }

  void scan()()
  {
  }

  void scan(T, S...)(ref T x, ref S args)
  {
    x = next!(T);
    scan(args);
  }

  void fromString(StrType)(StrType s) if (isSomeString!(StrType))
  {
    str ~= s.to!(char[]).strip.split;
  }
}

//Digit count---{{{
int DigitNum(int num) {
  int digit = 0;

  while (num != 0) {
    num /= 10;
    digit++;
  }

  return digit;
}
//}}}
//}}}

void main() {
  Scanner sc = new Scanner;

  double res = 0;
  int N;
  sc.scan(N);
  double[] x = new double[N];
  string[] u = new string[N];

  foreach (i; 0 .. N)
    sc.scan(x[i], u[i]);

  foreach (i; 0 .. N) {
    if (u[i] == "JPY") {
      res += x[i];
    } else if (u[i] == "BTC") {
      res += x[i] * 380000.0;
    }
  }

  writeln(res);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll; // [9,223,372,036,854,775,807 to -9.....808] 19 digits
typedef long double ld;
#define inc(i, a, b) for (long long int i = a; i <= b; i++)
#define dec(i, a, b) for (long long int i = a; i >= b; i--)
#define fast                      \
    ios_base::sync_with_stdio(0); \
    cin.tie(NULL);                \
    cout.tie(NULL);
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define lv vector<ll>
#define cv vector<char>
#define dv vector<ld>
#define rall(c) (c).rbegin(), (c).rend()
#define lpr pair<ll, ll>
#define mp make_pair
#define cin(c) \
    ll c;      \
    cin >> c;
#define lmap unordered_map<ll, ll>
#define vinp(a, n) \
    inc(i, 1, n)   \
    {              \
        cin(k);    \
        a.pb(k);   \
    }
#define LIM 1000000007
#define F first
#define S second
#define fr(i, n) inc(i, 0, n - 1)
#define fri(n, a) \
    inc(i, 0, n - 1) { cin >> a[i]; }
#define debug(p) cout << p;
#define umap unordered_map
#define uset unordered_set
#define fill(a, val, n) \
    inc(i, 0, n - 1) { a[i] = val; }
void i_love_Accepted()
{
    ll n,m,k;
    cin>>n>>m>>k;
    vector<cv> ar(n, cv(m));
    ll ans=0;
    fr(i,n)
    {
        fr(j,m)
        cin>>ar[i][j];
    }
    fr(i,(1<<n))
    {
        fr(j,(1<<m))
        {
            ll cnt=0;
            fr(x,n)
            {
                fr(y,m)
                {
                    if(i&(1<<x) || j&(1<<y))
                        continue;
                    if(ar[x][y]=='#')
                        cnt++;
                }
            }
            if(cnt==k)
                ans++;
        }
    }
    cout<<ans;
}   
int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fast;
    ll t=1;
    //cin>>t;
    while(t--)
    {
        i_love_Accepted();
        cout<<"\n";
    } 
}


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

#define rep(i, n) for(int i = 0; i < n; ++i)
#define rep2(i, a, b) for(int i = a; i <= b; ++i)
#define ll long long
#define eb emplace_back
#define all(c) (c).begin(), (c).end()
#define vi vector<int>
#define N 500010
#define MOD 1000000007

int main() {
	int n, q;
	int t, p, l, r;
	ll x;
	fenwick_tree<ll> fw(N);
	cin >> n >> q;
	rep(i, n) {
		cin >> x;
		fw.add(i, x);
	}
	rep(i,q) {
		cin >> t;
		if (t == 0) {
			cin >> p >> x;
			fw.add(p, x);
		}
		else {
			cin >> l >> r;
			cout << fw.sum(l, r) << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 8204
#include <bits/stdc++.h>
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define compress(v) sort(all(v)), v.erase(unique(all(v)), v.end())
using namespace std;

typedef long long ll;
typedef pair<ll, ll> p;

int n, m;
int a[202020], b[202020];

ll tree[1 << 19];
const int sz = 1 << 18;
void update(int x, ll v){
    x |= sz; tree[x] = v;
    while(x >>= 1) tree[x] = min(tree[x << 1], tree[x << 1 | 1]);
}
ll query(int l, int r){
    l |= sz; r |= sz; ll ret = 1e18;
    while(l <= r){
        if(l & 1) ret = min(ret, tree[l++]);
        if(~r & 1) ret = min(ret, tree[r--]);
        l >>= 1; r >>= 1;
    }
    return ret;
}

ll tree2[1 << 19];
void update2(int x, ll v){
    v -= x;
    x |= sz; tree2[x] = v;
    while(x >>= 1) tree2[x] = min(tree2[x << 1], tree2[x << 1 | 1]);
}
ll query2(int l, int r){
    l |= sz; r |= sz; ll ret = 1e18;
    while(l <= r){
        if(l & 1) ret = min(ret, tree2[l++]);
        if(~r & 1) ret = min(ret, tree2[r--]);
        l >>= 1; r >>= 1;
    }
    return ret;
}

int main(){
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
    memset(tree, 0x3f, sizeof tree);
    memset(tree2, 0x3f, sizeof tree2);
    cin >> n >> m;
    set<p> st;
    for(int i=1; i<=m; i++){
        st.emplace(i, 0); update(i, 0); update2(i, 0);
    }
    
    for(int i=1; i<=n; i++){
        cin >> a[i] >> b[i];
        if(query(1, m) >= 1e9){ cout << "-1\n"; continue; }
        
        ll mn = query2(1, b[i]+1) + b[i]+1;
        
        auto it = st.lower_bound(p(a[i], -1));
        
        while(it != st.end()){
            if(it->x > b[i]+1) break;
            update(it->x, 1e18);
            update2(it->x, 1e18);
            it = st.erase(it);
        }
        if(b[i]+1 <= m){
            st.emplace(b[i]+1, mn);
            update(b[i]+1, mn); update2(b[i]+1, mn);
        }
        
        ll res = query(1, m);
        if(res >= 1e9) cout << "-1\n";
        else cout << res+i << "\n";
    }
}

Measured memory_bytes: 25872
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int Q = sc.nextInt();
		int N = 100_001;
		boolean[] prime = new boolean[N+1];
		Arrays.fill(prime, true);
		prime[0] = prime[1] = false;
		for(int x = 4; x <= N; x+=2)
			prime[x] = false;
		for(int i = 3; i <= Math.sqrt(N); i+=2)
			if(prime[i])
				for(int x = i * 2; x <= N; x+=i)
					prime[x] = false;
		int[] S = new int[N];
		for(int i = 1; i < N; i++) {
			S[i] = S[i-1];
			if(i % 2 != 0 && prime[i] && prime[(i+1)/2])
				S[i]++;
		}
		for(int q = 0; q < Q; q++) {
			int l = sc.nextInt();
			int r = sc.nextInt();
			System.out.println(S[r] - S[l-1]);
		}
	}

}

Measured memory_bytes: 68112
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=5e5+7;
int n,m,fa[N],cnt=0;
int a[N],b[N],c[N],d[N];
inline int read() {
   int s=0,w=1;
   char ch=getchar();
   while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
   while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
   return s*w;
}
inline int find(int x) {return fa[x]==x?x:fa[x]=find(fa[x]); }
inline void unionn(int x,int y) {fa[find(x)]=find(y); }
map<int,int> p;
signed main() {
    n=read();
    for (int i=1;i<=n;i++) {
        a[i]=c[i]=read();
        a[n+1]^=a[i];
    }
    c[n+1]=a[n+1];
 
    for (int i=1;i<=n;i++) {
        b[i]=d[i]=read();
        b[n+1]^=b[i];
    }
    d[n+1]=b[n+1];
 
    sort(c+1,c+n+2); sort(d+1,d+n+2);
    bool flag=false;
    for (int i=1;i<=n+1;i++) {
        if (c[i]!=d[i]) {
            flag=true;
            break;
        }
    }
 
    if (flag) {printf("-1\n"); return 0;}
    int ans=0;
    for (int i=1;i<=n+1;i++) {
        if (a[i]!=b[i] || i==n+1) {
            if (i<=n) ans++;
            if (!p[a[i]]) p[a[i]]=++cnt;
            if (!p[b[i]]) p[b[i]]=++cnt;
        }
    }
    if (ans==0) {
        printf("0\n");
        return 0;
    }
    for (int i=1;i<=cnt;i++) fa[i]=i;
    for (int i=1;i<=n;i++) {
        if (a[i]!=b[i]) {
            unionn(p[a[i]],p[b[i]]);
        }
    }
    for (int i=1;i<=cnt;i++) {
        if (fa[i]==i) ans++;
    }
    printf("%d\n",ans-1);
    return 0;
}

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

int main(){
  string str;
  cin>>str;
  int a,b,c,d,t;
  t=stoi(str);
  a=t/1000;t-=a*1000;
  b=t/100;t-=b*100;
  c=t/10;t-=c*10;
  d=t;
  
  vector<int> B={1,1,1,1,-1,-1,-1,-1};
  vector<int> C={1,1,-1,-1,1,1,-1,-1};
  vector<int> D={1,-1,1,-1,1,-1,1,-1};
  for(int i=0;i<8;i++){
    int tmp=a+b*B.at(i)+c*C.at(i)+d*D.at(i);
    if(tmp==7){
      cout<<a;
      cout<<(B.at(i)==1?'+':'-');
      cout<<b;
      cout<<(C.at(i)==1?'+':'-');
      cout<<c;
      cout<<(D.at(i)==1?'+':'-');
      cout<<d;
      cout<<"=7"<<endl;
      break;
    }
  }
}


Measured memory_bytes: 3596
#include <iostream>
using namespace std;

int main() {
	long int x,y; int f=0;
	cin>>x>>y;
	
	if(y > 4*x) cout<<"No";
	else if(y < 2*x) cout<<"No";
	else{
	    if(y==4*x or y==2*x) cout<<"Yes";
	    else{
	        while(y>4){
	            y-=4;
	            x--;
	            if(x*2 == y){
	                f=1;
	                break;
	            }
	        }
	        if(x*2 == y)
	        f=1;
	        
	        if(f) cout<<"Yes";
	        else cout<<"No";
	    }
	}
	
	return 0;
}


Measured memory_bytes: 3100
import java.io.BufferedReader;
import java.io.InputStreamReader;
 
class Main {
    public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        String str = br.readLine();
        int i = 0;
        while (!str.equals("0")){
            i++;
            sb.append("Case ").append(i).append(": ").append(str).append("\n");
            str = br.readLine();
        }
        System.out.print(sb.toString());
    }
}

Measured memory_bytes: 30156
#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
#include<queue>
#include<cmath>
#include<cstdlib>
#define LL long long
#define LD long double
using namespace std;
const int NN=200 +117;
const int MM=200 +117;
int read(){
	int fl=1,x;char c;
	for(c=getchar();(c<'0'||c>'9')&&c!='-';c=getchar());
	if(c=='-'){fl=-1;c=getchar();}
	for(x=0;c>='0'&&c<='9';c=getchar())
		x=(x<<3)+(x<<1)+c-'0';
	return x*fl;
}
void open(){
	freopen("a.in","r",stdin);
	//freopen("a.out","w",stdout);
}
void close(){
	fclose(stdin);
	fclose(stdout);
}


int m,n;
int a[2*NN]={};
int use[2*NN]={};
const int mod=1e9+7;
LL dp[2][2*NN][2*NN]={};
void upd(LL &x,LL y){
	x=(x+y)%mod;
}
int main(){
	//open();
	n=read();
	dp[0][0][0]=1;
	for(int i=1;i<=2*n;++i){
		a[i]=read();
		if(a[i]!=-1){
			a[i]=2*n+1-a[i];
			use[a[i]]=1;
		}
	}
	int emp=0;
	for(int i=1;i<=n;++i){
		if(a[2*i-1]!=-1&&a[2*i]!=-1){
			use[a[2*i-1]]=2;
			use[a[2*i]]=2;
		}
		if(a[2*i-1]==-1&&a[2*i]==-1)++emp;
	}
	int now=0;
	int u1=0,u0=0;
	for(int x=2*n;x>=1;--x){
		if(use[x]==2)continue;
		now^=1;
		for(int i=0;i<=2*n;++i){
			for(int j=0;j<=2*n;++j){
				dp[now][i][j]=0;
			}
		}
		if(use[x]==1){//dp[x][i][j] used >=x,need i small to make pair,have j big to make pair
			++u1;
			for(int i=0;i<=2*n;++i){
				for(int j=0;j<=2*n;++j){
					if(j)upd(dp[now][i][j-1],j*dp[now^1][i][j]);//use a big one
					upd(dp[now][i+1][j],dp[now^1][i][j]);//request a small one
				}
			}
		}
		if(use[x]==0){
			for(int i=0;i<=2*n;++i){
				for(int j=0;j<=2*n;++j){
					int up=(i-j-u1+u0);
					upd(dp[now][i][j+1],dp[now^1][i][j]);//save a big one
					if(i)upd(dp[now][i-1][j],dp[now^1][i][j]);//respond a request
					if(up<0||(up&1))continue;
					if(emp-up/2>0)upd(dp[now][i+1][j],(emp-up/2)*dp[now^1][i][j]);//use a empty pair,cause a request
				}
			}
			++u0;
		}
	}
	printf("%lld\n",dp[now][0][0]);

	close();
	return 0;
}

Measured memory_bytes: 6528
//
// Created by rajshah9914 on 05/04/20.
//

#include<bits/stdc++.h>
using namespace std;
int main()
{
    unsigned long long k;
    cin>>k;
    queue<unsigned long long>q;
    for(unsigned long long i=1;i<=9;i++)
        q.push(i);
    unsigned long long c=0;
    if(k<=9)
        cout<<k<<endl;
    else
    {
        while(1)
        {
            unsigned long long top=q.front();
            q.pop();
            c++;
            if(c==k)
            {
                cout<<top<<endl;
                break;
            }
            if(top%10!=0)
            q.push(top*10+top%10-1);
            q.push(top*10+top%10);
            if(top%10!=9)
            q.push(top*10+top%10+1);
        }
    }
}

Measured memory_bytes: 1792
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_nl = lambda: list(map(int, readline().split()))
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    N = in_n()
    A = in_nl()

    ans = 0
    for a in A:
        while a:
            if a % 2 == 0:
                a //= 2
                ans += 1
            else:
                break

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9804
program abc043c
  implicit none
  integer :: n, i, t, ans = 10000000
  integer,allocatable :: a(:)
  read *, n
  allocate(a(n))
  read *, a
  do i = -100,100
     t = sum(abs(a-i)**2)
     if (t < ans) ans = t;
  end do
  print *, ans
end program abc043c


Measured memory_bytes: 256
// acdart
#include <iostream>
#include <cstring>
#include <algorithm>
#include <stdio.h>
#include <cstring>
#include <cmath>
#include <cctype>
#include <string>
#include <numeric>
#include <utility>
#include <queue>
#include <memory>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <cstdlib>
#include <list>
#include <limits.h>
#include <utility>
#include <functional>
#include <iterator>
#include <deque>
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define X first
#define Y second
#define F first
#define S second
#define MOD9 1000000009ll
#define MOD7 1000000007ll
#define MOD
#define INF  1023456789ll
#define INF16 10000000000000000ll
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define SZ(x) ((int)(x).size())
#define MAXN 10010
#define MAXM
#define ALL(x) ((x).begin()),((x).end())
#define RESET(a,b) memset(a,b, sizeof a)
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define LEN(X) strlen(X)
#define FI(a,b,c) for(int a=b; a<c; a++)
#define FD(a,b,c) for(int a=b; a>c; a--)
using namespace std;
typedef long long ll;
typedef long long LL;
typedef double db;
typedef double D;
typedef long double ld;
typedef long double LD;
/*********default*********/
// #define ONLINE_JUDGE
#define inf 0x3f3f3f3f
#define mod
#define maxm
#define maxn

int main()
{/*
	#ifdef ONLINE_JUDGE
    	freopen("aplusb.in", "r", stdin);
    	freopen("aplusb.out", "w", stdout);
	#endif*/
	// ios::sync_with_stdio(false);
	int x, y, z;
	
	scanf("%d%d%d", &x, &y, &z);
	printf("%d\n", x ^ y ^ z);
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;
 
public class Main {
 
	void submit() {
	    int N = nextInt();
	    char[] A = nextString().toCharArray();
	    char[] B = nextString().toCharArray();
	    char[] C = nextString().toCharArray();
	    
	    int total_change = 0;
	    
	    for(int i=0; i<N; i++){
	        if(A[i] != B[i] && B[i] != C[i] && C[i] != A[i] ){
	            total_change+=2;	            
	        }else if(A[i] != B[i] || B[i] != C[i] ||  C[i] != A[i]){
	            total_change++;	            
	        }
	    }

        out.println(total_change);
	}

	void preCalc() {
 
	}
 
	void stress() {
 
	}
 
	void test() {
 
	}
 
	Main() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		preCalc();
		submit();
		//stress();
		//test();
		out.close();
	}
 
	static final Random rng = new Random();
 
	static int rand(int l, int r) {
		return l + rng.nextInt(r - l + 1);
	}
 
	public static void main(String[] args) throws IOException {
		new Main();
	}
 
	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
 
	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}
 
	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}
 
	int nextInt() {
		return Integer.parseInt(nextToken());
	}
 
	long nextLong() {
		return Long.parseLong(nextToken());
	}
 
	double nextDouble() {
		return Double.parseDouble(nextToken());
	}
}

Measured memory_bytes: 21076
/* 
 * Author: aps
 * Time: 2020-06-22 17:41:51
**/
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
 
#define fi first
#define se second
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
 
using namespace __gnu_pbds;
using namespace std;

template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
 
const ll inf = 1e18;
const ll mod = 1e9+7;
 
inline ll add(ll x, ll y) { x += y; if (x >= mod) x -= mod; return x;}
inline ll sub(ll x, ll y) { x -= y; if (x < 0) x += mod; return x;}
inline ll mul(ll x, ll y) { return ((x % mod) * (y % mod)) % mod;}
inline ll gcd(ll x, ll y) { return x == 0 ? y : gcd(y % x, x); }
inline ll power(ll a, ll b) {
    ll x = 1;
    while (b) {
        if (b & 1) x = mul(x, a);
        a = mul(a, a);
        b >>= 1;
    }
    return x;
}
inline ll inv(ll a) { return power(a, mod - 2);}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main(){
    ios_base::sync_with_stdio(false); cin.tie(0);
    ll n; cin >> n;
    string ans = "";
    while(n) {
        n--;
        ans += char(n%26 + 'a');
        n /= 26;
    }
    reverse(begin(ans), end(ans));
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 3656
#include<iostream>
    using namespace std;
    int main()
    { int A,B,C,D;
     cin>>A;
     cin>>B;
     cin>>C;
     cin>>D;
     if(A>=B){if(C>=D){cout<<B+D<<endl;}
             else{cout<<B+C<<endl;}}
     else{if(C>=D){cout<<A+D<<endl;}
             else{cout<<A+C<<endl;}}
        
        return 0;
    }

Measured memory_bytes: 256
#include<iostream>
#include<cstdlib>
using namespace std;
#define ll long long 
int main()
{
    ll int x, y, n, i, ans, d;
    cin >> n;
    ans = n;
    for(i = 1; i * i <= n; i++)
    {
        if(n%i == 0)
        {
            x = i;
            y = n/i;
            d = x + y - 2;
            if(d < ans)
            ans = d;
        }
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 3656
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,m,k,a,b,c;
vector<ll> node,lazy,v;
void ini(ll n){
    m=1;
    while(m<n)m*=2;
    node.resize(2*m-1,0);
    lazy.resize(2*m-1,0);
    return ;
}
void eval(ll k,ll l,ll r){
    if(lazy[k]!=0){
        node[k]+=lazy[k];
        if(r-l>1){
            lazy[2*k+1]+=lazy[k]/2;
            lazy[2*k+2]+=lazy[k]/2;
        }
        lazy[k]=0;
    }
    return ;
}
void add(ll a,ll b,ll x,ll k,ll l,ll r){
    eval(k,l,r);
    if(r<=a||b<=l)return ;
    if(a<=l&&r<=b){
        lazy[k]=(r-l)*x;
        eval(k,l,r);
    }
    else{
        add(a,b,x,2*k+1,l,(r+l)/2);
        add(a,b,x,2*k+2,(r+l)/2,r);
        node[k]=node[2*k+1]+node[2*k+2];
    }
    return ;
}
ll getsum(ll a,ll b,ll k,ll l,ll r){
    if(a>=r||l>=b)return 0;
    eval(k,l,r);
    if(a<=l&&r<=b)return node[k];
    ll vl=getsum(a,b,2*k+1,l,(r+l)/2);
    ll vr=getsum(a,b,2*k+2,(r+l)/2,r);
    return vr+vl;
}
int main(void){
    cin>>n>>k;
    ini(n);
    for(int i=0;i<k;i++){
        cin>>a;
        if(a==0){
            cin>>a>>b>>c;
            a--,b--;
            add(a,b+1,c,0,0,m);
        }
        else{
            cin>>a>>b;
            a--,b--;
            cout<<getsum(a,b+1,0,0,m)<<endl;;
        }
        //for(int i=0;i<2*m-1;i++)cout<<node[i]<<"-"<<lazy[i]<<" ";
        //cout<<endl;
    }
}



Measured memory_bytes: 7068
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>

#define int long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define LOWER_BOUND(v,a) (lower_bound((v).begin(), (v).end(), (a)))
#define UPPER_BOUND(v,a) (upper_bound((v).begin(), (v).end(), (a)))
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
using namespace std;


signed main()
{
	int N, A, B;
	cin >> N >> A >> B;
	if ((A - B) % 2 == 0)
	{
		cout << "Alice" << endl;
	}
	else
	{
		cout << "Borys" << endl;
	}
}



Measured memory_bytes: 888
#include<stdio.h>


int gcd( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd

int lcm( int m, int n ,int yaku)
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm


int main(void){

	int a,b;
	int yaku,bai;


	while(scanf("%d %d",&a,&b)!=EOF){

		yaku = gcd(a,b);
		bai = lcm(a,b,yaku);
		printf("%d %d\n",yaku,bai);

	}

	return 0;
}

Measured memory_bytes: 596