akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
 
#define pii pair<int, int>
#define endl "\n"
#define int long long
#define F first
#define S second
#define B begin
#define E end
#define RB rbegin
#define RE rend
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
 
const int INF = 1e9 + 1;
const double EPS = 1e-10;
const ll P = 1e9 + 7;
const int Q = 47;
 
using namespace std;
 
void hello()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
}
 
void show(vector<int>& arr)
{
    for (auto i : arr)
        cout << i << " ";
    cout << endl;
}
void show(vector<vector<int>>& arr)
{
    for (auto i : arr)
        show(i);
    cout << endl;
}


signed main()
{
    hello();
    
    int l, r, d;
    cin >> l >> r >> d;
    cout << r / d - (l - 1) / d << endl;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
#define int long long
#define ull unsigned long long
#define ld long double
#define rep(a) rep1(i,a)
#define rep1(i,a) rep2(i,0,a)
#define rep2(i,b,a) for(int i=(b); i<((int)(a)); i++)
#define rep3(i,b,a) for(int i=(b); i>=((int)(a)); i--)
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define sz(a) ((int)a.size())
#define pow2(x) (1ll<<(x))
#define ceiling(a,b) (((a)+(b)-1)/(b))
#define print0(a) cout << (a) << ' '
#define print1(a) cout << (a) << '\n'
#define print2(a,b) cout << (a) << ' ',print1(b)
#define print3(a,b,c) cout << (a) << ' ',print2(b,c)
#define print4(a,b,c,d) cout << (a) << ' ',print3(b,c,d)
#ifdef i_am_noob
#define debug(a) print2(#a,a)
#else
#define debug(a) 
#endif
#define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>
 
using namespace std;
using namespace __gnu_pbds;
 
const int Mod=1000000007,Mod2=998244353;
const int MOD=Mod;
 
inline int add(int a, int b){return (a+b>=MOD?a+b-MOD:a+b);}
inline int sub(int a, int b){return (a+MOD-b>=MOD?a-b:a+MOD-b);}
int Pow(int a, int b){
	if(!b) return 1;
	int tmp=Pow(a*a%MOD,b>>1);
	return (b&1?tmp*a%MOD:tmp);
}
inline int inverse(int n){return Pow(n,MOD-2);}
 
const int maxn=100005;
//i_am_noob
int n,m;

signed main(){
	ios_base::sync_with_stdio(0),cin.tie(0);
	cin >> n >> m;
	if(n&1){
		rep(m) print2(i+1,n-i);
	}
	else{
		rep(m){
			if(i<=(n-4)/4) print2(i+1,n-i);
			else print2(i+1,n-1-i);
		}
	}
	return 0;
}

Measured memory_bytes: 3652
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
	int n,m,p,q,r,x,y;
	vector<int>::iterator itx,ity,it;
	for(;cin>>n>>m>>p>>q>>r;cout<<x<<endl){
		vector<int> v1(1),v2;
		
		for(v1.push_back(r);m--;v2.clear()){
			cin>>x>>y;
			itx=upper_bound(v1.begin(),v1.end(),x);
			ity=upper_bound(v1.begin(),v1.end(),y);
			
			if( ity-v1.begin()+1 & 1 )v2.push_back(0);
			v2.push_back(0);
//			v2.insert(v2.end(),ity-v1.begin()&1?1:2,0);
			for(it=ity;it!=v1.end();++it)
				v2.push_back(*it - y);
			
			if(v1.end()-itx & 1)v2.push_back(n-y);
			for(it=itx;it!=ity;++it)
				v2.push_back(*it-x+n-y);
			
			it = v1.begin();
			if(ity-v1.begin() & 1)++it;
			if(!it[1])it+=2;
			if(*it+n-x==v2.back())++it,v2.pop_back();
			for(;it!=itx;++it)
				v2.push_back(*it+n-x);
			
			v1.swap(v2);
		}
		v1.insert( upper_bound(v1.begin(),v1.end(),p-1), 2, p-1);
		v1.insert( lower_bound(v1.begin(),v1.end(),q), q );
		v1.push_back(n);
		it = upper_bound(v1.begin(),v1.end(),p-1);
		if(it-v1.begin() & 1) --it;
		for(x=0;*it<q;++it){
			m=*it,++it,
			x+=*it-m;
		}
	}
}

Measured memory_bytes: 0
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

//typedef
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//conversion
inline LL toLong(string s) {LL v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) LL((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

#define PUTS(x) cout << (x) << endl;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,k;
    cin>>n>>k;
    PUTS(n-k+1);
}

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

using namespace std;
#define BUF (305)
#define ll long long 

int h,w,d,q;
int A[BUF][BUF];
int B[BUF*BUF];

typedef struct {
	int x;
	int y;
}P;

P p[BUF*BUF];

int dist(P a,P b){
	int k=abs(a.x-b.x)+abs(a.y-b.y);
	return k;
}

int main(void){
	cin >> h >> w >> d;
	
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			cin >> A[i][j];
			p[A[i][j]]={i,j};
		}
	}

	int a = h*w/d;
	
	for(int i=1;i<=a;i++){
		for(int j=0;j<d;j++){
			int index = d*i+j;
			B[index] = B[index-d]+dist(p[index-d],p[index]);
		}
	}

	cin >> q;
	for(int i=0;i<q;i++){
		int r,l;
		cin >> r >> l;
		cout << B[l]-B[r] << "\n";
	}
	return 0;
}


Measured memory_bytes: 2560
#include <stdio.h>
int main(){
	int x,y=0,s;
	
	while(scanf("%d",&x) !=EOF){
		s=0;
		y=x;
		while(y<600){
			s+= x*y*y;
			y+=x;
		}
		printf("%d\n",s);
	}
	return 0;
}


