akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
	import java.io.*;
	import java.math.*;
	 
	 
	import static java.lang.Math.*;
	import static java.util.Arrays.*;
	import static java.util.Collections.*;
	 
	 
	public class Main{ 
	 
	 
	    static long mod=1000000007;
	    static int dx[]={1,-1,0,0};
	    static int dy[]={0,0,1,-1};
	    // static int dx[]={1,-1,0,0,1,1,-1,-1};
	    // static int dy[]={0,0,1,-1,1,-1,1,-1};
	    // PriorityQueue<Integer> que = new PriorityQueue<Integer>(); 
	    //HashMap<Integer,Integer> map = new HashMap<Integer,Integer>();
	 
	public  static void main(String[] args)   throws Exception, IOException{
	 
	    
	    Reader sc = new Reader(System.in);
	    PrintWriter out=new PrintWriter(System.out);
	 
	    // int n=sc.nextInt();
	    int n;
	    char c[]=sc.nextString().toCharArray();
	    n=c.length;
	    int d[][]=new int[26][n];
	    long ans=0;
	    d[c[0]-'a'][0]++;
	    for (int i=1; i<n; i++) {
	    	ans+=i-d[c[i]-'a'][i-1];
	    	db(i-d[c[i]-'a'][i-1]);
	    	for (int t=0;t<26 ;t++ ) {
	    		d[t][i]=d[t][i-1];
	    	}
	    	d[c[i]-'a'][i]++;
		}

		out.println(ans+1);
	    out.flush();
	}

	static boolean dfs(boolean w[][],boolean d[],int cur){
		for (int i=0; i<d.length; i++) {
			if(w[cur][i] && !d[i]){
				d[i]=true;
				if(cur==d.length-1)return true;
				if(!dfs(w,d,cur+1))return false;
				d[i]=false;
			}
		}
		return true;
	}
	 
	static void db(Object... os){
	 
	    System.err.println(Arrays.deepToString(os));
	 
	}
	 
	static boolean validpos(int x,int y,int r, int c){
	    
	    return x<r && 0<=x && y<c && 0<=y;
	    
	}
	 
	static boolean bit(long x,int k){
	    // weather k-th bit (from right) be one or zero
	    return  ( 0 < ( (x>>k) & 1 )  )  ? true:false;
	}
	 
	}
	 
	 
	class XY {
	    int x,y,d;
	    XY(int x, int y, int d) {
	        this.x=x;
	        this.y=y;
	        this.d=d;
	    } 
	}
	 
	class P implements Comparable<P>{
	    int x,y;
	    P(int x, int y) {
	        this.x=x;
	        this.y=y;
	    } 
	      
	    public int compareTo(P p){
	        return x - p.x;
	    } 
	}
	 
	class Reader
	{ 
	    private BufferedReader x;
	    private StringTokenizer st;
	    
	    public Reader(InputStream in)
	    {
	        x = new BufferedReader(new InputStreamReader(in));
	        st = null;
	    }
	    public String nextString() throws IOException
	    {
	        while( st==null || !st.hasMoreTokens() )
	            st = new StringTokenizer(x.readLine());
	        return st.nextToken();
	    }
	    public int nextInt() throws IOException
	    {
	        return Integer.parseInt(nextString());
	    }
	    public long nextLong() throws IOException
	    {
	        return Long.parseLong(nextString());
	    }
	    public double nextDouble() throws IOException
	    {
	        return Double.parseDouble(nextString());
	    }
	}

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

int main (){
  int N,L;
  cin >> N >> L;
  
  vector<string> s(N);
   for (int i = 0; i < N; i++) {
     cin >> s.at(i);
   }
  
  sort(s.begin(),s.end());
  
  for (int i=0;i<N;i++){
    cout << s.at(i);
  }
  
}
    

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int GCD(const int& a, const int& b){
   const int& _a = max(a,b);
   const int& _b = min(a,b);
   if(_a % _b == 0){
      return _b;
   }
   else{
      return GCD(_b, _a % _b);
   }
}

int LCM(const int& a, const int& b){
   const int& _a = max(a,b);
   const int& _b = min(a,b);
   return (_a*_b)/(GCD(_a, _b));
}

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

   for(int i = 0; i < k; i++){
      int max_v = max({a,b,c});
      if(a == max_v){
         a *= 2;
      }
      else if(b == max_v){
         b *= 2;
      }else{
         c *= 2;
      }
   }
   cout << a + b + c << endl;

   return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int Q[10100000][2],head,tail,D[801][801];
