akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;
 
int p[201010];
int q[201010];
int c[201010];
 
map<pair<int,int>,pair<int,int> > par;
 
void uf_init(pair<int,int> a){par[a]=a;}
 
pair<int,int> uf_find(pair<int,int> a){
	if(par[a]==a)return a;
	return par[a]=uf_find(par[a]);
}
 
void uf_union(pair<int,int> a,pair<int,int> b){
	a=uf_find(a);b=uf_find(b);
	if(a==b)return;
	par[a]=b;
}
 
map<pair<int,int>,vector<pair<int,int> > > adj;
 
main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;i++){
		scanf("%d%d%d",&p[i],&q[i],&c[i]);p[i]--;q[i]--;
	}
	
	for(int i=0;i<m;i++){
		uf_init(make_pair(p[i],c[i]));
		uf_init(make_pair(q[i],c[i]));
	}
	for(int i=0;i<m;i++){
		uf_union(make_pair(p[i],c[i]),make_pair(q[i],c[i]));
	}
	
	for(int i=0;i<m;i++){
		pair<int,int> oya=uf_find(make_pair(p[i],c[i]));
		pair<int,int> pp=make_pair(p[i],-1);
		pair<int,int> qq=make_pair(q[i],-1);
		
		adj[oya].push_back(pp);adj[pp].push_back(oya);
		adj[oya].push_back(qq);adj[qq].push_back(oya);
		//printf("(%d %d)--(%d %d)\n",oya.first,oya.second,pp.first,pp.second);
		//printf("(%d %d)--(%d %d)\n",oya.first,oya.second,qq.first,qq.second);
	}
	
	queue<pair<int,int> > que;
	map<pair<int,int>,int> cost;
	cost[make_pair(0,-1)]=0;
	que.push(make_pair(0,-1));
	for(;!que.empty();){
		pair<int,int> now=que.front();
		que.pop();
		int c=cost[now];
		
		if(now==make_pair(n-1,-1)){
			printf("%d\n",c/2);
			return 0;
		}
		
		if(adj.count(now)>0){
			int s=adj[now].size();
			for(int i=0;i<s;i++){
				pair<int,int> next=adj[now][i];
				if(cost.count(next)==0 || cost[next]>c+1){
					cost[next]=c+1;
					que.push(next);
				}
			}
		}
	}
	puts("-1");
	return 0;
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int A,B,C;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>A>>B>>C;
	if(C>=A && C<=B) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}


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

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

typedef long long ll;
const ll MOD = 1e9 + 7;

int main() {
  int X;
  std::cin >> X;

  std::vector<bool> dp(X + 1);
  dp[0] = true;

  for(int i = 100; i <= X; ++i) {
    for(int j = 0; j <= 5; ++j) {
      if(i - (100 +j) >= 0) {
        dp[i] = dp[i] || dp[i - (100 + j)];
      }
    }
  }

  std::cout << (dp[X] ? 1 : 0) << '\n';
}


Measured memory_bytes: 256
def cn(s):
    return ord(s)-ord("a")
s  = input()
t  = input()
alp = "abcdefghijklmnopqrstuvwxyz"
arr = [-1]*26
arrt = [-1]*26
f =True
for i in range(len(s)):
    if arr[cn(s[i])] ==-1:
        arr[cn(s[i])] = cn(t[i])
    elif arr[cn(s[i])] != cn(t[i]):
        f=False
        break
for i in range(len(s)):
    if arrt[cn(t[i])] ==-1:
        arrt[cn(t[i])] = cn(s[i])
    elif arrt[cn(t[i])] != cn(s[i]):
        f=False
        break

print("Yes") if f else print("No")


Measured memory_bytes: 3632
#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define lli long long int
#define ulli unsigned long long int
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define pf pop_front()
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define loopl(i,a,b) for(lli i=a;i<b;i++) 
#define loop(i,a,b) for(int i=a;i<b;i++)
#define mod 1000000007
#define inf 1000000000000000
#define lld long double
#define pll pair<long long int,long long int>
#define vll vector<lli>
#define stp setprecision(15)
#define eps 0.000001
#define endl '\n'
#define mod2 998244353
#define ll lli

using namespace std ;

#define N 200000+5 

typedef tree<lli,null_type,less<lli>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;

int main() 
{
/////////////////////////////////////
    
    fastio;
 
/////////////////////////////////////    

    lli x,a;
    cin>>x>>a;

    if(x<a) cout<<0;
    else cout<<10;

    
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n)  for (int i = 0; i < (int) (n); i++)
#define REP1(i, n) for (int i = 1; i <= (int) (n); i++)
#define all(x)     (x).begin(), (x).end()
#define SZ(x)      ((int) (x).size())
using ll = long long;

int main() {
  int n;
  cin >> n;
  set <string> se;
  REP(i, n) {
	string s;
	cin >> s;
	se.insert(s);
  }
  cout << SZ(se) << endl;
  return 0;
}


Measured memory_bytes: 19168
//コンテスト後に自力実装できた
//もうマジ無理死にたい
#include <bits/stdc++.h>

using namespace std;
using ll =long long;

#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cout << #x << " = " << (x) << endl;
void coY() {cout <<"Yes"<<endl;}
void coN(){cout <<"No"<<endl;}

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
const ll INF = 1LL << 60;

