akhauriyash/Code-Regression huggingface dataset:
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
using namespace std;
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define rrep(i,a,n) for(ll i=n;i>=a;i++)
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF = 1e+17;
const ll MODcdf = 998244353;
string keyence="keyence";
int main(){
    bool ch[1000001];
    rep(i,1,1000001)ch[i]=false;
    ll ans;
    ll s;cin>>s;
    ch[s]=true;
    ll now=s;
    rep(i,2,1000001){
        if(now%2==0){
            now=now/2;
        }
        else if(now%2==1){
            now=3*now+1;
        }
        if(ch[now]){
            ans=i;
            break;
        }
        ch[now]=true;
    }
    cout<<ans<<endl;
}

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

using ll = long long;

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	ll T; cin >> T;
	T++;

	ll ans = -1;
	while (T >= 5) {
		ans += 2; T -= 2;
		ans += T % 3;
		T -= T % 3;
		T /= 3;
	}
	ans += T;
	cout << ans << '\n';

	return 0;
}



Measured memory_bytes: 3204
temp=list(map(lambda x:int(x),input().split()))
H,W=temp[0],temp[1]
grid=[]


for _ in range(H):
    row=list(input())
    row.insert(0,'pad')
    row.append('pad')
    grid.append(row)

pad=['pad' for _ in range(W+2)]
grid.insert(0,pad)
grid.append(pad)

# print(np.array(grid))
dx=[1,0,-1,0]
dy=[0,1,0,-1]
flag=True
for r in range(1,H+1):
    for c in range(1,W+1):
        if grid[r][c]=='#':
            cnt=0
            for i in range(4):
                if grid[r+dx[i]][c+dy[i]]=='#':
                    cnt+=1
            if cnt==0:
                flag=False
                break
    if flag==False:break

if flag:print("Yes")
else:print("No")

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define lli long long int   //used int to avoid mle
#define ulli unsigned long long int 
#define ld long double
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define loop(i,a,b) for(lli i=a;i<b;i++)
#define initialize(array,size,value) for(lli i=0;i<size;i++) array[i]=value
#define couta(array,size) for(lli i=0;i<size;i++) cout<<array[i]<<" "
#define vl vector<lli>
#define vp vector< pair <lli,lli> >
#define sl set<lli>
#define spl set<pll>
#define msl multiset <lli>
#define msp multiset <pll>
#define pll pair<lli, lli>
#define mll map<lli, lli>              //for( map<lli, lli>::iterator i=temp.begin();i!=temp.end();i++)cout<<i->fi<<" "<<i->se<<endl;
#define mvl map<lli, vl>
#define umll unordered_map<lli, lli>
#define vt vector<pair<lli, pll >  >
#define vf vector<pair<pll,pll > >
#define qu queue<lli>
#define pq priority_queue<lli>
#define dq deque <lli>
#define ptr vector<lli>::iterator
#define bs(array,x) binary_search(array.begin(),array.end(),x)
#define lb(array,x) lower_bound(array.begin(),array.end(),x)
#define ub(array,x) upper_bound(array.begin(),array.end(),x)
#define nobw(array,i,j) upper_bound(array.begin(), array.end(), j)-lower_bound(array.begin(), array.end(), i) //number of numbers between i & j
#define vc clear()
#define fbo find_by_order //returns iterator
#define fok order_of_key //return index
#define endl '\n'
#define sp system("pause");
#define INF 9223372036854775807
#define MINF -9223372036854775808
#define start_routine() int begtime = clock();
#define end_routine() int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0
lli mod=998244353;
//string s=bitset<32>(n).to_string();
typedef tree<lli,null_type,less<lli>,rb_tree_tag, // change both to lli if set is req insted of multiset
tree_order_statistics_node_update> indexed_set;
int main()
{
	lli n;cin>>n;
	string s;
	cin>>s;
	lli r=0,g=0,b=0;
	for(lli i=0;i<n;i++){
		if(s[i]=='R')r++;
		else if(s[i]=='G')g++;
		else b++;
	}
	lli temp=r*g*b;
	//lli temp2=0;
	for(lli i=0;i<n;i++){
		for(lli j=i+1;j<n;j++){
			if(s[i]==s[j])continue;
			lli k=j+(j-i);
			if(k>=n)continue;
			if(s[k]==s[i] || s[k]==s[j])continue;
			temp--;
		}
	}
	cout<<temp;
	
    return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)
#define ALL(x) (x).begin(),(x).end()
using namespace std;

//素因数分解
vector<pair<ll,int>> factorize(ll n){
    vector<pair<ll,int>>res;
    for(ll i=2;i*i<=n;i++){
        if(n%i)continue;
        res.emplace_back(i,0);
        while (n%i == 0)
        {
        n /= i;
        res.back().second++;
        }
        
    }
    if(n != 1) res.emplace_back(n,1);
    return res;
}

void trace(int A[],int N){
    REP(i,N){
        if(i>0)printf(" ");
        printf("%d",A[i]);
    }
    printf("\n");
}


int main(){
    int N,A,B;
    cin >> N >> A >> B;
    cout << min(N*A,B) << endl;
}

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

import numpy as np
h_array = np.array(list(map(int, input().split())))
# print(h_array)

p_dict = {i:[0] for i in range(n)}
for i in range(m):
  a, b = map(int, input().split())
  a, b = a-1, b-1
  p_dict[a].append(h_array[b])
  p_dict[b].append(h_array[a])
  
# print(p_dict)
num_good = 0
for i in range(n):
#   print(i, p_dict[i] , h_array[i])
  if max(p_dict[i]) < h_array[i]:
    num_good += 1

print(num_good)


