akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    ll X;
    cin >> X;
    repi2(i, 1, 1000) {
        ll temp = i * 100;
        if(temp > X) break;
        if(X % temp <= (5 * i)) {
            cout << 1 << endl;
            return 0;
        }
    }
    cout << 0 << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
vector<int> A;
map<int,int> M;
int main() {
    int N, K, Q; cin >> N >> K >> Q;

    for(int i = 1; i <= N; i++) {
        A.emplace_back(i);
    }

    for(int i = 0; i < Q; i++) {
        int T; cin >> T;
        M[T]++;
    }

    for(int i = 1; i <= N; i++) {
        if(K-Q+M[i] > 0) cout << "Yes\n";
        else cout << "No\n";
    }
    return 0;
}


Measured memory_bytes: 5752
n = int(input())
mon = list(map(int, input().split()))
bra = list(map(int, input().split()))

sup = 0
total = 0
for i in range(n):
    spec = bra[i]+sup
    if mon[i]>spec:
        total += spec
        sup = 0
    else:
        total += mon[i]
        if sup>=mon[i]:
            sup = bra[i]
        else:
            sup = spec - mon[i]

if (sup>mon[n]):
    total += mon[n]
else:
    total += sup

print(total)

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

int main(){
  int R;
  cin>>R;
  if(R<1200){
    cout<<"ABC"<<endl;
  }
  else if(R>=1200 && R<2800){
    cout<<"ARC"<<endl;
  }
  else{
    cout<<"AGC"<<endl;
  }
}

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

int main()
{
  ll n,m;
  cin>>n>>m;
  char a[n][m];
  ll dp[n][m];
  
  for(int i=0;i<n;i++)
  {
  	for(int j=0;j<m;j++)
  	{
  		cin>>a[i][j];
	}
  }
  dp[0][0]=1;

  for(int i=0;i<n;i++)
  {
  	for(int j=0;j<m;j++)
  	{
  		if(a[i][j]=='.')
  		{
  			if(i-1 >=0 && j-1>=0)
  				dp[i][j]=(dp[i-1][j]+dp[i][j-1])%1000000007;
  			else if(i-1 >=0 )
  				dp[i][j]=dp[i-1][j]%1000000007;
  			else if(j-1>=0)
  				dp[i][j]=dp[i][j-1]%1000000007;
		}else
			dp[i][j]=0;
  		
	}
  }

  cout<<dp[n-1][m-1]%1000000007<<endl;
  
  return 0;
}
  

Measured memory_bytes: 9088
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;

int W,H,N;
vector<int>X,Y;
int x1[1024],y1[1024],x2[1024],y2[1024];
int unzipX[2048],unzipY[2048];
map<int, int>zipX,zipY;
int g[2048][2048], vis[2048][2048];
int dy[]={0,-1,0,1},dx[]={-1,0,1,0};

int compress(vector<int>&crd, int unzip[2048], map<int,int> &zip){
  sort(crd.begin(), crd.end());
  crd.erase(unique(crd.begin(), crd.end()), crd.end());
  for(int i=0;i<crd.size();i++){
    zip[crd[i]] = i;
    unzip[i] = crd[i];
  }
  return crd.size();
}

int dfs(int y, int x){
  if(vis[y][x]) return 0;
  vis[y][x] = 1;
  for(int d=0;d<4;d++){
    int ny=y+dy[d],nx=x+dx[d];
    if(ny<0||ny>=H||nx<0||nx>=W||g[ny][nx]) continue;
    dfs(ny, nx);
  }
  return 0;
}

int main(){
  while(scanf("%d%d",&W,&H) && W||H){
    scanf("%d", &N);
    X.clear(); Y.clear(); zipX.clear(); zipY.clear();
    X.push_back(0); Y.push_back(0);
    for(int i=0;i<N;i++){
      scanf("%d%d%d%d",&x1[i],&y1[i],&x2[i],&y2[i]);
      X.push_back(x1[i]); X.push_back(x2[i]);
      Y.push_back(y1[i]); Y.push_back(y2[i]);
    }
    X.push_back(W); Y.push_back(H);
    W = compress(X, unzipX, zipX)-1;
    H = compress(Y, unzipY, zipY)-1;
    memset(g, 0, sizeof g);
    for(int i=0;i<N;i++){
      for(int y=zipY[y1[i]];y<zipY[y2[i]];y++) 
	for(int x=zipX[x1[i]];x<zipX[x2[i]];x++) g[y][x] = 1;
    }
    int res = 0;
    memset(vis, 0,sizeof vis);
    for(int y=0;y<H;y++) for(int x=0;x<W;x++){
	if(g[y][x] || vis[y][x]) continue;
	dfs(y, x);
	res++;
      }
    /*    for(int y=0;y<H;y++){
      for(int x=0;x<W;x++) printf("%d", g[y][x]);
      puts("");
      }*/
    printf("%d\n", res);
  }
  return 0;
}

Measured memory_bytes: 36908
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll,vector<ll>,greater<ll>> SMALLPQ;
using vi=vector<ll>;
using vvi=vector<vector<ll>>;
using vc=vector<char>;
using vvc=vector<vector<char>>;
ll inf=1000000000000007;
const int mod=1000000007;
void chmin(auto &a,auto b){if(b<a)a=b;}
void chmax(auto &a,auto b){if(a<b)a=b;}
int main(){
  int m,k;cin>>m>>k;
  vi v((1<<m)*2);
  if(k>=(1<<m)){
    cout<<-1<<endl;
    return 0;
  }
  if(m==1){
    if(k>0)cout<<-1<<endl;
    else{
      cout<<0<<' '<<0<<' '<<1<<' '<<1<<endl;
    }
    return 0;
  }
  int p=(1<<m)-1;
  v.at(0)=k;
  int l=1;
  for(int p=(1<<m)-1;p>=0;p--){
    if(p==k)continue;
    v.at(l)=p;
    l++;
  }
  v.at(l)=k;
  l++;
  rep(p,1<<m){
    if(p==k)continue;
    v.at(l)=p;
    l++;
  }
  rep(i,v.size()){
    if(i)cout<<' ';
    cout<<v.at(i);
  }
  cout<<endl;
}


