akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication51
{
    class Program
    {
        static void Main()
        {
            double a, b, c, d, e;
            a = double.Parse(Console.ReadLine());
            b = double.Parse(Console.ReadLine());
            c = double.Parse(Console.ReadLine());
            d = double.Parse(Console.ReadLine());
            e = double.Parse(Console.ReadLine());
            double[] f = new double[2];
            f[0] = Math.Ceiling(b/d);
            f[1] = Math.Ceiling(c/e);
            Array.Sort(f);
            Console.WriteLine(a-f[1]);
        }
    }
}

Measured memory_bytes: 9372
#include <bits/stdc++.h>
  using namespace std;
  typedef long long int ll;
  #define mod 1000000007
  #define all(v)  v.begin(),v.end()
  #define pb push_back
  #define size(v)  (int) v.size()
  #define fast ios_base:: sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL)
  ll power_mod(ll a,ll x){if(x==0) return 1;ll y=power_mod(a,x/2);ll ans=(y*y)%mod; if(x%2) ans=(ans*a)%mod;return ans;}
  ll inv(ll a){return power_mod(a,mod-2);}
  ll power(ll a, ll x){ if(x==0) return 1; ll y= power(a,x/2); ll ans=(y*y); if(x%2) ans*=a; return ans;}




  int main()
  {
      fast;
      ll n,W;
      cin>>n>>W;
      ll w[n+1],v[n+1];
      for(int i=1;i<=n;i++)
      {
      	  cin>>w[i]>>v[i];
      	  
      }
      ll dp[n+1][W+1];
      ll ans=0;
      memset(dp,0,sizeof(dp));
      for(int i=1;i<=n;i++)
      {
      	  for(int j=1;j<=W;j++)
      	  {   
      	  	  if(j>=w[i])
      	  	  dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i]]+v[i]); 
      	  	  else
      	  	  dp[i][j]=dp[i-1][j];    

      	  	  
      	  }
      	 
      }

       
      cout<<dp[n][W]<<endl; 


        
  }




Measured memory_bytes: 79232
import java.util.Scanner;

class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      
 		String S = sc.next();
      	String T = sc.next();
      
      	int a = S.length();
       	String b = T.substring(0,a);
 
      if(S.equals(b)){
      	System.out.println("Yes");
      }else{
      	System.out.println("No");
      }
    }
}

Measured memory_bytes: 26820
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(x)  x.begin(),x.end()
#define vi vector<int>
#define vll vector<ll>
#define print(x) for(auto it=x.begin();it!=x.end();it++) cout<<*it<<' '; cout<<'\n';
#define debug(a,b,c) cout << a << " " << b << " " << c << endl;
#define in(x,n) for(int e=0;e<n;e++){int y;cin>>y;x.pb(y);}
#define inl(x,n) for(int e=0;e<n;e++){ll y;cin>>y;x.pb(y);}
#define lower(sl)  transform(sl.begin(), sl.end(), sl.begin(), ::tolower); 
#define endl "\n";
#define pi pair<int,int>
#define vpi vector<pair<int,int>>
#define vvi vector<vector<int>>
 

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//code here
	int n;
	cin >> n;
	ll res =0 ;
	for(int i=1;i<n;i++){
		res += (((n+i-1)/i) -1); 
	}
	cout << res << endl;
}

Measured memory_bytes: 3652
#include<stdio.h>
#define NIL -1
#define N 25
void preorder(int);
void inorder(int);
void postorder(int);

typedef struct{
  int parent;
  int left;
  int right;
}Tree;
Tree T[N];

int main(){
  int i,n,id,l,r,root;

  for(i=0;i<N;i++){
    T[i].parent=NIL;
    T[i].left=NIL;
    T[i].right=NIL;
  }
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d %d %d",&id,&l,&r);
    T[id].left = l;
    T[id].right = r;
    if(T[id].left != -1)
      T[T[id].left].parent = id;
    if(T[id].right != -1)
      T[T[id].right].parent = id;
  } 

  for(i=0;i<n;i++){
    if(T[i].parent == NIL)
      root = i;
  }
  printf("Preorder\n");
  preorder(root);
  printf("\nInorder\n");
  inorder(root);
  printf("\nPostorder\n");
  postorder(root);
  printf("\n");
  return 0;
}
void preorder(int u){
  if(u==NIL)
    return;
  printf(" %d",u);
  if(T[u].left!=-1)
    preorder(T[u].left);
  if(T[u].right!=-1)
    preorder(T[u].right);
}
void inorder(int u){
  if(u==NIL)
    return;
  if(T[u].left!=-1)
    inorder(T[u].left);
  printf(" %d",u);
  if(T[u].right!=-1)
    inorder(T[u].right);
}
void postorder(int u){
  if(u==NIL)
    return;
  if(T[u].left!=-1)
    postorder(T[u].left);
  if(T[u].right!=-1)
    postorder(T[u].right);
  printf(" %d",u);  
}

Measured memory_bytes: 616
#include <cassert>
#include <iostream>
#include <functional>
#include <iomanip>
#include <set>
#include <unordered_map>
#include <queue>
#include <vector>
#include <deque>
#include <algorithm>
#include  <cstring>
#include <string>
#include <cmath> 
using namespace std;
typedef long long LL;
const int MAX = 210000;
const LL base = 1e9 + 7;


struct Node {
	int x, y, w;
};


void solve() {

	LL result = 0;
	int n;

	cin >> n;
	int a;
	for (int i=0; i<n; ++i) {
		cin >>a;
		if (a%2==1) {
			cout<<"first"<<endl;
			return;
		}
	}

	cout << "second" << endl;

}

int main() {
	const int inId = 0;
	const int outId = 0;
	if (inId>0) {
		cerr << "redirect stdin to input " << inId << endl;
		string s = "input";
		s += to_string(inId);
		s += ".txt";
		auto r = freopen(s.c_str(), "r", stdin);	
		if (r == nullptr) {
			cerr<< "invalid input file "<< s;
		}
	}
	if (outId>0) {
		cerr << "redirect stdout to stdout " << outId << endl;
		string s = "stdout";
		s += to_string(outId);
		s += ".txt";
		auto r = freopen(s.c_str(), "w", stdout);
		if (r == nullptr) {
			cerr<< "invalid output file "<< s;
		}		
	}
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // close sync between cout and printf
	cout.precision(10);
	solve();
}
 