//Write From this Line
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
int Row , Colum ;
vector<string> field;
queue<pair<int,int>> q;
int main()
{
	//迷路、x座標とy座標をバグらせガチなので注意
	cin >>  Row >> Colum;
	field.resize(Row);//行数に合わせる

	rep(i,Row) cin >> field[i] ; //行数だけ入力を受け取る

	int ans = 0 ;
	for(int sy = 0 ; sy < Row ; sy++){
		for(int sx = 0 ; sx < Colum ; sx ++){
			//壁からは始められない！！
			//これがないとＷＡです
			if(field[sy][sx] == '#') continue;
			int Count[25][25];//bfsなので勝手に最小が取られるはず。
			rep(i,25)rep(j,25) Count[i][j] = 0 ;
			bool seen[25][25];//これで毎回falseで埋まるのかな？
			rep(i,25)rep(j,25) seen[i][j] = false;
			q.push(make_pair(sy,sx));
			seen[sy][sx] = true ;
			while(!q.empty()){
				auto point = q.front();
				q.pop();
				int ry =point.first;
				int rx = point.second;
				for(int dir = 0 ; dir < 4 ; dir++ ){
					int ny = ry + dy[dir];
					int nx = rx + dx[dir];
					if(ny < 0 || ny >= Row || nx < 0 || nx >= Colum) continue;
					if(field[ny][nx] == '#' ) continue;
					if(seen[ny][nx]) continue;
					q.push(make_pair(ny,nx));
					seen[ny][nx] = true; 
					Count[ny][nx] = Count[ry][rx] + 1;
					chmax(ans,Count[ny][nx]);
				}
			}
			//for(int y =0 ; y < Row ; y ++){
			//	for(int x = 0 ; x < Colum ; x ++){
			//		cout << Count[y][x] <<" " ;
			//	}
			//	cout << endl;
			//}
		}
	}
	printf("%d\n",ans); 
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <unordered_map>
#include <cmath>
#include <utility> // pair make_pair
#include <algorithm>
#include <functional>
#include <iomanip>
#include <climits> // LLONG_MAX, LLONG_MIN, INT_MIN, INT_MAX
#include <assert.h>

#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define ll long long
//#define int ll
#define INF INT_MAX/10

using namespace std;
using Pi = pair<int, int>;
using Graph = vector<vector<int> >;
using WeightGraph = vector<vector<Pi> >;

int Input[200100];

int main() {
  int N; cin >> N;
  auto comparator = [] (const Pi &l ,const Pi &r) {
                      if (l.second == r.second) {
                        return l.first < r.first;
                      } else {
                        return l.second > r.second;
                      }
                    };

  priority_queue<Pi, vector<Pi>, decltype(comparator)> PQ(comparator);

  for (int i = 0; i < N; i++) {
    int a, b; cin >> a >> b;
    PQ.push(Pi(a, b));
  }

  int now = 0;
  for (int i = 0; i < N; i++) {
    Pi x = PQ.top();
    PQ.pop();
    now += x.first;
    if (now > x.second) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 2420
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
#include <set>
#include <vector>

using namespace std;

int N,X;

int main(){
    scanf("%d %d", &N, &X);
    vector<int> m;
    int ans = 0;
    for (int i = 0; i < N; i++) {
        int m_i;
        scanf("%d", &m_i);
        m.push_back(m_i);
        //cout << m[i] << endl;
        X -= m[i];
        ans++;
    }
    //sort して小さい順から作れるだけつくる
    sort(m.begin(), m.end());
    while(true) {
        if ( X < m[0]) break;
        X -= m[0];
        ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
n,m=map(int,input().split())
boxs=[1]*n
TF=[1]+[0]*(n-1)
for i in range(m):
    a,b=map(int,input().split())
    if boxs[a-1]==0:
        continue
    else:
        boxs[a-1]-=1
        boxs[b-1]+=1
    if TF[a-1]==1 and boxs[a-1]==0:
        TF[a-1]=0
        TF[b-1]=1
    elif TF[a-1]==1:
        TF[b-1]=1
#print(boxs)
print(sum(TF))

Measured memory_bytes: 5364
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,n,s) for(int i = s; i < (n); ++i)
#define rsrep(i,n,s) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<x<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;

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

    ll ans = a - b;
    if (k%2 == 1) ans *= -1;

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

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

using namespace std;

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

int w, h;
int map[50][50];
int ans;

bool iswalkable(int ty,int tx){
	if(ty >= 0 && ty < h && tx >= 0 && tx < w) return true;
	return false;
}

void dfs(int y, int x){
	if(map[y][x] == 0) return;
	map[y][x] = 0;
	
	for(int vy = -1; vy <= 1; vy++){
		for(int vx = -1; vx <= 1; vx++){
			
			if(vy == 0 && vx == 0) continue;
			int ty = y + vy;
			int tx = x + vx;
			if(iswalkable(ty, tx)){
				dfs(ty, tx);
			}
			
		}
	}
	return;
}
			
	
int main(int argc, char const* argv[])
{
	
	while(true){
		cin >> w >> h;
		if(w == 0 && h == 0) break;

		ans = 0;
		rep(i, h) rep(j, w) cin >> map[i][j];

		rep(i, h){
			rep(j, w){
				if(map[i][j]){
					ans++;
					dfs(i, j);
				}
			}
		}


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

Measured memory_bytes: 1276
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin >> S;
  int ans=0 ;
  for(int i = 0;i< S.size(); i++){
  int M = 0;
    for(int j = i; j<S.size(); j++){
      if(S.at(j)=='A'||S.at(j)=='T'||S.at(j)=='C'||S.at(j)=='G'){
        M++;
      }
      else{
        break;
      }
        ans= max(ans,M);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;

ll H,W,d,c[510][510];

int main(void){
	cin>>H>>W>>d;
	rep(i,H){
		rep(j,W){
			ll s=(i+j)/d, t=(H-1-i+j)/d;
			s%=2;
			t%=2; 
			if(s==0){
				if(t==0){
					printf("R");
				}else{
					printf("Y");
				}
			}else{
				if(t==0){
					printf("G");
				}else{
					printf("B");
				}
			}
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(),(a).end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
const int INF=2e9;
double EPS=1e-10;
int main(){
      int n,m;
      while(cin>>n>>m&&(n||m)){
            int a[n],b[m];
            ll dp[2][256];
            REP(i,m)cin>>b[i];
            REP(i,n)cin>>a[i];
            memset(dp,-1,sizeof(dp));
            dp[0][128]=0;
            REP(i,n){
                  int l=i&1;
                  REP(j,256)dp[l^1][j]=-1;
                  REP(j,256){
                        if(dp[l][j]==-1)continue;
                        REP(k,m){
                              int nxt=j+b[k];
                              nxt=max(0,min(255,nxt));
                              if(dp[l^1][nxt]==-1)dp[l^1][nxt]=dp[l][j]+(a[i]-nxt)*(a[i]-nxt);
                              else dp[l^1][nxt]=min(dp[l^1][nxt],dp[l][j]+(a[i]-nxt)*(a[i]-nxt));
                        }
                  }
            }
            ll ans=-1;
            REP(i,256)if(dp[n&1][i]!=-1){
                  if(ans==-1)ans=dp[n&1][i];
                  else ans=min(ans,dp[n&1][i]);
            }
            cout<<ans<<endl;
      }
}

Measured memory_bytes: 1232
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author NikuKyabe
 */

#include "bits/stdc++.h"
using namespace std;
#define int long long


class CFlipFlipAndFlip {
public:
	void solve(std::istream& in, std::ostream& out) {
    int n,m;
    in >> n >> m;
    if(n == 1 && m == 1){
      out << 1 << endl;
    }
    else if(n == 1 || m == 1){
      out << max(n,m) - 2 << endl;
    }
    else{
      out << (n - 2) * (m - 2) << endl;
    }
	}
};


signed main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cout << fixed;
	CFlipFlipAndFlip solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3656
a,b,c = map(int,input().split())
k = int(input())
ans = 'No'
for i in range(k+1):
  for j in range(k-i+1):
    for r in range(k-i-j+1):
      if a*(2**i)<b*(2**j)<c*(2**r):
        ans = 'Yes'
print(ans)

Measured memory_bytes: 9188
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<vector>
#include<queue>
#include<cmath>
using namespace std;

int main()
{
    int r;
    
    cin >> r;
    
    cout << double(2 * 3.14159 * r) << endl;
    
    return 0;
}

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

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            string line = Console.ReadLine();

            if (line == "RRR") Console.WriteLine(3);
            else if (line == "RRS" || line == "SRR") Console.WriteLine(2);
            else if (line.IndexOf("R") >= 0) Console.WriteLine(1);
            else Console.WriteLine(0);
        }
    }
}


Measured memory_bytes: 26224
# coding: utf-8
from math import ceil, floor
from fractions import gcd
A, B, C, D = map(int, input().split())
lcm = (C * D) // gcd(C, D)
c_cnt = B // C - (A-1) // C
d_cnt = B // D - (A-1) // D
cd_cnt = B // (lcm) - (A-1) // (lcm)
minus = c_cnt + d_cnt - cd_cnt
print(B - A - minus + 1)

Measured memory_bytes: 5048
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define all(x)    (x).begin(),(x).end()
typedef long long ll;
const int MOD = (int)1e9 + 7;

int main(){
  int a,b;
  cin>>a>>b;
  cout<<(b%a==0? a+b : b-a)<<endl;
}



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

int main() {
  int a, b;
  for (int T = 0; cin >> a >> b, a | b; ++T) {
    if (T > 0) { cout << endl; }
    bool exist = false;
    for (int y = a; y <= b; ++y) {
      if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0)) {
        cout << y << endl;
        exist = true;
      }
    }
    if (!exist) { cout << "NA" << endl; }
  }
}

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

using namespace std;

const int MAX_V = 100005;

int n, m, ans;

bool vis[MAX_V];
int dp[MAX_V];
int in[MAX_V];

vector < int > G[MAX_V];

void dfs(int u) {
  if (vis[u] > 0) {
    return;
  }
  vis[u] = true;
  for (int v : G[u]) {
    dp[v] = max(dp[v], dp[u] + 1);
    --in[v];
    if (in[v] == 0) {
      dfs(v);
    }
  }
}

int main() {
  scanf("%d %d", &n, &m);
  while (m --) {
    int u, v;
    scanf("%d %d", &u, &v);
    G[u].push_back(v);
    ++in[v];
  }
  for (int i = 1; i <= n; ++i) {
    if (vis[i] == 0 && in[i] == 0) {
      dfs(i);
    }
  }
  ans = 0;
  for (int i = 1; i <= n; ++i) {
    ans = max(ans, dp[i]);
  }
  printf("%d", ans);
  return 0;
}


Measured memory_bytes: 9728
#include<stdio.h>
#define rep(i,N) for(int i=0;i<(int)N;i++)
#define swap(a,b) ((*a!=*b)&&(*a+=*b,*b=*a-*b,*a-=*b))
const int IMIN=(1<<15);
int IN(void)
{
  int x=0,f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
static inline void Sort(unsigned *from,unsigned *to,unsigned bit)
{
  if(!bit||to<from+1)return;
  unsigned *left=from,*right=to-1;
  for(;;)
  {
    while(left<right&&!(*left&bit))left++;
    while(left<right&&(*right&bit))right--;
    if(left>=right)break;
    swap(left,right);
  }
  if(!(bit&*left)&&left<to)left++;
  bit>>=1;
  Sort(from,left,bit);
  Sort(left,to,bit);
}
static inline void Radix(int *array,const int len)
{
  unsigned *x=(unsigned*)array;
  rep(i,len)x[i]^=IMIN;
  Sort(x,x+len,IMIN);
  rep(i,len)x[i]^=IMIN;
}
int main(void)
{
  int N=IN(),K=IN(),P[1000]={0},i=0,sum=0;
  while(i<N){P[i++]=IN();}
  Radix(P,N);i=0;
  while(i<K){sum+=P[i++];}
  return printf("%d\n",sum),0;
}

Measured memory_bytes: 1592
#include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
int main(){
	char a,b;
	cin>>a>>b;
	if((a=='H'&&b=='H')||(a=='D'&&b=='D'))
	cout<<"H";
	else 
	cout<<"D";
	return 0;
}  

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll,ll> P;
typedef vector<P> vp;
typedef vector<string> vs;
typedef vector<bool> vb;


const ll inf=1e16;

#define rep(i,m,n) for(ll i=m;i<n;i++)
#define repr(i,m,n) for(ll i=m-1;i>=n;i--)
#define fi first
#define se second
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
#define eb(x) emplace_back(x)
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define sum(x) accumulate(all(x),0)
#define gll greater<ll>()

ll mod_pow(ll x, ll n,ll mod){
 if(mod==0) return 0;
 ll res=1;
  while(n>0){
   if(n&1) res=res*x%mod;
   x=x*x%mod;
   n>>=1;
}
return res;
}


void solve(){
 ll n;
  string x;
  
  cin >> n >> x;
  
  ll bit=0;
  for(auto c:x) if(c=='1') bit++;
  
  ll plus=0,minus=0;
  repr(i,n,0){
    if(x[i]=='0') continue;
    plus+=mod_pow(2,n-1-i,bit+1);
    if(bit>1) minus+=mod_pow(2,n-1-i,bit-1);
  }
  
  rep(i,0,n){
  ll ans=1;
   ll cnt;
    if(x[i]=='0') cnt=(plus+mod_pow(2,n-1-i,bit+1))%(bit+1);
    else if(bit>1) cnt=(minus-mod_pow(2,n-1-i,bit-1)+(bit-1))%(bit-1);
    else {
      cout << 0 << endl;
      continue;
    }
    while(cnt){
    cnt=cnt%__builtin_popcount(cnt); 
    ans++; 
   }
    
    cout << ans << endl;
  
    
  }
  
  
}

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

Measured memory_bytes: 3764
// Problem : 
// 			C - Walking Takahashi
// 			
// 		
// Contest : AtCoder - AtCoder Beginner Contest 175
// URL : https://atcoder.jp/contests/abc175/tasks/abc175_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

// Delete the dynamically allocated memory

#include<bits/stdc++.h>
using namespace std;
 
#define ff              first
#define ss              second
#define pb              push_back
#define pr              pair<long long,long long>
#define mp(a,b)         make_pair(a,b)
#define vr              vector<long long>
#define mod1            1000000007
#define mod2            998244353
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define fill(a,b)       memset(a, b, sizeof(a))
#define mk(arr,n,type)  type *arr=new type[n];
#define ll              long long
#define ld	            long double
#define w(x)            int x; cin>>x; while(x--)
ll power(ll base, ll exp) {
    ll res=1;
    while(exp>0) {
       if(exp%2==1) res=(res*base);
       base=(base*base);
       exp/=2;
    }
    return res;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll x,k,d;
	cin>>x>>k>>d;
	if(x>0){
		ll v1=x%d;
		ll v2=abs(v1-d);
		ll s=x/d;
		if(k>s){
			ll p=k-s;
			if(p%2==0){
				cout<<v1<<"\n";
			}else{
				cout<<v2<<"\n";
			}
		}else{
			cout<<x-(k*d)<<"\n";
		}
	}else if(x<0){
		x=(-x);
		ll v1=x%d;
		ll v2=abs(v1-d);
		ll s=x/d;
		if(k>s){
			ll p=k-s;
			if(p%2==0){
				cout<<v1<<"\n";
			}else{
				cout<<v2<<"\n";
			}
		}else{
			cout<<x-(k*d)<<"\n";
		}
	}else{
		if(k%2==0){
			cout<<0<<"\n";
		}else{
			cout<<d<<"\n";
		}
	}
	return 0;
	}
	
	
	
	
	
	
	



Measured memory_bytes: 3648
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int S[] = new int[13];
		int H[] = new int[13];
		int C[] = new int[13];
		int D[] = new int[13];

		for (int i = 0; i < n; i++) {
			String M = sc.next();
			int R = sc.nextInt();
			if (M.equals("S")) {
				S[R - 1] = 1;
			} else if (M.equals("H")) {
				H[R - 1] = 1;
			} else if (M.equals("C")) {
				C[R - 1] = 1;
			} else {
				D[R - 1] = 1;
			}
		}

		for (int i = 0; i < 13; i++) {
			if (S[i] == 0) {
				int m = i + 1;
				System.out.println("S " + m);
			}
		}
		for (int i = 0; i < 13; i++) {
			if (H[i] == 0) {
				int m = i + 1;
				System.out.println("H " + m);
			}
		}
		for (int i = 0; i < 13; i++) {
			if (C[i] == 0) {
				int m = i + 1;
				System.out.println("C " + m);
			}
		}
		for (int i = 0; i < 13; i++) {
			if (D[i] == 0) {
				int m = i + 1;
				System.out.println("D " + m);
			}
		}

	}
}


Measured memory_bytes: 26456
#include<bits/stdc++.h>
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define per(a,b,c) for(int a=b;a>=c;a--)
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
#define eps 1e-11
using namespace std;
typedef long long ll;
typedef double db;
const int mod = 1e9 + 7;
const int N = 1e6 + 5;
int n, m, k;
int a[N];



ll gcd(ll a, ll b) {
    return b == 0 ? a : gcd(b, a%b);
}
int sqr(int x) { return x * x; }

struct node {
    double x, y;
}pt[N];

node o;
double r;

double dis(node a, node b) {
    return sqrt((a.x - b.x)*(a.x - b.x) + (a.y - b.y)*(a.y - b.y));
}

void dt(node p1, node p2, node p3) {
    double a, b, c, d, e, f;
    a = p2.y - p1.y;
    b = p3.y - p1.y;
    c = p2.x - p1.x;
    d = p3.x - p1.x;
    f = p3.x*p3.x + p3.y*p3.y - p1.x*p1.x - p1.y*p1.y;
    e = p2.x*p2.x + p2.y*p2.y - p1.x*p1.x - p1.y*p1.y;
    o.x = (a*f - b * e) / (2 * a*d - 2 * b*c);
    o.y = (d*e - c * f) / (2 * a*d - 2 * b*c);
    r = dis(o, p1);
}

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        scanf("%lf%lf",&pt[i].x,&pt[i].y);
    }
    random_shuffle(pt + 1, pt + 1 + n);
    o = pt[1]; r = 0;
    for (int i = 2; i <= n; i++) {
        if (dis(pt[i], o) > r + eps) {
            o = pt[i]; r = 0;
            for (int j = 1; j <= i - 1; j++) {
                if (dis(o, pt[j]) > r + eps) {
                    o.x = (pt[i].x + pt[j].x) / 2.0;
                    o.y = (pt[i].y + pt[j].y) / 2.0;
                    r = dis(o, pt[j]);
                    for (int k = 1; k <= j - 1; k++) {
                        if (dis(o, pt[k]) > r + eps) {
                            dt(pt[i], pt[j], pt[k]);
                        }
                    }
                }
            }
        }
    }
    printf("%.10f\n", 1.0*r);
    //printf("%.10lf\n%.10lf %.10lf", 1.0*r, o.x, o.y);
    return 0;
}
//
//                            _ooOoo_
//                           o8888888o
//                           88" . "88
//                           (| -_- |)
//                           O\  =  /O
//                        ____/`---'\____
//                      .'  \|     |//  `.
//                     /  \|||  :  |||//  \
//                    /  _||||| -:- |||||-  \
//                    |   | \  -  /// |   |
//                    | \_|  ''\---/''  |   |
//                    \  .-\__  `-`  ___/-. /
//                  ___`. .'  /--.--\  `. . __
//               ."" '<  `.___\_<|>_/___.'  >'"".
//              | | :  `- \`.;`\ _ /`;.`/ - ` : | |
//              \  \ `-.   \_ __\ /__ _/   .-` /  /
//         ======`-.____`-.___\_____/___.-`____.-'======
//                            `=---='
//        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//                     佛祖保佑      永无BUG


Measured memory_bytes: 256
n = int(input())
lst1 = list(input())

#どんよくぅ
s= []
s.append(lst1.pop(0))
ans,res = 0,0
for i in range(n-1):
    res = 0
    for j in s:
        if j in lst1:
            res += 1
    if not lst1[0] in s:
        s.append(lst1.pop(0))
    else:
        del lst1[0]
    ans = max(ans,res)

print(ans)



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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcountll

#define INF 1e16
#define mod 1000000007

ll n;
ll a[100010];
vector<ll> ss;

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

  cin>>n;
  ll sum=0;
  rep(i,n){
    cin>>a[i];
    sum+=a[i];
  }

  ss.push_back(0);
  for(ll i=1;i<n-1;i+=2){
    ss.push_back(ss.back()+a[i]);
  }

  ll m=ss.size();

  vector<ll> res;
  ll pres=0;
  rep(i,n-1){
    if(i%2==0){
      ll r=(ss[m-1]-ss[(i/2)]);
      r*=2;
      r+=pres;
      res.push_back(sum-r);
    }else{
      res.push_back(a[i-1]*2-res.back());
    }
    pres+=res[i];
  }
  res.push_back(sum);
  rep(i,n-1)res[n-1]-=res[i];
  rep(i,res.size())cout<<res[i]<<" ";
  cout<<endl;

  return 0;
}


Measured memory_bytes: 3444
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

int main(){
    int w;
    string s;
    cin >> s;
    cin >> w;
    for(int i = 0; i < s.size(); i++){
        if(i%w==0){
            cout << s[i];
        }
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define endl "\n"
#define int long long
using namespace std;

const int N = 100111;
const int inf = 1e10;
int n,k;
vector <int> g[N];
int ans = 1;
int md = 1000000007;
void dfs(int v, int pr , int t){
    //cout << v << endl;
    int cnt = 0;
    ans = ans * (k - t);
    ans %= md;
    while (ans < 0){
        ans+=md;
    }
    if (pr == 0){
        cnt = 0;
    }
    else{
        cnt = 1;
    }
    for (int i=0;i<g[v].size();i++){
        int to = g[v][i];
        if (pr != to){
            cnt++;
            dfs(to,v,cnt);
        }
    }
}
signed main()
{
	ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //freopen("input.txt","r",stdin);
    cin >> n >> k ;
    for (int i=1;i<n;i++){
        int x, y;
        cin >> x >> y;
        g[x].pb(y);
        g[y].pb(x);
    }
    dfs(1,0,0);
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 10368
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
using namespace std;
int T;
long long n,a,b,c,d;
map<long long,__int128>dp;
__int128 dfs(long long n)
{
	if (dp.count(n)) return dp[n];
	//printf("lala %lld\n",n);
	__int128 ans=(__int128)n*d;
	if (n%2==0) ans=min(ans,dfs(n/2)+a);
	else 
	{
		if (n>=1) ans=min(ans,dfs((n-1)/2)+a+d);
		ans=min(ans,dfs((n+1)/2)+a+d);
	}
	if (n%3==0) ans=min(ans,dfs(n/3)+b);
	else if (n%3==1)
	{
		if (n>=1) ans=min(ans,dfs((n-1)/3)+b+d);
		ans=min(ans,dfs((n+2)/3)+b+2ll*d);
	}
	else if (n%3==2)
	{
		if (n>=2) ans=min(ans,dfs((n-2)/3)+b+2ll*d);
		ans=min(ans,dfs((n+1)/3)+b+d);
	}
	if (n%5==0) ans=min(ans,dfs(n/5)+c);
	else if (n%5==1)
	{
		if (n>=1) ans=min(ans,dfs((n-1)/5)+c+d);
		ans=min(ans,dfs((n+4)/5)+c+4ll*d);
	}
	else if (n%5==2)
	{
		if (n>=2) ans=min(ans,dfs((n-2)/5)+c+2ll*d);
		ans=min(ans,dfs((n+2)/5)+c+2ll*d);
	}
	else if (n%5==3)
	{
		if (n>=3) ans=min(ans,dfs((n-3)/5)+c+3ll*d);
		ans=min(ans,dfs((n+2)/5)+c+2ll*d);
	}
	else if (n%5==4)
	{
		if (n>=4) ans=min(ans,dfs((n-4)/5)+c+4ll*d);
		ans=min(ans,dfs((n+1)/5)+c+d);
	}
	dp[n]=ans;
return ans;
}
void ptf(__int128 x)
{
	if (x==0) return;
	int t=x%10; ptf(x/10);
	printf("%d",t);
}
int main()
{
	scanf("%d",&T);
	while (T--)
	{
		scanf("%lld%lld%lld%lld%lld",&n,&a,&b,&c,&d);
		dp.clear(); dp[0]=0; dp[1]=d; ptf(dfs(n)); printf("\n");
	}
return 0;
}
/*
1
11 1 2 4 8
*/

Measured memory_bytes: 4760
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#define repeat(i, n) for (int i = 0; (i) < (n); ++(i))
#define repeat_from(i, m, n) for (int i = (m); (i) < (n); ++(i))
using namespace std;
template <class T>
void setmax(T &a, T const &b) {
    if (a < b) a = b;
}

template <class T>
void setmin(T &a, T const &b) {
    if (a > b) a = b;
}

template <typename T, typename X>
auto vectors(T a, X x) { return vector<T>(x, a); }

template <typename T, typename X, typename Y, typename... Zs>
auto vectors(T a, X x, Y y, Zs... zs) {
    auto cont = vectors(a, y, zs...);
    return vector<decltype(cont)>(x, cont);
}

// たぶん周期性があるはず、ありそう
#define PRINT(X) cout << #X << " " << X << endl;

int main() {
    long long N, X, M;
    cin >> N >> X >> M;
    vector<bool> visited(M, false);
    vector<long long> B;
    long long Ai = X;
    while (!visited[Ai]) {
        visited[Ai] = true;
        Ai = (Ai * Ai) % M;
    }
    // Ai がループの最初
    long long loop_begin = Ai;
    //PRINT(loop_begin);
    Ai = X;
    while (Ai != loop_begin) {
        B.push_back(Ai);
        Ai = (Ai * Ai) % M;
    }
    vector<long long> vecLoop;
    Ai = loop_begin;
    while (true) {
        vecLoop.push_back(Ai);
        Ai = (Ai * Ai) % M;
        if (Ai == loop_begin) break;
    }

    /*     cout << "B: " << endl;
    for (int i = 0; i < B.size(); ++i) cout << B[i] << " -> ";
    cout << endl;
    cout << "loop_begin: " << endl;
    for (int i = 0; i < vecLoop.size(); ++i) cout << vecLoop[i] << " -> ";
    cout << endl;
    */
    // ループ手前
    long long p = B.size();
    long long psum = 0;
    for (long long x : B) psum += x;

    // ループ
    long long q = vecLoop.size();
    long long qsum = 0;
    for (long long x : vecLoop) qsum += x;

    /*
    PRINT(p);
    PRINT(q);
    */
    long long res = 0;
    if (N < p) {
        for (int i = 0; i < p; ++i) {
            res += B[i];
        }
        cout << res << endl;
    } else {
        res += psum;
        res += (N - p) / q * qsum;
        for (int i = 0; i < (N - p) % q; ++i) {
            res += vecLoop[i];
        }
        cout << res << endl;
    }

    return 0;
}

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

int main(){
	char S[100];
  int i=0;
  cin >> S;
    while(S[i]){
    i++;
    }
  	for(int j=0; j<i; j++){
    S[j] = 'x';
    }
   cout << S;
  return 0;
}

Measured memory_bytes: 256
import sys
from collections import Counter

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 19 + 7
EPS = 10 ** -10

def gcd(a, b):
    while b: a, b = b, a % b
    return a

N = INT()
K = 10**9
L = 10**18
A = [0] * N
C = Counter()
for i in range(N):
    a = float(input())
    A[i] = round(a * K)
    C[gcd(A[i], L)] += 1

ans = 0
for k1, v1 in C.items():
    for k2, v2 in C.items():
        if k1 == k2:
            if k1*k2 % L == 0:
                ans += v1*(v1-1) // 2
        elif k1 < k2:
            if k1*k2 % L == 0:
                ans += v1 * v2
print(ans)


Measured memory_bytes: 85224
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <string>
#include <functional>
#include <math.h>
#include <utility>
using namespace std;
int n,A,B,Ac,Bc[100];
double t,last_t;
int main()
{
	cin>>n>>A>>B>>Ac;
	for(int i=0;i<n;i++){
		cin>>Bc[i];
	}
	sort(Bc,Bc+n,greater<int>());
	last_t=(double)Ac/A;
	for(int i=0;i<n;i++){
		Ac+=Bc[i];A+=B;
		t=Ac/A;
		if(t<last_t){
			break;
		}
		last_t=t;
	}
	printf("%d\n",(int)last_t);
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define maxs(a, b) a = max(a, b)
#define mins(a, b) a = min(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll linf = 1001002003004005006ll;
const int inf = 1001001001;
const int mod = 1000000007;

ll dp[100005][2];

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	int n = s.size();
	dp[0][0] = 1;
	rep(i, n) rep(j, 2) {
		if (s[i] == '1') (dp[i + 1][1] += dp[i][j]) %= mod;
		else (dp[i + 1][j] += dp[i][j]) %= mod;
		if (!(s[i] == '0' && j == 0)) (dp[i + 1][j] += (dp[i][j] * 2) % mod) %= mod;
	}
	cout << (dp[n][0] + dp[n][1]) % mod << endl;
	return 0;
}

Measured memory_bytes: 2000
N, K = map(int, input().split())
*A, = map(int, input().split())

dp = [0]*(K+1)
for c in range(K+1):
    for a in A:
        if a <= c and not dp[c-a]:
            dp[c] = 1
            break
print('First' if dp[K] else 'Second')

Measured memory_bytes: 41836
# input
h, w = [int(i) for i in input().split()]
ary = []
for y in range(h):
    ary.append([None if i == '.' else 0 for i in input()])


from collections import deque

update_q = deque((y, x) for y, line in enumerate(ary) for x, elem in enumerate(line) if elem == 0)

def update(ary, update_q):
    for _ in range(len(update_q)):
        pos = update_q.popleft()
        y, x = pos
        if x > 0:
            uy, ux = y, x-1
            if ary[uy][ux] is None:
                ary[uy][ux] = ary[y][x] + 1
                update_q.append((uy, ux))
        if x < w-1:
            uy, ux = y, x+1
            if ary[uy][ux] is None:
                ary[uy][ux] = ary[y][x] + 1
                update_q.append((uy, ux))
        if y > 0:
            uy, ux = y-1, x
            if ary[uy][ux] is None:
                ary[uy][ux] = ary[y][x] + 1
                update_q.append((uy, ux))
        if y < h-1:
            uy, ux = y+1, x
            if ary[uy][ux] is None:
                ary[uy][ux] = ary[y][x] + 1
                update_q.append((uy, ux))
    return ary, update_q


black_count = len(update_q)
update_count = 0
while black_count < w * h:
    ary, update_q = update(ary, update_q)
    black_count += len(update_q)
    update_count += 1


print(update_count)

Measured memory_bytes: 113628
#include<stdio.h>
int main(){
  int n,a,b,j=0,k=0,m=0;
  scanf("%d %d %d",&n,&a,&b);
  for(;n>=1;n--){
    k=n;
    for(j=0;k!=0;){
      j+=k%10;
      k/=10;
    }
    if(j>=a && j<=b){
    m+=n;
    }
  }
  printf("%d",m);
  return 0;
}


Measured memory_bytes: 1732
#include<bits/stdc++.h>
using namespace std;
int main(){
    int K,A,B;
    cin >> K >> A >> B;
    for(int i=A;i<=B;i++){
        if(i%K==0){
            cout << "OK";
            return 0;
        }
    }
    cout << "NG";
    return 0;
}

Measured memory_bytes: 3636
### ----------------
### ここから
### ----------------

import sys

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline
    n=int(readline())
    a=set()
    for i in range(n):
        a.add(readline().rstrip())
    print(len(a))
    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Measured memory_bytes: 31068
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//�]���؂�グ�� =>  (a + b - 1) / b 

signed main(){
	string s,t,k; cin>>s>>t>>k;
  cout<<"A"<<t[0]<<"C"<<endl;
	
	return 0;
}


Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
typedef long long int ld;
ld mod=1000000007;
long double p[3005];
long double dp[3005][3005];
void solve(int n,int k)
{
    int i,j;
    long double sum;
    if(dp[n][k]>=0)
    {
        return;// dp[n][k];
    }
    if(k==0)
    {
        if(n==1)
        {
            dp[n][k]=1-p[n-1];
           // cout<<"hola\n";
            //cout<<"p[n-1]= "<<p[n-1]<<" n= "<<n<<" k= "<<k<<" dp[n][k]= "<<dp[n][k]<<"\n";
            return;
        }
        else
        {
            solve(n-1,0);
            dp[n][k]=dp[n-1][k]*(1-p[n-1]);
            //cout<<"hola\n";
            //cout<<"p[n-1]= "<<p[n-1]<<" n= "<<n<<" k= "<<k<<" dp[n][k]= "<<dp[n][k]<<" dp[n-1][k]= "<<dp[n-1][k]<<"\n";
            return;
        }
    }
    if(n<k)
    {
        dp[n][k]=0;
        return;// dp[n][k];
    }
    if((n==k)and(n==1))
    {
        dp[n][k]=p[0];
        return ;//dp[n][k];
    }
    solve(n-1,k);
    solve(n-1,k-1);
    dp[n][k]=dp[n-1][k]*(1-p[n-1])+dp[n-1][k-1]*p[n-1];
    return ;//dp[n][k];
}
int main()
{
    int i,j,n;
    long double sum=0.000;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>p[i];
    }
    //memset(dp,-1.00000,sizeof(dp));
    for(i=0;i<=n;i++)
    {
        for(j=0;j<=n;j++)
        {
            dp[i][j]=-1.000000000;
        }
    }
    for(i=1;i<=n;i++)
    {
        for(j=0;j<=n;j++)
        {
            solve(i,j);
        }
    }
    /*for(i=1;i<=n;i++)
    {
        for(j=0;j<=n;j++)
        {
            cout<<dp[i][j]<<" ";
        }
        cout<<"\n";
    }*/
    for(i=(n+1)/2;i<=n;i++)
    {
        sum+=dp[n][i];
    }
    cout<<setprecision(15)<<sum<<"\n";
    return 0;
}

Measured memory_bytes: 141184
#include <cstdio>
#include <cmath>

using namespace std;
using ll = long long;
int n, ans = 0;
ll a, b, k;

int main () {
    scanf("%d%lld", &n, &k);
    while (n--) {
        scanf("%lld%lld", &a, &b);
        if (a * a + b * b <= k * k) ans++;
    }
    printf("%d", ans);
    return 0;
}

Measured memory_bytes: 3216
#include <iostream>
#include <vector>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

typedef long long ll;

int main()
{
	ll a;
	while(cin >> a && a)
	{
		ll count = 0;

		while(true)
		{
			if(a == 1) break;

			if(a%2 == 0)
			{
				a /= 2;
			}
			else
			{
				a = a*3 + 1;
			}
			count++;
		}

		cout << count << endl;
	}
	return 0;
}

Measured memory_bytes: 1156
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t){e.exports=require("fs")},function(e,t,r){"use strict";r.r(t);var n,o=r(0);500*(n=o.readFileSync("/dev/stdin","utf8").trim()).split(" ")[0]>=n.split(" ")[1]?console.log("Yes"):console.log("No")}]);

Measured memory_bytes: 7372
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int k;
  cin >>k;
  int ans=k/2;
  if(k%2==0){
    ans*=k/2;
  }
  else{
    ans*=k/2+1;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
n = int(input())
s = input()
ans = s.count('R') * s.count('G') * s.count('B')

for i in range(n-2):
    for j in range(i+1, i+(n-i-1)//2+1):
        k = 2*j-i
        if k < n and s[k] != s[i] and s[k] != s[j] and s[i] != s[j]:
            ans -= 1

print(ans)


Measured memory_bytes: 9144
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 > C){
			System.out.println("0");
		} else {
			System.out.println(C - (A-B));
		}
	}
}

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

