akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
#define INF 10000000
#define MAX_N 200000
typedef long long ll;
typedef pair<int, int> P;

//int cost[MAX_V][MAX_V];
int d[MAX_N];
//bool used[MAX_V];
int N, M;
struct edge {
	int to, cost;
};
vector<edge> G[MAX_N];

// O(|V^2|)
/*void dijkstra(int s) {
	fill(d, d + V, INF);
	fill(used, used + V, false);
	d[s] = 0;

	while(true) {
		int v = -1;
		rep(u, 0, V) {
			if(!used[u] && (v == -1 || d[u] < d[v])) v = u;
		}
		if(v == -1) break;
		used[v] = true;
		rep(u, 0, V) d[u] = min(d[u], d[v] + cost[u]);
	}
}*/

// O(ElogV)
void dijkstra(int s) {
	fill(d, d + N, INF);
	d[s] = 0;
	priority_queue<P, vector<P>, greater<P> > q;
	q.push(make_pair(0, s)); // distance, index)

	while(!q.empty()) {
		P p = q.top();
		q.pop();
		int v = p.second;
		if(d[v] < p.first) continue;
		rep(i, 0, G[v].size()) {
			edge e = G[v][i];
			if(d[e.to] > d[v] + e.cost) {
				d[e.to] = d[v] + e.cost;
				q.push(P(d[e.to], e.to));
			}
		}
	}
}


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

	cin >> N >> M;
	rep(i, 0, M) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		edge e1, e2;
		e1.to = b;
		e1.cost = 1;
		G[a].push_back(e1);
		e2.to = a;
		e2.cost = 1;
		G[b].push_back(e2);
	}

	dijkstra(0);

	if(d[N - 1] == 2) {
		cout << "POSSIBLE" << endl;
	} else {
		cout << "IMPOSSIBLE" << endl;
	}



}


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

