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

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

Measured memory_bytes: 3604
#include<iostream>
#include<stdio.h>
#include<cctype>
using namespace std;
int main(){
	char c;
	while(1){
		scanf("%c",&c);
		if(isupper(c)){
			c=tolower(c);
		}else{
			c=toupper(c);
		}
		cout<<c;
		if(c=='\n'){break;}
	}
    return 0;
}

Measured memory_bytes: 1112
//include
//------------------------------------------
#include <bits/stdc++.h>
using namespace std;
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef long long ll;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const long long INF = 1000000007;
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
// chmax chmin
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 main(void){
    int A,B; cin >> A >> B;
    if(A%3==0 || B%3==0 || (A+B)%3==0) cout << "Possible" << endl;
    else cout << "Impossible" << endl;
    return 0;
}

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

using namespace std;

struct Combination
{
  int mod;
  vector< int64_t > mfact, rfact;

  Combination(int sz, int mod) : mfact(sz + 1), rfact(sz + 1), mod(mod)
  {
    mfact[0] = 1;
    for(int i = 1; i < mfact.size(); i++) {
      mfact[i] = mfact[i - 1] * i % mod;
    }
    rfact[sz] = inv(mfact[sz]);
    for(int i = sz - 1; i >= 0; i--) {
      rfact[i] = rfact[i + 1] * (i + 1) % mod;
    }
  }

  int64_t fact(int k) const
  {
    return (mfact[k]);
  }

  int64_t pow(int64_t x, int64_t n) const
  {
    int64_t ret = 1;
    while(n > 0) {
      if(n & 1) (ret *= x) %= mod;
      (x *= x) %= mod;
      n >>= 1;
    }
    return (ret);
  }

  int64_t inv(int64_t x) const
  {
    return (pow(x, mod - 2));
  }

  int64_t P(int n, int r) const
  {
    if(r < 0 || n < r) return (0);
    return (mfact[n] * rfact[n - r] % mod);
  }

  int64_t C(int p, int q) const
  {
    if(q < 0 || p < q) return (0);
    return (mfact[p] * rfact[q] % mod * rfact[p - q] % mod);
  }

  int64_t H(int n, int r) const
  {
    if(n < 0 || r < 0) return (0);
    return (r == 0 ? 1 : C(n + r - 1, r));
  }
};

using int64 = long long;
const int INF = 1 << 30;
const int mod = 1e9 + 7;

int N;
vector< int > g[5000];
int sub[5000];
int centroid_sz = INF;
vector< int > centroid;
Combination comb(5001, mod);

int build_dfs(int idx, int par)
{
  sub[idx] = 1;
  for(auto &to : g[idx]) {
    if(to == par) continue;
    sub[idx] += build_dfs(to, idx);
  }
  return (sub[idx]);
}


void build_centroid(int idx, int par, const int all)
{
  int connect = all - sub[idx];
  for(auto &to : g[idx]) {
    if(to == par) continue;
    build_centroid(to, idx, all);
    connect = max(connect, sub[to]);
  }
  if(connect < centroid_sz) {
    centroid_sz = connect;
    centroid.clear();
  }
  if(connect == centroid_sz) {
    centroid.emplace_back(idx);
  }
}