Measured memory_bytes: 3840
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String n = scan.nextLine();
        while(scan.hasNext()) {
            n = n + scan.nextLine();
        }
            System.out.println("a : " + counter('a', n));
            System.out.println("b : " + counter('b', n));
            System.out.println("c : " + counter('c', n));
            System.out.println("d : " + counter('d', n));
            System.out.println("e : " + counter('e', n));
            System.out.println("f : " + counter('f', n));
            System.out.println("g : " + counter('g', n));
            System.out.println("h : " + counter('h', n));
            System.out.println("i : " + counter('i', n));
            System.out.println("j : " + counter('j', n));
            System.out.println("k : " + counter('k', n));
            System.out.println("l : " + counter('l', n));
            System.out.println("m : " + counter('m', n));
            System.out.println("n : " + counter('n', n));
            System.out.println("o : " + counter('o', n));
            System.out.println("p : " + counter('p', n));
            System.out.println("q : " + counter('q', n));
            System.out.println("r : " + counter('r', n));
            System.out.println("s : " + counter('s', n));
            System.out.println("t : " + counter('t', n));
            System.out.println("u : " + counter('u', n));
            System.out.println("v : " + counter('v', n));
            System.out.println("w : " + counter('w', n));
            System.out.println("x : " + counter('x', n));
            System.out.println("y : " + counter('y', n));
            System.out.println("z : " + counter('z', n));
    }
    public static int counter(char c, String line){
        int sum = 0;
        for(int x = 0; x < line.length();x++){
            if(c == line.charAt(x)){
                sum++;
            }
            else if(Character.toUpperCase(c) == line.charAt(x)){
                sum++;
            }
        }
        return sum;
    }
}


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

int main()
{
    int n;
    cin >> n;
    int a[3]{0};
    bool b[3]{0};
    int m;
    cin >> m;
    for(int i = 0; i < m; i++){
        int s, c;
        cin >> s >> c;
        s--;
        if(b[s] && a[s] != c){
            cout << -1 << endl;
            return 0;
        }
        a[s] = c;
        b[s] = true;
    }
    if(n == 1){
        cout << a[0] << endl;
    }
    else if(a[0] == 0){
        if(b[0]){
            cout << -1 << endl;
        }
        else{
            a[0] = 1;
            for(int i = 0; i < n; i++) cout << a[i];
            cout << endl;
        }
    }
    else{
        for(int i = 0; i < n; i++) cout << a[i];
        cout << endl;
    }
}

Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <algorithm>
using namespace std;
#define pb push_back
typedef long long ll;
int main()
{
	ll n,m,k;
	scanf("%lld %lld %lld",&n,&m,&k);
	vector<ll>x,y,x2,y2;
	for(int i=0;i<k;i++){ ll xx,yy;scanf("%lld %lld",&xx,&yy);x.pb(xx);y.pb(yy);x2.pb(xx);y2.pb(yy);};
	sort(x.begin(),x.end()); sort(y.begin(),y.end());
	ll xi,yi; long long ret=1e15;
	for(int i=k-1;i<=k;i++)for(int j=k-1;j<=k;j++)
	{
		ll v=x[i/2]; ll w=y[j/2]; ll res=0,re=0;
		for(int a=0;a<k;a++){re=max(re,(ll)(abs(x2[a]-v)+abs(y2[a]-w))); res+=(ll)(abs(x2[a]-v)+abs(y2[a]-w))*2ll;}
		if(ret>res-re){ ret=min(ret,res-re); xi=v; yi=w;}
	}
	printf("%lld\n%lld %lld\n",ret,xi,yi);
}

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

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    
    if(a<=c&&c<=b) cout << "Yes";
    else cout << "No";
}


Measured memory_bytes: 256
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
 
int main()
{
    int a[101][101], b[101], c[101];
    int i, j;
    int n, m;
 
    scanf("%d%d", &n, &m);
    for (i = 0; i < n; i++) {
        for (j = 0; j < m; j++) scanf("%d", &a[i][j]);
    }
    for (j = 0; j < m; j++) scanf("%d", &b[j]);
 
    for (i = 0; i < n; i++) {
        c[i] = 0;
        for (j = 0; j < m; j++) c[i] += a[i][j] * b[j];
    }
 
    for (i = 0; i < n; i++) {
        printf("%d\n", c[i]);
    }
    return 0;
}


Measured memory_bytes: 2144
unittest
{
	assert( [ "3", "1 -1 2" ].parse.expand.solve == "4\n-1 1\n2 -2" );
	assert( [ "3", "1 1 1" ].parse.expand.solve == "1\n1 1\n1 0" );
	
	assert( [ "5", "-2 -1 0 1 2" ].parse.expand.solve == "6\n-2 1\n2 -3\n5 -1\n6 0" );		// 追加ケース
	assert( [ "3", "-1 -1 -1" ].parse.expand.solve == "1\n-1 -1\n0 -1" );		// 追加ケース
	assert( [ "3", "-3 -2 -1" ].parse.expand.solve == "4\n-1 -3\n2 -2" );		// 追加ケース
}



import std.algorithm;
import std.conv;
import std.format;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	input.popFront;
	auto as = input.front.split.to!( long[] );
	return tuple( as );
}