Measured memory_bytes: 256
import java.io.*;
import java.util.StringTokenizer;

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

        long n = in.nextInt();
        long k = in.nextInt();
        if ((k & 1) == 1) {
            out.println((long) Math.pow(n / k, 3));
        } else {
            long div = n / (k / 2);
            long even = div / 2;
            long odd = ((div & 1) == 0) ? div / 2 : div / 2 + 1;
            out.println((long) Math.pow(even, 3) + (long) Math.pow(odd, 3));
        }


        out.close();
        //INT OVERFLOW -> USE LONG
        //ARR OUT OF BOUNDS
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public double[] nextDoubleArray(int n) {
            double[] arr = new double[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextDouble();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        public char[] nextCharArray(int n) {
            char[] arr = nextLine().trim().replaceAll("\\s", "").toCharArray();
            return arr;
        }

        public String[] nextStringArray(int n) {
            String[] arr = new String[n];
            for (int i = 0; i < n; i++) {
                arr[i] = next();
            }
            return arr;
        }
    }
}


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

using namespace std;

int main()
{
    int n, m, i;
    long long int tempInt, mod=1e9+7;
    cin>>n>>m;
    vector<long long int> pos;
    vector<long long int> neg;
    for(i=0;i<n;i++)
    {
        cin>>tempInt;
        if(tempInt<0)
            neg.push_back(tempInt);
        else
            pos.push_back(tempInt);
    }
    if(m==n)
    {
        long long int res=1;

        for(i=0;i<(int)pos.size();i++)
            res=(res*pos[i])%mod;
        for(i=0;i<(int)neg.size();i++)
            res=(res*neg[i])%mod;
        if(res<0)
            res+=mod;
        cout<<res<<endl;
        return 0;
    }
    if(neg.empty())
    {
        long long int res=1;

        sort(pos.rbegin(),pos.rend());
        for(i=0;i<m;i++)
            res=(res*pos[i])%mod;
        cout<<res<<endl;
        return 0;
    }
    sort(neg.begin(),neg.end());
    //cout<<"Neg Sorted\n";
    if(pos.empty())
    {
        long long int res=1;
        if( m%2)
        {
            for(i=(int)neg.size()-1;i>=(int)neg.size()-m;i--)
                res=(res*neg[i])%mod;
            cout<<mod+res<<endl;
            return 0;
        }
        else
        {
            for(i=0;i<m;i++)
                res=(res*neg[i])%mod;
            cout<<res<<endl;
            return 0;
        }

    }
    sort(pos.rbegin(),pos.rend());
    //cout<<"Pos Sorted\n";
    long long int res=1;
    int j,k;
    i=0;
    j=0;
    k=0;
    while(i<m)
    {
        //cout<<"Choosing "<<i+1<<"\n";
        if(i==m-1  || k>(int)neg.size()-2)
        {
            res=(res*pos[j])%mod;
            //cout<<"Chose: pos["<<j<<"]: "<<pos[j]<<endl;
            j++;
            i++;
        }
        else
        {
            if(j<(int)pos.size()-1)
            {
                if(pos[j]*pos[j+1]>neg[k]*neg[k+1])
                {
                    res=(res*pos[j])%mod;
                    //cout<<"Chose: pos["<<j<<"]: "<<pos[j]<<endl;
                    j++;
                    i++;
                }
                else
                {
                    res=(res*((neg[k]*neg[k+1])%mod))%mod;
                    //cout<<"Chose: neg["<<k<<"]: "<<neg[k]<<"& neg["<<k+1<<"]: "<<neg[k+1]<<endl;
                    k+=2;
                    i+=2;
                }
            }
            else
            {
                res=(res*((neg[k]*neg[k+1])%mod))%mod;
                //cout<<"Chose: neg["<<k<<"]: "<<neg[k]<<"& neg["<<k+1<<"]: "<<neg[k+1]<<endl;
                k+=2;
                i+=2;
            }
        }
    }

    cout<<res<<endl;
    return 0;
}


Measured memory_bytes: 5520
N , M = map(int,input().split())
p = [''] * M
S = [''] * M
A = [0] * N
W = [0] * N
for i in range(M):
    p[i],S[i] = map(str,input().split())
    p[i] = int(p[i])
    if A[p[i]-1] == 0:
        if S[i] == 'WA':
            W[p[i]-1] += 1
        else:
            A[p[i]-1] += 1

for j in range(N):
    if A[j] == 0:
        W[j] =0
print(sum(A),sum(W))


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

int main(){
  int N, M, a, b;
  std::cin >> N >> M;
  
  std::vector<long> Hs(N, 0);
  
  for (int i = 0; i < N; i++) std::cin >> Hs[i];
  
  std::vector<int> heighest(N, 1);
  
  for (int i = 0; i < M; i++){
    std::cin >> a >> b;
    a--;
    b--;
    if (Hs[a] > Hs[b]) heighest[b] = 0;
    else if (Hs[a] < Hs[b]) heighest[a] = 0;
    else {
      heighest[a] = 0;
      heighest[b] = 0;
    }
  }
  
  int answer = 0;
  for (int i = 0; i < N; i++) answer += heighest[i];
  
  std::cout << answer;
  
  return 0;
}

Measured memory_bytes: 3904
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <cstring>
#include <ctime>
#include <unordered_map>
#include <iomanip>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pii;

template<class T> ostream& operator<<(ostream& stream, const vector<T> v){ stream << "["; for (int i=0; i<(int)v.size(); i++) cout << v[i] << " "; stream << "]"; return stream; }
ll fpow(ll x, ll p, ll m){ll r=1; for (;p>>=1;){ if (p&1) r=r*x%m; x=x*x%m; } return r;}
int gcd(int a, int b){ if (!b) return a; return gcd(b,a%b);}
ll gcd(ll a, ll b){ if (!b) return a; return gcd(b,a%b);}

int N,M;
map<int,int> cnt;

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

    int i,x;
    for (i=1; i<=N; i++){
        cin >> x;
        cnt[x]++;
    }

    cin >> M;
    bool g=1;
    for (i=1; i<=M; i++){
        cin >> x;
        cnt[x]--;
        if (cnt[x]<0) g=0;
    }

    cout << (g ? "YES\n" : "NO\n");

	return 0;
}


