akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define f(i,a,b) for(register int i=a;i<=b;++i)
#define ff(i,a,b) for(register int i=a;i>=b;--i)
#define debug(x) cerr << #x << " : " << x << " " << endl
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
const ll mod = 998244353;
const ll mod1 = 2e18 + 7;
const double tiaohe = 0.57721566490153286060651209;
const int inf = 0x3f3f3f3f;
ll oula(ll x) { ll res = x;f(i, 2, x / i) { if (x % i == 0) { res = res / i * (i - 1);while (x % i == 0) x /= i; } }if (x > 1) res = res / x * (x - 1);return res; }
ll quickmod(ll a, ll n, ll m) { ll s = 1;while (n) { if (n & 1) { s = s * a % m; }a = (a*a) % m;n = n / 2; }return s; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
void ex_gcd(ll a, ll b, ll &x, ll &y, ll &d) { if (!b) { d = a, x = 1, y = 0; } else { ex_gcd(b, a % b, y, x, d);y -= x * (a / b); } }
ll inv(ll t, ll p) { ll d, x, y;ex_gcd(t, p, x, y, d);return d == 1 ? (x % p + p) % p : -1; }
//double a = log(n) +tiaohe + 1.0 / (2 * n);
double eqa = (1 + sqrt(5.0)) / 2.0;
const int N = 6e5 + 5;
int t;
double a[N];
int main()
{
	//freopen("in.txt", "r", stdin);
	int n, k;
	while (cin >> n >> k)
	{
		f(i, 1, n)scanf("%lf", &a[i]), a[i] = (a[i]+1)/2;
		//f(i, 1, n)cout << a[i] << endl;
		double ans = 0;
		f(i, 1, k)ans += a[i];
		//debug(ans);
		double now = ans;
		f(i, 1, n - k)
		{
			now -= a[i];
			now += a[i + k];
			ans = max(ans, now);
		}
		printf("%.8lf\n", ans);
	}
	return 0;
}

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

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	ll N,M,X;
	cin>>N>>M>>X;
	vector<ll> C(N);
	ll A[N][M];
	rep(i,N){
		cin>>C[i];
		rep(j,M){
			cin>>A[i][j];
		}
	}
	// cout<<A[0][M-1];
	ll ans = -1;
	ll n = 1;
	rep(i,N){
		n *= 2;
	}
	
	ll tmp_ans;
	rep(i,n){
		tmp_ans = 0;
		vector<ll> v(M);
		// rep(j,M){
		// 	v[i]=0;
		// }
		ll b = i;
		rep(j,N){
			if(b%2==1){
				rep(k,M){
					v[k] += A[j][k];
				}
				tmp_ans += C[j];
			}
			b/=2;
		}
		// rep(j,M){
		// 	cout<<v[j]<<" ";
		// }
		// cout<<"\n";
		bool flag = true;
		rep(j,M){
			if(v[j]< X){
				flag = false;
			}
		}
		// cout<<flag;
		if(flag == true){
			// cout<<tmp_ans<<"\n";
			// rep(j,M){
			// 	cout<<v[i]<<" ";
			// }
			if(ans != -1){
				ans = min(ans,tmp_ans);
			}else{
				ans = tmp_ans;
			}
		}
	}

	cout<<ans<<"\n";
	// cout<<X;

	
	return 0;
}


Measured memory_bytes: 3660
/*
    Author - Param Kothari
    Ah shit, here we go again
*/

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

#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define mk make_pair

typedef long long ll;
typedef long double ld;

void solve(){
    string s;
    cin >> s;
    if(s.back() == 's'){
        s += "es";
    }
    else{
        s += "s";
    }
    cout << s << "\n";
    return;
}

int main(){
    IOS;
    int t = 1;
    // cin >> t;
    for(int i = 1; i <= t; i++){
        solve();
    }
    return 0;
}

Measured memory_bytes: 3648
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.IO.Compression;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
using Console = System.Console;

namespace Atcoder
{

    class Program
    {
        private const long COMDIV = 1000000007;

        static void Main(string[] args)
        {
            var ABC = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var A = ABC[0];
            var B = ABC[1];
            var C = ABC[2];

            var K = int.Parse(Console.ReadLine());
            for (int i = 0; i <= K; i++)
            {
                if (C > B && B > A)
                {
                    Console.WriteLine("Yes");
                    return;
                }

                if (B <= A)
                {
                    B *= 2;
                    continue;
                }

                if (C <= B)
                {
                    C *= 2;
                    continue;
                }
            }

            Console.WriteLine("No");
        }
    }
}

Measured memory_bytes: 28256
#include <stdio.h>

int pow[100001];

long long div_mod(long long x, long long y, long long z)
{
	if (x % y == 0) return x / y;
	else return (div_mod((1 + x / y) * y - x, (z % y), y) * z + x) / y;
}

long long recursion(char S[], int N, int P)
{
	if (N == 0) return 0;
	else if (N == 1) {
		if ((S[0] - '0') % P == 0) return 1;
		else return 0;
	}
	
	int i, k, tmp;
	static int count[10000] = {}, appear[10000] = {};
	long long ans = recursion(S, N / 2, P) + recursion(&(S[N/2]), (N + 1) / 2, P);
	for (i = N / 2 - 1, k = 0, tmp = 0; i >= 0; i--) {
		tmp = (tmp + pow[N/2-i] * (S[i] - '0')) % P;
		if (count[tmp] == 0) appear[k++] = tmp;
		count[tmp]++;
	}
	for (i = 0, tmp = 0; i < (N + 1) / 2; i++) {
		tmp = (tmp * 10 + (S[N/2+i] - '0')) % P;
		if (tmp == 0) ans += count[0];
		ans += count[div_mod(P - tmp, pow[i], P)];
	}
	for (i = 0; i < k; i++) count[appear[i]] = 0;
	return ans;
}

int main()
{
	int i, N, P;
	char S[200001];
	scanf("%d %d", &N, &P);
	scanf("%s", S);
	
	long long ans = 0;
	if (P == 2 || P == 5) {
		for (i = 0; i < N; i++) if ((S[i] - '0') % P == 0) ans += i + 1;
		printf("%lld\n", ans);
		fflush(stdout);
		return 0;
	}
	
	for (i = 1, pow[0] = 1; i <= N / 2; i++) pow[i] = pow[i-1] * 10 % P;
	printf("%lld\n", recursion(S, N, P));
	fflush(stdout);
	return 0;
}

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

