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

using i64 = long long;
using pii = pair<int, int>;


const i64 INF = 0x3f3f3f3f3f3f3f3fLL;
const int N = 5005;


i64 dp[N];

vector<pii> v;
int n, ans = 0;



int main() {
#ifdef HOME
	freopen("zabuton.in", "r", stdin);
	freopen("zabuton.out", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);


	cin >> n;
	v.resize(n);
	for (auto &i: v)
		cin >> i.x >> i.y;

	memset(dp, 0x3f, sizeof dp);
	sort(begin(v), end(v), [&](const pii &a, const pii &b) {
		return a.x + a.y < b.x + b.y; });
	
	dp[0] = 0;
	for (auto i: v) {
		for (int j = N - 2; j >= 0; --j) {
			if (dp[j] <= i.x) {
				dp[j + 1] = min(dp[j + 1], dp[j] + i.y);
				ans = max(ans, j + 1); } } }

	cout << ans << endl;

	return 0; }


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

template<typename T>
vector<pair<T, int> > runLength(const T a[], int n) {
	vector<pair<T, int> > r;
	if (n <= 0) return r;
	int cnt = 0;
	for (int i = 0; i <= n; i ++) {
		if (i == n || (i != 0 && a[i] != a[i - 1])) {
			r.push_back(make_pair(a[i - 1], cnt));
			cnt = 0;
		}
		cnt ++;
	}
	return r;
}

int main() {
	int N;
	while (~scanf("%d", &N)) {
		vector<int> a(N);
		for (int i = 0; i < N; ++ i)
			scanf("%d", &a[i]);
		auto runs = runLength(a.data(), N);
		int ans = 0;
		for (auto run : runs)
			ans += run.second / 2;
		printf("%d\n", ans);
	}
}


Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
#define ld long double
#define ll long long
#define loop(i,x,y) for(ll i=x;i<y;i++)
#define pb push_back
#define S second
#define F first



void solve(){
	
	int n;
	cin >> n;

	string s;

	cin >> s;

	vector <char> list;

	map <char, int> check;

	for(char c: s)
		check[c]++;

	
	for(int i = 0; i < n-1 ; i++){

		cin >> s;

		map <char, int> rest;

		for(char c: s)
			rest[c]++;

		for(auto it: check){

			char test = it.first;

			if(rest.find(test) != rest.end())
				check[test] = min(rest[test], check[test]);
			else
				check[test] = 0;

		}

	}

	string ans = "";
	for(auto it: check){

		char c = it.first;
		int val = it.second;

		for(int i = 0; i < val; i++)
			ans += c;

	}

	cout << ans << endl;

}
	
 
 
int main(){
	    
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
 
	solve();
	 
	return 0;
 
}

	 


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<iostream>
using namespace std;
const int MAXN=1e5+10;
int a[MAXN];
int m,n,l,p,k,ans,tot;
int inline read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int main()
{
	n=read();
	m=read();
	ans=n+1-m;
	printf("%d",ans); 


	return 0;
}



Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
const int INF= 1e9+5;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>>vvi;

int main(){
  int a,b,c;
  cin>>a>>b>>c;
  int x=__gcd(a,b);
  if(c%x==0)cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}

Measured memory_bytes: 256
x=int(input())
if 400<=x<=599:
    print(8)
elif 600<=x<=799:
    print(7)
elif 800<=x<=999:
    print(6)
elif 1000<=x<=1199:
    print(5)
elif 1200<=x<=1399:
    print(4)
elif 1400<=x<=1599:
    print(3)
elif 1600<=x<=1799:
    print(2)
elif 1800<=x<=1999:
    print(1)


Measured memory_bytes: 9188
#include <float.h>
#include <inttypes.h>
#include <limits.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