x = a[0]
y = sum(a[1:])
ans = abs(x-y)
for i in range(1, n-1):
    x += a[i]
    y -= a[i]
    ans = min(ans, abs(x-y))
print(ans)


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

namespace ABC_A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);
            int c = int.Parse(input[2]);
            string yes = "Yes";
            string no = "No";
            if(a<=c && c <= b)
            {
                Console.WriteLine(yes);
            }
            else
            {
                Console.WriteLine(no);
            }

        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
void dfs(int node, vector<int> adj[], int dp[], bool vis[])
{
	vis[node] = true;

	for (int i = 0; i < adj[node].size(); i++) {

		if (!vis[adj[node][i]])
			dfs(adj[node][i], adj, dp, vis);
			
		dp[node] = max(dp[node], 1 + dp[adj[node][i]]);
	}
}
void addEdge(vector<int> adj[], int u, int v)
{
	adj[u].push_back(v);
}
int findLongestPath(vector<int> adj[], int n)
{
	int dp[n + 1];
	memset(dp, 0, sizeof dp);

	bool vis[n + 1];
	memset(vis, false, sizeof vis);
	for (int i = 1; i <= n; i++) {
		if (!vis[i])
			dfs(i, adj, dp, vis);
	}

	int ans = 0 ;
	for (int i = 1; i <= n; i++) {
		ans = max(ans, dp[i]);
	}
	return ans;
}
int main()
{
	int n , m ;
	cin>>n>>m;
	vector<int> adj[n + 1];
	for(int i= 0 ; i< m ; i++)
    {
        int f , s;
        cin>>f>>s;
        addEdge(adj, f, s);
	}

	cout << findLongestPath(adj, n);
	return 0;
}


Measured memory_bytes: 9600
#pragma region header
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr int inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
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;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i % mod;
}
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 ;
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
#pragma endregion

signed main() {
    int n;cin >> n;
    vi v(n);
    rep(i,  n) {
        cin >> v[i];
        v[i]-=i+1;
    }
    sort(all(v));
    int k = v[n/2],l=v[(n+1)/2];
    int a = 0,b = 0;
    rep(i, n) a+=abs(k-v[i]),b+=abs(l-v[i]);
    cout << min(a,b) << endl;
    return 0;
}

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

using namespace std;

int main() {
    int d;cin>>d;
    switch(d) {
        case 22:cout<<"Christmas Eve Eve Eve";break;
        case 23:cout<<"Christmas Eve Eve";break;
        case 24:cout<<"Christmas Eve";break;
        case 25:cout<<"Christmas";break;
        default:;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif
#define int long long

signed main(){

  int n, m; cin >> n >> m;
  vector<int> a(n+1);
  for(int i = 0; i < n; i++){
    cin >> a[i+1];
    a[i+1] += a[i];
  }

  map<int, int> mp;
  int ans = 0;
  for(int i = 0; i <= n; i++){
    ans += mp[a[i] % m];
    mp[a[i] % m]++;
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 4992