Measured memory_bytes: 2096
#include <stdio.h>

int main(int argc, const char * argv[]) {
    int W, H, x, y, r;
    scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);
    if(x - r < 0 || x + r > W || y - r < 0 || y + r > H){
        printf("No\n");
    }else{
        printf("Yes\n");
    }
    return 0;
}



Measured memory_bytes: 2100
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define elif else if
int a,b,d;
char c;
string aa[30][30];
signed main()
{
	cin>>a>>b;
	rep(i,a){
		rep(j,b){
			cin>>aa[i][j];
			if(aa[i][j]=="snuke"){
				c='A'+j;
				d=i+1;
			}
		}
	}
	cout<<c<<d;
}

Measured memory_bytes: 256
/*

This Submission is to determine how many 120/240 min const. delivery point there are.

//info
120 req. steps <= 5
*/
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 1e18
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 1000000007
#define seg_size 262144
#define REP(a,b) for(long long a = 0;a < b;++a)

unsigned long xor128() {
	static unsigned long x = time(NULL), y = 362436069, z = 521288629, w = 88675123;
	unsigned long t = (x ^ (x << 11));
	x = y; y = z; z = w;
	return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}
int main() {
	string s;
	int a;
	cin >> a;
	cin >> s;
	if (a >= 3200) {
		cout << s << endl;
	}
	else {
		cout << "red" << endl;
	}
}

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

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<(o)<<" ";}
#define dumpl(o) if(DBG){cerr<<#o<<" "<<(o)<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	int A, B; char cp;
	cin >> A >> cp >> B;
	if (cp == '+')cout << A+B << endl;
	else cout << A-B << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <algorithm>
#include <cassert>
#include <string>
#include <climits>
#include <numeric>

using namespace std;
using ll = long long;

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



Measured memory_bytes: 256
#include<stdio.h>
int main(){
  long int a, b, c;
  scanf("%ld %ld", &a, &b);
  long int d = a % b;
  if(b % 2 == 1){
    if(d <= (b - 1) / 2){
      printf("%ld", d);
    }else{
      c = b - d;
      printf("%ld", c);
    }
  }
  else{
    if(d < b / 2){
      printf("%ld", d);
    }else{
      c = b - d;
      printf("%ld", c);
    }
  }
}


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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,c,d;
  cin >> a;
  b = a / 100;
  c = (a - b * 100) / 10;
  d = a - b * 100 - c * 10;
  cout << b + c + d;
}

Measured memory_bytes: 256
using System;

namespace ABC149B
{
	class Program
	{
		static void Main(string[] args)
		{
			string[] str = Console.ReadLine().Split(' ');
			long a = long.Parse(str[0]);
			long b = long.Parse(str[1]);
			long k = long.Parse(str[2]);
			long A = a;
			long B = b;
			a -= k;
			k -= A;
			if (a < 0) a = 0;
			if (k > 0) b -= k;
			if (b < 0) b = 0;
			Console.WriteLine("{0} {1}", a, b);
		}
	}
}


Measured memory_bytes: 13140
#include <iostream>
#include <vector>
#include <string>
using namespace std;
using ll = long long int;

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

    ll ans = 0;
    char prev = '-';
    for (ll i = 0; i < N; i++)
    {
        if (s[i] != prev){
            prev = s[i];
            ans++;
        }
    }
    cout << ans << endl;
}

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

#define PI 3.14159265359
#define INF 1e9
#define LINF 1e18
#define IMOD 1000000007 
#define irep(i,n) for(int i = 0; i < (int)(n); i++)
#define irep2(i,a,n) for(int i = (int)(a); i <= (int)(n); i++)
#define lrep(i,n) for(long long  i = 0; i < (long long)(n); i++)
#define lrep2(i,a,n) for(long long i = (long long)(a); i <= (long long)(n); i++)

#define irrep(i,n) for(int i = (int)(n); i > -1; i--)
#define irrep2(i,a,n) for(int i = (int)(n); i >= (int)(a); i--)

typedef long long ll;
typedef std::vector<char> v_char;
typedef std::vector<v_char > v2_char;
typedef std::vector<double> v_double;
typedef std::vector<v_double > v2_double;
typedef std::vector<int> v_int;
typedef std::vector<v_int > v2_int;
typedef std::vector<ll> v_ll;
typedef std::vector<v_ll > v2_ll;
typedef std::vector<std::string> v_string;
typedef std::vector<v_string > v2_string;
typedef std::vector<bool> v_bool;
typedef std::vector<v_bool > v2_bool;
typedef std::pair<ll, ll> pll;
typedef std::pair<int, int> pii;

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

using namespace std; 

int main(void)
{
    int n;
    cin >> n;
    cout << n * 800 - 200 * (n/15); 
    return 0;
}   
/** atcoder **/


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
  int N,M,i,j,answer=0;
  float C,A[1000][1000],B[1000],sum=0;
  scanf("%d",&N);
  scanf("%d",&M);
  scanf("%f",&C);
  for(i=0;i<M;i++){
  scanf("%f",&B[i]);
  }
  for(j=0;j<N;j++){
    for(i=0;i<M;i++){
      scanf("%f",&A[j][i]);
    }
  }
  
  for(j=0;j<N;j++){
    for(i=0;i<M;i++){
      sum=sum+A[j][i]*B[i];
    }
    if(sum+C>0){
      answer++;
    }
    sum=0;
  }
  printf("%d",answer);
  return 0;
}

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

