akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define endl '\n'
#define pb push_back
#define fi first
#define se second
#define all(c) (c).begin(),(c).end()
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;

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

#define TRACE
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

const ll inf = 2e18;
const int mod = 1e9 + 7;
const int N = 2e5 + 10;

int modpow(int x, int n, int m) {
	x %= m;
	int res = 1;
	while(n > 0) {
		if(n & 1)
			res = res * x % m;
		x = x * x % m;
		n >>= 1;
	}
	return res;
}

int fact[N], invfact[N];

void pre() {
	fact[0] = 1;
	for(int i = 1; i < N; i++) {
		fact[i] = fact[i - 1] * i % mod;
	}
	invfact[N - 1] = modpow(fact[N - 1], mod - 2, mod);
	for(int i = N - 2; i >= 0; i--) {
		invfact[i] = invfact[i + 1] * (i + 1) % mod;
	}
}

int ncr(int x, int y) {
	if(y < 0 || y > x)
		return 0;
	int res = fact[x] * invfact[y] % mod * invfact[x - y] % mod;
	return res;
}

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

	pre();
	int n, k;
	cin >> n >> k;
	int ans = 0;
	for(int i = 0; i <= min(n - 1, k); i++) {
		ans = (ans + ncr(n, i) * ncr(n - 1, n - i - 1) % mod) % mod;
	}
	cout << ans;
	
	return 0;
}

Measured memory_bytes: 3328
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int a,b,c,d,i,j,k,cnt=0;
	cin>>a>>b>>c>>d;
	for(i=0;i<=a;i++){
		for(j=0;j<=b;j++){
			for(k=0;k<=c;k++){
				if(500*i+100*j+50*k == d){
					cnt++;
				}
			}
		}
	}
	cout<<cnt;
	return 0;	
} 

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

#include <bitset>
#include <cassert>
#include <queue>
#include <random>
#include <stack>
#include <iomanip>

using namespace std;

#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define repf(i, a, b) for (ll i = (ll)a; i < (ll)b; i++)
#define repr(i, a, b) for (ll i = (ll)a; i > (ll)b; i--)

#define repv(x, arr) for (auto &x : arr)
#define all(v) (v).begin(), (v).end()
#define vec(name, num) vector<ll> name((num), 0);
#define mp(a, b) make_pair(a, b)
#define op(i) cout << (i) << endl;
#define F first
#define S second

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;

const ll mod = 1e9 + 7;
const ll infl = 1e17;

typedef unsigned long long ull;


int main(){
    ll n,m;
    cin>>n>>m;
    vll s(n);
    vll t(m);
    rep(i, n) cin >> s[i];
    rep(i, m) cin >> t[i];
    vvll dp(n + 1, vll(m + 1, 0));
    dp[0][0] = 1;
    rep(j, m) dp[0][j+1] = 1;
    rep(i,n){
        dp[i+1][0] = 1;
        rep(j,m){
            if (s[i]==t[j]){
                dp[i + 1][j + 1] = (dp[i][j + 1] + dp[i + 1][j]) % mod;
            }
            else
            {
                dp[i + 1][j + 1] = (mod + dp[i][j + 1] + dp[i + 1][j] - dp[i][j]) % mod;
            }
        }
    }
    cout << dp[n][m] << endl;
}

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

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

Measured memory_bytes: 1208
/**So..a**/
#include<bits/stdc++.h>

using namespace std;
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#define PB(x, v) x.push_back(v);
#define M_P(a, b) make_pair(a, b)
#define pll pair<ll, ll>
#define ll long long
#define mll map<ll, ll>
#define vl vector<ll>
#define fa(x, v) for(auto x: v)
#define fr(i, a, b) for(int i= a;i <=b; i++)
#define TEST  ll Test; cin >> Test; while(Test--)

#define B_ begin()
#define E_ end()
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define NL_ "\n"
#define F first
#define S second
#define FF first.first
#define FS first.second
#define SF second.first
#define SS second.second

#define mod(a) a%1000000007
#define MAX 2000000000
#define  ull unsigned long long
 string s, t;

 ll atleast(ll& i)
 {
     if(s.length()-i <t.length())  return LLONG_MAX;
     ll len = 0;
     for(ll j = 0; j<t.length(); j++)
     {
           if(s[i+j]==t[j]) continue;
           len++;
     }
     return len;
 }



int main()
{

    FAST;
    ll n;
    cin >> n;
   ll arr[n+1];
    arr[0];
    ll r;
    fr(i ,1, n)
    {
        cin >> r;
        arr[i] = arr[i-1] + r;
    }
    const ll mod = 1000000000+7 ;
    ll ans = 0;
    fr(i, 1, n-1)
    {
        r = arr[i] - arr[i-1];
        ll temp  = arr[n] - arr[i];
        temp%=mod;
        r*=temp;
        r%=mod;
        ans+=r;
        ans%=mod;
    }
    cout << ans%mod;

    return 0;
}


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