int main()
{
  cin >> N;
  for(int i = 1; i < N; i++) {
    int x, y;
    cin >> x >> y;
    --x, --y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  build_centroid(0, -1, build_dfs(0, -1));
  assert(centroid.size() <= 2);
  if(centroid.size() == 2) {
    cout << comb.fact(N / 2) * comb.fact(N / 2) % mod << endl;
    return (0);
  }
  build_dfs(centroid[0], -1);


  int sz = 1;
  vector< int > dp1(1);
  dp1[0] = 1;
  for(auto &to : g[centroid[0]]) {
    vector< int > dp2(sz + sub[to]);
    for(int i = 0; i < sz; i++) {
      for(int j = 0; j <= sub[to]; j++) {
        (dp2[i + j] += dp1[i] * comb.P(sub[to], j) % mod * comb.C(sub[to], j) % mod) %= mod;
      }
    }
    sz += sub[to];
    dp1.swap(dp2);
  }
  int ret = 0;
  for(int i = 0; i < N; i++) {
    if(i % 2 == 0) (ret += dp1[i] * comb.fact(N - i) % mod) %= mod;
    else (ret += mod - dp1[i] * comb.fact(N - i) % mod) %= mod;
  }
  cout << ret << endl;
}



Measured memory_bytes: 896
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<ctime>
#include<map>
#include<bitset>
#include<set>
#include<assert.h>
#include<chrono>
#include<random>
#define LL long long
#define mp(x,y) make_pair(x,y)
#define pll pair<long long,long long>
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
inline LL read()
{
	LL f=1,x=0;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int stack[20];
template<typename T>inline void write(T x)
{
	if(x<0){putchar('-');x=-x;}
    if(!x){putchar('0');return;}
    int top=0;
    while(x)stack[++top]=x%10,x/=10;
    while(top)putchar(stack[top--]+'0');
}
template<typename T>inline void pr1(T x){write(x);putchar(' ');}
template<typename T>inline void pr2(T x){write(x);putchar('\n');}
template<typename T>inline void chkmin(T &x,T y){x=x<y?x:y;}
template<typename T>inline void chkmax(T &x,T y){x=x>y?x:y;}
const int MAXN=200005;
int a[MAXN],n,b[MAXN];
LL pres[MAXN],sufs[MAXN];
int S[MAXN],pos[MAXN],tp;
int main()
{
//	freopen("b.in","r",stdin);
	n=read();
	for(int i=1;i<=n;i++)a[i]=read();
	for(int i=1;i<=n;i++)b[i]=a[i];
	LL cnt=0;pos[0]=n;
	for(int i=n-1;i>=1;i--)
	{
		if(b[i]<=b[i+1])
		{
			LL v=b[i],t=0;while(1LL*v*4<=b[i+1])t++,v*=4;
			S[++tp]=t;pos[tp]=i;
		}
		else
		{
			LL v=b[i+1];
			while(v<b[i])
			{
				v*=4;while(!S[tp]&&tp)--tp;	
				if(!tp)cnt+=2*(n-i);
				else cnt+=2*(pos[tp]-i);
				if(S[tp])--S[tp];
			}
		}sufs[i]=cnt;
	}
	reverse(a+1,a+1+n);
	for(int i=1;i<=n;i++)b[i]=a[i];
	tp=0;cnt=0;pos[0]=n;
	for(int i=n-1;i>=1;i--)
	{
		if(b[i]<=b[i+1])
		{
			LL v=b[i],t=0;while(1LL*v*4<=b[i+1])t++,v*=4;
			S[++tp]=t;pos[tp]=i;
		}
		else
		{
			LL v=b[i+1];
			while(v<b[i])
			{
				v*=4;while(!S[tp]&&tp)--tp;
				if(!tp)cnt+=2*(n-i);
				else cnt+=2*(pos[tp]-i);
				if(S[tp])--S[tp];
			}
		}pres[n-i+1]=cnt;
	}LL ans=1e18;
	for(int i=1;i<=n;i++)chkmin(ans,pres[i-1]+sufs[i]+(i-1));
	pr2(ans);
	return 0;
}



Measured memory_bytes: 6528
//#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <climits>
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v+n)
#define REVERSE(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;
const ll MOD=1000000007LL;
typedef pair<int, int> P;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }


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

  if(s.size() == 2) cout << s << endl;
  
  else{
    std::reverse(s.begin(), s.end());
    cout << s << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <utility>
#include <typeinfo>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#define REP(i,n) for(int i=0;i<n;i++)
typedef long long ll;
using namespace std;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;

int n,m;

bool end(int game[][7][7],int value)
{
	bool win(false);
	int x[13]={0,0,1,1,1,0,-1,-1,0,1,1,-1,1};
	int y[13]={0,1,0,1,0,1,1,0,-1,1,-1,1,1};
	int z[13]={1,0,0,0,1,1,0,1,1,1,1,1,-1};
	REP(i,n){
		REP(j,n){
			REP(k,n){
				REP(l,13){
					bool flag(true);
					REP(p,m)
					{
						if(-1<i+p*x[l]&&i+p*x[l]<n&&-1<j+p*y[l]&&j+p*y[l]<n&&-1<k+p*z[l]&&k+p*z[l]<n)
						{
							if(game[i+p*x[l]][j+p*y[l]][k+p*z[l]]!=value){flag=false;break;}
						}
						else
						{
							flag=false;
						}
					}
					if(flag){win=true;}
				}
				if(win)break;
			}
			if(win)break;
		}
		if(win)break;
	}
	if(win){return true;}
	else{return false;}
}

int main() 
{
	int q;
	while(scanf("%d%d%d",&n,&m,&q)&&n&&m&&q)
	{
		int z[7][7]={};//z座標に入っている数
		int game[7][7][7]={};
		bool black(false),white(false);
		int finish(0);
		for(int i=0;i<q;i++)
		{
			int a,b;
			if(!black&&!white)//勝敗が決まっていないなら、i+1個目のballを追加
			{
				scanf("%d%d",&a,&b);
				--a;--b;
				if(i%2==0)//add black
				{
					game[a][b][z[a][b]]=1;//1 means black
					z[a][b]++;
					if(end(game,1))
					{
						black=true;
					}
				}
				else//add white
				{
					game[a][b][z[a][b]]=2;//2 means white
					z[a][b]++;
					if(end(game,2))
					{
						white=true;
					}
				}
				finish++;
			}
			else//勝敗が決まっている
			{
				scanf("%d%d",&a,&b);
			}
		}
		
		if(!black&&white){printf("White %d\n",finish);}
		else if(black&&!white){printf("Black %d\n",finish);}
		else {printf("Draw\n");}
	}
	return 0;
}

Measured memory_bytes: 1196
#include <iostream>
#include <cstdio>

using namespace std;

typedef long long ll;

string s;
ll n;

int main()
{
    cin>>s>>n;
    for(ll i = 0; i + 1 < s.size(); i++)
    {
        if(n + s[i] < 'z' + 1LL) continue;
        if(s[i] == 'a') continue;
        n -= 'z' + 1LL - s[i];
        s[i] = 'a';
    }
    s[(ll)s.size() - 1] = (char)((n + s[(ll)s.size() - 1] - 'a') % 26 + 'a');
    cout<<s;
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <algorithm>
#include <queue>
#include <iterator>
#include <functional>
#include <numeric>
#include <cmath>
#include <stack>
#include <limits>
#include <ctime>

using namespace std;

#define ll long long
#define sc(n) static_cast<ll>(n)
#define IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

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

int main() {
	IO;
#ifdef _DEBUG
	ifstream cin("In.txt");
#endif	
	ll n;
	cin >> n;
	vector<vector<ll> > vc(n + 1, vector<ll>(n + 1));
	for (ll i = 1; i <= n; i++) {
		for (ll j = i; j <= n; j++) {
			ll g = gcd(i, j);
			vc[i][j] = g;
			vc[j][i] = g;
		}
	}
	ll sm = 0;
	for (ll i = 1; i <= n; i++) {
		for (ll j = 1; j <= n; j++) {
			for (ll k = 1; k <= n; k++) {
				sm += vc[vc[i][j]][k];
			}
		}
	}

	cout << sm<< endl;
	return 0;
}

Measured memory_bytes: 3780
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<memory.h>
using namespace std;
typedef long long ll;
const int Max = 4e5 + 5;

int lst[Max];

int main()
{
	string str;
	cin >> str;
	reverse(str.begin(), str.end());
	int g = 0;
	int f = 1;
	while (g < str.size())
	{
		if (g + 5 > str.size())
		{
			f = 0;break;
		}
		else if (str.substr(g, 5) == "maerd" || str.substr(g, 5) == "esare")
		{
			g += 5;
		}
		else if(g+6<=str.size())
		{
			if (str.substr(g,6 ) == "resare")g += 6;
			else if (g + 7 <= str.size())
			{
				if (str.substr(g, 7) == "remaerd")g += 7;
				else
				{
					f = 0;
					break;
				}
			}
			else
			{
				f = 0;break;
			}
		}
		else
		{
			f = 0;break;
		}
	}
	if (f) cout << "YES";
	else cout << "NO";
}

Measured memory_bytes: 3228
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Math;

class P
{
  static int[] Input(){
    return Console.ReadLine().Split().Select(int.Parse).ToArray();
  }

  static int[][] Input2(int n){
    int[][] X = new int[n][];
    for(int i = 0; i < n; i++){
      X[i] = Input();
    }
    return X;
  }

  static void Main()
  {
    int[] NC = Input();
    int[][] X = Input2(NC[1]); int[][] Y = Input2(NC[0]);
    int[,] Z = new int[3,NC[1]];
    for(int i = 0; i < NC[0]; i++){
      for(int j = 0; j < NC[0]; j++){
        for(int l = 0; l < NC[1]; l++){
          Z[(i+j)%3, l] += X[Y[i][j]-1][l];
        }
      }
    }
    int R = 2000000000;
    for(int i = 0; i < NC[1]; i++){
      for(int j = 0; j < NC[1]; j++){
        if (i==j)continue;
        for(int k = 0; k < NC[1]; k++){
          if (k==i^k==j)continue;
          R = Min(R, Z[0, i]+Z[1, j]+Z[2, k]);
        }
      }
    }
    Console.WriteLine(R);
  }
}

Measured memory_bytes: 18628
import sys
def input():
    return sys.stdin.readline()[:-1]
h,w,k=map(int,input().split())
s = []
for i in range(h):
    str=input()
    tmp=[]
    for j in range(w):
        if str[j]=="0":
            tmp.append(0)
        else:
            tmp.append(1)
    s.append(tmp)

tdiv=2**(h-1)
#import numpy as np
#s = np.array(s)
ans = 100100100
for i in range(tdiv):
    lis=[]
    #tmp=np.zeros(w)
    #tmp+=s[0,:]
    tmp=[s[0][ii] for ii in range(w)]
    cnt = 0
    #print(tmp)
    for j in range(h-1):
        if (i>>j&1):
            #tmp+=s[j+1,:]
            tmp=[tmp[ii]+s[j+1][ii] for ii in range(w)]
        else:
            lis.append(tmp)
            #tmp=np.zeros(w)
            #tmp+=s[j+1,:]
            tmp=[s[j+1][ii] for ii in range(w)]
            cnt+=1
    lis.append(tmp)
    #lis = np.array(lis)
    #clis=np.zeros(cnt+1)
    clis=[0 for ii in range(cnt+1)]
    #print(lis,cnt)
    tmpcnt=cnt
    for ind in range(w):
        #if any(d>k for d in lis[:,ind]):
        #if lis[:,ind].max()>k:
        if max([lis[ii][ind] for ii in range(tmpcnt+1)])>k:
            cnt=10010010
            break
        clis=[lis[ii][ind]+clis[ii] for ii in range(tmpcnt+1)]
        #if clis.max()>k:
        if max(clis)>k:
            clis=[lis[ii][ind] for ii in range(tmpcnt+1)]
            cnt+=1
    #print(cnt)
    ans = min(ans,cnt)
print(ans)


Measured memory_bytes: 57052
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <numeric>
#include <bitset>
using namespace std;
#define lint long long
#define ll long long
#define pq priority_queue
#define mp make_pair
#define vl vector<long long>
long long INF = 1e10;
#define pii pair<long long,long long>
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
/******************************define**********************************/
ll pow10(ll x){
    if( x == 0) return 1;
    else return pow10(x - 1) * 10;
}
ll atoi(string S){
    ll l = S.size();
    ll ans = 0;
    for(ll i = 0;i < l;i++){
        ans += pow10(l - i - 1) * (S[i] - '0');
    }
    return ans;
}

/*****************************functions********************************/

/****************************main function*****************************/
int main(void){
    string N; cin >> N;
    ll n = atoi(N);
    ll m = 0;
    for(int i = 0;i < N.size();i++) m += (N[i] - '0');
    if(n %m == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fir first
#define se second
#define ll long long
#define mp make_pair
#define pb push_back
#define quickio(a) ios::sync_with_stdio(a)
#define cl(a,b) memset(a,b,sizeof(a))
using namespace std;
const int maxn=2e5+10;
const ll mod=1e9+7;
const double eps=1e-7;
const int maxm=1e6+10;
int vis[50050];
vector<int> prime;
int n,m;
ll fac[maxn],facinv[maxn],inv[maxn];
void init(){
    fac[0]=fac[1]=facinv[0]=facinv[1]=1;
    inv[1]=1;
    for (int i=2;i<maxn;i++){
        fac[i]=fac[i-1]*i%mod;
        inv[i]=(mod-mod/i)*inv[mod%i]%mod;
        facinv[i]=facinv[i-1]*inv[i]%mod;
    }
}
ll c(int n,int m){
    if (n<0||m<0||n<m) return 0;
    return fac[n]*facinv[m]%mod*facinv[n-m]%mod;
}

int main(){
    init();
    scanf("%d %d",&n,&m);
    for (int i=2;i<50050;i++)
        for (int j=2*i;j<50050;j+=i)
            vis[j]=1;
    for (int i=2;i<50050;i++){
        if(!vis[i])
            prime.pb(i);
    }
    ll res=1;
    for (int i=0;i<prime.size();i++){
        if (prime[i]>m)
            break;
        if (m%prime[i]==0){
            int cnt=0;
            while (m%prime[i]==0){
                m/=prime[i];
                cnt++;
            }
            res=res*c(n-1+cnt,cnt)%mod;
        }
    }
    if(m>1){
        res=res*c(n,1)%mod;
    }
    printf("%lld\n",res);
    return 0;
}

Measured memory_bytes: 5120
#include <iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#include<ctime>
#include<set>
#include<map>
#include<queue>
#include<stack>
#define sqr(x) ((x)*(x))
#define fz1(i,n) for ((i)=1;(i)<=(n);(i)++)
#define fd1(i,n) for ((i)=(n);(i)>=1;(i)--)
#define fz0g(i,n) for ((i)=0;(i)<=(n);(i)++)
#define fd0g(i,n) for ((i)=(n);(i)>=0;(i)--)
#define fz0k(i,n) for ((i)=0;(i)<(n);(i)++)
#define fd0k(i,n) for ((i)=(long long)((n)-1);(i)>=0;(i)--)
#define fz(i,x,y) for ((i)=(x);(i)<=(y);(i)++)
#define fd(i,y,x) for ((i)=(y);(i)>=(x);(i)--)
#define fzin fz1(i,n)
#define fzim fz1(i,m)
#define fzjn fz1(j,n)
#define fzjm fz1(j,m)
#define ff(c,itr) for (__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define rdst(st,len){static char ss[len];scanf(" %s",ss);(st)=ss;}
#define inc(x,y) {x+=(y);if(x>=mod)x-=mod;}
#define dec(x,y) {x-=(y);if(x<0)x+=mod;}
#define spln(i,n) (i==n?'\n':' ')
using namespace std;
inline void read(int &x)
{
	char c;int f=1;
	while(!isdigit(c=getchar())&&c!='-')if(c=='-')f=-1;
	x=(c&15);while(isdigit(c=getchar()))x=(x<<1)+(x<<3)+(c&15);
	x*=f;
}
int n,m,i,j,bel[1005][1005][2],px[200005],py[200005];
vector<pair<int,int> > bi[1005];
void dfs(int x,int y,int z,int typ)
{
	if(bel[y][x][typ]){
		return;
	}
	bel[y][x][typ]=z;
	ff(bi[x],it){
		dfs(it->first,y,z,typ);
	}
}
int main()
{
	read(n);read(m);
	fz1(i,m){
		read(px[i]);read(py[i]);
		bi[px[i]].push_back(make_pair(py[i],i));
	}
	fz1(i,n){
		bel[i][i][0]=bel[i][i][1]=-1;
		ff(bi[i],it){
			dfs(it->first,i,it->second,0);
		}
		reverse(bi[i].begin(),bi[i].end());
		ff(bi[i],it){
			dfs(it->first,i,it->second,1);
		}
	}
	fz1(i,m){
		if((!!bel[py[i]][px[i]][0])^(bel[px[i]][py[i]][0]!=i||bel[px[i]][py[i]][1]!=i)){
			puts("diff");
			continue;
		}
		puts("same");
	}
	return 0;
}

Measured memory_bytes: 13568
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
int n,a[100010],num;
int main()
{
	cin >> n;
	for(int i = 1; i <= n; i++)
		cin >> a[i];
	sort(a + 1, a + 1 + n);
	double ans = a[n] * 1.0 / 2;
	double mi = 10000000000;
	for(int i = 1; i <= n - 1; i++)
	{
		if(abs(a[i]-ans)<mi)
		{
			num = a[i];
			mi = abs(a[i] - ans);
		}
	}
	printf("%d %d\n", a[n], num);
	return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define   ll            long long int
#define   endl          "\n"
#define   vi            vector<int>
#define   vll           vector<ll>
#define   pb            push_back
#define   all(p)        p.begin(),p.end()
#define   F             first
#define   S             second
#define   mp            make_pair
using namespace std;

int main(){
    ios_base::sync_with_stdio(0);
    int t,d,cnt=0;
    cin>>t>>d;
    while(t--){
        ll x,y;
        cin>>x>>y;
        ll u=x*x;
        ll v=y*y;

        double z=sqrt(u+v);
       if(z<=d)cnt++;
    }
    cout<<cnt<<endl;


return 0;
}


Measured memory_bytes: 3584
fn solve() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let n: usize = sc.read();
    let m: usize = sc.read();
    let result = if n == m { "Yes" } else { "No" };
    println!("{}", result);
}

fn main() {
    std::thread::Builder::new()
        .stack_size(64 * 1024 * 1024) // 64MB
        .spawn(|| solve())
        .unwrap()
        .join()
        .unwrap();
}

//snippet from kenkoooo
pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_line(&mut self) -> String {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b'\n' || b == b'\r')
            .take_while(|&b| b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 8572
#include <iostream>

using namespace std;

int main() {
  unsigned long n, ac = 0, wa = 0, tle = 0, re = 0;
  cin >> n;
  string s[n];
  for (unsigned long i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == "AC") ac++;
    else if (s[i] == "WA") wa++;
    else if (s[i] == "TLE") tle++;
    else if (s[i] == "RE") re++;
  }
  
  cout << "AC x " << ac << "\nWA x " << wa << "\nTLE x " << tle << "\nRE x " << re;
  
  return 0;
}

Measured memory_bytes: 6748
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll dpT[100005][2];
int n , k , cost[100005];
ll prefSum[100005];
ll pr[100005] , suf[100005];
ll sum(int l , int r)
{
    if(l)
        return prefSum[r] - prefSum[l - 1];
    return prefSum[r];
}
ll sum1(int l , int r)
{
    if(r < l)
        return 0;
    if(l)
        return pr[r] - pr[l - 1];
    return pr[r];
}
int main()
{
    scanf("%d %d" , &n , &k);
    for(int i = 0; i < n; i++)
    {
        scanf("%d" , &cost[i]);
    }
    prefSum[0] = cost[0];
    pr[0] = max(0 , cost[0]);
    for(int i = 1; i < n; i++)
    {
        prefSum[i] = prefSum[i - 1] + cost[i];
        pr[i] = pr[i - 1] + max(0 , cost[i]);
    }
    ll ans = sum(0 , n - 1);
    for(int i = 0; i <= n - k; i++)
    {
        ans = max(ans , sum1(0 , i - 1) + sum1(i + k , n - 1) + max(sum(i , i + k - 1) , 0LL));
    }
    cout << ans;
}


Measured memory_bytes: 3584
N,M=map(int,input().split())
A=[input()for i in range(N)]
B=[input()for i in range(M)]
b=''
a='no'
for i in range(M):
    b+=B[i]
for i in range(N-M+1):
    if B[0]in A[i] :
        for j in range(N-M+1):
            a=''
            for k in range(M):
                a+=A[i+k][j:j+M]
            if a==b:
                print("Yes")
                exit()
print("No") 


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
template<typename T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }
template<class T> ostream& operator<<(ostream &os, vector<T> V) { os << "[ "; for(auto v : V) os << v << " "; return os << "]"; }
template<class T> ostream& operator<<(ostream &os, set<T> S){ os << "{ "; for(auto s:S) os<<s<<" ";return os<<"}"; }
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) { return os << "(" << P.first << "," << P.second << ")";}
template<class L, class R> ostream& operator<<(ostream &os, map<L,R> M) { os << "{ "; for(auto m:M) os<<"("<<m.first<<":"<<m.second<<") "; return os<<"}"; }
#ifdef LMAO
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){cerr << name << " : " << arg1 << endl;}
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){ const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1<<" | "; __f(comma+1, args...); }
#else
    #define trace(...) 42