int main(){
    int n;
    cin >> n;
    unordered_map<string,ll> mp;
    string str;
    for(int i=0;i<n;i++){
        cin >> str;
        sort(str.begin(),str.end());
        mp[str]++;
    }
    ll ans = 0;
    for(auto p : mp){
        ans += p.second*(p.second-1)/2;
   }
    cout << ans << endl;
    
}


Measured memory_bytes: 10660
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

const int MAX = 510000;
const int MOD = 1000000007;

int main(){
  ll N; cin>>N;
  if(N%10==7){
    cout<<"Yes"<<endl;
    return 0;
  }
  N/=10;
  if(N%10==7){
    cout<<"Yes"<<endl;
    return 0;
  }
  N/=10;
  if(N%10==7){
    cout<<"Yes"<<endl;
    return 0;
  }
  cout<<"No"<<endl;

}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define DUMP(x)  cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define IFOR(i, m, n) for(int i = n - 1; i >= m; i-- )
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
const int MOD = 1000000007;
/* テンプレートここまで */

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

  map<int, int> mp;

  REP(i, N){
    int a;
    cin >> a;
    mp[a] += 1;
  }

  int ans = 0;

  for(auto i = mp.begin(); i!= mp.end(); i++){
    int tmp = i->second;
    auto j = next(i);
    auto k = next(j);

    if(j != mp.end() && j->first <= i->first + 1){
      tmp += j->second;
    }
 
    if(j!= mp.end() && k!= mp.end() && k->first <= i->first + 2){
      tmp += k->second;
    }

    ans = max(ans, tmp);
  }

  cout << ans << endl;
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); ++i)
#define ALL(a) (a).begin(), (a).end()
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using Graph = vector<vi>;  // vi <=> vl
using P = pair<int, int>;  // int <=> ll
const int MOD = 1e9+7;
const double EPS = 1e-9;

int main() {
  ll x; cin >> x;
  ll ans = x / 11 * 2;
  if (x%11 > 0) ++ans;
  if (x%11 > 6) ++ans;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;

int main(void) {
  cout << std::fixed << std::setprecision(10);
  cin.tie(0);
  std::ios::sync_with_stdio(false);

  int n;
  cin>>n;
  std::vector<int> vec(n);
  std::vector<int> sorted(n);
  for(int i=0;i<n;i++){
    cin>>vec[i];
    sorted[i]=vec[i];
  }

  std::sort(sorted.begin(), sorted.end());
  std::unordered_set<int> odd,even;
  for(int i = 0; i < n; ++i){
    if(i%2==0){
      even.insert(sorted[i]);
    }else{
      odd.insert(sorted[i]);
    }
  }

  int result=0;
  for(int i = 0; i < n; ++i){
    if(i%2==0){
      if(odd.find(vec[i])!=odd.end()){
        result++;
      }
    }else{
      if(even.find(vec[i])!=even.end()){
        result++;
      }
    }
  }

  cout<<result/2<<endl;

  return 0;
}




Measured memory_bytes: 5144
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  vector <int> v(n);
  map <int,int> m;
  for (int i=0;i<n;++i)
    cin>>v[i];
  for (int i=0;i<n;++i)
    m[v[i]]++;
  for (auto it:m)
    if (it.second!=1)
    {
      cout<<"NO"<<endl;
      return 0;
    }
  cout<<"YES"<<endl;
  return 0;
}

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

int main() {

  string S;
  cin >> S;
  
  int ans = 1000;

  for (int i = 0; i < S.size() - 2; i++) {
    int a_ = (S[i] - '0') * 100 + (S[i+1] - '0') * 10 + (S[i+2] - '0');
    ans = min(ans, abs(a_ - 753));
  }
  
  cout << ans << endl;

}

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

int main(){
  long long N,A,B;
  cin >> N >> A >> B;
  
  if(N%(A+B)==0){
    cout << N/(A+B)*A << endl;
  }
  else if(N%(A+B)<A){
    cout << N/(A+B)*A+N%(A+B) << endl;
  }
  else if(N%(A+B)>A){
    cout << N/(A+B)*A+A << endl;
  }
}
  


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

int main(){
  int N;
  string S;
  cin >> N >> S;
  int A=S.size();
  for(int i=0;i<A;i++){
    if(S.at(i)+N<='Z'){
      S.at(i)+=N;
    }
    else{
      S.at(i)+=N-26;
    }
    cout << S.at(i);
  }
  cout << endl;
}
  

Measured memory_bytes: 3604
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define upperlimit 1000100
#define INF 1000000100
#define INFL 1000000000000000100LL
#define eps 1e-8
#define endl '\n'
#define sd(n) scanf("%d",&n)
#define slld(n) scanf("%lld",&n)
#define pd(n) printf("%d",n)
#define plld(n) printf("%lld",n)
#define pds(n) printf("%d ",n)
#define pllds(n) printf("%lld ",n)
#define pdn(n) printf("%d\n",n)
#define plldn(n) printf("%lld\n",n)
#define REP(i,a,b) for(i=a;i<=b;i++)
#define mp make_pair
#define pb push_back
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define vll vector<pll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define F first
#define S second
#define clr(a) memset(a,0,sizeof(a))
#define FILEIO(name) \
    freopen(name".in", "r", stdin); \
    freopen(name".out", "w", stdout);

using namespace std;

