akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define ll long long
#define ull unsigned long long
#define ld long double
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define rbf(a, x) for (auto& a : x)
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define drep(i, x) for (ll i = ((ll)(x)-1); i >= 0; i--)
#define pll pair<long long,long long>
#define pb emplace_back
#define mp make_pair
#define mt make_tuple
#define vvc vector<vector<char>>
#define vc vector<char>
#define vvb vector<vector<bool>>
#define vb vector<bool>
#define Maxe(x) *max_element(all(x))
#define Mine(x) *min_element(all(x))
#define Size(x) ((ll)(x).size())
#define umap unordered_map
const long long INF = 1LL << 60;
const long double pi = 3.1415926535897932;
#define Fi first
#define Se second
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

    template<typename Num>
        constexpr Num mypow(Num a, long long b) {
            if(b==0)return 1;
            if (a==0)return 0;
            Num x = 1;
              while (b > 0) {
                if(b & 1)x*=a;
                a*=a;
                b >>= 1;
              }
              return x;
        }

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

//lis,modpow,uf,modncr,soinsubunkai,yakusurekkyo
//mint,dijkstra,gyakugen

    signed main(){
        ios::sync_with_stdio(false);
        cin.tie(nullptr);
        ll n;
        cin>>n;
        string s;
        cin>>s;
        const ll MOD=1e9+7;
        umap<char,ll> m;
        rep(i,n)m[s[i]]++;
        ll res=1;
        rbf(p,m){
            res*=p.Se+1;
            res%=MOD;
        }
        res--;
        cout<<res<<endl;
    }

Measured memory_bytes: 3672
#include <stdio.h>

int main() {
	char num[4];
  	scanf("%s", &num);
  	if(num[0] == '7' || num[1] == '7' || num[2] == '7') {
    	puts("Yes");
    }else {
    	puts("No");
    }
    
   return 0;
}