int main(){
  int n;
  cin>>n;
  vector<double> p(n);
  rep(i,n) cin>>p[i];
  
  vector<vector<double>> dp(n,vector<double>(n+1));
  dp[0][0] = 1 - p[0];
  dp[0][1] = p[0];
  rep(i,n-1){
    dp[i+1][0] = dp[i][0]*(1-p[i+1]);
  }
  rep(i,n-1){
    for(int j = 1;j < n+1;j++){
      dp[i+1][j] = p[i+1]*dp[i][j-1] + (1-p[i+1])*dp[i][j];
    }
  }
  double ans = 0;
  for(int i = (n+1)/2;i <= n;i++){
    ans += dp[n-1][i];
  }

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

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

int main() {
  double n,k,m,cnt;
  cin>>n>>k;
  double ans;

  for (int i=1; i<=n; i++) {
    m=i; cnt=0;
    if (i>=k) {
      ans+=1/n;
      continue;
    }
    while (m*2<k) {
      m*=2;
      cnt++;
    }
    cnt++;
    ans+=1/(n*pow(2,cnt));
  }
  
  printf("%.12lf\n",ans);
  return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main(){
	int n;
	cin >> n;
	int a;
	map<int, int> mp;
	REP(i,n){
		cin >> a;
		mp[a]++;
	}
	int ans = 0;
	for(auto i : mp){
		if(i.second	% 2 == 1) ans++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 4992
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Math;
using static System.Array;
using static AtCoder.Tool;
namespace AtCoder
{
    class AC
    {
        const int MOD = 1000000007;
        const int INF = int.MaxValue / 2;
        const long SINF = long.MaxValue / 2;
        const double EPS = 1e-8;
        static readonly int[] dx = { 0, 1, 0, -1 };
        static readonly int[] dy = { 1, 0, -1, 0 };
       

        static void Main(string[] args)
        {
            //var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            //Console.SetOut(sw);
            var cin = new Scanner();

            int N = int.Parse(Console.ReadLine());
            var L = cin.SplitReadL();
            Sort(L);
           

            long ans = 0;

            for(var i = 0; i < N - 2; i++)
            {
                for (var j = i + 1; j < N - 1; j++)
                {
                    long sum = L[i] + L[j];

                    int l = -1;
                    int r = L.Length;
                    while (r - l > 1)
                    {
                        int c = (l + r) / 2;
                        if (L[c] >= sum)
                        {
                            r = c;
                        }
                        else
                        {
                            l = c;
                        }
                    }

                    ans += Max(0, l - j);
                }
            }

            Console.WriteLine(ans);


            //Console.Out.Flush();
        }
        


    }

    

    

    public class Scanner
    {
        public int[] SplitRead()
        {
            int[] array = Console.ReadLine().Split().Select(int.Parse).ToArray();
            return array;
        }
        public long[] SplitReadL()
        {
            long[] array = Console.ReadLine().Split().Select(long.Parse).ToArray();
            return array;
        }
    }

    public static class Tool
    {
        static public void Initialize<T>(ref T[] array, T initialvalue)
        {
            for (var i = 0; i < array.Length; i++)
            {
                array[i] = initialvalue;
            }
        }
    }
}


Measured memory_bytes: 13524
#include <cstdio>

int main(void){
	for(;;){
		int r,c;
		scanf("%d%d",&r,&c);
		if(r==0)break;
		int dat[10][10000];
		for(int i=0;i<r;i++){
			for(int j=0;j<c;j++){
				scanf("%d",&(dat[i][j]));
			}
		}
		
		int ans=0;
		
		for(int i=0;i<(1<<r);i++){
			int q=0;
			for(int j=0;j<c;j++){
				int p=0;
				for(int k=0;k<r;k++){
					if((dat[k][j]==0)==((i&(1<<k))==0)){
						p++;
					}
				}
				q+=(p>r-p)?p:r-p;
			}
			ans=(ans<q)?q:ans;
		}
		printf("%d\n",ans);
	}
	return 0;
}
		

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

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

using namespace std;

int main(void){
  vector<string> day = {"SUN","MON","TUE","WED","THU","FRI","SAT"};
  string s;
  cin >> s;
  rep(i, 7){
    if(day[i] == s){
      cout << 7 - i << endl;
    }
  }
  return 0;
}


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

using namespace std;

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

	if(a[1]==1&&a[4]==1&&a[7]==1&&a[9]==1){
		cout<<"YES";
	}else{
		cout<<"NO";
	}
} 

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define PI 3.1415926535
typedef long long ll;
typedef pair<int, int> Pi;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<Pll> vPll;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;
typedef vector<vector<ll>> vvll;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<double>> vvd;
typedef vector<vector<Pi>> vvPi;
typedef priority_queue<int, vector<int>, greater<int>> pqli;
typedef priority_queue<ll, vector<ll>, greater<ll>> pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi>> pqlP;
string YN(bool y) { return (y?"YES":"NO"); }
string yn(bool y) { return (y?"Yes":"No"); }
string ON(bool y) { return (y?"OK":"NG"); }
void swap(long long *x, long long *y)
{
	long long temp=*x;
	*x=*y;
	*y=*x;
}
int main(void)
{
	ll h, w;

	cin>>h>>w;

	if(h%3==0||w%3==0){
		cout<<0<<endl;
	}else{
		ll ans=min(h, w);
		
		repr(i, 1, h){
			ll s[3], maxs=-1, mins=1e12;
			s[0]=i*w;
			s[1]=(h-i)*(w/2);
			s[2]=(h-i)*(w-w/2);
			rep(j, 3){
				if(mins>s[j]) mins=s[j];
				if(maxs<s[j]) maxs=s[j];
			}
			ans=min(ans, maxs-mins);
		}

		repr(i, 1, w){
			ll s[3], maxs=-1, mins=1e12;
			s[0]=i*h;
			s[1]=(w-i)*(h/2);
			s[2]=(w-i)*(h-h/2);
			rep(j, 3){
				if(mins>s[j]) mins=s[j];
				if(maxs<s[j]) maxs=s[j];
			}
			ans=min(ans, maxs-mins);
		}
		cout<<ans<<endl;
	}
}

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

int main()
{
  int A,B,c,d,e;
  cin>>A>>B;
	c=max(A,B);
 	d=min(A,B);
  	e=max(c-1,d);
  
  
  cout<<c+e<<endl;
  
}
  
  

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=ll(1e18)+ll(7);
const ll MOD=1000000007LL;
#define out(a) cout<<fixed<<setprecision((a))


int main(){
	int N;
	cin >> N;
	vector<P> A[N];
	FOR(i,0,N){
		int a;
		cin >> a;
		FOR(j,0,a){
			int x,y;
			cin >> x >> y;
			x--;
			A[i].push_back({x,y});
		}
	}

	int ans = 0;
	FOR(i,0,(1LL<<N)){
		set<int> S;
		FOR(j,0,N){
			if(i&(1LL<<j))S.insert(j);
		}
		bool ok = true;
		for(auto s:S){
			for(P a:A[s]){
				int x = a.first;
				int y = a.second;
				if((S.count(x) && y==0)||(y==1 && not S.count(x))){
					ok = false;
				}
			}
		}
		if(ok){
			int aaa = S.size();
			ans = max(ans,aaa);
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define GET_ARRAY_SIZE(a)   (sizeof(a)/sizeof(a[0]))
#define LL long long
#define VI vector<int>
#define VL vector<LL>
#define VII vector< vector<int> >
#define VLL vector< vector<LL> >
#define VS  vector<string>
#define VSS vector< vector<string> >
#define PII pair<int,int>
#define PIS pair<int,string>
#define PSI pair<string,int>
#define PLL pair<LL,LL>
const LL MOD = 1000000007;
const LL INF = 1e16;
LL facctorialMethod(int k);
int main(){
    LL l,r,d,count = 0;
    cin >> l >> r >> d;
    for(int i = l; i <= r; i++) {
        if(i%d == 0) {
            count++;
        }
    }
    cout << count << endl;

    return 0;
}

LL facctorialMethod(int k){
    int sum = 1;
    for (int i = 1; i <= k; ++i){
        sum *= i;
    }
    return sum;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  if(N%10==3){
    cout<<"bon"<<endl;
  }else if((N%10==0)||(N%10==1)||(N%10==6)||(N%10==8)){
    cout<<"pon"<<endl;
  }else{
    cout<<"hon"<<endl;
  }
}           

Measured memory_bytes: 3636
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>

using namespace std;
typedef long long ll;

int main(){
  int a,b,c,d;cin>>a>>b>>c>>d;
  int x;
  x=a+b;
  cout<<min(a, b)+min(c, d)<<endl;
}


Measured memory_bytes: 256
N, M = list(map(int, input().split()))
L = []
R = []
for _ in range(M):
    l, r = list(map(int, input().split()))
    L += [l]
    R += [r]
if min(R) - max(L) >= 0:
    print(min(R) - max(L) + 1)
else:
    print(0)

Measured memory_bytes: 11064
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long
#define ld long double

#define mod 1000000007
#define EULER 2.7182818284
#define INF 1000000000

#define pb push_back
#define ins insert
#define IT iterator
#define PQ priority_queue
#define    nl           "\n"
#define fi first
#define se second
#define maxe max_element
#define mine min_element
#define er erase
#define lb lower_bound
#define ub upper_bound

#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define pi pair<int,int>
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define mpi map<int,int>
#define mpl map<ll,ll>
#define umpi unordered_map<int,int>
#define umpl unordered_map<ll,ll>
#define si set<int>
#define sl set<ll>
#define msi multi_set<int>
#define msl multi_set<ll>

#define mem(v,i) memset(v,i,sizeof(v)) // v is array. To set all elements to 0 or -1 only. mem(arr,0);


#define repab(i,a,b) for(int i=(a);i<=(b);i++)
#define reprab(i,a,b) for(int i=(a);i>=(b);i--)
#define repll(i,a,b) for(ll i=(a);i<=(b);i++)
#define rep(i,n) for(int i=(0);i<(n);i++)
#define repr(i,n) for(int i=(n);i>=0;i--)
#define bs bitset
#define bpc(a) __builtin_popcount(a)
#define tc int t;cin>>t;while(t--)
template<typename T> void TIME(T start, T end)
{
#ifndef ONLINE_JUDGE
    double time_taken =  chrono::duration_cast<chrono::nanoseconds>(end - start).count();
    time_taken *= 1e-9;
    cout << "\nExecuted in: " << fixed
         << time_taken << setprecision(9);
    cout << " sec";
#endif
}

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

ll max(ll a,ll b)
{
    if(a>b)return a;return b;
}
ll min(ll a,ll b)
{
    if(a<b)return a;return b;
}

ll mypow(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
ll gcd(ll a,ll b)
{
    if(b==0)
    return a;
    return gcd(b,a%b);
}
//..............................!!!!!!Get ready to fight!!!!!!............................


int main()
{   
     auto start = chrono::high_resolution_clock::now();
    fast
    ll a,b,n,ans;
    cin>>a>>b>>n;
    if(b==n){
         ans=floor(a*(n-1)/b)-a*floor((n-1)/b);
    }
    else if(b>n){
        ans=floor(a*(n)/b)-a*floor((n)/b);
    }
    else {
        ans=floor(a*(b-1)/b)-a*floor((b-1)/b);
    }
    cout<<ans;
    auto end = chrono::high_resolution_clock::now();
    TIME(start, end);
    return 0;
}

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

int main(){
int a,b;
  cin>>a>>b;
  
  int h;
  if(b==100){h=a*1000+b;}
  else if(10<=b && b<=99){h=a*100+b;}
  else{h=a*10+b;}
  
  for(int i=1; i<=320;i++){
   if(i*i==h){cout<<"Yes"; return 0;}
  }
  
  cout<<"No"; return 0;
}


Measured memory_bytes: 384
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MOD2 998244353
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")
#define PN printf("\n")

void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a=c;}
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;}
ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll mod(ll n){return n%=MOD1;}
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}

typedef struct{ ll a , b;}fr;
int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;}
int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;}
void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);}
void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);}