ll gcd(ll n1,ll n2){
    if(!n1)return n2;
    if(!n2)return n1;
    if(n1%n2==0)return n2;
    return gcd(n2,n1%n2);
}
ll powmod(ll base,ll exponent){
    base%=mod;
    ll ans=1;
    while(exponent){
        if(exponent&1)ans=(ans*base)%mod;
        base=(base*base)%mod;
        exponent/=2;
    }
    ans%=mod;
    return ans;
}
int f(int n){
	int ret=0;
	while(n%100==0){
		ret++;
		n/=100;
	}
	return ret;
}
int main()
{
	int temp,i,j,k,n;
	sd(k);sd(n);
	for(i=1;;i++){
		if(n==0)break;
		if(f(i)==k){
			n--;
		}
		if(n==0)break;
	}
	pdn(i);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
#include <functional>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define EB emplace_back
#define GREATER(T) T, VT<T> greater<T>
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

class binary_indexed_tree {
private:
    int N;
     int M;
    std::vector<vector<LL>> bit;
public:
    binary_indexed_tree() : N(-1), M(-1) {}
    binary_indexed_tree(int n, int m) : N(n), M(m), bit(n, vector<LL>(m)) {}

    void init(int n, int m) {
        N = n;
        M = m;
        bit = VVL(N + 1, VL(M + 1));
    }

    void add(int x, int y, LL num) {
        for (int i = x; i <= N; i += i & (-i)) {
            for (int j = y; j <= M; j += j & (-j)) {
                (bit[i][j] += num) %= MOD;
            }
        }
    }
    LL sum(int x, int y) {
        LL res = 0;
        for (int i = x; i > 0; i -= i & (-i)) {
            for (int j = y; j > 0; j -= j & (-j)) {
                (res += bit[i][j]) %= MOD;
            }
        }
        return res;
    }

    LL sum(int x1, int y1, int x2, int y2) {
        return (sum(x2, y2) - sum(x1 - 1, y2) - sum(x2, y1 - 1) + sum(x1 - 1, y1 - 1) + MOD + MOD) % MOD;
    }
};

const int MAX = 2e3 + 10;
int N, M;
binary_indexed_tree bit;

int main(void) {
    cin >> N >> M;
    VI S(N);
    REP(i, N) {
        cin >> S[i];
    }
    VI T(M);
    REP(i, M) {
        cin >> T[i];
    }
    bit.init(N + 1, M + 1);

    bit.add(1, 1, 1);
    REP(i, N) {
        REP(j, M) {
            if (S[i] == T[j]) {
                bit.add(i + 2, j + 2, bit.sum(i + 1, j + 1));
            }
        }
    }

    cout << bit.sum(N + 1, M + 1) << endl;
}


Measured memory_bytes: 31616
#include<bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define VAL 100000
#define ll  long long int
#define INF 10000000000000000LL
#define pll pair<long long , long long>
const int MAX=1e6+10;
const ll MOD=1e9+7;
const int TOT_PRIMES=19;
const int MAX_A=70;
using namespace std;
int main() 
{
	int n , k;
	cin>>n>>k;
	int snuke[MAX];
	memset(snuke, 0, sizeof(snuke));
	for(int i=1;i<=k;i++){
		int d;
		cin>>d;
		for(int j=1;j<=d;j++){
			int x;
			cin>>x;
			snuke[x]++;
		}
	}
	int ans=0;
	for(int i=1;i<=n;i++)
		ans=ans+(snuke[i]==0);
	cout<<ans;
}

Measured memory_bytes: 7540
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define inf (ll)1e9
#define mod (ll)(1e9+7)
#define d(x) cerr<<#x<<"="<<x<<endl;
#define p(x) cout<<(x)<<endl
#define ps(x) cout<<(x);
#define pfix(d,x) cout << fixed << setprecision(d) << x << endl;
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define minel(v) *min_element(all(v))
#define minind(v) distance((v).begin(), min_element(all(v)))
#define maxel(v) *max_element(all(v))
#define maxind(v) distance((v).begin(), max_element(all(v)))
#define fi first
#define se second
ll a,b,c,d,n,m,p,q,x,y,k,h,w,sum,mi,ma,ans,l,r,res;
bool flag;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int dx8[8]={1,1,0,-1,-1,-1,0,1},dy8[8]={0,1,1,1,0,-1,-1,-1};
char cha;
string s;
typedef vector<int> VI;
typedef vector<pair<int,int> > VP;

//s0から順番に決めていけるらしい

int main(){
    cin>>n;
    if(n==0)p(0);
    while(n!=0){
        if(n%2!=0){s+="1";n--;}
        else s+="0";
        n/=-2;
        d(n);
    }
    reverse(all(s));
    p(s);
    return 0;
}


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

// template {{{  0 
// using {{{ 1
using ll = long long int;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
// }}} 1
// 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("%lld", &x)
#define Scll2(x,y) scanf("%lld%lld", &x, &y)
#define Scll3(x,y,z) scanf("%lld%lld%lld", &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 (2e9)
#define PI (acos(-1))
// }}} 2
// systems {{{ 2
#define Repe(x,y,z) for(ll x = z; x < y; x++)
#define Rep(x,y) Repe(x,y,0)
#define RRepe(x,y,z) for(ll x = y-z-1; x >= 0; x--)
#define RRep(x,y) RRepe(x,y,0)
// }}} 2
// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n")
#define YESNO(a) (a)?printf("YES\n"):printf("NO\n")
// }}} 2
// }}} 1
// input {{{ 1
// }}} 1
// }}} 0

int main() {

    int N;
    Scd(N);

    vi p(N*3,1);
    p[1] = 0;
    Repe(i,N*2,1){
        if( p[i] ){
            for( int j = i+i; j < N*2; j += i ) p[j] = 0;
        }
    }

    int ans = 0;
    Repe(i,N*2,N) if( p[i] ) {
        ans = i;
        break;
    }

    printf ("%d\n", ans );

    return 0;
}



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

using namespace std;

#define vit vector<int>::iterator
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fr first
#define sc second
#define skip continue
#define PI 3.14159265

typedef unsigned long long ull;
typedef long long ll;
typedef unsigned int ui;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<bool> vb;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const ll MAXN = 3e5 + 3;

void faster(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

bool cmp(const string& a, const string& b) {
    return (a + b) < (b + a);
}

void solve(){
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    if(a * b >= c * d) cout << a * b;
    else cout << c * d;

}


int main(){
    //freopen("slalom.in","r",stdin);
    //freopen("slalom.out","w",stdout);
    //faster();
    int n = 1;
    //cin >> n;
    while(n--){
        solve();
        cout << endl;
    }
    //fclose(stdout);
}


Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cstdint>
#include <cassert>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

int main() {
  i64 a, b;
  cin >> a >> b;
  if (a > 0) cout << "Positive\n";
  else if (a <= 0 && 0 <= b) cout << "Zero\n";
  else if ((b - a + 1) % 2 == 0) cout << "Positive\n";
  else cout << "Negative\n";
  return 0;
}


Measured memory_bytes: 256
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>

#define FASTIO
#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)

#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;


/*
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
*/
int cc[4];

int main() {
#ifdef FASTIO
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#endif
	for (int i = 0; i < 3; ++i) {
		int a, b;
		cin >> a >> b;
		--a, --b;
		++cc[a], ++cc[b];
	}
	for (int i = 0; i < 4; ++i)
		if (cc[i] > 2) {
			cout << "NO\n";
			return 0;
		}
	cout << "YES\n";
	return 0;
}




Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <iostream>

#define rep( i, n, m ) for (int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for (int i = ( n ); i < ( m ); i--)

int main( void ){
	int n;
	int sum = 0;
	if(!scanf( "%d", &n ))
		return -1;
	int* A_array = new int[ n ];
	int* B_array = new int[ n ];
	int* C_array = new int[ n - 1 ];
	rep ( i, 0, n ){
		int a;
		if(!scanf( "%d", &a ))
			return -1;
		A_array[ i ] = a - 1;
	}
	rep ( i, 0, n ){
		int b;
		if(!scanf( "%d", &b ))
			return -1;
		B_array[ i ] = b;
		sum += b;
	}
	rep( i, 0, n - 1 ){
		int c;
		if(!scanf( "%d", &c ))
			return -1;
		C_array[ i ] = c;
	}
	rep( i, 0, n - 1 ){
		if(A_array[ i ] + 1 == A_array[ i + 1 ]){
			sum += C_array[ A_array[ i ] ];
		}
	}
	printf( "%d\n", sum );
	return 0;
}


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

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr int MOD = 1e9 + 7;

template <typename T>
void printv(const vector<T> &v)
{
    int sz = v.size();
    for (int i = 0; i < sz; i++)
    {
        cout << v[i] << " \n"[i == sz - 1];
    }
}

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

    int a, b;
    cin >> a >> b;
    cout << a * b << " " << 2 * (a + b) << endl;
}



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

const int mod = 1e9 + 7;

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n+1, true);
  rep(i,m) {
    int b;
    cin >> b;
    a[b] = false;
  }
  vector<ll> dp(n+1);
  dp[0] = 1;
  for (int now = 0; now < n; now++) {
    for (int next = now+1; next <= min(n, now+2); next++) {
      if(a[next]) {
        dp[next] += dp[now];
        dp[next] %= mod;
      }
    }
  }
  cout << dp[n] << endl;
  return 0;
}

