akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define BIT(X, i) ((X>>i)&1)
#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
#define r_all(a) (a).rbegin() (a).rend()

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef pair<ll, ll> pii;
typedef vector<pii> vii;
typedef priority_queue<ll> pq;

const int MOD = 1e9+7;
const int INF = (1<<30);
const ll INFL = (1L<<62);

int main() {
  ll N, A; cin >> N >> A;
  vi x(N);
  rep(i, N) cin >> x[i];
  vvvi dp(N+1, vvi(3000, vi(N+1, 0)));

  dp[0][0][0] = 1;
  rep(i, N) {
    rep(j, 2500) {
      rep(k, N) {
        dp[i+1][j][k] += dp[i][j][k];
        dp[i+1][j+x[i]][k+1] += dp[i][j][k];
      }
    }
  }
  ll ans = 0;
  for (int k = 1; k <= N; k++) {
    ans += dp[N][k*A][k];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 67328
#include<iostream>
using namespace std;
#include<map>
#include<set>
#define int long long int
#define mod 1000000007
int function(string &str1,string &str2,int initial,int final,int memo[][4][4],int status1,int status2)
{
	if(initial>final)
	    return 1;
	if(memo[initial][status1][status2]!=-1)
	    return memo[initial][status1][status2];
	else
	{
		if(str1[initial]==str2[initial])
		{
			int i;
			int answer=0;
			for(i=1;i<4;i++)
			{
				if(i!=status1&&i!=status2)
				{
					answer+=function(str1,str2,initial+1,final,memo,i,i);
					answer=answer%mod;
				}
			}
			memo[initial][status1][status2]=answer;
			return memo[initial][status1][status2];
		}
		else
		{
			int i,j;
			int answer=0;
			for(i=1;i<4;i++)
			{
				for(j=1;j<4;j++)
				{
					if(i!=j&&i!=status1&&j!=status2)
					{
						answer+=function(str1,str2,initial+2,final,memo,i,j);
						answer=answer%mod;
					}
				}
			}
			memo[initial][status1][status2]=answer;
			return memo[initial][status1][status2];
		}
	}
}
int32_t main()
{
     int n;
     cin>>n;
     string str1;
     cin>>str1;
     string str2;
     cin>>str2;
     bool result=true;
     int j;
     for(j=0;j<n-1;j++)
     {
		 if(str1[j]==str2[j]&&(str1[j]==str1[j+1]||str2[j]==str2[j+1]))
		 {
			 result=false;
			 break;
		 }
	 }
	 if(!result)
	     cout<<0<<endl;
	 else
	 {
		 int memo[n+1][4][4];
		 int i,k;
		 for(i=0;i<=n;i++)
		 {
			 for(j=0;j<4;j++)
			 {
				 for(k=0;k<4;k++)
				 {
					 memo[i][j][k]=-1;
				 }
			 }
		 }
		 int answer=function(str1,str2,0,n-1,memo,0,0);
		 cout<<answer<<endl;
	 }
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
#include<string>
#include<utility>
#include<algorithm>
#include<vector>
#include<math.h>
#include<bits/stdc++.h>
#include<stdio.h>
 
int main(){
    int N;
    cin >> N;
    int a[N];
    for(int i=0;i<N;++i){
        cin >> a[i];
    }
    int ans=1000000;
    int res=0;
    sort(a,a+N);
    for(int i=a[0];i<=a[N-1];++i){
        for(int j=0;j<N;++j){
            res+=pow(i-a[j],2);
            if(j==N-1){
                if(res<ans){
                    ans=res;
                    res=0;
                }
                else{
                    res=0;
                }
            }
        }
    }
    cout << ans;
}

Measured memory_bytes: 256
#include <limits.h>

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
using namespace std;
using P = pair<int, int>;
using ll = long long;
template <typename T = long long>
vector<T> make_v(size_t a) {
  return vector<T>(a);
}
template <typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
  return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

int main() {
  int n;
  cin >> n;
  vector<int> a(n, 0);
  for (int x = 1; x * x < n; x++) {
    for (int y = 1; y * y < n; y++) {
      for (int z = 1; z * z < n; z++) {
        if (x * x + y * y + z * z + x * y + y * z + z * x <= n) {
          a[x * x + y * y + z * z + x * y + y * z + z * x - 1]++;
        }
      }
    }
  }
  for (int i = 0; i < n; i++)
    cout << a[i] << endl;
}


Measured memory_bytes: 3552
#include <bits/stdc++.h>
using namespace std;
 
int main(void)
{
  int N=0;
  string S, T, ans;
  cin >> N >> S >> T;
  for(int i = 0; i < N; ++i) {
    ans = ans + S[i] + T[i]; 
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <algorithm>

int main()
{
    int N;

    scanf("%d", &N);

    std::vector<int64_t> C(N, 0);
    std::vector<int64_t> D(N + 1, 0);
    for (int i = 0; i < N; ++i)
    {
        int a;
        scanf("%d", &a);
        C[--a]++;
        D[C[a]]++;
    }

    std::vector<int64_t> S(N + 1, 0);
    for (int i = 1; i <= N; ++i)
    {
        S[i] = S[i - 1] + D[i];
    }

    for (int K = 1; K <= N; ++K)
    {
        int64_t low = 0, high = N + 1;
        while (high - low > 1)
        {
            int64_t x = (low + high) / 2;
            if (S[x] >= K * x)
            {
                low = x;
            }
            else
            {
                high = x;
            }
        }
        printf("%lld\n", low);
    }
}


Measured memory_bytes: 7936
from collections import defaultdict
length = int(input())
target = [int(n) for n in input().split(" ")]
w_counter = defaultdict(int)

for t in target:
    w_counter[t] += 1

max_card = 0
min_card = 10 ** 8
overlap_card = 0 
for k,v in w_counter.items():
    if v > 1:
        max_card = max(max_card,k)
        min_card = min(min_card,k)
        overlap_card += v - 1
cannot_pinch = 1

for k,v in w_counter.items():
    if min_card <= k <= max_card:
        cannot_pinch = 0
        break
#print(overlap_card)
if overlap_card % 2 == 0:
    print(length - overlap_card)
else:
    print(length - overlap_card - (1 + cannot_pinch))

Measured memory_bytes: 18656
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
    string s,t;
    cin>>s>>t;
    int ans=0;
    rep(i,3){
        if(s[i]==t[i]) ans++;
    }
    cout<<ans<<endl;
    return 0;
}

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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 62)

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

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



int n, t[101];
string s[101], x;
void solve(){
	cin >> n;
	i64 cnt = 0;
	for(int i = 0; i < n; i++){
		cin >> s[i] >> t[i];
		cnt += t[i];
	}
	cin >> x;
	
	i64 ans = 0;
	for(int i = 0; i < n; i++){
		ans += t[i];
		if(s[i] == x) break;
	}
	cout << cnt- ans << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}

Measured memory_bytes: 256
//		HYSO SERIOUS? WHY SO SERIOUS                            RIOUS? WHY SO SERIOUS? WHYSO SERIO
//		 ERIOUS? WHY SO SERIOUS ? WHY                          WHY SO SERIOUS? WHY SOSERIOUSWHYS
//		       OSERIOUS? WHY SO SERIOU         SERIOUS        ERIOUS? WHY SO SERIOUS? WHYS
//		          WHY SO SERIOUS? WHY SOSERIOUS? WHYSOSERIOUS? WHY SO SERIOUS?WHY SO SE
//		           ERIOUS? WHY SO SERIOUS? WHY SO SERIOUS? WHY SO SERIOUS? WHY SOSERIO
//		           WHY SO SERIOUS? WHY SO SERIOUS? WHY SO SERIOUS? WHY SO SERIOUS? WH
//		            SERIOUS?WHYSO SERIOUS? WHY SO SERIOUS? WHY SO SERIOUS? WHYSO SE
//		              ?WHYSOSERIOUS?WHY SO SERIOUS? WHY SO SERIOUS?WHYSO SERIOUS?
//		                           OSERIOUS? WHY SO SERIOUS?WHYSOSER
//		                                 HYSOSERIOUS?WHYSOSERI
//		                                     SOSERIOUS?W
//		                                         SER
//		                                          W


#include <iostream>
#include <queue>
#include <tuple>
#include <vector>
using namespace std;
#include<bits/stdc++.h>
#include <algorithm>
#define ll long long int
#define read(a) long long int a; cin>>a;
#define readstr(s) string s; cin>>s;
#define readarr(a,l) long long int a[l]={0}; for(ll i=0;i<l;i++) cin>>a[i];
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define rloop(i,a,b) for(ll i=a;i>b;i--)
#define ff first
#define ss second
#define readmtrx(i,j,a,b) ll arr[a][b]={0};for(ll i=0;i<a;i++)for(ll j=0;j<b;j++) cin>>arr[i][j];
#define v(pi) vector<ll>pi
#define vp(pi) vector<pair<ll,ll>>pi
#define fast ios_base::sync_with_stdio(false);cin.tie(0);
#define pb(p) push_back(p)
#define mp make_pair
#include <cmath>
#include <map>
#include <string>
#define mi(lol) map<ll,ll>lol
#define fsort(vec) sort(vec.begin(),vec.end())
#define rsort(vec) sort(vec.begin(),vec.end(),compare)
#define inf ll inf=INT_MAX
//sorting according to the second element vector 

bool compare(pair<ll,ll> p,pair<ll,ll> q){
	return p.second < q.second;	
}

//   example:-
//   sort(vec.begin(),vec.end(),compare);


int main() {
	fast;
// #ifndef ONLINE_JUDGE
//   freopen("input.txt","r",stdin);
//   freopen("output.txt","w",stdout);
// #endif
	readstr(s)
	string f=s;
	bool flag=false,flag1=false;
	ll m=s.length()/2;
	string g=s.substr(0,m);
	string rr=g;
	reverse(g.begin(),g.end());
	if(rr==g){
		flag=true;
	}
	string r=s.substr(m+1,s.length()-1);
	string rrr=r;
	reverse(r.begin(),r.end());
	if(rrr==r){
		flag1=true;
	}
	bool flag2=false;
	reverse(s.begin(),s.end());
	if(s==f) flag2=true;
	if(flag1&&flag&&flag2) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
void solve(){
    
}
int main() {
  ll n,sum=0;
  cin>>n;
  for(ll i=1;i<=n;i++){
  	if(i%3!=0 and i%5!=0)
  	sum+=i;
  }
  cout<<sum;
  return 0;
}

Measured memory_bytes: 3632
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N = ii()
A = li()

A_r = [A[i]-(i+1) for i in range(N)]
B = sorted(A_r)

cnt = 0
for i in range(N):
    num = -2*(i+1)-A_r[i]
    ind_l = bisect.bisect_left(B, num)
    if B[ind_l] != num:
        continue
    ind_r = bisect.bisect_right(B, num)
    cnt += ind_r - ind_l

print(cnt)

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

int main() {
  long long a,b,c,d;
  cin>>a>>b>>c>>d;
  long long ans=-1000000000000000000;
  ans=max(ans,a*c);
  ans=max(ans,a*d);
  ans=max(ans,b*c);
  ans=max(ans,b*d);
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll f(ll n,ll x){
    if(n>=0)
    return n/x+1;
    else
    return 0;
}
ll gcd(ll a,ll b){
	if(!b)return a;
	return gcd(b,a%b);
}
int main(){
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    ll lcm=(c*d)/gcd(c,d);
    ll dc=f(b,c)-f(a-1,c);
    ll dd=f(b,d)-f(a-1,d);
    ll l=f(b,lcm)-f(a-1,lcm);
    cout<<(b-a)-(dc+dd-l)+1;
}

Measured memory_bytes: 3576
#include <stdio.h>
int main (void)
{
   int i,j,x[10000];
   i = 0;
   do{
      scanf("%d",&x[i]);
      i++;
   }while(x[i-1] != 0);
   for(j=1;j<i;j++){
      printf("Case %d: %d\n",j,x[j-1]);
   }
   return 0;
}

Measured memory_bytes: 636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll n;
    cin >> n;
    set<ll> s;
    rep(i, n) {
        ll a;
        cin >> a;
        if (s.count(a) > 0) {
            cout << "NO" << endl;
            return 0;
        }
        s.insert(a);
    }
    cout << "YES" << endl;
    return 0;
}


Measured memory_bytes: 9600
import os
import sys
from io import BytesIO, IOBase
from collections import defaultdict as dd
from math import log,ceil

def main():
    n=int(input())
    l=ceil((log(25*n+26)/log(26)))-1
    d=n-26*(pow(26,l)-1)//25-1
    s=''
    for i in range(int(l)):
        s=chr(97+int(d)%26)+s
        d//=26
    print(s)
    



BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")


if __name__ == "__main__":
    main()



Measured memory_bytes: 67764
#include<bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main()
{
    int n;
    cin >> n;
    vector<long long> a(n);
    long long sum = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        sum += a[i];
    }
    long long ans = 0;
    for (int i = 0; i < n-1; i++)
    {
        sum -= a[i];
        ans = (ans + (sum % mod) * (a[i] % mod)) % mod;
    }
    cout << ans << "\n";
}

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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define LCM(a, b) (a) / __gcd((a), (b)) * (b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define ln '\n'

using namespace std;
using LL = long long;
using ldouble = long double;
using P = pair<int, int>;
using LP = pair<LL, LL>;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1e9 + 7;
static const int SIZE = 200005;

const int dx[] = {0, -1, 1, 0};
const int dy[] = {-1, 0, 0, 1};

vector<LL> Div(LL n) {
    vector<LL> ret;
    for(LL i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);
            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

    LL N;
    cin >> N;
    LL d = 26;
    LL s = 26;
    int c = 1;
    while(s < N) {
        d *= 26;
        s += d;
        c++;
    }

    s -= d;
    if(s == 1) --s;
    N -= s;
    N--;
    vector<char> v;
    for(int i = 0; i < c; ++i) {
        v.pb(N % 26 + 'a');
        N /= 26;
    }

    reverse(all(v));
    for(int i = 0; i < v.size(); ++i) {
        cout << char(v[i]);
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 3604
#include <bits/stdc++.h>
  #define rep(i,n) for (int i = 0; i < (n); ++i)
  #define ok() puts(ok?"Yes":"No");
  using namespace std;
  typedef long long ll;
  typedef vector<int> vi;
  typedef pair<int, int> ii;
  typedef vector<vi> vvi;
  typedef vector<ii> vii;
  typedef vector<bool> vb;
  typedef vector<vb> vvb;
  typedef set<int> si;
  typedef map<string, int> msi;
  typedef greater<int> gt;
  typedef priority_queue<int, vector<int>, gt> minq;
  typedef long long ll;
  typedef pair<ll,ll> pll;
  const ll LINF = 1e18L + 1;
  const int INF = 1e9 + 1;
  //clang++ -std=c++11 -stdlib=libc++ 

  int main() {
    string s; cin >> s;
    reverse(s.begin(), s.end());
    int n = s.length();
    ll mod = 2019;
    vector<ll> prefixSum(s.length()+1);
    vector<ll> ans(mod);
    ll tot = 0, keta = 1;
    prefixSum[0] = 0;
    // rep(i,s.length()) {
      for (int i=0;i<n;i++) {
    ll x = s[i]-'0';
      tot += x * keta;
      tot %= mod;
      keta *= 10;
      keta %= mod;
      prefixSum[i+1] = tot;
    }
    for (int i=0;i<=n;i++) {
      ans[prefixSum[i]]++;
    }
    ll out = 0;
    auto comb = [] (ll n) -> ll {
      if (n<=1) return 0;
      return (n-1)*n/2;
    };
    // rep(i, prefixSum.size()) cout << prefixSum[i] << endl;
    for (int i=0; i<mod; i++) {
      out += comb(ans[i]);
    }

    printf("%lld\n", out);
    return 0;
  }

Measured memory_bytes: 5068
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.concurrent.SynchronousQueue;

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

	void run() {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		if (A <= B) {
			System.out.println("Impossible");
			return;
		}

		ArrayDeque<Integer> stack = new ArrayDeque<>();
		stack.add(0);
		int Asz = A;
		int Bsz = B;
		for (int i = 1; stack.size() <= Bsz; ++i) {
			if (!stack.isEmpty())
				System.out.println("? " + stack.getFirst() + " " + i);
			else {
				stack.addFirst(i);
				continue;
			}
			String s = sc.next();
			if (s.equals("Y")) {
				stack.addFirst(i);
			} else {
				--Bsz;
				stack.removeFirst();
			}
		}
		int ori = stack.getFirst();
		boolean[] beHonest = new boolean[A + B];
		beHonest[ori] = true;
		for (int i = 0; i < A + B; ++i) {
			if (i == ori)
				continue;
			System.out.println("? " + ori + " " + i);
			String s = sc.next();
			if (s.equals("Y")) {
				beHonest[i] = true;
			}
		}
		StringBuilder ans = new StringBuilder();
		for (int i = 0; i < A + B; ++i) {
			if (beHonest[i]) {
				ans.append("1");
			} else {
				ans.append("0");
			}
		}
		System.out.println("! " + ans);

	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}

Measured memory_bytes: 42976
#include<stdio.h>
#include<stdlib.h>

int Fibonachi(int);

int *F;

int main(){
  int x,a,i;


  scanf("%d",&x);
  
  F = (int *)malloc(sizeof(int) * x+1);

  for(i = 0 ; i < x+1 ; i++) F[i] = 0;
  
  a = Fibonachi(x);
  
  printf("%d\n",a);

  
  return 0;

}

int Fibonachi(int n){
  int ans;
  if(n == 0 || n == 1) F[n] = 1;

  if(F[n] != 0) return F[n];

  F[n] = Fibonachi(n-1)+Fibonachi(n-2);
  
  return F[n]; 

}

Measured memory_bytes: 596
#include <iostream>
#include <string>
#include <vector>

using namespace std;

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

const long long INF = 1LL << 60;
long long dp[101][100001] = {0};
long long w[101], v[101];

int main(){
    int N, W;
    cin >> N >> W;
    
   
   //long long dp[110][100] ;
    //unsigned long long dp[N+1][W+1];

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

    for (int i=1; i <= N; ++i){
        for(int j=1; j <= W; ++j){
            if(j >= w[i-1]){
                chmax(dp[i][j], dp[i-1][j-w[i-1]]+ v[i-1]);
            }
            chmax(dp[i][j], dp[i-1][j]);
        }
    }

    long long ans=0;
    for(int i=0; i < W+1; ++i){
        chmax(ans, dp[N][i]);
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 78336
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define rREP(i,m,n) for(ll i = (m); i >= (n); i--)
#define ALL(c) (c).begin(), (c).end()
#define print(x) cout << (x) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
ll dp[3010][6020];

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

    int n;
    ll t;
    cin>>n>>t;
    pair<ll, ll> p[n];
    rep(i,n)
    {
        ll a,b;
        cin>>a>>b;
        p[i] = make_pair(a,b);
    }
    sort(p, p+n);
    rep(i,3010)  rep(j,6020) dp[i][j]=0;
    // cout << "koko02" << endl;
    rep(i,n+1) rep(j, 6020)
    {
        if (i==0) continue;
        if (j-p[i-1].first<t && j-p[i-1].first>=0)
        {
            dp[i][j] = max(dp[i-1][j-p[i-1].first]+p[i-1].second, dp[i-1][j]);
        }
        else
        {
            // 食べない食べれない
            dp[i][j] = dp[i-1][j];
        }
        // if (j==0)
        // {
        //     cout << "now" << i << endl;
        // }
    }
    // cout << "koko" << endl;
    ll ans = 0;
    rep(i,6020)
    {
        ans = max(ans, dp[n][i]);
    }
    cout << ans << endl;
    // cout << dp[n][60] << endl;



    
    
}




Measured memory_bytes: 141952
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
	string a, b;
	cin >> a >> b;
	if (a.size() > b.size()) { cout << "GREATER" << endl; return 0; }
	else if (a.size() < b.size()) { cout << "LESS" << endl; return 0; }
	for (int i = 0; i < a.size(); i++) {
		if (a[i] > b[i]) { cout << "GREATER" << endl; return 0; }
		if (b[i] > a[i]) { cout << "LESS" << endl; return 0; }
	}
	cout << "EQUAL" << endl;
	int x;
	cin >> x;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
  	cin>>n;
  	vector<int>num(n);
  	sort(num.begin(), num.end());
    for(int i=0;i<n;i++){
    	cin>>num[i];
    }
  sort(num.begin(), num.end());
  	double x=num[0];
  	cout << fixed << setprecision(5);
  	for(int i=1;i<n;i++){
    	x=(x+num[i])/2;
    }
  	cout<<x<<endl;
}

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


public class HelloWorld
{

    static long H;
    static long W;
    static long K;
    static long res = long.MaxValue;
    static string[] choco;
    static public void Main()
    {
        var inp = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
        H = inp[0];
        W = inp[1];
        K = inp[2];
        choco = new string[H];
        for (int i = 0; i < H; i++)
        {
            choco[i] = Console.ReadLine();
        }

        for (int i = 0; i < Math.Pow(2,H -1); i++)
        {
            var num = Convert.ToString(i, 2).PadLeft((int)H -1,'0');
            res = Math.Min(res, Check(num)); 
        }
        Console.WriteLine(res);
    }

    static long Check(string map)
    {
        var GroupNumber = 1;
        var Group = new int[H];
        for (int i = 0; i < H; i++)
        {
            Group[i] = GroupNumber;
            if(i < H -1 &&map[i] == '1')GroupNumber++;
        }
        var GroupSum = new long[Group[H - 1]+1];
        long ans = Group[H - 1] - 1;

        for (int j = 0; j < W; j++)
        {
            var GroupSumTmp = new long[Group[H - 1]+1];
            for (int i = 0; i < H; i++)
            {
                GroupSumTmp[Group[i]] += choco[i][j] == '1' ? 1 : 0;
                if (GroupSumTmp[Group[i]] > K) return long.MaxValue;
            }

            var cut = false;
            for (int i = 1; i <= Group[H - 1]; i++)
            {
                if(GroupSum[i] + GroupSumTmp[i] > K)
                {
                    cut = true;
                    break;
                }
            }

            if (cut)
            {
                GroupSum = GroupSumTmp;
                ans++;
            }
            else
            {
                for (int i = 1; i <= Group[H - 1]; i++)
                {
                    GroupSum[i] += GroupSumTmp[i];
                }
            }
        }

        return ans;
    }
}

Measured memory_bytes: 46824
function main(input){
    const args = input.split("\n");
    const N = args[0],
        nums = args.slice(1, args.length - 1);
    
    console.log(nums.filter((n, i)=> nums.indexOf(n) === i).length);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 29564
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define RI(a) scanf("%d",&a)
#define RII(a,b) scanf("%d%d",&a,&b)
#define RIII(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define F first
#define S second
#define REP(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=2000000000;
const ll mod=ll(1e9+7);

int n;
int x[maxn],y[maxn];
int t[maxn];
int main()
{
	IOS;
	int n;
	cin>>n;
	for(int i=1;i<=n;i++) cin>>t[i]>>x[i]>>y[i];

	REP(i,n){
		if((t[i]+x[i]+y[i])%2!=(t[i+1]+x[i+1]+y[i+1])%2){
			cout<<"No\n";
			return 0;
		}
		if(abs(x[i]-x[i+1])+abs(y[i]-y[i+1])>t[i+1]-t[i]){
			cout<<"No\n";
			return 0;
		}
	}
	cout<<"Yes\n";
	return 0;
		
}


Measured memory_bytes: 1408
using System;
using System.Linq ;　

class C
{
  static void  Main (string[] args)
  {
    Console.ReadLine ();
     var vals = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    var odd = vals.Where ((p,i)=>i%2!=0).GroupBy(p=>p).OrderBy(p=>-p.Count()).ToArray();
    var evn = vals.Where ((p,i)=>i%2==0).GroupBy(p=>p).OrderBy(p=>-p.Count()).ToArray();
if(odd[0].Key != evn[0].Key) Console.WriteLine(vals.Length -(odd[0].Count()+evn[0].Count()));
else Console.WriteLine(vals.Length - Math.Max(odd[0].Count()+(evn.Skip(1).FirstOrDefault()?.Count()??0), evn[0].Count()+(odd.Skip(1).FirstOrDefault()?.Count()??0)));
  }
}

Measured memory_bytes: 35528
#include <stdio.h>

int max(int a,int b);

int main(void){
  int paper[14][14];
  for(int i=0;i<14;i++){
    for(int j=0;j<14;j++){
      paper[i][j]=0;
    }
  }
  int x,y,s;
  while(scanf("%d,%d,%d",&x,&y,&s)!=EOF){
    x+=2;
    y+=2;
    switch(s){
      case 3:
        paper[x-2][y]+=1;
        paper[x][y-2]+=1;
        paper[x+2][y]+=1;
        paper[x][y+2]+=1;
      case 2:
        paper[x-1][y-1]+=1;
        paper[x-1][y+1]+=1;
        paper[x+1][y-1]+=1;
        paper[x+1][y+1]+=1;
      case 1:
        paper[x-1][y]+=1;
        paper[x][y-1]+=1;
        paper[x+1][y]+=1;
        paper[x][y+1]+=1;
        paper[x][y]+=1;
    }
  }
  int white=0;
  int ink=0;
  for(int i=2;i<12;i++){
    for(int j=2;j<12;j++){
      if(paper[i][j]==0){
        white+=1;
      }
      else{
        ink=max(ink,paper[i][j]);
      }
    }
  }
  printf("%d\n%d\n",white,ink);
  return 0;
}

int max(int a, int b){
  if(a<b){
    return b;
  }
  else{
    return a;
  }
}



Measured memory_bytes: 1932
#include<bits/stdc++.h>
using namespace std ;
#define ull unsigned long long int
#define m 1000000007
ull powerArray[100001];

int main()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   int k,x;
   cin>>k>>x;
   int n1 = x-k+1;
   int n2 = x+k-1;
   for(int i=n1 ; i<=n2 ; i++)
      cout<<i<<" ";
   return 0;
}

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

#define ll long long
#define inf 0x3f3f3f3f
const int maxn=1e5+5;
#define mod 1000000007
/*int head[maxn],ver[maxn],nxt[maxn],tot,edge[maxn];
bool vis[maxn];
int d[maxn],ans;
void add(int x,int y)
{
    ver[++tot]=y;
    edge[tot]=1;
    nxt[tot]=head[x];
    head[x]=tot;
}
void dp(int x)
{
    vis[x]=1;
    for(int i=head[x];i;i=nxt[i])
    {
        int y=ver[i];
        if(vis[y])continue;
        dp(y);
        ans=max(ans,d[x]+d[y]+edge[i]);
        d[x]=max(d[x],d[y]+edge[i]);
    }
}*/
bool check(int x)
{
    for(int i=2;i<=sqrt(x);i++)
    {
        if(x%i==0) return false;
    }
    return true;
}
int main()
{
   int x;
   cin>>x;
   while(1)
   {
      if(check(x))
      {
          cout<<x<<endl;
          return 0;
      }
      else x++;
   }
  return 0;
}


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

#define int long long

using namespace std;

const int maxn = 3010, mod = 1e9 + 7;
int dp[maxn][maxn], n;
string s;

signed main()
{
    ios::sync_with_stdio(false);
    cin >> n >> s;

    dp[1][1] = 1;
    for (int i = 2; i <= n; i++)
    {
        for (int j = 1; j <= n; j++)
            (dp[i - 1][j] += dp[i - 1][j - 1]) %= mod;
        for (int j = 1; j <= i; j++)
            dp[i][j] = (s[i - 2] == '<' ? dp[i - 1][j - 1]
                                        : dp[i - 1][n] - dp[i - 1][j - 1] + mod) %
                       mod;
    }

    int ans = 0;
    for (int i = 1; i <= n; i++)
        (ans += dp[n][i]) %= mod;

    cout << ans;

    return 0;
}

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

#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;
int a[]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
void solve(){
    int k;
    cin>>k;
    cout<<a[k-1]<<endl;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

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

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()

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

  int r;
  cin>>r;
  cout<<3*r*r<<endl;
  return 0;
}


Measured memory_bytes: 256
# 1-indexed　Binary Indexed Tree
class BIT:
    def __init__(self, n, init_list):
        self.num = n+1
        self.tree = [0]*self.num
        for i,e in enumerate(init_list):
            self.update(i,e)

    def update(self,k,x):
        k = k+1
        while k < self.num:
            self.tree[k] += x
            k += (k&(-k))
        return 
    
    # sum([l,r))
    def query(self, l,r):
        ret = 0
        while r>0:
            ret += self.tree[r]
            r -= r&(-r)
        while l>0:
            ret -= self.tree[l]
            l -= l&(-l)
        
        return ret


N = int(input())
A = list(map(int,input().split()))
#%%
idxlist = [0]*N
for i,a in enumerate(A):
    idxlist[a-1] = i+2

A = [N+1]*2 + A + [N+1]*2
#%%
ans = 0
seg = BIT(N+4,[1]*2+[0]*N+[1]*2)

def judge(l,r,key):
    if l>r:
        l,r = r,l
    res = seg.query(l,r+1)
    if res>key:
        return False
    else:
        return True

def bsearch(idx,ng,key):
    ok = idx
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if judge(idx,mid,key):
            ok = mid
        else:
            ng = mid
    return ng


for idx in reversed(idxlist):
    if A[idx]==N:
        seg.update(idx,1)
        continue
    ng_l = 0
    ng_r = N+3
    
    L1 = bsearch(idx,ng_l,0)
    L2 = bsearch(idx,ng_l,1)
    R1 = bsearch(idx,ng_r,0)
    R2 = bsearch(idx,ng_r,1)
    
    coef = 0
    if A[L1]!=N+1:
        coef += (L1-L2)*(R1-idx)
    if A[R1]!=N+1:
        coef += (R2-R1)*(idx-L1)
    ans += A[idx]*coef
    seg.update(idx,1)
    
print(ans)






Measured memory_bytes: 59784
using System;
using System.Linq;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            var A = Console.ReadLine().Split().Select(s=>int.Parse(s)).ToArray();
            var min = int.MaxValue;
            foreach(var item in A)
            {
                var count = 0;
                var tmp = item;
                while(tmp % 2==0)
                {
                    tmp /= 2; 
                    count++;
                }
                if (count < min) min = count;
            }
            Console.WriteLine(min);
        }
    }
}


Measured memory_bytes: 13268
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int maxn = 100010;
int n,x;
int a[maxn],cnt;
int main()
{
	scanf("%d%d",&n,&x);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	sort(a+1,a+1+n);
	for(int i=1;i<n;i++)
	{
		if(x<a[i]) break;
		if(x>=a[i]) x-=a[i],cnt++;
	}
	if(x==a[n]) cnt++;
	printf("%d",cnt);
	return 0;
}

Measured memory_bytes: 384
#!usr/bin/env python3
from collections import defaultdict,deque
import sys
import math
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
mod = 1000000007

def solve():
    n = I()
    v = [[] for i in range(n)]
    for i in range(n-1):
        a,b = LI()
        a -= 1
        b -= 1
        v[a].append(b)
        v[b].append(a)
    q = deque([0])
    d = [0]*n
    d[0] = 1
    pre = [None]*n
    while q:
        x = q.popleft()
        nd = d[x]+1
        for y in v[x]:
            if not d[y]:
                d[y] = nd
                pre[y] = x
                q.append(y)
    V = list(range(1,n))
    V.sort(key = lambda x:-d[x])
    size = [1]*n
    for i in V:
        size[pre[i]] += size[i]
    inv = pow(2,mod-2,mod)
    ans = (1-pow(inv,n,mod)-n*inv)%mod
    p = [pow(inv,i,mod) for i in range(n)]
    for i in range(1,n):
        a = size[i]
        b = n-a
        ans += (p[a]-1)*(p[b]-1)%mod
        ans %= mod
    print(ans)
    return

#Solve
if __name__ == "__main__":
    solve()


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

int main(){
  
  int N;
  cin >> N;
  int a[N];
  int count = 0;
  for ( int i = 0; i<N ; i++ ) cin >> a[i];
  
  bool is_break = false;
  while(true){
  	for(int i=0; i<N; i++){
      if(a[i] % 2 == 1) {
        is_break = true;
        break;
      }
      a[i] = a[i]/2;
    }
 	if(is_break) break;   
    count++;
  }
  
  cout << count << endl;
  return 0;
}
 

Measured memory_bytes: 256
N = int(input())
ans = 1000000
for i in range(1, N):
    total = 0
    A = str(i)
    for a in A:
        total += int(a)
    B = str(N-i)
    for b in B:
        total += int(b)
    if total < ans:
        ans = total

print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repp(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;

signed main(){
    int n, m;
    cin >> n >> m;
    vector<int> t(m);
    rep(i, 0, m){
        cin >> t[i];
        t[i]--;
    }
    vector<int> a(n - 1), b(n - 1), c(n - 1), d(n - 1, 0);
    rep(i, 0, n - 1) cin >> a[i] >> b[i] >> c[i];
    rep(i, 0, m - 1){
        if(t[i] < t[i + 1]){
            rep(j, t[i], t[i + 1]) d[j]++;
        }else{
            repb(j, t[i] - 1, t[i + 1]) d[j]++;
        }
    }
    int ans = 0;
    rep(i, 0, n - 1){
        // cout << d[i] << endl;
        ans += min(d[i]*a[i], b[i]*d[i] + c[i]);
    }
    cout << ans << endl;
}

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

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	long long m1 = 0, m2 = 0;
	map<int,int> m;
	for(int i = 0; i < n; ++i){
		int x;
		cin >> x;
		++m[x];
		if(m[x] == 2) {
			if(x > m1) {
				m2 = m1;
				m1 = x;
				m[x] -= 2;
			}
			else if(x > m2) {
				m2 = x;
				m[x] -= 2;
			}
		}
	}
	cout << m1*m2 << endl;

}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define fr(i,a,n) for(i=a;i<n;i++)
#define frn(i,a,n) for(i=a;i<=n;i++)
#define vll vector<ll>
#define pll pair<ll,ll>
#define vp vector<pll>
#define ub upper_bound
#define lb lower_bound
//#define map map<ll,ll>
#define mem(x,y) memset(x,y,sizeof(x))
#define all(v) v.begin(),v.end()
#define bs binary_search
#define qll queue<ll>
#define sll set<ll>
#define ma 500000
ll power(ll x,ll n)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return power(x*x,n/2);
    else                             //n is odd
        return x*power(x*x,(n-1)/2);
}
int highestPowerof2(int n)
{
   int p = (int)log2(n);
   return (int)pow(2, p);  
}
ll powermod(ll x, ll y, ll p)  
{  
    ll res = 1;
    x = x % p;
    if (x == 0) return 0;  
  
    while (y > 0)  
    {  
        if (y & 1)  
            res = (res*x) % p;  
        y = y>>1; 
        x = (x*x) % p;  
    }  
    return res;  
}
 
int main()
{
    ll x;
  cin>>x;
    if(x==0)
    cout<<1<<endl;
    else
    cout<<0<<endl;
        
}


Measured memory_bytes: 3672
MOD = 10 ** 9 + 7
INF = 10 ** 10
import sys
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)
from collections import deque

def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]

    if a[0] != 0:
        print(-1)
        return
    
    ans = a[-1]
    down = a[-1]
    stair = a[-1]
    for i in range(n - 2,-1,-1):
        down -= 1
        stair -= 1
        if down > a[i]:
            print(-1)
            return
        if stair == a[i]:
            continue
        down = max(down,a[i])
        stair = a[i]
        ans += stair
    
    print(ans)