int n,m,k,sx,sy;
char p[801][801];
void Ins(int x,int y,int d){
    if(D[x][y]<=d || p[x][y]!='.')
        return;
    D[x][y]=d;
    tail++;
    Q[tail][0]=x,Q[tail][1]=y;
}
int main(){
    int x,y;
    cin>>n>>m>>k;
    for(int i=1;i<=n;i++){
        scanf("%s",p[i]+1);
        for(int j=1;j<=m;j++){
            if(p[i][j]=='S')
                sx=i,sy=j,p[i][j]='.';
            D[i][j]=1e9;
        }
    }
    Ins(sx,sy,0);
    while(head<tail){
        head++;
        x=Q[head][0],y=Q[head][1];
        Ins(x+1,y,D[x][y]+1);
        Ins(x,y+1,D[x][y]+1);
        Ins(x-1,y,D[x][y]+1);
        Ins(x,y-1,D[x][y]+1);
    }
    int res=1e9;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            if(D[i][j]<=k)
                res=min(res,1+(min(min(i-1,n-i),min(j-1,m-j))+k-1)/k);
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 8448
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
typedef complex <double> cp;
#define debug(a) cout<<#a<<":"<<a<<endl;
#define fr freopen("in.txt","r",stdin);
#define Fill(x,a) memset(x,a,sizeof(x))
#define cpy(a,b) memcpy(a,b,sizeof(a))
const double PI = acos(-1);
const int INF=0x3f3f3f3f;
const int N=1e6+7;
const int mod=1e9+7;
int maxn,minn;
int T,n,m,q;

ll ksm(ll a,ll b){
	
	ll ans = 1;
	while(b){
		if(b&1)	ans = (ans * a) % mod;
		a = ( a * a ) % mod;
		b >>= 1;
	}
	return ans;	
}

int main(){
	cin >> n;
	ll ans = ((ksm(10,n) - 2 * ksm(9,n) + ksm(8 ,n)  ) % mod + mod ) % mod;
	cout << ans << endl;

	return 0;
}



Measured memory_bytes: 3572
//InTheNameOfGod
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,j,k) for(int i=j;i<k;++i)
#define rrep(i,j,k) for(int i=j;i>=k;i--)
#define pb push_back
#define lb(i) i&(-i);
const int maxn = 1e5+6;
vector<int> s[maxn],t[maxn];
int cnt[40];
int n,f,c,re;
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);
    cin>>n>>c;
    rep(i,0,n)
    {
        int x,y,z;
        cin>>x>>y>>z;
        s[x].pb(z);
        t[y].pb(z);
    }
    rep(i,0,maxn)
    {
        for(auto u:s[i])
        {
            if(cnt[u])
            {
                cnt[u]++;
            }
            else
            {
                cnt[u]++;
                if(f)
                {
                    f--;
                }
                else re++;
            }
        }
        for(auto u:t[i])
        {
            cnt[u]--;
            if(cnt[u]==0)
            {
                f++;
            }
        }
    }
    cout<<re;
    return 0;
}


Measured memory_bytes: 11264
#include<iostream>

using namespace std;

#define INF 0x3f3f3f3f

int Max(int a, int b){ return a > b ? a : b; }
int Min(int a, int b){ return a < b ? a : b; }

int main(){
    int n, f = 1;
    cin >> n;
    int mini, maxr = -INF;
    while(n--){
        int x; cin >> x;
        if(f) { mini = x; f = 0; continue;}
        maxr = Max(maxr, x - mini);     //记录j之前最大的利益
        mini = Min(mini, x);            //记录j之前包括j最小的价值
    }
    cout << maxr << endl;
    return 0;
}


Measured memory_bytes: 3108
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AConsecutiveIntegers solver = new AConsecutiveIntegers();
        solver.solve(1, in, out);
        out.close();
    }

    static class AConsecutiveIntegers {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int N = in.ni(), K = in.ni();
            out.println(N - K + 1);
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String ns() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int ni() {
            return Integer.parseInt(ns());
        }

    }
}



Measured memory_bytes: 24788
n=int(input())
a=list(map(int,input().split()))

dp = [[0 for _ in range(n)] for __ in range(n)]
for i in range(n):
    if n%2 == 1:
        dp[i][0] = a[i]
    else:
        dp[i][0] = -a[i]
for le in range(1,n):
    for i in range(n):
        if i + le >= n: continue
        if (n-le)%2 == 1:
            dp[i][le] = max(dp[i][le-1] + a[i+le], dp[i+1][le-1] + a[i])
        else:
            dp[i][le] = min(dp[i][le-1] - a[i+le], dp[i+1][le-1] - a[i])

print(dp[0][n-1])

Measured memory_bytes: 121564
#include<bits/stdc++.h>
using namespace std;
int main()
{
    char s[100];
    char c[100],v[100];
    cin>>c>>s>>v;
    if(c[0]>='a' && c[0]<='z')
    c[0]-=32;
    if(s[0]>='a' && s[0]<='z')
    s[0]-=32;
    if(v[0]>='a' && v[0]<='z')
    v[0]-=32;
    cout<<c[0]<<s[0]<<v[0];
    
    return 0;
}

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