int main(void) {
	string o, e;

	cin >> o;
	cin >> e;

	int max = o.length() > e.length()
		? o.length()
		: e.length();

	for (int i = 0; i < max; i++) {
		if (o[i] != '\0') cout << o[i];
		if (e[i] != '\0') cout << e[i];
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

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

    ll n;
    cin >> n;
    map<ll, ll> mp;
    for(ll j = 2; j <= n; j++){
        ll p = j;
        for(ll i = 2; i * i <= p; i++){
    	    while(p % i == 0){
      		    p /= i;
      		    mp[i]++;
    	    }
  	    }
  	    if(p != 1) mp[p]++;
    }

    ll res = 0;
    for(int i = 2; i <= n; i++){
        for(int j = i + 1; j <= n; j++){
            for(int k = 2; k <= n; k++){
                if(k == i || k == j) continue;
                if(mp[i] >= 4 && mp[j] >= 4 && mp[k] >= 2) res++;
            }
        }
    }
    for(int i = 2; i <= n; i++){
        for(int j = 2; j <= n; j++){
            if(j == i) continue;
            if(mp[i] >= 14 && mp[j] >= 4) res++;
            if(mp[i] >= 24 && mp[j] >= 2) res++;
        }
    }
    for(int i = 2; i <= n; i++){
        if(mp[i] >= 74) res++;
    }
    cout << res << endl;
    return 0;
}

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

struct Team{
    vector<bool> is_solve;
    vector<int> WA;
    int team_id, time, solved;
    Team(){}
    Team(int P, int id){
        is_solve = vector<bool>(P, false);
        WA = vector<int>(P, 0);
        team_id = id;
        time = 0;
        solved = 0;
    }
};
bool operator<(const Team &a, const Team &b){
    if( a.solved == b.solved ){
        if( a.time == b.time ){
            return a.team_id > b.team_id;
        }
        return a.time < b.time;
    }
    return a.solved > b.solved;
}
bool operator==(const Team &a, const Team &b){
    return a.solved == b.solved && a.time == b.time;
}

int main(){
    int M, T, P, R;
    while( cin >> M >> T >> P >> R, M ){
        vector<Team> v;
        for(int i = 0; i < T; i++){
            v.push_back( Team(P, i) );
        }
        
        for(int i = 0; i < R; i++){
            int m, t, p, j;
            cin >> m >> t >> p >> j;
            t--; p--;
            if( j == 0 ){ // Correct Answer
                for(int k = 0; k < v.size(); k++){
                    if( v[k].team_id == t ){
                        v[k].is_solve[p] = true;
                        v[k].solved++;
                        v[k].time += m;
                        v[k].time += 20 * v[k].WA[p];
                        break;
                    }
                }
            }else{ // Wrong Answer
                for(int k = 0; k < v.size(); k++){
                    if( v[k].team_id == t ){
                        v[k].WA[p]++;
                        break;
                    }
                }
            }
        }
        
        sort(v.begin(), v.end());
        for(int i = 0; i < v.size(); i++){
            if( i ){
                bool flag = (v[i-1] == v[i]);
                cout << (flag? "=" : ",");
            }
            cout << v[i].team_id + 1;
        }
        cout << endl;
    }
}

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

int main(){
    int D;
    cin >> D;
    if(D == 25) {
        cout << "Christmas" << endl;
    }
    else if(D == 24) {
        cout << "Christmas Eve" << endl;
    }
    else if(D == 23) {
        cout << "Christmas Eve Eve" << endl;
    }
    else {
        cout << "Christmas Eve Eve Eve" << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[100005];
int main(){
	long long h,n,ans=0;
	cin>>h>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
		ans+=a[i];
	}
	if(ans>=h) cout<<"Yes";
	else cout<<"No";
	return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <math.h>
using namespace std;

int main(){
  string S; cin >> S;
  long long K; cin >> K;
    
  if(K==1){cout << (int)S[0]-48;}
  else{
    int p=0;
    while('1'==S[p]){p++;}
    if(K<=p){cout << 1;}
    else{cout << (int)S[p]-48;}
  }
  
  return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
 
## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
 
N=int(input())
H= list(map(int, input().split()))

count = 0
tmp = 0

for i in range(1,N):
    if H[i-1] >= H[i]:
        tmp += 1
    else:
        count = max(count,tmp)
        tmp = 0
    if i == N-1:
        count = max(count,tmp)       

print(count)

Measured memory_bytes: 91028
#include <bits/stdc++.h>
#define enl printf("\n")
#define case(t) printf("Case #%d: ", (t))
#define ni(n) scanf("%d", &(n))
#define nl(n) scanf("%lld", &(n))
#define nai(a, n) for (int i = 0; i < (n); i++) ni(a[i])
#define nal(a, n) for (int i = 0; i < (n); i++) nl(a[i])
#define pri(n) printf("%d\n", (n))
#define prl(n) printf("%lld\n", (n))
#define pii pair<int, int>
#define vii vector<pii>
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
typedef long long ll;
const double pi = acos(-1);
const int MOD = 998244353;
const int INF = 1e9 + 7;
const int MAXN = 3e5 + 5;
const double eps = 1e-9;
using namespace std;
ll fac[MAXN], inv[MAXN];

ll bin(ll a, ll b) {
    ll ret = 1;
    while (b) {
        if (b & 1)
            ret = (ret * a) % MOD;
        a = (a * a) % MOD;
        b /= 2ll;
    }
    return ret;
}

ll ncr(int n, int k) {
    if (k > n || k < 0) return 0;
    return (fac[n] * inv[k] % MOD) * inv[n-k] % MOD;
}

int main() {
    fac[0] = 1;
    for (ll i = 1; i < MAXN; i++)
        fac[i] = fac[i - 1] * i % MOD;
    inv[0] = 1;
    for (ll i = 1; i < MAXN; i++)
        inv[i] = bin(fac[i], MOD - 2);
    ll n, a, b, k;
    nl(n), nl(a), nl(b), nl(k);
    ll ans = 0;
    if (k % __gcd(a, b) != 0)
        return !pri(0);
    for (ll x = 0; x <= n; x++) {
        if ((k - x * a) % b != 0)
            continue;
        ll y = (k - x * a) / b;
        ans = (ans + ncr(n, x) * ncr(n, y) % MOD) % MOD;
    }
    prl(ans);
    return 0;
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


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

  if(a >= 3200) cout << s << endl;
  else cout << "red" << endl;
  
  return 0;
}



Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <deque>
#include <iostream>
#include <queue>
#include <stack>
#include <utility>
#include <vector>
using std::cin;
using std::cout;
using std::endl;

int main(void) {
    int n;
    std::vector<int> vec;
    cin >> n;
    for (int i = 0; i < n; i++) {
        int m1;
        cin >> m1;
        vec.push_back(m1);
    }
    std::sort(vec.begin(), vec.end());
    auto itr_max = vec.end();
    itr_max--;
    int max = *itr_max;
    int min = *vec.begin();
    cout << max - min << endl;

    return 0;
}


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

void Cont(){
    int N,K;
    cin >> N >> K;
    vector<bool> sunukers(N);
    for(int i=0;i<K;i++){
        int havers;
        cin >> havers;
        for(int j=0;j<havers;j++){
            int who;
            cin >> who;
            sunukers.at(who-1)=1;
        }
    }
    int sum = N;
    for(const auto& v : sunukers){
        if(v)
            sum--;
    }
    cout << sum << "\n";
}

int main()
{
	std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Cont();
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
int N, A[1000000], cnt;

void Out(const vector<int> G) {
	cout << G.size() << endl;
	cout << G.back();
	for (int i = G.size() - 2; i >= 0; i--) {
		cout << ' ' << G[i];
	}
	cout << endl;
	cout << cnt << endl;
	for (int i = 0; i < N; i++)
		cout << A[i] << endl;
}

void InsertionSort(int g) {
	for (int i = g; i < N; i++) {
		int v = A[i], j = i - g;
		while (j >= 0 && A[j] > v) {
			A[j + g] = A[j];
			j -= g;
			cnt++;
		}
		A[j + g] = v;
	}
}
void ShellSort(const vector<int> G) {
	cnt = 0;
	for (int i = G.size() - 1; i >= 0; i--) {
		InsertionSort(G[i]);
	}
}

int main()
{
	vector<int> G;
	cin >> N;
	int calc = 1;
	while (calc <= N) {
		G.push_back(calc);
		calc = calc * 3 + 1;
	}
	for (int i = 0; i < N; i++)
		cin >> A[i];
	ShellSort(G);
	Out(G);
	return 0;
}

Measured memory_bytes: 6980
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#include <queue> 
using namespace std;
const int N = 100005;
int n;
int color[N];	// each point's color 
vector<int> G[N];
int bfs(){
	queue<int> q;
	q.push(1);	// first
	q.push(n);	// second
	int cnt[2];
	cnt[0] = cnt[1] = 1;
	while(!q.empty()){
		int u = q.front();
		q.pop();
		for(int i = 0; i < G[u].size(); i++){
			int v = G[u][i];
			if(color[v] == -1){
				color[v] = color[u];
				q.push(v);
				cnt[color[u]]++;
			}
			else if(color[u] != color[v]){
				
			}
			else if(color[v] == color[u]){
			
			} 
		}
	}
	if(cnt[1] > cnt[0]){
		return 1;
	}
	else if(cnt[0] > cnt[1]){
		return 0;
	}
	else if(cnt[1] == cnt[0]){
		return 0;
	}
}
int main(){
	while(~scanf("%d", &n)){
		int x, y;
		
		memset(color, -1, sizeof(color));
		color[1] = 1;	// black
		color[n] = 0;	// white
		for(int i = 1; i <= n; i++){
			G[i].clear();
		}
		
		for(int i = 1; i < n; i++){
			scanf("%d %d", &x, &y);
			G[x].push_back(y);
			G[y].push_back(x);
		}
		
		int ans = bfs();
		ans?puts("Fennec"):puts("Snuke");
			
	}
}

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<string> vs;
typedef pair<int, int> P;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

void YN(bool flg){if(flg) cout << "YES" << endl; else cout << "NO" << endl;}
void Yn(bool flg){if(flg) cout << "Yes" << endl; else cout << "No" << endl;}
void yn(bool flg){if(flg) cout << "yes" << endl; else cout << "no" << endl;}

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

    int n = 1;
    int cnt = 0;
    while(n <= x) {
        cnt++;
        n += cnt;
    }

    cout << cnt << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(ut)(b);i++)
#define REP(i,b) FOR(i,0,b)
#define ALL(c) c.begin(),c.end()
#define PB push_back
#define cat //cout << __LINE__ << endl;
using namespace std;
typedef long long LL;
typedef double ld;
typedef int ut;
typedef vector<ut> VI;
typedef pair<ut,ut> pr;
typedef pair<ut,pr> ppr;
typedef vector<pr> Vpr;
typedef vector<ppr> Vppr;
typedef priority_queue<pr,Vpr,greater<pr> > PQ;
using namespace std;
const int SIZE=1e6;
const LL INF=1LL<<58;
const LL p=1e9+7;
vector<string> nums;
int K;
string s;
double per;
double solve(LL x,LL p){
	if(x&1){return 1+solve(x-1,p)*per+solve(x+1,p)*(1-per);}
	double need=x/2;
	return need/per;
}
int main(){
	LL x,p;
	cin >> x >> p;
	per=p/100.0;
	printf("%12.12f\n",solve(x,p));
	return 0;
}

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

using namespace std;

int input(){
    int n;
    cin>>n;
    return n;
}
long long hello(long long int n, long long m){
    long long h;
    h=n+m;
    return h;
}
int main()
{
    int i, n;
    long long rock=0, lee;
    priority_queue<long long, vector<long long>, greater<long long>> Whyareyouwatching;
    priority_queue <long long> MycodeAr;
    n=input();
    for(i=0;i<n;i++){
        lee=input();
        Whyareyouwatching.push(lee);
        MycodeAr.push(lee);
        rock=hello(rock, lee);
    }
    cout<<Whyareyouwatching.top()<<" "<<MycodeAr.top()<<" "<<rock<<endl;
    return 0;
}


Measured memory_bytes: 3292
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int mod=998244353;
inline int kpow(int a,int b)
{
	int s=1;
	for(;b;b>>=1,a=1ll*a*a%mod)
		if(b&1)s=1ll*s*a%mod;
	return s;
}
int n,ans,jc[10000010],jcv[10000010];
int main()
{
	scanf("%d",&n);
	jc[0]=1;
	for(int i=1;i<=n;++i)jc[i]=1ll*jc[i-1]*i%mod;
	jcv[n]=kpow(jc[n],mod-2);
	for(int i=n;i;--i)jcv[i-1]=1ll*jcv[i]*i%mod;
	int po=1;
	for(int i=n;i>n/2;--i)
	{
		ans=(ans+1ll*jcv[i]*jcv[n-i]%mod*po)%mod;
		(po+=po)>=mod?po-=mod:0;
	}
	ans=(kpow(3,n)+2ll*(mod-ans)*jc[n]%mod)%mod;
	printf("%d",ans);
	return 0;
}


Measured memory_bytes: 78336
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define all(x) x.begin(),x.end()
#define ln '\n'
const double PI = acos(-1.0);
const long long MOD = 1000000007LL;
//const long long MOD = 998244353LL;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
template<class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true;} return false; }
template<class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true;} return false; }
///////////////////////////////////////////////////////////////////////////////////////////////////


