akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define int long long
using ll=long long;
using vi=vector<int>;
using pii=pair<int,int>;
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)
#define ITR(i,b,e) for(auto i=(b);i!=(e);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define SZ(c) ((int)c.size())
#define CONTAIN(c,x) (c.find(x)!=end(c))
#define OUTOFRANGE(y,x,h,w) (y<0||x<0||y>=h||x>=w)
#define dump(...)
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
#define INF (1001001001)
#define INFLL (1001001001001001001ll)
template<class T> ostream& operator << (ostream &os,const vector<T> &v) {
    ITR(i,begin(v),end(v)) os<<*i<<(i==end(v)-1?"":"\n"); return os; }
template<class T> istream& operator >> (istream &is,vector<T> &v) {
    ITR(i,begin(v),end(v)) is>>*i; return is; }
template<class T> istream& operator >> (istream &is, pair<T,T> &p) {
    is>>p.first>>p.second; return is; }
template<class T>bool chmax(T &a,const T &b) {if(a<b) {a=b;return 1;} return 0;}
template<class T>bool chmin(T &a,const T &b) {if(b<a) {a=b;return 1;} return 0;}
//------------------------------------------------------------------------------
struct before_main_function {
    before_main_function() {
        #ifdef int
            #undef INF
            #define INF INFLL
            #define stoi stoll
        #endif
        cin.tie(0);ios::sync_with_stdio(false);
        cout<<setprecision(15)<<fixed;
        #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

signed main() {
    int ans=0;
    int n;
    cin>>n;
    REP(i,n) {
        int l,r;
        cin>>l>>r;
        ans+=r-l+1;
    }
    cout<<ans<<endl;
    return 0;
}


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

using namespace std;
#define BUF (1000)
#define ll long long 


int n;

bool check(int t, int x, int y){
	int tmp = x+y;
	if(tmp<=t && tmp>=-t){
		tmp = abs(tmp);
		//cout << tmp%2 << t%2;	
		if((tmp%2) == (t%2) ){
			//cout << true;
			return true;
		}
	}
	return false;
}

int main(void){
	cin >> n;
	int ans = 1;
	int tc=0,xc=0,yc=0;
	for(int i=0;i<n;i++){
		int t,x,y;
		cin >> t >> x >> y;
		if(!check(t-tc,x-xc,y-yc))ans = 0;
		//cout << check(t-tc,x-xc,y-yc);
		tc = t;xc = x;yc = y;
	}

	if(ans == 1) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
	
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define pb push_back
#define mp make_pair
#define INF9 1000000000 //10^9
#define MOD 1000000007 //10^9+7
#define fi first
#define sc second
using ll=long long;
using pii=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout<<fixed<<setprecision(20);

    int n;cin >> n;
    vi a(n);
    rep(i,n) cin >> a[i];
    sort(RALL(a));
    int ans = 0;
    rep(i,n){
        if(i%2) ans-=a[i];
        else ans += a[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    char buf[80];
    char last[] = {'A','B','C'};
    scanf("%s", buf);
    if(strncmp(buf,last,3)==0)  printf("ARC");
    else printf("ABC");
    return 0;
}

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

def power_func(a,n,p):
    bi = str(format(n,"b"))#2進表現に
    res = 1
    for i in range(len(bi)):
        res = (res*res) %p
        if bi[i] == "1":
            res = (res*a) %p
    return res

p = 1000000007
Z = power_func(10,N,p)
print(((Z - power_func(9,N,p))*2 - Z+power_func(8,N,p))%p)

Measured memory_bytes: 9136
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define MOD 1000000007
#define MOD2 998244353
#define INF MOD
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;

int main() {
    int n;
    cin >> n;
    int ans = 0;
    rep(i,n) {
        int x;
        cin >> x;
        if (i % 2 == 0 && x % 2 == 1) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3632
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cmath>
#include<cstdio>
#include<tuple>
#include<bitset>
#include<map>

using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
#define ll long long
using lint=long long;
#define debug(output) cout<<#output<<"= "<<output<<endl
typedef pair<int,int> P;
const int inf=1000000007;
const int MOD=1000000007;
signed main(){
  string s;cin>>s;
  int d;cin>>d;
  vector<lint> dp(d+1,0);
  int rest=0;
  int n=s.length();
  rep(i,n){
      vector<lint> buf(d+1,0);
      int top=s[i]-'0';
      rep(j,10){
          rep(k,d){
              buf[(k+j)%d]+=dp[k];
              buf[(k+j)%d]%=MOD;
          }
      }
      rep(j,top){
          buf[(rest+j)%d]+=1;
          buf[(rest+j)%d]%=MOD;
      }
      rest+=top;rest%=d;
      swap(buf,dp);
  }
  if(rest==0)++dp[0];
  dp[0]+=MOD-1;
  dp[0]%=MOD;
  cout<<dp[0]<<"\n";
  return 0;
}

Measured memory_bytes: 3620
#include <iostream>
#include <cctype>

using namespace std;

int main(void){
  char c;
  cin >> c;
  char a,z;
  a = 'a';
  z = 'z';
  if(a <= c && c <= z){
    cout << "a" << endl;
  }else{
    cout << "A" << endl;
  }
  return 0;
}

Measured memory_bytes: 3556
mod = 1000000007


def fexp(x, y):
    ans = 1
    while y > 0:
        if y % 2 == 1:
            ans = ans * x % mod
        x = x * x % mod
        y //= 2
    return ans


n = int(input())
ans = fexp(10, n) - 2 * fexp(9, n) + fexp(8, n)
ans %= mod
if ans < 0:
    ans += mod
print(ans)

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


int main(){
	int letter[26]={},memo[26]={};
	int n;
	string input;
	
	for(int i=0;i<26;i++){
		letter[i]=1000;
	}
	cin >> n;
	
	for(int i=0;i<n;i++){
		cin >> input;
		for(int j=0;j<input.size();j++){
			memo[input[j]-'a']++;
		}
		for(int j=0;j<26;j++){
			letter[j]=min(letter[j],memo[j]);
			memo[j]=0;
		}
		
	}
	
	string answer={};
	for(int i=0;i<26;i++){
		for(int j=0;j<letter[i];j++){
			char a='a'+i;
			answer+=a;
		}
	}
	cout << answer << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;i++){
		int t;
		scanf("%d",&t);
		n-=t;
	}
	if(n<0)puts("-1");
	else printf("%d",n);
}


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

int main()
{
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    bool flag = true;
    while (flag)
    {
        C -= B;
        if(C <= 0){
            cout << "Yes" << endl;
            flag = false;
            break;
        }
        A -= D;
        if(A <= 0){
            cout << "No" << endl;
            flag = false;
            break;
        }
    }
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	long long n, k; cin >> n >> k;
	vector<ll>h;
	for (int i = 0; i < n; i++)
	{
		int nm;
		cin >> nm;
		h.push_back(nm);
	}
	sort(h.begin(),h.end(),greater<ll>());
	long long attac = 0;
	for (int i = 0; i < n; i++)
	{
		if (k)
		{
			h[i] = 0;
			k--;
		}
		else
			attac += h[i];
	}
	cout << attac;
}

Measured memory_bytes: 2420
// warm heart, wagging tail,and a smile just for you!
//                                                                     ███████████   
//                                                                   ███╬╬╬╬╬╬╬╬╬╬███
//                                                                ███╬╬╬╬╬████╬╬╬╬╬╬███
//                                            ███████████       ██╬╬╬╬╬████╬╬████╬╬╬╬╬██
//                                      █████████╬╬╬╬╬████████████╬╬╬╬╬██╬╬╬╬╬╬███╬╬╬╬╬██
//                               ████████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬██╬╬╬╬╬╬╬██
//                             ████╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬╬╬╬╬╬██
//                           ███╬╬╬█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬███╬╬╬╬╬╬╬█████
//                         ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬████████╬╬╬╬╬██
//                       ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬███
//                     ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬██
//                 ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬████
//     █████████████╬╬╬╬╬╬╬╬██╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬██████
//   ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬██████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████╬╬╬╬╬╬╬███████████╬╬╬╬╬╬╬╬██╬╬╬██╬╬╬██
// ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬█╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬██
// ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬▓▓▓▓▓▓╬╬╬████╬╬████╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬███
// ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬█████
// ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████
//   ███╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██
//       ██████████████  ████╬╬╬╬╬╬███████████████████████████╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████
//                         ███████                           █████  ███████████████████  
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define INF 1LL<<60
#define fs first
#define sc second
#define pb push_back
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) (a)<=(i) && (i)<(b)
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " << 
typedef pair<int,int> P;
typedef vector<vector<P> > Graph;

signed main(){
  ios::sync_with_stdio(false);
  cin.tie(0);  

  int n,k;
  cin >> n >> k;

  vector<int> a(n);
  REP(i,n) cin >> a[i];
  
  vector<int> dp(k+1,0);
  REP(i,k+1){
    bool flag = false;
    REP(j,n){
      if(i-a[j] < 0) break;
      if(dp[i-a[j]] == -1) flag = true;
    }
    if(flag) dp[i] = 1;
    else dp[i] = -1;
  }

  if(dp[k] == 1) cout << "First" << endl;
  else cout << "Second" << endl;

  return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
int main() {
    int m1, d1, m2, d2;
    cin >> m1 >> d1 >> m2 >> d2;
    if (d2 == 1) {
        cout << '1' << endl;
    }
    else {
        cout << '0' << endl;
    }
    return 0;
}

Measured memory_bytes: 3608
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    s = S()
    a = s.count("o")
    print(700+a*100)
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()


Measured memory_bytes: 39024
#include <iostream>

 

using namespace std;

 

int main()
{
   int i, h, m, s;
   cin >> i;
   h = i / 3600;
   m = i / 60 - h*60 ;
   s = i % 60;
   
   cout << h << ":" <<  m << ":" << s << endl; 
   
   return 0;
}

 


Measured memory_bytes: 3088
n = int(input())
a = list(map(int, input().split()))

from fractions import gcd

tl = [a[0]]
for i in range(1, n):
    tl.append(gcd(tl[i - 1], a[i]))

tr = [a[n - 1]]
for i in range(1, n):
    tr.append(gcd(tr[i - 1], a[n - 1 - i]))
tr.reverse()

ans = 1
for i in range(n):
    tmp = 1
    l = tl[i - 1] if 0 < i else tr[i + 1]
    r = tr[i + 1] if i < n - 1 else tl[i - 1]
    ans = max(ans, gcd(l, r))
print(ans)


Measured memory_bytes: 14400
S = input()

YYMM = 1 <= int(S[-2:]) <= 12
MMYY = 1 <= int(S[:2]) <= 12

if YYMM and MMYY:
    print('AMBIGUOUS')
elif YYMM:
    print('YYMM')
elif MMYY:
    print('MMYY')
else:
    print('NA')

Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<list>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<ctime>
using namespace std;

typedef long long ll;
bool debug = false;
const int NIL = -1;
const int INF = 1000000000;
const int NUM = 10010;
clock_t START, END;
int V[NUM];
struct items {
	int value;
	int weight;
}G[1601];

int main(void)
{
	if (debug) {
		START = clock();
		freopen("in29.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	};
	int N, W;
	cin >> N >> W;
	for (int i = 0; i < N; i++) {
		cin >> G[i].value >> G[i].weight;
		if (V[G[i].weight]) {
			G[V[G[i].weight] - 1].value = max(G[V[G[i].weight] - 1].value, G[i].value);
			i--;
			N--;
		}
		else
			V[G[i].weight] = i + 1;
	}
	memset(V, 0, sizeof(V));
	int sumn = N;
	for (int i = 0; i < N; i++) {
		int k = 2;
		while (G[i].weight * k <= W) {
			G[sumn].value = G[i].value;
			G[sumn++].weight = G[i].weight * k;
			k *= 2;
		}
	}
	N = sumn;
	for (int i = 0; i < N; i++) {
		for (int j = G[i].weight; j <= W; j++) {
			for (int k = 1; k <= j / G[i].weight; k++) {
				V[j] = max(V[j], V[j - G[i].weight * k] + G[i].value * k);
			}
		}
	}
	cout << V[W] << endl;
	if (debug) {
		END = clock();
		double endtime = (double)(END - START) / 1000;
		printf("total time = %lf s", endtime);
	}
	return 0;
}


Measured memory_bytes: 3160
N=int(input())
shogen=[]
count_ans=[]
for i in range(N):
    A=int(input())
    shogen.append([list(map(int,input().split())) for i in range(A)])
#print(shogen)
def saiki(A):
    if len(A)==N:
        honest=set()
        honest_kari=set()
        unkind=set()
        count=0
        unkind_kari=set()
        for i in range(N):
            if A[i]==1:
                honest.add(i)
            else:
                unkind.add(i)
        for i in range(N):
            if i in honest:
                for j in range(len(shogen[i])):
                    if shogen[i][j][1]==0:
                        unkind_kari.add(shogen[i][j][0]-1)
                    else:
                        honest_kari.add(shogen[i][j][0]-1)
        #print(honest,honest_kari)
        for i in unkind_kari:
            if i in unkind:
                count+=1
        for i in honest_kari:
            if i in honest:
                count+=1
        if count==len(unkind_kari)+len(honest_kari):
            kari=set(list(honest)+list(honest_kari))
            #print(honest,honest_kari,count)
            count_ans.append(len(kari))

        
        return
    for i in range(2):
        A.append(i)
        saiki(A)
        A.pop()
saiki([])
print(max(count_ans))

Measured memory_bytes: 3488
#include <iostream>
#include <cstdio>
using namespace std;
  
#define MAX 10000
#define NIL -1
  
struct Node {
  int parent;
  int left;
  int right;
};
  
Node T[MAX];
int n, D[MAX], H[MAX];
  
void setDepth(int u, int d) {
  if ( u == NIL ) return;
  D[u] = d;
  setDepth(T[u].left, d + 1);
  setDepth(T[u].right, d + 1);
}
  
int setHeight(int u) {
  int h1 = 0, h2 = 0;
  if ( T[u].left != NIL ) {
    h1 = setHeight(T[u].left) + 1;
  }
  if ( T[u].right != NIL ) {
    h2 = setHeight(T[u].right) + 1;
  }
  return H[u] = ( h1 > h2 ? h1 : h2 );
}
  
int getSibling(int u) {
  if ( T[u].parent == NIL ) return NIL;
  if ( T[T[u].parent].left != u && T[T[u].parent].left != NIL )
    return T[T[u].parent].left;
  if ( T[T[u].parent].right != u && T[T[u].parent].right != NIL )
    return T[T[u].parent].right;
  return NIL;
}
  
void print(int u) {
  printf("node %d: ", u);
  printf("parent = %d, ", T[u].parent);
  printf("sibling = %d, ", getSibling(u));
  int deg = 0;
  if ( T[u].left != NIL ) deg++;
  if ( T[u].right != NIL ) deg++;
  printf("degree = %d, ", deg);
  printf("depth = %d, ", D[u]);
  printf("height = %d, ", H[u]);
  
  if ( T[u].parent == NIL ) {
    printf("root\n");
  } else if ( T[u].left == NIL && T[u].right == NIL ) {
    printf("leaf\n");
  } else {
    printf("internal node\n");
  }
}
  
int main() {
  int id, left, right;
  int root = 0;
  
  cin >> n;
  for ( int i = 0; i < n; i++ ) T[i].parent = NIL;
  
  for ( int i = 0; i < n; i++ ) {
    scanf("%d %d %d", &id, &left, &right);
    T[id].left = left;
    T[id].right = right;
    if ( left != NIL ) T[left].parent = id;
    if ( right != NIL ) T[right].parent = id;
  }
  
  for ( int i = 0; i < n; i++ )
    if ( T[i].parent == NIL ) root = i;
  
  setDepth(root, 0);
  setHeight(root);
  
  for ( int i = 0; i < n; i++ ) print(i);
  
  return 0;
}

Measured memory_bytes: 3232
n=input()
count=0

for i in range(len(n)):
    if n[i]=="9":
        count+=1

if n[0]!="9":
    if count==len(n)-1:
        ans=int(n[0])+9*(len(n)-1)
    else:
        ans=(int(n[0])-1)+9*(len(n)-1)
elif count==len(n):
    ans=9*len(n)
else:
    ans=9*(len(n))-1

if len(n)==1:
    ans=int(n)


print(ans)

Measured memory_bytes: 3064
n = int(input())
l = list(map(int, input().split()))
m = l[:]
c = 0

for i in range(n):
    m.remove(m[i])
    if l[i] >= sum(m):
        c = 1
        break
    m = l[:]

if c == 1:
    print("No")
else:
    print("Yes")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int> 
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
int n;
int a[200005];
int main(){
    scanf("%d",&n);
    for(int i=0;i<n;i++) scanf("%d",&a[i]);
    sort(a,a+n);
    for(int i=1;i<n;i++)
        if(a[i]==a[i-1]){
            printf("NO\n");
            return 0;
        }
    printf("YES\n");
    return 0;
}

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

#define MAX_A 100000
#define MAX_B 100000
#define MAX_Q 100000
#define MAX_ST 1e+10

typedef long long int ll;

ll s[MAX_A], t[MAX_B], x[MAX_Q], ans[MAX_Q];

int main() {
  int a, b, q;
  std::cin >> a >> b >> q;

  for(int i = 0; i < a; ++i) {
    std::cin >> s[i];
  }
  for(int i = 0; i < b; ++i) {
    std::cin >> t[i];
  }
  for(int i = 0; i < q; ++i) {
    std::cin >> x[i];
  }

  std::sort(s, s + a);
  std::sort(t, t + b);

  for(int i = 0; i < q; ++i) {
    ll sl, tl , sr, tr;
    int ind_sr, ind_tr;

    ind_sr = std::upper_bound(s, s + a, x[i]) - std::begin(s);
    ind_tr = std::upper_bound(t, t + b, x[i]) - std::begin(t);

    sr = s[ind_sr];
    tr = t[ind_tr];
    if(ind_sr > 0) sl = s[ind_sr - 1];
    else sl = sr;
    if(ind_tr > 0) tl = t[ind_tr - 1];
    else tl = tr;

    ll ss[2] = {sl, sr}, ts[2] = {tl, tr};
    ans[i] = 2 * MAX_ST;
    for(ll S : ss) {
      for(ll T : ts){
        ans[i] = std::min(ans[i], std::abs(S - x[i]) + std::abs(T - S));
        ans[i] = std::min(ans[i], std::abs(T - x[i]) + std::abs(S - T));
      }
    }
  }

  for(int i = 0; i < q; ++i) {
    std::cout << ans[i] << std::endl;
  }
}


Measured memory_bytes: 4480
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();

		int bunsi=(N-1);
		int bunbo=K-1;

		int ans=(bunsi+bunbo-1)/bunbo;

		System.out.println(ans);
	}


	//以下テンプレート

	public static int[] extgcd(int a, int b) {

		int x0 = 1;
		int x1 = 0;

		int y0 = 0;
		int y1 = 1;

		while (b != 0) {
			int q = a / b;
			int r = a % b;

			int x2 = x0 - q * x1;
			int y2 = y0 - q * y1;

			a = b;
			b = r;

			x0 = x1;
			x1 = x2;

			y0 = y1;
			y1 = y2;
		}

		return new int[] { a, x0, y0 };

	}

	static int gcd(int a, int b) {

		if (b == 0)
			return a;

		if (a < b) {
			int t = a;
			a = b;
			b = t;
		}

		return gcd(b, a % b);

	}

	static int lcm(int a, int b) {
		return a * b / gcd(a, b);
	}

	static void swap(int[] a) {
		int t;

		t = a[0];
		a[0] = a[1];
		a[1] = t;

		return;
	}

	static <T> void output(List<T> list) {

		for (int i = 0; i < list.size(); i++) {
			System.out.print(list.get(i));

			if (i != list.size() - 1) {
				System.out.print(" ");
			} else {
				nl();
			}
		}

	}

	static void output(String[][] str) {

		for (int i = 0; i < str.length; i++) {
			for (int j = 0; j < str[i].length; j++) {
				print(str[i][j]);
			}

			nl();
		}

	}

	static void output(boolean flg, String Yes, String No) {

		if (flg) {
			pln(Yes);
		} else {
			pln(No);
		}

	}

	static void output(String[][] str, int digit) {

		String dig = "%" + String.valueOf(digit) + "s";

		for (int i = 0; i < str.length; i++) {
			for (int j = 0; j < str[i].length; j++) {
				System.out.printf(dig, str[i][j]);
			}
			nl();
		}

	}

	static void pln(String str) {
		System.out.println(str);
	}

	static void pln(int x) {
		System.out.println(x);
	}

	static void print(String str) {
		System.out.print(str);
	}

	static void print(int x) {
		System.out.print(x);
	}

	static void print(String str, int times) {
		for (int i = 0; i < times; i++) {
			print(str);
		}
	}

	static void print(int x, int times) {
		for (int i = 0; i < times; i++) {
			print(x);
		}
	}

	static void nl() {
		System.out.println();
	}

}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define N 100001
#define M 100001
int hd[N], nx[M], e[M];
int f[N], v[N], n, m;
int dfs(int x) {
    if (f[x]) return f[x];
    for (int i = hd[x]; i; i = nx[i]) f[x] = max(f[x], dfs(e[i]));
    return ++f[x];
}
int main() {
    scanf("%d%d", &n, &m);
    for (int i = 1, Num = 0, x, y; i <= m; i++) {
        scanf("%d%d", &x, &y);
        nx[++Num] = hd[x], hd[x] = Num, e[Num] = y;
    }
    int ans = 0;
    for (int i = 1; i <= n; i++) ans = max(ans, dfs(i));
    printf("%d\n", ans - 1);
    return 0;
}

Measured memory_bytes: 3200
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef long double D;
//typedef complex<D> P;
#define F first
#define S second
const ll MOD=1000000007;
//const ll MOD=998244353;

template<typename T,typename U>istream & operator >> (istream &i,pair<T,U> &A){i>>A.F>>A.S; return i;}
template<typename T>istream & operator >> (istream &i,vector<T> &A){for(auto &I:A){i>>I;} return i;}
template<typename T,typename U>ostream & operator << (ostream &o,const pair<T,U> &A){o<<A.F<<" "<<A.S; return o;}
template<typename T>ostream & operator << (ostream &o,const vector<T> &A){int i=A.size(); for(auto &I:A){o<<I<<(--i?" ":"");} return o;}



int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;
  cin>>N;
  vector<ll> A(N);
  cin>>A;
  sort(A.begin(),A.end(),greater<ll>());
  ll l=0,r=N;
  auto judge=[&](ll m){
               return A[m]>m;
             };
  while(r-l>1){
    ll m=(l+r)/2;
    if(judge(m)){l=m;}
    else{r=m;}
  }
  vector<ll> B;
  for(int i=l;i<N;i++){
    if(A[i]>l){B.push_back(A[i]-l);}
  }
  bool jd=(B.size()&1) && (B[0]&1);
  cout<<(jd?"Second":"First")<<endl;
  


  return 0;
}


Measured memory_bytes: 5068
#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
#include <sstream>
#include <iomanip>
#include <set>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef vector<P> vp;
typedef vector<PL> vpl;
typedef vector<vector<P>> vvp;
typedef vector<vector<PL>> vvpl;
const int INF = 1001001001;
const ll LINF = 1e18;
const double pi = 3.1415926535897932;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define REP(i, n) for(ll i = 0; i < n; i++)
#define FORMAP(it, m) for(auto it = m.begin(); it != m.end(); it++)
#define ff first
#define ss second
#define pb push_back

template <typename T>
T gcd(T a, T b) {
    return (a == 0) ? b : gcd(b%a, a);
}
template <typename T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}

bool p_comp_fs(const PL p1, const PL p2){ return p1.first < p2.first;};
bool p_comp_fg(const PL p1, const PL p2){ return p1.first > p2.first;};
bool p_comp_ss(const PL p1, const PL p2){ return p1.second < p2.second;};
bool p_comp_sg(const PL p1, const PL p2){ return p1.second > p2.second;};
template <typename T>
vector<T> uniquen(vector<T> vec){
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
    return vec;
}

int main(){
    ll n; cin >> n; vl xs(5); REP(i, 5) cin >> xs[i];
    ll m = LINF; ll midx = -1;
    REP(i, 5){
        if(m > xs[i]){
            m = xs[i]; midx = i+1;
        }
    }
    ll ans = (n + (m-1)) / m + 4;
    cout << ans << endstr;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main () {
	int x, n, t = 0;
	cin >> n >> x;		
	while (n !=0 || x != 0) {
		t = 0;
		for (int a = 1; a <= n; a++) {
			for (int b = 1; b <= n; b++) {
				for (int c = 1; c <= n; c++) {
					if (a+b+c == x && a < b && b < c) {
					   t++;
					}
				}
			}
		}
	cout << t << endl;
	cin >> n >> x;
	}
	return 0;
}



Measured memory_bytes: 3044
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, int> Pli;

string S;

int main() {
    cin >> S;

    if (S[2] == S[3] && S[4] == S[5]) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
int a,b,c,x,zzz=0;

  scanf("%d %d %d", &a, &b, &c);
  for(x=a;x<=b;x++){
    if(c%x==0){
      zzz++;
    }
  }

printf("%d\n",zzz);

  return 0;

}

Measured memory_bytes: 1852
#include<bits/stdc++.h>
using namespace std;
#define re register
char ss[1001000];
const int mod=1e9+7;
int f[1001000],ff[1001000][2][2],x[2];
int main()
{
	re int n,m,ans=1,xx=0,mmx=1<<30;
	scanf("%d%d",&n,&m);
	scanf("%s",ss+1);
	for(re int i=1;i<=m;i++)
	{
		if(ss[i]!=ss[1])
		{
			if(ans)mmx=xx+2-(xx&1);
			else if((xx&1)&&mmx>xx+1)mmx=xx+1;
			xx=0;ans=0;
		}else xx++;
	}
	if(ans==1)
	{
		ff[1][0][0]=ff[1][1][1]=1;
		for(re int i=2;i<=n;i++)
		{
			for(re int j=0;j<=1;j++)
			{
				ff[i][j][0]=(ff[i-1][j][0]+ff[i-1][j][1])%mod;
				ff[i][j][1]=ff[i-1][j][0];
			}
		}
		printf("%lld\n",((long long)ff[n][0][0]+ff[n][0][1]+ff[n][1][0])%mod);
		return 0;
	}
	f[0]=f[2]=1;
	for(re int i=4;i<=n;i++)
	{
		f[i]=(2ll*f[i-2]+(i-mmx-2>=0?mod-f[i-mmx-2]:0))%mod;
		//printf("**%d %d %d\n",i,f[i],mmx);
	}
	for(re int i=2;i<=mmx&&i<=n;i+=2)ans=(ans+(long long)i*f[n-i])%mod;
	printf("%d\n",ans);
}

Measured memory_bytes: 6400
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        // TODO 自動生成されたメソッド・スタブ
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
        for (int i = 0; i < input.length(); i++) {
            char ans = input.charAt(i);
            if (Character.isUpperCase(ans)) {
                ans = Character.toLowerCase(ans);
            } else {
                ans = Character.toUpperCase(ans);
            }
            System.out.print(ans);
        }
        System.out.printf("\n");
    }

}



Measured memory_bytes: 25396
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < (int64_t)n; i++)
#define REP_FOR(i, a, b) for (int64_t i = (int64_t)a; i < (int64_t)b; i++)
#define REP_REV(i, a, b) for (int64_t i = (int64_t)a; i > (int64_t)b; i--)
#define FORALL(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int64_t, int64_t> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int64_t> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int64_t infi = 1147483600;
const ll infl = 4e18 + 5;
const char EOL = '\n';
//cout << fixed << setprecision(17) << res << endl;
const ll MOD = 1000000007;

#define M 1000000007

ll comb(ll a, ll b) {
    ll res = 1;
    for (ll i = 0; i < b; ++i) {
        res *= (a-i);
    }
    for (ll i = 0; i < b; ++i) {
        res /= (b-i);
    }
    return res;
}

ll pow(ll a, ll b) {
    if (b == 1) return a;
    if (b <= 0) return 1;
    ll res = pow(a, b/2);
    res = res * res;
    if (b%2 == 1) res *= a;
    return res;
}

int main() {
    string s;
    ll n, k;
    cin >> s >> k;
    n = s.length();
    ll res = 0;
    for (ll i = 0; i < n; ++i) {
        if (k == 0) break;
        int c = (int)(s[i]-'0');
        if (c > 0) {
            res += (c-1) * comb((n-i-1), k-1) * pow(9, k-1);
            //cerr << i << ": +" << (c-1) * comb((n-i-1), k-1) * pow(9, k-1) << endl;
            res += comb((n-i-1), k) * pow(9, k);
            //cerr << i << ": +" << comb((n-i-1), k) * pow(9, k) << endl;
            --k;
        }
    }
    if (k == 0) {
        ++res;
    }
    cout << res << endl;
}


Measured memory_bytes: 384
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
input = sys.stdin.buffer.readline
def inputS(): return input().rstrip().decode()
readlines = sys.stdin.buffer.readlines 

N, M = map(int, input().split())
AC = [False]*(N+1)
WA = [0]*(N+1)
WAsum = 0

for _ in range(M):
  p, s = input().split()
  p = int(p)  
  if AC[p]:
    continue
  if s == b"AC":
    AC[p] = True
    WAsum += WA[p]
  else:
    WA[p] += 1
print(sum(AC), WAsum)    

Measured memory_bytes: 4596
import java.util.Scanner;
import java.util.regex.Pattern;

public class Main {