int main(){
	int k;
	cin >> k;
	int n[32] = {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};

	cout << n[k-1] << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <numeric>
#include <queue>
#include <numeric>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <map>
#include <functional>
#include <limits>
#include <set>
#include <stack>
#include <cctype>
#define rep(i,a,b) for((i)=a;i<(int)(b);i++)

#define AAA (1000000007) 


using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pairII;


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

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
ll powD(ll a, ll b) {
	ll ans = 1;
	a %= AAA;
	for (int i = 0; i < b; i++)
	{
		ans *= a;
		ans %= AAA;
	}
	return ans;
}


int main() {
	int i, j, k;

	int N, M, K;

	vector<int> A;

	cin >> N;
	rep(i, 0, N) {
		int a;
		cin >> a;
		A.push_back(a);
	}

	int type = 0;
	int ans = 0;
	rep(i,1,N) {
		if (type == 0) {
			if (A[i - 1] < A[i])
				type = 1;
			if (A[i - 1] > A[i])
				type = -1;
			if (A[i - 1] == A[i])
				type = 0;
		}
		else if (type == 1) {
			if (A[i - 1] <= A[i])
				continue;
			else {
				type = 0;
				ans++;
			}
		}
		else {
			if (A[i - 1] >= A[i])
				continue;
			else {
				type = 0;
				ans++;
			}
		}
	}
	cout << ans+1;
	return 0;
}

Measured memory_bytes: 892
N = input()
Len = len(N)
count=0
if(Len%2 == 0):
    for i in range(Len):
        if(i%2==0):
            count = count + 9 * 10**i
else:
    for i in range(Len-1):
        if(i%2==0):
            count = count + 9 * 10**i
    count = count + int(N)-10**(Len-1) +1

print(count)

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

using namespace std;
using ll = long long;

const int mod = 1e9 + 7;

int n;
string s;

vector<ll> dp, csum;

ll sum(int a, int b){
    if(a == 0) return csum[b];
    return (csum[b] - csum[a-1] + mod) % mod;
}

int main(){
    cin>>n>>s;
    dp.resize(n+1); csum.resize(n+1);
    dp[1] = 1;
    for(int i = 2; i <= n; i++){
        vector<ll> ndp(n+1);
        csum[1] = dp[1];
        for(int u = 2; u <= n; u++){
            csum[u] = (csum[u-1] + dp[u]) % mod;
        }
        for(int l = 1; l <= i; l++){
            if(s[i-2] == '<'){
                // for(int k = 1; k < l; k++){
                    // ndp[l] = (ndp[l] + dp[k]) % mod;
                    ndp[l] = sum(1, l-1);
                // }
            }else{
                // for(int k = l; k <= i-1; k++){
                    // ndp[l] = (ndp[l] + dp[k]) % mod;
                    ndp[l] = sum(l, i-1);
                // }
            }
        }
        dp = ndp;
    }
    ll res = 0;
    for(auto x : dp){
        res = (res + x) % mod;
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define repk(i,k,n) for (ll i = k; i < (ll)(n); ++i)
#define INF 500000001000000000
#define MOD 1000000007
using namespace std;
typedef long long  ll;
typedef pair<int, int> P;

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

	ll L,R;
	cin >> L >> R;
	ll ans;
	if(R - L > 2019){
		ans = 0;
	}
	else{
		ans = 2018;
		for(ll i = L; i <= R; i++){
			for(ll j = i+1; j<=R; j++){
				ans = min(ans, i*j%2019);
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define repn(i,n) for(ll i=0;i<=(ll)(n);i++)
typedef pair<ll,ll> P;
typedef pair<ll,ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
//cin.tie(0);
//ios::sync_with_stdio(false);
vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};
ll h,w;

vector<string> v;

bool inr(ll lim,ll x){
    if(0<=x && x < lim)return true;
    else return false;
}

PL dfs(ll x,ll y,char c){
    PL res;
    
    v[x][y]='!';
    
    if(c=='#'){
        res={0,1};//w,b
        for(ll i=0;i < 4;i++)
        {
            if(inr(h,x+dx.at(i)) && inr(w,y+dy.at(i)) && v[x+dx.at(i)][y+dy.at(i)]=='.'){
                PL res2=dfs(x+dx.at(i),y+dy.at(i),'.');
                res.fi+=res2.fi;
               res.se+=res2.se;

            }
        }
    }else{
        res={1,0};//w,b
        for(ll i=0;i < 4;i++)
        {
            if(inr(h,x+dx.at(i)) && inr(w,y+dy.at(i)) && v[x+dx.at(i)][y+dy.at(i)]=='#'){
                PL res2=dfs(x+dx.at(i),y+dy.at(i),'#');

                res.fi+=res2.fi;
                res.se+=res2.se;
            }

        }
    }
    return res;
}

signed main(){
    cin>>h>>w;
    v.resize(h);
    PL res;
    ll ans=0;
    rep(i,h)cin>>v.at(i);
    for(ll i=0;i < h;i++)
    {
        for(ll j=0;j < w;j++)
        {
            if(v.at(i).at(j)=='#'){
                res=dfs(i,j,'#');
                ans+=res.fi*res.se;
 
            }
        }
    }
    cout<<ans<<endl;
}



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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const int MAXN = 5*1000+1;
int n;
string s;
int dp[MAXN][MAXN];
int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    cin>>n;
    cin>>s;

    memset(dp,-1,sizeof(dp));

    FORR(i,0,n) FORR(j,0,n){
        if(dp[i+1][j+1]==-1){
            dp[i][j] = (s[i]==s[j])?1:0;
        }else{
            if(s[i]==s[j])
                dp[i][j] = dp[i+1][j+1] + 1;
            else
                dp[i][j] = 0;
        }
    }

    int ans = 0;
    REP(i,n) FOR(j,i+1,n){
        if(i+dp[i][j]-1 < j)
            ans = max(ans, dp[i][j]);
    }

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

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

using namespace std;

typedef long long ll;

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,w;
  cin>>n>>w;
  ll x,v;
  pair<bool,ll> dp[w+1];
  for(ll i=0;i<=w;i++)
  {
  dp[i].first=false;
  dp[i].second=0;
  }
  dp[0].first=true;
  for(ll i=1;i<=n;i++)
  {
  cin>>x>>v;
  for(ll j=w;j>=x;j--)
  {
  if(dp[j-x].first)
  {
  dp[j].first=true;
  dp[j].second=max(dp[j].second,dp[j-x].second+v);
  }
  }
  }
  ll ans=0;
  for(ll i=1;i<=w;i++)
  {
  ans=max(ans,dp[i].second);
  }
  cout<<ans;
}


Measured memory_bytes: 5208
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

public class Main {

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();

        solver.call(in,out);
        out.close();
    }

    static class TaskA {
        public void call(InputReader in, PrintWriter out) {
            int x ,y ;
            x =in.nextInt();
            y =in.nextInt();
            if(y>4*x || y%2!=0 || y<2*x)
                out.println("No");
            else {
                out.println("Yes");
            }

        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }


    }
}

Measured memory_bytes: 32732
//#pragma GCC optimize ("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define pb push_back
#define F first
#define S second
#define ins insert
#define mp make_pair
#define fo(i, n1, n, x) for(int i = n1; i <= n; i += x)
#define foo(i, n, n1, x) for(int i = n; i >= n1; i -= x)
#define bit __builtin_popcount
#define md (l + ((r - l) / 2))
#define all(x) x.begin(),x.end()
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)

using namespace std;
//using namespace __gnu_pbds;
//using namespace __gnu_cxx;


using ll = long long;

//#define int ll

using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;



const int N = 2e5 + 11, mod = 1e9 + 7, mod2 = 998244353;
const int MAX = 1e5 + 11;
const int INF1 = 2e9 + 11;
const ll INF2 = 6e18 + 11;
const double INF3 = 1e8 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const double EPS = 1e-4;
const double PI = acos(-1.0);


//template<typename T> using ordered_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }


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

int x, n, a[111], ans = -1, flag;
bool us[111];
main() {
  file("threesum");
  ios;
  int y;
  cin >> x >> y;
  fo(i, 0, x, 1) if (i * 2 + (x - i) * 4 == y) flag = 1;
  cout << (flag ? "Yes" : "No");
  return 0;
}
/**

*/


Measured memory_bytes: 3652
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		if(a<b){
			if(b<c){
				System.out.println("Yes");
			}else if(c<b){
				System.out.println("No");
			}
		}else {
			System.out.println("No");
		}
		sc.close();
	}
}