Measured memory_bytes: 4516
/*
Though leaves are many , the root is one.
Through all the lying days of my youth
I swayed my leaves and flowers in the sun.
Now I may wither into the truth.
	  	  	- William Butler Yeats
*/
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
//#pragma GCC target("avx,tune=native")
#include<bits/stdc++.h>
#pragma comment("-Wl,--stack=1024000000")
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const double eps=1e-6;
const int mod=1000000007;
typedef long long ll;
#ifndef LOCAL
#define cerr if(0)cout
#define eprintf(...) 0
#else
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#endif
inline string getstr(string &s,int l,int r){string ret="";for(int i=l;i<=r;i++)ret.push_back(s[i]);return ret;}
int modpow(int x,int y,int md=mod){int ret=1;do{if(y&1)ret=(ll)ret*x%md;x=(ll)x*x%md;}while(y>>=1);return ret;}
inline int Rand(){return rand()*32768+rand();}
int n,a,b;
int dp[5005][5005][2],sum[5005][5005][2];
inline void add(int &x,int y){
	x+=y;if(x>=mod)x-=mod;
}
inline void sub(int &x,int y){
	x-=y;if(x<0)x+=mod;
}
inline int Add(int x,int y){
	return x+y>=mod?x+y-mod:x+y;
}
inline int Sub(int x,int y){
	return x>=y?x-y:x-y+mod;
}
int main(){
	cin>>n>>a>>b;
	if(a>b)swap(a,b);
	dp[1][0][0]=1;
	dp[1][0][1]=1;
	add(sum[1][0][1],dp[1][0][1]);
	add(sum[1][0][0],dp[1][0][0]); 
	for(int i=2;i<=n+1;i++){
		for(int j=0;j<=5000;j++){
			if(j)add(sum[i][j][1],sum[i-1][j-1][1]);
			if(j)add(sum[i][j][0],sum[i-1][j-1][0]);
			if(j)add(dp[i][0][1],Sub(sum[i-1][j-1][0],(i>=a&&j>=a?sum[i-a][j-a][0]:0)));
			if(j>=b)continue;
			if(j)add(dp[i][j][0],sum[i-1][j-1][1]);
			add(dp[i][j][1],(i>=a&&j>=a?sum[i-a][j-a][0]:0));
		}
		for(int j=0;j<b;j++){
			add(sum[i][j][1],dp[i][j][1]);
			add(sum[i][j][0],dp[i][j][0]);
//			cerr<<i<<" "<<j<<" "<<dp[i][j][0]<<" "<<dp[i][j][1]<<endl;
		}
	}
	int ans=0;
	for(int i=0;i<b;i++){
		add(ans,dp[n+1][i][0]);
		add(ans,dp[n+1][i][1]);
	}
	ans=Sub(modpow(2,n,mod),ans);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 394660
#include <ctype.h>
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

//char rbuf[]; int rbufl;
//#define getchar() rbuf[rbufl++]
#define getchar getchar_unlocked
#define putchar putchar_unlocked
int32_t nextint(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); bool s=false; if(c=='-'){s=true;c=getchar();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; }
int64_t nextlong(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); int s=0; if(c=='-'){s=1;c=getchar();} uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; }
uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; }
void printint(int32_t x){ if(x<0){x=-x; putchar('-');}else if(x==0){putchar('0');} int d=0; char s[10]; while(x){ s[d]='0'+x%10; x/=10; d++; } for (int i=d-1; i>=0; i--) putchar(s[i]); putchar('\n'); }
void rsorta_d32(void *base, const int count, const int size, const int index){
	typedef int32_t rsort_t;
	rsort_t (*a)[size] = (rsort_t(*)[size])base;
	rsort_t (*b)[size] = (rsort_t(*)[size])malloc(count*size*sizeof(rsort_t));
	int c[0x100];
	for(int k=0; k<4; k++){
		memset(c, 0, sizeof(c)); for(int i=0; i<count; i++){ c[(a[i][index]>>(k<<3))&0xFF]++; } for(int i=1; i<0x100; i++) c[i]+=c[i-1]; for(int i=count-1; i>=0; i--){ int to=--c[(a[i][index]>>(k<<3))&0xFF]; for(int j=0; j<size; j++){ b[to][j]=a[i][j]; } }{rsort_t(*t)[size]=a; a=b; b=t;}
	}
	free(b);
}