	private static final char[] alphabet = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
	private static final int    ALP_NUM  = 26;
	private static final String REGEX    = "(the|this|that)";

    public static void main(String[] args) {

        //input
        Scanner sc = new Scanner(System.in).useDelimiter(System.getProperty("line.separator"));

        char[] in_ar;
        char[] tmp_ar;
    	Pattern p = Pattern.compile(REGEX);
        while(sc.hasNext()){
            in_ar = sc.next().toCharArray();
            tmp_ar = new char[in_ar.length];

            for(int i=0;i<ALP_NUM;i++){

            	//change character.
            	for(int j=0;j<in_ar.length;j++){
            		tmp_ar[j] = change_char(in_ar[j],i);
            	}

            	if (p.matcher(String.valueOf(tmp_ar)).find()){break;}
            }
            
            //output
            System.out.println(tmp_ar);
        }
    }

    private static char change_char(char c,int i){

    	if(c == '.' || c == ' '){return c;}

    	int index = 0;
    	for(int j=0;j<ALP_NUM;j++){
    		if(alphabet[j] == c){
    			index = j;
    			break;
    		}
    	}
    	return alphabet[(index + i) % ALP_NUM];
    }
}

Measured memory_bytes: 18112
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
#define pb push_back
int n,m,a,b;
bool used[111111];
vector<int>v[111111],ans;
void dfs(int x){
	used[x]=true;
	ans.pb(x);
	for(int i:v[x]){
		if(!used[i]){
			dfs(i);
			return;
		}
	}
}
signed main(){
	cin>>n>>m;
	rep(i,m){
		cin>>a>>b;
		v[a-1].pb(b-1);
		v[b-1].pb(a-1);
	}
	dfs(0);
	reverse(ans.begin(),ans.end());
	for(int i:v[0]){
		if(!used[i]){
			dfs(i);
			break;
		}
	}
	cout<<ans.size()<<endl;
	rep(i,ans.size())cout<<ans[i]+1<<(i==ans.size()-1?"\n":" ");
	return 0;
}


Measured memory_bytes: 9976
// package agc.agc024;

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class Main {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();
        if (in.nextLong() % 2 == 0) {
            out.println(a - b);
        } else {
            out.println(b - a);
        }
        out.flush();
    }