Measured memory_bytes: 26268
#include<iostream>

using namespace std;

void sort(int a[],int n)
{
	int i = 0,j = n - 1;
	int pivot = a[(i+j)/2];

	while(true)
	{
		while(a[i] < pivot)i++;
		while(a[j] > pivot)j--;

		if( i >= j )break;

		int hold = a[i];
		a[i] = a[j];
		a[j] = hold;

		i++;
		j--;
	}

	if( i > 1 )sort(a,i);
	if( n-j-1 > 1 )sort(a+j+1,n-j-1);
}

int main()
{
	int N;
	int *a;
	int cnt = 0;
	cin >> N;
	a = new int[N];

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

	sort(a,N);

	int chk = 0;
	for(int i=0;i<N;i++)
	{
		if(chk != a[i])
		{
			cnt++;
			chk = a[i];
		}
	}

	cout << cnt << endl;

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

#define VAL_NUM (100)

int main (void) {
        int flag = 0;
        int array[VAL_NUM];
        int val_num;
        int i, j;
        int a;

        scanf("%d", &val_num);

        for (i = 0; i < val_num; i++)
                scanf("%d", &array[i]);

        for (i = 0; i < val_num; i++) {
                for (j = 1; j < val_num; j++) {
                        if (array[j] < array[j-1]) {
                                a = array[j];
                                array[j] = array[j-1];
                                array[j-1] = a;
                                flag++;
                        }
                }
        }

        printf("%d", array[0]);
        for (i = 1; i < val_num; i++)
                printf(" %d", array[i]);
        printf("\n%d\n", flag);

        return 0;
}



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

ll gcd(ll a, ll b) {
    return b ? gcd(b, a%b) : a;
}

int main() {
    int n, k;
    cin >> n >> k;
    int g;
    cin >> g;
    int m= g;
    for (int i = 1; i < n; ++i) {
        int t;
        cin >> t;
        m = max(m, t);
        g = gcd(g, t);
    }
    
    if (k <= m && k%g == 0) {
        cout << "POSSIBLE" << endl;
    } else {
        cout << "IMPOSSIBLE" << endl;
    }

        
    
    return 0;
}


Measured memory_bytes: 256
n, a, b = map(int, input().split())
s = input()
cnt_a, cnt_b, b_num = 0, 0, 0

for i in range(n):
    if s[i] == 'a':
        if cnt_a + cnt_b < a+b:
            print('Yes')
            cnt_a += 1
        else:
            print('No')
    elif s[i] == 'b':
        b_num += 1
        if cnt_a + cnt_b < a+b and b_num <= b:
            print('Yes')
            cnt_b += 1
        else:
            print('No')
    else:
        print('No')

Measured memory_bytes: 4016
import java.util.*;

public class Main {
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int h = sc.nextInt();
        int a = sc.nextInt();
        int ans = (h % a == 0) ? h / a : h / a + 1;
        System.out.println(ans);
    }
}

Measured memory_bytes: 23124
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
typedef struct pair<int,int> P;
typedef struct pair<int,P> P2;

vector<int> v[100001];
vector<ll> v2;

const ll INF=1000000000000000001;
int main() {
	ll n1;
	cin>>n1;
//	int total=0;
	for(ll h=1;h<3501;++h){
		for(ll w=1;w<3501;++w){
			if((4*h*w-n1*(h+w))>0){
				ll n=(n1*h*w)/(4*h*w-n1*(h+w));
				if(n1==(4*n*h*w)/(n*h+n*w+h*w)){
//					cout<<total<<endl;
					cout<<n<<" "<<h<<" "<<w<<endl;
					return 0;
				}
			}
		}
	}
//	cout<<total<<endl;
	return 0;
}


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

typedef long long ll;
typedef pair<int, int> ii;

int main()
{
    int x, y, z, k;
    scanf("%d %d %d %d", &x, &y, &z, &k);

    ll inpX[x], inpY[y], inpZ[z];
    for (int i = 0; i < x; i++)
        scanf("%lld", &inpX[i]);
    for (int i = 0; i < y; i++)
        scanf("%lld", &inpY[i]);
    for (int i = 0; i < z; i++)
        scanf("%lld", &inpZ[i]);
    sort(inpZ, inpZ + z);

    ll cand[x * y];
    for (int i = 0; i < x; i++)
        for (int j = 0; j < y; j++)
            cand[i * x + j] = inpX[i] + inpY[j];
    sort(cand, cand + x * y);

    vector<ll> ans;
    for (int xx = max(0, x * y - k); xx < x * y; xx++)
        for (int yy = max(0, z - k); yy < z; yy++) {
            // printf("xx %d yy %d\n", xx, yy);
            // printf("%lld %lld\n", cand[xx], inpZ[yy]);
            ans.push_back(cand[xx] + inpZ[yy]);
        }
    sort(ans.begin(), ans.end());
    reverse(ans.begin(), ans.end());

    for (int xx = 0; xx < k; xx++) {
        printf("%lld\n", ans[xx]);
    }

    return 0;
}