int main(void){
    // char ;
    ll n;
    scanf("%lld",&n);
    // ll [n];
    rep(i,0,3){
        if(n%10==7){
            YES;
            return 0;
        }
        n/=10;
    }

    NO;
    // printf("%lld\n");
    return 0;
}


Measured memory_bytes: 1660
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl "\n"
#define ll long long
#define int ll
#define BUF 1e5
#define INF 1 << 30
#define vi vector<int>
#define vvi vector<vector<int>>
#define all(a) (a).begin(), (a).end()
#define bit(n) (1LL << (n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
constexpr ll mod = 1e9 + 7;
ll A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

struct edge {
    int from, to, cost;
};

edge es[5001];
int d[2501];
int V, E;

bool shortest_path(int s) {
    for (int i = 0; i < V; i++) {
        d[i] = INF;
    }
    d[s] = 0;
    for (int i = 0; i < 2 * V; i++) {
        for (int j = 0; j < E; j++) {
            edge e = es[j];
            if (d[e.from] != INF && d[e.to] > d[e.from] + e.cost) {
                d[e.to] = d[e.from] + e.cost;
                if (i >= V && e.to == V - 1) {
                    return false;
                }
            }
        }
    }
    return true;
}

signed main() {
    cin >> V >> E >> P;
    for (int i = 0; i < E; i++) {
        cin >> es[i].from >> es[i].to >> es[i].cost;
        es[i].from--, es[i].to--;
        es[i].cost -= P;
        es[i].cost *= -1;
    }
    vector<int> v;
    if (shortest_path(0)) {
        cout << max(-d[V - 1], 0LL) << endl;
    } else {
        cout << -1 << endl;
    }
}

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