    public static void debug(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }

    public static class InputReader {
        private static final int BUFFER_LENGTH = 1 << 12;
        private InputStream stream;
        private byte[] buf = new byte[BUFFER_LENGTH];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        private int next() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public char nextChar() {
            return (char) skipWhileSpace();
        }

        public String nextToken() {
            int c = skipWhileSpace();
            StringBuilder res = new StringBuilder();
            do {
                res.append((char) c);
                c = next();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public int nextInt() {
            return (int) nextLong();
        }

        public long nextLong() {
            int c = skipWhileSpace();
            long sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = next();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = next();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public double nextDouble() {
            return Double.valueOf(nextToken());
        }

        int skipWhileSpace() {
            int c = next();
            while (isSpaceChar(c)) {
                c = next();
            }
            return c;
        }

        boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
    }
}

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

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

    if(n>=400 && n<=599){
        cout<< "8"<<endl;
    }
     else if(n>=600 && n<=799){
        cout<< "7"<<endl;
    }
    else if(n>=800 && n<=999){
        cout<< "6"<<endl;
    }
    else  if(n>=1000 && n<=1199){
        cout<< "5"<<endl;
    }
     else if(n>=1200 && n<=1399){
        cout<< "4"<<endl;
    }
     else  if(n>=1400 && n<=1599){
        cout<< "3"<<endl;
    }
    else if(n>=1600 && n<=1799){
        cout<< "2"<<endl;
    }
   else if(n>=1800 && n<=1999){
        cout<< "1"<<endl;
    }
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
typedef long long ll;

int main() {
    vector<vector<int>> A(3, vector<int>(3)),B(3, vector<int>(3));
    rep(i,3){
        rep(j,3){
            cin >> A[i][j];
            B[i][j] = 0;
        }
    }
    int n; cin >> n;
    rep(i,n){
        int b; cin >> b;
        rep(i,3){
            rep(j,3){
                if(A[i][j] == b) B[i][j] = 1;
            }
        }
    }
    bool ans = false;
    rep(i,3){
        if(B[i][0] + B[i][1] + B[i][2] == 3) ans = true;
    }
    rep(j,3){
        if(B[0][j] + B[1][j] + B[2][j] == 3) ans = true;
    }
    if(B[0][0] + B[1][1] + B[2][2] == 3) ans = true;
    if(B[0][2] + B[1][1] + B[2][0] == 3) ans = true;

    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

int main()
{
  int a, b;
  cin >> a >> b;
  if (a < b) {
    char c = '0' + a;
    for (int i = 0; i < b; i++) {
      cout << c;
    }
  } else {
    char c = '0' + b;
    for (int i = 0; i < a; i++) {
      cout << c;
    }
  }
  cout << '\n';
  return 0;
}


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

long long int x, ans;

int main(void){
  cin >> x;
  ans = 2 * (x / 11);
  int z = x % 11;
  if(z >= 1 && z <= 6){
    ans++;
  }
  if(z >= 7){
    ans += 2;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
void io() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); }

int main() {
	io(); long long x, y;
	cin >> x >> y;
	if ((long long)abs(x - y) <= 1) cout << "Brown";
	else cout << "Alice";
}


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

int main(){
  int a,b;
  cin>>a>>b;
  int max=a+b;
  if(a-b>max)max=a-b;
  if(a*b>max)max=a*b;
  cout << max << endl;
  return 0;
}


Measured memory_bytes: 256
n,m = map(int,input().split())


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)

    divisors.sort(reverse=True)
    return divisors


cnd = make_divisors(m)

for i in range(len(cnd)):
    if m // cnd[i] >= n:
        print(cnd[i])
        exit()



Measured memory_bytes: 38640
fn main() {
    let v: Vec<String> = read_vec();

    if v[0].parse::<i32>().unwrap() == v[1].parse::<i32>().unwrap() {
        println!("Yes");
        return;
    }

    println!("No");
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

Measured memory_bytes: 4352
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>

using namespace std;

int main(){
	string S;

	cin >> S;
	int price = 700;
	if(S[0] == 'o') price += 100;
	if(S[1] == 'o') price += 100;
	if(S[2] == 'o') price += 100;

	cout << price;
	
	return 0;
}


Measured memory_bytes: 256
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val N = sc.nextInt()

    var P = 0
    var W = 0
    var G = 0
    var Y = 0
    for (i in 0 until N) {
        val s = sc.next().toString()
        if (s == "P") P++
        if (s == "W") W++
        if (s == "G") G++
        if (s == "Y") Y++
    }
    if (P > 0 && W > 0 && G > 0 && Y > 0) {
        println("Four")
    } else {
        println("Three")
    }
}


Measured memory_bytes: 29472
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <assert.h>
#include <numeric>
#include <time.h>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>

using namespace std;
typedef long long ll;

#define rep(i, n) for (i = 0; i < n; i++)
#define all(c) (c).begin(), (c).end()
#define P pair<int, int>

int main()
{
  int n;
  cin >> n;
  string s;
  map<string, int> mp;
  for (int i = 0; i < n; i++)
  {
    cin >> s;
    mp[s]++;
  }

  int mx = 0;
  for (auto p : mp)
  {
    mx = max(mx, p.second);
  }

  for (auto it = mp.begin(); it != mp.end(); it++)
  {
    if (it->second != mx)
      continue;
    cout << it->first << endl;
  }
}


Measured memory_bytes: 25216
import sys

input=sys.stdin.readline

N,L,T=map(int,input().split())
res=[]
start=[]
for _ in range(N):
    x,w=map(int,input().split())
    start.append((x,w%2))
    res.append(((x+T*(-1)**(w+1))%L,w%2))


res.sort()
#print(res,pos,id)
if start[0][1]==1:
    id=0
    pos=start[0][0]
    for i in range(1,N):
        x,w=start[i]
        if w!=start[0][1]:
            id+=(2*T+pos-x)//L-((pos-x-1)//L)
    id%=N
    ans=[-1]*N
    check=-1
    for i in range(N):
        p,w=res[i]
        if p==(pos+T)%L and w==1:
            ans[i]=id
            check=i
            break
    #print(ans,check)
    for i in range(1,N):
        ans[check-i]=(id-i)%N
    res=[(ans[i],res[i][0]) for i in range(N)]
    #print(ans)
    #print(res)
    res.sort()
    for id,pos in res:
        print(pos)
else:
    id=0
    pos=start[0][0]
    for i in range(1,N):
        x,w=start[i]
        if w!=start[0][1]:
            id-=(2*T+x-pos)//L-((x-pos-1)//L)
    id=id%N
    ans=[-1]*N
    check=-1
    for i in range(N):
        p,w=res[i]
        if p==(pos-T)%L and w==0:
            ans[i]=id
            check=i
            break
    for i in range(1,N):
        ans[check-i]=(id-i)%N
    res=[(ans[i],res[i][0]) for i in range(N)]
    res.sort()
    for id,pos in res:
        print(pos)


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

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second

const ll mod=1e9+7;

ll dp[2010101]={};

ll solve(ll n)
{
    dp[0]=1;
    ll sum=1;
    for(int i=1; i<=n; ++i)
    {
        dp[i] = sum;
        // printf("%s\n", );
        if(i-2>=0) dp[i] = (dp[i]-dp[i-2]+mod)%mod;
        (sum+=dp[i])%=mod;
    }

    sum = (sum-dp[n]-dp[n-1]+mod*2)%mod;
    dp[n+1] = sum;

    for(int i=n+2; i<2*n; ++i)
    {
        sum = (sum-dp[i-(n+1)-1]+mod)%mod;
        dp[i] = sum;
    }

    ll ret=0;
    ll sq = ((n-1)*(n-1))%mod;
    rep(i,n-1)
    {
        (ret+=(dp[i]*sq)%mod)%=mod;
    }
    (ret+=(dp[n-1]*(n-1))%mod)%=mod;
    for(int i=n; i<=2*n; ++i) (ret+=dp[i])%=mod;
    return ret;
}

int main()
{
    ll n;
    cin >>n;
    cout << solve(n) << endl;
    return 0;
}


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

int main()
{
	int n, m, l;
	cin >> n >> m >> l;

	int a[100][100] = { 0 }, b[100][100] = { 0 };
	long long c[100][100] = { 0 };
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			cin >> a[i][j];
		}
	}
	for (int i = 0; i < m; i++) {
		for (int j = 0; j < l; j++) {
			cin >> b[i][j];
		}
	}

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < l; j++) {
			for (int k = 0; k < m; k++) {
				c[i][j] += a[i][k] * b[k][j];
			}
		}
	}

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < l; j++) {
			cout << c[i][j];
			cout << ((j != (l - 1)) ? " " : "\n");
		}
	}

	return 0;
}