Measured memory_bytes: 42980
#include <iostream>
#include <cstdio>
#include <cstring>
#include <tr1/unordered_map>
#include <cmath>
#include <algorithm>

using namespace std;

typedef long long LL;

const int MAXN = 1e05 + 10;
const int MAXM = 2200 + 10;

int N;
LL a[MAXN], newa[MAXN]= {0};

int prime[MAXM]= {0}, pcnt = 0;
bool visit[MAXM]= {false};
const int MAX = 2200;
void sieve () {
	for (int i = 2; i <= MAX; i ++) {
		if (visit[i]) continue;
		prime[++ pcnt] = i;
		for (int j = i << 1; j <= MAX; j += i)
			visit[j] = true;
	}
}

tr1::unordered_map<LL, int> mapp, ccnt;
int ind = 0;
inline LL power (LL x, int p) {
	LL cnt = 1;
	for (int j = 1; j <= p; j ++)
		cnt *= x;
	return cnt;
}
pair<LL, LL> save[MAXN];
int solve () {
	int ans = 0;
	save[++ ind] = make_pair (1, 0);
	mapp[0] = mapp[1] = 1;
	for (int i = 1; i <= N; i ++) {
		LL p = a[i];
		LL cnt = 1, ano = 1;
		for (int j = 1; j <= pcnt; j ++)
			if (! (p % prime[j])) {
				int times = 0;
				while (! (p % prime[j]))
					p /= prime[j], times ++;
				times %= 3;
				if (times > 0)
					ano *= power (prime[j], 3 - times);
				cnt *= power (prime[j], times);
			}
		if (a[i] != 1 && cnt == 1 && p == 1) {
			ccnt[0] ++;
			continue;
		}
		ccnt[cnt * p] ++, newa[i] = cnt * p;
		if (mapp[cnt * p]) continue;
		if (p > 1) {
			LL sqr = sqrt (p);
			if (sqr * sqr == p) {
				save[++ ind] = make_pair (cnt * p, ano * sqr);
				mapp[cnt * p] = mapp[ano * sqr] = ind;
			}
		}
		else {
			save[++ ind] = make_pair (cnt, ano);
			mapp[cnt] = mapp[ano] = ind;
		}
	}
	ccnt[0] = min (ccnt[0], 1), ccnt[1] = min (ccnt[1], 1);
	for (int i = 1; i <= ind; i ++)
		ans += max (ccnt[save[i].first], ccnt[save[i].second]);
	for (int i = 1; i <= N; i ++)
		if (! mapp[newa[i]])
			ans ++;
	return ans;
}

template<typename T>
T getnum () {
	T num = T ();
	char ch = getchar ();

	while (! isdigit (ch))
		ch = getchar ();
	while (isdigit (ch))
		num = (num << 3) + (num << 1) + ch - '0', ch = getchar ();

	return num;
}

int main () {
	N = getnum<int> ();
	for (int i = 1; i <= N; i ++)
		a[i] = getnum<LL> ();
	sieve ();
	int ans = solve ();
	cout << ans << endl;

	return 0;
}

/*
8
1
2
3
4
5
6
7
8
*/

/*
6
2
4
8
16
32
64
*/

/*
10
1
10
100
1000000007
10000000000
1000000009
999999999
999
999
999
*/

/*
10
1
10
100
2368593037
38192375
218391929
572421321
2
16
32
*/

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

using ll = long long;
// #define int long long

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(i, r, n) for (int i = (r); i < (n); ++i)
#define REPR(i, n) for(int i = (n); i >= 0; --i) // from n to 0
#define REPRS(i, r, n) for(int i = (n); i >= (r); --i) // from n to r
#define COUTB(x) cout << (x) << "\n"
#define COUTS(x) cout << (x) << " "
#define PB push_back
#define SORT(obj) sort((obj).begin(), (obj).end())
#define SORTR(obj) sort((obj).begin(), (obj).end(), greater<>())
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define PI (acos(-1))

bool IsPrime(int);

/***** MAIN *****/
signed main() {
  int price, ans1, ans2;
  cin >> price;
  ans1 = floor(price / 1.08);
  ans2 = ceil(price/1.08);
  if(floor(ans1 * 1.08) == price) {
    cout << ans1;
  } else if(floor(ans2 * 1.08) == price) {
    cout << ans2;
  } else {
    cout << ":(";
  }



  cout << "\n";
  return 0;
}
/***** MAIN *****/

bool IsPrime(int a) {
  if(a <= 1) return false;
  if(a == 2) return true;
  if(a%2 == 0) return false;
  for(int i = 3; i*i <= a; i+=2) {
    if(a%i==0) return false;
  }
  return true;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int tmp = n;
        int sum = 0;
        while(tmp!=0){
            sum += tmp%10;
            tmp /= 10;
        }
        if(n%sum==0){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 23764
// This amazing code is by Eric Sunli Chen.
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
template<typename T> bool get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'&&t!=EOF; t=getchar());
	if(t=='-')neg=true,t=getchar();if(t==EOF)return false;
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;return true;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	short a[20]= {},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) (get1(a)&&get1(b))
#define get3(a,b,c) (get1(a)&&get2(b,c))
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);