struct Benri {
    Benri() {
        std::cin.tie(0); ios::sync_with_stdio(false);
        cout << fixed << setprecision(12);
    }
} benri;
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; }

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vll = vector<long long>;
using pll = pair<ll, ll>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define MOD 1000000007
#define MOD2 998244353




int main() {
    string s; cin >> s;
    int n = s.size();
    int ans = 1000;
    vi S(n);
    rep(i, n) {
        S[i] = s[i] - '0';
    }
    rep(i, n - 2) {
        chmin(ans, abs((S[i] * 100 + S[i + 1] * 10 + S[i + 2]) - 753));
    }
    cout << ans << endl;

}




Measured memory_bytes: 256
from math import *
from bisect import bisect_left

def cin(): # To take limited number of inputs
    return map(int,input().split())

def cins(): # To take space sepreated strings
    return input.split()

def cino(test=False): # To take individual int input (test = False)
    if not test:
        return int(input())
    else: # To take string input (test = True)
        return input()

def cina(): # array input
  return list(map(int,input().split()))

def ssplit(): # multiple string input
    return list(input().split())

def printlist(l): # To print space seperated array
    for i in l:
        print(i,end=" ")

def bs(arr, l, r, x): 
    while l <= r: 
        mid = l + (r - l) // 2; 
        if arr[mid] == x: 
            return mid 
        elif arr[mid] < x: 
            l = mid + 1
        else: 
            r = mid - 1
    return -1


def main():
    a,b = cin()
    if b==0:
        c = cino(True)
        print(a)
    else:
        arr = cina()
        arr.sort()
        init = 1
        if bs(arr,0,b-1,a)==-1:
            print(a)
        else:
            o,t = bs(arr,0,b-1,a-init),bs(arr,0,b-1,a+init)
            while o>=0 and t>=0:
                init+=1
                o,t = bs(arr,0,b-1,a-init),bs(arr,0,b-1,a+init)
            if o==-1:
                print(a-init)
            else:
                print(a+init)




if __name__ == '__main__':
    main()


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

#define ll long long

const int N=3005;
ll dp[N][N];

int main(){
	int n;
	cin>>n;
	vector<int> a(n);
	for(int& x:a){
		scanf("%d",&x);
	}
	
	for(int L=n-1;L>=0;--L){
		for(int R=L;R<n;++R){
				if(L==R){
					dp[L][R] = a[L];
				}else{
					dp[L][R] = max(a[L] - dp[L+1][R],a[R] - dp[L][R-1]);
				}
		}
	}
	printf("%lld\n", dp[0][n-1]);
    return 0;
}


Measured memory_bytes: 70016
def main():
    N = int(input())
    T = list(map(int, input().split()))
    V = list(map(int, input().split()))
    C = [0] * (N+1)
    for i in range(N-1):
        C[i+1] = min(V[i], V[i+1])
    for _ in range(N):
        for i in range(N):
            left = C[i]
            right = C[i+1]
            C[i] = min(C[i], right + T[i])
            C[i+1] = min(C[i+1], left + T[i])
    ans = 0
    for i in range(N):
        if (V[i] - C[i]) + (V[i] - C[i+1]) < T[i]:
            lx = V[i] - C[i]
            rx = V[i] - C[i+1]
            ans += (C[i] + V[i]) * lx / 2 + \
                (C[i+1] + V[i]) * rx / 2 + \
                V[i] * (T[i]-lx-rx)
        else:
            M = max(C[i], C[i+1])
            m = min(C[i], C[i+1])
            x = (T[i] - (M-m)) / 2
            ans += (M + M+x) * x / 2 + (m + M+x) * (x+(M-m)) / 2
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 38768
#include <algorithm>
#include <iostream>
#include <list>
#include <vector>
#include <iterator>
using namespace std;
int main(){
    long n;
    list<long> l;
    cin >> n;
    vector<long> vec{istream_iterator<long>(cin), istream_iterator<long>()};
    sort(vec.begin(),vec.end());
    vec.erase(std::unique(vec.begin(), vec.end()), vec.end());
    if( n == vec.size() ){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  
    return 0;
}


Measured memory_bytes: 2420
#include<bits/stdc++.h>
using namespace std;
int main()
{
    #ifdef TarekHasan
        freopen("input.txt","r",stdin);
    #endif // TarekHasan

    long long int n,k; cin >> n >> k;
    vector< int > v(n);
    vector< int > visited(n,0);
    vector< int > seq;

    for(int i=0;i<n;i++)
    {
        cin >> v[i];
        v[i]-=1;
    }

    map< int , int > index;

    int x = 0;
    seq.push_back(0);
    index[x]=0;

    while(true)
    {
        visited[x]=1;
        x=v[x];

        if(visited[x])
            break;
        else
        {
            seq.push_back(x);
            index[x]=seq.size()-1;
        }
    }


    if(k<index[x])
        cout << seq[k]+1 << endl;
    else
        cout << seq[index[x]+((k-index[x])%(seq.size()-index[x]))]+1 << endl;
    return 0;
}


Measured memory_bytes: 14600
import java.util.*;
public class Main {
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), ans = 1;
        for (int i = 3; i <= n; i++) {
            ans += getProductCount(i - 1);
        }
        System.out.println(ans);
	}
    static int getProductCount(int n) {
        int count = 2;
        int end = (int) Math.sqrt(n);
        for(int i = 2; i <= end; i++){
            if (n % i == 0) {
                if (i == end && end * end == n) {
                    count++;
                } else {
                    count+=2;
                }
            }
        }
        return count;
    }

}