Measured memory_bytes: 55964
#include<bits/stdc++.h>
#define ll long long 
#define pb push_back
using namespace std ; 
int main(){
	int a , b ; 
	cin>> a >> b ;
	int p = 1 , ans = -1 ;  
	for(int i = 1 ; i <= 10000 ; ++i){
		
        if(floor( i * 0.08) == a && floor(i*0.1) == b){
			p  = 0 ; 
			ans = i ; 
			break ; 
		}
		
	}
	if(p ==1) 
	 cout<<-1<<endl; 
	 else 
	 cout<<ans<<endl;
 }


Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#define N_MAX 100000

int N;
char s[N_MAX+1];
bool assignar[N_MAX+1];


bool assign(int i){
   if(i==0 || i==1){
        assignar[i] = true;
        if(assign(i+1)){
            return true;
        }
        assignar[i] = false;
        if(assign(i+1)){
            return true;
        }
        return false;
    }
    //割り当てた条件がクリアかどうかを確認する
    else if(i==N){
        bool t = (s[i-1] == 'o');
        if(t ^ assignar[i-1]){
            if(assignar[i-2] ^ assignar[0]){
                bool u = (s[0] == 'o');
                if(u ^ assignar[0]){
                    return assignar[i-1] ^ assignar[1];
                }else{
                    return !(assignar[i-1] ^ assignar[1]);
                }
            }else{
                return false;
            }
        }else{
            if(!(assignar[i-2] ^ assignar[0])){
                bool v = (s[0] == 'o');
                if(v ^ assignar[0]){
                    return assignar[i-1] ^ assignar[1];
                }else{
                    return !(assignar[i-1] ^ assignar[1]);
                }
            }else{
                return false;
            }
        }
    }else{
        bool t = (s[i-1] == 'o');
        if(t ^ assignar[i-1]){
            assignar[i] = !assignar[i-2];
        }else{
            assignar[i] = assignar[i-2];
        }
        return assign(i+1);
    }
}

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

    if(assign(0)){
        char ans[N_MAX+1];
        for(int i=0;i<N;i++){
            if(assignar[i]){
                ans[i] = 'S';
            }else{
                ans[i] = 'W';
            }
        }
        ans[N] = '\0';
        printf("%s\n",ans);
    }else{
        printf("-1\n");
    }

    return 0;
}



Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		Main mainObj = new Main();
		mainObj.solve();
	}

	public void solve() throws IOException {
		FastScanner fs = new FastScanner();
		
		String s = fs.next();
		String t = fs.next();
		
		int maxkaburi = 0;
		for(int i = 0; i <= s.length() - t.length(); i++) {
			int kaburi = 0;
			for(int j = 0; j < t.length();j++) {
				if(t.charAt(j) == s.charAt(i+j)) {
					kaburi++;
				}
			}
			maxkaburi = Math.max(maxkaburi, kaburi);
		}
		
		
		System.out.println(t.length() - maxkaburi);
	}

	

	public class FastScanner {

		BufferedReader reader;
		private StringTokenizer st;

		public FastScanner() {
			st = null;
			reader = new BufferedReader(new InputStreamReader(System.in));
		}

		public String next() throws IOException {
			if (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(reader.readLine());
			}
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			st = null;
			String readLine = null;
			readLine = reader.readLine();
			return readLine;
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		public int[] nextIntArr(int n) throws NumberFormatException, IOException {
			int[] retArr = new int[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextInt();
			}
			return retArr;
		}

		public long[] nextLongArr(int n) throws NumberFormatException, IOException {
			long[] retArr = new long[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextLong();
			}
			return retArr;
		}

		public void close() throws IOException {
			reader.close();
		}
	}

}


Measured memory_bytes: 32704
#include <iostream>
#include <vector>

using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;

int N;
vvi T;

int dfs(int v, int p) {
        int cur=0;
        for (auto u : T[v]) {
                if (u == p) continue;
                cur ^= dfs(u,v)+1;
        }

        return cur;
}

int main() {
        cin >> N;
        T = vvi(N+1,vi());
        for (int i=0; i<N-1; i++) {
                int x,y;
                cin >> x >> y;
                T[x].push_back(y);
                T[y].push_back(x);
        }

        int sg = dfs(1,-1);
        if (sg == 0)
                cout << "Bob\n";
        else
                cout << "Alice\n";
        return 0;
}

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

ll solve(vector<ll> a,ll k){
    ll res = 0;
    ll sum = 0;
    int r = 0;

    for(int l = 0 ; l < a.size() ; l++ ){

        while(sum + a[r] <= k && r < a.size()){
            sum += a[r];
            r++;
        }
        res += r-l;
    
        sum -= a[l];
    }
    return res;
}

int main(){
    int n,Q;cin >> n >> Q;
    vector<ll> x(n);
    for(int i = 0; i < n ; i++)cin >> x[i];

    for(int i = 0; i < Q ; i++){
        ll query;cin >> query;
        cout << solve(x,query) << endl;
    }


    return 0;
}


Measured memory_bytes: 4432
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        String S = buffer.readLine();
        String T = buffer.readLine();
        int  minLen = Integer.MAX_VALUE;
        for (int pos = 0; pos < S.length()-T.length()+1; pos++) {
            int currLen = 0;
            for (int i = 0; i < T.length(); i++) {
                if (T.charAt(i)!=S.charAt(pos+i))currLen++;
            }
            minLen = Math.min(minLen, currLen);
        }
        System.out.println(minLen);
    }
}