int dp[100000][20];

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int N,M; cin >> N >> M;
    vector<vector<int>> dist(N, vector<int>(N,1e9));
    rep(i,M) {
        int u,v,d; cin >> u >> v >> d;
        dist[u][v] = d;
    }

    int ans = 1e9;
    rep(i,N) {
        rep(mask,1<<N) rep(j,N) dp[mask][j] = 1e9;
        dp[1<<i][i] = 0;
        rep(mask,1<<N) {
            bitset<15> s(mask);
            rep(j,N) {
                if (dp[mask][j]==1e9) continue;
                rep(k,N) {
                    if (s.test(k)) continue;
                    if (dist[j][k]==1e9) continue;
                    chmin(dp[mask|(1<<k)][k],dp[mask][j] + dist[j][k]);
                }
            }
        }
        rep(j,N) {
            chmin(ans,dp[(1<<N)-1][j]+dist[j][i]);
        }
    }

    cout << (ans == 1e9 ? -1 : ans) << ln;
}


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

int main() {
    string S;
    cin >> S;
    for (char c = 'a'; c <= 'z'; c++) {
        if (S.find(c) == S.npos) {
            cout << c << endl;
            return 0;
        }
    }
    cout << "None" << endl;
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using vb=vector<bool>;
using vvb=vector<vb>;
using vc=vector<char>;
using vvc=vector<vc>;
using pii = pair<int,int>;
using pil = pair<int,ll>;
using pli = pair<ll,int>;
using pll = pair<ll,ll>;
using tiii = tuple<int,int,int>;
using vpii = vector<pii>;
using vpil = vector<pil>;
using vpli = vector<pli>;
using vpll = vector<pll>;

#define rep(i, n) for(int i=0;i<(int)n;i++)
#define rep2(i, s, n) for(int i=(s);i<(int)n;i++)
int INF=1e9+7;

int main() {
  int K;
  cin >> K;
  ll ten=1,now=0;
  bool flag=false;
  rep(i,K) {
    (now+=ten*7)%=K;
    (ten*=10)%=K;
    if(now==0) {
      cout << i+1 << endl;
      flag=true;
      break;
    }
  }
  if(!flag) cout << -1 << endl;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define fastio() ios_base::sync_with_stdio(false);
#define rmod(x, y) ((((x)%(y))+(y))%(y))
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
template<typename T, typename R = null_type, typename C = less<T>>
tree<T, R, C, rb_tree_tag, tree_order_statistics_node_update> ordered_set(){
	return tree<T, R, C, rb_tree_tag, tree_order_statistics_node_update>();
}

struct dset{
	vector<int> parent, rank;
	dset(){}
	dset(int n) {parent.resize(n, -1), rank.resize(n, 1);}
	int find(int x){return ((parent[x]==-1)?x:(parent[x]=find(parent[x])));}
	void join(int a, int b){
		a = find(a), b = find(b);
		if (a != b){
			if (rank[a]<rank[b]) swap(a, b);
			rank[a]+=rank[b];
			parent[b] = a;
		}
	}
};


int n, k, l, x, y;


int main(){
	scanf("%d %d %d", &n, &k, &l);
	dset road(n), rail(n);
	for(int i = 0; i<k; i++){
		scanf("%d %d", &x, &y);
		road.join(x-1, y-1);
	}
	for(int i = 0; i<l; i++){
		scanf("%d %d", &x, &y);
		rail.join(x-1, y-1);
	}
	map<pair<int, int>, int> cnt;
	for(int i = 0; i<n; i++) cnt[{road.find(i), rail.find(i)}]++;	
	for(int i = 0; i<n; i++) printf("%d ", cnt[{road.find(i), rail.find(i)}]);
	puts("");
	return 0;
}


Measured memory_bytes: 15104
#include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <cstdlib>
using namespace std;

int main(){
  int i,j,n,ans,one;
  string line;
  while(1){
    getline(cin,line);
    if(line == "0") break;
    stringstream sin(line);
    string str;
    ans = 0;
    one = 0;
    while(sin >> str){
      n = atoi(str.c_str()) * 1;
      if(n > 10) n = 10;
      ans += n;
      if(n == 1 && ans <= 11){
	ans += 10;
	one++;
      }

      if(ans > 21){
	if(one > 0){
	  one--;
	  ans -= 10;
	}
	else{
	  ans = 0;
	  break;
	}
      }
    }
    cout << ans << endl;

  }
  return 0;
}

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

int main() {

  int N, K, Q;
  cin >> N >> K >> Q;

  vector<int> A(N);
  for (int i = 0; i < Q; i++) {
    int i_;
    cin >> i_;
    A[i_ - 1]++;
  }

  for (int i = 0; i < N; i++) {
    if (0 < (K + A[i] - Q)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }

}

Measured memory_bytes: 1024
"use strict"
function main(arg) {
    var data = arg.trim().split("\n")
    var c = data[0].split(" ")
    var c_n = data[1].split(" ").map(Number)
    var x = data[2]

    if (x === c[0]) {
        console.log(String(c_n[0] - 1) + " " + String(c_n[1]))
    } else {
        console.log(String(c_n[0]) + " " + String(c_n[1] - 1))
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 21064
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        int place;
        double tSurf, tA;
        Scanner sc = new Scanner(System.in);
        place = sc.nextInt();
        tSurf = sc.nextDouble();
        tA = sc.nextDouble();
        double[] ts = new double[place];
        
        int result = 1;
        double min = 0;
        for(int i = 0; i < place; i++){
            ts[i] = tSurf - sc.nextInt() * 0.006;
            if(i == 0) {
                min = Math.abs(tA - ts[0]);
                continue;
            }
            if(Math.abs(tA - ts[i]) < min){
                min = Math.abs(tA - ts[i]);
                result = i + 1;
            }
        }
        System.out.println(result);
    }
}

Measured memory_bytes: 25824
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		List<S> slist = new ArrayList<>();
		List<C> clist = new ArrayList<>();
		for(int i = 0; i < n; i++){
			slist.add(new S(scanner.nextInt(),scanner.nextInt()));
		}
		for(int i = 0; i < m; i++){
			clist.add(new C(scanner.nextInt(), scanner.nextInt()));
		}

		for(int i = 0; i< n; i++){
			int x = slist.get(i).x;
			int y = slist.get(i).y;
			int len = Integer.MAX_VALUE;
			int count = 0;
			for(int j = 0; j < m; j++){
				int cx = clist.get(j).x;
				int cy = clist.get(j).y;
				if(Math.abs(x-cx) + Math.abs(y-cy) < len){
					len = Math.abs(x-cx) + Math.abs(y-cy);
					count = j;
				}
			}
			System.out.println(count+1);
		}
	}
}

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

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

Measured memory_bytes: 21844
use std::collections::VecDeque;
fn main(){
    let scan = std::io::stdin();
    let mut line = String::new();
    let _ = scan.read_line(&mut line);
    let vec: Vec<&str> = line.split_whitespace().collect();
    let n: i32 = vec[0].parse().unwrap();
    let q: i32 = vec[1].parse().unwrap();

    let mut que: VecDeque<(String, i32)> = VecDeque::new();
    for _ in 0..n{
        let mut line = String::new();
        let _ = scan.read_line(&mut line);
        let vec: Vec<&str> = line.split_whitespace().collect();
        let a: String = String::from(vec[0]);
        let b: i32 = vec[1].parse().unwrap();
        que.push_back((a, b));
    }

    let mut time = 0;
    loop{
        let data = que.pop_front();
        if data == None{
            break;
        }
        let (a,mut b): (String,i32) = data.unwrap();
        if b <= q {
            time = time + b;
            for c in a.chars(){
                print!("{}",c);
            }
            println!(" {:?}",time);
        }else{
            time = time + q;
            b = b - q;
            que.push_back((a, b));
        }
    }
}

Measured memory_bytes: 7084
/**
*    author:  souzai32
*    created: 22.08.2020 21:08:09
**/

#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
typedef long long ll;
using namespace std;

int main() {

    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    int m=a[0];
    ll sum=0;

    for(int i=1; i<n; i++){
        if(a[i]<m) sum+=m-a[i];
        else m=a[i];
    }

    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 4040
#include <iostream>
#include <cmath>
#include <cstdlib>
 
using namespace std;
 
int main(){
         
	int n;
	cin >> n;
	
	int * X;
	int * Y;
	
	X = new int [n];
	Y = new int [n];
	
	for(int i = 0; i < n; i++){cin >> X[i];}
	for(int i = 0; i < n; i++){cin >> Y[i];}
	
	for(int i = 0; i < 3; i++){
		double sum;
		sum = 0;
		for(int j = 0; j < n; j++){
			sum += pow(abs(X[j] - Y[j]),i+1);
		}
		cout << fixed << pow(sum,(1.0/(i+1.0))) << endl;
	}
	
	double max;
	max = 0;
	for(int i = 0; i < n; i++){
		if(max < abs(X[i] - Y[i])){
			max = abs(X[i] - Y[i]);
		}
	}
	cout << fixed << max << endl;
	
	delete[] X;
	delete[] Y;
}

Measured memory_bytes: 1332
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPLL(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;
template<class T>inline bool chmax(T &a, const T &b){if(a < b){a = b; return 1;}return 0;}
template<class T>inline bool chmin(T &a, const T &b){if(a > b){a = b; return 1;}return 0;}
typedef long long ll;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  string S; cin >> S;
  int ans = 0, cur = 0;;
  REP(i, 3){
   if(S[i] == 'S'){
     cur = 0;
   }else{
     cur++;
     ans = max(ans, cur);
   }
  }  
  cout << ans << endl;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef vector<vector<ll>> Graph;

const ll mod = 1e9 + 7;
//const ll mod = 998244353;

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define spa << " " <<
#define fi first
#define se second

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

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

template<typename T> void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cerr<<v[i][0];for(ll j=1;j<w;j++)cerr spa v[i][j];cerr<<endl;}};
template<typename T> void debug(vector<T>&v,ll n){if(n!=0)cerr<<v[0];
for(ll i=1;i<n;i++)cerr spa v[i];
cerr<<endl;};

string num2bit(ll num, ll len){
    string bit = "";
    REP(i, len){
    bit += char('0'+(num>>i & 1));
    }
    return bit;
}

vector<int> graph_bfs(Graph &G, vector<ll> &s){
    const int N = G.size();
    vector<int> dist(N, -1);
    queue<int> qu;

    // initialization
    for(auto v: s){
        qu.push(v);
        dist[v] = 0;
    }

    while(!qu.empty()){
        int now = qu.front();qu.pop();
        for(auto next: G[now]){
            if(dist[next] != -1) continue;
            dist[next] = dist[now] + 1;
            qu.push(next);
        }
    }

    return dist;
}

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

    ll n;
    cin >> n;
    Graph G(n);
    REP(i, n){
        ll u, k;
        cin >> u >> k;
        u--;
        REP(j, k){
            ll v;
            cin >> v;
            v--;
            G[u].push_back(v);
        }
    }

    vector<ll> s = {0};

    auto dist = graph_bfs(G, s);

    REP(i, n){
        cout << i+1 << " " << dist[i] << endl;
    }

    return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> veci;
typedef vector<ll> vecll;
typedef vector<string> vecs;
template<class T,class U> using Hash=unordered_map<T,U>;

#define REP(i, a, n) for(ll i = a; i < (ll)n; i++)
#define RREP(i, a, n) for(ll i = n-1; i >= (ll)a; i--)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) RREP(i, 0, n)
#define MD 1000000007

template<class T> T read(){T a;cin >> a;return a;}
template<class T> void read(T& a){cin >> a;}
template<class T, class ...Args> void read(T& a, Args&... args){cin >> a; read(args...);} 
template<class T> void rarr(T a, int n){for(int i = 0; i < n; i++) {cin >> a[i];}}
template<char c = ' ',class T> void write(T a){cout << setprecision(12) << a << endl;}
template<char c = ' ',class T,class ...Args> void write(T a, Args... args){cout << setprecision(12) << a << c; write<c>(args...);}
template<class T> void warr(vector<T> a, const char* c = " "){cout << a[0];for(int i = 1; i < (int)a.size(); i++)cout << c << a[i];cout << endl;;}
template<class T> void warr(T a, int n, const char* c = " "){cout << a[0];for(int i = 1; i < n; i++)cout << c << a[i];cout << endl;}
void split(string s, string delim, veci& result){result.clear();string::size_type pos = 0;while(pos != string::npos){string::size_type p = s.find(delim, pos);if(p == string::npos){result.push_back(atoi(s.substr(pos).data()));break;}else {result.push_back(atoi(s.substr(pos, p - pos).data()));}pos = p + delim.size();}}
void split(string s, string delim, vecs& result){result.clear();string::size_type pos = 0;while(pos != string::npos){string::size_type p = s.find(delim, pos);if(p == string::npos){result.push_back(s.substr(pos));break;}else {result.push_back(s.substr(pos, p - pos));}pos = p + delim.size();}}
ll gcd(ll a, ll b){while(true){ll k = a % b;if(k == 0)return b;a = b;b = k;}}
ll comb(ll n, ll m){ll p=1;m=min(m,n-m);for(ll i=1;i<=m;i++){p*=n-i+1;p/=i;}return p;}

int main(void)
{
    int n;
    read(n);
    REP(i,1,n+1){
        int x=i;
        if(x%3==0){
            cout << " " << i;
            continue;
        }
        while(x!=0){
            if(x%10==3){
                cout << " " << i;
                break;
            }
            x/=10;
        }
    }
    cout<<endl;
    return 0;
}

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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  ll n,k;
  cin >> n >> k;

  vll h(n);
  REP(i, n)
    cin >> h[i];

  sort(h.begin(), h.end());
  auto it = lower_bound(h.begin(), h.end(), k);
  if(*(h.end()-1) < k)
    cout << 0 << endl;
  else
    cout << n - (it - h.begin()) << endl;

  
}