Measured memory_bytes: 35712
#include<cstdio>
using namespace std;
#define N 105000
int n,head[N],cnt,is[N],f[N],g[N],dp[N][2],st,as=1e9,a,b;
char s[N];
struct edge{int t,next;}ed[N*2];
void adde(int f,int t){ed[++cnt]=(edge){t,head[f]};head[f]=cnt;ed[++cnt]=(edge){f,head[t]};head[t]=cnt;}
void dfs(int u,int fa){is[u]=s[u]=='W';for(int i=head[u];i;i=ed[i].next)if(ed[i].t!=fa)dfs(ed[i].t,u),is[u]|=is[ed[i].t];}
void dfs1(int u,int fa){int is1=(fa?0:1);for(int i=head[u];i;i=ed[i].next)if(ed[i].t!=fa&&is[ed[i].t])dfs1(ed[i].t,u),f[u]+=f[ed[i].t]+2,is1++;if((is1&1)^(s[u]=='B'))f[u]++;}
void dfs2(int u,int fa){for(int i=head[u];i;i=ed[i].next)if(ed[i].t!=fa&&is[ed[i].t])g[ed[i].t]=g[u]+f[u]-f[ed[i].t],dfs2(ed[i].t,u);}
void dfs3(int u,int fa)
{
	int su=0,m1=1e9,m2=1e9,m3=1e9,is1=fa?0:1;
	for(int i=head[u];i;i=ed[i].next)
	if(ed[i].t!=fa&&is[ed[i].t])
	{
		is1++;
		dfs3(ed[i].t,u);
		su+=f[ed[i].t]+2;
		if(m1>dp[ed[i].t][0]-f[ed[i].t]-1)m1=dp[ed[i].t][0]-f[ed[i].t]-1;
		if(m2>dp[ed[i].t][1]-f[ed[i].t]-1)m3=m2,m2=dp[ed[i].t][1]-f[ed[i].t]-1;
		else if(m3>dp[ed[i].t][1]-f[ed[i].t]-1)m3=dp[ed[i].t][1]-f[ed[i].t]-1;
	}
	dp[u][0]=(m1>0?0:m1)+f[u]+((is1&1)^(s[u]=='B')?-1:1);
	dp[u][1]=m2+f[u]+((is1&1)^(s[u]=='B')?-1:1);
	if(dp[u][1]>f[u])dp[u][1]=f[u];
	if(m2>0)m3=m2,m2=0;else if(m3>0)m3=0;
	for(int i=head[u];i;i=ed[i].next)
	if(ed[i].t!=fa&&is[ed[i].t])
	{
		int s1=dp[ed[i].t][0]-f[ed[i].t]-1;
		if(dp[ed[i].t][1]-f[ed[i].t]-1==m2)s1+=m3;
		else s1+=m2;
		int as1=f[u]+g[u]+s1+((is1&1)^(s[u]=='B')?-1:1);
		if(m3==0&&((is1&1)^(s[u]=='B'))==0)as1--;
		if(as>as1)as=as1;
	}
	for(int i=head[u];i;i=ed[i].next)
	if(ed[i].t!=fa&&is[ed[i].t])
	{
		int s1=dp[ed[i].t][1]-f[ed[i].t]-1;
		int as1=f[u]+g[u]+s1+((is1&1)^(s[u]=='B')?-1:1);
		if(as>as1)as=as1;
	}
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<n;i++)scanf("%d%d",&a,&b),adde(a,b);
	scanf("%s",s+1);
	for(int i=1;i<=n;i++)if(s[i]=='W')st=i;
	dfs(st,0);dfs1(st,0);as=f[st];dfs2(st,0);dfs3(st,0);
	if(!st)as=0;printf("%d\n",as);
}

Measured memory_bytes: 12032
#include <iostream> 
#include <math.h>
using namespace std;
 
long long  saidai(long long a, long long b)
{
	if (a%b==0) {
		return(b);
    } else {
		return (saidai(b,a%b));
    }
}
 