#define getcode(i,j) (((i)>>(j))&1)
const int mod=1e9+7;

int n,m,k,must[24][24];

int dp[1<<19],ndp[1<<19],nxt[1<<19][19];
int main()
{
	memset(must,-1,sizeof(must));
	get3(n,m,k);n--;
	for(int i=1,a,b,c;i<=k;i++)
	{
		get3(a,b,c);
		must[a][b-1]=c;
	}
	
	for(int i=0;i<(1<<n);i++)for(int j=0;j<n;j++)if(!getcode(i,j))
	{
		nxt[i][j]=(i&((1<<j)-1))^(1<<j);
		bool ok=0;
		for(int k=j+1;k<n;k++)
		{
			if(ok)nxt[i][j]|=(i&(1<<k));
			if(getcode(i,k))ok=1;
		}
	}
	dp[0]=1;
	for(int i=1;i<=m;i++)for(int j=0;j<n;j++)
	{
		memset(ndp,0,sizeof(ndp));
		for(int msk=0;msk<(1<<n);msk++)
		{
			int v=getcode(msk,j);
			if(must[i][j]!=1&&!v)//go left
			{
				ndp[msk]+=dp[msk];
				if(ndp[msk]>=mod)ndp[msk]-=mod;
			}
			if(must[i][j]!=0)
			{
				if(v)
				{
					ndp[msk]+=dp[msk];
					if(ndp[msk]>=mod)ndp[msk]-=mod;
				}
				else
				{
					ndp[nxt[msk][j]]+=dp[msk];
					if(ndp[nxt[msk][j]]>=mod)ndp[nxt[msk][j]]-=mod;
				}
			}
		}
		swap(dp,ndp);
	}
	int ans=0;
	for(int i=0;i<(1<<n);i++)
	{
		ans+=dp[i];
		if(ans>=mod)ans-=mod;
	}
	printendl(ans);
	return 0;
}

Measured memory_bytes: 43264
#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);


int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    string s;
    cin>>s;
    for(int i = 0;i<3;i++)
    {
        cout<<s[i];
    }
	

	return 0;
}

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

int main()
{
  int n, t;
  cin >> n >> t;
  vector<int> c;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    if (b <= t) c.push_back(a);
  }
  sort(c.begin(), c.end());
  if (c.empty()) {
    cout << "TLE" << endl;
  }
  else cout << c[0] << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <utility>
#include <functional>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <sstream>
#include <cctype>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <tuple>
#include <queue>
using namespace std;
#define rep(i,n,x) for(int i=n;i<x;i++)
#define rem(i,n,x) for(int i=n;i>x;i--)
#define SORT(x) sort(x.begin(),x.end())
#define REV(x) reverse(x.begin(),x.end())
#define all(x) x.begin(),x.end()
#define pb push_back
#define setp(x) setprecision(x)
using LL = long long;
using ULL = unsigned long long;

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

	string ans = "AC";
	int countC = 0;
	if (s[0] != 'A') ans = "WA";
	rep(i, 1, s.size()) {
		if (2 <= i && i <= s.size() - 2 && s[i] == 'C') countC++;
		else if (isupper(s[i])) ans = "WA";
	}
	if (countC != 1) ans = "WA";

	cout << ans << endl;

	return 0;
}

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

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);

  ll h,w;cin>>h>>w;

  
  if(h>1&&w>1){
    cout<<(h*w+1)/2<<endl;
  }else{
    cout<<1<<endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stdio.h>
#include <list>
#include <numeric>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
#include <map>
#include <math.h>
//　ceil(a/b)   (a + (b - 1))/ b
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int,int> P;
const int inf=1000000007;
const int mod=1000000007;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};

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


// ll memo[2020][2020];
// int pascal_triangle(){
//   for(int i = 0; i < 2020; i++){
//     for(int j = 0; j < i+1; j++){
//       if(j == 0 || j == i) memo[i][j] = 1;
//       else{
// 	memo[i][j] = (memo[i-1][j-1]+memo[i-1][j]);
//       }
//     }
//   }
//   return 0;
// }


// int factrial(int n){
//   if(n == 0) return 1;
//   return n*factrial(n-1);
// }

// int divisor(int a){
//   int cnt = 0;
//   for(int i=1; i <= a; i++) if(a%i == 0) cnt++;
//   return cnt;
// }

// int comb(int n, int k){
//   return fact(n) / (fact(n-k)*fact(k));
// }

// int answer(bool f){
//   if(f) cout << "Yes" << endl;
//   else cout << "No" << endl;
//   return 0;
// }



char s[2010][2010];
int a[2010][2010];
int b[2010][2010];
int c[2010][2010];
int d[2010][2010];



int main(){
  int H,W;
  cin >> H >> W;
  rep(i,H){
    rep(j,W){
      cin >> s[i][j];
    }
  }

  rep(i,H){
    rep(j,W){
       if(s[i][j] == '.'){
        if(i == 0) a[i][j] = 1;
	else a[i][j] = a[i-1][j]+1;

	if(j == 0) b[i][j] = 1;
	else b[i][j] = b[i][j-1]+1;
      }
    }
  }

  for(int i = H-1; i>=0; i--){
    for(int j = W-1; j>=0; j--){
      if(s[i][j] == '.'){
        if(i == H-1) c[i][j] = 1;
	else c[i][j] = c[i+1][j]+1;

	if(j == W-1) d[i][j] = 1;
	else d[i][j] = d[i][j+1]+1;
      }
    }
  }

  
  int ans = 0;
  rep(i,H){
    rep(j,W){
	int val = a[i][j]+b[i][j]+c[i][j]+d[i][j]-3;
	ans = max(val,ans);
    }
  }
  
  cout << ans << endl;


  
  return 0;
}