Measured memory_bytes: 1024
N, Q = map(int, input().split())
S = input()
A = [0, 0]
c = 0
for i in range(1,N):
    if S[i-1:i+1] == "AC":
        c += 1
    A.append(c)
for _ in range(Q):
    l, r = map(int, input().split())
    print(A[r]-A[l])

Measured memory_bytes: 6176
/* ****mittal**** */
#include<bits/stdc++.h>
#define ll          long long int 
#define pb          push_back
#define endl        '\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)    for(ll int i=a;i<b;i++)
#define repr(i,a,b)   for(ll int i=a;i>=b;i--)
#define lbnd    lower_bound
#define ubnd        upper_bound
#define mp          make_pair
using namespace std;
ll add(ll x,ll y)
{
return (x%hell+y%hell)%hell;
}
ll mul(ll x,ll y)
{
return ((x%hell)*(y%hell))%hell;
}
ll sub(ll x,ll y)
{
return (x-y+hell)%hell;
}
#define N  100005
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int TESTS=1;
//    cin>>TESTS;
    while(TESTS--)
    {
        ll n,m,p;
        cin>>n>>m>>p;
        ll a[n+2],b[m+2];
        ll x=hell,y=hell,ans=0;
        for(int i=1;i<=n;i++)
            cin>>a[i],y=min(y,a[i]);
        for(int i=1;i<=m;i++)
            cin>>b[i],x=min(x,b[i]);
        ans=x+y;
        for(int i=1;i<=p;i++)
        {
            ll f,g,h;
            cin>>f>>g>>h;
            ans=min(ans,a[f]+b[g]-h);
        }
        cout<<ans<<endl;


    }
    return 0;
}