int main() {
    long long A, B;
    cin >> A >> B;
    long long sai = saidai(A, B);
    int M = sqrt(max(A, B)) + 1;
    int ans = 1;
    int i = 2;
    while(M > i && sai >= i) {
        if(sai % i == 0) {
            ans += 1;
            while(sai % i == 0) {
                sai /= i;
            }
        }
        i++;
    }
    if(sai != 1) {
        ans += 1;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
/* C++14 (Clang 3.8.0) for AtCoder */

#include <iostream>
#include <vector>
#include <string>
// #include <cmath>
// #include <math.h>
// #include <map>
// #include <algorithm>

namespace AtCoder {
	using Str = std::vector<std::string>;
	using Num = std::vector<int>;
	using BigNum = std::vector<double>;

	class Ans {
	public:
		void showResult(void);
		void increment(void);
		void increment(double);
		void decrement(void);
		void decrement(double);
		double getResult(void);
	private:
		double result;
	};
	void Ans::showResult(void) {
		printf("%.0lf\n", this->result);
	}
	void AtCoder::Ans::increment(void) {
		this->result++;
	}
	void AtCoder::Ans::increment(double value) {
		this->result += value;
	}
	void AtCoder::Ans::decrement(void) {
		this->result--;
	}
	void AtCoder::Ans::decrement(double value) {
		this->result -= value;
	}
	double AtCoder::Ans::getResult(void) {
		return this->result;
	}

	void input(Str* str) {
		str->clear();
		std::string buf = "", row = "";
		std::getline(std::cin, buf);
		for (unsigned int i = 0; i < buf.size(); i++) {
			if (' ' == buf[i]) {
				str->push_back(row);
				row = "";
			} else {
				row += buf[i];
			}
		}
		str->push_back(row);
	}
	void input(Num* num) {
		num->clear();
		std::string buf = "", row = "";
		std::getline(std::cin, buf);
		for (unsigned int i = 0; i < buf.size(); i++) {
			if (' ' == buf[i]) {
				num->push_back(std::atoi(row.c_str()));
				row = "";
			} else {
				row += buf[i];
			}
		}
		num->push_back(std::atoi(row.c_str()));
	}
	void input(BigNum* num) {
		num->clear();
		std::string buf = "", row = "";
		std::getline(std::cin, buf);
		for (unsigned int i = 0; i < buf.size(); i++) {
			if (' ' == buf[i]) {
				num->push_back(std::atof(row.c_str()));
				row = "";
			} else {
				row += buf[i];
			}
		}
		num->push_back(std::atof(row.c_str()));
	}
	void exp(std::string* str,  Str* newStr) {
		std::string pre = *str;
		newStr->clear();
		for (unsigned int i = 0; i < pre.length(); i++) {
			newStr->push_back(pre.substr(i, 1));
		}
	}
}

int main(void) {

	AtCoder::Num n;
	AtCoder::Str s;
	AtCoder::input(&n);
	AtCoder::input(&s);
	AtCoder::exp(&s[0], &s);

	const int max = n[0] - 2;

	AtCoder::Ans* ans = new AtCoder::Ans();

	for (int i = 0; i < max; i++) {
		if ("A" == s[i]) {
			if ("B" == s[i + 1] &&
				"C" == s[i + 2]) {
				ans->increment();
			}
		}
	}

	ans->showResult();

	delete(ans);

	return 0;
}

Measured memory_bytes: 888
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;

#define FOR(i, s, e)   for(int i = (s); i < (e); i++)
#define FOR64(i, s, e) for(ll  i = (s); i < (e); i++)
#define ALL(x)         (x).begin(), (x).end()
#define SORT(b, e)     sort((b), (e))
#define REV(b, e)      reverse((b), (e))
#define VSORT(v)       sort((v).begin(), (v).end())
#define VREV(v)        reverse((v).begin(), (v).end())
#define pb(a)          push_back(a)
#define INF            999999999
#define P(x)           printf("%d\n", (x));

typedef long long ll;

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

	vector<int> A(N);
	map<int, int> M;

	for(int &a : A){
		cin >> a;
		M[a]++;
	}
	
	VSORT(A);
	
	int ans = 0;
	for(int j = N-1; j >= 0; j--){
		int a = A[j];
		if(M[a]){
			M[a]--;
			for(int k = 30; (1L << k) > a; k--){
				if(M[(1L << k) - a]){
					M[(1L << k) - a]--;
					ans++;
					break;
				}
			}
		}
	}
	
	cout << ans << endl;
	
	return 0;
}



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

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()

int main() {
  int n,d;
  int ans;
  cin >> n>>d;
  ans = n/(d*2+1);
  if (n%(d*2+1)!=0) {
    ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for(int i=m; i<n; i++)
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
template <typename T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1;} return 0; }
template <typename T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1;} return 0; }


int main() {
  int n; cin>>n;
  string s[n];
  rep(i,0,n) cin>>s[i];
  sort(s,s+n);
  int count =1;
  rep(i,1,n){
      if(s[i]==s[i-1]) continue;
      else count++;
  }
  cout<<count<<endl;

  

}

Measured memory_bytes: 9880
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
static class Program
{
	public static void Main(string[] args)
	{
		var s = Console.ReadLine();
		Console.WriteLine(s[2] == s[3] && s[4] == s[5] ? "Yes" : "No");
	}
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define pb push_back

typedef vector<int> vint;
typedef long long ll;

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

    ll a, v, b, w, t;
    cin >> a >> v >> b >> w >> t;
    ll av = v * t;
    ll bv = w * t;
    if (a < b)
    {
        a += av;
        b += bv;

        if (a >= b)
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
    }
    else
    {
        a -= av;
        b -= bv;
        if (a <= b)
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
    }
}


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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, b, a) for(int i = b - 1; i >= a; i--)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define hash dhsjakhd
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;

unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937 eng(seed);

uniform_int_distribution<> DD(0, (1ll << 31));

ll random2(){
    return (ll(DD(eng))*(1ll << 31) + ll(DD(eng))) & ((1ll << 62ll)-1);
}

ll n,m,T,k,q;

const ll big = 1000000007;
const ll big2 = 1000000009;
const ll mod =  998244353;

const int MAXN = 100001;



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

    //freopen("input.txt","r",stdin);
   // freopen("autput.txt","w",stdout);
    ll a,b,c,d;

    cin >> m >> d;
    ll ans = 0;
    rep(c1,1,m+1){
        rep(c2,1,d+1){
            ll d1 = c2%10;
            ll d10 = c2/10;
            if(d1 >= 2 && d10 >= 2 && d1*d10 == c1){
                ans++;
            }
        }
    }
    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 764
# -*- coding: utf-8 -*-
 
A, B, C = map(int, input().split())

if A < B:
	if A <= C and C <= B:
		result = 'Yes'
	else:
		result = 'No'