Measured memory_bytes: 32496
#include <bits/stdc++.h>
using namespace std;
#pragma region
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << (#x) << "] = [", _print(x)
#else
#define debug(x...)
#endif
#pragma endregion
typedef long long ll;
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define sz(v) int((v).size())
#define int ll
#pragma region
#define f first
#define s second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#pragma endregion


int n;
vector<int> a;
int comp[1'111'111];
bitset<1'111'111> ina;
void solve()
{
    cin>>n;
    a.resize(n);
    forn(i, n) cin>>a[i];
    int g = 0;
    forn(i, n) g=__gcd(g, a[i]);
    if (g != 1)
    {
        cout << "not coprime\n";
        return;
    }
    //setwise coprime

    forn(i, n) ina[a[i]] = 1;
    //
    for(int i = 2; i <1'111'111; ++i)
    {
        if (comp[i]) continue;
        int f = 0;
        for (int j = i; j < 1'111'111; j += i)
        {
            comp[j] = i;
            f += ina[j];
        }
        if (f >= 2)
        {
            cout << "setwise coprime\n";
            return;
        }
    }
    cout << "pairwise coprime\n";
}

signed main()
{
    int T = 1;
    ios_base::sync_with_stdio(0); cin.tie(0);
    //cin >> T;
    for(int i=1;i<=T;++i)
    {
        //cout << "Case #" << i << ": ";
        solve();
    }
    return 0;
}


Measured memory_bytes: 19748
n, k = map(int, input().split())
p = list(map(int, input().split()))
kp = []
for i in range(n):
  kp.append((p[i]+1)/2)
sumkp = []
sumkpi = 0
for i in range(n):
  sumkpi += kp[i]
  sumkp.append(sumkpi)
maxans = -1
maxans = sumkp[k-1]
for i in range(1, n-k+1):
  maxans = max(maxans, sumkp[i+k-1] - sumkp[i-1])
print(maxans)

Measured memory_bytes: 25124
import sys

N=int(input())
non_zero=0

for i in range (1,len(str(N))):
    if str(N)[i]=='0':
        non_zero+=1
    
if non_zero==len(str(N))-1:
    if str(N)[0]=='1':
        print(10)
        sys.exit()
    else:
        print(int(str(N)[0]))
        sys.exit()

count=0
for j in range(len(str(N))):
    count+=int((str(N))[j])
    
print(count)

Measured memory_bytes: 3316
n = int(input())
 
flg = True
t_ = 0
x_ = 0
y_ = 0

for i in range(n):
  t, x, y = map(int, input().split())
  t_ = abs(t - t_)
  x_ = abs(x - x_)
  y_ = abs(y - y_)
  
  if t_ - x_ - y_ < 0:
    print('No')
    flg = False
    break
  elif (t_ - x_ - y_) % 2 != 0:
    print('No')
    flg = False
    break
  t_ = t
  x_ = x
  y_ = y
 
if flg:
  print('Yes')

Measured memory_bytes: 3064
//FizzBuzz Sum

#include<bits/stdc++.h>
using namespace std;

int main (){
    long long N,Ans=0;
    cin >> N;
    for(int i=1;i<=N;i++){
        if((i%3)!=0&&(i%5)!=0){
            Ans += i;
        }
    }
    cout << Ans << endl;
    return 0;
}

Measured memory_bytes: 3640
import bisect

n = int(input())
A = list(map(int, input().split()))
counts = [0]*(n)
for a in A:
    counts[a-1] += 1
counts.sort()

cumsum = []
num = 0
for count in counts:
    num += count
    cumsum.append(num)

answers = [0]*(n)
for i in range(1, n+1):
    idx = bisect.bisect_right(counts, i)
    left = cumsum[idx-1]
    right = (n-idx)*i
    K = (right+left)//i
    answers[K-1] = i

now = 0
for i in range(n-1, -1, -1):
    if answers[i] == 0:
        answers[i] = now
    now = answers[i]

for ans in answers:
    print(ans)

Measured memory_bytes: 38108
#include <bits/stdc++.h>
using namespace std;
int main(){
	int a=0,n;
	cin>>n;
	string s;
	for(int i=0;i<n;i++){	
		cin>>s[i];
		if(s[i]=='Y'){
			cout<<"Four";
			return 0;
		}
	}
	cout<<"Three";
	return 0;
}

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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

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

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

    ll a, b;cin >> a >> b;
    ll ans = 0;
    if(a == 1 && b == 1)ans = 1000000;
    else {
        if(a == 1)ans += 300000;
        else if(a == 2)ans += 200000;
        else if(a == 3)ans += 100000;
        if(b == 1)ans += 300000;
        else if(b == 2)ans += 200000;
        else if(b == 3)ans += 100000;
    }

    cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define LOCAL 1

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define dbg(...) cout<<#__VA_ARGS__ ": ["; for(auto e: __VA_ARGS__){cout<<e<<", ";} cout<<"]\n"
#define dbg1(...) cout<<#__VA_ARGS__ " "<< __VA_ARGS__ 
#else
#define dbg(...) 1;
#define dbg1(...) 1;
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
constexpr ll R=2e5+69, INF=2e9+6969;

int n,ans,m,comp;
vector <int> v[R];
bitset <R> vis;

void dfs(int a)
{
	comp++;
	vis[a] = 1;
	for(auto e: v[a])
	{
		if(!vis[e]) dfs(e);
	}
}

int main()
{
	scanf("%d%d", &n, &m);
	for(int i=0;i<m;++i)
	{
		int a,b;
		scanf("%d%d", &a, &b);
		v[a].pb(b);
		v[b].pb(a);
	}
	for(int i=1;i<=n;++i)
	{
		comp = 0;
		if(!vis[i]) dfs(i);
		ans = max(ans,comp);
	}
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 24012
#include <iostream>

using namespace std;

int a[200005];

int main() {
  int n;
  cin >> n;
  for(int i = 0; i < n; i++) {
    cin >> a[i];
  }

  int mm = 0;
  int j = 0;
  for(int i = 0; i < n; i++) {
    if(a[i] > mm) {
      mm = a[i];
      j = i;
    }
  }

  int m = 0;
  for(int i = 0; i < n; i++) {
    if(i == j) continue;
    m = max(m,a[i]);
  }

  for(int i = 0; i < n; i++) {
    if(i == j) cout << m<< endl;
    else cout << mm << endl;
  }

}
    


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

void pass(int l, int x, int n);

int ans;
bool toru[8];
vector<int> road[8];
signed main()
{
    int n, m, a, b;

    cin >> n >> m;
    for(int i=0 ;i<m ;i++ ){
        cin >> a >> b;

        road[a-1].push_back(b-1);
        road[b-1].push_back(a-1);
    }
    pass(0, 0, n);

    cout << ans << endl;
    return (0);
}

void pass(int l, int x, int n)
{   
    toru[x] = true;
    if(l == n-1){
        ans++;
    }
    else{
        for(int i=0 ;i<road[x].size() ;i++ ){
            if(toru[road[x][i]] == false){

                pass(l+1, road[x][i], n);
                toru[road[x][i]] = false;
            }
        }
    }

    return;
}

Measured memory_bytes: 3624
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())

mib = float('inf')

for i in range(n):
    a, b = map(int, input().split())
    if mib > b:
        mib = b
        ans = a

ans += mib

print(ans)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	int a; string s; cin >> a >> s;
	cout << (a >= 3200 ? s : "red") << endl;
	
	return 0;
}

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