Measured memory_bytes: 67328
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		while (s.hasNext()) {
			int a = Integer.parseInt(s.next());
			char op = s.next().charAt(0);
			int b = Integer.parseInt(s.next());
			switch (op) {
				case '+':
					a += b;
					break;
				case '-':
					a -= b;
					break;
				case '*':
					a *= b;
					break;
				case '/':
					a /= b;
					break;
				case '?':
					return;
			}
			System.out.println(a);
		}
	}
}

Measured memory_bytes: 17144
#define _GLIBCXX_DEBUG
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <random>
using namespace std;
int		cnt;
int		ans;

int		main(void)
{
	int		N;
	cin >> N;
	vector<int> A(N);
	vector<int> B(N);
	vector<int> C(N - 1);
	for (int i = 0; i < N; i++)
		cin >> A.at(i);
	for (int i = 0; i < N; i++)
		cin >> B.at(i);
	for (int i = 0; i < N - 1; i++)
		cin >> C.at(i);
	int		tmp = -1;
	for (auto &i : A)
	{
		if (i == tmp + 1)
			ans += (B.at(i - 1) + C.at(tmp - 1));
		else
			ans += B.at(i - 1);
		tmp = i;
	}
	cout << ans << endl;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w
using namespace std;

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;
 
const int INF=1e+9;
const double EPS=1e-9;
const int MOD=1000000007;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

signed main(){
	string s;
	cin >> s;
	if(s[1] == s[2] && (s[0] == s[1] || s[2] == s[3])) Yes();
	else No();
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{

    int h,w;
    int[][] map;
    int[][] wall_h;
    int[][] wall_s;

    class P{
	int x,y;
	P(int x, int y){
	    this.x = x;
	    this.y = y;
	}
    }

    void solve(){
	Scanner sc = new Scanner(System.in);

	while(true){
	    w = sc.nextInt();
	    h = sc.nextInt();
	    if(w==0 && h==0) break;

	    map = new int[h][w];
	    wall_h = new int[h][w-1];
	    wall_s = new int[h-1][w];
	    for(int i=0; i<h*2-1; i++){
		if(i%2==0){
		    for(int j=0; j<w-1; j++) wall_h[i/2][j] = sc.nextInt();
		}else{
		    for(int j=0; j<w; j++) wall_s[i/2][j] = sc.nextInt();
		}
	    }

	    bfs();

	    System.out.println(map[h-1][w-1]);
	}
    }

    void bfs(){
	LinkedList<P> list = new LinkedList<P>();
	list.add(new P(0,0));
	map[0][0] = 1;
	while(list.size()>0){
	    P p = list.poll();
	    int x = p.x, y = p.y;
	    if(y+1<h && map[y+1][x]==0 && wall_s[y][x]==0){
		map[y+1][x] = map[y][x]+1;
		list.add(new P(x,y+1));
	    }
	    if(y-1>=0 && map[y-1][x]==0 && wall_s[y-1][x]==0){
		map[y-1][x] = map[y][x]+1;
		list.add(new P(x,y-1));
	    }
	    if(x+1<w && map[y][x+1]==0 && wall_h[y][x]==0){
		map[y][x+1] = map[y][x]+1;
		list.add(new P(x+1,y));
	    }
	    if(x-1>=0 && map[y][x-1]==0 && wall_h[y][x-1]==0){
		map[y][x-1] = map[y][x]+1;
		list.add(new P(x-1,y));
	    }
	}
    }

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

Measured memory_bytes: 12000
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  int d[110];
  int ans = 0;
  cin >> N;
  for(int i = 0; i < N; i++) cin >> d[i];
  
  int num[110] = {0};
  for(int i = 0; i < N; i++){
    num[d[i]] = num[d[i]] + 1;
  }
  
  for(int i = 1; i <= 100; i++){
    if(num[i] > 0){
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

#define ll long long

int main(){
    ll D,G;
    ll p[13],c[13];
    int ans = 1e9;
    cin >> D >> G; 
    for(int i = 0; i < D; i++){
        cin >> p[i] >> c[i];
    } 
    for(int bit = 0; bit < (1 << D); bit++){
        int sum=0, num=0, rest_max=-1, cnt=0;

        for(int i = 0; i < D; i++){
            if(bit & (1<< i)){
                sum += 100 * (i+1) * p[i] + c[i];
                num += p[i];
            }else{
                rest_max = i;
            }
        }
        while(sum < G){
            cnt++;
            num++;
            sum += 100 * (rest_max+1);
        }
        if(cnt <= p[rest_max]){
            // cout << num << " bit:" << bit << endl;
            ans = min(num,ans);
        }
    }
    cout << ans << endl;  
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;

public class Main {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    void solve() throws IOException {
        int n = ni();
        int k = ni();

        int ans = k;
        for (int i = 1; i < n; i++) {
            ans *= k-1;
        }

        out.print(ans);
    }

    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }

    int ni() throws IOException {
        return Integer.parseInt(ns());
    }

    long nl() throws IOException {
        return Long.parseLong(ns());
    }

    double nd() throws IOException {
        return Double.parseDouble(ns());
    }

    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }

    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }

    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}


Measured memory_bytes: 8276
import re
A,b = map(int,input().split())
S = input()
ok = True
for i in range(len(S)):
    if i == A:
        if S[i] == "-":
            pass
        else:
            ok = False 
    else:
        if re.match("\d",S[i]):
            pass
        else:
            ok = False
if ok:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
#define optimizar_io ios_base::sync_with_stdio(false);cin.tie(0);

int main() {
	optimizar_io
	string s;
	int n, r = 0, w = 0;

	cin >> n >> s;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'R') r++;
		else w++;
	}
	int cnt = 0;
	for (int i = 0; i < r; i++) {
		if (s[i] == 'W')
			cnt++;
	}
	cout << min({cnt, r, w}) << "\n";
	return 0;
}

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

#define lint long long
#define P pair<int, int>
#define LLP pair<long long, long long>
#define REP(i, x, n) for(int i = (x), i##_len = (int)(n) ; i < i##_len ; ++i)
#define rep(i, n) for(int i = 0, i##_len = (int)(n) ; i < i##_len ; ++i)
#define reps(i, n) for(int i = 1, i##_len = (int)(n) ; i <= i##_len ; ++i)
#define rrep(i, n) for(int i = (int)(n) - 1 ; i >= 0 ; --i)
#define rreps(i, n) for(int i = (int)(n) ; i > 0 ; --i)
#define SORT(x) sort((x).begin(), (x).end())
#define SORT_INV(x) sort((x).rbegin(), (x).rend())

const int IINF = (1 << 30) - 1;
const long long LLINF = 1LL << 61;
const long long MOD = 1000000007LL;
const int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};
const double EPS = 1e-8;

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

    int n;
    cin >> n;

    int a = 0, b = 0, ab = 0, ans = 0;

    vector<string> s(n);
    rep(i, n){
        cin >> s[i];
        if(s[i].front() == 'B' && s[i].back() == 'A'){
            ++ab;
        }else if(s[i].front() == 'B'){
            ++b;
        }else if(s[i].back() == 'A'){
            ++a;
        }
        REP(j, 1, s[i].size()){
            if(s[i][j - 1] == 'A' && s[i][j] == 'B'){
                ++ans;
            }
        }
    }

    ans += max(ab - 1, 0);
    if(ab > 0){
        if(b > 0){
            ++ans;
            --b;
        }
        if(a > 0){
            ++ans;
            --a;
        }
    }

    ans += min(a, b);

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 768
n, k = map(int, input().split())
ans = [0]*n