int a[100][2];
int main(void){
	int n=nextint();
	for(int i=0; i<n; i++){
		a[i][0]=nextint();
		a[i][1]=nextint();
	}
	bool f=false;
	for(int i=2; i<n; i++){
		if(a[i-2][0]==a[i-2][1] && a[i-1][0]==a[i-1][1] &&a[i][0]==a[i][1]) f=true;
	}
	puts(f?"Yes":"No");
}


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

int main() {
   int X,Y;
   cin >> X >> Y;
   for (int i=0; i<=X; i++) {
       if (2*i+4*(X-i)==Y) {
           cout << "Yes" << endl;break;
       }
       if (i==X) cout << "No" << endl;
   }
}

Measured memory_bytes: 3580
# -*- coding: utf-8 -*-
# get a integer
num = int(raw_input())
# get two integers separated with half-width break
array = map(int, raw_input().split())
# get a string
#s = raw_input()

state = 0
way_total = 0
for j in range(0,num):
    way_total += abs(array[j] - state)
    state = array[j]
way_total += abs(state)

for i in range(0,num):
    if i != num - 1 and i != 0:
        way = way_total - abs(array[i-1] - array[i]) - abs(array[i+1] - array[i]) + abs(array[i-1] - array[i+1])
    elif i == 0:
        way = way_total - abs(array[i])- abs(array[i+1] - array[i]) + abs(array[i+1])
    elif i == num - 1:
        way = way_total - abs(array[i-1] - array[i]) - abs(array[i]) + abs(array[i-1] - 0)
    print(way)


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

const long long int MOD = 1000000007;

int main()
{
  int N, X;

  std::cin >> N >> X;

  std::vector<int> S(N);

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

  std::sort(S.begin(), S.end());

  std::vector<std::vector<long long int>> dp(N, std::vector<long long int>(X + 1));

  for (int i = 0; i <= X; i++)
  {
    dp[0][i] = i % S[0];
  }

  for (int i = 1; i < N; i++)
  {
    for (int j = 0; j <= X; j++)
    {
      dp[i][j] = (1ll * dp[i - 1][j] * i + dp[i - 1][j % S[i]]) % MOD;
    }
  }

  std::cout << dp[N - 1][X] << std::endl;
}


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

#define ll long long
int main(){
	ll a, b ;
	cin >>a;
	string s,ss;
	cin >>s;cin >>ss;
	int len = s.size();int num =0;
	for(int i=0;i<len;i++){
		cout<<s[i];
		if(i%1==0)cout<<ss[num++];
	}cout<<endl;
}

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

using ll = long long;

constexpr ll MOD = 1e9+7;
constexpr ll INF = 1ll<<60;

#define FOR(i,a,b) for (ll i=(a);i<(ll)(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

int main(int argc, char **argv)
{
	ll N; cin >> N;
	vector<ll> A(N); REP(i, N) cin >> A[i];

	ll a{0};

	REP(i, N)
	{
		if (i&1)
		{
			a -= A[i];
		}
		else
			a += A[i];
	}

	std::cout << a << " ";
	for (ll i = 0; i < N-1; ++i)
	{
		a = 2*A[i] - a;
		std::cout << a << " ";
	}

	std::cout << std::endl;
}

Measured memory_bytes: 2048
import java.util.Scanner;