Measured memory_bytes: 1792
a = int(input())
w = list(map(int, input().split()))
mae = 0
back = 0
ans = 1000
for i in range(a-1):
    mae += w[i]
    for j in range(a-1,i,-1):
        back += w[j]
    if abs(mae-back) < ans:
        ans = abs(mae-back)
    back = 0
print(ans)

Measured memory_bytes: 3064
#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
string s;
int main()
{
	cin>>s;
	int x;
	char chr;
	chr=s[0];
	x=1;
	for (int i=1;i<s.length();++i)
	{
		if (x==3)
		{
			cout<<"Yes\n";
			return 0;
		}
		if (chr==s[i])
		{
			x++;
		}
		else
		{
			chr=s[i];
			x=1;
		}
	}
	if (x==3)
	{
		cout<<"Yes\n";
	}
	else
	{
		cout<<"No\n";
	}
	return 0;
}

Measured memory_bytes: 384
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
q = int(input())
sm = sum(a)
dic = dict(Counter(a))
for _ in range(q):
    b,c = map(int,input().split())
    if b not in dic:
        print(sm)
    else:
        dif = c-b
        sm = sm+dic[b]*dif
        print(sm)
        x = dic[b]
        if c in dic:
            dic[c]+=x
        else:
            dic[c]=x
        dic[b]=0