auto solve( long[] as )
{
	as.sort();
	auto anss = new string[ as.length - 1 ];
	auto ansi = 0L;
	auto ansm = as.back;
	as.popBack;
	
	// 一番大きい値以外のプラス値を一番小さい値に突っ込む
	while( !as.empty && 0 < as.back )
	{
		anss[ ansi ] = format( "%s %s", as.front, as.back );
		ansi++;
		as.front -= as.back;
		as.popBack;
	}
	
	// マイナス値を一番大きい値に突っ込む
	while( !as.empty )
	{
		anss[ ansi ] = format( "%s %s", ansm, as.front );
		ansi++;
		ansm -= as.front;
		as.popFront;
	}
	
	return format( "%s\n%s", ansm, anss.join( "\n" ) );
}


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

# define Rep(i,a,b) for(int i=a;i<=b;i++)
# define _Rep(i,a,b) for(int i=a;i>=b;i--)
# define RepG(i,u) for(int i=head[u];~i;i=e[i].next)

typedef long long ll;

const int N=1e5+5;

template<typename T> void read(T &x){
   x=0;int f=1;
   char c=getchar();
   for(;!isdigit(c);c=getchar())if(c=='-')f=-1;
   for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+c-'0';
    x*=f;
}

# define int long long

int n;
int f[N];

signed main()
{
    read(n);
    Rep(i,1,n){
        if(i*i>n)break;
        Rep(j,1,n){
            if(i*i+j*j>n)break;
            Rep(k,1,n){
                int val=i*i+j*j+k*k+i*j+i*k+j*k;
                if(val>n)break;
                f[val]++;
            }
        }
    }
    Rep(i,1,n)printf("%lld\n",f[i]);
    return 0;
}

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

int main(){
  long long H;
  cin >> H;
  bitset<64> HP(H);
  int top;
  for(int i=63;;i--){
    if(HP.test(i)){
      top=i;
      break;
    }
  }
  HP.set();
  long long ans = (HP>>(63-top)).to_ullong();
  cout << ans << endl;
}


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

class Procon
{
    public Procon() { }
    static void Main(string[] agrs)
    {
        new Procon().Do();
    }

    Scanner cin;

    public void Do()
    {
        cin = new Scanner();
        string S = cin.nextString();
        int min = 1000;
        for (int i = 0; i < S.Length - 2; i++)
        {
            int tmp = 0;
            tmp += (S[i] - '0') * 100;
            tmp += (S[i + 1] - '0') * 10;
            tmp += S[i + 2] - '0';
            min = Math.Min(min, Math.Abs(tmp - 753));
        }

        Console.WriteLine(min);
    }
}

class Scanner
{
    string[] s;
    int i;
    int max_i;

    public Scanner()
    {
        s = new string[0];
        max_i = 0;
        i = 0;
    }

    public string nextString()
    {
        if (i >= s.Length)
        {
            s = Console.ReadLine().Split(' ');
            max_i = s.Length;
            i = 0;
            if (max_i == 0)
            {
                return "";
            }
            return s[i++];
        }
        else
        {
            return s[i++];
        }
    }

    public int nextInt()
    {
        return int.Parse(nextString());
    }


    public long nextLong()
    {
        return long.Parse(nextString());
    }

    public double nextDouble()
    {
        return double.Parse(nextString());
    }

    public string[] arrayString()
    {
        return Console.ReadLine().Split(' ');
    }

    public int[] arrayInt()
    {
        string[] str = Console.ReadLine().Split(' ');
        int[] array = new int[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = int.Parse(str[i]);
        }
        return array;
    }

    public long[] arrayLong()
    {
        string[] str = Console.ReadLine().Split(' ');
        long[] array = new long[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = long.Parse(str[i]);
        }
        return array;
    }