#define getchar getchar_unlocked
#define putchar putchar_unlocked
int32_t nextint(void){ char c=getchar_unlocked(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar_unlocked(); bool s=false; if(c=='-'){s=true;c=getchar_unlocked();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return s?-x:x; }
int64_t nextlong(void){ char c=getchar_unlocked(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar_unlocked(); int s=0; if(c=='-'){s=1;c=getchar_unlocked();} uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return s?-x:x; }
uint32_t nextstr(char *s){ char c=getchar_unlocked(); while(c==' '||c=='\n') c=getchar_unlocked(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar_unlocked(); } *s='\0'; return len; }

int edge[99999][2];

int qmem[199998];

int u, v;

int *e[100000];
int el[100000];

bool p[100000];

int f(int now, int from, int k){
	if(now==v){return 1;}
	if(el[now]==1 && e[now][0]==from) return 0;
	for(int i=0; i<el[now]; i++){
		int to=e[now][i];
		if(to!=from){
			int v=f(to, now, k+1);
			if(v>0){
				if(v<=k){
					p[now]=true;
					u=from;
				}
				return v+1;
			}
		}
	}
	return 0;
}

int g(int now, int from){
	if(p[now]) return 0;
	p[now]=true;
	if(el[now]==1 && e[now][0]==from) return 1;
	int ans=0;
	for(int i=0; i<el[now]; i++){
		int to=e[now][i];
		if(to!=from){
			int pos=g(to, now);
			if(pos>ans) ans=pos;
		}
	}
	return ans+1;
}

int main(void){
	int n=nextint();
	u=nextint()-1;
	v=nextint()-1;
	for(int i=0; i<n-1; i++){
		int A=nextint()-1;
		int B=nextint()-1;
		edge[i][0]=A;
		edge[i][1]=B;
		el[A]++;
		el[B]++;
	}
	int ne=0;
	for(int i=0; i<n; i++){
		e[i]=&qmem[ne];
		ne+=el[i];
		el[i]=0;
	}
	for(int i=0; i<n-1; i++){
		int A=edge[i][0];
		int B=edge[i][1];
		e[A][el[A]++]=B;
		e[B][el[B]++]=A;
	}
	int a=f(u, -1, 0);
	p[v]=true;
	int b=g(u, -1);
	int ans=b+(a+1)/2-2;
	printf("%d\n", ans);
}


Measured memory_bytes: 7424
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1000000007LL;
const int INF = LLONG_MAX;

signed main(){
    
    int n; cin >> n;
    for(int x = 0; x <= 100; x++){
        for(int y = 0; y <= 100; y++){
            if(4 * x + 7 * y == n){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const ll mod = 100000000000000003;
int ne[200001], he[10001];
char C[1200100];

ll num[524300];
int kazu[524300];
const int ma = (1 << 19) - 1;
int query(ll n) {
	int n2 = (n & ma) + 1;
	while (num[n2]) {
		if (num[n2] == n + 1) return kazu[n2];
		n2 = n2 * 61 % 524287;
	}
	return 0;
}
void add(ll n, int b) {
	int n2 = (n & ma) + 1;
	while (num[n2]) {
		if (num[n2] == n + 1) {
			kazu[n2] |= b;
			return;
		}
		n2 = n2 * 61 % 524287;
	}
	num[n2] = n + 1;
	kazu[n2] = b;
}

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


	fread(C, 1, 1200100, stdin);
	char* ci = C, c;
	int N = 0;
	while ((c = *ci++) >= '0') N = N * 10 + c - '0';

	ll dekai[100];
	int d = 0;
	char* s[200001];
	rep1(i, N) {
		s[i] = ci;
		while (*ci++ >= '0');
		int n = ci - s[i] - 1;	
		if (n <= 100000) {
			ne[i] = he[n];
			he[n] = i;
		}
		else {
			dekai[d++] = (ll(n) << 30) + s[i] - C;
		}
	}

	ll kotae = 0;

	for (int M = 1; M <= 10000; M++) {
		for (int p = he[M]; p; p = ne[p]) {
			auto S = s[p];
			int k[26] = {};
			ll are = 0;
			for (int i = M - 1; i >= 1; i--) {
				int tmp = query(are);
				if (tmp) {
					rep(j, 26) if ((tmp >> j & 1)) {
						k[j]++;
					}
				}
				kotae += k[S[i] - 'a'];
				k[S[i] - 'a'] = 0;
				are = (are * 30 + S[i] - 'a' + 1) % mod;
			}

			kotae += k[S[0] - 'a'];
			k[S[0] - 'a'] = 0;

			add(are, 1 << (S[0] - 'a'));
		}
	}
	sort(dekai, dekai + d);
	rep(p, d) {
		auto S = C + (dekai[p] & (1 << 21) - 1);
		int k[26] = {};
		ll are = 0;
		for (int i = (dekai[p] >> 30) - 1; i >= 1; i--) {
			int tmp = query(are);
			if (tmp) {
				rep(j, 26) if ((tmp >> j & 1)) {
					k[j]++;
				}
			}
			kotae += k[S[i] - 'a'];
			k[S[i] - 'a'] = 0;
			are = (are * 30 + S[i] - 'a' + 1) % mod;
		}

		kotae += k[S[0] - 'a'];
		k[S[0] - 'a'] = 0;

		add(are, 1 << (S[0] - 'a'));
	}
	printf("%lld\n", kotae);


	Would you please return 0;
}

Measured memory_bytes: 12652
N, *D = map(int, open(0).read().split())
D.append(0)
D.sort()
T = [0] * 24
for i, d in enumerate(D):
    if i % 2 == 0 and d % 12 != 0:
        d = 24 - d
    T[d] += 1
if any(t >= 2 for t in T):
    print(0)
    quit()
T = [i for i, t in enumerate(T) if t != 0] + [24]
print(min(T[i + 1] - T[i] for i in range(len(T) - 1)))


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <numeric>




typedef long long ll;
#define PI 3.14159265359
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define mp make_pair
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define decp(n) cout<<fixed<<setprecision((int)n)
#define _GLIBCXX_DEBAC
#include <functional>
/*map<Keyの型, Valueの型> 変数名;
queue<型> 変数名;
priority_queue<型> 変数名;
priority_queue<型, vector<型>, greater<型>> 変数名;*/
//copy(v1.begin(), v1.end(), back_inserter(v2));
using namespace std;

ll gcd(ll a, ll b) {
	ll c;
	if (a < b) {
		c = a; a = b; b = c;
	}
	while (b != 0) {
		c = a % b; a = b; b = c;
	}
	return a;
}

ll lcm(ll a, ll b) {
	ll c;
	c = a * b / gcd(a, b);
	return c;
}

int sort_greater(int m, int n) {
	vector<int> a(m);
	for (int i = 0; i < m; i++) {
		cin >> a[i];
	}
	sort(a.begin(), a.end(), greater<int>());
	for (int i = 0; i < n; i++) {
		cout << a[i];
	}
	return 0;
}

int bubblesort(int a[], int n) {
	int sw = 0;
	bool flag = 1;
	for (int i = 0; flag; i++) {
		flag = 0;
		for (int j = n - 1; j >= i + 1; j--) {
			if (a[j] < a[j - 1]) {
				swap(a[j], a[j - 1]);
				flag = 1;
				sw += 1;
			}
		}
	}
	return sw;
}

int a_z()
{
	for (int i = 0; i <= ('Z' - 'A'); i++) {
		cout << (char)('A' + i);
	}
	return 0;
}

int selecttionsort(int a[], int n) {
	int t, sw = 0, minj;
	for (int i = 0; i < n - 1; i++) {
		minj = i;
		for (int j = 0; j < n - 1; j++) {
			if (a[j] < a[minj]) {
				minj = j;
			}
		}
		t = a[i]; a[i] = a[minj]; a[minj] = t;
		if (i != minj) sw += 1;

	}
	return sw;
}

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

const ll mod = 1000000007;

map<string, int> memo;

using P=pair<ll,ll>;

/*void dfs(int v, int p = -1) {
	for (int u : to[v]) {
		if (u == p) continue;
		ans[u] += ans[v];
		dfs(u, v);
	}
}*/
ll findIndex(int value, vector<ll> a)
{

	for (ll i = 0; i < (ll)a.size(); i++) {
		if (a[i] == value) {
			return i;
		}
	}
	return -1;
}

ll nCr(ll n, ll r) {
	ll a = 1;
	for (ll i = n; i > n - r; --i) {
		a = a * i;
	}
	for (ll i = 1; i < r + 1; ++i) {
		a = a / i;
	}
	return a;
}



const int INF = 1001001001;



int main() {
	int n;
	cin >> n;
	vector<ll> a(n);
	rep(i, n)cin >> a[i];
	ll ans = 0;
	rep(i, n-1) {
		for (int j = i + 1; j < n; j++) {
			ans = max(ans, abs(a[i] - a[j]));
		}
	}
	cout << ans;
	return 0;
}













Measured memory_bytes: 3584
import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int a = stdIn.nextInt();
        int b = stdIn.nextInt();
        int c = stdIn.nextInt();
        int d = stdIn.nextInt();

        boolean isTakahashi = true;

        while(true){
          if(isTakahashi){
            c -= b;
            if(c <= 0){
              System.out.println("Yes");
              return;
            }
          }else{
            a -= d;
            if(a <= 0){
              System.out.println("No");
              return;
            }
          }
          isTakahashi = isTakahashi ? false : true;
        }
    }
}

Measured memory_bytes: 35760
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
typedef long long ll;

int main(){
	int n ; 
	cin >> n ; 
	vector<int> v(3*n) ; 
	for(int i=0;i<3*n;i++){
		cin >> v[i] ; 
	}
	sort(v.rbegin(),v.rend()) ; 
	debug() << imie(v) ; 
	ll ans = 0 ; 
	for(int i=1,j=0;j<n;j++,i+=2){
		ans += v[i] ; 
	}
	cout << ans << endl;
    return 0 ;
}


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

typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1e9+7,INF=mod*mod*3ll;;
#define rep(i,N) for(ll i=0; i<(N); i++)
#define rep1(i,N) for(ll i=1; i<(N); i++)
#define pb push_back

struct edge {ll to; ll cap; ll rev;} ;
vector<edge> G[205];
ll level[205];
ll iter[205];
void add_edge(ll from,ll to,ll cap){
	edge e;
	e.to=to, e.cap=cap, e.rev=G[to].size();
	G[from].push_back(e);
	e.to=from, e.cap=0, e.rev=G[from].size()-1;
	G[to].push_back(e);
}
void bfs(ll s){
	memset(level, -1, sizeof(level));
	queue<ll> que;
	level[s]=0;
	que.push(s);
	while(!que.empty()){
		ll v=que.front();
		que.pop();
		for(ll i=0; i<G[v].size(); i++){
			edge e=G[v][i];
			if(e.cap>0 && level[e.to]<0){
				level[e.to]=level[v]+1;
				que.push(e.to);
			}
		}
	}
}
ll dfs(ll v, ll t, ll f){
	if(v==t) return f;
	for(ll &i=iter[v]; i<G[v].size(); i++){
		edge &e=G[v][i];
		if(e.cap>0 && level[v]<level[e.to]){
			ll d=dfs(e.to, t, min(f, e.cap));
			if(d>0){
				e.cap-=d;
				G[e.to][e.rev].cap+=d;
				return d;
			}
		}
	}
	return 0;
}
ll max_flow(ll s, ll t){
	ll flow=0;
	while(1){
		bfs(s);
		if(level[t]<0) return flow;
		memset(iter, 0, sizeof(iter));
		ll f;
		while((f=dfs(s, t, INF))>0){
			flow+=f;
		}
	}
}

ll N;
ll a[105],b[105],c[105],d[105];

int main(){

cin.tie(0);
ios::sync_with_stdio(false);

cin>>N;

rep(i,N) cin>>a[i]>>b[i];
rep(i,N) cin>>c[i]>>d[i];

//0~N-1 赤い点
//N~N+N-1 青い点
ll s=2*N,t=s+1;
rep(i,N) add_edge(s,i,1);
rep(i,N) add_edge(N+i,t,1);
rep(i,N){
	rep(j,N){
		if(a[i]<c[j]&&b[i]<d[j]) add_edge(i,j+N,1);
	}
}
cout<<max_flow(s,t)<<endl;

}
	


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

int main(void){
    map<char,int> mp;
    string w;
    cin>>w;
    for(char c:w){
        mp[c] ++;
    }

    string ans = "Yes";
    for(auto kv :mp){
        if(kv.second%2 ==1){
            ans = "No";
            break;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

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

        int n = sc.nextInt();
        int S[] = new int[n];
        for (int i = 0; i < n; i++) {
            S[i] = sc.nextInt();
        }

        int q = sc.nextInt();
        int T[] = new int[q];
        for (int i = 0; i < q; i++) {
            T[i] = sc.nextInt();
        }

        int count = 0;
        for (int i = 0; i < q; i++) {
            int result = binarySearch(S, T[i]);
            if(result != -1){
                count++;
            }
        }
        System.out.println(count);

    }

    public static int binarySearch(int[] A, int x) {
        int left = 0;
        int right = A.length;
        int mid;

        while (left < right) {
            mid = (left + right) / 2;
            if (A[mid] == x) {
                return mid;
            } else if (x < A[mid]) {
                right = mid;
            } else {
                left = mid + 1;
            }
        }

        return -1;
    }
}


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

#define uint        unsigned int
#define ld          long double
#define int         long long
#define showoff     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb          push_back
#define pii         pair<int,int>
#define FOR(i,a,b)  for(int i=a;i<b;++i)
#define RFOR(i,a,b) for(int i=a;i>b;--i)
#define f           first
#define se          second
#define maxn        200005
#define all(v)      v.begin(),v.end()
#define sz(x)       (int)x.size()
#define mod         1000000007
#define pqueue      priority_queue<int>
#define pdqueue     priority_queue< int,vector<int> ,greater< int >>

using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//const int md = 998244353;

/*const int mod = 998244353;
int power(int a,int n)
{
    if(n == 1)return a%mod;
    if(n == 0)return 1;
    if(n&1)return ((a%mod)*(power((a*a)%mod,n/2))%mod)%mod;
    return power((a*a)%mod,n/2)%mod;
}
*/
int eat[maxn],a[maxn],b[maxn];

signed main()
{
    showoff;
    int n,s1 = 0,s2 = 0;
    cin >> n;
    vector<pii>v;
    FOR(i,0,n){
    int a,b;
    cin >> a >> b;
    v.pb({-a-b,-a});
    }
    sort(v.begin(),v.end());
    FOR(i,0,n){
    s1 -= v[i].se;
    ++i;
    if(i == n)break;
    s2 -= v[i].f-v[i].se;
    }
    cout << s1-s2;
    return 0;
}


Measured memory_bytes: 2420
#include <bits/stdc++.h>
const double PI = acos(-1);
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    vector<string> s(n);
    vector<int> num(52);
    int count = n;
    for (int  i = 0; i < count; i++)
    {
        cin >> s.at(i) >> a.at(i);
        /* code */
    }
    for(int i = 1; i <= 13; i++){
        for (int j = 0; j < count; j++)
        {
            if(s.at(j) == "S" && a.at(j) == i){
                num.at(i-1) = 1;
            }
        }
        
    }
    for(int i = 1; i <= 13; i++){
        for (int j = 0; j < count; j++)
        {
            if(s.at(j) == "H" && a.at(j) == i){
                num.at(i+12) = 1;
            }
        }
        
    }
    for(int i = 1; i <= 13; i++){
        for (int j = 0; j < count; j++)
        {
            if(s.at(j) == "C" && a.at(j) == i){
                num.at(i+25) = 1;
            }
        }
        
    }
    for(int i = 1; i <= 13; i++){
        for (int j = 0; j < count; j++)
        {
            if(s.at(j) == "D" && a.at(j) == i){
                num.at(i+38) = 1;
            }
        }
        
    }
    for(int i = 0; i <= 12; i++){
        if(num.at(i) == 0){
            cout << "S" << " " << i + 1 << endl;
        }
    }
     for(int i = 13; i <= 25; i++){
        if(num.at(i) == 0){
            cout << "H" << " " << i - 12 << endl;
        }
    }
     for(int i = 26; i <= 38; i++){
        if(num.at(i) == 0){
            cout << "C" << " " << i - 25 << endl;
        }
    }
     for(int i = 39; i <= 51; i++){
        if(num.at(i) == 0){
            cout << "D" << " " << i - 38 << endl;
        }
    }

}
    


Measured memory_bytes: 3132
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <ctime>
#include <list>
#include <numeric>
#include <utility>
#include <ctime>
#define INF 100000000
#define LINF 9000000000000000000
#define mod 1000000007
 
#define rep(i,n) for(int i=0;i<int(n);i++)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair
#define MOD(x) (x%(mod))
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;
 
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;

/*---------------------------------------------------*/

int main(){
  int n,m;
  ll ans=0;
  ll tmp=2;
  cin>>n>>m;
  rep(i,pow(2,m)){
    ans+=(n-m)*100;
    ans+=(m*1900);
  }
  cout<<ans<<endl;
  return 0;
}


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

using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair

int main()
{
	ios::sync_with_stdio(false);
  	cin.tie(0);
	int a,b;
	cin >> a>> b;
	cout << (a+b+1)/2 << "\n";	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using pll=pair<ll,ll>;

const ll MOD=1000000007;

ll abs1(ll a){
  if(a>=0)return a;
  else return -a;
}

ll pow1(ll a,ll b,ll p){
  ll ret=1;
  while(b!=0){
    if((b&1)==1){
      ret*=a;
    }
    a*=a;
    if(a>=p)a%=p;
    b=b>>1;
  }
  return ret;
}

int digit(ll a,ll b){
  int i=0;
  while(a!=0){
    a/=b;
    i++;
  }
  return i;
}

ll gcd1(ll a,ll b){
  if(a==0 && b==0)return 0;
  ll n;
  while(a%b!=0){
    n=a%b;
    a=b;
    b=n;
  }
  return b;
}

ll solveLinear(ll n,ll m,ll c){
  if(n==0 && m==0)return 0;
  ll a[100],b[100];
  a[0]=n;b[0]=m;
  int i=1;
  while(b[i-1]!=0){
    a[i]=b[i-1];
    b[i]=a[i-1]%b[i-1];
    i++;
  }
  n=i;
  if(c%a[n-1]!=0){
    return 0;
  }
  ll x=c/a[n-1],y=0;
  for(i=1;i<n;i++){
    ll cnt=x;
    x=y;
    y=cnt-(a[n-i-1]/b[n-i-1])*y;
  }
  return x;
}

ll modRev(ll a,ll p=MOD){
  a%=p;
  ll n=solveLinear(a,p,1);
  n%=p;
  if(n<0)return n+p;
  return n;
}

ll fact(ll n,ll p=MOD){
  if(n<0)return 0;
  int i;
  ll ret=1;
  for(i=0;i<n;i++){
    ret=ret*(i+1);
    if(ret>=p)ret%=p;
  }
  return ret;
}

ll perm(ll n,ll k,ll p=MOD){
  if(n<0 || k<0 || n<k)return 0;
  int i;
  ll ret=1;
  for(i=0;i<k;i++){
    ret=ret*(n-i);
    if(ret>=p)ret%=p;
  }
  return ret;
}

ll binom(ll n,ll k,ll p=MOD){
  if(n<0 || k<0 || n<k)return 0;
  int i;
  ll ret=1,fact=1;
  for(i=0;i<k;i++){
    ret=ret*(n-i);
    fact*=i+1;
    if(ret>=p)ret%=p;
    if(fact>=p)fact%=p;
  }
  return (ret*modRev(fact))%p;
}

ld d(ld x1,ld y1,ld x2,ld y2){
  return sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
}

int main(){
  int i,j,k,cnt=0;
  ld x[3],y[3];
  for(i=0;i<3;i++)cin>>x[i]>>y[i];
  ld S,s,a[3],h[3];
  a[0]=d(x[0],y[0],x[1],y[1]);
  a[1]=d(x[1],y[1],x[2],y[2]);
  a[2]=d(x[2],y[2],x[0],y[0]);
  s=(a[0]+a[1]+a[2])/2;
  s=sqrt(s*(s-a[0])*(s-a[1])*(s-a[2]));
  for(i=0;i<3;i++)h[i]=2*s/a[i];
  ld mi=INT_MAX;
  for(i=0;i<3;i++)mi=min(mi,h[i]);
  printf("%.10llf\n",2*s/(a[0]+a[1]+a[2]+2*mi));
}


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

using namespace std;

int main() {
	double x1, x2, y1, y2;

	cin >> x1 >> y1 >> x2 >> y2;
	cout << fixed << setprecision(6)
		<< sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2)) << endl;

	return 0;
}


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

int main(void) {
	string word, text;

	cin >> word;
	transform(word.begin(), word.end(), word.begin(), ::tolower);

	int count = 0;
	while (cin>>text) {
		if (text == "END_OF_TEXT")
			break;
		transform(text.begin(), text.end(), text.begin(), ::tolower);
		if (text == word)
			count++;
		
	}

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

Measured memory_bytes: 3208
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(v) v.begin(), v.end()
#define mem(arr) memset(arr, 0, sizeof(arr))
#define ff first
#define ss second
#define int long long int
const int MOD = 1e9 + 7;
const int INF = 1e18;
const int N = 1e6 + 1;
vector<int> g[N];
vector<int> vis(N);
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int tc = 1;
    while(tc--){
        int n;
        cin >> n;
        int a[n];
        int mx = 0;
        int ans = 0;
        for(int &it : a){
            cin >> it;
            mx = max(mx, it);
            ans += max(0LL, mx - it);
        }
        cout << ans << '\n';
    }
}

Measured memory_bytes: 35916
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(int)(a); i!=(int)(b); i++)
#define RFOR(i, a, b) for(int i=(int)(a); i!=(int)(b); i--)
#define REP(i, n) FOR(i, 0, n)
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;

int n, m;
Graph g;
vector<bool> included;
deque<int> path;

bool checkf(int v){
  for(int& u: g[v]){
    if(!included[u]){
      path.emplace_front(u);
      included[u] = true;
      return true;
    }
  }
  return false;
}

bool checkb(int v){
  for(int& u: g[v]){
    if(!included[u]){
      path.emplace_back(u);
      included[u] = true;
      return true;
    }
  }
  return false;
}

int main(){
  cin >> n >> m;
  g.resize(n+1);
  included.resize(n+1);

  REP(i, m){
    int a, b; cin >> a >> b;
    g[a].emplace_back(b);
    g[b].emplace_back(a);
  }

  path.emplace_back(1); path.emplace_back(g[1][0]);
  included[1] = included[g[1][0]] = true;

  while(checkf(path[0]) || checkb(path[path.size()-1]));

  cout << path.size() << endl;
  for(int& v: path) cout << v << " ";
  cout << endl;

  return 0;
}


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

int main(){
  int k, x;
  cin >> k >>x;

  for(int i=x-(k-1); i<x+k; ++i){
    cout << i << " ";
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <deque>
#include <queue>
#include <cmath>
#include <algorithm>
#include <utility>
#include <functional>
#include <fstream>
#define debug(x) cout << #x << " = " << x << endl
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define repr(i,n) for(int i = (n); i > -1; i--)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const double EPS = 1e-9;

map<ll, ll> prime_factor(ll n) {
  map<ll, ll> res;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if(n != 1) res[n] = 1;
  return res;
}

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

  ll n,p;
  cin>>n>>p;
  ll ans = 1;
  ll t = p;
  map<ll, ll> m = prime_factor(p);
  for(auto x:m) {
    ans *= (ll)pow(x.first, x.second / n);
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define   PI    acos(-1)
#define mx 1000
int fx[]={0,0,-1,1};
int fy[]={1,-1,0,0};
int main()
{
    ll n,i,j,weight,val,cap;
    cin>>n>>cap;
    ll dp[cap+5];
    memset(dp,0,sizeof(dp));
    for(i=0;i<n;i++){
        cin>>weight>>val;
        for(j=cap;j>=weight;j--){
            dp[j]=max(dp[j],dp[j-weight]+val);
        }
    }
    cout<<dp[cap]<<endl;

    return 0;
}


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

int main(void) {
	int N; cin >> N;
	int a, b, x, y; cin >> a;
	int i;

	x = a;
	y = a;

	for (i = 0; i < N - 1; i++) {
		cin >> b;
		x = max(x, b);
		y = min(y, b);
	}
	cout << x - y << endl;
	return 0;
}

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



using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;


//container util
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)



int main(void){

	int A, B, C, D; cin >> A >> B >> C >> D;

	int lower = max(A, C);
	int upper = min(B, D);

	cout << max(0, upper-lower) << endl;



	return 0;

}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
const int N = 15;
char a[N]; 
int main(){
    scanf("%s",a);
    for(int i=0;i<strlen(a);i++)
        if(a[i]=='1')
            printf("9");
        else if(a[i]=='9')
            printf("1");
        else
            printf("%c",a[i]);
    printf("\n");
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int n,m,i,j,k;
int main(){
	scanf("%d",&n);
	if(n>=400&&n<=599) printf("8");
	else if(n>=600&&n<=799) printf("7");
	else if(n>=800&&n<=999) printf("6");
	else if(n>=1000&&n<=1199) printf("5");
	else if(n>=1200&&n<=1399) printf("4");
	else if(n>=1400&&n<=1599) printf("3");
	else if(n>=1600&&n<=1799) printf("2");
	else if(n>=1800&&n<=1999) printf("1");
	return 0;
}

Measured memory_bytes: 1660
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <complex>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <assert.h>
#include <array>
#include <cstdio>
#include <cstring>
#include <random>
#include <functional>
#include <numeric>
#include <bitset>

using namespace std;

struct before_main{before_main(){cin.tie(0); ios::sync_with_stdio(false);}} before_main;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }

typedef long long ll;
int const inf = 1<<29;

namespace math { namespace integer {

template<class value_type> value_type mod_mul(value_type x, value_type k, ll m) { if(k == 0) { return 0; } if(k % 2 == 0) { return mod_mul((x+x) % m, k/2, m); } else { return (x + mod_mul(x, k-1, m)) % m; } }
template<class value_type> value_type mod_pow(value_type x, value_type n, ll mod) { if(n == 0) { return 1; } if(n % 2 == 0) { return mod_pow(mod_mul(x, x, mod) % mod, n / 2, mod); } else { return mod_mul(x, mod_pow(x, n - 1, mod), mod); } }
template<class value_type> value_type extgcd(value_type a, value_type b, value_type& x, value_type& y) { value_type d = a; if(b != 0) { d = extgcd(b, a%b, y, x); y -= (a / b) * x;} else { x = 1, y = 0; } return d; }
template<class value_type> value_type mod_inverse(value_type x, ll mod) { return mod_pow(x, value_type(mod-2), mod); /* use fermat */ }
template<class value_type> value_type mod_inverse_composite_num_mod(value_type a, ll mod) { value_type x, y; extgcd(a, mod, x, y); return (mod + x % mod) % mod; }

}}
using namespace math::integer;

#define int long long

int lcm(int x, int y) {
  return x / __gcd(x, y) * y;
}

signed main() {

  for(int A, B, d; cin >> A >> B >> d && (A|B|d);) {
    int G = __gcd(__gcd(A, B), d);
    A /= G, B /= G, d /= G;
    int ans = 1e18, tx = -1, ty = -1, axby = 1e18;
    for(int sgn=-1; sgn<2; sgn+=2) {
      int a = sgn * A, b = -sgn * B;
      int x, y; int g = extgcd(a, b, x, y);
      x *= d / g, y *= d / g;
      int L = lcm(a, b);
      for(int i=0; i<50000; i++) {
        if(x >= 0 || y >= 0) {
          if(minimize(ans, abs(x) + abs(y))) {
            axby = a * x + b * y;
            tx = x, ty = y;
          }
          else if(ans == abs(x) + abs(y)) {
            if(minimize(axby, a * x + b * y)) {
              tx = x, ty = y;
            }
          }
        }
        x += L / abs(a);
        y += L / abs(b);
      }
    }
    cout << abs(tx) << " " << abs(ty) << endl;

  }
  
  return 0;
}

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


int main(){
    string s;
    ll k;
    cin>>s;
    cin>>k;
    int a=-1,b=-1;
    for(int i=0;i<s.size();i++){
            if(s[i]!='1'){
            a=i+1;
            b=s[i]-'0';
            break;
        }
    }
    
    if(a==-1){
        cout<<1<<endl;
    }else if(k<a){
        cout<<1<<endl;
    }else{
        cout<<b<<endl;
    }
    return 0;
}

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

const int Mod=1e9+7;

int N,M,K,L,Ans;
int F[4005][2005],Pre[2005];

int main(){
	int i,j;
	scanf("%d%d%d",&N,&M,&K),L=(N+M-1)/(K-1);
	F[0][0]=1;
	for(i=0;i<=M;i++)
		Pre[i]=1;
	for(i=1;i<=L;i++){
		for(j=0;j<=M;j++){
			F[i][j]=(Pre[j]-(j>K-1?Pre[j-K]:0)+Mod)%Mod;
			if(j&&j%(K-1)==M%(K-1)&&i*(K-1)-j+1<=N&&(i*(K-1)-j+1)%(K-1)==N%(K-1))
				Ans=(Ans+(F[i][j]-F[i-1][j]+Mod)%Mod)%Mod;
		}
		Pre[0]=F[i][0];
		for(j=1;j<=M;j++)
			Pre[j]=(Pre[j-1]+F[i][j])%Mod;
	}
	printf("%d\n",Ans);
	return 0;
}

Measured memory_bytes: 31616
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;

vector<ll> enum_prime(int n){   // containing n
    vector<ll> res;
    if (n <= 1) return res;
    vector<bool> p(n + 1);
    fill(p.begin() + 2, p.end(), true);
    for(int i = 2; i <= n; i++){
        if(p[i]){
            res.push_back(i);
            for(int j = i * 2; j <= n; j += i) p[j] = false;
        }
    }
    return res;
}

int main()
{
    ll n;
    cin >> n;
    vector<ll> prime = enum_prime(1000000);
    vector<int> v;
    for(ll p : prime){
        int l = 0;
        while(n % p == 0){
            n /= p;
            l++;
        }
        if(l) v.push_back(l);
    }
    if(n != 1) v.push_back(1);
    int s[30];
    s[0] = 0;
    for(int i = 1; i < 30; i++) s[i] = s[i - 1] + i;
    int ans = 0;
    for(int x : v){
        int r = upper_bound(s, s + 30, x) - s - 1;
        ans += r;
    }
    cout << ans << endl;
}


Measured memory_bytes: 4444
#include<bits/stdc++.h>
using namespace std;int prime(int t){for(int x=2;x*x<=t;x++){if(t%x==0){return 2;}}return 1;}int main(){int a,m=0;cin>>a;int b[a];for(int i=3;;i+=10){if(prime(i)==1){b[m]=i;m++;}if(m==a){break;}}for(int i=0;i<a;i++){cout<<b[i]<<" ";}return 0;}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long ;
int main(){
    int n;
    cin >> n;
    bool ok=false;
    vector<ll> a(n);
    vector<ll> b(n);
    rep(i,n) cin >> a[i];
    rep(i,n) cin >> b[i];

    ll asum=0,bsum=0;
    rep(i,n) asum += a[i];
    rep(i,n) bsum += b[i];
    if(asum >= bsum) ok=true;
    if(!ok){
        cout << -1 << endl;
        return 0;
    }
    else{
        ll cant=0,cantk=0;
        vector<ll> yoyu(n);
        rep(i,n){
            if(a[i]<b[i]){
                cant += b[i] - a[i];
                cantk++;
            }
            else{
                yoyu.push_back(a[i]-b[i]);
            }
        }
        if(cant == 0){
            cout << 0 << endl;
            return 0;
        }
        sort(yoyu.rbegin(),yoyu.rend());
        rep(i,yoyu.size()){
            cant -= yoyu[i];
            cantk++;
            if(cant<0) break;
        }
        cout << cantk << endl;
        
    }
    
}

Measured memory_bytes: 6376
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int K = scanner.nextInt();
		int X = scanner.nextInt();
		int Y = scanner.nextInt();
		int sum = 0;
		for(int i = 0 ; i<N;i++){
			sum += i<K?X:Y;
		}
		System.out.println(sum);
		scanner.close();
	}
}

Measured memory_bytes: 21844
-- https://github.com/minoki/my-atcoder-solutions
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}
import Data.Char (isSpace)
import Data.Int (Int64)
import Data.List (unfoldr, scanl)
import Control.Monad
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector.Unboxed.Mutable as UM
import qualified Data.ByteString.Char8 as BS
import Data.Bifunctor
import Control.Exception

-- d <= 2 * k && x >= 0 && y >= 0 && (even (x + y) || odd k)
solveSmall :: Int -> Int -> Int -> [(Int,Int)]
solveSmall !k !x !y
  | assert (x >= 0 && y >= 0 && d <= 2 * k) False = undefined
  | d == 0 = []
  | d == k = [(x,y)]
  | odd (x + y) && d < k =
    let !x1 = -1
        !y1 = 1-k
    in (x1,y1) : map (bimap (+ x1) (+ y1)) (solveSmall k (x-x1) (y-y1))
  | odd (x + y) {- k < d < 2*k -} =
    let (x1,y1) | x >= k = (k,0)
                | y >= k = (0,k)
                | otherwise = (x,k-x) -- k < x + y && x < k && y < k
    in (x1,y1) : map (bimap (+ x1) (+ y1)) (solveSmall k (x-x1) (y-y1))
  | otherwise {- even (x + y) -} =
    if x >= y
    then let !x1 = (x + y) `quot` 2
             !y1 = x1 - k
         in [(x1,y1), (x,y)]
    else let !y1 = (x + y) `quot` 2
             !x1 = y1 - k
         in [(x1,y1), (x,y)]
  where d = abs x + abs y -- <= 2 * k

-- x >= 0 && y >= 0
solve :: Int -> Int -> Int -> [(Int,Int)]
solve !k !x !y
  | d < 2 * k = solveSmall k x y
  -- Now x + y >= 2 * k holds, which implies x >= k || y >= k
  | otherwise =
    let (q,r) = x `quotRem` k -- 0 <= r < k
        (q',r') = y `quotRem` k -- 0 <= r' < k
        -- abs (q*k - x) + abs (q'*k - y)
        --   = r + r' < 2*k-1
        (m,n) | 0 < r + r' && r + r' < k =
                -- 2*k <= x + y = (q+q')*k + r+r'
                -- k < 2*k - (r+r') <= (q+q')*k
                -- Therefore, 1 < q+q'
                if q > q'
                then (q-1,q')
                else (q,q'-1)
              | otherwise {- k <= r+r' -} = (q,q')
        !x1 = m*k
        !y1 = n*k
    in [(i*k,0) | i <- [1..m]] ++ [(x1,j*k) | j <- [1..n]] ++ map (bimap (+ x1) (+ y1)) (solveSmall k (x-x1) (y-y1))
  where d = abs x + abs y

main = do
  k <- readLn
  [x,y] <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
  if k >= 2 && even k && odd (x + y)
    then putStrLn "-1"
    else do let xs = solve k (abs x) (abs y)
                ys | x < 0 && y < 0 = map (bimap negate negate) xs
                   | x < 0 = map (first negate) xs
                   | y < 0 = map (second negate) xs
                   | otherwise = xs
            -- print $ check k ys
            print $ length ys
            forM_ ys $ \(x',y') -> putStrLn $ unwords [show x', show y']

check :: Int -> [(Int,Int)] -> Bool
check !k xs = and $ zipWith (\(x0,y0) (x1,y1) -> abs (x0-x1) + abs (y0-y1) == k) ((0,0) : xs) xs


Measured memory_bytes: 28924
#include <iostream>
#include <algorithm>
#include <queue>


using namespace std;

int main(){
  long long N;

  cin>>N;
  for(int h = 1;h<=3500;h++){
    for(int n = 1;n<=3500;n++){
      long long bunbo = 4 * h * n - N * (n + h);
      if(bunbo <= 0)
	continue;

      long long bunshi = N * h * n;
      if(bunshi%bunbo == 0){
	//for debug
	//cout<<bunshi<<"\t/\t"<<bunbo<<"\t=\t"<<bunshi/bunbo<<endl;

	cout<<h<<" "<<n<<" "<<bunshi/bunbo<<endl;
	return 0;
      }
	
    }
  }

  return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
	public static void main(String[] args)throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int AA1=Integer.parseInt(br.readLine());
		String[] in = br.readLine().split("\\s+");
		int[] AA=new int[AA1]; 
		for(int i=0;i<AA1;i++){
			 AA[i]=Integer.parseInt(in[i]);
			}
		int AA2=Integer.parseInt(br.readLine());
		String[] in2 = br.readLine().split("\\s+");
		int[] AAA=new int[AA2];
		int ans=0;
		for(int i=0;i<AA2;i++){
			 AAA[i]=Integer.parseInt(in2[i]);
			 for(int j=0;j<AA1;j++){
				 if(AAA[i]==AA[j]){
					 ans++;
					 break;
				 }
			 }
			}
		System.out.println(ans);
		
		
	
			
			
	}
}

Measured memory_bytes: 23580
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int x, y;
bool f = 0;
int main()
{
    cin.sync_with_stdio(0); cin.tie(0);
    cin >> x >> y;
    for(int i = 0; i <= x; i++){
        if((y-i*2)%4 == 0){
            if(i+(y-i*2)/4 == x){
                f = 1;
            }
        }
    }
    if(f)cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3648
#include <stdio.h>
                                                                                                
  
long long dig(long long x, long long y){


    long long t = 0;

    long long s = 0;

    
    if( x > y ) s = x;

    else s = y;


    for( ; s > 0 ; ){

           s = s / 10;

           t += 1;

           }

    return t;

    }



int main(void){
                                                                                                
   
    long long n, a, b;    

    int k;

    int f = 10;
   
      
    scanf("%lld", &n);

    for( a = 1 ; a * a <= n ; a = a + 1 ){
   
        if( n % a == 0 ) {

            b = n / a;

            k = dig(a, b);

            if( k < f ) f = k;

            }

         }
       

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

    return 0;
                                                          
}

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

int main() {
    int h, w;
    cin >> h >> w;

    string frame;
    for (int i = 0; i < w + 2; i++) {
        frame += '#';
    }

    string pic[h + 2];
    pic[0] = frame;
    pic[h + 1] = frame;

    for (int i = 0; i < h; i++) {
        string p; cin >> p;
        pic[i+1] = '#' + p + '#';
    }

    for (int i = 0; i < h+2; i++) {
        cout << pic[i] << endl;
    }

    return 0;
}

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

#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

double distance(int64_t x1, int64_t y1, int64_t x2, int64_t y2) {
    auto dx = x1 - x2;
    auto dy = y1 - y2;

    return sqrt(dx * dx + dy * dy);
}

struct Circle {
    int64_t x, y, r;

    double distance_to(int64_t xx, int64_t yy) const {
        return max(0., distance(x, y, xx, yy) - r);
    }

    double distance_to(const Circle& other) const {
        return max(0., distance_to(other.x, other.y) - other.r);
    }
};

istream& operator>>(istream& is, Circle& c) { return is >> c.x >> c.y >> c.r; }

int main() {
    int64_t xs, ys, xt, yt;
    cin >> xs >> ys >> xt >> yt;

    int64_t n;
    cin >> n;

    vector<Circle> cs(n);
    for (auto&& cc : cs) {
        cin >> cc;
    }

    vector<vector<pair<int64_t, double>>> adjs(n + 2);
    adjs[0].emplace_back(n + 1, distance(xs, ys, xt, yt));
    for (auto i : irange(0L, n)) {
        // from start
        adjs[0].emplace_back(i + 1, cs[i].distance_to(xs, ys));

        // to target
        adjs[i + 1].emplace_back(n + 1, cs[i].distance_to(xt, yt));

        for (auto j : irange(i + 1, n)) {
            adjs[i + 1].emplace_back(j + 1, cs[i].distance_to(cs[j]));
            adjs[j + 1].emplace_back(i + 1, cs[i].distance_to(cs[j]));
        }
    }

    priority_queue<pair<double, int64_t>> q;
    vector<double> costs(n + 2, numeric_limits<double>::max());
    q.emplace(0L, 0L);
    costs[0] = 0;
    while (!q.empty()) {
        auto cost = -q.top().first;
        auto v = q.top().second;
        q.pop();

        if (cost > costs[v]) {
            continue;
        }

        if (v == n + 1) {
            cout << setprecision(20) << cost << endl;
            return 0;
        }

        for (const auto& edge : adjs[v]) {
            auto u = edge.first;
            auto new_cost = cost + edge.second;

            if (new_cost < costs[u]) {
                costs[u] = new_cost;
                q.emplace(-new_cost, u);
            }
        }
    }
}

Measured memory_bytes: 22164
package main
 
import (
	"fmt"
)
 
func main() {
    var a int
  	var b float64
  	var o float64
	fmt.Scan(&a)
    if a % 2 == 0 {
		b = float64(a) / 2
		o = float64(b) / float64(a)
  	} else {
		b = float64((a + 1)) / 2
		o = float64(b) / float64(a)
  	}
	fmt.Print(o)
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <functional>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <deque>
#include <ctime>

using namespace std;

#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define pb push_back
#define mp make_pair
#define all(r) (r).begin(),(r).end()
#define rall(r) (r).rbegin(),(r).rend()
#define fi first
#define se second
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))


typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;
const double PI = acos(-1);

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

int main(){

    int n;
    char s[110];
    cin >> n;

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

    int mx = 0;
    int tmp = 0;


    for(int j=0; j<n; j++){
        if(s[j] == 'I'){
            tmp += 1;
            if(mx < tmp) mx = tmp; //最大値の更新
        }else if(s[j] == 'D'){
            tmp -= 1;
        }
    }

    cout << mx << endl;

}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
 
int isprime(long);

int main(){
  int N, n, t = 0;
  long L;

  scanf("%d\n",&N);

  for(n = 0; n < N; n++){
    scanf("%ld\n", &L);
    if (L==2){
       t++;
    }else if(L>2){
       t+=isprime(L);
    }
  }
  printf("%d\n",t);
  return 0;
}

int isprime(long L){
  long i = 3;
  long Ls = (long)sqrt(L);
  if (!(L%2)){
      return 0;
  }
  while (i <= Ls){
    if(!(L%i)){
       return 0;
    }
    i += 2;
  }
  return 1;
}

Measured memory_bytes: 600
// Daniel Grzegorzewski15
// while (clock()<=69*CLOCKS_PER_SEC)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")

#define MP make_pair
#define PB push_back
#define ST first
#define ND second

using namespace __gnu_pbds;
using namespace std;

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

//X.find_by_order(k); - zwraca iterator na k-ty element (numeracja od zerowego)
//X.order_of_key(k); - zwraca liczbę elementów ostro mniejszych niż k

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef long long LL;

void init_ios() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}

const int N = 5*(int)1e5 + 3;
int SQ = 700;

int n, q, wyn, c[N], cnt[N], res[N];
vector<pair<PII, int>> que;

bool cmp(pair<PII, int> x, pair<PII, int> y) {
  if (x.ST.ST/SQ != y.ST.ST/SQ)
    return x.ST.ST < y.ST.ST;
  return x.ST.ND > y.ST.ND;
}

int main() {
  init_ios();
  cin >> n >> q;
  SQ = max(4, q/(int)sqrt(n));
  for (int i = 1; i <= n; ++i)
    cin >> c[i];
  for (int i = 1; i <= q; ++i) {
    int l, r;
    cin >> l >> r;
    que.PB({{l, r}, i});
  }
  sort(que.begin(), que.end(), cmp);
  int l = 1, r = 1;
  wyn = cnt[c[l]] = 1;
  for (auto el: que) {
    int le = el.ST.ST;
    int ri = el.ST.ND;
    int id = el.ND;
    while (le < l) {
      --l;
      ++cnt[c[l]];
      if (cnt[c[l]] == 1)
        ++wyn;
    }
    while (r < ri) {
      ++r;
      ++cnt[c[r]];
      if (cnt[c[r]] == 1)
        ++wyn;
    }
    while (l < le) {
      --cnt[c[l]];
      if (cnt[c[l]] == 0)
        --wyn;
      ++l;
    }
    while (ri < r) {
      --cnt[c[r]];
      if (cnt[c[r]] == 0)
        --wyn;
      --r;
    }
    res[id] = wyn;
  }
  for (int i = 1; i <= q; ++i)
    cout<<res[i]<<"\n";
}

Measured memory_bytes: 15540
const Main = input => {
    input = input.split("\n");
    const s = input[0];
    const t = input[1];

    let count = 0;
    for(let i = 0; i < s.length; i++) {
        if(!(s.charAt(i) === t.charAt(i))) {
            count++;
        }
    }
    
    console.log(count);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 33144
//abc123 b 最後に注文するものを決める
#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    int n; cin>>n;
    int ans=0;
    int a[n];
    for(int i=0;i<n;i++) cin>>a[i];
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            ans=max(ans,abs(a[j]-a[i]));
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256