else:
	if B <= C and C <= A:
		result = 'Yes'
	else:
		result = 'No'	
 
print(result)

Measured memory_bytes: 2940
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1e17 - 10;
const double PI = acos(-1);
typedef pair<LL, LL> Pll;
LL h = 0, w, n = 0, m, s, ans = INF, dp[1003][1003][3] = {}, a[10000] = {}, sum = 0;
int flag = 0;
string str;
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		int aa;
		cin >> aa;
		LL num = 0;
		while (true) {
			if (aa % 2 == 0) {
				aa /= 2;
				num++;
			}
			else break;
		}
		ans = min(num, ans);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <algorithm>
#include <set>
#include <map>
#include <string>
using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)
#define rep_r(i,s,n)for(ll i=n-1;i>=s;i--)
#define repe_r(i,s,n)for(ll i=s;i<=n;i++)
static const ll MOD = 1e9 + 7;
static const ll MAX_L = (ll)1 << 62;

int main() {
	string s; cin >> s;
	ll k; cin >> k;

	ll index = 0;
	rep(i, 0, s.size()) {
		if (s[i] != '1') {
			index = i;
			break;
		}
	}
	if (index >= k) {
		cout << 1 << endl;
		return 0;
	}
	else {
		cout << s[index] << endl;
		return 0;
	}

	return 0;
}

Measured memory_bytes: 256
alp = 'abcdefghijklmnopqrstuvwxyz'

d = {c:False for c in alp}

s = open(0).read().rstrip()

for c in list(s):
    d[c] = True

isnone = True
for c,b in d.items():
    if not b:
        isnone = False
        print(c)
        break
if isnone:
    print('None')

Measured memory_bytes: 71944
// finish date: 2018/02/24

#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>

using namespace std;

#define FOR(i, a, b) for(int (i)=a;(i)<(b);(i)++)
#define rep(i, n)  FOR(i,0,n)
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vvvi vector<vector<vector<int>>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vd vector<double>
#define vvd vector<vector<double>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define bigmod 1000000007
#define INF 1050000000
#define pii pair<int,int>


int main() {
    int N;
    cin >> N;
    map<int, int> odd;

    vi A(N);
    rep(i, N) {
        cin >> A[i];
        if (i % 2 == 0) odd[A[i]]++;
    }
    sort(A.begin(), A.end());
    
    int c = 0;
    rep(i, N) {
        if (i % 2 == 0 && !odd.count(A[i])) c++;
    }
    cout<<c<<endl;
    return 0;
}





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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< pii >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define in(x, a, b) ((a) <= (x) && (x) < (b))
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)

//int dxy[5] = {0, 1, 0, -1, 0};
// 01Trie BIT CHT DFT FFT avl cmd cusum dijkstra dinic geo2 gin graph kruskal lca lcm matrix ncm next_combination ppuf segtree st tmp topcoder uf vi 

using Weight = int;
using Flow = int;
struct Edge {
    int s, d; Weight w; Flow c;
    Edge() {};
    Edge(int s, int d, Weight w = 1) : s(s), d(d), w(w), c(w) {};
};
bool operator<(const Edge &e1, const Edge &e2) { return e1.w < e2.w; }
bool operator>(const Edge &e1, const Edge &e2) { return e2 < e1; }
inline ostream &operator<<(ostream &os, const Edge &e) { return (os << '(' << e.s << ", " << e.d << ", " << e.w << ')'); }

using Edges = vector<Edge>;
using Graph = vector<Edges>;
using Array = vector<Weight>;
using Matrix = vector<Array>;

void addArc(Graph &g, int s, int d, Weight w = 1) {
    g[s].emplace_back(s, d, w);
}
void addEdge(Graph &g, int a, int b, Weight w = 1) {
    addArc(g, a, b, w);
    addArc(g, b, a, w);
}

void solve(Graph &g, vi &ans, int pos, int bef, int yui)
{
    int nxt = yui + ans[pos];
    ans[pos] += yui;
    for (auto i : g[pos]) {
        if (i.d != bef) {
            solve(g, ans, i.d, pos, nxt);
        }
    }
}

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

    int2(n, q);
    Graph g(n);
    for (int i = 0; i < n-1; i++) {
        int2(tmpx, tmpy);
         ;
         tmpx--; tmpy--;
        addEdge(g, tmpx, tmpy );
    }
    
    vi ans(n, 0);
    rep(i, q) {
        int2(p, x);
        ans[p-1] += x;
    }

    solve(g, ans, 0, -1, 0);

    rep(i, n) {
        cout << ans[i] << " ";
    }
    cout << endl;

    return 0;
}


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

const int MAX_N=505;
const int MAX_M=505;
int n,m;
int a[MAX_N][MAX_M];
int d[MAX_N*MAX_M][5];

int main()
{
	ios::sync_with_stdio(false);
	cin>>n>>m;
	for(int i=1;i<=n;++i)
		for(int j=1;j<=m;++j)
			cin>>a[i][j];
	int ans=0;
	for(int i=1;i<n;++i)
	{
		for(int j=1;j<m;++j)
			if(a[i][j]%2){
				--a[i][j];
				if(a[i][j+1]%2){
					d[ans][0]=d[ans][2]=i;
					d[ans][1]=j;	d[ans][3]=j+1;
					++a[i][j+1];
				}else{
					d[ans][0]=i;	d[ans][2]=i+1;
					d[ans][1]=d[ans][3]=j;
					++a[i+1][j];
				}
				++ans;
			}
		if(a[i][m]%2){
			--a[i][m];
			d[ans][0]=i;	d[ans][2]=i+1;
			d[ans][1]=d[ans][3]=m;
			++a[i+1][m];
			++ans;
		}
	}
	for(int j=1;j<m;++j)
		if(a[n][j]%2){
			--a[n][j];
			d[ans][0]=d[ans][2]=n;
			d[ans][1]=j;	d[ans][3]=j+1;
			++a[n][j+1];
			++ans;
		}
	cout<<ans<<endl;
	for(int i=0;i<ans;++i)
		cout<<d[i][0]<<" "<<d[i][1]<<" "<<d[i][2]<<" "<<d[i][3]<<endl;
	
	return 0;
}