class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        sc.nextLine();

        String patterm = "SHCD";

        int cards[][] = new int[4][13];

        int lost_num = 52-n;

        for(int i=0;i<n;i++){
            String c = sc.next();
            int num = sc.nextInt();
            sc.nextLine();

            cards[patterm.indexOf(c)][num-1] = 1;
        }
        for(int i=0;i<cards.length;i++){
            for(int j=0;j<cards[0].length;j++){
                if(cards[i][j] == 0){
                    System.out.println(patterm.charAt(i)+" "+(j+1));
                    lost_num--;
                }
                if(lost_num == 0) break;
            }
        }
    }
}


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

namespace AOJ2
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> resultList = new List<int>();

            string input;
            while ((input = Console.ReadLine()) != null)
            {
                decimal[] array = input.Split(' ').Select(s => decimal.Parse(s)).ToArray();
                decimal child = array[0];
                decimal mother = array[1];
                int n = (int)array[2];

                decimal sho = child / mother;
                string str = sho.ToString("F15").Split('.')[1];

                int sum = 0;
                for (int i = 0; i < str.Length && i<n; i++)
                {
                    sum += int.Parse(str.Substring(i, 1));
                }

                resultList.Add(sum);
            }

            foreach (int a in resultList)
            {
                Console.WriteLine(a);
            }

        }
        
    }
}

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second

using vint=vector<int>;
using pint=pair<int,int>;
using vpint=vector<pint>;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<class A,class B>
ostream& operator<<(ostream& ost,const pair<A,B>&p){
	ost<<"{"<<p.first<<","<<p.second<<"}";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost,const vector<T>&v){
	ost<<"{";
	for(int i=0;i<v.size();i++){
		if(i)ost<<",";
		ost<<v[i];
	}
	ost<<"}";
	return ost;
}

template<uint32_t mod>
struct ModInt{
	uint32_t a;
	ModInt& s(uint32_t vv){
		a=vv<mod?vv:vv-mod;
		return *this;
	}

	ModInt(int64_t x=0){s(x%mod+mod);}

	ModInt& operator+=(const ModInt &x){return s(a+x.a);}
	ModInt& operator-=(const ModInt &x){return s(a+mod-x.a);}
	ModInt& operator*=(const ModInt &x){
		a=uint64_t(a)*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt &x)const{return ModInt(*this)+=x;}
	ModInt operator-(const ModInt &x)const{return ModInt(*this)-=x;}
	ModInt operator*(const ModInt &x)const{return ModInt(*this)*=x;}
	ModInt operator/(const ModInt &x)const{return ModInt(*this)/=x;}
	bool operator==(const ModInt &x)const{return a==x.a;}
	bool operator!=(const ModInt &x)const{return a!=x.a;}
	bool operator<(const ModInt &x)const{return a<x.a;}

	ModInt operator-()const{return ModInt()-*this;}
	ModInt pow(int64_t n)const{
		ModInt res(1),x(*this);
		while(n){
			if(n&1)res*=x;
			x*=x;
			n>>=1;
		}
		return res;
	}

	ModInt inv()const{return pow(mod-2);}
};

template<uint32_t mod>
istream& operator>>(istream& in,ModInt<mod>& a){
	return (in>>a.a);
}
template<uint32_t mod>
ostream& operator<<(ostream& out,const ModInt<mod>& a){
	return (out<<a.a);
}
using mint=ModInt<998244353>;


template<class Mint,int32_t lg>
struct ModIntTable{
	int N;
	vector<Mint>facts,finvs,invs;
	ModIntTable():N(1<<lg),facts(N),finvs(N),invs(N){
		const uint32_t mod=Mint(-1).a+1;
		invs[1]=1;
		for(int i=2;i<N;i++)invs[i]=invs[mod%i]*(mod-mod/i);

		facts[0]=1;
		finvs[0]=1;
		for(int i=1;i<N;i++){
			facts[i]=facts[i-1]*i;
			finvs[i]=finvs[i-1]*invs[i];
		}
	}
	inline Mint fact(int n)const{return facts[n];}
	inline Mint finv(int n)const{return finvs[n];}
	inline Mint inv(int n)const{return invs[n];}
	inline Mint binom(int n,int k)const{return facts[n]*finvs[k]*finvs[n-k];}
	inline Mint perm(int n,int k)const{return facts[n]*finvs[n-k];} 
};
ModIntTable<mint,21>mtable;