Measured memory_bytes: 3260
#include <iostream>
using namespace std;
class Dice{
public:
    int num[6];
    int numI[6];
    int table[24][6];
    void roll(char ch){
        if(ch == 'N') rollSet(num[1], num[5], num[2], num[3], num[0], num[4]);
        else if(ch == 'E') rollSet(num[3], num[1], num[0], num[5], num[4], num[2]);
        else if(ch == 'R') rollSet(num[0], num[3], num[1], num[4], num[2], num[5]);
    }
    void rollSet(int a, int b, int c, int d, int e, int f){
        num[0] = a; num[1] = b; num[2] = c; num[3] = d; num[4] = e; num[5] = f;
    }
    void iniTable(){
        for(int i = 0; i < 24; i++){
            for(int j = 0; j < 6; j++){
                table[i][j] = 0;
            }
        }
    }
    void getTable(){
        for(int i = 0; i < 24; i++){
            for(int j = 0; j < 6; j++){
                cout << table[i][j] << " ";
            }
            cout << endl;
        }
    }
    void setTable(int row, Dice d){
        for(int i = 0; i < 6; i++){
            table[row][i] = d.num[i];
        }
    }
};
bool compDice(Dice a, Dice b){
    for(int i = 0; i < 24; i++){
        int count = 0;
        for(int j = 0; j < 6; j++){
            if(a.numI[j] == b.table[i][j]) count++;
            if(count == 6){
                // for(int k = 0; k < 6; k++){
                //     cout << a.numI[k] << " ";
                // }
                return true;
            }
        }
    }
    return false;
}
int main(){
    int n;
    cin >> n;
    Dice d[n];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < 6; j++){
            cin >> d[i].num[j];
            d[i].numI[j] = d[i].num[j];
        }
        d[i].iniTable();
    }
    string s1 = "NNNNEEEE", s2 = "RRRR";
    for(int k = 1; k < n; k++){
        int row = 0;
        for(int i = 0; i < s1.size(); i++){
            d[k].roll(s1[i]);
            if(i == 5 || i == 7) continue;
            for(int j = 0; j < s2.size(); j++){
                d[k].roll(s2[j]);
                d[k].setTable(row, d[k]);
                row++;
            }
        }
    }
    // for(int i = 1; i < n; i++){
    //     cout << "[" << i << "]" << endl;
    //     d[i].getTable();
    // }
    bool flag = false;
    for(int i = 0; i < n - 1; i++){
        for(int j = i + 1; j < n; j++){
            if(compDice(d[i], d[j])) flag = true;
            if(flag) break;
        }
        if(flag) break;
    }
    if(flag) cout << "No" << endl;
    else cout << "Yes" << endl;
}