Measured memory_bytes: 9600
#include<cstdio>
int main() {
	int i,h,m,s;
	scanf("%d",&i);
	h=i/3600;
	i=i-3600*h;
	m=i/60;
	i=i-60*m;
	s=i;
	printf("%d:%d:%d\n",h,m,s);
	return 0;
}


Measured memory_bytes: 2760
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>

#define rep(i,x) for(int i = 0; i < x; i++)
#define rrep(i,x) for(int i = 1; i <= x; i++)
#define srep(i,s,t) for (int i = s; i < t; ++i)
using ll = long long;
using namespace std;
const int INF = 1001001001;
const ll LINF = 1002003004005006007;

int main(){
    int a, b; cin >> a >> b;
    string ans;
    if (a <= b){
        rep(i, b) ans += ('0' + a);
    }else{
        rep(i, a) ans += ('0' + b);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
n, y= map(int, input().split())
yu = -1
hi = -1
no = -1
for i in range(n+1):
    for j in range(n+1-i):
        k = n - i- j
        if y == 10000*i + 5000*j + 1000*k and k >= 0:
            yu = i
            hi = j
            no = k
print(yu, hi, no)
        

Measured memory_bytes: 2940
S = list(input())
s = ['A','C','G','T']
cnt = 0
max = 0
for i in range(len(S)):
  for j in range(i,len(S)):
    if s.count(S[j]) != 0:
      cnt += 1
    else:
      break
  if max < cnt:
    max = cnt
  cnt = 0
print(max)

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

#ifdef DEBUG
#include "../include/debug.hpp"
#else
#define debug(...) 42
#define rdfile(...) 42
#endif

const int V = 1e5;
bool visited[V*2];

void dfs(vector<vector<int>> &to, int u, int &xn, int &yn) {
    if (visited[u]) return;
    visited[u] = true;
    if (u < V) xn ++;
    else yn ++;
    for (int v: to[u]) {
        dfs(to, v, xn, yn);
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    // rdfile("_input.txt");

    int N;
    cin >> N;
    int x, y;
    vector<vector<int>> to(V*2);
    for (int i=0; i<N; ++i) {
        cin >> x >> y;
        x--; y--;
        to[x].push_back(V+y);
        to[V+y].push_back(x);
    }

    long long ans = 0;
    for (int i=0; i<V; ++i) {
        if (visited[i]) continue;
        int xn = 0, yn = 0;
        dfs(to, i, xn, yn);
        ans += (long long)xn * yn;
    }

    cout << ans - N << endl;

    return 0;
}

Measured memory_bytes: 11264
#include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
const int nmax=100005;
long long a[nmax],v[nmax];
long long tot;
int n,i,m;
int main()
{
    //freopen("data.in","r",stdin);
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a+1,a+n+1);
    m=(n+1)/2;
    for(i=1;i<m;i++)
        tot+=2LL*(a[m]-a[i]);
    for(i=m+1;i<=n;i++)
        tot+=2LL*(a[i]-a[m]);
    if(n%2==1)
    {
        tot-=1LL*min(a[m]-a[m-1],a[m+1]-a[m]);
    }
    if(n%2==0)
    {
        tot-=1LL*(a[m+1]-a[m]);
    }
    cout<<tot;
    return 0;
}


Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Abc163E
    {
        struct Baby
        {
            public int Index;
            public long Value;
            public Baby(int index, long value)
            {
                Index = index;
                Value = value;
            }
        }

        public static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            var a = Console.ReadLine().Split(' ').Select((s, i) => new Baby(i, long.Parse(s))).OrderByDescending(i => i.Value).ToArray();

            var dp = new long[n + 1, n + 1];


            for (int i = 0; i < n; i++)
            {
                for (int l = 0; l <= i; l++)
                {
                    var r = i - l;
                    dp[l + 1, r] = Math.Max(dp[l + 1, r], dp[l, r] + a[i].Value * Math.Abs(a[i].Index - l));
                    dp[l, r + 1] = Math.Max(dp[l, r + 1], dp[l, r] + a[i].Value * Math.Abs(a[i].Index - (n - 1 - r)));
                }
            }

            long max = 0;
            for (int i = 0; i <= n; i++)
                if (max < dp[i, n - i])
                    max = dp[i, n - i];
            Console.WriteLine(max);
        }
    }
}


Measured memory_bytes: 41908
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
	int n, m;
	long long sum = 0;
	cin >> n >> m;
	int a[n];
	pair<int, int> b[m];
	for(int i = 0; i < n; i++){
		scanf("%d", a + i);
	}

	for(int i = 0; i < m; i++){
		scanf("%d %d", &b[i].second, &b[i].first);
	}

	sort(a, a + n);
	sort(b, b + m, greater<pair<int, int>>());
	for(int i = 0, j = 0; i < n; i++){
		if(a[i] < b[j].first && b[j].second > 0){
			a[i] = b[j].first;
			--b[j].second;
		}
		j += (b[j].second == 0 && j < m - 1);
		sum += a[i];
	}
	printf("%lld", sum);
	return 0;
}