Measured memory_bytes: 1660
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
const lli INF = 1e9+7;
int main(){
    lli n,m;
    cin >> n>>m;
    lli sumProfit = 0;
    vector < pair <lli,lli> >  v(n);
    for(int i =0;i<n;i++){
        lli x,y;
        cin >> x >> y;
        v[i].first = x;
        v[i].second=y;
        sumProfit+=y;
    }
    vector < lli > dp(sumProfit+1,INF);
    dp[0]=0;
    for(int i =0;i<n;i++){
        for(int j = sumProfit;j>=1;j--){
            if(j-v[i].second>=0)
                dp[j] = min(dp[j],dp[j-v[i].second]+v[i].first);
        }
    }
    for(int i =dp.size()-1;i>=0;i--){
        if(dp[i]<=m){
            cout << i << endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 1024
# -*- coding:utf-8 -*-

def solve(a, b, c, d):
	# (1) AとCが通信可能
	if abs(a-c) <= d:
		print("Yes")
		return
	# (2) AとB、BとCが通信可能
	if (abs(a-b) <= d) and (abs(b-c) <= d):
		print("Yes")
		return
	print("No")

if __name__ == "__main__":
	a, b, c, d = list(map(int, input().split()))
	solve(a, b, c, d)


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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef map<ll,ll>::iterator itll;
typedef long double ld;
typedef map<ll,ll> mapll;

#define con continue
#define pb push_back
#define fi first
#define se second
#define fr front()
#define INF 1000000000000000000
#define all(vl) vl.begin(),vl.end()
#define m_p make_pair 
#define sz(a) sizeof(a)
#define forn(mp,it) for(it = mp.begin();it!=mp.end();it++)
#define FOR(i,a,n) for(int i=a;i<n;i++) 
#define FORE(i,a,n) FOR(i,a,n+1)
#define Endl endl
#define eNdl endl
#define enDl endl
#define endL endl

int main()
{
	ll a,b,c;
	cin>>a>>b>>c;
	cout<<(a<=b*c?"Yes":"No")<<endl;
	return 0;
}


Measured memory_bytes: 3616
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>

int main()
{
  int n;
  scanf("%d",&n);
  if(n%10==3) printf("bon");
  else if(n%10==0||n%10==1||n%10==6||n%10==8) printf("pon");
  else printf("hon");
  return 0;
}


Measured memory_bytes: 1732
#include <bits/stdc++.h>
  
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 all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second
  
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 MOD = 1e9 + 7;
double EPS = 1e-8;

int main(){
	ll n, a, b;
	cin >> n >> a >> b;
	vl v(n);
	rep(i, n) cin >> v[i];
	
	ll l = 0, r = 1e10;
	rep(k, 64) {
		ll m = (l + r) / 2;
		ll cnt = 0;
		bool f = false;
		rep(i, n) {
			if(v[i] > a * m) {
				f = true;
				break;
			}
			if(v[i] > b * m) cnt += (v[i]-m*b+(a-b-1))/(a-b);
		}
		//cout << k << " " <<m<<" "<< f << " " << cnt << endl;
		if(f || cnt > m) l = m;
		else r = m;
	}
	cout << r << endl;
}


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

#define F first
#define S second
#define PB push_back

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;
typedef priority_queue<int> HEAP;
typedef priority_queue<int, vector<int>, greater<int> > RHEAP;

const int N = 310, M = 1010;

int n, m, k, d;
int g[N][N];
PII p[N * N];
vector<vector<LL>> s;

int main()
{
	scanf("%d%d%d", &n, &m, &d);
	for (int i = 1; i <= n; i ++ )
		for (int j = 1; j <= m; j ++ )
		{
			scanf("%d", &g[i][j]);
			p[g[i][j]] = {i, j};
		}

	s.resize(d + 10);
	for (int i = 0; i < d; i ++ )
	{
		s[i].resize((n * m + d - 1) / d + 10);
		s[i][0] = 0;
		for (int j = 0; i + (j + 1) * d <= n * m; j ++ )
		{
			PII st = p[i + j * d], ed = p[i + (j + 1) * d];
			LL sum = abs(st.F - ed.F) + abs(st.S - ed.S);
			s[i][j + 1] = s[i][j] + sum;
		}
	}
	scanf("%d", &k);
	while (k -- )
	{
		int l, r;
		scanf("%d%d", &l, &r);
		
		int t = l % d;
		printf("%lld\n", s[t][r / d] - s[t][l / d]);
	}
	return 0;
}

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

using namespace std;

int i,cnt[15];

int main(){
	for(i = 0; i < 3; i++){
		int x;
		scanf("%d", &x);
		cnt[x]++;
	}
	if(cnt[5] == 2 && cnt[7] == 1)
	printf("YES\n");
	else
	printf("NO\n");
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
using namespace std;
int input() {
	int r;
	scanf("%lld", &r);
	return r;
}
signed main() {
	int a = input(), b = input(), k = input();
	int m = min(a, k);
	a -= m; k -= m;
	m = min(b, k);
	b -= m; k -= m;
	cout << a << ' ' << b << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <stack>
#include <utility>
#include <cmath>
#include <cstdio>
#include <string>

using namespace std;
typedef long long LL;
typedef pair<LL, LL> PII;
LL MOD = 1000000007;

int main() {
    string K;
    int D;
    cin >> K >> D;
    int N = K.size();
    vector<vector<LL>> dp(N+1, vector<LL>(D, 0)); 


    dp[0][0] = 1;
    for(int i=1; i<=N; i++) {
        for(int j=0; j<D; j++) {
            for(int k=0; k<10; k++) {
                int to = (j+k) % D;
                dp[i][to] += dp[i-1][j];
                dp[i][to] %= MOD;
            }
        }
    }
    /*
    for(int i=0; i<N; i++, cout << endl)
        for(int j=0; j<D; j++) {
            cout << dp[i][j] << " ";
        }
*/

    int sum = 0;
    LL ans = MOD - 1;
    for(int i=0; i<N; i++) {
        int digit = (K[i] - '0');
        for(int j=0; j<digit; j++) {
            int ind = ((0 - sum - j) + 10 * D ) % D;
            ans += dp[N-i-1][ind];
            ans %= MOD;
        }
        sum += digit;
        sum %= D;

    }
    //cout << sum << endl;
    if(sum % D == 0) ans++;
    cout << ans % MOD << endl;


    return 0;
}

Measured memory_bytes: 10240
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

N, K = LI()
A = LI()

for i in range(len(A)):
    A[i] -= 1

next_city = 0
visited = [-1 for i in range(N)]
visited[0] = 0
for n in range(N):
    next_city = A[next_city]
    if visited[next_city] != -1:
        roop_s = visited[next_city]
        roop_cnt = n + 1 - roop_s
        break
    visited[next_city] = n + 1
ans = -1

if K - roop_s >= 0:
    amari = (K - roop_s) % roop_cnt
    next_city = 0
    for k in range(amari + roop_s):
        next_city = A[next_city]
    ans = next_city

else:
    next_city = 0
    for k in range(K):
        next_city = A[next_city]
    ans = next_city
# print(roop_s, roop_cnt)
print(ans + 1)

Measured memory_bytes: 33660
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int,  int>;
using pll = pair<ll, ll>;
using edge = pair<int, ll>;
using graph = vector<vector<int>>; 
using WeightedGraph = vector<vector<edge>>;
const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;

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


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


int main(){
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    while(true){
        C -= B;
        if(C <= 0){
            cout << "Yes" << endl;
            return 0;
        }
        A -= D;
        if(A <= 0){
            cout << "No" << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV = vector<vector<vector<int>>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VVVL = vector<vector<vector<ll>>>;
using pq = priority_queue<int>;
template<class T>
using P = pair<T, T>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define REP(i,k,n) for(int i=(k);i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define output(x,y) cout << fixed << setprecision(y) << x << endl;
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; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int under = (1 << 31);
int upper = under - 1;
ll UNDER = (1LL << 63);
ll UPPER = UNDER - 1;
const int MOD = 1e9 + 7;
const long double pi = 3.141592653589793;
struct UnionFind {
	vector<int> par;
	UnionFind(int n) : par(n) {
		rep(i, n) par[i] = i;
	}
	int root(int x) {
		if (par[x] == x) return x;
		else return par[x] = root(par[x]);
	}
	void unite(int x, int y) {
		int rx = root(x);
		int ry = root(y);
		if (rx == ry) return;
		par[rx] = ry;
	}
	bool same(int x, int y) {
		return root(x) == root(y);
	}
};
int main() {
	int n, m;
	cin >> n >> m;
	vector<P<int>> node(m);
	rep(i, m) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		node[i] = make_pair(a, b);
	}
	int ans = 0;
	rep(i, m) {
		UnionFind G(n);
		rep(j, m) {
			if (i == j) continue;
			int a = node[j].first;
			int b = node[j].second;
			G.unite(a, b);
		}
		rep(i, n) {
			if (!G.same(0, i)) {
				ans++;
				break;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
//============================================================================
// Name        : AOJ.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

int main() {

	int N;
	int D[100000];
	int R=0;
	cin>>N;
	for(int i=0;i<N;i++){
		cin>>D[i];
	}

	int a1=1,a2=1,a3=1;
	for(int i=1;i<N;i++){
		if(D[i]==D[i-1]){
			R=max(R,a3);
			a3=a2+1;
			a2=a1+1;
			a1=1;
		}
		if(D[i]!=D[i-1]){
			a1+=1;
			a2+=1;
			a3+=1;
		}

	}
	R=max(R,a1);
	R=max(R,a2);
	R=max(R,a3);


	cout<<R<<endl;
	return 0;
}

Measured memory_bytes: 3472
#if 0
2020.02.14

每次对半分，直到区域只剩 1x1 ，可以知道答案的上界是 O(logNM) 。

DP 设 f[k][x][l][r] 表示以 (x, l), (x, r) 为左上角和右上角，
区域的值不超过 k 最多能向下延伸几行。
转移有两种，一种是按行划分的情况，可以直接转移。
按列划分的情况比较棘手，暴力转移需要枚举划分方式，
也就是枚举 p : f[k][x][l][r] <- min(f[k-1][x][l][p], f[k-1][x][p+1][r])
但是不难发现后面的值随 p 的变化是个单峰函数，
并且最优的 p 随 r 的变化是个单调函数。
因此固定 k, x, l 时只需维护一个 p 即可。
#endif
#include <cstdio>
#include <algorithm>
#include <cstring>
#define debug(...) fprintf(stderr, __VA_ARGS__)

typedef long long ll;
struct {
	inline operator int () { int x; return scanf("%d", &x), x; }
	inline operator ll () { ll x; return scanf("%lld", &x), x; }
	inline operator char () { char x[3]; return scanf("%s", x), *x; }
} read;

const int maxn = 190;
char s[maxn][maxn];
int f[maxn][maxn][maxn], g[maxn][maxn][maxn];

void chkmax(int &x, int y) {
	if(y > x) x = y;
}

int main() {
	int n = read, m = read;
	for(int i = 1; i <= n; i ++)
		scanf("%s", s[i] + 1);

	for(int x = n; x; x --)
		for(int l = 1; l <= m; l ++)
			for(int r = l; s[x][l] == s[x][r]; r ++)
				f[x][l][r] = 1 + (s[x][l] == s[x + 1][l] ?
						f[x + 1][l][r] : 0);

	int ans = 0;
	while(f[1][1][m] < n) {
		++ ans;

		for(int x = 1; x <= n; x ++)
			for(int l = 1; l <= m; l ++)
				for(int r = l; r <= m; r ++)
					std::swap(f[x][l][r], g[x][l][r]);

		for(int x = 1; x <= n; x ++)
			for(int l = 1; l <= m; l ++) {
				int p = l;
				for(int r = l; r <= m; r ++) {
					int d = g[x][l][r];
					chkmax(f[x][l][r], d + g[x + d][l][r]);
					int now = std::min(g[x][l][p], g[x][p + 1][r]);
					int nxt = std::min(g[x][l][p + 1], g[x][p + 2][r]);
					while(p + 1 < r and now <= nxt) {
						++ p;
						now = nxt;
						nxt = std::min(g[x][l][p + 1], g[x][p + 2][r]);
					}
					chkmax(f[x][l][r], now);
				}
			}
	}

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


Measured memory_bytes: 53248
#include<bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
const int maxn=25000+100,maxm=50000+5;
int n,m,p;
long long dis[maxn],in[maxn],inq[maxn];
int head[maxn],head1[maxn];
bool mark[maxn];
struct edge{
	int to,next,val;
}e[maxm],e1[maxm];
int size=0;
void addedge(int u,int v,int w){
	e[++size].to=v;e[size].val=w;e[size].next=head[u];head[u]=size;
}
void addedge1(int u,int v,int w){
	e1[size].to=v;e1[size].val=w;e1[size].next=head1[u];head1[u]=size;
}
inline int 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<<3)+(x<<1)+ch-'0';ch=getchar();}
	return x*f;
}
void bfs(){
	queue<int>q;
	q.push(n);
	mark[n]=1;
	while(!q.empty()){
		int u=q.front();
		q.pop();
		for(int i=head1[u];i;i=e1[i].next){
			int to=e1[i].to;
			if(mark[to])continue;
			q.push(to);
			mark[to]=1;
		}
	}
}
bool spfa(){
	if(!mark[1])return 1;
	for(int i=1;i<=n;i++)
	dis[i]=-inf;
	queue<int>q;
	q.push(1);
	inq[1]=1;
	dis[1]=0;
	while(!q.empty()){
		int u=q.front();
		q.pop();
		inq[u]=0;
		for(int i=head[u];i;i=e[i].next){
			int to=e[i].to;
			if(!mark[to])continue;
			if(dis[to]<dis[u]+e[i].val){
				dis[to]=dis[u]+e[i].val;
				if(!inq[to]){
					in[to]++;
					if(in[to]>n)return 1;
					q.push(to);
					inq[to]=1;
				}
			}
		}
	}
	return dis[n]==-inf; 
}
int main(){
	n=read();m=read();p=read();
	for(int i=1;i<=m;i++){
		int u=read(),v=read(),w=read()-p;
		addedge(u,v,w);
		addedge1(v,u,w);
	}
	bfs();
	if(spfa())puts("-1");
	else printf("%d",dis[n]<0?0:dis[n]);
	return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define fr(x,i,n) for(int x = i; x < n; ++x)
#define fb(x,i,n) for(int x = i; x >= n; --x)
#define pr pair<int,int>
#define ll long long int
//const int mod=1e9+7;
const ll inf=1LL<<32;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n,m;
    cin>>n>>m;
    int a[n];
    double sum=0;
    fr(i,0,n)
    {
        cin>>a[i];
        sum+=a[i];
    }
    sort(a,a+n,greater<int>());
    string ans="Yes";
    if(a[m-1]<sum/(4*m))
    ans="No";
    cout<<ans;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	
	/*
	 * default function
	 * */	
	int ni() {
		return cin.nextInt();
	}
	
	long nl() {
		return cin.nextLong();
	}
	
	String line() {
		return cin.nextLine();
	}
	
	void println(String str) {	
		System.out.println(str);
	}
	
	void print(String str) {
		System.out.print(str);
	}
	
	/*
	 * default variable
	 */
	
	static final int MOD = 1000000007;
	
	Scanner cin = new Scanner(System.in);	
	String  output;
	
	public static void main(String[] args) {			
		new Main().run();						
	}
	
	/* default above */		
	public void run() {
			
		input();
		/* 
		 * start
		 */	
		
		int res = solve();
		
		/*
		 * finish
		 */
		
		output = res +"";
		println(output);
			
	}
	/* 
	 * define variable
	 */
	
	int X ;
	 
	void input() {
		
		X = ni();
	}
	
	int solve() {
		
		int i = 1;
		int cnt = 0;
		
		for (;; i ++) {
			
			int j = i;
			while (j > 0) {
				cnt ++;
				if (cnt == X) {
					return i;
				}
 				j --;
			}
		}
	}
	
}


Measured memory_bytes: 23636
#include<iostream>
#include<vector>
#define MAX 1000000
#define INF 1000000000
using namespace std;
typedef long long ll;
int main(){
  ll num=0,cnt=3,i=0;
  vector<ll> n_list,o_list;
  while(num<=MAX){
    num = (cnt)*(cnt-1)*(cnt-2);
    num/=6;
    n_list.push_back(num);
    if(num%2==1){
      o_list.push_back(num);
    }
    cnt++;
  }
  ll n;
  cin >> n;
  while(n!=0){
    vector<ll> dp(n+1),odp(n+1);
    fill(dp.begin(),dp.end(),INF);
    fill(odp.begin(),odp.end(),INF);
    dp[0]=0;
    odp[0]=0;
    for(int i=0;i<n_list.size();i++){
      for(int j=n_list[i];j<=n;j++){
        dp[j]=min(dp[j],dp[j-n_list[i]]+1);
      }
    }
    for(int i=0;i<o_list.size();i++){
      for(int j=o_list[i];j<=n;j++){
        odp[j]=min(odp[j],odp[j-o_list[i]]+1);
      }
    }
    cout << dp[n]<<" "<<odp[n]<<endl;
    cin >> n;
  }
}



Measured memory_bytes: 25176
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
int n, m, a[maxn * 2 + 10];

int chk(int pos, int v) {
	for (int i = 1, j = pos; i <= pos; ++i, --j) {
		if (a[i] + a[j] > v) return 1;
	}
	for (int i = pos + 1, j = n * 2; i <= n * 2; ++i, --j) {
		if (a[i] + a[j] < m) return -1;
		else if (a[i] + a[j] > m + v) return 1;
	}
	return 0;
}

bool chk(int v) {
	int l = 0, r = n;
	while (l <= r) {
		int mid = (l + r) >> 1;
		int d = chk(mid * 2, v);
		if (d == -1) l = mid + 1;
		else if (d == 0) return 1;
		else r = mid - 1;
	}
	return 0;
}

int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= 2 * n; ++i) scanf("%d", &a[i]);
	sort(a + 1, a + 2 * n + 1);
	int l = 0, r = m - 1;
	while (l != r) {
		int mid = (l + r) >> 1;
		if (chk(mid)) r = mid;
		else l = mid + 1;
	}
	printf("%d", l);
}


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

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

    cin >> x1 >> y1 >> x2 >> y2;
    printf("%.8lf\n", pow((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1), 0.5));
}

Measured memory_bytes: 3368
#include<bits/stdc++.h>
using namespace std;
vector<int> c(2*1000002,0);
int main()
{
    int n;
    cin>>n;
    long long ans=0;
    vector<int> a(n,0);
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        ans+=c[a[i]];
        c[a[i]]++;
    }
    for(int i=0;i<n;i++)
    {
        cout<<ans-c[a[i]]+1<<endl;
    }
}


Measured memory_bytes: 11136
#include <iostream>
#include <cstring>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <queue>
#include <list>
#include <numeric>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <math.h>
#include <stack>
#include <climits>
#include <bitset>
#include <utility>


using namespace std;
typedef long long ll;
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 ll INF = 1LL <<60;
// const int INF = 10000;

//最大公約数
ll gcd(ll x, ll y) {
  ll tmp = 0;
  if (x < y){
    tmp=x;
    x=y;
    y=tmp;
  }
  while (y > 0) {
    ll r = x % y;
    x = y;
    y = r;
  }
  return x;
}

//最大公倍数
ll lcm(ll x,ll y){
  return x/gcd(x,y)*y;
}

const int MAX = 1e6+1;
const int MOD = 1e9+7;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


//階乗
ll kaijo(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum *= i;
        sum%=1000000000+7;
    }
    return sum;
}

//for(int i = ; i < ; i++){}

ll lmax(ll s,ll t){
  if(s>t){
    return s;
  }
  else{
    return t;
  }
}

ll lmin(ll s,ll t){
  if(s<t){
    return s;
  }
  else{
    return t;
  }
}

long long modpow(long long res,long long a, long long n, long long mod) {
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

//sieve(MAX);でベクトルIsPrimeに「MAXまでの数値の素数の真偽」を格納する。
vector<bool> IsPrime;
void sieve(size_t max){
    if(max+1 > IsPrime.size()){     // resizeで要素数が減らないように
        IsPrime.resize(max+1,true); // IsPrimeに必要な要素数を確保
    } 
    IsPrime[0] = false; // 0は素数ではない
    IsPrime[1] = false; // 1は素数ではない

    for(size_t i=2; i*i<=max; ++i) // 0からsqrt(max)まで調べる
        if(IsPrime[i]) // iが素数ならば
            for(size_t j=2; i*j<=max; ++j) // (max以下の)iの倍数は
                IsPrime[i*j] = false;      // 素数ではない
}
// ここから開始
int main(){
  sieve(55555);
  vector<int> prime1mod5;
  for(int i = 1; i < 55556; i++){
    if(IsPrime[i] == true&&i%5==1) prime1mod5.push_back(i);
  }
  int n;
  cin>>n;
  for(int i = 0; i < n; i++){
    cout<<prime1mod5[i]<<" ";
  }
  cout<<endl;
  return 0;
}



Measured memory_bytes: 256
n = int(input())
h = [int(_) for _ in input().split()]
prev = 0
dec = False
once = False
big = 0
for i in range(1, n):
    if h[prev] - h[i] >= 2:
        print('No')
        dec = True
        break
    elif h[prev] > h[i] and once == False:
        once = True
        big = h[prev]
    elif h[prev] > h[i] and once:
        if h[prev] < big:
            print('No')
            dec = True
            break
        else:
            big = h[prev]
    prev += 1
    
if not dec:
    print('Yes')

Measured memory_bytes: 14704
#include<iostream>
#include<string>
#include<stdio.h>
#include<cmath>
using namespace std;

#define max(a,b) a > b ? a : b

int main() {

    string S;

    cin >> S;

    if (S == "Sunny")
    {
        cout << "Cloudy" << endl;
    }
    else if(S == "Cloudy")
    {
        cout << "Rainy" << endl;
    }
    else {
        cout << "Sunny" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

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

template<class T> vector<T> make_vec(size_t a) { return vector<T>(a); }
template<class T, class... Ts> auto make_vec(size_t a, Ts... ts) {
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template<class T, class V>
typename enable_if<is_class<T>::value == 0>::type fill(T &t, const V &v) {
    t = v;
}
template<class T, class V>
typename enable_if<is_class<T>::value != 0>::type fill(T &t, const V &v){
    for (auto &e : t) fill(e, v);
}

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }

#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }



int main() {
    int N, K;
    while (cin >> N >> K) {
        int res = 0;
        for (int i = 0; i < N; ++i) {
            int h; cin >> h;
            if (h >= K) ++res;
        }
        cout << res << endl;
    }
}


Measured memory_bytes: 256
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

N, K = iInM()
A = iInLH()

dp = [0] * (K + 1) 
# 0: lose
# 1: win

for i in range(1, K + 1):
    for j in range(N):
        if i - A[j] < 0:
            break
        if dp[i - A[j]] == 0:
            dp[i] = 1
            break

ans = 'First' if dp[K] else 'Second'
print(ans)

#print(dp)

Measured memory_bytes: 74552
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll INF = 3000000000000000000; //10^18
const int inINF = 1000000000; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

//N点連結グラフの二部グラフ判定
//Gはグラフの隣接リスト表現
//colorは大きさNの配列。二部グラフだったとき、独立集合がここに返ってくる
//vは探索を始める点。cは探索を始める点に塗る色
//vと同じ独立集合に含まれる点はcに塗られ、そうでない点は-cに塗られる
//colorは先に0で埋めておく
bool is_bipartite_graph (vector<vector<int>> &G, vector<int> &color, int v, int c){
    color[v] = c;
    for (int next_v : G[v]){
        if(color[next_v] == c){
            return false;
        }
        if(color[next_v] == 0 && !is_bipartite_graph(G, color, next_v, -c)){
            return false;
        }
    }
    return true;
}


int main(){
    ll N, M;
    cin >> N >> M;
    vector<vector<int>> G(N);
    int x, y;
    for (int i = 0; i < M; i++) {
        cin >> x >> y; x--; y--;
        G[x].push_back(y);
        G[y].push_back(x);
    }

    vector<int> color(N, 0);
    if(is_bipartite_graph(G, color, 0, 1)){
        ll a, b;
        a = 0; b = 0;
        for (int i = 0; i < N; i++) {
            if(color[i] == 1){
                a++;
            }
            else{
                b++;
            }
        }
        printf("%lld\n", a*b - M);
    }
    else{
        printf("%lld\n", (N-1)*N/2 - M);
    }




}

Measured memory_bytes: 9404
/**
 *    author:  Mohamad Milhem
 *    created: 2020-04-29-16.54.15
**/

#include <bits/stdc++.h>
#include <stdio.h>

using namespace std;
typedef long long ll;

#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back
#define lp(i,s,f) for(ll i = s; i < ll(f); i++)
#define inF freopen("input.in", "r", stdin);
#define outF freopen("output.in", "w", stdout);
#define MOD ll(1000000007)
#define debug(x) cout << '[' << #x << " is: " << x << "] " <<endl;
#define decimalpoint cout << std::fixed << setprecision(5)
int n;
vector<int> v;
int dp[100005];


int calc(int idx){
    if (idx >= n)return 1e9;
    if (idx == n-1)return 0;

    if (dp[idx] != -1)return dp[idx];


    int firstChoice = abs(v[idx] - v[idx+1]) + calc(idx+1);
    int secondChoice = abs(v[idx] - v[idx+2]) + calc(idx+2);

    return dp[idx] = min(firstChoice , secondChoice);

}




int main(){

    FAST;

    cin >> n;

    for (int i = 0 ; i < n ; i++){
        int in;
        cin >> in;
        v.push_back(in);
    }
    memset(dp, -1 , sizeof dp);


    cout << calc(0) << endl;



    return 0;
}


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

int main(){
	ios::sync_with_stdio(0);
    cin.tie(0);
    int n, d;
    cin >> n;
    vector<pair<int, int>> a;
    for(int i = 0; i < n; i++){
        cin >> d;
        a.push_back({d,i+1});
    }
    sort(a.begin(), a.end());
    for(int i = 0; i < n; i++){
        cout << a[i].second<<" ";
    }
    return 0;
}


Measured memory_bytes: 1780
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;

public class Main {

	static Scanner sc = new Scanner(System.in);

	static class FastScanner {
		private final InputStream in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;

		public FastScanner(InputStream source) {
			in = source;
		}

		private boolean hasNextByte() {
			if (ptr < buflen) {
				return true;
			} else {
				ptr = 0;
				try {
					buflen = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (buflen <= 0) {
					return false;
				}
			}
			return true;
		}

		private int readByte() {
			if (hasNextByte()) return buffer[ptr++];
			else return -1;
		}

		private static boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}

		public boolean hasNext() {
			while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
			return hasNextByte();
		}

		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (b < '0' || '9' < b) {
				throw new NumberFormatException();
			}
			while (true) {
				if ('0' <= b && b <= '9') {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) {
					return minus ? -n : n;
				} else {
					throw new NumberFormatException();
				}
				b = readByte();
			}
		}

		public int nextInt() {
			long nl = nextLong();
			if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
				throw new NumberFormatException();
			return (int) nl;
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}
	}

	public static void main(String[] args){

		solve_abc166_a();
	}
  
  	public static void solve_abc166_a(){

		FastScanner sc = new FastScanner(System.in);
		
		String s = sc.next();
		
		if(s.equals("ABC")) System.out.println("ARC");
		else System.out.println("ABC");
		

	}
}

Measured memory_bytes: 26972
n = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))

from itertools import permutations

l = list(range(1, n + 1))
perm = permutations(l, n)

idx_P, idx_Q = 0, 0
for i,v in enumerate(perm):
    if v == tuple(P):
        idx_P = i
    if v == tuple(Q):
        idx_Q = i

print(abs(idx_P - idx_Q))

Measured memory_bytes: 3064
#include <stdio.h>
int main() {
	int a, b;
	scanf("%d %d", &a, &b);

	if (a > b) {
		printf("a > b\n");
	}
	else if (a < b) {
		printf("a < b\n");
	}
	else if (a == b) {
		printf("a == b\n");
	}


	return 0;
}

Measured memory_bytes: 580
#include <stdio.h>
int main()
{
  int x,y;
  while(1){
    scanf("%d %d",&x,&y);
    if(x==0 && y==0) break;
    if(x < y){
      printf("%d %d\n",x,y);
    } else {
    printf("%d %d\n",y,x);
    }
  }
  return 0;
}

Measured memory_bytes: 600
#include<stdio.h>
#define MAX 10000
#define NIL -1

struct Node { int p, l, r;};
struct Node T[MAX];
int n;

/* 先行順巡回 */
void preParse( int u ){
	if ( u==NIL ) return;
	printf(" %d",u);
	preParse(T[u].l);
	preParse(T[u].r);
}

/*中間順巡回*/
void inParse( int u ){
	if( u == NIL ) return;
	inParse(T[u].l);
	printf(" %d",u);
	inParse(T[u].r);
}

/*後行順巡回*/
void postParse( int u ){
	if ( u==NIL ) return;
	postParse(T[u].l);
	postParse(T[u].r);
	printf(" %d",u);
}

int main(){
	int i, v, l, r, root;
	
	scanf("%d",&n);
	for( i=0; i<n; i++){
		T[i].p = NIL;
	}
	
	for( i=0; i<n; i++){
		scanf("%d %d %d",&v,&l,&r);
		T[v].l = l;
		T[v].r = r;
		if( l != NIL ) T[l].p =v;
		if( r != NIL ) T[r].p =v;
	}
	
	for( i=0; i<n; i++) if( T[i].p == NIL ) root = i;
	
	printf("Preorder\n");
	preParse(root);
	printf("\n");
	printf("Inorder\n");
	inParse(root);
	printf("\n");
	printf("Postorder\n");
	postParse(root);
	printf("\n");
	
	return 0;
}



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

int main(){
  int N;
  cin >> N;
  int a[N];
  for(int i = 0; i < N; i++){
    cin >> a[i];
    a[i]--;
  }
  vector<bool> visited(N,false);
  int current = 0;
  int cnt = 0;
  while(true){
    if(visited[current]){
      cout << -1 << endl;
      return 0;
    }else if(current == 1){
      cout << cnt << endl;
      return 0;
    }else{
      visited[current] = true;
      current = a[current];
      cnt++;
    }
  }
  return 0;
}


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

int main(){
  vector<double> nuki(50000, 0);
  for(int i=1; i<=50000; i++){
    nuki[i] = i;
  }
  vector<int> komi(50000);
  for(int i=1; i<=50000; i++){
    komi[i] = nuki[i] * 1.08;
  }
  double num;
  cin >> num;
  for(int i=1; i<=50000; i++){
    if(komi[i] == num){
      cout << nuki[i];
      return 0;
    }
  }
  cout << ":(" << endl;
  return 0;
}

Measured memory_bytes: 896
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
using namespace std;
typedef long long ll;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    int a, b, c, d;
    a = n / 1000;
    b = n / 100 % 10;
    c = n / 10 % 10;
    d = n % 10;
    if ( a + b + c + d == 7 ) cout << a << '+' << b << '+' << c << '+' << d << "=7";
    else if ( a + b + c - d == 7 ) cout << a << '+' << b << '+' << c << '-' << d << "=7";
    else if  ( a + b - c + d == 7 ) cout << a << '+' << b << '-' << c << '+' << d << "=7";
    else if ( a - b + c + d == 7 ) cout << a << '-' << b << '+' << c << '+' << d << "=7";
    else if ( a + b - c - d == 7 ) cout << a << '+' << b << '-' << c << '-' << d << "=7";
    else if ( a - b - c + d == 7 ) cout << a << '-' << b << '-' << c << '+' << d << "=7";
    else if ( a - b + c - d == 7 ) cout << a << '-' << b << '+' << c << '-' << d << "=7";
    else if ( a - b - c - d == 7 ) cout << a << '-' << b << '-' << c << '-' << d << "=7";
}


Measured memory_bytes: 3652
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <bitset>
#include <vector>
using namespace std;
int main()
{
	int N, T;
	cin >> N;//>>T;

	for (int i = 111; i < 1000; i += 111) {
		if (i >= N) {
			cout << i << endl;
			break;
		}
	}
}


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

using namespace std;

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

typedef long long ll;
ll dp[100010][3], a[100010][3];
int main() {
    int N; cin >> N;
    rep(i,N)rep(j,3)cin>>a[i][j]; //a,b,cの入力を受け取る
    rep(i,N){
        rep(j,3){
            rep(k,3){
                if(j==k) continue; //前日に選択しているため
                dp[i+1][k] = max(dp[i+1][k], dp[i][j]+a[i][k]);
            }
        }
    }
    ll ans = 0;
    rep(i,3){
        ans = max(ans, dp[N][i]);//三種類それぞれの最大値を比較する
    }
    cout << ans << endl;
}

Measured memory_bytes: 4992
#include <stdio.h>

void partition(int a[], int p, int r) {
  int i = p - 1;
  for (int j = p; j <= r - 1; j++) {
    if (a[j] <= a[r]) {
      i++;
      int tmp = a[i];
      a[i] = a[j];
      a[j] = tmp;
    }
  }
  int tmp = a[i+1];
  a[i+1] = a[r];
  a[r] = tmp;
  
  for (int k = 0; k <= r; k++) {
    if (k == i + 1) {
      printf("[%d]", a[k]);
    } else {
      printf("%d", a[k]);
    }
    if (k == r) {
      printf("\n");
    } else {
      printf(" ");
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  partition(a, 0, n - 1);
  return 0;
}



Measured memory_bytes: 2180
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<cstring>
#include<math.h>
#include<bitset>
#include<queue>
#include<set>
#include<iomanip>
#include<math.h>
#include<assert.h>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr int INF = 1000000007;
const int mod = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main(){
  int N;
  cin >> N;
  vector<pair<int,int>> P(N);
  for(int i=0; i<N; i++){
    int a,b;
    cin >> a >> b;
    P[i] = make_pair(b,a);
  }
  sort(P.begin(),P.end());
  bool cant = false;
  int T=0;
  for(int i=0; i<N; i++){
    T += P[i].second;
    if(T > P[i].first){
      cant = true;
    }
  }
  if(cant){
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
  return 0;
}


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

int main(void){
  int n,m;
  m = 0;

  while(cin >> n){
    if( n <= 36) {
      for(int i = 0; i <= 9; i++ ){
	for(int j = 0; j <= 9; j++ ){
	  for(int k = 0; k <= 9; k++ ){
	    if(n - i - j - k >=0 ){
	      if(n - i - j - k <=9){
		m++;
	      }
	    }
	  }
	}
      }
    }
    cout << m << endl;
    m = 0;
  }

  return 0;
}

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

#define ll long long
#define v vector

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	ll a, b;
	cin >> a >> b;
	if((b >= 0) && (a <= 0)) {
		cout << "Zero" << endl;
	}
	if((a < 0) && (b < 0)) {
		ll num = abs(b-a) + 1;
		cout << (((num % 2) == 0) ? "Positive" : "Negative") << endl;
	}
	if((a > 0) && (b > 0)) {
		cout << "Positive" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = m; i < (n); i++)
#define RFOR(i, m, n) for (int i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const ll INF = 1000000000000000000LL;

ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

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

ll factorial(ll n) {
  ll answer = 1;
  while (n > 1) {
    answer *= n;
    answer %= mod;
    n--;
  }
  return answer;
}

ll combination(ll n, ll r) {
  return factorial(n) / (factorial(r) * factorial(n - r));
}

ll permutation(ll n, ll r) { return factorial(n) / factorial(n - r); }

template <typename T>
void remove(std::vector<T>& vector, unsigned int index) {
  vector.erase(vector.begin() + index);
}

map<ll, ll> prime_factor(ll n) {
  map<ll, ll> ret;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1) ret[n] = 1;
  return ret;
}
// for (auto p : prime_factor(n)) {
//	while (p.second--) {
//		cout << p.first << endl;
//	}
//}

vector<ll> divisor(ll n) {
  vector<ll> ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

bool compare_by_b(pair<ll, ll> a, pair<ll, ll> b) {
  if (a.second != b.second) {
    return a.second < b.second;
  } else {
    return a.first < b.first;
  }
}

vector<ll> Eratosthenes(const ll N) {
  bool is_prime[1000000 + 1];
  vector<ll> P;
  for (ll i = 0; i <= N; i++) {
    is_prime[i] = true;
  }
  for (ll i = 2; i <= N; i++) {
    if (is_prime[i]) {
      for (ll j = 2 * i; j <= N; j += i) {
        is_prime[j] = false;
      }
      P.emplace_back(i);
    }
  }
  return P;
}

typedef vector<int> ivec;
typedef vector<string> svec;
typedef vector<ll> lvec;

int main() {
  string s;
  cin >> s;
  string size = to_string(s.size() - 2);
  string ans = s[0] + size + s[s.size() - 1];
  cout << ans << endl;
  return 0;
}

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

struct edge{
    int to,weight;
    edge(int to,int weight):to(to),weight(weight){}
};
using Graph = vector<vector<int>> ;
using GraphEdge = vector<vector<int>> ;

long long modinv(long long a, long long m=MOD) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
    /*MODの割り算の際に
    a/＝b;
    を
    a *= modinv(b,MOD);
    とする。
        */
}
int main(){

    char a;cin >> a;
    map<char,char> m;
    m['A'] = 'T';
    m['T'] = 'A';
    m['G'] = 'C';
    m['C'] = 'G';

    cout << m[a] << endl;
    return 0;
}

Measured memory_bytes: 3460
#include<iostream>
#include<string>
#include<algorithm>
#include<functional>
using namespace std;
int main (){

	while (true) {
		int N;
		cin >> N;
		if (N == 0) break;
		string c;
		cin >> c;
		int maisu[10];
		for (int i = 0; i < N; i++){
			maisu[i] = 0;
		}
		int ba = 0;
		int turn = 0;
		for (int i = 0; i < c.size(); i++){
			if(c[i] == 'M') {
			   maisu[turn]++;
			}
			else if(c[i] == 'S') {
				maisu[turn]++;
				ba += maisu[turn];
				maisu[turn] =0;
			}
			else {
				maisu[turn]++;
				maisu[turn] += ba;
				ba = 0;
			}
			
			turn++;
			turn %= N;
		}
		sort(maisu,maisu+N);
		for (int i = 0; i < N; i++){
			cout << maisu[i] << " ";
		}
		cout << ba << endl;
	}
return 0;
}

Measured memory_bytes: 1224
#include <bits/stdc++.h>
#include <string>
#define ull unsigned long long
#define ll long long
#define pp pair<ull, ull>

using namespace std;

const ull base = 233;

int N;
map<pp, int> cntR;
string str;

inline int bitswap(int x)
{
	int ret = 0;
	for (int i = 0; i < N; i++)
		ret = ret * 2 + (x >> i & 1);
	return ret;
}

pp gethash(int S, int dir)
{
	string s = dir ? str.substr(N) : str.substr(0, N);
	pp ret = pp(0, 0);
	for (int i = 0; i < N; i++)
		if (S >> i & 1)
			ret.first = ret.first * base + s[i];
	reverse(s.begin(), s.end());
	S = (1 << N) - bitswap(S) - 1;
	string tmp;
	for (int i = 0; i < N; i++)
		if (S >> i & 1)
		{
			ret.second = ret.second * base + s[i];
			tmp += s[i];
		}
//	cerr << S << ' ' << dir << ' ' << tmp << endl;
	return ret;
}

int main()
{
	cin >> N >> str;
	for (int S = 0; S < (1 << N); S++)
		cntR[gethash(S, 1)]++;
	ll ans = 0;
	for (int S = 0; S < (1 << N); S++)
	{
		pp cur = gethash(S, 0);
		ans += cntR[pp(cur.second, cur.first)];
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 33024
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef long double ld;
const ll N=3e5+5;
const ll MOD=1e9+7;
const ld pi=3.14159265359;
const ll INF=(1LL<<60);
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define setp setprecision
#define lwb lower_bound
#define SZ(a) (ll)a.size()

ll n,a,b,ans[N],id,le,l;
vector<ll> v;

int main(){
	ios_base::sync_with_stdio(0);
	cin>>n>>a>>b;
	if(n<a+b-1||n>a*b){cout<<-1;return 0;}
	for(ll i=1;i<=b;i++)ans[i]=b+1-i;
	le=n-b;id=b+1;
	REP(j,a-1){if(j<le%(a-1))v.pb(le/(a-1)+1);else v.pb(le/(a-1));}
	l=b+1;id=b;
	for(auto j:v){
		id+=j;
		for(ll i=l;i<l+j;i++){
			ans[i]=id--;
		}
		id+=j;l=l+j;
	}
	REP1(i,n)cout<<ans[i]<<" ";
	return 0;
}


Measured memory_bytes: 6636
#include <bits/stdc++.h>
  using namespace std;
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) ll aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) string aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007

int main() {
	
	int N;
	cin>>N;
	int odd=0;
	fx(N){
		int a;
		cin>>a;
		if(a%2==1){
			odd++;
		}
	}

if(odd%2==0){
	ce("YES")
}else{
	ce("NO")
}

}


Measured memory_bytes: 256