Measured memory_bytes: 21168
N=int(input())
X=list(map(int,input().split()))
sum=0
for x in X:
    sum+=x

sum//=N
ans1=0
ans2=0
for x in X:
    ans1+=(x-sum)*(x-sum)
    ans2+=(x-sum-1)*(x-sum-1)
print(min(ans1,ans2))


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

using namespace std;

const int maxn = 1e2+10;
const int maxm = 1e5+10;
const int inf = 1e9+10;

int w[maxn], c[maxn];
int dp[maxm];

void solve(int n, int m)
{
	for (int i = 1; i <= m; i++) dp[i] = inf;

	for (int i = 1; i <= n; i++)
		for (int j = m; j >= c[i]; j--)
			dp[j] = min(dp[j], dp[j-c[i]]+w[i]);
}

int main(void)
{
	int n, m;
	cin >> n >> m;

	for (int i = 1; i <= n; i++)
		cin >> w[i] >> c[i];

	solve(n, maxm-1);

	int ans = 0;
	for (int i = 1; i < maxm; i++)
		if (dp[i] <= m) ans = i;

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

Measured memory_bytes: 640
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n: usize,
        v: [(String, usize); n]
    }
    let mut w: Vec<(String, usize, usize)> = v.iter().cloned().zip(1..).map(|x| ((x.0).0, (x.0).1, x.1)).collect();
    w.sort_by(|x, y| if x.0 == y.0 {y.1.cmp(&x.1)} else {x.0.cmp(&y.0)});
    for i in 0..n {
        println!("{}", w[i].2);
    }
}