#endif
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define endl "\n"
#define tcase int tt; cin>>tt; while(tt--)
#define tcase2 int tt; cin>>tt; for(int qq=1;qq<=tt;qq++)
#define all(x) x.begin(), x.end()
typedef long long int ll;
typedef  unsigned long long int ull;
typedef long double ld;
const int MAX = 1000010;
const int MOD2 = 998244353;
const int MOD = 1000000007; 
const int INF = 1e8;    
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const ld EPS = 1e-7;
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define forne(i, a, b) for(int i = a; i <= b; i++)   
/*****************start************/

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);cout<<fixed<<setprecision(25);cerr<<fixed<<setprecision(10);
    int x;
    cin>>x;
    if(x>=30)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
    
    return 0;
}


Measured memory_bytes: 3608
#include<iostream>
#include<stdio.h>
#include<string>
#include<cmath>
#include<math.h>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
#include<unordered_map>
#pragma warning(disable: 4996)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define PI 3.141592653589793

using namespace std;
using ll = long long;


int main() {

	int n, k, q;

	cin >> n >> k >> q;

	vector<int> a(n, k);


	rep(i, q) {
		int A;
		cin >> A;
		A--;
		a[A]++;
	}
	
	rep(i, n) {

		a[i] -= q;

		if (a[i] > 0) { cout << "Yes" << endl; }
		else cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 1024
import std.stdio;
import std.algorithm;
import std.functional;
import std.range;
import std.container;
import std.string;
import std.conv;
import std.array;

void main() {
    int n;
test:
    while (n = readln.chomp.to!int, n) {
        int[] a, b;
        void init() {
            auto _ = readln.chomp.split(" ").map!(to!int).array;
            a = _.sort!"a > b".array;
            _ = readln.chomp.split(" ").map!(to!int).array;
            b = _.sort!"a > b".array;
        }
        init();
        for (int i = 0; i * 2 < n - 1; i++) {
            int x = i * 2;
            int y = i;
            if (a[x] > b[y]) {
                (i * 2 + 1).writeln;
                continue test;
            }
        }
        "NA".writeln;
    }
}

Measured memory_bytes: 7480
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

//constexpr long long int MOD = 1000000007;
constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-8;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;


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

	cin >> N;
	for (int i = 0; i <= N; i++) {
		L = i * 100;
		R = i * 105;
		if (L <= N && N <= R) {
			cout << 1 << endl;
			return 0;
		}
	}
	cout << 0 << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		int a[] = new int[n];
		int ans = 0;
		for(int i = 0; i < n; i++) {
			a[i] = scanner.nextInt();
		}
		
			for(int k = 0; k < n; k++) {
//				if(k == r) {
//					if(k == 0) {
//						ans -= Math.abs(a[k]) + Math.abs(a[k+1]-a[k]) - Math.abs(a[k+1]);
//					}else if(k == n-1) {
//						ans -= Math.abs(a[k]-a[k-1]) + Math.abs(-a[k]) - Math.abs(-a[k-1]);
//					}else {
//						ans -= Math.abs(a[k]-a[k-1]) + Math.abs(a[k+1]-a[k]) - Math.abs(a[k+1]-a[k-1]);			
			 if(k == 0) {
					ans += Math.abs(-a[k]);
				}else if(k == n-1) {
					ans += Math.abs(a[k] - a[k-1]);
					ans += Math.abs(a[k]);
				}else {
					ans += Math.abs(a[k] - a[k-1]);
				}
			}
			for(int r = 0; r < n; r++) {
				int aans = ans;
				if(r == 0) {
					aans -= Math.abs(a[r]) + Math.abs(a[r+1]-a[r]) - Math.abs(a[r+1]);
				}else if(r == n-1) {
					aans -= Math.abs(a[r]-a[r-1]) + Math.abs(-a[r]) - Math.abs(-a[r-1]);
				}else {
					aans -= Math.abs(a[r]-a[r-1]) + Math.abs(a[r+1]-a[r]) - Math.abs(a[r+1]-a[r-1]);
				}
				System.out.println(aans);
			}
	}
}