Measured memory_bytes: 1408
#include "bits/stdc++.h"
using namespace std;
const int N = 5e3 + 3;
int n;
int parent[N];
vector < int > v[N];
int arr[N];
int dp[N];
bitset < N > bit;
int main(){
	scanf("%d" , &n);
	for(int i = 2 ; i <= n ; ++i){
		scanf("%d" , parent + i);
		v[parent[i]].emplace_back(i);
	}
	for(int i = 1 ; i <= n ; ++i){
		scanf("%d" , arr + i);
	}
	for(int i = n ; i >= 1 ; --i){
		if(v[i].empty()){
			dp[i] = 0;
		}
		else{
			bit.reset();
			bit.set(0);
			long long tot = 0;
			for(int next : v[i]){
				tot += arr[next] + dp[next];
				bit = (bit << arr[next]) | (bit << dp[next]);
			}
			dp[i] = -1;
			for(int j = arr[i] ; j >= 0 ; --j){
				if(bit.test(j)){
					dp[i] = tot - j;
					break;
				}
			}
			if(dp[i] == -1){
				printf("IMPOSSIBLE\n");
				return 0;
			}
		}
	}
	printf("POSSIBLE\n");
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#define sqr(x) ((x)*(x))
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define ld long double
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define debuge cerr<<"isok"<<endl
#define debug(x) cerr<<#x<<"="<<x<<endl
#define SS second
#define FF first
#define ls (k<<1)
#define rs (k<<1|1)
#define inf 0x3f3f3f3f
#define clr(a,x) memset(a,x,sizeof(a))
using namespace std;

const int N=100005,M=100005,mod=1e9+7;
template<class T> inline void gmin(T &x,const T &y){if(x>y) x=y;}
template<class T> inline void gmax(T &x,const T &y){if(x<y) x=y;}
inline void ch(int &x,int y){x+=y;if(x>=mod) x-=mod;}

struct matrix{
	int a[3][3];
	void build(int *b){
		for(int i=0;i<3;i++)
			for(int j=0;j<3;j++)
				a[i][j]=b[i*3+j];
	}
}p,e,ans,tmp,I;
matrix operator * (const matrix &a,const matrix &b){
	memset(tmp.a,0,sizeof(tmp.a));
	for(int i=0;i<3;i++)
		for(int j=0;j<3;j++)
			for(int k=0;k<3;k++)
				ch(tmp.a[i][j],(ll)a.a[i][k]*b.a[k][j]%mod);
	return tmp;
}
matrix mul(matrix a,int y){
	matrix ans=I;
	while(y){
		if(y&1) ans=ans*a;
		a=a*a;y>>=1;
	}return ans;
}
void print(matrix a){
	for(int i=0;i<3;i++,puts(""))
		for(int j=0;j<3;j++)
			printf("%d ",a.a[i][j]);
	puts("");
}
int n,m,f[N];

int main(){
	int aa[10]={1,0,1,2,1,2,1,1,2};
	int bb[10]={1,0,0,2,1,0,1,1,1};
	int cc[10]={1,0,0,0,1,0,0,0,1};
	p.build(aa);e.build(bb);
	I.build(cc);ans=I;
	scanf("%d%d",&n,&m);
	int last=1;
	for(int i=1;i<=m;i++){
		int x;
		scanf("%d",&x);x++;
		ans=ans*mul(p,x-last-1);
//		print(ans);
		ans=ans*e;last=x;
//		print(ans);
	}
	ans=ans*mul(p,n-last);
	int res=((ll)ans.a[2][0]+ans.a[2][1]*2+ans.a[2][2])%mod;
	printf("%d\n",res);
	return 0;
}


Measured memory_bytes: 256
k = int(input())

ll = [1, 2, 3, 4, 5, 6, 7, 8, 9]
lq = [1, 2, 3, 4, 5, 6, 7, 8, 9]


while len(ll) < k:
    nq = []
    for i in range(len(lq)):
        d = lq[i] % 10
        if d > 0:
            nl = lq[i] * 10 + d - 1
            nq.append(nl)
            ll.append(nl)
        nl = lq[i] * 10 + d
        nq.append(nl)
        ll.append(nl)
        if d < 9:
            nl = lq[i] * 10 + d + 1
            nq.append(nl)
            ll.append(nl)

    lq = nq

print(ll[k-1])


Measured memory_bytes: 13068
#include<bits/stdc++.h>
#define ll long long
#define read(x) scanf("%d",&x);
#define readll(x) cin>>x;
#define FOR(x,a,b) for(int x=a;x<b;x++)
#define MP make_pair
#define PB push_back
#define pii pair<int,int>
#define readN(N,X) for(int i=0;i<N;i++) cin>>X[i];
#define pff pair<double,double>
using namespace std;

int N,K;
vector<pair<int,int>> sushi;
long long res, best;
int cnt[100005];


int main(){
  cin>>N>>K;
  for (int i=0;i<N;i++) {
    int a,b;
    cin>>a>>b;
    sushi.push_back(MP(b, a));
  }
  sort(sushi.begin(), sushi.end());
  reverse(sushi.begin(), sushi.end());
  long long x = 0;
  res = 0;
  for (int i=0;i<K;i++){
   //cout<<sushi[i].first<<" "<<sushi[i].second<<endl;
    res += sushi[i].first;
    if (cnt[sushi[i].second] == 0) x++;
    cnt[sushi[i].second]++;
  }
  best = res + x*x;
  
  //cout<<res<<' '<<x<<endl;
  int j = K - 1;
  for (int i = K; i < N; i++) {
    int t = sushi[i].second;
    int d = sushi[i].first;

    if (cnt[t]) continue;
    while (j >= 0 && cnt[sushi[j].second] <= 1) j--;
    if (j < 0) break;
    cnt[sushi[j].second]--;
    res -= sushi[j].first;
    j--;

    x++;
    cnt[t]++;
    res += d;
    if (best < res + x*x)
      best = res + x*x;
    //cout<<i<<' '<<j<<' '<<res<<' '<<x<<endl;
  }

  cout<<best<<endl;
  

}


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

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

    int ans;

    if (n != 100) ans = pow(100, d) * n;
    else ans= pow(100, d) * (n + 1);

    
    cout << ans << endl;


    return 0;
}

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

n = maxn = 0
maxi = -1
S.chars.each.with_index do |c, i|
  n += (c == "E" ? 1 : -1)
  if n > maxn
    maxn = n
    maxi = i
  end
end

s1 = (maxi <= 0 ? "" : S[0, maxi])
s2 = S[(maxi+1)..-1]
d1 = s1.gsub("E", "").length
d2 = s2.gsub("W", "").length
p d1 + d2

Measured memory_bytes: 29468
#include <bits/stdc++.h>
#define int long long
#define N 100010
using namespace std;
typedef unsigned long long ull;
const int INF = 1LL<<55;
const int mod = (1e9)+7;
const double EPS = 1e-8;
const double PI = 6.0 * asin(0.5);
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
vector<vector<int> > AB,A,B;
int Aidx[5],Bidx[5];

unordered_set<ull> S;
ull VtoH(const vector<vector<int> > &v){
  const ull B = 1777771;
  ull res = 0;
  for(int i=0;i<5;i++)
    for(int j=0;j<5;j++) res = res * B + (v[i][j]+'0');
  return res;
}