Measured memory_bytes: 4352
//file_name:ABC50_A.cpp
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;

    // int scan
    /*
    int x;
    scanf("%d",&x);
    int y;
    scanf("%d",&y);
    int z;
    scanf("%d",&z);

    // matrix scan
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // string scan
    /*
    string s;
    cin >> s;
    */


int main() {
    int a,b;
    char s;
    cin >> a >> s >> b;


    ll ans = a+b;

    if(s=='-'){
        ans = a-b;
    }

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



Measured memory_bytes: 256
n, m = map(int, input().split())
t = list(map(int, input().split()))

ans = 0

for i in range(n):
    if i == n-1:
        ans += m
    elif t[i+1] - t[i] > m:
        ans += m
    else:
        ans += t[i+1] - t[i]

print(ans)




Measured memory_bytes: 30840
#include <bits/stdc++.h>
#define FOR(i, a, n) for(int (i) = (int)(a); (i) < (int)(n); ++(i))
#define FORe(i, a, n) for(int (i) = (int)(a); (i) <= (int)(n); ++(i))
#define rFOR(i, a, n) for(int (i) = (int)(n)-1; (i) >= (int)(a); --(i))
#define rFORe(i, a, n) for(int (i) = (int)(n); (i) >= (int)(a); --(i))
#define REP(i, n) FOR((i), 0, (n))
#define REPe(i, n) FORe((i), 1, (n))
#define REPo(i, n) FORe((i), 0, (n))
#define rREP(i, n) rFOR((i), 0, (n))
#define rREPe(i, n) rFORe((i), 1, (n))
#define rREPo(i, n) rFORe((i), 0, (n))
#define rep(i, n) FOR((i), 0, (n))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fi first
#define se second
#define dup(x, y) (((x)+(y)-1)/(y))
#define vc(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll = long long;
using P = pair<int,int>;
using pll = pair<ll,ll>;
using T = tuple<int,int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vs = vector<string>;
using vp = vector<P>;
using vt = vector<T>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const double PI = acos(-1);

int main() {
  int a, b, h, m;
  cin >> a >> b >> h >> m;
  double th = double(h*60+m)/720 * 2*PI;
  double tm = double(m)/60 * 2*PI;
  double xh = a*cos(th), yh = a*sin(th);
  double xm = b*cos(tm), ym = b*sin(tm);
  double dx = xh-xm, dy = yh-ym;
  double ans = sqrt(dx*dx+dy*dy);
  printf("%.20f\n", ans);

  return 0;
}

Measured memory_bytes: 4004
#include<iostream>
#include <algorithm>
using namespace std;
int main()
{
    // 整数の入力
    int N;
    int count = 0;
    int a[100000];
    cin >> N;
    for(int i=0;i<N;i++){
      cin >> a[i];
    }
    sort(a,a+N);
    count = a[N/2]-a[N/2-1];
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 640
n = int(input())
ans = 0
red = sorted([list(map(int, input().split())) for _ in range(n)], key=lambda x:-x[1])
blue = sorted([list(map(int, input().split())) for _ in range(n)])
for i in red:
    for num, j in enumerate(blue):
        if i[0] < j[0] and i[1] < j[1]:
            ans += 1
            del blue[num]
            break
print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, A;
  int except500;
  cin >> N >> A;
  except500 = N % 500;
  if (except500 <= A){
    cout << "Yes" << endl; 
  }
  else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
using System;

namespace ABC168A
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = Console.ReadLine();
            var ans = "";

            switch (N[N.Length - 1])
            {
                case '2':
                case '4':
                case '5':
                case '7':
                case '9':
                    ans = "hon";
                    break;
                case '0':
                case '1':
                case '6':
                case '8':
                    ans = "pon";
                    break;
                case '3':
                        ans = "bon";
                    break;
                default:
                    break;
            }

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 25784
import math
con=math.sqrt(3)/2

def gohho(da):
    ans=[]
    n=len(da)
    for i in range(n-1):
        ans.append(da[i])
        ans.append([(da[i][0]*2+da[i+1][0])/3,(da[i][1]*2+da[i+1][1])/3])
        ans.append([(da[i][0]*2+da[i+1][0])/3+(da[i+1][0]-da[i][0])*0.5/3-(da[i+1][1]-da[i][1])*con/3,(da[i][1]*2+da[i+1][1])/3+(da[i+1][0]-da[i][0])*con/3+(da[i+1][1]-da[i][1])*0.5/3])
        ans.append([(da[i][0]+da[i+1][0]*2)/3,(da[i][1]+da[i+1][1]*2)/3])
    ans.append(da[-1])
    return ans

n=int(input())
da=[[0,0],[100,0]]
for i in range(n):
    da=gohho(da)
for i in da:
    print(i[0],i[1])



Measured memory_bytes: 6300
#include <stdio.h>

#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>

using namespace std;

int main(int, char**) {
  string s;
  cin >> s;
  if (s[0] != s[1] || s[1] != s[2]) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
  return 0;
}


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

typedef long long ll;
typedef int64_t i6;

#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, n) for (ll i = 1; i <= n; ++i)
#define ALL(v) (v).begin(), (v).end()
#define Sort(x) sort(ALL(x))
#define Sort_rev(x) Sort(x);reverse(ALL(x))

template<typename V,typename T>
T find_num(V v, T num) {
    if ( find(ALL(v), num) == v.end() ) {
        return false;
    } else {
        return true;
    }
}

// π M_PI
// deg = rad*180/M_PI

int main() {
    ll n;
    cin >> n;
    string s[n];
    std::vector<string> v;
    // ll ans = n;
    rep(i, n) {
        cin >> s[i];
        v.push_back(s[i]);
        /*
        rep(j, i) {
            if ( s[i] == s[j] ) {
                ans--;
                break;
            }
        }*/
    }

    ll ans = 0;
    Sort(v);
    rep(i, n) {
        if ( i == 0 ) {
            ans++;
        } else {
            if ( v[i] != v[i-1] ) {
                ans++;
            }
        }
    }

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


Measured memory_bytes: 17908
cards={}
cards[:blue]=gets.to_i.times.map { gets.chomp }
cards[:red]=gets.to_i.times.map { gets.chomp }
num=cards[:blue].uniq.map {|b| cards[:blue].count{|c| c == b } - cards[:red].count{|d| d == b }}.max
puts num.negative?? 0 : num

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

int A, B, C, D, E, F;

double density(int a, int b, int c, int d) {
    int sugar = c * C + d * D;
    int water = a * 100 * A + b * 100 * B;

    return sugar * 1.0 / (sugar + water);
}

int main() {
    ios::sync_with_stdio(0);

    cin >> A >> B >> C >> D >> E >> F;

    double sol = -1;
    int solSugar = 0, solAll = 0;

    for (int a = 0; a * 100 * A <= F; ++a) {
        for (int b = 0; a * 100 * A + b * 100 * B <= F; ++b) {
            int maxVal = min(F - a * 100 * A - b * 100 * B, E * (a * A + b * B));

            int d = maxVal / D;

            for (int c = 0; c * C <= maxVal; ++c) {
                while (c * C + d * D > maxVal)
                    --d;

                double posSol = density(a, b, c, d);
                if (posSol > sol) {
                    sol = posSol;
                    solSugar = c * C + d * D;
                    solAll = solSugar + a * 100 * A + b * 100 * B;
                }
            }
        }
    }

    cout << solAll << " " << solSugar << "\n";

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cctype>

using namespace std;

string s;
 
typedef string::const_iterator State;
int expression(State&);
int term(State&);
int number(State&);
int factor(State&);
 
int expression(State &begin){
  int ret = term(begin);
  while(1){
    if(*begin == '+'){
      begin++;
      ret += term(begin);
    }
    else if(*begin == '-'){
      begin++;
      ret -= term(begin);
    }
    else break;
  }
  return ret;
}
 
 
int term(State &begin){
  int ret = factor(begin);
  while(1){
    if(*begin == '*'){
      begin++;
      ret *= factor(begin);
    }
    else if(*begin == '/'){
      begin++;
      int tmp = factor(begin);
      ret /= tmp;
    }
    else break;
  }
  return ret;
}
 
int number(State &begin){
  int ret = 0;
  while(isdigit(*begin)){
    ret *= 10;
    ret += *begin-'0';
    begin++;
  }
  return ret;
}
 
int factor(State &begin){
  if(*begin == '('){
    begin++;
    int ret = expression(begin);
    begin++;
    return ret;
  }
  else return number(begin);
}

int main(){
  int n;
  cin >> n;
  for(int i = 0 ; i < n ; i++){
    cin >> s;
    State ss = s.begin();
    int ans = expression(ss);
    cout << ans << endl;
  }
}

Measured memory_bytes: 1204
#include<bits/stdc++.h>
using namespace std;
#define N 200003
#define LL long long
#define mod 998244353

int n,ans;


inline int read(){
	int X=0,w=0;
	char ch=0;
	while (ch<'0' || ch>'9')
	  w|=ch=='-',ch=getchar();
	while (ch>='0' && ch<='9')
	  X=(X<<3)+(X<<1)+(ch^48),ch=getchar();
	return w ? -X : X;
}

int main(){
	n=read();
	ans=1;
	for (int i=1;i<=3;i++)
	  ans=ans*n;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256