    public double[] arrayDouble()
    {
        string[] str = Console.ReadLine().Split(' ');
        double[] array = new double[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = double.Parse(str[i]);
        }
        return array;
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
//#define MOD (998244353)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
//ifstream cinn("input.txt");ofstream coutt("output.txt");

signed main(){
    FASTER;
    map<string,int> mp;
    int n;cin>>n;
    for(int i=0;i<n;i++){
        string s;cin>>s;
        mp[s]++;
    }
    int mx=-1;
    for(auto i:mp){
        mx=max(i.second,mx);
    }
    vector<string> v;
    for(auto o:mp){
        if(o.second==mx){
            v.push_back(o.first);
        }
    }
    sort(all(v));
    for(string s:v){
        cout<<s<<"\n";
    }
    
}



Measured memory_bytes: 25584
#include<bits/stdc++.h>
using namespace std;
#define REP(i,st,ed) for(register int i=st,i##end=ed;i<=i##end;++i)
#define DREP(i,st,ed) for(register int i=st,i##end=ed;i>=i##end;--i)
typedef long long ll;
inline int read(){
	int x;
	char c;
	int f=1;
	while((c=getchar())!='-' && (c<'0' || c>'9'));
	if(c=='-') c=getchar(),f=-1;
	x=c^'0';
	while((c=getchar())>='0' && c<='9') x=(x<<1)+(x<<3)+(c^'0');
	return x*f;
}
inline ll readll(){
	ll x;
	char c;
	ll f=1;
	while((c=getchar())!='-' && (c<'0' || c>'9'));
	if(c=='-') c=getchar(),f=-1;
	x=c^'0';
	while((c=getchar())>='0' && c<='9') x=(x<<1ll)+(x<<3ll)+(c^'0');
	return x*f;
}
const int maxn=1000+10,maxm=2000000+10;
vector<int> G[maxn];
struct point{
	int x,y;
}a[maxm];
int d[maxn][maxn],vis[maxn];
void dfs(int s,int x,int u){
	if(s==x || d[s][x]>=2 || vis[x]==u) return;
	d[s][x]++;
	if(d[s][x]==1) vis[x]=u;
	REP(i,0,G[x].size()-1) dfs(s,G[x][i],u);
}
int main(){
	int n=read(),m=read();
	REP(i,1,m){
		a[i].x=read(),a[i].y=read();
		G[a[i].x].push_back(a[i].y);
	}
	REP(i,1,n){
		memset(vis,-1,sizeof(vis));
		REP(j,0,G[i].size()-1) dfs(i,G[i][j],G[i][j]);
	}
	REP(i,1,m)
		if((d[a[i].x][a[i].y]>=2)^(d[a[i].y][a[i].x]>=1)) printf("diff\n");
		else printf("same\n");
	return 0;
}


Measured memory_bytes: 8832
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll inf=1000000000000000000;
double pi=2*acos(0);
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define rrep(i,n,m) for(ll i=n;i>=m;i--)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
int main(){
    ios::sync_with_stdio(false);cin.tie(0);
    ll n;cin>>n;
    ll d[n];rep(i,0,n)cin>>d[i];
    ll ans=0;
    rep(i,0,n-1){
        rep(j,i+1,n){
            ans+=d[i]*d[j];
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		int C = 0;
		Scanner in = new Scanner(System.in);
		//??°???S?????????
		int n = in.nextInt();
		int[] S = new int[n];
		for(int i = 0;i<n;i++) S[i] = in.nextInt();
		//??°???T?????????
		int q = in.nextInt();
		int[] T = new int[q];
		for(int i = 0;i<q;i++) T[i] = in.nextInt();
		
	
		for(int i = 0;i<q;i++){
			int searchkey = T[i];
			int lowerBound = 0;
			int upperBound = n-1;
			int curIn;
			while(true){
				curIn = (lowerBound+upperBound)/2;
				if(S[curIn] == searchkey) {
					C++;
					break;
				}else if(lowerBound>upperBound) break;
				else{
					if(S[curIn]<searchkey)
						lowerBound = curIn +1;
					else
						upperBound = curIn -1;
				}
				
			}
		}
		System.out.println(C);
	}
}

Measured memory_bytes: 76940
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define endl "\n"
#define pb push_back
#define f(i,n) for(i=0;i<n;i++)
#define F(i,a,b) for(i=a;a<=b;i++)
#define arr(a,n) for( i=0;i<n;i++)cin>>a[i];
#define fi first
#define se second
#define mp make_pair
#define mod 1000000007
#define YES cout<<"YES"<<endl;
#define Yes cout<<"Yes"<<endl;
#define NO cout<<"NO"<<endl;
#define No cout<<"No"<<endl;
#define yes cout<<"yes"<<endl;
#define no cout<<"no"<<endl;
#define vi vector<ll>
#define ed end()
#define bg begin()
#define sz size()
#define ln length()
#define s() sort(a,a+n);
#define sr() sort(a,a+n,greater<ll>());
#define v()  sort(v.begin(),v.end());
#define vr() sort(v.begin(),v.end(),greater<ll>());
#define mod 1000000007
#define fast() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll power(ll x,ll y,ll p){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
int main() {

fast();

{int n=700;
  string s;
  cin>>s;
  if(s[0]=='o')
  {
    n+=100;
  }
  if(s[1]=='o')
  {
    n+=100;
  }
  if(s[2]=='o')
  {
    n+=100;
  }
cout<<n<<endl;
}
return 0;
}


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

#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//以降 cin の入力元が 'input.txt' になる
//std::ifstream in("input.txt");
//std::cin.rdbuf(in.rdbuf());

ll dp[55][5000];
signed main()
{
    gearup;
    int n,a; cin >> n >> a;
    vl x(n);
    rep(i,n)cin>>x[i],x[i] -= a;
    dp[0][2500] = 1;
    rep(i,n){
        for(int j=0;j<5000;j++){
            dp[i+1][j] += dp[i][j];
            dp[i+1][j+x[i]] += dp[i][j];
        }
    }
    ll res = 0;
    out(dp[n][2500] - 1); //何も選ばないを引く
}

Measured memory_bytes: 5596
#include <bits/stdc++.h>
using namespace std;
int a[200000];
int b[200000];

int main(){
	ios::sync_with_stdio(0);
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> a[i];
		b[i] = a[i];
	}
	sort(b , b + n);
	for (int i = 0; i < n; i++){
		if (b[n - 1] == a[i]){
			cout << b[n - 2] << "\n";
		}
		else{
			cout << b[n - 1] << "\n";
		}
	}
	return 0;
}

Measured memory_bytes: 3200
import java.util.*;
import java.io.*;
import static java.lang.System.in;

public class Main {
    static int[] id;
    static long[] size;
    static int[][] edge;
    static long toSubtract;
    public static void main(String[] args)throws IOException {
        //BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), m = sc.nextInt();
        toSubtract = n;
        id = new int[n+1];
        edge = new int[m][];
        for(int i=0;i<m;i++){
            edge[i] = new int[]{sc.nextInt(),sc.nextInt()};
        }
        id = new int[n+1]; size = new long[n+1];
        for(int i=0;i<=n;i++) id[i]=i;
        Arrays.fill(size,1);
        long base = ((long)n)*((long)n);
        ArrayList<Long> res = new ArrayList<>();
        res.add((base-toSubtract)/2);
        PrintWriter out = new PrintWriter(System.out);
        for(int j=m-1;j>=1;j--){
            union(edge[j][0],edge[j][1]);
            res.add((base-toSubtract)/2);
        }
        for(int i=res.size()-1;i>=0;i--) out.println(res.get(i));
        out.flush();
    }
    static int find(int p){
        while(p!=id[p]){
            id[p] = id[id[p]];
            p = id[p];
        }
        return p;
    }
    static void union(int p, int q){
        int i=find(p), j=find(q);
        if(i==j) return;
        id[j] = i;
        toSubtract -= size[i]*size[i]+size[j]*size[j];
        size[i] += size[j];
        toSubtract += size[i]*size[i];
    }
}

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

#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T>
T gcd(T a, T b) { return ((a % b == 0) ? b : gcd(b, a % b)); }
template <typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr LL LINF = 334ll << 53;
constexpr int INF = 15 << 26;
constexpr LL MOD = 1E9 + 7;

namespace Problem {
using namespace std;

class Solver {
 public:
  int n;
  vector<double> x, y, dx, dy;
  Solver(LL n) : n(n), x(n), y(n), dx(n), dy(n){};

  void solve() {
    for (int i = 0; i < n; ++i) {
      char c;
      cin >> x[i] >> y[i] >> c;
      if (c == 'R') dx[i] = 1;
      if (c == 'L') dx[i] = -1;
      if (c == 'U') dy[i] = 1;
      if (c == 'D') dy[i] = -1;
    }
    double LB = 0;
    double UB = 1e9;
    auto xminmax = [&](double t) -> double {
      double xmin = LINF;
      double xmax = -LINF;
      for (int i = 0; i < n; ++i) {
        double xtmp = x[i] + dx[i] * t;
        xmin = min(xmin, xtmp);
        xmax = max(xmax, xtmp);
      }
      return xmax - xmin;
    };
    auto yminmax = [&](double t) -> double {
      double ymin = LINF;
      double ymax = -LINF;
      for (int i = 0; i < n; ++i) {
        double ytmp = y[i] + dy[i] * t;
        ymin = min(ymin, ytmp);
        ymax = max(ymax, ytmp);
      }
      return ymax - ymin;
    };
    auto area = [&](double t) -> double {
      double xmin = LINF;
      double xmax = -LINF;
      double ymin = LINF;
      double ymax = -LINF;
      for (int i = 0; i < n; ++i) {
        double xtmp = x[i] + dx[i] * t;
        xmin = min(xmin, xtmp);
        xmax = max(xmax, xtmp);
        double ytmp = y[i] + dy[i] * t;
        ymin = min(ymin, ytmp);
        ymax = max(ymax, ytmp);
      }
      return (xmax - xmin) * (ymax - ymin);
    };
    double t1 = ternary_search(LB, UB, xminmax);
    double t2 = ternary_search(LB, UB, yminmax);
    double ans = ternary_search(max(LB, min(t1, t2) - 10ll), min(UB, max(t1, t2) + 10ll), area);
    DBG(t1, t2, ans);
    cout << area(ans) << endl;
  }

  double ternary_search(double lb, double ub, function<double(double)> f) {
    for (int _ = 0; _ < 100; ++_) {
      vector<double> res(4);
      double m1 = lb + (ub - lb) / 3;
      double m2 = m1 + (ub - m1) / 2;
      res[0] = f(lb);
      res[1] = f(m1);
      res[2] = f(m2);
      res[3] = f(ub);
      int p = distance(res.begin(), min_element(res.begin(), res.end()));
      if (p == 0) {
        ub = m1;
      } else if (p == 1) {
        ub = m2;
      } else if (p == 2) {
        lb = m1;
      } else {
        lb = m2;
      }
    }
    return ub;
  }
};

}  // namespace Problem

int main() {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(false);
  std::cerr << std::fixed << std::setprecision(12);
  std::cout << std::fixed << std::setprecision(12);
  long long n = 0;
  std::cin >> n;

  Problem::Solver sol(n);
  sol.solve();
  return 0;
}


Measured memory_bytes: 3456
#[allow(unused_imports)]
use std::collections::HashSet;

//use std::collections::LinkedList;
use std::collections::VecDeque;

#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

type Idx = (usize, String, u32);

fn main() {
    let n = read::<usize>();
    let mut list: VecDeque<Idx> = VecDeque::new();

    for i in 1..n+1 {
        let sp = read_vec::<String>();
        let s = sp[0].to_string();
        let p_str = &sp[1];
        let p:u32 = p_str.parse().unwrap();
        let idx = (i, s, p);

        add_idx(&mut list, idx);

    }

    for x in &list {
        println!("{}", x.0);
    }
}

fn add_idx(list : &mut VecDeque<Idx>, idx:Idx) {
    let p = find_pos(list, &idx);
    list.insert(p, idx);
}

fn find_pos(list :&VecDeque<Idx>, x: &Idx) -> usize{
    if list.len() == 0 {
        return 0;
    }
    if !cond(&list[0], x) {
        return 0;
    }

    return binary_search(list, x, 0, list.len());
}

// [ o o o x x x] となっているときは2を返す。
// We do not care the case list[mid] == x
fn binary_search(list :&VecDeque<Idx>, x: &Idx, lb : usize, ub : usize) -> usize {
    while ub - lb > 1 {
        let mid = (lb + ub) / 2;
        let mut lb1 = lb;
        let mut ub1 = ub;
        if cond(&list[mid], x) {
            lb1 = mid;
        } else {
            ub1 = mid;
        }
        return binary_search(list, x, lb1, ub1);
    }
    return ub;
}

fn cond(x : &Idx, y : &Idx) -> bool {
    if x.1 < y.1 {
        return true;
    }
    if x.1 == y.1 && x.2 > y.2 {
        return true;
    }
    return false;
}

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

using namespace std;

#define endl '\n'

int main(){

  ios_base :: sync_with_stdio(false);
  cin.tie(NULL);

 
  int n;
  cin >> n;

  int dig = n%10;

  if(dig == 3)
    cout << "bon" << endl;
  else if(dig == 0 || dig == 1 || dig == 6 || dig == 8)
  cout << "pon" << endl;
  else
    cout << "hon" << endl;

  return 0;
}

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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using vec_b = vector<bool>;
using vec_str = vector<string>;

#define INF (1LL << 60)
#define MOD 1000000007

#define REP(i,m,n) for(ll (i)=(m),i##_len=(n);(i)<(i##_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define _PR(x) cout << (x) << endl
#define _PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define pb push_back
#define mp make_pair

int main()
{
    ll K;
    string S;
    cin >> K >> S;
    if(SZ(S) <= K) _PR(S);
    else {
        REP(i,0,K) cout << S[i];
        cout << "..." << endl;
    }

    return 0;
}

/*



*/

Measured memory_bytes: 3624
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = (a), _end_ = (b); i < _end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define mp make_pair
//#define x first
//#define y second
#define pb push_back
#define eb emplace_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

typedef long long LL;
const int MAX_N = 2e5 + 5;


int n, t;
int a[MAX_N];



int main()
{
#ifdef ANONYM
    freopen("data.in", "r", stdin);
    freopen("data.out", "w", stdout);
#endif

    ios::sync_with_stdio(false);
    cin >> n;
    int sta = (n-1)/2, op = -1;
    REP(i, 0, n) {
        cin >> t;
        sta += i*op;
        a[sta] = t;
        op = -op;
    }
    if(n%2 == 0) reverse(a, a+n);
    cout << a[0];
    REP(i, 1, n) {
        cout << ' ' << a[i];
    }
    cout << '\n';
    return 0;
}


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

// definition {{{ 1

// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)

#define Scll(x) scanf("%llu", &x)
#define Scll2(x,y) scanf("%llu%llu", &x, &y)
#define Scll3(x,y,z) scanf("%llu%llu%llu", &x, &y, &z)

#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2

// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2

// systems {{{ 2
#define Rep(x,y) for(int x = 0; x < y; x++)
#define Repe(x,y,z) for(int x = z; x < y; x++)
// }}} 2

// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n");
// }}} 2

// }}} 1

ll lcm( ll a, ll b ){
    if( a < b ) return lcm(b,a);

    ll tmp;
    ll mul = a*b;
    while( b%a ){
        tmp = a;
        a = b%a;
        b = tmp;
    }

    return mul/a;

}

int main() {

    ll a,b,c,d;

    Scll2(a,b);
    Scll2(c,d);

    ll cd = lcm(c,d);

    ll ansa = 0;
    a--;
    ansa = a/c + a/d;
    ansa -= a/cd;
    ll ansb = 0;
    ansb = b/c + b/d;
    ansb -= b/cd;

    ll ansab = ansb - ansa;

    printf ("%llu\n", b-a-ansab );

    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
const ll INF = 1e16;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)

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; }

void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}
//--------------------------------------------------------------------------------//