vector<int> rev(vector<int> a){reverse(a.begin(),a.end());return a;}
void mirror(vector<vector<int> > &res){for(int i=0;i<5;i++) res[i] = rev(res[i]);}

vector<vector<int> > rot(const vector<vector<int> > &a){
  vector<vector<int> > res(5,vector<int>(5));
  for(int i=0;i<5;i++)
    for(int j=0;j<5;j++) res[i][j] = a[4-j][i];
  return res;
}

void insert(vector<vector<int> > v){
  S.insert(VtoH(v));
  v = rot(v) , v = rot(v), S.insert(VtoH(v));
  mirror(v), S.insert(VtoH(v));
  v = rot(v) , v = rot(v), S.insert(VtoH(v));
}

bool canPut(int idx,int j){
  int a = 1, b = 1;
  for(int i=0;i<5;i++) if(A[i][j] == B[idx][i]) a = 0;
  for(int i=0;i<5;i++) if(A[i][j] == B[idx][4-i]) b = 0;
  return a || b;
}

bool can(){
  int used = 0;
  for(int i=0;i<5;i++){
    for(int nx=0;nx<5;nx++){
      if((used>>nx&1) || !canPut(nx,i)) continue;
      Bidx[i] = nx;
      used |= (1<<nx);
      break;
    }
  }
  return used == (1<<5)-1;
}

int solve(){
  S.clear();
  int res = 0;
  for(int i=0;i<5;i++) Aidx[i] = i;
  for(int bit=0;bit<(1<<10);bit++){
    if(__builtin_popcount(bit) != 5) continue;    
    A.clear();B.clear();
    for(int i=0;i<10;i++) (bit>>i&1)? A.push_back(AB[i]):B.push_back(AB[i]);
    vector<vector<int> > tmp = A;
    do{
      for(int a=0;a<(1<<5);a++){
        for(int i=0;i<5;i++) A[Aidx[i]] = (a>>i&1)? rev(tmp[i]):tmp[i];
        if(!can() || S.count(VtoH(A))) continue;
        insert(A);
        res++;
      }
    } while(next_permutation(Aidx,Aidx+5));
  }
  return res/2;
}

signed main(){
  while(1){
    AB.clear();
    for(int i=0;i<10;i++){
      string str;
      cin>>str;
      if(str == "END") return 0;
      vector<int> tmp(5);
      for(int j=0;j<5;j++) tmp[j] = str[j] - '0';
      AB.push_back(tmp);
    }
    cout<<solve()<<endl;
  }
  return 0;
}

Measured memory_bytes: 3184
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<fstream>

#define MOD (1000000007)

using namespace std;

typedef long long int Int;

constexpr Int TEN(int n) { return n == 0 ? 1 : 10 * TEN(n-1); }

const int max_n = 100;
int A[max_n];
int B[max_n];
int C[max_n];
int D[max_n];
int N,M,Q;
int G[max_n];

Int rec(int cp, int num) {
    Int ans = 0;
    if(cp == N) {
        for(int i = 0;i < Q;i++) {
            if(G[B[i]] - G[A[i]] == C[i])
                ans += D[i];
        }
    } else { 
        for(int j = num;j <= M;j++) {
            G[cp] = j;
            ans = max(ans,rec(cp+1, j));
        }
    }

    return ans;
}

Int solve(void) {
    Int ans = 0;
    for(int i = 1;i <= M;i++) {
        G[0] = i; 
        ans = max(ans,rec(1, i));
    }

    return ans;
}


int main(void) {
    cin>>N>>M>>Q;

    for(int i = 0;i < Q;i++) {
        cin>>A[i]>>B[i]>>C[i]>>D[i];
        A[i]--;
        B[i]--;
    }

    cout<<solve()<<endl;

    return 0;
}


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

using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,n,m) for(ll i=n; i>(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define VEC2(x,a,b) vector<vector<ll>> x = vector<vector<ll>>(a,vector<ll>(b,0))
#define sortAl(v) sort(v.begin(),v.end())
#define sortAlr(v) sort(v.begin(),v.end()); reverse(v.begin(),v.end())
#define cinv(v,n,m) FOR(i,n,m) cin>>v.at(i)
#define coutv(v,n,m) FOR(i,n,m) cout<<v.at(i) <<" "; cout<<end
#define cout(n) cout<<fixed<<setprecision(n)
int main(){
  ll k;
  cin>>k;
  cout<<k/2*(k/2+k%2)<<endl;
}


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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            new Program().Solve();
        }

        void Solve()
        {
            var text = Console.ReadLine();
            var before = text.Substring(0, 3);
            var after = text.Substring(4);
            Console.WriteLine(before + "8" + after);
        }
    }
}