signed main(){
	string N;
	int i, sum = 0;
	cin >> N;
	for(i = 0; i < N.size(); i++){
		sum += (int)(N[i] - '0');
	}
	if(sum % 9 == 0){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 3704
#include <stdio.h>

int main(void){
  char s[3];
  int i,ans=0;
  
  scanf("%s",s);
  for(i=0; i<3; i++){
    if(s[i]=='R') ans++;
  }
  if(ans==2){
    if(!(s[0]==s[1] || s[1]==s[2])) ans--;
  }
  printf("%d",ans);
  return 0;
}

Measured memory_bytes: 1728
import sys
input = sys.stdin.readline
n,Q=map(int,input().split())
b_num = 2**(n-1).bit_length()
mx = 10**9
segl=[mx]*2*b_num 
def update(k, x):
    k += b_num-1
    segl[k] = x
    while k+1:
        k = (k-1)//2
        segl[k] = min(segl[k*2+1],segl[k*2+2])
if __name__ == '__main__':
    xs = []
    for i in range(n):
        s,t,x=map(int,input().split())
        xs += [(s-x,True,x,i), (t-x,False,x,i)]
    qs = []
    for _ in range(Q):
        qs.append(int(input()))
    xs.sort(key=lambda x:x[0])
    j = 0
    for x in xs:
        while Q-j:
            if qs[j] < x[0]:
                print(segl[0] if segl[0]!= mx else -1)
                j += 1
                continue
            break
        update(x[3], x[2] if x[1] else mx)
    while Q-j:
        print(-1)
        j+=1


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

#define vec                vector<int>
#define vecll              vector<ll>
#define vecd               vector<double>
#define vecst              vector<string>
#define vecb               vector<bool>
#define vec2(var, n, m)    vector<vector<int>>  var(n, vector<int>(m, 0))
#define vecb2(var, n, m)   vector<vector<bool>> var(n, vector<bool>(m, false))
#define vecll2(var, n, m)  vector<vector<ll>>   var(n, vector<ll>(m, INF))

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define arrst(var, n)    vecst var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define uniqueall(v)     v.erase(unique(v.begin(), v.end()), v.end());
#define f_sum(var)       accumulate(all(var), 0)
#define f_sumll(var)     accumulate(all(var), 0LL)
#define chmin(v1, v2)    v1 = min(v1, v2)
#define chmax(v1, v2)    v1 = max(v1, v2)
#define pb(var)          push_back(var)
#define prt(var)         cout << (var) << "\n"
#define prtd(n, var)     cout << fixed << setprecision(n) << (var) << "\n"
#define prtfill(n, var)  cout << setw(n) << setfill('0') << (var);
#define prt2(v1, v2)     cout << (v1) << " " << (v2) << "\n"
#define prt3(v1, v2, v3) cout << (v1) << " " << (v2) << " " << (v3) << "\n"
#define prtall(v)        rep(i,v.size()){cout<<v[i]<<(i!=v.size()-1?" ":"\n");}
void prtok(bool ok){prt(ok ? "Yes" : "No");}
//----------------------------------------------------------------

int main(void) {
  vec v = {-1, 0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0};
  int x, y;
  cin >> x >> y;
  prtok(v[x]==v[y]);

}


Measured memory_bytes: 3584
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <sstream>
#include <cmath>
#include <functional>
#include <fstream>
#include <cstdlib>
typedef long long ll;
const int MOD = 1e9+7;


#define REP(i, N) for (int i = 0; i < (N); i++)
#define REPP(i, a, b) for (int i = (a); i < (b); i++)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define VSORT(c) sort((c).begin(),(c).end())
#define SZ(x) ((int)(x).size())
//vvintを作る　マクロで　 #define vvint(N,M) vector<vector<int>>

using namespace std;


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

    string s;
    cin >> s;

    string lst = "ACGT";
    int count = 0,max = 0;
    for(int i = 0; i < s.length();i++){
        if(lst.find(s[i]) == string::npos){
            count = 0;
        }else{
            count++;
            if(count > max) max = count;
        }
    }
    cout << max << endl;
    

    return 0;
}

Measured memory_bytes: 256
import java.util.*;

class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int n,d;                // n:number, d:direction
        int minX, MaxX, minY, MaxY;
        while(N != 0){
            int[][] kaiga = new int[399][399];
            int[] ZahyouX = new int[N];
            int[] ZahyouY = new int[N];
            
            for(int i = 0; i<kaiga.length; i++){
                for(int j = 0; j<kaiga[i].length; j++){
                    kaiga[i][j] = 0;
                }
            }
            
            kaiga[200][200] = 1;
            ZahyouX[0] = 200;
            ZahyouY[0] = 200;
            
            for(int i = 1; i<N; i++){
                n = sc.nextInt();
                d = sc.nextInt();
                if(d==0){
                    ZahyouX[i] = ZahyouX[n] - 1;
                    ZahyouY[i] = ZahyouY[n];
                }else if(d==1){
                    ZahyouX[i] = ZahyouX[n];
                    ZahyouY[i] = ZahyouY[n] + 1;
                }else if(d==2){
                    ZahyouX[i] = ZahyouX[n] + 1;
                    ZahyouY[i] = ZahyouY[n];
                }else if(d==3){
                    ZahyouX[i] = ZahyouX[n];
                    ZahyouY[i] = ZahyouY[n] - 1;
                }
                kaiga[ZahyouY[i]][ZahyouX[i]] = 1;
            }
            exit1:
            for(int i=0;;i++){
                for(int j=0;j<398;j++){
                    if(kaiga[i][j]==1){
                        minY = i;
                        break exit1;
                    }
                }
            }
            exit2:
            for(int i=398;;i--){
                for(int j=0;j<398;j++){
                    if(kaiga[i][j]==1){
                        MaxY = i;
                        break exit2;
                    }
                }
            }
            exit3:
            for(int i=0;;i++){
                for(int j=0;j<398;j++){
                    if(kaiga[j][i]==1){
                        minX = i;
                        break exit3;
                    }
                }
            }
            exit4:
            for(int i=398;;i--){
                for(int j=0;j<398;j++){
                    if(kaiga[j][i]==1){
                        MaxX = i;
                        break exit4;
                    }
                }
            }
            int LengthOfX = MaxX - minX + 1;
            int LengthOfY = MaxY - minY + 1;
            System.out.println(LengthOfX + " " + LengthOfY);
            
            N = sc.nextInt();
        }
        
    }
}

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