int main() {
    init();
    string s;
    cin >> s;
    ll n = s.size();
    if(n%2){
        cout << "No" << endl;
        return 0;
    }

    string t = "";
    rep(i, n / 2) t += "hi";

    cout << (s == t ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long int N,W;cin>>N>>W;
  long long int v[N],w[N];
  for(long long int i=0;i<N;i++)cin>>w[i]>>v[i];
  long long int dp[N+1][100001];
  dp[0][0]=0;
  for(long long int i=1;i<=100000;i++)dp[0][i]=W+1;
  for(long long int i=1;i<=N;i++){
    for(long long int j=0;j<=100000;j++){
      if(j<v[i-1])dp[i][j]=dp[i-1][j];
      else dp[i][j]=min(w[i-1]+dp[i-1][j-v[i-1]],dp[i-1][j]);
    }
  }
  long long int x=100000;
  while(W<dp[N][x])x--;
  cout<<x<<endl;
}

Measured memory_bytes: 79104
import math

def c(n, r):
    return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))

n = int(input())
d = dict()
for _ in range(n):
    s = "".join(sorted([c for c in input()]))
    d[s] = d.get(s, 0) + 1

ans = 0
for v in d.values():
    if v >= 2:
        ans += c(v, 2)
print(ans)

Measured memory_bytes: 22312
fun main(args: Array<String>) {
    val L = readLine()!!.split(' ').map(String::toInt)
    val A = L[0]
    val B = L[1]
    val C = L[2]
    val D = L[3]
    val E = L[4]
    val F = L[5]

    var mttl:Int = 0
    var msug: Int = 0
    for (ai in 0..30) {
        val a = 100 * A * ai
        if (a > F) {
            break
        }
        for (bi in 0..30) {
            val b = 100 * B * bi
            if (a + b > F) {
                break
            }
            for (ci in 0..100) {
                val c = C * ci
                if (a + b + c > F) {
                    break
                }
                for (di in 0..100) {
                    val d = D * di
                    if (a + b + c + d > F) {
                        break
                    }
                    if ((a + b) * E / 100 < c + d) {
                        break
                    }
                    val ttl = a + b + c + d
                    val sug = c + d
                    if (msug * ttl <= sug * mttl) {
                        mttl = ttl
                        msug = sug
                    }
                }
            }
        }
    }
    println("$mttl $msug")
}

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