struct node{
  int key;
  struct node *parent;
  struct node *left;
  struct node *right;
} ;

int flag = 0;

typedef struct node Node;

Node *root, *NIL;

void Insert(int);
void Inorder(Node *);
void Preorder(Node *);
void Find(Node *, int);

int main()
{
  int n,i,a;
  char in[7],insert[7] = "insert",find[5] = "find",print[6] = "print";
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    scanf("%s",in);
    (void)getchar();
    if(strcmp(in, insert) == 0) {
      scanf(" %d",&a);
      Insert(a);
    }
    else if(strcmp(find, in) == 0) {
      scanf("%d",&a);
      Find(root,a);
      if(flag == 1) printf("yes\n");
      else printf("no\n");
      flag = 0;
    }
    else  {
      Inorder(root);
      printf("\n");
      Preorder(root);
      printf("\n");
    }
  }
  return 0;
}

void Insert(int a) {
  Node *b = NIL;
  Node *c = root;
  Node *d;

  d = malloc(sizeof(Node));
  d -> key = a;
  d -> left = NIL;
  d -> right = NIL;
  while(c != NIL) {
    b = c;
    if(d -> key < c -> key) c = c -> left;
    else  c = c -> right;
  }

  d -> parent = b;
  if(b == NIL)  root = d;
  else {
    if(d -> key < b -> key)  b -> left = d;
    else    b -> right = d;
  }
}

void Inorder(Node *u) {
  if(u == NIL) return;
  else {
    Inorder(u -> left);
    printf(" %d", u->key);
    Inorder(u -> right);
  }
}

void Preorder(Node *u) {
  if(u == NIL) return;
  else {
    printf(" %d", u->key);
    Preorder(u -> left);
    Preorder(u -> right);
  }
}

void Find(Node *u, int k) {
    if(u == NIL) return;
  else {
    if(u -> key == k) {
      flag = 1;
      return;
    }
  }
    if(u -> key > k) {
      Find(u -> left, k);
      return;
    }
    else {
      Find(u -> right, k);
      return;
  }
}

Measured memory_bytes: 19376
#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int n;
vector<long long> a;
long long dp[3010][3010];

long long dfs(int l, int r){
    if(dp[l][r] != -1) return dp[l][r];
    if(l + r >= n) return dp[l][r] = 0;
    long long res = 0;
    if((l + r) % 2 == 0){
        res = max(dfs(l + 1, r) + a[l], dfs(l, r + 1) + a[n - r - 1]);
    }else{
        res = min(dfs(l + 1, r), dfs(l, r + 1));
    }
    return dp[l][r] = res;
}

int main(){
    cin >> n;
    a = vector<long long>(n);
    long long sum = 0;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        sum += a[i];
    }
    for(int i = 0; i < 3010; i++){
        for(int j = 0; j < 3010; j++){
            dp[i][j] = -1;
        }
    }
    long long x = dfs(0, 0);
    long long y = sum - x;
    cout << x - y << endl;
    return 0;
}


Measured memory_bytes: 71168
#include "bits/stdc++.h"

using namespace std;
using ll=long long;
using ull=unsigned long long;

typedef pair<int,int>Pi;
typedef pair<long long,long long>P;
typedef pair<long long,P>PP;
typedef pair<P,P>PPP;

const long long MOD=1e9+7;
const long long INF=5e18;
const int di[4]={1,0,-1,0};
const int dj[4]={0,1,0,-1};

#define fr first
#define sc second
#define pb push_back
#define eb emplace_back
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()

int n,a[100010],b[100010];
int zip[200010];
int ans;
vector<int>v;

void input(){
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i]>>b[i];
		v.eb(a[i]);
		v.eb(b[i]);
	}
	return;
}

void solve(){
	sort(ALL(v));
	v.erase(unique(ALL(v)),v.end());
	for(int i=0;i<n;i++){
		int st=lower_bound(ALL(v),a[i])-v.begin();
		int go=lower_bound(ALL(v),b[i]+1)-v.begin();
		zip[st]++;
		zip[go]--;
	}
	for(int i=0;i<200005;i++){
		zip[i+1]+=zip[i];
		ans=max(ans,zip[i]);
	}
	cout<<ans<<endl;
	return;
}

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


Measured memory_bytes: 5240
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
const double PI = 3.14159265358979323846;

int main() {
  int n;
  cin >> n;
  bool flag = true;
  rep(i, n) {
    int a;
    cin >> a;
    if(a % 2 == 0) {
      if(!(a % 3 == 0 || a % 5 == 0)) flag = false;
    }
  }
  if(flag) cout << "APPROVED" << endl;
  else cout << "DENIED" << endl;
  return 0;
}

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

int gcd(int c, int a) {
	if (a == 0) return c;
	return gcd(a, c % a);
}