string s[200];
int n, m;

int main(){
	for(int i=1; i<=2; i++){
		cin>>s[i];
		s[i]='0'+s[i];
	}
	
	for(int i=1; i<=3; i++){
		if(s[1][4-i]!=s[2][i]){
			cout<<"NO"<<endl;
			return 0;
		}
	}
	
	cout<<"YES"<<endl;
	return 0;
}


Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string str, a, i, u, e, o;
  a = "a"; i = "i"; u = "u"; e = "e"; o = "o";
  cin >> str;
  if(str == a || str == i || str == u || str == e || str == o){
    cout << "vowel" << endl;
  }
  else{
    cout << "consonant" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define maxs(a, b) a = max(a, b)
#define mins(a, b) a = min(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll linf = (1ll << 61);
const int inf = 1001001001;
const int mod = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n;
	cin >> n;
	vector<ll> rec;
	for (ll i = 1; i * i <= n; ++i) {
		if (n % i == 0) {
			rec.push_back(i);
			if (i * i != n) rec.push_back(n / i);
		}
	}
	ll ans = 0;
	for (ll c : rec) {
		if (c - 1LL <= 1) continue;
		ll tmp1 = n / (c - 1LL);
		ll tmp2 = n % (c - 1LL);
		if (tmp1 == tmp2) ans += c - 1;
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 384
// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで

#include <bits/stdc++.h>
#define mod 1000000007
#define INF LLONG_MAX
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};

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

    ll  a,b,c,d,e,n,k,maxi=0,f=0,mini=INF,sum=0,q;
	string str,stra,ko;
    ll x,y,w,z;
    char hoge,fuga;
    cin>>str;
    if(str[0]==str[1]&&str[1]==str[2]||str[3]==str[1]&&str[1]==str[2]) Yes;
    else No;

    return 0;
}


Measured memory_bytes: 3648
import java.util.*;
class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
        String S = stdIn.next();
	char[] c = new char[4];
	int flag =0;
	for(int i=0;i<3;i++){
	    if(S.charAt(i)==S.charAt(i+1)){
		flag++;
	        System.out.println("Bad");
		break;
	    }
	}
	if(flag==0){
	    System.out.println("Good");
	}   
    }
}


Measured memory_bytes: 21844
n, a = list(map(int, input().strip().split(' ')))
d = list(map(int, input().strip().split(' ')))

even = sum([1 for i in d if i%2==0])
odd  = sum([1 for i in d if i%2==1])
ret = 0
if odd == 0:
    if a == 0:
        ret = 2**even
else:
    ret = (2**even) * (2**(odd-1))
print(ret)

Measured memory_bytes: 3064
N = gets.to_i
S = gets.chomp


["SS","SW","WS","WW"].each{ |s|
  #$stderr.puts s
  (0...N).each{ |i|
    j = (i+1+N)%N
    s << ((s[-2] == "S") ^ (s[-1] == "W") ^ (S[j] == "x") ? "S" : "W")
  }
  #$stderr.puts s
  next if s[0..1] != s[-2..-1]
  puts s[0...N]
  exit
}
p -1


Measured memory_bytes: 2556
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
ABC = [list(map(int, input().split())) for _ in range(m)]
dist = [-float("inf")]*(n+1)
dist[1] = 0
for i in range(n):
  for a, b, c in ABC:
    if dist[b] < dist[a]+c:
      if i == n-1 and b == n:
        print("inf")
        exit()
      dist[b] = dist[a]+c
ans = dist[n]
print(ans)

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

int main() {
    int N, x;
    string S;
    cin >> N;

    for (int i = 0; i < N; i++){
        cin >> S;
        if(S != "Y"){
            x = true;
        }
        else{
            x = false;
            break;
        }
    }
    if(x == true){
        cout << "Three";
    }
    else if(x == false){
        cout << "Four";
    }
}
    


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        List<String> list = new ArrayList<String>();
        //入力
        while(true){
            String inputNum = sc.next();
            if(inputNum.equals("0")) break;
            list.add(inputNum);
        }
        
        Calculation calc = new Calculation();
        for(int i = 0; i < list.size(); i++){
            System.out.println(calc.changeIntCalc(list.get(i)));
        }
    }
}

class Calculation{
    public int changeIntCalc(String listNum){
        int charCut = 0;
        String[] strArray = listNum.split("");
        for(int count = 0; count < listNum.length(); count++){
            charCut += Integer.parseInt(strArray[count]);
        }
        return charCut;
    }
}


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

using namespace std;

const int MOD=1e9+7;
//const int MOD=998244353;

const double PI=3.14159265359;

vector<long long> len(51), pct(51);

long long getAns(int i, long long x){
    if(!i || !x) return x;
    
    if(x<=len[i-1]+1) return getAns(i-1,x-1);
    
    if(x==len[i-1]+2) return 1+pct[i-1];
    
    if(x==len[i]) return pct[i];
    
    return 1+pct[i-1]+ getAns(i-1,x-2-len[i-1]);
}