int a[3][3];
int d[3][3];
 
int main() {  
  rep(i, 3) rep(j, 3) cin >> a[i][j];

  int n;
  cin >> n;

  rep(i, n) {
    int b;
    cin >> b;

    rep(i, 3) rep(j, 3) if (a[i][j] == b) d[i][j] = 1;
  }

  bool flag = false;

  rep(i, 3) {
    int count = 0;
    rep(j, 3) count += d[i][j];
    if (count == 3) flag = true;
  }

  rep(i, 3) {
    int count = 0;
    rep(j, 3) count += d[j][i];
    if (count == 3) flag = true;
  }
  
  { int count = 0;
    rep(i, 3) {
      count += d[i][i];
      if (count == 3) flag = true;
    }
  }
  
  { int count = 0;
    rep(i, 3) {
      count += d[i][2 - i];
      if (count == 3) flag = true;
    }
  }

  if (flag) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}


Measured memory_bytes: 256
/*
 * main.c
 *
 *  Created on: 2019/07/21
 *      Author: family
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int a[200001] = {0};

int main()
{
	int N = 0, i = 0, num = 1, ans = 0;
	scanf("%d", &N);
	for (i = 0; i < N; i++) {
		scanf("%d", &a[i]);
	}
	i = 0;
	while (i < N) {
		if (a[i] == num) {
			num++;
		} else {
			ans++;
		}
		i++;
	}
	if (num == 1) {
		ans = -1;
	}
	printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 896
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) {
		IO io = new IO();
		int[] a = new int[3];
		while(true) {
			Arrays.fill(a, 0);

			for(int i=0;i<6;i++) {
				a[i%3] += io.nextInt();
			}
			int mina = Integer.MAX_VALUE;
			for(int i=0;i<3;i++) {
				mina = Math.min(mina,a[i]);
			}
			if (a[0] + a[1] + a[2] == 0) {
				break;
			}
			int min = 0;
			int imax = Math.min(2,mina);
			for(int i=0;i<=imax;i++) {
				min = Math.max(min,(a[0]-i)/3+(a[1]-i)/3+(a[2]-i)/3+i);
			}
			io.println(min);
		}
		io.flush();
	}

}
class IO {
	BufferedReader bi = new BufferedReader(new InputStreamReader(System.in));
	StringBuilder out = new StringBuilder();
	int index = 0;
	String bfl = null;
	String[] bf = new String[0];
	private boolean read() {
		try {
			bfl = bi.readLine();
			if (bfl == null) {
				return false;
			}
			bf = bfl.split("\\s");
			index = 0;
		} catch (IOException e) {
			e.printStackTrace();
		}
		return true;
	}
	public boolean hasNext() { return index < bf.length ? true : read(); }
	public boolean hasNextLine() { return read(); }
	public String next() { return hasNext() ? bf[index++] : null; }
	public String nextLine() { if (hasNextLine()) {index = bf.length; return bfl; }else return null; }
	public int nextInt() { return Integer.parseInt(next()); }
	public long nextLong() { return Long.parseLong(next()); }
	public double nextDouble() { return Double.parseDouble(next()); };
	public char nextChar() { return next().charAt(0); }
	public void println(long x) { out.append(x); out.append("\n"); }
	public void println(double x) { out.append(x); out.append("\n"); }
	public void println(String s) { out.append(s); out.append("\n"); }
	public void println() { out.append("\n"); }
	public void print(long x) { out.append(x); }
	public void print(double x) { out.append(x); }
	public void print(String s) { out.append(s); }
	public void print(char c) {out.append(c);}
	public void flush() {System.out.print(out); out = new StringBuilder(); }
	public int[] arrayInt(int n) {
		int[] a = new int[n];
		for(int i=0;i<n;i++) {
			a[i] = nextInt();
		}
		return a;
	}
	public long[] arrayLong(int n) {
		long[] a = new long[n];
		for(int i=0;i<n;i++) {
			a[i] = nextLong();
		}
		return a;
	}
	public double[] arrayDouble(int n) {
		double[] a = new double[n];
		for(int i=0;i<n;i++) {
			a[i] = nextDouble();
		}
		return a;
	}
}

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

long int waza(long int a){
	if(a==1){
		return 1;
	}else{
		long int s = waza(a/2);
		return 2*s +1;
	}
}

int main(){
	long int n;
	cin >> n;
	cout << waza(n) << endl;
}

Measured memory_bytes: 256
#ifndef ___Class_Union_Find
#define ___Class_Union_Find
 
#include <vector>
#include <utility>
#include <algorithm>
 
using namespace std;
 
class Union_Find
{
private:
 
    vector<int> data;
 
public:
 
    Union_Find(unsigned size_) : data(size_, -1) { }
 
    void unite(int x, int y);
     
    bool same(int x, int y);
 
    int root(int x);
};
 
void Union_Find::unite(int x, int y)
{
    x = root(x);
    y = root(y);
 
    if (x != y)
    {
        if (data[x] < data[y])
        {
            swap(x, y);
        }
 
        data[x] += data[y];
        data[y] = x;
    }
}
 
bool Union_Find::same(int x, int y)
{
    return root(x) == root(y);
}
 
int Union_Find::root(int x)
{
    return data[x] < 0 ? x : data[x] = root(data[x]);
}
 
#endif // ___Class_Union_Find
 
 
// ------ main ------ //
 
#include <cstdio>
 
using namespace std;
 
int n, m, q, x, y;
 
int main()
{
    scanf("%d", &n);
    scanf("%d", &m);
 
    Union_Find u(n);
 
    for (int i = 0; i < m; i++)
    {
        scanf("%d", &x);
        scanf("%d", &y);
 
        u.unite(x, y);
    }
    
    scanf("%d", &q);
    
    for(int i = 0; i < q; i++)
    {
        scanf("%d", &x);
        scanf("%d", &y);
        
        printf("%s\n", u.same(x, y) ? "yes" : "no");
    }
 
    return 0;
}

Measured memory_bytes: 3404
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	int now; cin >> now;
	char ch;
	while (cin >> ch) {
		if (ch == '+') {
			int n; cin >> n;
			now += n;
		}
		else if (ch == '-') {
			int n; cin >> n;
			now -= n;
		}
		else if (ch == '*') {
			int n; cin >> n;
			now *= n;
		}
		else if (ch == '/') {
			int n; cin >> n;
			now /= n;
		}
		else {
			break;
		}

	}
	cout << now << endl;
	return 0;
}

Measured memory_bytes: 3096
#include <iostream>
using namespace std;
int main(){
    int dice1[6],dice2[6];
    int pos[6][6] = {{0,3,5,2,4,0},{4,0,1,6,0,3},{2,6,0,0,1,5},{5,1,0,0,6,2},{3,0,6,1,0,4},{0,4,2,5,3,0}};
    int a,b;
    for(int i=0;i<6;i++) cin>>dice1[i];
    for(int i=0;i<6;i++) cin>>dice2[i];
    bool flg=false;
    for(int j=0;j<6;j++){
        if(dice1[0]==dice2[j]){
            a=j;
            for(int k=0;k<6;k++){
                if(dice1[1]==dice2[k] && k!=a && pos[a][k]!=0){
                    b=k;
                    if(dice1[2]==dice2[pos[a][b]-1] && dice1[3]==dice2[5-(pos[5-a][5-b]-1)] && dice1[4]==dice2[5-b] && dice1[5]==dice2[5-a]) flg=true;
                }
                if(flg) break;
            }
        }
        if(flg) break;
    }
    if(flg) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    string S; cin >> S;
    int N = (int)(S.size());
    bool can = true;

    string T = S;
    string t = T;
    reverse(T.begin(),T.end());
    if (t!=T) can = false;

    string U = S.substr(0,(N-1)/2);
    string u = U;
    reverse(U.begin(),U.end());
    if (u!=U) can = false;

    string R = S.substr((N+3)/2-1);
    string r = R;
    reverse(R.begin(),R.end());
    if (r!=R) can = false;

    if (can) cout << "Yes" << endl;
    else cout << "No" << endl;
    // cout << S << " " <<  T << " "<< U << " " << R << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

#define MOD 10007

int N;
string S;
int dp[1010][8];

int f(int i) {
  char c = S[i];
  int ret = 1;
  if (c == 'O') ret = 2;
  if (c == 'I') ret = 4;
  return ret;
}

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

  for (int k=0; k<8; k++) {
    if ((k & 1) != 0 && (k & f(0)) != 0) dp[0][k] = 1;
  }
  for (int i=1; i<N; i++) {
    int g = f(i);
    for (int k=0; k<8; k++) {
      if ((k & g) == 0) continue;
      for (int s=0; s<8; s++) {
        if ((k & s) == 0) continue;
        dp[i][k] = (dp[i][k] + dp[i-1][s]) % MOD;
      }
    }
  }

  int ans = 0;
  for (int k=0; k<8; k++) {
    ans = (ans + dp[N-1][k]) % MOD;
  }
  cout << ans << "\n";
  return 0;
}

Measured memory_bytes: 3252
#include <stdio.h>
#include <string.h>
  
int main(void){
  char s[1001], order[8], ch[1001];
  int i, j, n, x, y;
  
  scanf("%s\n%d", s, &n);
  
  for(i=0;i<n;i++){
    scanf("%s %d %d", order, &x, &y);
      
    if(!strcmp(order, "reverse")){
      for(j=x;j<=y;j++)
        ch[y-j] = s[j];
      for(j=x;j<=y;j++)
        s[j] = ch[j-x];
    }
  
    if(!strcmp(order, "replace")){
      scanf("%s", ch);
      for(j=0;ch[j]!='\0';j++)
        s[x+j] = ch[j];
    }
  
    if(!strcmp(order, "print")){
      for(j=x;j<=y;j++)
        printf("%c", s[j]);
      printf("\n");
    }
  }
  
  return 0;
}


Measured memory_bytes: 2124
#include <iostream>
#include <bitset>
#include <string>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <deque>
#include <algorithm>
#include <random>
#include <iomanip>

using namespace std;

int main(int argc, char *argv[]) {
	long long int n;
	cin >> n;
	long long int res =  (1 + n) * n / 2;
	long long int nn = n / 3;
	res -= (1 + nn) * nn / 2 * 3;
	nn = n / 5;
	res -= (1 + nn) * nn / 2 * 5;
	nn = n / 15;
	res += (1 + nn) * nn / 2 * 15;
	cout << res << endl;
}


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


using namespace std;

int main() {

	int h,w;

	while (1) {
		cin >> h >> w;
		if (h == 0 && w == 0) { return 0; }
		else {
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					cout << "#";
				}
				cout << endl;
			}
			cout << endl;
		}
	}

}


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

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for(int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

vu64 S;
map<u64, u64> m;

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

    int N, K;
    u64 A;
    cin >> N >> K;

    S.resize(N + 1, 0);
    rep (i, N)
    {
        cin >> A;
        S[i + 1] = A + S[i];
    }

    rep (i, N + 1)
    {
        S[i] = (S[i] - i) % K;
    }

    u64 ans = 0;
    for (int j = 1; j <= N; ++j)
    {
        if (j - K >= 0) --m[S[j - K]];
        ++m[S[j - 1]];
        ans += m[S[j]];
    }

    cout << ans << "\n";
    return 0;
}



Measured memory_bytes: 14336
N, M=map(int, input().split())
mod = 1000000007
result = [0 for i in range(N+1)]
for j in range(M):
    a = int(input())
    result[a] = -1
result[0] = 1
result[1] = 1 if result[1] != -1 else 0
for i in range(2,N+1):
    if result[i] != -1:
        before1 = result[i-1] if result[i-1] != -1 else 0
        before2 = result[i-2] if result[i-2] != -1 else 0
        result[i] = (before1 + before2) % mod
print(result[-1])

Measured memory_bytes: 7064