Measured memory_bytes: 13140
#include<cstdio>
#include<cstring>
#include<vector>
#include<stack>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#define maxn 200100
#define INF 100000000
using namespace std;
int main()
{
	char s[5],t[5];
	cin>>s>>t;
	int ans=0;
	for(int i=0;i<3;i++)
		if(s[i]==t[i])
			ans++;
	printf("%d\n",ans);
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cctype>
#include<string.h>
#include<stdio.h>
using namespace std;

int main(){
	int D, N;
	cin >> D >> N;
	if (D == 0){
		if (N == 100){
			cout << 101 << endl;
		}
		else{
			cout << N << endl;
		}
	}
	else if (D == 1){
		if (N == 100){
			cout << 10100 << endl;
		}
		else{
			cout << 100 * N << endl;
		}
	}
	else{
		if (N == 100){
			cout << 1010000 << endl;
		}
		else{
			cout << 10000 * N << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 256
def main():
    N, M, Q = map(int, input().split())
    S = [[0] * (N+1) for _ in range(N+1)]
    for i in range(M):
        L, R = map(int, input().split())
        S[L][R] += 1

    for i in range(1,N+1):
        for j in range(1,N+1):
            S[i][j] += S[i-1][j] + S[i][j-1] - S[i-1][j-1]

    for i in range(Q):
        p, q = map(int, input().split())
        ans = S[q][q] - S[q][p-1] - S[p-1][q] + S[p-1][p-1]
        print(ans)
    



main()

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

int main(){
	int N=0;
  	cin >>N;
  	int num[N]={};
  	int Alice=0, Bob=0;
  
  	for(int i=0;i<N;i++){
    	cin >>num[i];
    }
  
  	for(int i=0;i<N-1;i++){
    	for(int j=0;j<N-1-i;j++){
        	if (num[j+1]<num[j]){
              	int temp=num[j];
              	num[j]=num[j+1];
              	num[j+1]=temp;
            }
          	
        }
    }
  
  	bool flag=1;
  	for(int i=N-1;i>=0;i--){
     	if(flag){
          Alice += num[i];
          flag =0;
        }
      
      	else{
          Bob += num[i];
          flag =1;
        }
    }
  	cout << Alice - Bob <<endl;
}

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

#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})

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

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;

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

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

    int N, Q;
    cin >> N >> Q;

    vector<array<int, 3>> works(N); // x, s, t
    for (int i = 0; i < N; i++) {
        cin >> works[i][1] >> works[i][2] >> works[i][0];
    }
    sort(all(works));

    vi ans(Q, -1);

    set<pair<int, int>> people;
    for (int i = 0, d; i < Q; i++) {
        cin >> d;
        people.insert({ d, i });
    }

    for (auto w : works) {
        int x = w[0], s = w[1], t = w[2];
        for (auto it = people.lower_bound({ s - x, -1 }); it != people.end(); ) {
            if (it->first >= t - x) break;
            ans[it->second] = x;
            people.erase(it++);
        }
    }

    for (int v : ans)
        cout << v << "\n";

    return 0;
}



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

int main()
{
    string s;
    cin >> s;
    s.push_back('.');
    string t = "AKIHABARA";
    for(int i = 0; i < 9; i++){
        if(s[i] != t[i]) s.insert(i, "A");
    }
    s.pop_back();
    if(s == t) cout << "YES" << endl;
    else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<map>
#include<iostream>
#include<numeric>
using namespace std;
typedef long long int lli;
#define rep(i,n) for(lli i = 0;i<((lli)(n));i++)
#define reg(i,a,b) for(lli i = ((lli)(a));i<=((lli)(b));i++)
#define irep(i,n) for(lli i = ((lli)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(lli i = ((lli)(b));i>=((lli)(a));i--)
typedef pair<lli, lli> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX
#define eprintf(...) fprllif(stderr,__VA_ARGS__)
#define pque(type) priority_queue<type,vector<type>,greater<type> >
#define memst(a,b) memset(a,b,sizeof(a))

int main(void){
	int n;
	cin >> n;
	vector<vector<int>> v(n);
	rep(i, n-1){
		int a, b; cin >> a >> b; a--; b--;
		v[a].push_back(b);
		v[b].push_back(a);
	}
	vector<int> u(n, -1);
	queue<int> q;
	
	q.push(0); u[0] = 0;
	while(!q.empty()){
		int p = q.front(); q.pop();
		rep(i, v[p].size()) if(u[v[p][i]] == -1){
			int r = v[p][i];
			u[r] = u[p] + 1;
			q.push(r);
		}
	}
	
	int c = u[n-1] - 1, s = 0;
	
	q.push(n-1); u[n-1] = 0;
	while(!q.empty()){
		int p = q.front(); q.pop();
		rep(i, v[p].size()) if(u[v[p][i]] > (c+1)/2){
			q.push(v[p][i]);
			u[v[p][i]] = 0;
			s++;
		}
	}
	
	cout << (n-2-s > s ? "Fennec" : "Snuke") << endl;
	
	return 0;
}

Measured memory_bytes: 6144
/*
    Author: Nguyen Tan Bao
    Status:
    Idea:
*/
 
#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x
 
using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<II, int> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;
 
const ll MODBASE = 1000000007LL;
const int MAXN = 110;
const int MAXM = 1000;
const int MAXK = 16;
const int MAXQ = 200010;

int n;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cin >> n;
    FOR(i,1,n) {
        int x;
        cin >> x;
        if (x % 2 == 0) {
            if (!(x % 3 == 0 || x % 5 == 0)) {
                cout << "DENIED";
                return 0;
            }
        }
    }
    cout << "APPROVED";
    return 0;
}


Measured memory_bytes: 256
// In the name of ALlah //
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int maxn = 1e5 * 5 + 10 , inf = 1e9;
int n , a[maxn] , cnt[maxn];
void solve(){
    int ans = 0;
    for (int i = 1; i <= 1e5; i ++){
        ans = max(cnt[i] + cnt[i - 1] + cnt[i + 1] , ans);
    }
    cout << ans;
}
void in (){
    cin >> n;
    for (int i = 0; i < n; i++){
        cin >> a[i];
        cnt[a[i]] ++;
    }
    solve();
}
int main(){
    ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
    in();
}


Measured memory_bytes: 4384
import java.util.Scanner;

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

		//File file = new File("top2_3.txt");
		//FileInputStream fi = new FileInputStream(file);
		//Scanner sc = new Scanner(fi);

		int n = sc.nextInt();

		int[] oddCnt = new int[100001];
		int[] evenCnt = new int[100001];

		for (int i = 0; i < 100001; i++) {
			oddCnt[i] = 0;
			evenCnt[i] = 0;
		}

		for (int i = 0; i < n; i++) {
			int v = sc.nextInt();
			if (i % 2 == 0) {
				evenCnt[v]++;
			} else {
				oddCnt[v]++;
			}
		}

		int oddMax = 0;
		int oddMaxId = 0;
		int odd2ndMax = 0;
		int evenMax = 0;
		int evenMaxId = 0;
		int even2ndMax = 0;

		for (int i = 0; i < 100001; i++) {
			if (evenMax <= evenCnt[i]) {
				even2ndMax = evenMax;
				evenMax = evenCnt[i];
				evenMaxId = i;
			} else if (even2ndMax <= evenCnt[i]) {
				even2ndMax = evenCnt[i];
			}
			if (oddMax <= oddCnt[i]) {
				odd2ndMax = oddMax;
				oddMax = oddCnt[i];
				oddMaxId = i;
			} else if (odd2ndMax <= oddCnt[i]) {
				odd2ndMax = oddCnt[i];
			}
		}

		if (evenMaxId != oddMaxId) {
			//System.out.println(1 + ":" + n + ":" + evenMaxId + ":" + oddMaxId);
			System.out.println(n - evenMax - oddMax);
		} else if (even2ndMax > odd2ndMax) {
			//System.out.println(2 + ":" + n + ":" + evenMaxId + ":" + oddMaxId);
			System.out.println(n - even2ndMax - oddMax);
		} else {
			//System.out.println(3 + ":" + n + ":" + evenMax + ":" + oddMax + ":" + even2ndMax + ":" + odd2ndMax);
			System.out.println(n - evenMax - odd2ndMax);
		}
		sc.close();
	}
}


Measured memory_bytes: 52308
#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main()
{
	char W[11];
	char T[1001];
	int c,i,wn,tn;

	c = 0;

	scanf("%10s",W);
	wn = strlen(W);

	while (1)
	{
		scanf("%1000s",T);
		if (!strcmp(T,"END_OF_TEXT")) break;

		tn = strlen(T);
		if (wn != tn) continue;

		i = 0;
		while (i < wn)
		{
			if (tolower(W[i]) != tolower(T[i])) break;
			i++;
		}
		if (i == wn) c++;
	}

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

	return 0;
}

Measured memory_bytes: 1796
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


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


	int N;
	cin >> N;
	int A[50], B[50];
	rep(i, N) cin >> A[i];
	rep(i, N) cin >> B[i];

	int kotae[51] = {};
	for (int i = 49; i >= 0; i--) {
		int OK = 1;
		rep(j, N) {
			int dp[50][51] = {};
			dp[0][A[j]] = 1;
			rep1(k, 49) {
				rep(p, 51) dp[k][p] = dp[k - 1][p];
				if (50 - k <= i || kotae[50 - k]) {
					rep(p, 51) if (dp[k - 1][p]) {
						dp[k][p % (50 - k)] |= 1;
					}
				}
			}
			if (dp[49][B[j]] == 0) OK = 0;
		}
		if (OK == 0) kotae[i + 1] = 1;
	}

	if (kotae[50]) {
		co(-1);
	}
	else {
		ll suuji = 0;
		rep1(i, 49) {
			if(kotae[i]) suuji += 1ll << i;
		}
		co(suuji);
	}

	Would you please return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define ll long long int
#define F first
#define S second
const ll mod = 1e9 + 7;
const ll INF = 10000000000000;
#define pb push_back
#define deb(x) cout << '>' << #x << ':' << x << endl;
#define fastio ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
vector<ll>adj[107];
int main()
{
    fastio;
   ll n=0,k=0;
   cin>>n>>k;
   for(ll K=0;K<k;++K){
    ll d=0;
    cin>>d;
    for(ll j=0;j<d;++j){
        ll x=0;
        cin>>x;
        adj[x].pb(K+1);
    }
   }
   ll c=0;
   for(ll i=1;i<=n;++i){
    if(adj[i].size()==0)
        ++c;
   }
   cout<<c;
}

Measured memory_bytes: 3780
while True:
    h, w = map(int, input().split())

    if h == 0 and w == 0:
        break

    for i in range(h):
        if i == 0 or i == h - 1:
            print('#' * w)
        else:
            print('#' + '.' * (w - 2) + '#')

    print()

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

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;

  for (;;) {
    c -= b;
    if (c <= 0) {
      cout << "Yes" << endl;
      break;
    }
    a -= d;
    if (a <= 0) {
      cout << "No" << endl;
      break;
    }
  }
}