int main() {
	int n; cin >> n;
	int c = 0;
	for (int i = 0; i < n; i++) {
		int a; cin >> a;
		c = gcd(c, a);
	}
	cout << c << endl;
}

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

const int N = 3010, P = 1e9 + 7, I2 = (P + 1) / 2;

int n, q, A[N], f[N][N], pw[N], ans;

int main() {
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; ++i)
    scanf("%d", A + i);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (i != j)
        f[i][j] = A[i] < A[j];
  for (int i = 1; i <= q; ++i) {
    int x, y; scanf("%d %d", &x, &y);
    f[x][y] = f[y][x] = 1ll * (f[x][y] + f[y][x]) * I2 % P;
    for (int j = 1; j <= n; ++j)
      if (j != x && j != y) {
        f[j][x] = f[j][y] = 1ll * (f[j][x] + f[j][y]) * I2 % P;
        f[x][j] = f[y][j] = 1ll * (f[x][j] + f[y][j]) * I2 % P;
      }
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j < i; ++j)
      ans = (ans + f[i][j]) % P;
  for (int i = 1; i <= q; ++i)
    ans = ans * 2 % P;
  std::cout << ans << std::endl;
  return 0;
}


Measured memory_bytes: 35584
#include<iostream>
#include<string.h>
#include<string>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<bitset>
#include<math.h>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef long double db;
typedef vector<int> vi;
typedef pair<int,int> pii;
const int N=300000+100;
const db pi=acos(-1.0);
#define lowbit(x) ((x)&(-x))
#define sqr(x) (x)*(x)
#define rep(i,a,b) for (register int i=a;i<=b;i++)
#define per(i,a,b) for (register int i=a;i>=b;i--)
#define go(u,i) for (register int i=head[u],v=sq[i].to;i;i=sq[i].nxt,v=sq[i].to)
#define fir first
#define sec second
#define mkp make_pair
#define pb push_back
#define maxd 998244353
#define eps 1e-8
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

inline ll readll()
{
    ll x=0;int f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

int n,L,x[N],t[N];
bool l[N],r[N];

int main()
{
    n=read();L=read();
    int ans=0;
    rep(i,1,n) x[i]=read();
    rep(i,1,n)
    {
        t[i]=read();
        if (t[i]%(L<<1))
        {
            int tmp=t[i]/(L<<1);
            ans+=(tmp+1);t[i]%=(L<<1);
            if (t[i]<=2*x[i]) l[i]=1;
            if (t[i]<=2*(L-x[i])) r[i]=1;
        }
        else ans+=t[i]/(L<<1);
    }
    int lcnt=0,cnt=0;
    rep(i,1,n-1)
    {
        if ((lcnt) && (r[i]))
        {
            lcnt--;ans--;
            if (l[i]) cnt++;
        }
        else if ((!l[i]) && (r[i]))
        {
            if (cnt) {cnt--;lcnt++;}
        }
        else if (l[i]) lcnt++;
    }
    if (!r[n]) ans++;
    printf("%lld\n",1ll*(L<<1)*ans);
    return 0;
}

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

#define REP(i, n) for(int (i)=0;(i)<(n);++(i))
#define MOD 1000000007

using namespace std;

typedef long long ll;

int main()
{
    ll N;
    cin >> N;
    vector<ll> A(N);
    REP(i, N) cin >> A[i];
    ll dp[N + 1][2];
    dp[0][0] = 0;
    dp[0][1] = -10e10;
    for (int i = 1; i <= N; ++i)
    {
        dp[i][0] = max(dp[i - 1][0] + A[i - 1], dp[i - 1][1] - A[i - 1]);
        dp[i][1] = max(dp[i - 1][0] - A[i - 1], dp[i - 1][1] + A[i - 1]);
    }

    cout << dp[N][0] << endl;
}


Measured memory_bytes: 2560
import java.util.*;

class Main{
    public static void main(String[] arg){
      Scanner sc = new Scanner(System.in);
      double a = sc.nextInt();
      double ans = 0;
      for(double i = 6; i > 0;i--){
        if(a >= Math.pow(2,i)){
          ans = Math.pow(2,i);
          break;
        }
      }
      if(a == 1){
        ans = 1;
      }
      System.out.println(Math.round(ans));
    }
}


Measured memory_bytes: 21844
n = int(input())
dig,d_min,d_max = 0,0,0
d_range = []
ans = ""
while not d_min <= n <= d_max:
    if dig%2 == 0:  d_max += 2**dig
    else:  d_min -= 2**dig
    dig += 1
    d_range.append([d_min,d_max])

for i in range(dig-1):
    check = n- (-2)**(dig-1-i)
    if not d_range[dig-2-i][0] <= check <= d_range[dig-2-i][1]:
        ans += "0"
    else:
        ans += "1"
        n = check
if n == 1:
    ans+="1"
else:
    ans += "0"

print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
  	int N;
  	cin >> N;
  	vector<long long> a(3*N);
  	for(int i=0;i<3*N;i++) cin >> a[i];
  	sort(a.begin(), a.end(), greater<long long>());
  	long long sum = 0;
  	for(int i=0;i<2*N;i++){
      	if(i%2 == 1) sum += a[i];
    }
  	cout << sum << endl;
}

Measured memory_bytes: 5584
from datetime import datetime as dt
tstr = input()
tdatetime  = dt.strptime(tstr, '%Y/%m/%d')
tstr = '2019/04/30'
heiseitime = dt.strptime(tstr, '%Y/%m/%d')
if heiseitime >= tdatetime:
  print("Heisei")
else:
  print("TBD")

Measured memory_bytes: 10296
#include "bits/stdc++.h"
using namespace std;

int main(){
  int a,b;
  while(1){
    cin>>a>>b;
    if(a==0&&b==0)break;
    for(int i=0;i<a;i++){
      for(int j=0;j<b;j++){
        cout<<"#";
      }
      cout<<endl;
    }
    cout<<endl;
  }
}