Measured memory_bytes: 3232
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <string.h>
#include <math.h>

int main (void)
{
    intmax_t N, A[100];
    double ans = 0;

    scanf("%jd", &N);
    for (size_t i = 0; i < N; i++) {
        scanf("%jd", &A[i]);
    }

    for (size_t i = 0; i < N; i++) {
        ans += (1 / (double)A[i]);
    }
    ans = 1 / ans;

    printf("%.6f\n", ans);

    return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define debug(a) cerr << #a << ": " << a << endl
#define sz(a) int(a.size())
#define rep(i,n) for(int i=0;i<n;i++)
#define forr(i, st, en) for(int i = st; i <= en; i++)
#define all(v) (v).begin(),(v).end()
#define X first
#define Y second
#define fast cin.tie(0); ios::sync_with_stdio(false)
#define vi vector<int>
#define vii vector<vector<int>>

int32_t main(){ fast;
	
	int x, n; cin>>x>>n;
	if(n == 0){
		cout<<x<<endl;
		return 0;
	}
	vector<int> a(n);
	set<int> set;
	rep(i, n){
		cin>>a[i];
		set.insert(a[i]);
	}
	int minn = a[0], maxx = a[0];
	for(int x1: a){
		minn = min(minn, x1);
		maxx = max(maxx, x1);
	}
	int diff = 1e9 + 7;
	int answer = 0;
	for(int i = -10000; i <= 10000; i++){
		if(abs(i - x) < diff && set.find(i) == set.end()){
			diff = abs(i - x);
			answer = i;
		}
	}
	cout<<answer<<endl;
}


Measured memory_bytes: 3664