Measured memory_bytes: 64012
#include <bits/stdc++.h>
#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++)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using pii = pair<int, int>;

//const ll INF = 1e18L + 5;
//const int INF = 1e9 + 5;
//const double pi = 3.14159265358979323846;

ll		f(ll h)
{
	if (h == 1)
		return 1;
	return 2 * f(h / 2) + 1;
}

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

	ll h;
	cin >> h;

	cout << f(h) << endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N, K = map(int, input().split())
# 文字列用のリスト　インプットをブランクで区切りリスト化
k = input()
s = [int(j) for j in k.split(" ")]
valIn = 0
# Nの桁毎の分解
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []

def irohacheck(n):
	global valIn
	valIn = 0
	# 分解した数値をリストにして格納
	num = digit(n)
	# num内の数字がsに含まれる場合には、valInをインクリメント
	for i in range(len(num)):
		if s.count(num[i])>0:
			valIn+=1

irohacheck(N)
while(valIn != 0):
	N += 1
	irohacheck(N)
print(N)


Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int N;
    cin >> N;
    int ca[N][3] = {0};
    int p[N] = {0};
    for(int i = 0;i < N;i++){
        for(int j = 0;j < 3;j++){
            cin >> ca[i][j];
        }
    }
    /*for(int i = 0;i < N;i++){
        for(int j = 0;j < 3;j++){
            p[i]+=ca[i][j];
        }
        cout << p[i] << endl;
        cout << ca[i][0] << " " << ca[i][1];
        cout << " " << ca[i][2] << endl;
    }*/
    for(int i = 0;i < 3;i++){
        for(int j = 0;j < N;j++){
            bool f = false;
            if(ca[j][i] != 0){
                for(int k = j+1;k < N;k++){
                    if(ca[j][i] == ca[k][i]){
                        f = true;
                        ca[k][i] = 0;
                    }
                }
                if(f){
                    ca[j][i] = 0;
                }
            }
        }
    }
    for(int i = 0;i < N;i++){
        for(int j = 0;j < 3;j++){
            p[i]+=ca[i][j];
        }
        cout << p[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 3072
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <set>
#include <queue>
#include <stack>
#include <utility>
#include <stdio.h>
#include <unistd.h>
using namespace std;
typedef long long int ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define drep(i, n) for(int i = n - 1; i >= 0; i--)
#define itrep(itr, base) for (auto itr = base.begin(); itr != base.end(); itr++)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define yes cout << "yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define no cout << "no" << endl
#define PI 3.14159265359

const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const int mod = 1000000007;

void P(int x) {cout << x << endl;}
void P(long x) {cout << x << endl;}
void P(double x) {cout << x << endl;}
void P(ll x) {cout << x << endl;}
void P(string x) {cout << x << endl;}
void P(char x) {cout << x << endl;}

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

vector<set<int>> mp;
vector<pair<int, int>> v;
vector<int> reach;

int solve(int now) {
  itrep(itr, mp[now]) {
    if (reach[*itr] == 0) {
      reach[*itr] = 1;
      solve(*itr);
    }
  }
  return 1;
}

int main() {
  int n, m;
  cin >> n >> m;
  mp = vector<set<int>>(n);
  rep (i, m) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    v.push_back(make_pair(a, b));
    mp[a].insert(b);
    mp[b].insert(a);
  }

  int ans = 0;
  rep (i, m) {
    int a, b;
    a = v[i].first;
    b = v[i].second;
    mp[a].erase(mp[a].find(b));
    mp[b].erase(mp[b].find(a));
    reach = vector<int>(n, 0);
    reach[a] = 1;
    solve(a);
    int flag = 0;
    rep (i, n) {
      if (reach[i] == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 1) {
      // cout << "bridge: " << a << " => " << b << endl;
      ans++;
    }
    mp[a].insert(b);
    mp[b].insert(a);
  }
  P(ans);

  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <limits.h>

using namespace std;

int main()
{
    int n, tmp, min = INT_MAX, max = INT_MIN;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> tmp;
        if (max < tmp - min)
            max = tmp - min;
        if (min > tmp)
            min = tmp;
    }
    cout << max <<endl;
    return 0;
}


Measured memory_bytes: 3116
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mod = (int)1e9 + 7;
const int INF = (int)1e9;
const int N = 2005;
const int MAXA = (int)3e6;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int x;
    cin >> x;
    if(x == 1)cout << 0; else cout << 1;
    return 0;
}



Measured memory_bytes: 3652
using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(func());
        }

        private static string func()
        {
            var k = Console.ReadLine();
            if (k[2] != k[3]) return "No";
            if (k[4] != k[5]) return "No";
            return "Yes";
        }
    }
}


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