Measured memory_bytes: 3084
#include "bits/stdc++.h"

#define MOD 1000000007
#define rep(i, n) for(ll i=0; i < (n); i++)
#define ALL(v) v.begin(),v.end()
#define DUMP(i, v)for(ll i=0;i<v.size();i++)cout<<v[i]<<" "

using namespace std;
typedef long long int ll;
typedef vector<ll> llvec;
typedef vector<double> dvec;
typedef pair<ll, ll> P;
struct Edge{ll from, to, cost;};
struct node{ll cost, to;
  bool friend operator>(node a, node b){
    return a.cost>b.cost;
  }
};

ll mod(ll a, ll mod){
  ll res = a%mod;
  if(res<0)res=res + mod;
  return res;
}

ll modpow(ll a, ll n, ll mod){
  ll res=1;
  while(n>0){
    if(n&1) res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll modinv(ll a, ll mod){
  return modpow(a, mod-2, mod);
}

ll gcd(ll a, ll b){
  ll r = a%b;
  if(r==0) return b;
  else return gcd(b, a%b);
}

bool is_prime(ll n){
  ll i = 2;
  if(n==1)return false;
  if(n==2)return true;
  bool res = true;
  while(i*i <n){
    if(n%i==0){
      res = false;
    }
    i = i+1;
  }

  //if(i==1)res = false;
  if(n%i==0)res=false;
  return res;
}


/**************************************
** A main function starts from here  **
***************************************/
int main(){
  ll a, b, c, d, e, N;
  cin >> N >> a >> b >> c >> d >> e;
  a = min(a, b);
  a = min(a, c);
  a = min(a, d);
  a = min(a, e);
  cout << (N+a-1)/a - 1 + 5;
  return 0;
}


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

typedef unsigned long long uLL;
typedef long long int LL;
typedef pair <int,int> pii;
typedef pair <int,pii> piii;
typedef pair <long long,long long> pll;
typedef pair <long long,pll> plll;
const int N = 1e5 + 5;
const int inf = 1e9;
const long long INF = 1e18;
const double PI = acos(-1.0);
const double EPS = 1e-8;
const int MOD = 1000000007;

int n , k;
int a[ N ];
int dp[ N ];

int can( int rem ) {
        if( rem == 0 ) return 1;
        if( dp[rem] != 0 ) return dp[rem];
        for( int i = 1; i <= n; i++ ) {
                if( a[i] <= rem ) {
                        if( can( rem - a[i] ) == 1 ) return dp[rem] = 2;
                }
        }
        return dp[rem] = 1;
}
int main( int argc , char const *argv[] ) {
        ios_base::sync_with_stdio( false ); cin.tie( NULL );
        cin >> n >> k;
        for( int i = 1; i <= n; i++ ) cin >> a[i];
        int f = 0;
        for( int i = 1; i <= n; i++ ) {
                f = can( k - a[i] );
                if( f == 1 ) break;
        }
        if( f == 1 ) cout << "First" << endl;
        else cout << "Second"<< endl;
        return 0;
}













Measured memory_bytes: 3840
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)


signed main() {
    ll A;
     cin >> A;
/*
   string B;
    cin >> B;

    B[1] = B[2];
    B[2] = B[3];
    B[3] = '\0';
    ll num = atoi(B.c_str());
*/
    double B;
    cin >> B;
    ll num = B*100 + 0.9;

    A *= num;
    A /= 100;

    cout << A << endl;
}

Measured memory_bytes: 3724
i = []
for _ in range(3):
    a,b = map(int,input().split())
    i.append(a)
    i.append(b)
if (1 <= i.count(1) and i.count(1) <= 2) and (1 <= i.count(2) and i.count(2) <= 2) and (1 <= i.count(3) and i.count(3) <= 2) and (1 <= i.count(4) and i.count(4) <= 2):
    print ("YES")
else:
    print ("NO")

Measured memory_bytes: 3064
#                         author:  kagemeka 
#                         created: 2019-11-07 12:33:44(JST)
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator

def main():
    a, b, c, x, y = (int(i) for i in sys.stdin.readline().split())
    if a + b <= c * 2:
        cost = a * x + b * y
    elif x >= y:
        atleast = y
        cost = c * atleast * 2
        remainder = x - atleast
        if a <= c * 2:
            cost += a * remainder
        else:
            cost += c * remainder * 2
    else:
        atleast = x
        cost = c * atleast * 2
        remainder = y - atleast
        if b <= c * 2:
            cost += b * remainder
        else:
            cost += c * remainder * 2 
    
    print(cost)
    
if __name__ == "__main__":
    # execute only if run as a script
    main()


Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        if(a<b) {
            if(b<c){
                System.out.printf("%d %d %d\n", a, b, c);
            }else if(a<c){
                System.out.printf("%d %d %d\n", a, c, b);
            }else{
                System.out.printf("%d %d %d\n", c, a, b);
            }
        }else{
            if(a<c) {
                System.out.printf("%d %d %d\n", b, a, c);
            }else if(b<c) {
                System.out.printf("%d %d %d\n", b, c, a);
            }else {
                System.out.printf("%d %d %d\n", c, b, a);
            }
        }
    }
}


Measured memory_bytes: 26340
program c

integer :: n,i(6),j(5),sum,delta,max_itr=100000
integer :: jj(5) = (/ 9**1, 9**2, 9**3, 9**4, 9**5 /)
integer :: ii(6) = (/ 6**1, 6**2, 6**3, 6**4, 6**5, 6**6 /)
read(*,*) n

do i1=0,5
do i2=0,5
do i3=0,5
do i4=0,5
do i5=0,5
do i6=0,2
do j1=0,5
do j2=0,5
do j3=0,5
do j4=0,5
do j5=0,1
 
delta = n - (i1*6**1 + i2*6**2 + i3*6**3 + i4*6**4 + i5*6**5 + i6*6**6 + j1*9**1 + j2*9**2 + j3*9**3 + j4*9**4 + j5*9**5)