signed main(){
	int N,M;
	cin>>N>>M;

	mint ans=0;
	for(int i=0;i<=M&&i<=N;i++){
		if((3*M-i)&1)continue;
		int m=(3*M-i)/2;


		ans+=mtable.binom(N,i)*mtable.binom(N-1+m,m);

		if(m>M&&i<=N-1){
			ans-=mtable.binom(N-1,i)*mtable.binom(N-1+m-M-1,m-M-1)*N;
		}
		if(m>=M&&i){
			ans-=mtable.binom(N-1,i-1)*mtable.binom(N-1+m-M,m-M)*N;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 24960
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int m = scan.nextInt();
        int f = scan.nextInt();
        int b = scan.nextInt();
        scan.nextLine();

        scan.close();

        if (m >= b) {
            System.out.println(0);
        } else if (m + f >= b) {
            System.out.println(b - m);
        } else {
            System.out.println("NA");
        }
    }
}


Measured memory_bytes: 26324
#include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(0);cin.tie();cout.tie();
#define ff first
#define ss second
#define pb push_back
typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9 + 7;
const ll inf = 9223372036854775807;
const ll mininf = -9223372036854775807;
const ll nax = 0;
int n, total=0;

int main(){
	IOS
	cin >> n;
	int curr=1, arr[n+5];
	for(int i=1;i<=n;i++){
		cin >> arr[i];
	}
	while(curr!=2){
		curr=arr[curr];
		total++;
		if(total>n) break;
		if(curr==2){
			cout << total << '\n';
			return 0;
		}
	}
	cout << -1 << '\n';
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;

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

	vector<int> v(5);
	for (int i = 0; i < N; i++) {
		string s;
		cin >> s;

		if (s.at(0) == 'M') v.at(0)++;
		if (s.at(0) == 'A') v.at(1)++;
		if (s.at(0) == 'R') v.at(2)++;
		if (s.at(0) == 'C') v.at(3)++;
		if (s.at(0) == 'H') v.at(4)++;
	}

	int64_t ans = 0;
	for (int bit = 1; bit < (1 << 5); bit++) {
		bitset<5> bs(bit);
		if (bs.count() != 3) continue;

		int64_t n = 1;
		for (int i = 0; i < 5; i++) {
			if (bs[i]) n *= v.at(i);
		}

		ans += n;
	}

	cout << ans << endl;
}

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

int main() {
  int n;
  cin >> n;
  int sum;
  bool ans = false;
  
  for (int i = 0; i <= n / 4; i++) {
    sum = 0;
    sum += i * 4;
    if (sum == n && i != 0) {
      ans = true;
      break;
    }
    for (int j = 0; j <= n / 7; j++) {
      sum += j * 7;
      if (sum == n && j != 0) {
        ans = true;
        break;
      }
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
// #pragma GCC optimize("O2")
typedef long long int ll;
typedef long double ld;
typedef map <ll,ll> mm;
typedef vector <ll> mv;
typedef pair <ll,ll> mp;
typedef set <ll> ms;
typedef multiset <ll> mms;
typedef queue <ll> mq;
typedef deque <ll> mdq;
typedef stack <ll> mst;
typedef priority_queue <ll> mpq;
typedef priority_queue <ll, vector<ll>, greater<ll> > mmh;
typedef complex<double> cd;
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_multiset tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define flush cout.flush();
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define pb(v) push_back(v)
#define lb(v) lower_bound(v)
#define ub(v) upper_bound(v)
#define cn continue
#define forl(i,n) for(ll i=0;i<n;i++)
#define forlr(i,n) for(ll i=n-1;i>=0;i--)
#define rev(s) reverse(s.begin(),s.end())
void swap(ll &a,ll &b)
{
	ll tmp=a;
	a=b;
	b=tmp;
}
ll atoistring(string s)
{
	stringstream lol(s);
	ll x;
	lol>>x;
	return x;
}
void pv(mv v)
{
	forl(i,v.size())
	{
		cout<<v[i]<<" ";
	}
	cout<<"\n";
}
void pa(ll *v,ll size)
{
	forl(i,size)
	{
		cout<<v[i]<<" ";
	}
	cout<<"\n";
}
// ll facs[], facsinv[];
// ll nck(ll N,ll K,ll mod)
// {
// 	if(N<K)
// 	{
// 		return 0;
// 	}
// 	return (((facs[N]*facsinv[N-K])%mod)*facsinv[K])%mod;
// }
inline ld kthRoot(ld n, ll k) {
	return pow(k, (1.0 / k) * (log(n) / log(k)));
}
inline bool isSqr(ll x) {
	ll sqr = sqrt(x);
	return (sqr * sqr == x);
}
ll power(ll x,ll y,ll p)
{
	ll res=1;
	x=x%p;
	while(y>0)
	{
		if(y&1)
		{
			res=(res*x)%p;
		}
		y=y>>1;
		x=(x*x)%p;
	}
	return res;
}
void checkmod(ll &x,ll mod)
{
	if(x>=mod)
	{
		x%=mod;
	}
}
ll ncr(ll n, ll r, ll mod) {
	ll ans = 1;
	forl(i,min(r,n - r)) {
		ans *= n - i;
		checkmod(ans,mod);
		ans *= power(i+1, mod - 2,mod);
		checkmod(ans,mod);
	}
	return ans;
}
ll sumofgp(ll a,ll n,ll m)
{
	// n = number of terms - 1
	if(n<0)
	{
		return 0;
	}
	if(n==0)
	{
		return 1;
	}
	if(n==1)
	{
		return (1+a)%m;
	}
	ll ans;
	if(n%2)
	{
        ans=(1+a)*sumofgp((a*a)%m,(n-1)/2,m);
	}
    else
    {
        ans=1+((a*(1+a))%m)*sumofgp((a*a)%m,n/2-1,m);
    }
    return ans%m;
}
ll power_of_2_not_less(ll n)
{
	if(!n)
	{
		return 1;
	}
	n--;
	n |= n>>1;
	n |= n>>2;
	n |= n>>4;
	n |= n>>8;
	n |= n>>16;
	n |= n>>32;
	n++;
	return n;
}
ll mod = 1e9 + 7;
// void checktime()
// {
// 	struct timespec ts;
// 	printf("Running Program\n");
// 	clock_gettime(CLOCK_MONOTONIC_RAW,&ts);
// 	long double st=ts.tv_nsec/(1e9)+ts.tv_sec;
// 	// Call Funcn Here
// 	clock_gettime(CLOCK_MONOTONIC_RAW,&ts);
// 	long double en=ts.tv_nsec/(1e9)+ts.tv_sec;
// 	printf("Program ended\nTime = %Lf\n",en-st);
// }

void thisIsMain() {
	string s;
	cin>>s;
	cout<<s[0]<<s[1]<<s[2]<<"\n";
}

int main(void)
{
	fastio
	ll t = 1;
	// cin>>t;
	while(t--) thisIsMain();
	return 0;
}

Measured memory_bytes: 3640