if __name__ =='__main__':
    main()  


Measured memory_bytes: 11396
N, K = map(int, input().split())
if K % 2 != 0:
    tmp = (N//K)
    if tmp == 0:
        ans = 0
    else:
        ans = tmp ** 3
else:
    K = K//2
    tmp = (N//K)
    if tmp == 0:
        ans = 0
    else:
        tmp1 = tmp//2
        tmp2 = tmp - tmp1
        ans = tmp2**3 + tmp1**3

print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  long int n,i,ni=2,mni=1,a[10000];
  cin >> n;
  for(i=0;;i++){
    if(n%ni==0){
      a[i]=0;
    }else{
      a[i]=1;
      n-=mni;
    }
    if(n==0){
      break;
    }
    ni*=2;
    mni*=-2;
  }
  for(;i>=0;i--){
    cout << a[i];
  }
}
      

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

using namespace std;

bool solve() {
	int n;
	cin >> n;

	int odd = 0;
	int even = 0;
	for (int i = 0; i < n; i++) {
		int a;
		scanf("%d", &a);

		if (a % 2 == 0) {
			even++;
		} else {
			odd++;
		}
	}
	return odd % 2 == 0;
}

int main() {
	puts(solve() ? "YES" : "NO");
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repR(i, n) for(int i = (n) - 1; i > -1; i--)
#define rep1(i, n) for(int i = 1; i < (int)(n + 1); i++)
#define rep1R(i, n) for(int i = (n); i > 0; i--)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

int find_same(string s, string t) {
  int ans = 0;
  for (char c = 'a'; c <= 'z'; c++) {
    auto founds = s.find(c);
    auto foundt = t.find(c);
    if (founds != string::npos && foundt != string::npos) ans++;
  }
  return ans;
}

int main() {
  int N; cin >> N;
  string S; cin >> S;
  int ans = 0;
  rep1(i, N - 1) {
    ans = max(ans, find_same(S.substr(0, i), S.substr(i)));
  }
  cout << ans << endl;
  return 0;
}


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

int main(){
  int n;
  cin >> n;
  int a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  sort(a,a+n);
  int t=0;
  for(int i=0;i<n-1;i++){
    t=t+a[i];
  }
  if(t>a[n-1]){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <array>
#include <algorithm>
#include <map>
#include <vector>
#include <list>
#include <cmath>
#include <stack>
#include <queue>
#include <climits>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using namespace std;

const int mod = 1000000007;
struct mint {
	ll x; // typedef long long ll;
	mint(ll x = 0) :x((x% mod + mod) % mod) {}
	mint operator-() const { return mint(-x); }
	mint& operator+=(const mint a) {
		if ((x += a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator-=(const mint a) {
		if ((x += mod - a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator*=(const mint a) {
		(x *= a.x) %= mod;
		return *this;
	}
	mint operator+(const mint a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint a) const {
		mint res(*this);
		return res *= a;
	}
	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime mod
	mint inv() const {
		return pow(mod - 2);
	}
	mint& operator/=(const mint a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint a) const {
		mint res(*this);
		return res /= a;
	}
};

struct combination {
	vector<mint> fact, ifact;
	combination(int n) :fact(n + 1), ifact(n + 1) {
		fact[0] = 1;
		for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
		ifact[n] = fact[n].inv();
		for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
	}
	mint operator()(int n, int k) {
		if (k < 0 || k > n) return 0;
		return fact[n] * ifact[k] * ifact[n - k];
	}
} comb(2000005);

mint g(int r, int c) {
	return comb(r + c + 2, r + 1) - 1;
}

bool comp(int i, int j) {
	return i > j;
}

int main()
{
	int n;
	cin >> n;
	string ch;
	priority_queue<string, vector<string>, std::greater<string>>  str;
	for (int i = 0; i < n; i++)
	{
		cin >> ch;
		sort(ch.begin(), ch.end());
		str.push(ch);
	}

	long long count = 0;
	string before = "";
	int check = 0;
	for (int i = 0; i < n; i++)
	{
		string c = str.top();
		str.pop();
		if (c == before)
		{
			check++;
		}
		else
		{
			count += (long long)check * ((long long)check - 1) / 2;
			check = 1;
			before = c;
		}
	}
	count += (long long)check * ((long long)check - 1) / 2;
	cout << count;
}


Measured memory_bytes: 36980
import sys
def input():
    return sys.stdin.readline()[:-1]

H,W = map(int,input().split(' '))
l = [list(input()) for _ in range(H)]

white_row = [True]*H
white_col_dp = []
for i in range(H):
    for j in range(W):
        elm = l[i][j]
        if elm=='#':
            white_row[i] = False
            white_col_dp.append(j)
ANS = []
white_col_dp = set(white_col_dp)
for i in range(H):
    if not white_row[i]:
        tmp = []
        for j in range(W):
            if j in white_col_dp:
                tmp.append(l[i][j])
        ANS.append(''.join(tmp))

for i in ANS:
    print(i)

Measured memory_bytes: 3188
#memo
"""
繰り返しやった時に絶対値が最小になればよい。
毎回0に近づく動きをさせよう。
"""

list_in = list(map(int,input().split()))
xin = list_in[0]
kin = list_in[1]
din = list_in[2]

now_place = abs(xin)
rem = kin

cnt = min(now_place//din, kin)
now_place -= din * cnt
rem -= cnt

if rem %2 == 1:
    now_place = now_place - din

ans = abs(now_place)

print(ans)


Measured memory_bytes: 61456
#include<iostream>
using namespace std;
int main (void)
{
  long long int n,k;
  cin>>k;
  n=0;
  for(int i=1;i<1000000;i++)
  {
    n=10*n+7;
    n=n%k;
    if(n==0){cout<<i<<endl;return 0;}

  }
  cout<<"-1"<<endl;
}

Measured memory_bytes: 3596
#include <iostream>
int main()
{
    int H, W;

    while (true){

        std::cin >> H >> W;

        if (H == 0 && W == 0){
            break;
        }

        for (int y = 0; y < H; y++){
            for (int x = 0; x < W; x++){

                if (x == 0 || x == W - 1 || y == 0 || y == H - 1){
                    std::cout << '#';

                    if (x == W - 1){
                        std::endl(std::cout);
                    }

                } else {
                    std::cout << '.';
                }
            }
        }
        std::endl(std::cout);
    }
    return 0;
}

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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int H, W, ans[1005][1005];
int d[5] = {-2, -1, 0, 1, 2};
int di[4] = {0,1,0,-1}, dj[4] = {1,0,-1,0};
int Ch, Cw, Dh, Dw;
char S[1005][1005];

int main(){
  cin >> H >> W;
  cin >> Ch >> Cw >> Dh >> Dw;
  for (int i = 1; i <= H; i++){
    for (int j = 1; j <= W; j++){
      cin >> S[i][j];
    }
  }

  fill((int*)ans, (int*)(ans + H + 1), -1);

  priority_queue <pair<int, Pii>, vector<pair<int, Pii>>, greater<pair<int, Pii>>> que;
  que.push({0, {Ch, Cw}});

  while (!que.empty()){
    pair<int, Pii> Q = que.top(); que.pop();
    if (ans[Q.se.fi][Q.se.se] != -1) continue;
    ans[Q.se.fi][Q.se.se] = Q.fi;

    for (int k = 0; k < 4; k++){
      int I = Q.se.fi + di[k], J = Q.se.se + dj[k];

      if (S[I][J] != '.') continue;
      if (ans[I][J] != -1) continue;
      que.push({Q.fi, {I, J}});
    }

    for (int i = 0; i < 5; i++){
      for (int j = 0; j < 5; j++){
        int I = Q.se.fi + d[i], J = Q.se.se + d[j];
        if (1 <= I && I <= H && 1 <= J && J <= W){
          if (ans[I][J] == -1 && S[I][J] == '.'){
            que.push({Q.fi + 1, {I, J}});
          }
        }
      }
    }
  }

  cout << ans[Dh][Dw] << endl;

  return 0;
}


Measured memory_bytes: 9728
#include<bits/stdc++.h>
typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
	
using namespace std;
int N,M,K;
int main(){
	bool flg=false;
	cin>>N>>M>>K;
	REP(n,N+1){
		REP(m,M+1){
			if(n*(M-m)+(N-n)*m==K){
				flg=true;
			}
		}
	}
	cout<<(flg ? "Yes" : "No")<<endl;
}

Measured memory_bytes: 256