if(delta >= 0 .and. delta <= 6) then
max_itr = min(max_itr, delta+i1+i2+i3+i4+i5+i6+j1+j2+j3+j4+j5)
endif

enddo
enddo
enddo
enddo
enddo
enddo
enddo
enddo
enddo
enddo
enddo

write(*,*) max_itr

end program

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

#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s); i<(long long)(n);i++)
#define mod 1000000007
typedef long long ll;

int main() {
    string s;cin>>s;
    if(s=="Sunny"){
        cout<<"Cloudy"<<endl;
    }
    else if(s=="Cloudy"){
        cout<<"Rainy"<<endl;
    }
    else{
        cout<<"Sunny"<<endl;
    }

}


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

int main (){
    string S;
    cin >> S;
    int ans = 0;
    for (int i = 0; i < S.length() - 1; i++)
    {
        if (S[i] != S[i + 1])
        {
            ans++;
        }
        
    }
    cout << ans << endl;
    return 0;
    
}

Measured memory_bytes: 512
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main() {
	int N;
	cin >> N;
	vector<string> S(N + 1);
	for (int i = 0; i < N;i++) {
		cin >> S[i];
		sort(S[i].begin(), S[i].end());
	}
	sort(S.begin(), S.end());
	reverse(S.begin(), S.end());
	long long int count = 0;
	long long int ans = 0;
	for (int i = 0; i < N; i++) {
		if (S[i] == S[i + 1]) {
			count++;
		}
		else {
			count++;
			ans += count * (count - 1) / 2;
			count = 0;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 7296
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#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 bg begin()
#define ed end()
#define rbg rbegin()
#define red rend()
#define all(x) x.bg,x.ed
#define rall(x) x.rbg,x.red
#define pb push_back
#define pf push_front
#define eb emplace_back
using namespace std;
typedef long long ll;
template<class t,class u> bool chmax(t&a,u b){if(a<b){a=b; return true;} return false;}
template<class t,class u> bool chmin(t&a,u b){if(a>b){a=b; return true;} return false;}
template<class t,class u> t MAX(t a,u b){if(a>=b) return a; return b;}
template<class t,class u> t MIN(t a,u b){if(a<=b) return a; return b;}
template<class t> int SIZE(t s){return (int)s.size();}
template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;
using vvi=vc<vc<int>>;
using pi=pair<int,int>;
using vi=vc<int>;
void yes(){ cout << "Yes" << endl; }
void no(){ cout << "No" << endl; }
const long long INF = 1LL << 60;

int main(){
    cout << fixed << setprecision(20);
    ll n; cin >> n;
    ll ans = 0;
    rng(i,1,n+1){
        ll mi = i; ll a = n/i;
        ll ma = a*i;
        ans += ((mi+ma) * a) / 2;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
constexpr ll mod=1e9+7;

int main()
{
  ll n;
  cin>>n;
  vector<ll> a(n);
  ll r=-1,g=-1,b=-1;
  ll ans=1;
  for (ll i = 0; i < n; ++i)
  {
    ll a;
    cin>>a;
    ll cnt=0;
    cnt+=(r==a-1)? 1:0;
    cnt+=(g==a-1)? 1:0;
    cnt+=(b==a-1)? 1:0;
    ans*=cnt;
    ans%=mod;
    if(r==a-1) r=a;
    else if(g==a-1) g=a;
    else if(b==a-1) b=a;
    else 
    {
      cout<<0<<endl;
      return 0;
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 1024
#include <stdio.h>
main()
{
  int x ,y;
  while(1){
    scanf("%d %d",&x, &y);
    if(x==0 && y==0)break;
    if(x<=y){printf("%d %d\n", x, y);}
    if(x>y){printf("%d %d\n", y, x);}
}
  
}

Measured memory_bytes: 1028
N = int(input())
L = [0 for i in range(200)]
L[0] = 1

for i in range(101):
	if L[i] == 1:
		L[i + 4] = 1
		L[i + 7] = 1

if L[N] == 1:
	print("Yes")
else:
	print("No")

Measured memory_bytes: 3060
#include <stdio.h>

int linearSearch(int A[], int n, int key);



int main()
{
  
  int i;
  int n;
  int q;
  int A[10000+1];
  int key;
  int kei = 0;

  scanf("%d",&n);
  for( i = 0 ; i < n; i++){
    scanf("%d",&A[i]);
  }

  scanf("%d",&q);
  for( i = 0; i < q; i++){
    scanf("%d",&key);
    if(linearSearch(A,n,key))kei++;
    
  }
  printf("%d\n",kei);

  return 0;
    
}


int linearSearch( int A[], int n, int key)
{

  int i = 0;
  A[n] = key;
  while( A[i] != key)
    i++;
  return i!=n;
  
}



Measured memory_bytes: 2104
N = int(input())
flag = 0
ans = 0
for i in range(N):
    a,b = map(int,input().split())
    if a == b:
        ans += 1
        if ans == 3:
            flag += 1
            break
    else:
        ans = 0
print("Yes") if flag == 1 else print("No")

Measured memory_bytes: 9172
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll t,a,b,i,j,k,n,x;
    vector<ll>v;
    for(i=0;i<3;i++)
    {
        cin>>k;
        v.push_back(k);
    }
    sort(v.begin(),v.end());
    ll c=1;
    if(v[0]!=v[1])
    {
        c++;
    }
    if(v[1]!=v[2])
    {
        c++;
    }
    cout<<c<<endl;
    return 0;
}


Measured memory_bytes: 3628
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
   
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    string ans;
    for (int i = 0; i < k; i++) {
        string s1 = ans;
        string s2 = s;
        reverse(s.begin(), s.end());
        s2 += s;
        string s3 = s2;
        reverse(s3.begin(), s3.end());
        vector<string> vec, vec1;
        for (int i = 0; i <= n; i++) {
            vec.emplace_back(s2.substr(i, n));
        }
        for (int i = 0; i <= n; i++) {
            vec1.emplace_back(s3.substr(i, n));
        }
        sort(vec.begin(), vec.end());
        sort(vec1.begin(), vec1.end());
        ans = vec[0];
        if (ans == s1) {
            cout << s << endl;
            return 0;
        }
        s = vec1[0];
        reverse(s.begin(), s.end());
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 52816
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <utility>
#include <iomanip>  // std::setprecision()
using namespace std;
using ll = long long;
#define rep(i,a,b) for(int i=(a); i<(b); i++)
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define pai 3.14159265358979323846
ll gcd(ll a, ll b){if (a%b == 0)  return(b);else  return(gcd(b, a%b));}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}
/* map<string,int> */
/* 大文字を小文字に変換 tolower*/
/* 小文字を大文字に変換 toupper*/
/* 辞書順 next_permutation(a.begin(),a.end()) */
 
int main() {
    int x ,n;
    cin >> x >> n;
    vector <int> p(n);
    int mi = 10000;
    for (int i =0;i<n;i++) {
        cin >> p[i];
    }
    if (find(p.begin(),p.end(),x) != p.end() ) {
    } else {
        cout << x << endl;
        return 0;
    }
    int i =0;
    while(1) {
        if (find(p.begin(),p.end(),x-i) != p.end() ) {
        } else {
            cout << x-i << endl;
            return 0;
        }
        if (find(p.begin(),p.end(),x+i) != p.end() ) {
        } else {
            cout << x+i << endl;
            return 0;
        }
        i++;
    }
}

Measured memory_bytes: 3192
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
using namespace std;
using ll = long long;
using P = pair<int,int>;

ll ct(ll h){
   if(h==1) return 1;
   return 1+ct(h/2)*2;
}

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

   cout<<ct(h)<<endl;
   return 0;
}


Measured memory_bytes: 3632
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(ll i = (ll)(s); i < (ll)(t); i++)
#define rrep(i,s,t) for(ll i = (ll)(s-1);(ll)(t) <= i; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
constexpr ll INF = numeric_limits<ll>::max()/4;
constexpr ll n_max = 2e5+10;
#define int ll

template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string &s) {return '"' + s + '"';}
string to_string(const char *c) {return to_string((string) c);}
string to_string(bool b) {return (b ? "true" : "false");}
template <size_t N>
string to_string(bitset<N> v){
    string res = "";
    for(size_t i = 0; i < N; i++) res += static_cast<char>('0' + v[i]);
    return res;
}
template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for(const auto &x : v) {
        if(!first) res += ", ";
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p){return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}

void debug_out() {cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

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

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n,m,q; cin >> n >> m >> q;
    string s[n];
    rep(i,0,n)cin >> s[i];
    vector sum(n+1, vector<ll>(m+1));
    vector rs(n+1, vector<ll>(m+1)), ds(n+1, vector<ll>(m+1));
    rep(i,0,n)rep(j,0,m){
        sum[i+1][j+1] = sum[i][j+1] + sum[i+1][j] - sum[i][j] + (s[i][j] == '1');
        rs[i+1][j+1] = rs[i][j+1] + rs[i+1][j] - rs[i][j];
        ds[i+1][j+1] = ds[i][j+1] + ds[i+1][j] - ds[i][j];
        if(j + 1 < m && s[i][j] == '1' && s[i][j+1] == '1'){
            rs[i+1][j+1] += 1;
        }
        if(i+1 < n && s[i][j] == '1' && s[i+1][j] == '1'){
            ds[i+1][j+1] += 1;
        }
    }

    debug(sum);
    debug(rs);
    debug(ds);

    auto calc = [&](vvl &sum, ll xs, ll ys, ll xe, ll ye){
        return sum[xe][ye] - sum[xs][ye] - sum[xe][ys] + sum[xs][ys];
    };

    rep(i,0,q){
        ll xs,ys; cin >> xs >> ys;
        ll xe,ye; cin >> xe >> ye;
        xs--;ys--;
        ll ans = calc(sum, xs, ys, xe, ye);
        debug(ans);
        ans -= calc(rs, xs,ys,xe,ye-1);
        ans -= calc(ds, xs,ys,xe-1,ye);

        cout << ans << "\n";
    }
}

Measured memory_bytes: 101676
#include<stdio.h>
int main()
{
int a,b,c,i;
  c=0;
  scanf("%d",&a);

  for(i=0;i<a+1 && c==0;++i)
  {
    b=i*1.08;
   if(b==a) {printf("%d",i);
                 c++;}
   }
 
if(c==0) printf(":(");
   
return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false), cin.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'

using namespace std;

main()
{
    fast;
    int n,i;
    cin>>n;
    ll a[n],pre[n],tot=0,ans=INT_MAX;
    for (i=0;i<n;i++)
    {
        cin>>a[i];
        tot+=a[i];
        if (i==0)
            pre[i]=a[i];
        else
            pre[i]=pre[i-1]+a[i];
    }
    for (i=0;i<n-1;i++)
        ans=min(ans,abs(pre[i]-(tot-pre[i])));
    cout<<ans<<endl;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll a,b,c;cin >> a >> b >> c;
	if(a+b>=c || b>=c) cout << b+c << endl;
	else cout << b+min(c,a+b+1) << endl;
}

Measured memory_bytes: 256
n=int(input())
l=input().rstrip().split()
m=int(input())
ans=[]
A=0
for i in range(m):
    p,x=[int(i) for i in input().rstrip().split()]
    for j in range(len(l)):
        if p-1==j:
            A+=x
        else:
            A+=int(l[j])
    ans.append(A)
    A=0

for i in range(len(ans)):
    print(ans[i])

Measured memory_bytes: 3064