for i in range(k):
  d = input()
  A =  list(map(int, input().split()))
  for a in A:
    ans[a-1] += 1
    
li = list()
for i, num in enumerate(ans):
  if num == 0:
    li.append(i)
    
print(len(li))


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

int main() {
  int n;
  cin >> n;
  
  char s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == 'Y') {
      cout << "Four" << endl;
      return 0;
    }
  }
  cout << "Three" << endl;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define eps 1e-3
#define pi acos(-1.0)
#define inf 0x3f
#define _inf 0xcf
#define INF 0x3f3f3f3f
#define _INF 0xcfcfcfcf
#define pb push_back
#define debug1 cout << "&&";
#define debug2 cout << "**";
#define ms(a, x) memset(a, x, sizeof(a))
#define IO ios::sync_with_stdio(false), cin.tie(0);
#define rep(i, a, b) for (int i = (int)a; i <= (int)b; ++i)
#define per(i, a, b) for (int i = (int)a; i >= (int)b; --i)
using namespace std;
typedef double db;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, int> pli;
typedef pair<long long, long long> pll;
mt19937_64 mrand(random_device{}());
const int mod = 1e9 + 7;
const int N = 50 + 10;
const int M = 1e6 + 10;
inline int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
inline ll Pow(ll a, ll b) {
    ll ans = 1;
    for (; b; b >>= 1) {
        if (b & 1) ans = ans * a % mod;
        a = a * a % mod;
    }
    return ans;
}
inline ll Mul(ll a, ll b) {
    ll lf = a * (b >> 25ll) % mod * (1LL << 25) % mod;
    ll rg = a * (b & ((1ll << 25) - 1)) % mod;
    return (lf + rg) % mod;
}
inline ll C(ll y, ll x) {
    ll ans = 1;
    if (y < 0 || x < 0 || y < x) return 0;
    y %= mod;
    if (!y || !x) return 1;
    rep(i, 0, x - 1) ans = ans * (y - i) % mod;
    rep(i, 1, x) ans = ans * Pow(i, mod - 2) % mod;
    return ans;
}
/*====================================================*/

ll n, k, ans;

struct mat {
   ll a[N][N];
   mat() { ms(a, 0); }
   inline mat operator * (const mat &b) const {
      mat res;
      rep(i, 1, n) rep(k, 1, n) {
         ll tmp = a[i][k];
         rep(j, 1, n) {
            res.a[i][j] = (res.a[i][j] + (tmp * b.a[k][j]) % mod) % mod;
         }
      }
      return res;
   }

   inline mat operator ^ (ll b) const {
      mat res, bas;
      rep(i, 1, n) res.a[i][i] = 1;
      rep(i, 1, n) rep(j, 1, n) bas.a[i][j] = a[i][j];
      for(; b; b >>= 1) {
         if(b & 1) res = res * bas;
         bas = bas * bas;
      }
      return res;
   }
}p;

int main() {
   IO
   cin >> n >> k;
   rep(i, 1, n) rep(j, 1, n) {
      cin >> p.a[i][j];
   }
   mat res = p^(k);
   rep(i, 1, n) rep(j, 1, n) {
      ans = (ans + res.a[i][j]) % mod;
   }
   cout << ans << endl;
   return 0;
}

/*

*/

Measured memory_bytes: 3688
import java.util.*;

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

  int n;
  String[] book = new String[] {"pon", "pon", "hon", "bon", "hon", "hon", "pon", "hon", "pon", "hon"};
  String ans;

  public Main() {
    Scanner sc = new Scanner(System.in);
    try {
      n = sc.nextInt();
    } finally {
      sc.close();
    }
  }
  
  void solve() {
    ans = book[n % 10];
  }

  void show() {
    System.out.println(ans);
  }
}


Measured memory_bytes: 35744