int main(){
    
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int n;
    long long x;
    cin>>n>>x;
    
    
    
    len[0]=1;
    pct[0]=1;
    for(int i=1; i<=50; i++){
        len[i]=3+2*len[i-1];
        pct[i]=1+2*pct[i-1];
        
    }
    
    cout<<getAns(n,x);
    
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <queue>
using namespace std;

#define N 30

static struct D
{
  int lf;
  int rt;
  int up;
  int dn;
  int mk;
  D ( ) { this->lf = this->rt = this->up = this->dn = 1; this->mk = 0; }
} d[ N ][ N ];
static int w;
static int h;

struct S
{
  int x;
  int y;
  int s;
  S ( int x, int y, int s ) { this->x = x; this->y = y; this->s = s; }
};

int
main (
  int   argc,
  char *argv[ ]
  )
{
  int i, j;

  for ( ; ; )
  {
    queue<S> lis;
    int res = 0;

    scanf ( "%d%d", &w, &h );
    if ( w == 0 && h == 0 )
      break ;

    for ( i = 0; i < h; ++i )
    for ( j = 0; j < w; ++j )
      d[ j ][ i ] = D ( );

    for ( i = 0; i < h; ++i )
    {
      for ( j = 0; j < w - 1; ++j )
      {
        scanf ( "%d", &d[ j ][ i ].rt );
        d[ j + 1 ][ i ].lf = d[ j ][ i ].rt;
      }

      if ( i < h - 1 )
      for ( j = 0; j < w; ++j )
      {
        scanf ( "%d", &d[ j ][ i ].dn );
        d[ j ][ i + 1 ].up = d[ j ][ i ].dn;
      }
    }

    lis.push ( S ( 0, 0, 1 ) );
    while ( !lis.empty ( ) )
    {
      const S s = lis.front ( );
      lis.pop ( );

      if ( s.x == w - 1 && s.y == h - 1 )
      {
        res = s.s;
        break ;
      }
      if ( d[ s.x ][ s.y ].mk )
        continue ;
      d[ s.x ][ s.y ].mk = 1;

      if ( d[ s.x ][ s.y ].lf == 0 ) lis.push ( S ( s.x - 1, s.y, s.s + 1 ) );
      if ( d[ s.x ][ s.y ].rt == 0 ) lis.push ( S ( s.x + 1, s.y, s.s + 1 ) );
      if ( d[ s.x ][ s.y ].up == 0 ) lis.push ( S ( s.x, s.y - 1, s.s + 1 ) );
      if ( d[ s.x ][ s.y ].dn == 0 ) lis.push ( S ( s.x, s.y + 1, s.s + 1 ) );
    }
    printf ( "%d\n", res );
  }

}

Measured memory_bytes: 1072
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int N;
int A[15];
int x[15][14];
int y[15][14];
int ju[15];

void input(){
    
    cin>>N;
    for(int i=0;i<N;i++){
        cin>>A[i];
        for(int j=0;j<A[i];j++)cin>>x[i][j]>>y[i][j];
    } 
}
int count(int x){
    if(x==0)return 0;
    return (x&1)+count(x>>1);
}

void solve(){
    int pure=0;
    
    for(int i=0;i<(1<<N);i++){
        bool jud=true;
        for(int j=0;j<N;j++){
            if(!((1<<j)&i))continue;
            for(int k=0;k<A[j];k++){
                if(((i>>(x[j][k]-1))&1)^y[j][k])jud=false;
            }
        }
        if(jud){
            pure=max(pure,count(i));
        }
    }
    cout<<pure<<endl;
}

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

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

using namespace std;

typedef long long ll;

int main(){
    int k = 0;
    int x[5] = {1,2,3,4,5};
    for(int i = 0; i < 5; i++){
        cin >> k;
        if(k != x[i]){
            cout << i+1 << endl;
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 3596
import numpy as np
n,k=map(int,input().split())
exp=tuple(map(lambda x: (int(x)+1)/2,input().split()))
l=np.cumsum(exp)

ans=l[k-1]
for i in range(0,n-k):
  x=l[i+k]-l[i]
  ans=max(ans,x)
print(ans)

Measured memory_bytes: 32556
#include <bits/stdc++.h>
#define DEBUG if(0)
#define lli long long int
#define ldouble long double
using namespace std;

int main()
{
  int n;
  while (scanf("%d", &n) != EOF)
    printf("%d\n", (1000 - n % 1000) % 1000);
  return 0;
}

Measured memory_bytes: 3816
package main
 
import "fmt"
 
func CheckCounts(a []float64, size int, avg float64) (count float64) {
	for i := 0; i < size; i ++{
		if avg <= a[i]{
			count ++
		}
	}
	return
}

func main()  {
	var i, n int
	var sum, m float64
	sum = 0
	fmt.Scan(&n, &m)
	a := make([]float64, n)
	for i = 0; i < n; i++{
		fmt.Scan(&a[i])
		sum+=a[i]
	}

	if CheckCounts(a, n, sum * 1 / (4 * m)) < m{
		fmt.Println("No")
	}else{
		fmt.Println("Yes")
	}
}


Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#define rep(i, a, b) for(int i = (a); i < (b); i++)
using namespace std;

int main() {
  string s;
  cin >> s;
  if(s[0] == '7' || s[1] == '7' || s[2] == '7') {
    cout << "Yes";
  } else {
    cout << "No";
  }
}


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

int main(void) {
	int X, Y;
	cin >> X >> Y;

	int xb[] = { 1,1,0,-1,-1,-1,0,1 };
	int yb[] = { 0,1,1,1,0,-1,-1,-1 };

	string str[60];
	for (int i = 0; i < X; i++) {
		cin >> str[i];
	}
  
	int count = 0;
	for (int i = 0; i < X; i++) {
		for (int j = 0; j < Y; j++) {
			if (str[i][j] == '.')
			{
				count = 0;
				for (int k = 0; k < 8; k++)
				{
					int xx = i + xb[k];
					int yy = j + yb[k];

					if (xx >= 0 && xx < X && yy >= 0 && yy < Y)
					{
						if (str[xx][yy] == '#')
						{
							count++;
						}
					}
				}
				str[i][j] = ('0' + count);
			}
		}
		cout << str[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
  
    int sum , i;
    char k[1000];
      
    while(1){
        scanf("%s",k);
        if (k[0]=='0')break;
        for (sum=0,i=0; k[i]!='\0'; i++) {
            sum+=(k[i]-'0');
        }
        printf("%d\n",sum);
        }
  
    return 0;
}

Measured memory_bytes: 536
num_time_list = (input()).split()
num = int(num_time_list[0])
time = int(num_time_list[1])

option_list = []
for i in range(num):
    option_list.append((input()).split())
    
answer = 0
for i in range(num):
    option_cost = int(option_list[i][0])
    option_time = int(option_list[i][1])
    if option_time <= time:
        if answer > option_cost or answer == 0:
            answer = option_cost
            
if answer == 0:
    print( "TLE" )
else:
    print( answer )

Measured memory_bytes: 3064
#include <assert.h>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using ll = long long;
using P = std::pair<ll, ll>;

#define rep(i, a, b) for (ll(i) = (a); i < (b); i++)
#define all(i) i.begin(), i.end()
#define debug(i) std::cerr << "debug "<< i << std::endl

// const ll MOD = 998244353;
const ll MOD = 1e9 + 7;

int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  //問題文中の添え字が0-indexか1-indexか確認!

  std::string s,t;
  std::cin>>s>>t;
  ll n=s.size(),m=t.size();

  std::vector<ll> scnt(n+1,0),tcnt(m+1,0);

  rep(i,0,n)scnt[i+1]=scnt[i]+((s[i]=='A')?1:0);
  rep(i,0,m)tcnt[i+1]=tcnt[i]+((t[i]=='A')?1:0);

  ll q;
  std::cin>>q;

  rep(i,0,q){
    ll a,b,c,d;
    std::cin>>a>>b>>c>>d;
    ll temp1=2*(scnt[b]-scnt[a-1])-b+a-1;
    ll temp2=2*(tcnt[d]-tcnt[c-1])-d+c-1;
    if((temp1-temp2+3*100000)%3==0)std::cout<<"YES\n";
    else std::cout<<"NO\n";
  }

  return 0;
}


Measured memory_bytes: 2512
n = int(input())
li_a = list(map(int, input().split()))
li_b = list(map(int, input().split()))
li_c = list(map(int, input().split()))

answer = 0
before = -99

for i in range(n):
    idx = li_a[i]
    answer += li_b[idx - 1]
    if idx == before + 1:
        answer += li_c[idx - 2]
    before = idx
print(answer)




Measured memory_bytes: 3060
n = int(input())
mod = 10**9 + 7
ans = 1
for _ in range(n):
    ans *= 10
    ans %= mod

no1 = 1
no19 = 1
for _ in range(n):
    no1 *= 9
    no1 %= mod
for _ in range(n):
    no19 *= 8
    no19 %= mod
print((ans -(no1*2 - no19))%mod)

Measured memory_bytes: 64384
#include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
#define ios std::ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define PI acos(-1.0) //3.14159265358
#define EPS 1e-9 //epsilon, 10^-9, checking for equality 
#define pb push_back
#define fi first
#define se second
#define sz(x) x.size()
#define rep(i,n) for(int i=0;i<n;i++)
#define isort(x) sort(x.begin(),x.end())
#define dsort(x) sort(x.rbegin(),x.rend())
const int inf=1e9+7; //10^9 +7
const int modc=998244353;
typedef long long int ll;typedef vector<int> vi;typedef vector<ll> vll;
typedef pair<int,int> ii;typedef map<int,int> mii;
inline void rvi(vi &v, int n){int temp; rep(i,n){cin>>temp;v.pb(temp);}}
inline void rvll(vll &v, int n){ll temp;rep(i,n){cin>>temp;v.pb(temp);}}
inline void prvi(vi &a){rep(i,sz(a)){cout<<a[i]<<" ";}cout<<endl;}
inline void prvll(vll &a){rep(i,sz(a)){cout<<a[i]<<" ";}cout<<endl;}
inline vll prefixsum(vi &a){vll b;b.pb(a[0]);for(int i=1;i<sz(a);i++){b.pb(a[i]+b[i-1]);}return b;}
inline vll suffixsum(vi &a){vll b(sz(a));b[sz(a)-1]=a[sz(a)-1];for(int i=sz(a)-2;i>=0;i--){b[i]=a[i]+b[i+1];}return b;}
inline vll prefixsum(vll &a){vll b;b.pb(a[0]);for(int i=1;i<sz(a);i++){b.pb(a[i]+b[i-1]);}return b;}
inline vll suffixsum(vll &a){vll b(sz(a));b[sz(a)-1]=a[sz(a)-1];for(int i=sz(a)-2;i>=0;i--){b[i]=a[i]+b[i+1];}return b;}
void solve();int main(){ios;solve();return 0;}
//--------SOLVE--------------------------------------------------------------------
void solve()
{
	int n,w;cin>>n>>w;
	vector< ii > items;
	items.pb({-1,-1});
	for(int i=0;i<n;i++)
	{
		int t1,t2;cin>>t1>>t2;
		items.pb({t1,t2});
	}
	//dp[i][j] gives max value for items 1 to i with max allowed weight=j
	vector< vector<long long> > dp;
	dp.resize(2);
	for(int i=0;i<2;i++) dp[i].resize(100005);
	for(int i=0;i<=1;i++) dp[i][0]=0; //0 weight allowed
	for(int i=0;i<=w;i++) dp[0][i]=0; //0 items taken
	for(int i=1;i<=n;i++)
	{
		if(i&1) //i is odd
		{
			for(int j=1;j<=w;j++)
			{
				if(items[i].fi>j) dp[1][j]=dp[0][j];
				else dp[1][j]=max(dp[0][j],dp[0][j-items[i].fi]+items[i].se);
			}

		}
		else
		{
			for(int j=1;j<=w;j++)
			{
				if(items[i].fi>j) dp[0][j]=dp[1][j];
				else dp[0][j]=max(dp[1][j],dp[1][j-items[i].fi]+items[i].se);
			}			
		}
	}
	cout<< ((n&1)?dp[1][w]:dp[0][w]) <<endl;
}

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

if n == 1:
    n = 1
elif n == 2:
    n = 0
else:
    n = n - 2
    
if m == 1:
    m = 1
elif m == 2:
    m = 0
else:
    m = m - 2
    
print(n * m)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
//#include <vector>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const int inf = 1e9;
const ll INF = 1e18;
const double pi = 3.14159265358979323846;
#define rep(i,n) for(ll i=0;i<n;i++)
using Graph = vector<vector<int>>;
using pint = pair<int,int>;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

int main(){
    int n,a,b;cin>>n>>a>>b;
    int x=min(a,b),y=max(0,a+b-n);

    cout<<x<<" "<<y<<"\n";
}

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





int main()
{
    /*ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);*/

    long long int 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;


    string s1,s2;
    cin>>s1>>s2;
    c=0;
    for(i=0;i<s1.size();i++)
    {
        if(s1[i]!=s2[i])
            c++;
    }
    cout<<c<<"\n";

    return 0;


}


Measured memory_bytes: 3856
package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	var minC, maxC int
	var ans int64
	parts := make([][]int, 3)
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	for i := range parts {
		parts[i] = make([]int, n)
		for j := range parts[i] {
			sc.Scan()
			parts[i][j], _ = strconv.Atoi(sc.Text())
		}
		sort.Ints(parts[i])
	}
	for _, p := range parts[1] {
		minC = sort.SearchInts(parts[0], p)
		maxC = n - sort.SearchInts(parts[2], p+1)
		ans += int64(minC * maxC)
	}
	fmt.Println(ans)
}

Measured memory_bytes: 5888
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string>
#include <cmath>
#include <sstream>
#include <istream>
#include <iomanip>
#include <typeinfo>
#include <stack>
#include <map>

using namespace std;
typedef long long int ll;

int main(){

    ll N, H;
    cin >> N >> H;
    vector<ll > A;
    vector<ll > B;

    for(ll i = 0; i < N; i++){
        ll a, b;
        cin >> a >> b;
        A.push_back(a);
        B.push_back(b);
        //cout << B[i] << endl;
    }

    sort(A.rbegin(), A.rend());
    sort(B.rbegin(), B.rend());
    
    ll ans = 0;
    for(ll i = 0; i < B.size(); i++){
        if(H <= 0) break;
        if(B[i] < A[0]) break;
        H -= B[i];
        ans++;
    }

    if(H > 0){
        ans += ceil((double)H / A[0]);
    }
    /*
    while(H >= 0){
        H -= A[0];
        ++ans;
    }
    */

    cout << ans << endl;

    


}  

Measured memory_bytes: 2036
#include<stdio.h>
#include<string.h>
int main()
{
	int N,i,count=0;
	char S[50];
	scanf("%d %s", &N,&S);
	for (i = 0; i < N; i++) {
		if (S[i] == 'A') {
			if (S[i + 1] == 'B') {
				if (S[i + 2] == 'C') {
					count++;
				}
			}
		}
	}
	printf("%d", count);
    return 0;
}



Measured memory_bytes: 128
#include<map>
#include<cmath>
#include<stack>
#include<cstdio>
#include<queue>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
char c;
int ans;
int main(){
	for(int i=0;i<6;i++){
        cin>>c;
        if(c=='1')ans++;
	}
	printf("%d\n",ans);
	return 0;
}


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

using namespace std;
int N = 100;

int main(){
  int i,j,k,l;
  int n,p[N+1],m[N+1][N+1];
  cin >> n;
  for(i = 1; i <= n; i++){
    cin >> p[i-1];
    cin >> p[i];
  }
  for(i = 1; i <= n; i++){
    m[i][i] = 0;
  }
  for(l = 2; l <= n; l++){
    for(i = 1; i <= n-l+1;i++){
      j = i+l-1;
      m[i][j] = (1 << 21);
      for(k = i; k <= j-1; k++){
        m[i][j] =min(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      }
    }
  }
  cout << m[1][n] << endl;
  return 0;
}

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

template <class T>
void print(vector<T>& v){
    for(T x:v) cout<<x<<" ";
    cout<<endl;
}

void sol(){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    bool q=true;
    while (true){
        if (q){
            c-=b;
            if (c<1){
                cout<<"Yes"<<endl;
                return;
            }
            q=false;
        }
        else{
            a-=d;
            if (a<1){
                cout<<"No"<<endl;
                return;
            }
            q=true;
        }
    }
}

int main() {
    // int t;
    // cin>>t;
    // for (int i=0; i<t; ++i){
        sol();
    // }
    return 0;
}

Measured memory_bytes: 3588
inf = 10 ** 20
n, m = map(int, input().split())
a_list = []
d = [-inf for _ in range(n)]
d[0] = 0
for _ in range(m):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    a_list.append([a, b, c])
    d[b] = max(d[a] + c, d[b])
temp = d[-1]
for i in range(m):
    a, b, c = a_list[i]
    d[b] = max(d[a] + c, d[b])
if temp != d[-1]:
    print("inf")
else:
    print(d[-1])

Measured memory_bytes: 3444
#include<bits/stdc++.h>
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++)
typedef long long ll;
#define vint vector<int>
#define vstring vector<string>
#define vll vector<ll>
#define INF 100000000

int calc(int a,int b);

int main(){
  int a,b;
  cin >> a >> b;
  vint A(b);
  rep(i,b) cin >> A[i];
  sort(A.begin(),A.end());
  vint B(b-1);
  rep(i,b-1) B[i] = abs(A[i+1] - A[i]);
  sort(B.begin(),B.end());
  ll sum = 0;
  rep(i,b-a) sum += B[i];
  cout << sum << endl;
}  

Measured memory_bytes: 1024
from collections import Counter
s=list(input())
c=Counter(s)
ans=10**8
for i in c.keys():
    sss=s
    cnt=0
    while True:
        if len(set(sss))==1:
            break
        else:
            ss=[]
            for j in range(len(sss)-1):
                if sss[j]==i or sss[j+1]==i:
                    ss.append(i)
                else:
                    ss.append(s[j])
            cnt+=1
            if ss[0]==i and len(set(ss))==1:
                break
            else:
                pass
        sss=ss
    ans=min(ans,cnt)
print(ans)

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

int main () {
  int H , W;
  cin >> H >> W;
  
  string a;
  
  for (int i = 0; i < H + 1; i++) {
  if (i == 0 || i == H) {
    for (int j = 0; j < W + 2; j++) {
      if (j !=  W + 1) cout << '#';
      else {
        cout << '#' << endl;
      }
    }
  }
    if (i == H) break;
    cin >> a;
    cout << '#' + a + '#' << endl;
  }
}


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

int main(){

	int W, H, x, y, r;
	cin >> W >> H >> x >> y >> r;

	if((x - r >= 0 && x + r <= W) && (y - r >= 0 && y + r <= H)){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}

	return 0;
}


Measured memory_bytes: 3104
#include <iostream>
#include <vector>
#include <algorithm>
#define llint long long

using namespace std;

llint n, m;
vector<llint> G[1005];
llint color[1005];

bool dfs(llint v, llint p, llint c)
{
	color[v] = c;
	for(int i = 0; i < G[v].size(); i++){
		llint u = G[v][i];
		if(u == p) continue;
		if(color[u] == -c) continue;
		if(color[u] == c) return false;
		if(!dfs(u, v, -c)) return false;
	}
	return true;
}

int main(void)
{
	while(1){
		cin >> n >> m;
		if(n == 0 && m == 0) return 0;
		
		for(int i = 1; i <= n; i++) G[i].clear();
		
		llint u, v;
		for(int i = 1; i <= m; i++){
			cin >> u >> v;
			G[u].push_back(v);
			G[v].push_back(u);
		}
		for(int i = 1; i <= n; i++) color[i] = 0;
		if(!dfs(1, -1, 1)){
			cout << 0 << endl;
			continue;
		}
		
		llint bcnt = 0, wcnt = 0;
		for(int i = 1; i <= n; i++){
			if(color[i] > 0) bcnt++;
			else wcnt++;
		}
		vector<llint> vec;
		if(bcnt%2 == 0) vec.push_back(bcnt/2);
		if(wcnt%2 == 0) vec.push_back(wcnt/2);
		sort(vec.begin(), vec.end());
		vec.erase(unique(vec.begin(), vec.end()), vec.end());
		
		cout << vec.size() << endl;
		for(int i = 0; i < vec.size(); i++) cout << vec[i] << endl;
	}
	
	return 0;
}


Measured memory_bytes: 3316
#include <iostream>
#include <algorithm>
#include <math.h> 
#include <string>
#include <iomanip>
using namespace std;
int main(){
   int n;
   long a[100000];
   cin >> n;
   int counter = 0;
   for(int i = 0; i < n; i++) cin >> a[i];
   for(int i = 0; i < n; i++){
       if(a[i] < 0) counter += 1;
   }

   long long total = 0;
   for(int i = 0; i < n; i++){
       if(a[i] < 0) total = total - a[i];
       else total = total + a[i];
   }

   long b[100000];
   for(int i = 0; i < n; i++) {
        if(a[i] < 0) b[i] = -a[i];
        else b[i] = a[i];
   }

   long min = 1000000000;
   for(int i = 0; i < n; i++) {
       if(min > b[i]) {
           min = b[i];
       }
   }

   if(counter%2 == 0){
       cout << total << endl;
   }else{
       cout << total-2*min << endl;
   }
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define err(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)

using namespace std;

typedef long long ll;

int main() {
	int n;
	cin >> n;
	
	vector<int> A(n);
	for (int i = 0; i < n; i++) {
		cin >> A[i];
		A[i]--;
	}
	
	int ans = 0;
	for (int i = 0; i < n; i++) {
		if (A[i] != i) continue;
		if (i + 1 < n && A[i] != i + 1 && A[i + 1] != i) swap(A[i], A[i + 1]);
		else swap(A[i], A[i - 1]);
		ans++;
	}
	cout << ans << "\n";
	return 0;
}

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

int main(){
  int n,minas,min;
  int *a;
  long sum;
  min=1000000000;
  minas=0;
  cin>>n;
  a=(int*)malloc(sizeof(int)*(n+1));
  for(int i=0;i<n;i++){
    cin>>a[i];
    if(a[i]<0){
      minas++;
      a[i]=a[i]*(-1);
    }
    if(min>a[i]){
      min=a[i];
    }
  }
  /*int *b;
  int *c;
  b=(int*)malloc(sizeof(int)*(n+1));
  c=(int*)malloc(sizeof(int)*(minas+1));
  */
  /*for(int i1=0;i1<n;i1++){
    for(int i2=i1;i2<n;i2++){
      if(a[i1]>a[i2]){
	tmp=a[i1];
	a[i1]=a[i2];
	a[i2]=tmp;
      }
    }
  }*/
  sum=0;
  for(int j=0;j<n;j++){
    sum+=(long)a[j];
  }
  if(minas%2==1){
    sum-=(long)min;
    sum-=(long)min;
  }
  //int p_sum=0;
  /*
  int m_sum=0;
  for(int j=minas;j<n;j++){
    p_sum+=a[j];
  }
  for(int k=0;k<minas;k++){
    m_sum-=a[k];
  }
  sum=p_sum+m_sum;*/
  cout<<sum<<endl;
  return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define  p5         100007
#define  p6          1000007
#define  PI         acos(-1)
#define  M          1000000007
#define  sc         scanf
#define  ss         second
#define  ff         first
#define  pf         printf
#define  scin(x)    sc("%d",&x)
#define  scin2(x,y) sc("%d%d",&x,&y)
#define  READ(f)    freopen(f, "r", stdin)
#define  WRITE(f)   freopen(f, "w", stdout)
#define  ll         long long
#define  pp         pair < int, int>
#define  pq         priority_queue
#define  pb         push_back
//int month[]={31,28,31,30,31,30,31,31,30,31,30,31};
//int dx[5] = {1, -1, 0, 0 };
//int dy[5] = {0, 0, 1, -1};
using namespace std;
int main()
{
	ll n,i,j,k;
	cin>>n;
	if(n&1)
        k=n/2+1;
    else
        k=n/2;
    double ans=(double)k/n;
    printf("%.10lf\n",ans);

	return 0;
}
//https://prosenc.blogspot.com/2016/
//https://www.sanfoundry.com/dynamic-programming-solutions-longest-increasing-subsequence-problem/



Measured memory_bytes: 256
N,M=[int(i) for i in input().split(" ")]
number=[-1 for i in range(N)]
for i in range(M):
    s,c=[int(i) for i in input().split(" ")]
    if(number[s-1]==-1):
        number[s-1]=c
    elif(number[s-1]!=c):
        print(-1)
        break
else:
    n=0
    for i in range(N):
        if number[i]==-1:
            if i==0 and N>=2:
                number[i]=1
            else:
                number[i]=0
        n=n*10 + number[i]
    if(len(str(n))==N):
        print(n)
    else:
        print("-1")


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,x,n) for(int i=x; i<(int)(n); i++)
#define rep_eq(i,x,n) for(int i=x; i<=(int)(n); i++)
using namespace std;

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

  vector<int> A(N);
  bool flag = true;
  rep( i, 0, N ) {
    cin >> A.at(i);
    if ( A.at(i)%2 == 0 ) {
      if ( A.at(i)%3 && A.at(i)%5 ) {
        flag = false;
      }
    }
  }
  cout << ( flag ? "APPROVED" : "DENIED" ) << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 1000000007
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
typedef long long ll;
typedef int64_t in;

using namespace std;

int main(){
    ll n,l;
    cin >> n >> l;
    ll sum=0;
    ll z=MOD;
    ll index;
    REP(i, l, l+n){
        sum += i;
        if(z > abs(i)){
            z = abs(i);
            index = i;
        }
    }
    
    cout << sum - index << endl;

    return 0;
}


Measured memory_bytes: 256
import java.io.*;

public class Main {
	public static void main(String[] args) {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try {
			String line = reader.readLine();
			double r = Double.parseDouble(line);
			System.out.printf("%f %f\n", (Math.PI * r * r), (2 * Math.PI * r));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}

Measured memory_bytes: 16916
#include<iostream>
#include<string>
#include <cctype>
#include<cmath>
#include<vector>

using namespace std;


int main(void) {
	int N=0;
	string a[100];

	bool f=false;
	bool g = true;
	cin >> N;

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

		if (f == false) {
			f = true;
		}
		else {
			if (a[i].front() != a[i - 1].back()) {
				g = false;
			}
		}
	}

	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			if (i != j) {
				if (a[i] == a[j]) {
					g = false;
				}
			}
		}	
	}

	if (g == false) {
		cout << "No" << endl;

	}
	else {
		cout << "Yes" << endl;

	}

	return 0;



}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef pair<int, P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i, x) for (int i = 0; i < x; i++)
#define rep1(i, x) for (int i = 1; i <= x; i++)
#define rrep(i, x) for (int i = x - 1; i >= 0; i--)
#define rrep1(i, x) for (int i = x; i > 0; i--)
#define sor(v) sort(v.begin(), v.end())
#define rev(s) reverse(s.begin(), s.end())
#define lb(vec, a) lower_bound(vec.begin(), vec.end(), a)
#define ub(vec, a) upper_bound(vec.begin(), vec.end(), a)
#define uniq(vec) vec.erase(unique(vec.begin(), vec.end()), vec.end())
#define mp1(a, b, c) P1(a, P(b, c))

const int INF = 1000000000;
const ll M = 1000000000;
const int dir_4[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
const int dir_8[8][2] = {{1, 0},  {1, 1},   {0, 1},  {-1, 1},
                         {-1, 0}, {-1, -1}, {0, -1}, {1, -1}};

/*----------------------------------------------/
/- char         : %c  | char *       : %s  | short        : %hd
/- int          : %d  | long         : %ld | long long    : %lld
/- unsigned short:%hu | unsigned int : %u  | unsigned long: %lu
/- u_long long  : %llu| (octal)      : %o  | (hexadecimal): %x
/- float        : %f  | double       : %lf |
/----------------------------------------------*/

/*----------------------------------------------/
/- INT_MAX, LONG_MAX   : 1<<15 = 2.1*pow(10, 9)       (= 2147483647)
/- UINT_MAX, ULONG_MAX : 1<<16 = 4.2*pow(10, 9)       (= 4294967295)
/- LLONG_MAX           : 1<<63 = 9.2*pow(10, 18)      (= 9223372036854775807)
/- ULLONG_MAX          : 1<<64 = 1.8*pow(10, 19)      (= 18446744073709551615)
/----------------------------------------------*/

int main() {
    int s;
    scanf("%d", &s);
    /* ====================================== */
    vector<int> a(1000010);
    a[s] = true;
    int c = s;
    rep1(i, 1000000) {
        int b = c % 2 == 0 ? c / 2 : c * 3 + 1;
        if (a[b]) {
            cout << i + 1;
            break;
        } else {
            a[b] = true;
        }
        c = b;
    }

    /* ====================================== */
    cout << endl;
    return 0;
}

Measured memory_bytes: 4224
#include <iostream>
using namespace std;
int main(){ 
     string a;
     cin >> a;
     int flag = 0;
     for (int i = 0; i < a.length(); i+= 2) {
       if (a[i] != 'h' or a[i + 1] != 'i') {
           flag = 1;
       }
     }
     if (flag == 1) {
       cout << "No";
     } else {
       cout << "Yes";
     }
    
}

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

int main(){
  int n,m,x,y;
  cin >> n >> m >> x >> y;
  int xmax = -101,ymin = 101;
  for(int i = 0; i < n; ++i){
    int w;
    cin >> w;
    if(w > xmax)xmax = w;
  }
  for(int i = 0; i < m; ++i){
    int w;
    cin >> w;
    if(w < ymin)ymin = w;
  }
  
  for(int i = max(x,xmax); i <= min(y,ymin); ++i){
    //cout << i << endl;
    if(i > x && i > xmax && i <= ymin && y >= i){
      cout << "No War" << endl;
      return 0;
    }
  }
  
  cout << "War" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define ll long long
#define lll __int128
#define ull unsigned long long
#define fi first
#define se second
#define db double
#define ld long double
#define lld __float128

/// order_of_key, find_by_order

template<class T, class COMP>
using custom_set = tree<T, null_type, COMP, rb_tree_tag, tree_order_statistics_node_update>;

template<class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

template<class T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

template<class T, class U>
using ordered_map = tree<T, U, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rnd_64(chrono::steady_clock::now().time_since_epoch().count());

int main()
{
    int n, a, b; cin >> n >> a >> b;
    int df = a^b;
    vector<int> bts[2];
    for(int ind = 0; ind < n; ind++)
    {
        bts[df % 2].push_back(ind);
        df /= 2;
    }
    if(bts[1].size() % 2 == 0)
    {
        cout << "NO"; return 0;
    }
    vector<int> sf(bts[1].size()/2+1, 0), zer;
    int cyc = 0;
    for(int i = 0; i < bts[0].size(); i++)
    {
        int sz = zer.size();
        zer.push_back(bts[0][i]);
        for(int j = 0; j < sz; j++)
        {
            zer.push_back(zer[j]);
        }
    }
    int cur = a;
    cout << "YES\n" << a;
    for(int i = 1; i < (1 << n); i++)
    {
        if(cyc == zer.size())
        {
            for(int j = 0; j < sf.size(); j++)
            {
                sf[j]++;
               // cout << sf[j] << ' ';
                if((sf[j] & 3) != 0)
                {
                    if(sf[j] < 8)
                    {
                        if((sf[j] & 7) == 1 || (sf[j] & 7) == 3 || (sf[j] & 7) == 6)
                        {
                            cur ^= (1 << bts[1][j*2]);
                        }
                        else
                        {
                            cur ^= (1 << bts[1][j*2+1]);
                        }
                    }
                    else
                    {
                        if(sf[j] & 1 == 1)
                        {
                            cur ^= (1 << bts[1][j*2]);
                        }
                        else
                        {
                            cur ^= (1 << bts[1][j*2+1]);
                        }
                    }
                }
                if((sf[j] & 3) != 0) break;
            }
            cyc = 0;
        }
        else
        {
            cur ^= (1 << zer[cyc]);
            cyc++;
        }
        cout << ' ' << cur;
        //cout << '\n';
    }

    cout << '\n';
//    while(cur)
//    {
//        cout << cur%2;
//        cur /= 2;
//    }


}






































/// shche ne vmerla Ykraina


Measured memory_bytes: 1024