Measured memory_bytes: 3632
#include<stdio.h>
int main()
{
    int i,N,x;
    scanf("%d", &N);
    x=0;
    for(i=1;i<=9;i++)
    {
        if(N%i==0 && N/i<=9)
        {
            printf("Yes\n");
            x=1;
            break;
        }
    }
    if(x==0)
    {
        printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 128
#include <iostream>

using namespace std;
int A,B,C,i;

int main(){
  cin >> A >> B >> C;
  for (i=1; i<=B; i++){
    if(A*i%B == C){
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}


Measured memory_bytes: 256
package main

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

var dp []int

func dpf(x int) int {
	if x == 0 {
		return 0
	}
	if dp[x] != 0 {
		return dp[x]
	}

	m := dpf(x - 1)
	for y := 6; y <= x; y *= 6 {
		m = min(m, dpf(x-y))
	}
	for y := 9; y <= x; y *= 9 {
		m = min(m, dpf(x-y))
	}
	dp[x] = m + 1
	return m + 1
}

func main() {
	n := readI()

	//dp[i] = i円引き出す際の最低操作回数
	dp = make([]int, n+1)

	fmt.Println(dpf(n))
}

func min(a ...int) int {
	m := a[0]
	for i := 1; i < len(a); i++ {
		if m > a[i] {
			m = a[i]
		}
	}
	return m
}

/*-----------Input utils-----------*/

var sc = bufio.NewScanner(os.Stdin)

func init() {
	if len(os.Args) >= 2 {
		if os.Args[1] == "debug" {
			debug()
		}
	}
	const buf = 200100
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, buf), buf)
}

func debug() {
	testFile, err := os.Open("./test/sample-3.in")
	if err != nil {
		fmt.Fprintln(os.Stderr, "There is no testfile.")
		os.Exit(1)
	}
	sc = bufio.NewScanner(testFile)
}

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

func readR() []rune {
	return []rune(readS())
}

func readI() int {
	i, _ := strconv.Atoi(readS())
	return i
}

func readF() float64 {
	f, _ := strconv.ParseFloat(readS(), 64)
	return f
}


Measured memory_bytes: 27616
(defun solve (a b)
  (cons (car a)
        (cons (car b)
              (if (or (null (cdr a)) 
                      (null (cdr b)))
                  nil
                  (solve (cdr a) (cdr b))))))

(let* ((n (read))
       (str (read-line))
       (a (coerce (subseq str 0 n) 'list))
       (b (coerce (subseq str (+ n 1)) 'list)))
  (princ (coerce (solve a b) 'string)))

Measured memory_bytes: 4448
N=int(input())
a = list(map(int,input().split()))
s = a[0]
for i in range(1,len(a)):
    s ^= a[i]
    #print(a[i])
#print(s)
for i in range(len(a)):
    #print(s,a[i])
    ans = s^a[i]
    print(ans,end=" ")


Measured memory_bytes: 105488
#include <bits/stdc++.h>
#define lli                             long long int
#define ull                             unsigned long long int
#define D                               double
#define Input(n)                        for(int i = 0; i < n; i++) cin >> a[i];                          
#define sqr(x)                          ((x)*(x))
#define ff                              first
#define sz                              size()
#define PB                              push_back
#define MP                              make_pair
#define CHR                             getchar()
#define NL                              printf("\n")
#define PI                              2.0*acos(0.0)
#define MEM(a,val)                      memset(a,val,sizeof(a))
#define timesave                        ios_base::sync_with_stdio(0); cin.tie(0)
#define debug                           printf("***** here here here here *****\n");
#define file_input                      freopen("A.in","r",stdin),freopen("A1.out","w",stdout)
using namespace std;

template <typename T> T in(){char ch;T n = 0;bool ng = false;while (1){ch = getchar();if (ch == '-'){ng = true;ch = getchar();break;}if (ch>='0' && ch<='9')     break;}while (1){n = n*10 + (ch - '0');ch = getchar();if (ch<'0' || ch>'9')   break;}return (ng?-n:n);}
template<typename T>inline T POW(T B,T P){ if(P==0) return 1; if(P&1) return B*POW(B,P-1);  else return SQR(POW(B,P/2));}
template<typename T>inline T Gcd(T a,T b){if(a<0)return Gcd(-a,b);if(b<0)return Gcd(a,-b);return (b==0)?a:Gcd(b,a%b);}
template<typename T>inline T Lcm(T a,T b) {if(a<0)return Lcm(-a,b);if(b<0)return Lcm(a,-b);return a*(b/Gcd(a,b));}


long long Bigmod(long long base, long long power, long long MOD){long long ret=1;while(power){if(power & 1)ret=(ret*base)%MOD;base=(base*base)%MOD;power>>=1;}return ret;}
bool isVowel(char ch){ ch=toupper(ch); if(ch=='A'||ch=='U'||ch=='I'||ch=='O'||ch=='E') return true; return false;}
long long ModInverse(long long number, long long MOD){return Bigmod(number, MOD-2, MOD);}
bool isConst(char ch){if (isalpha(ch) && !isVowel(ch)) return true; return false;}
int toInt(string s)  { int sm; stringstream ss(s); ss>>sm; return sm; }

const int M = 1e5 + 5;

 
                      ///*********************** Let`s start ***************************//

int main()
{
	timesave;
	
	
	int n, a, b, aa, bb;
	
	cin >> n >> a >> b;
	
	if((b-a)%2 == 1) cout << "Borys" << endl;
	else  cout << "Alice" << endl;
	
	

    return 0;
}


Measured memory_bytes: 256
using System;


namespace ConsoleApplication9
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                String x = Console.ReadLine();
                //char????????????
                char[] m = x.ToCharArray();
                //????????????????????´??°?????´???
                if (x == "0")
                {
                    break;
                }
                int sum = 0;
                foreach (char a in m)
                {
                    sum +=  a - 48;  
                }
                //string????????´??°?????´???????¨????
                Console.WriteLine(sum);
            }
        }
    }
}

Measured memory_bytes: 8944
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using pii=pair<int,int>;
#define all(c) begin(c),end(c)
#define rall(c) rbegin(c),rend(c)
#define fore(x,c) for(auto &&x:c)
#define rep(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define rrep(i, a, n) for(int i=(int)(n-1);i>=a;--i)
#define sz(c) ((int)c.size())
#define contains(c,x) (c.find(x)!=end(c))
#define inseg(l,x,r) ((l)<=(x)&&(x)<(r))
#define dump(...)
#define pb push_back
#define _ 0
const signed INF_=1001001001; const long long INF=1001001001001001001LL;
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    for (auto i = begin(v); i != end(v); i++) os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    for (auto i = begin(v); i != end(v); i++) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a,const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a,const U &b){return a>b?a=b,1:0;}
template <class T> void psum(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap=priority_queue<T,vector<T>,greater<T>>;
struct before_main_function {
    before_main_function() {
        cin.tie(0); ios::sync_with_stdio(0);
        cout << setprecision(15) << fixed;
        // #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

signed main() {
    int N;
    cin >> N;
    vector<int> V(N), C(N);
    cin >> V >> C;
    int ans = 0;
    rep(i, 0, N) {
        int d = V[i] - C[i];
        if (d > 0) ans += d;
    }
    cout << ans << endl;
    return (0^_^0);
}



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

typedef long long ll;

#define REP(i, n) for(ll i = 0; i < n; i++)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(ll i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
#define LINF 1e18


int main() {
    int N; cin >> N;
    vector<vector<int>> dp(2,vector<int>(120,0));
    dp[0][0] = 1;
    
    REP(j,100){            
        if(j+4<=N) dp[0][j+4] += dp[0][j];
        dp[1][j] += dp[0][j];
        if(j+7<=N) dp[1][j+7] += dp[1][j];
    }
    if(dp[1][N] > 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define endl "\n"
#define fo for(int i=0;i<n;i++)
#define clear cin.clear();cin.ignore(numeric_limits<streamsize>::max(), '\n');
#define loopSolve int t; cin>>t; while(t--){solve();}
//INT_MAX         2,147,483,647                       <10^10
//U_INT_MAX       4,294,967,295                       <10^10
//LONG_LONG_MAX   9,223,372,036,854,775,807           <10^18
//U_LONG_LONG_MAX 18,446,744,073,709,551,615          <10^18
//ll power(int a, int b){
//    return (ll)(pow(a,b)+0.5);
//}

vector<int> gV(int n){
    vector<int> v(n);
    int input;
    fo { cin>>v[i];  }
    return v;
}

int* gA(int n){
    int* arr = new int[n];
    fo cin>>arr[i];
    return arr;
}


void solve(){
    int n,ans=0;
    cin>>n;
    int* arr = gA(n);
    fo{
        if(i%2==0 && arr[i]%2!=0)
            ans++;
    }
    cout<<ans<<endl;

}


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

    solve();
    //loopSolve;

	return 0;
}


Measured memory_bytes: 3656