Measured memory_bytes: 7168
#include <iostream>
using namespace std;
int main()
{
    int n,sum=0,maxx=0,s,ss,i=1;;
    while(cin >> n)
   {
       i=1;
    do{
           sum=0; s=i;
            while(s % 2 == 0)
            {
               sum++;
               s=s/2;
            }
            if(sum>=maxx)
                {ss=i;
                  maxx=sum;
                }
                i++;
           // cout<<maxx << ss <<endl;
        }while(i <= n );
        cout << ss << endl;maxx=0;ss=0;
    }
    return 0;
}


Measured memory_bytes: 256
// Problem : D - .. (Double Dots)
// Contest : AtCoder - AtCoder Beginner Contest 168
// URL : https://atcoder.jp/contests/abc168/tasks/abc168_d
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define sort(v) sort(all(v))
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
using namespace std;
vector<bool>vis;
vector<vector<int>>g;
vector<int>ans;
void bfs(int u) 
{ 
    queue<int> q; 
  
    q.push(u); 
    vis[u] = true; 
  
    while (!q.empty()) { 
  
        int f = q.front(); 
        q.pop(); 
 
        //cout << f << " "; 
  
        for (auto i = g[f].begin(); i != g[f].end(); i++) { 
            if (!vis[*i]) { 
                q.push(*i);
                ans[*i]=f; 
                vis[*i] = true; 
            } 
        } 
    } 
} 
int main()
{
    IOS
    int t=1;
    //cin>>t;
    while(t--)
    {
		int n,m;
		cin>>n>>m;
		vis.assign(n+1, false);
		ans.assign(n+1,0);
		ans[0]=-1;
		ans[1]=-1;
		g.assign(n+1, vector<int>());
		while(m--)
		{	
			int a,b;
			cin>>a>>b;
			g[a].pb(b);
			g[b].pb(a);
		}
		for(int i=1;i<=n;i++) {
			if(!vis[i])
			bfs(i);
		}
		if(find(all(ans),0)!=ans.end()) cout<<"No\n";
		else 
		{	
			cout<<"Yes\n";
			for(int i=2;i<=n;i++) cout<<ans[i]<<"\n";
		}
    }
    return 0;
}


Measured memory_bytes: 10292
//#inclde <bits/stdc++.h>
//using namespace std;
#include <iostream>
#include <string>


   // int mokemoke,hogehoge;
   // std::cin >> mokemoke >> hogehoge;
   // std::cout << mokemoke << hogehoge << std::endl;

int main(){

    int A,B,C;
    std::cin >> A >> B >> C;
    int nya = 0;
    if(A == 5){
        nya++;
    }
    if(B == 5){
        nya++;
    }
    if(C == 5){
        nya++;
    }
    int h = 0;
    if(A == 7){
        h++;
    }
    if(B == 7){
        h++;
    }
    if(C == 7){
        h++;
    }
    if(nya == 2&&h == 1){
        std::cout << "YES" << std::endl;
    }
    else{
        std::cout << "NO" << std::endl;
    }
    return 0;
}


Measured memory_bytes: 256
#if 1

#include <bits/stdc++.h>
using namespace std;
vector< pair<int,int> > a;
long long h,w,d[3005],n,mod = 1000000007,f[300005],b[300005];

long long p(long long x,long long y)
{
    return y ? p(x*x % mod,y/2)*(y % 2 ? x : 1) % mod : 1;
}

long long go(long long x,long long y)
{
	return ((f[x+y]*b[x]) % mod*b[y]) % mod;
}
int main()
{
	cin >> h >> w >> n;
	f[0] = b[0] = 1;
	for(int i = 1;i < 300000;i++)
    {
        f[i] = f[i-1]*i % mod;
        b[i] = p(f[i],mod-2);
    }
	for(int i = 0;i < n;i++)
	{
		int x,y;
		cin >> x >> y;
		a.push_back(make_pair(x,y));
	}
	a.push_back({h,w});
	sort(a.begin(),a.end());
	for(int i = 0;i <= n;i++)
	{
		long long now = go(a[i].first-1,a[i].second-1);
		for(int j = 0;j < i;j++)
		{
			if(a[j].second <= a[i].second)
			{
				now = (now-d[j]*go(a[i].first-a[j].first,a[i].second-a[j].second) % mod+mod) % mod;
			}
		}
		d[i] = now;
		//cout << d[i] << " ";
	}
	cout << d[n];
}

#endif // 1


Measured memory_bytes: 4992
import Data.Bits
import qualified Data.Vector as V
main=print.solve.map read.words=<<getLine
solve[n,a,b]=(g 1 2 n-1-c V.! a-c V.! b+3*m)`mod`m where
  k=max a b+1
  c=V.generate k$ \i-> if i<1 then 1 else c V.!(i-1)*(n+1-i)`mod`m*v V.! i`mod`m
  v=V.generate k$ \i-> if i<2 then 1 else v V.!(m`mod`i)*(m-m`div`i)`mod`m
g r x n
  |n==0=r
  |otherwise=g t(x*x`mod`m)(shiftR n 1)
  where t=if n .&. 1==0 then r else r*x`mod`m
m=10^9+7

Measured memory_bytes: 48008
#include <stdio.h>
 
int main()
{
  int a, b, r, tmp;
  	
  scanf("%d%d",&a,&b);
 
  /* ?????¶??° a > b ????¢?????????\??? */
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
  /* ?????????????????????????????? */
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
 
  /* ?????§??¬?´???°????????? */
  printf("%d\n", b);
 
  return 0;
}

Measured memory_bytes: 592