int main(){
  int x,y;
  cin >> y >> x;
  char c[y][x];
  for(int j=0;j<y;j++){
    for(int i=0;i<x;i++){
      cin >> c[j][i];
    }
  }
  for(int j=-1;j<=y;j++){
    for(int i=-1;i<=x;i++){
      if(i==-1||j==-1||i==x||j==y){
        cout<<"#";
      }else{
        cout<<c[j][i];
      }
    }
    cout<<endl;
  }
}


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

int main()
{
    char x[3];
    scanf("%s", x);
    if (x[0] == x[2])
    {
        printf("Yes\n");
    }
    else
    {
        printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 128
using System;
using System.Linq;

class R
{
	static void Main()
	{
		Func<long[]> read = () => Console.ReadLine().Split().Select(long.Parse).ToArray();
		var h = read();
		long n = h[0], k = h[1];

		var a = new long[n, n];
		for (int i = 0; i < n; i++)
		{
			var r = read();
			for (int j = 0; j < n; j++) a[i, j] = r[j];
		}

		var v0 = Enumerable.Repeat(1L, (int)n).ToArray();
		var vk = MMul(MPow(a, k), v0);
		Console.WriteLine(vk.Sum() % M);
	}

	static int M = 1000000007;

	static long[,] UnitMatrix(int n)
	{
		var r = new long[n, n];
		for (int i = 0; i < n; i++) r[i, i] = 1;
		return r;
	}

	static long[,] MPow(long[,] b, long i)
	{
		for (var r = UnitMatrix(b.GetLength(0)); ; b = MMul(b, b))
		{
			if (i % 2 > 0) r = MMul(r, b);
			if ((i /= 2) < 1) return r;
		}
	}

	static long[,] MMul(long[,] a, long[,] b)
	{
		var n = a.GetLength(0);
		var r = new long[n, n];
		for (var i = 0; i < n; i++)
			for (int j = 0; j < n; j++)
				for (var k = 0; k < n; k++)
					r[i, j] = (r[i, j] + a[i, k] * b[k, j]) % M;
		return r;
	}

	static long[] MMul(long[,] a, long[] v)
	{
		var n = v.Length;
		var r = new long[n];
		for (var i = 0; i < n; i++)
			for (var k = 0; k < n; k++)
				r[i] = (r[i] + a[i, k] * v[k]) % M;
		return r;
	}
}


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

int l[100010], r[100010], a[100010];
int gcd(int a,int b)
{
    while(b != 0)
    {
        int temp = b;
        b = a % b;
        a = temp;
    }
    return a;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int i, j, k, m, n, mx=1;
    cin>>n;
    for(i=0;i<n;i++)
        cin>>a[i];
    for(i=1;i<n;i++){
        l[i] = gcd(l[i-1], a[i-1]);
        r[n-i] = gcd(r[n-i+1], a[n-i]);
        //cout<<l[i]<<" "<<r[n-i]<<endl;
    }
    for(i=0;i<n;i++)
        mx = max(mx, gcd(l[i], r[i+1]));

    cout<<mx<<endl;

    return 0;
}


Measured memory_bytes: 1408
#include <iostream>
#include <vector>
#include <array>
#include <deque>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>
#include <iomanip>

using namespace std;
using ll=long long int;

int main() {
    int n, d;
    cin >> n >> d;

    int w = d*2+1;

    int ans = (n+w-1)/w;
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
//

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#define rep(i,x,y) for(ll i=x;i<y;i++)
#define irep(i,a) for(auto i = a.begin(); i != a.end(); ++i)
#define nvarep(n,a) ll n;cin>>n;vector<ll>a(n);rep(i,0,n)cin>>a[i]
#define vecrep(n,a,type) vector<type>a(n);rep(i,0,n)cin>>a[i]
#define lcm(a,b) (a/__gcd(a, b)*b)
#define range(a) (a).begin(),(a).end() 
#define pb push_back
#define mp make_pair
#define nnn "\n"
#define spa " "
using p = pair<ll, bool>;
using garph = vector<vector<ll>>;
const int inf = 2147483647;//2*10^9
const ll INF = 9223372036854775807;//9*10^18

signed main (){
    int n,m;cin>>n>>m;
    vector<p>h(n);
    rep(i,0,n){
        h[i].first=1;
        h[i].second=false;
    }
    h[0].second=true;
    rep(i,0,m){
        int a,b;cin>>a>>b;
        a--;b--;
        h[a].first--;
        h[b].first++;
        if(h[a].second)h[b].second=true;
        if(h[a].first==0)h[a].second=false;
    }
    int ans = 0;
    rep(i,0,n)if(h[i].second)ans++;
    cout<<ans<<nnn;
    return 0;
}

Measured memory_bytes: 1792
#include<cstring>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<queue>
#include<bitset>
#include<cstdlib>
#include<set>
#include<unordered_map>
#define l(x) (x<<1)
#define r(x) ((x<<1)|1)
#define low(x) (x&(-x))
#define IL inline
#define reg register
#define LL long long
#define N 500010
#define MOD 998244353
#define MO 1000000007
#define INF 0x3f3f3f3f
using namespace std;

int T,n,i,j,k,x,y,z;
int a[N],b[N];
char c[N];

struct Data{
	int x,y;
}d[N];

IL int Abs(int x){return (x<0)?-x:x;}
IL void Swap(int &a,int &b){a^=b^=a^=b;}
IL int Min(int a,int b){return (a<b)?a:b;}
IL int Max(int a,int b){return (a>b)?a:b;}
IL bool cmp(const Data a,const Data b){return a.x<b.x;}

IL LL Mi(LL x,LL y){
	LL p=x,t=1,Res=1;
	for (;t<=y;(t&y)?Res=(Res*p)%MOD:0,p=(p*p)%MOD,t<<=1);
	return Res;
}

IL int read(){
	int p=0,f=1;	char	c=getchar();
	while (c<48||c>57)	{if (c=='-')	f=-1;	c=getchar();}
	while (c>=48&&c<=57)	p=(p<<1)+(p<<3)+c-48,c=getchar();
	return p*f;
}

int main(){
	#ifdef __Marvolo
	freopen("zht.in","r",stdin);
	freopen("zht.out","w",stdout);
	#endif
	x=read();	y=read();	z=read();
	k=read();
	int p=0,q=0,w=0;
	for (i=0;i<=k;i++){
		for (j=0;j<=k;j++)
			for (int g=0;g<=k;g++){
				if (i+j+g!=k)	continue;
				p=x*(1<<i);
				q=y*(1<<j);
				w=z*(1<<g);
				if (p<q && q<w)	{
					puts("Yes");
					return 0;
				}
			}
	}
	puts("No");
	return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007


int main() {

  string S;
  cin >> S;

  for(int i = 0;i < S.size();i++) {
    cout << S.at(i);
    if(i == 3) cout << " ";
  }

  cout << endl;



}



Measured memory_bytes: 256
N, M = map(int, input().split())

# データ構造の設定が上手と思った
# 配列の配列にせず、文字列の配列にしている点
A = [input() for j in range(N)]
B = [input() for j in range(M)]

for i in range(N-M+1):
    for j in range(N-M+1):
        for k in range(M):
            if A[i+k][j:j+M] != B[k]:
                break
        else:
            print("Yes")
            exit()
else:
    print("No")

Measured memory_bytes: 3060
#include <vector>
#include <iostream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>

using namespace std;

template<typename T, typename S>
istream& operator >> (istream& is, pair<T, S>& p) {
    is >> p.first >> p.second;
    return is;
}

template<typename T>
istream& operator >> (istream& is, vector<T>& v) {
    for (auto& x : v) {
        is >> x;
    }
    return is;
}

template<typename T>
ostream& operator << (ostream& os, const vector<T>& v) {
    for (auto& x : v) {
        os << x << " ";
    }
    os << "\n";
    return os;
}

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

#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n, m;
    cin >> n >> m;
    vector<int> sz(n, 1), cc(n, 0);
    cc[0] = 1;
    for (int i = 0; i < m; ++i) {
        int x, y;
        cin >> x >> y;
        --x, --y;
        if (cc[x]) {
            cc[y] = 1;
        }
        sz[y]++;
        sz[x]--;
        if (sz[x] == 0) cc[x] = 0;
    }
    int ans = 0;
    for (int i = 0; i < n; ++i) ans += cc[i];
    cout << ans;
}


Measured memory_bytes: 3988
use proconio::input;

fn main() {
    input! {
        n: usize
    }

    let (x,y,z) = {
        let mut x = 0;
        let mut y = 0;
        let mut z = 0;
        for i in 0..=3500 {
            for j in 0..=3500 {
                if 4*i*j > n*(i+j) {
                    if (n*i*j) % (4*i*j - n*(i+j)) == 0 {
                        x = i;
                        y = j;
                        z = (n*i*j) / (4*i*j - n*(i+j));
                        break;
                    }
                }
            }
        }
        (x,y,z)
    };

    println!("{} {} {}",x,y,z)
    
}

Measured memory_bytes: 2180
import sys
import math
import bisect
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

def factorial(n):
    if n == 1:
        return n
    elif n==0:
        return 0
    return n * factorial(n-1)

n = ni()

p = na()
q = na()
def check(pq):
    ans = factorial(n)
    a = list(range(1,n+1))
    for i in range(n):
        l = n - i
        pqi = pq[i]
        index = a.index(pqi)
        ans -= factorial(max(l-1, 0)) * max(l-index, 0)
        a.remove(pqi)
    return ans
print(abs(check(p) - check(q)))


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main(){
  int x, n;
  cin >> x >> n;
  int seisu[102];
  for(int i=0; i<102; ++i) seisu[i] = i;
  for(int i=0; i<n; ++i){
    int p; cin >> p;
    seisu[p] = 999;
  }
  int m = 999, res;
  for(int i=0; i<102; ++i){
    int a = abs(x - seisu[i]);
    if(m > a){
      m = a;
      res = seisu[i];
    }
  }
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 3616
# include <bits/stdc++.h>
# define sz(x) (int)((x).size())
# define f first 
# define s second
# define pb push_back
# define ub upper_bound
# define lb lower_bound
# define all(x) x.begin(), x.end()
# define rep(i,n) for(int i=0;i<n;++i)
# define forn(i,n) for(int i=1;i<=n;++i)
# define pqueue priority_queue

using namespace std;

template<class T> void umin(T &a,T b){a=min(a,b);}
template<class T> void umax(T &a,T b){a=max(a,b);}

typedef long long ll;
typedef pair<int,int> pii;

const int mod=1e9+7,N=1e6+3;



void solve(){	
	int n;
	cin>>n;
	set<char>s;
	forn(i,n){
		char c;
		cin>>c;
		s.insert(c);
	}
	cout<<(sz(s)==4?"Four":"Three");

}

int main(){
 	ios_base::sync_with_stdio(0);
 	cin.tie(0);cout.tie(0);
	int T=1; 
	//cin>>T;	
	while(T--)solve();
}

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

#define INF 2147483647

using namespace std;

void update(int i,int x);
int getMax(int a,int b);
int dfs(int a,int b,int k,int l,int r);

int tree[262144];
int data[100001];
int n,q;
int a,b,c;
int len, ap;

int main()
{
    int dist = 0, max = 0;
    cin >> len >> ap;

    for (int i = 0; i < len; i++) {
        cin >> data[i];
        update(i, -data[i]);
    }
    int tmp;
    for (int i = 0; i < len-1; i++) {
        tmp = -getMax(i+1, len) - data[i];
        if (max < tmp) {
            max = tmp;
            dist = 1;
        } else if (max == tmp) {
            dist++;
        }
    }

    cout << dist << endl;
            
    return 0;
}


int dfs(int a,int b,int k,int l,int r)
{
    if(r<=a || b<=l)return INF;
    if(a<=l && r<=b)return tree[k];
    int m=(l+r)/2;
    return min(dfs(a,b,k*2+1,l,m),dfs(a,b,k*2+2,m,r));
}

int getMax(int a,int b)
{
    // 131072 = 2^17
    return dfs(a,b,0,0,131072);
}

void update(int i,int x)
{
    // 131072 = 2^17
    i+=(131072-1);
    tree[i]=x;
    while(i){
        i=(i-1)/2;
        tree[i]=min(tree[i*2+1],tree[i*2+2]);
    }
}


Measured memory_bytes: 1536
c,t,d[4010]={1};char s[4010];i;main(j){for(gets(s);s[i/2];d[j]=0,i++)for(j=c+=s[i]?t+=2,s[i]-48:0;j>i+c-t&&~j;j--)d[j]=(d[j]+d[j-1])%998244353;printf("%d",d[c]);}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
#define mod 1000000007
using ll = long long;
using namespace std;
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 main(){
  int H, A; cin >> H >> A;
  cout << (H+A-1)/A << endl;
  return 0;
}


Measured memory_bytes: 764
#include <iostream>
#include <map>
using namespace std;
map<int,bool> m;
int n, t,i,ans;
int main()
{
	cin>>n;
	for (i=0;i<n;i++)
	{
		cin>>t;
		if(m[t])m[t]=0,ans--;
		else m[t]=1,ans++;
	}
	cout << ans<<"\n";
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const int MAX = 1000000;
const ll INF = (1LL << 31) - 1;
const double pi=acos(-1);



int main(){
  double a,b,x;
  cin >> a >> b >> x;
  if(a*a*b<=2*x){
    cout << fixed << setprecision(10) << 360*atan((2*a*a*b-2*x)/a/a/a)/2/pi << endl;
  }
  else{
    cout << fixed << setprecision(10) << 360*(atan(a*b*b/2/x))/2/pi << endl;
  }
  
    
}


Measured memory_bytes: 256