akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <array>
#include <algorithm>
#include <cstring>
#include <queue>

using namespace std;

int main() {
    int a;
    string s;

    // input
    cin >> a >> s;

    // process
    if (a >= 3200) {
        cout << s << endl;
    } else {
        cout << "red" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define esc(ret) cout << (ret) << endl,quick_exit(0)
#define fcout(d) cout << fixed << setprecision(d)
#define repU(i,s,t) for(int i = (int)(s); i <= (int)(t); ++i)
#define repD(i,s,t) for(int i = (int)(s); i >= (int)(t); --i)
#define rep(i,n) repU(i,0,n - 1)
#define rep1(i,n) repU(i,1,n)
#define all(v) begin(v),end(v)
#define vct vector
#define prique priority_queue
#define l_bnd lower_bound
#define u_bnd upper_bound
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define mkp make_pair
#define mkt make_tuple
#define fir first
#define sec second
#define qceil(n,d) ((n) > 0 ? ((n) - 1) / (d) + 1 : (n) / (d))
#define parity(a,b) ((a) & 1 == (b) & 1)

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair<int,int> pii;

const pii dir[] = { {1,0},{0,1},{-1,0},{0,-1},{1,1},{-1,1},{-1,-1},{1,-1} };
const int mod = 1e9 + 7;
const int inf32 = (1 << 30) - 1;
const ll inf64 = (1LL << 62) - 1;


ll N,M,A,B,C,D,K,a[100100],b[100100];
string S,T;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	cin >> N;
	K = M = 0;
	rep(i,N) cin >> a[i];
	rep(i,N) cin >> b[i];
	rep(i,N){
		A = a[i],B = b[i];
		if(A > B) K += A - B;
		else M += (B - A) / 2;
	}
	if(K <= M) esc("Yes");
	else esc("No");
}



Measured memory_bytes: 384
n=int(input())
t=list(map(int,input().split()))
m=int(input())
drink=[]

for i in range(m):
    tmp=list(map(int,input().split()))
    drink.append(tmp)
total=0
for i in range(n):
    total+=t[i]
for i in range(m):
    ans=total
    ans-=t[drink[i][0]-1]
    ans+=drink[i][1]
    print(ans)

Measured memory_bytes: 38384
#include<bits/stdc++.h>
using namespace std;
long long n,tot,a,b,dp[101000];
int main()
{
	cin>>n>>tot;
	for(int i=1;i<=100000;i++)
	   dp[i]=1e18;
	for(int i=1;i<=n;i++){
		cin>>a>>b;
		for(int j=i*1000;j>=b;j--)
		    dp[j]=min(dp[j],dp[j-b]+a);
	}
	long long ans=0;
	for(int i=1;i<=100000;i++)
	   if(dp[i]<=tot)
	      ans=i;
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<long long,long long>
#define ii pair<int,int>
#define mod 1000000007
#define endl '\n'
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);

ll power(ll a,ll b){
	ll ans=1;
	while(b>0){
		if(b%2!=0){
			ans=(ans*a)%mod;
		}
		a=((a%mod)*(a%mod))%mod;
		b>>=1;
	}
	return ans;
}

void sieve(int n){
	bool prime[n+1];
	memset(prime,true,sizeof(prime));
	for(int p=2;p*p<=n;p++){
		if(prime[p]){
			for(int i=p*p;i<=n;i+=p)
				prime[i]=false;
		}
	}
	for(int p=2;p<=n;p++){
		if(prime[p])
			cout<<p<<" ";
	}
}

int main() {
	IOS;
	int t=1;
	//cin>>t;
	while(t--){
		int a;
		string s;
		cin>>a>>s;
		if(a>=3200)
			cout<<s;
		else
			cout<<"red";
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
mt19937 rng(std::chrono::system_clock::now().time_since_epoch().count());
const int N = 1e5;
int n,q,p[N],ans;
long long m;
bool is;
vector<pair<int,int>>bad;
int get(int u){return u == p[u] ? u : p[u] = get(p[u]);}
int main(){
	//freopen("input.txt","r",stdin);
	scanf("%d%lld%d",&n,&m,&q);
	ans = n;
	for(int i = 0;i < n;i++)p[i] = i;
	for(int i = 0,a,b,c;i < q;i++){
		scanf("%d%d%d",&a,&b,&c);
		if(c == 1){
			is = 1;
			bad.push_back({a,b});
			continue;
		}
		if(get(a) != get(b))ans--;
		p[get(a)] = get(b);
	}
	for(auto i : bad)
		if(get(i.first) == get(i.second)){
			puts("No");
			return 0;
		}
	if((ans < 3 || m == n - 1) && is){
		puts("No");
		return 0;
	}
	puts(n + ans*(ans - 3LL)/2 >= m ? "Yes" : "No");
}

Measured memory_bytes: 1784
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<set>
#include<map>
#include<queue>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);++i)
#define rrep(i,n) for(int (i)=(n)-1;(i)>=0;--i)
#define rep1(i,n) for(int (i)=1;(i)<=(n);++i)
#define rrep1(i,n) for(int (i)=(n);(i)>=1;--i)
#define pb push_back
#define fr first
#define sc second
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> DP;
typedef pair<long long,long long> LP;
typedef double db;
using namespace std;
ll N,A,B;
ll x,y,z;
ll p;
int main()
{
  cin>>N>>A>>B;
  rep(i,N){
    cin>>p;
    if(p<=A) x++;
    else if(A< p && p <= B) y++;
    else z++;
  }
  cout<<min(min(x,y),z)<<endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <queue>

#define MAP_SIZE_MAX 1001
#define INF 100000000

typedef std::pair<int, int> point;

int get_distance(int sx, int sy, int goal,
                 int h, int w, char map[][MAP_SIZE_MAX],
                 int *gx, int *gy) {
  std::queue<point> queue;
  queue.push(point(sx, sy));

  // initalize distance array
  int distance[MAP_SIZE_MAX][MAP_SIZE_MAX];
  for (int i = 0; i < MAP_SIZE_MAX; i++) {
    for (int j = 0; j < MAP_SIZE_MAX; j++) {
      distance[i][j] = INF;
    }
  }
  distance[sx][sy] = 0;

  // ???????????¢?´¢
  while (true) {
    point current = queue.front();
    queue.pop();
    int x = current.first;
    int y = current.second;

    // goal!
    if (map[x][y] == goal + '0') {
      *gx = x;
      *gy = y;
      return distance[x][y];
    }

    // 4 ???????????????
    int d[] = { 0, 1, 0, -1, 0 };
    for (int i = 0; i < 4; i++) {
      int _x = x + d[i];
      int _y = y + d[i + 1];
      if (map[_x][_y] != 'X' &&
          distance[_x][_y] == INF &&
          0 <= _x && _x < h && 0 <= _y && _y < w) {
        distance[_x][_y] = distance[x][y] + 1;
        queue.push(point(_x, _y));
      }
    }
  }
}

int solve(int h, int w, int n, char map[][MAP_SIZE_MAX]) {
  // find start position
  int sx, sy, gx, gy;
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      if (map[i][j] == 'S') {
        sx = i;
        sy = j;
        break;
      }
    }
  }

  int result = 0;
  for (int i = 1; i <= n; i++) {
    result += get_distance(sx, sy, i, h, w, map, &gx, &gy);

    // ??´????????????????¬??????????????????????
    sx = gx;
    sy = gy;
  }

  return result;
}

int main() {
  int h, w, n;
  scanf("%d %d %d", &h, &w, &n);

  char map[MAP_SIZE_MAX][MAP_SIZE_MAX];
  for (int i = 0; i < h; i++) {
    scanf("%s", map[i]);
  }

  printf("%d\n", solve(h, w, n, map));

  return 0;
}

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

int main(){
    int a, b, m;
    cin >> a >> b >> m;
    vector<int> A(a), B(b);
    for(int i = 0; i < a; i++)  cin >> A[i];
    for(int i = 0; i < b; i++)  cin >> B[i];
    int tmp = *min_element(A.begin(),A.end()) + *min_element(B.begin(),B.end());
    while(m--){
        int x, y, c;
        cin >> x >> y >> c;
        x--, y--;
        tmp = min(tmp, A[x]+B[y]-c);
    }
    cout << tmp << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define INF 0x3f3f3f3f 
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ll long long int
#define pi 3.14159265358979
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define PI 3.1415926535897932384626
typedef pair<int, int>  pii;
typedef vector<int>   vi;
typedef vector<pii>   vpii;
typedef vector<vi>    vvi;

int main() {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    int n,count=0;
    cin>>n;
    string s;
    cin>>s;
    int i=0,j=n-1;
    while(i!=j)
    {
        if(s[i]=='W'&&s[j]=='R')
            {
                swap(s[i],s[j]);
                count++;
            }
        else if(s[i]=='W')
            j--;
        else if(s[i]=='R')
            i++;

    }
    cout<<count;
    return 0;
}


Measured memory_bytes: 3748
#include<iostream>
#include<fstream>
#include<iomanip>
#include<cstdio>
#include<string>
#include<cstring>
#include<climits>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<deque>
#include<tuple>
#include<list>
#include<unordered_map>
#include<random>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define lb lower_bound
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
// #define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , dy[4] ={0,1,0,-1};


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll n,a[100][100];
    ll dp[1<<20];
    ll use[1<<20];
    cin>>n;
    rep(i,n){
        rep(j,n){
            cin>>a[i][j];
        }
    }
    rep(bit,(1<<n)){
        rep(i,n){
            rep2(j,i,n){
                if((bit&(1<<i))&&(bit&(1<<j)))use[bit]+=a[i][j];
            }
        }
    }
    /*
    rep(bit,(1<<n)){
        for(ll mask=bit;mask>0;mask=(mask-1)&bit){
            dp[bit]=max(dp[bit],dp[bit-mask]+use[mask]);
        }
    }
    */
   rep(bit,(1<<n)){
       ll unused=bit^((1<<n)-1);
       for(ll mask=unused;mask>0;mask=(mask-1)&unused){
           dp[bit|mask]=max(dp[bit|mask],dp[bit]+use[mask]);
       }
   }
    cout<<dp[(1<<n)-1]<<endl;
    return 0;
}

Measured memory_bytes: 6912
#include <iostream>
using namespace std;
int main(void){
    int distance, big_jump, count=0;
    cin >> distance >> big_jump;
    
    count += distance / big_jump; //大ジャンプで跳ぶ回数
    count += distance % big_jump; //小ジャンプで跳ぶ回数
    
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 3100
n, m = map(int, input().split())
sc = [tuple(map(int, input().split())) for j in range(m)]
for i in range(1000):
    if len(str(i)) == n and all(str(i)[s - 1] == str(c) for s, c in sc):
        print(i)
        break
else:
    print(-1)

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

template<long long MOD = 1000000007>
struct Mint {
private:
  long long val;

public:
  constexpr Mint(const long long x = 0) noexcept : val(x < 0 ? x % MOD + MOD : x >= MOD ? x % MOD : x) {}
  constexpr Mint &operator+=(const Mint rhs) noexcept {
    if ((val += rhs.val) >= MOD) val -= MOD;
    return *this;
  }
  constexpr Mint &operator-=(const Mint rhs) noexcept {
    if ((val -= rhs.val) < 0) val += MOD;
    return *this;
  }
  constexpr Mint &operator*=(const Mint rhs) noexcept {
    val = val * rhs.val % MOD;
    return *this;
  }
  constexpr Mint &operator/=(Mint rhs) noexcept {
    val = val * rhs.inv().val % MOD;
    return *this;
  }
  constexpr Mint operator+(const Mint& rhs) const noexcept { return Mint(*this) += rhs; }
  constexpr Mint operator-(const Mint& rhs) const noexcept { return Mint(*this) -= rhs; }
  constexpr Mint operator*(const Mint& rhs) const noexcept { return Mint(*this) *= rhs; }
  constexpr Mint operator/(const Mint& rhs) const noexcept { return Mint(*this) /= rhs; }
  constexpr Mint inv() const noexcept { return pow(MOD-2); }
  constexpr Mint pow(long long n) const noexcept {
    Mint ret(1), mul(val);
    while (n) {
      if (n % 2) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }
  constexpr bool operator==(const Mint& rhs) const noexcept { return val == rhs.val; }
  constexpr bool operator!=(const Mint& rhs) const noexcept { return val != rhs.val; }
  friend ostream &operator<<(ostream &os, const Mint<MOD> &x) { return os << x.val; }
  friend istream &operator>>(istream &is, Mint<MOD> &x) {
    long long t;
    is >> t;
    x.val = t % MOD;
    return is;
  }
};


int main() {
  int n, k; cin>>n>>k;
  Mint<> ans = 1;

  vector<long long> acc(n+1, 0);
  for (int i = 1; i < n+1; i++) {
    acc[i] = acc[i-1] + i;
  }

  for (int i = k; i <= n; i++) {
    ans += (acc[n] - acc[n-i]) - acc[i-1] + 1;
  }

  cout << ans << endl;

  return 0;
}

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

int		main(void)
{
	int		a;
	cin >> a;
	if (a >= 2800)
		cout << "AGC" << endl;
	else
		cout << (a >= 1200 ? "ARC" : "ABC") << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<ll>; using VVI = vector<VI>; using VVVI = vector<VVI>;
const int inf=1e9+7;
const ll INF=1LL<<61;
const ll mod=1e9+7;

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(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int i,j;
	ll n;
	cin>>n;
	string s;
	cin>>s;
	VI v(3,0);
	ll ans=0;
	for(i=0;i<n;i++){
		int u=s[i]%3;
		ll mul=1;
		for(j=0;j<3;j++){
			if(j!=u) mul*=v[j];
		}
		ans+=mul;
		v[u]++;
	}
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			if(i-j<0||i+j>=n) continue;
			if(s[i-j]!=s[i]&&s[i]!=s[i+j]&&s[i-j]!=s[i+j]){
				ans--;
			}
		}
	}
	cout<<ans<<endl;


}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
  ll D,T,S;
  cin>>D>>T>>S;
  if(D/S<T) {
cout<<"Yes"<<endl;
  }
  else if(D/S==T&&D%S==0) {
cout<<"Yes"<<endl;
  }
  else {
cout<<"No"<<endl;
  }
}

Measured memory_bytes: 3620
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 1000000007;

template<class _T> static void getint(_T& a) {
	std::cin >> a;
}
template<class _T> static void getint(_T& a, _T& b) {
	std::cin >> a >> b;
}
template<class _T> static void getint(_T& a, _T& b, _T& c) {
	std::cin >> a >> b >> c;
}

static void ABC073D();

int main()
{
	ABC073D();
	fflush(stdout);
	return 0;
}


static int ABC073Ddfs(std::set<int> town, int cost, int from, std::vector<std::vector<int>>& costs)
{
	int ret = MOD_NUM;

	if (town.size() > 1) {
		town.erase(from);
		for (auto it = town.begin(); it != town.end(); it++) {
			ret = std::min(ret, ABC073Ddfs(town, cost + costs[from][*it], *it, costs));
		}
		town.insert(from);
	}
	else {
		ret = cost;
	}
	return ret;
}

static void ABC073D()
{
	int N, M, R;
	getint(N, M, R);

	std::set<int> town;
	for (int i = 0; i < R; i++) {
		int t;
		getint(t); t--;
		town.insert(t);
	}

	std::vector<std::vector<int>> costs(N, std::vector<int>(N, (int)MOD_NUM));
	for (int i = 0; i < M; i++) {
		int from, to, cost;
		getint(from, to, cost); from--; to--;	//	0-indexed
		costs[from][to] = cost;
		costs[to][from] = cost;
	}

	for (int k = 0; k < N; k++) {
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				costs[i][j] = std::min(costs[i][j], costs[i][k] + costs[k][j]);
			}
		}
	}

	int minCost = (int)MOD_NUM;
	for (auto it = town.begin(); it != town.end(); it++) {
		minCost = std::min(minCost, ABC073Ddfs(town, 0, *it, costs));
	}
	printf("%d\n", minCost);
}


Measured memory_bytes: 3896
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;

int main(void) {
	int h, w;
	cin >> h >> w;
	
	vector<string> s(h);
	for(int i = 0; i < h; ++i) {
		cin >> s[i];
	}
	
	int dx[4] = {1, 0, -1, 0};
	int dy[4] = {0, 1, 0, -1};
	int ans = 0;
	
	for(int sx = 0; sx < h; ++sx) {
		for(int sy = 0; sy < w; ++sy) {
			
			if( s[sx][sy] == '#' ) continue;
			
			vector< vector<int> > dist(h, vector<int>(w, 1 << 30));
			queue< pair<int, int> > q;
			
			dist[sx][sy] = 0;
			q.push( make_pair(sx, sy) );
			
			while( !q.empty() ) {
				int nowx = q.front().first;
				int nowy = q.front().second;
				q.pop();
					
				for(int k = 0; k < 4; ++k) {
					int nx = nowx + dx[k];
					int ny = nowy + dy[k];
							
					if( nx < 0 || nx >= h || ny < 0 || ny >= w ) continue;
					if( s[nx][ny] == '#' ) continue;
							
					if( dist[nx][ny] > dist[nowx][nowy] + 1 ) {
						dist[nx][ny] = dist[nowx][nowy] + 1;
						q.push( make_pair(nx, ny) );
					}
				}
			}
			
			int max_dist = 0;
			for(int i = 0; i < h; ++i) {
				for(int j = 0; j < w; ++j) {
					if( s[i][j] == '#' ) continue;
					max_dist = max(max_dist, dist[i][j]);
				}
			}
			
			ans = max(ans, max_dist);
		}
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 256
/********************************************************************************
	
	Code by a weak man who named CYJian, and he hopes the code can get more points.

	Algorithm: 

 ********************************************************************************/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

//{{{ FAST IO AND SOME FUNCTIONS
const int __SIZE = 1 << 18;
char ibuf[__SIZE], *iS, *iT;

#define ge (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin), (iS == iT ? EOF : *iS++)) : *iS++)
#define ri read_int()
#define rl read_ll()
#define ra read_alpha()
#define FILE(s) freopen(s"in", "r", stdin), freopen(s"out", "w", stdout)

template<typename T>
inline void read(T &x) {
	char ch, t = 0; x = 0;
	while(!isdigit(ch = ge)) t |= ch == '-';
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = ge;
	x = t ? -x : x;
}
inline char read_alpha() { char c = ge; while(!isalpha(c) && c != EOF) c = ge; return c; }
inline int read_int() { int x; return read(x), x; }
inline ll read_ll() { ll x; return read(x), x; }

template<typename T> inline void chkmin(T&a, T b) { a = a < b ? a : b; }
template<typename T> inline void chkmax(T&a, T b) { a = a > b ? a : b; }
//}}}

const int mod = 1e9 + 7;

inline int Mod(int x) { return x >= mod ? x - mod : x; }

vector<int>to[5010];

int G[5010];
int g[5010];
int si[5010];
int mul[5010];
int f[5010][5010];

inline void dfs(int x, int la) {
	f[x][1] = si[x] = 1;
	for(auto u : to[x]) {
		if(u == la) continue;
		dfs(u, x);
		for(int i = 1; i <= si[x]; i++) {
			int F = f[x][i];
			g[i] = (g[i] + 1LL * F * (mod - G[u])) % mod;
			for(int j = 1; j <= si[u]; j++)
				g[i + j] = (g[i + j] + 1LL * F * f[u][j]) % mod;
		} si[x] += si[u];
		for(int i = si[x]; i; i--) f[x][i] = g[i], g[i] = 0;
	} int &F = G[x];
	for(int i = 2; i <= si[x]; i += 2) 
		F = (F + 1LL * mul[i] * f[x][i]) % mod;
}

int main() {
#ifdef LOCAL
	FILE("");
#endif
	int n = ri; mul[0] = 1;
	for(int i = 2; i <= n; i += 2) mul[i] = 1LL * mul[i - 2] * (i - 1) % mod;
	for(int i = 1; i < n; i++) {		
		int u = ri, v = ri;
		to[u].push_back(v);
		to[v].push_back(u);
	} dfs(1, 0);
	cout << G[1] << endl;
	return 0;
}

Measured memory_bytes: 98176
import fractions
from functools import reduce


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


N, X = map(int, input().split())
sbn_x = [abs(X - x) for x in list(map(int, input().split()))]
print(gcd_list(sbn_x))


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

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  if (abs(c - a) <= d) {
    cout << "Yes" << endl;
    return 0;
  }
  if (abs(b - a) <= d && abs(c - b) <= d) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}


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

template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
ll min(int a,ll b){return min((ll)a,b);} ll min(ll a,int b){return min(a,(ll)b);}
template <class S> void print(vector<S> &v){for(ll i=0; i<(ll)v.size(); i++){cerr << v[i] << ' ';}cerr << endl;}
template <class S> void print(vector<vector<S>> &v) {for (ll i = 0; i < (ll)v.size(); i++) {for (ll j = 0; j < (ll)v[i].size(); j++) {cerr << v[i][j] << ' ';}cerr << endl;}}

int main(){
	string s; cin >> s;
	int ans;
	if(s ==  "RRR"){
		ans = 3;
	}else if(s == "RSR"){
		ans = 1;
	}else{
		ans = count(all(s), 'R');
	}
	cout << ans << endl;
}

Measured memory_bytes: 3620
count = 0

s_chars = input()
k_num = int(input())

for i in s_chars:
    if i == '1':
        count += 1
    else:
        break

if s_chars[0] != '1':
    print(s_chars[0])
else:
    if count >= k_num:
        print(s_chars[k_num - 1])
    else:
        print(s_chars[count])

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

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 llINF = 1LL << 60;
const int iINF = 1e8;


const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){} //ll = x; x = x%mod+mod)%mod; と同じらしい
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}


//---main---------------------------------------------
int main(){
    //main
    int N;
    cin >> N;
    mint ans=0,tsum;
    cin >> tsum;
    mint Ai;
    rep(i,N-1){
        cin >> Ai;
        ans += Ai*tsum;
        tsum += Ai;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3628
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

print(inp()*2*math.pi)

Measured memory_bytes: 10376
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int N,M;
    cin >> N;
    set<string> st;
    rep(i,0,N){
        string s;
        cin >> s;
        st.insert(s);
    }
    cin >> M;
    int turn = 0;//0 close
    rep(i,0,M){
        string s;
        cin >> s;
        if(st.count(s)){
            if(!turn)cout << "Opened by " + s << endl;
            else     cout << "Closed by " + s << endl;
            turn = !turn;
        }else{
            cout << "Unknown " + s << endl;
        }
    }
}


Measured memory_bytes: 3244
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
#define MOD 1000000007

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;


int N,A,B;
bool K[20];
int U[20],T[20];
int u,t;

int f(int v){
  int k = 0;
  rep(i,0,t){
    if((v>>i & 1) && K[T[i]]){
      k |= 1<<T[i];
    }
    if((!(v>>i & 1)) && !K[T[i]]){
      k |= 1<<T[i];
    }
  }
  rep(i,0,u){
    int j = t+i;
    if((v>>j & 1) && K[U[i]]){
      k |= 1<<U[i];
    }
    if((!(v>>j & 1)) && !K[U[i]]){
      k |= 1<<U[i];
    }
  }
  return k;
}



int main(){
  cin >> N >> A >> B;
  int n=0;
  rep(i,0,N){
    if((A>>i & 1) != (B>>i & 1)) n++;
    if((A>>i & 1) && (B>>i & 1)){
      U[u]=i;u++;K[i]=true;
    }else if((!(A>>i & 1)) && (!(B>>i & 1))){
      U[u]=i;u++;K[i]=false;
    }else if((!(A>>i & 1)) && (B>>i & 1)){
      T[t]=i;t++;K[i]=true;
    }else{
      T[t]=i;t++;K[i]=false;
    }
  }

  if(n%2==0){
    cout << "NO" << endl;
    return 0;
  }
  vector<int> tmp[20];
  tmp[1].push_back(0);
  tmp[1].push_back(1);
  for(int i=3;i<=n;i+=2){
    for(int j=0;j<=(1<<(i-2))-4;j+=2){
      tmp[i].push_back((0<<(i-2))+tmp[i-2][j]);
      tmp[i].push_back((2<<(i-2))+tmp[i-2][j]);
      tmp[i].push_back((3<<(i-2))+tmp[i-2][j]);
      tmp[i].push_back((1<<(i-2))+tmp[i-2][j]);
      tmp[i].push_back((1<<(i-2))+tmp[i-2][j+1]);
      tmp[i].push_back((3<<(i-2))+tmp[i-2][j+1]);
      tmp[i].push_back((2<<(i-2))+tmp[i-2][j+1]);
      tmp[i].push_back((0<<(i-2))+tmp[i-2][j+1]);
    }
    tmp[i].push_back((0<<(i-2))+tmp[i-2][(1<<(i-2))-2]);
    tmp[i].push_back((0<<(i-2))+tmp[i-2][(1<<(i-2))-1]);
    tmp[i].push_back((2<<(i-2))+tmp[i-2][(1<<(i-2))-1]);
    tmp[i].push_back((2<<(i-2))+tmp[i-2][(1<<(i-2))-2]);
    tmp[i].push_back((3<<(i-2))+tmp[i-2][(1<<(i-2))-2]);
    tmp[i].push_back((1<<(i-2))+tmp[i-2][(1<<(i-2))-2]);
    tmp[i].push_back((1<<(i-2))+tmp[i-2][(1<<(i-2))-1]);
    tmp[i].push_back((3<<(i-2))+tmp[i-2][(1<<(i-2))-1]);
  }

  rep(i,0,N-n+1){
    for(int j=0;j<1<<(n+i);j+=2){
      tmp[n+i+1].push_back((1<<(n+i))+tmp[n+i][j]);
      tmp[n+i+1].push_back((0<<(n+i))+tmp[n+i][j]);
      tmp[n+i+1].push_back((0<<(n+i))+tmp[n+i][j+1]);
      tmp[n+i+1].push_back((1<<(n+i))+tmp[n+i][j+1]);
    }
  }

  vector<int> ans;

  cout << "YES" << endl;

  rep(i,0,tmp[N].size()){
    if(i!=0) cout << " ";
    cout << f(tmp[N][i]);
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 3316
#include "bits/stdc++.h"
using namespace std;
#define watch(x) cout << (#x) << " is " << (x) << endl

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

  int n;
  cin>>n;
  int a,b,c;
  cin>>a>>b>>c;
  vector<string>vals(n); 
  string ans;

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

  }

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

     if(vals[i]=="AB"){
           if(i+1<n && a==1 && b==1){
               if(vals[i+1]=="BC"){
                 b++;
                 a--;
                 ans+="B"; 
               }
               else if(vals[i+1]=="AC"){
                 a++;
                 b--;
                 ans+="A";
               }
               else{
                 a++;
                 b--;
                 ans+="A";
               }
           }
           else{
             if(a>b){
               a--;
               b++;
               ans+="B";
             }
             else{
               b--;
               a++;
               ans+="A";
             }
           }


     }
     else if(vals[i]=="BC"){
       if(i+1<n && c==1 && b==1){
               if(vals[i+1]=="AC"){
                 c++;
                 b--;
                 ans+="C"; 
               }
               else if(vals[i+1]=="AB"){
                 c--;
                 b++;
                 ans+="B";
               }
               else{
                 b++;
                 c--;
                 ans+="B";
               }
           }
           else{
             if(c>b){
               c--; 
               b++;
               ans+="B";
             }
             else{
               b--;
               c++;
               ans+="C";
             }
           }

     }
     else if(vals[i]=="AC"){
                 if(i+1<n && c==1 && a==1){
               if(vals[i+1]=="BC"){
                 c++;
                 a--;
                 ans+="C"; 
               }
               else if(vals[i+1]=="AB"){
                 c--;
                 a++;
                 ans+="A";
               }
               else{
                 a++;
                 c--;
                 ans+="A";
               }
           }
           else{
             if(c>a){
               c--; 
               a++;
               ans+="A";
             }
             else{
               a--;
               c++;
               ans+="C";
             }
           }  
     }


     if(a<0 || b<0 || c<0){
       cout<<"No"<<endl;
       return 0;
     }

  }
   cout<<"Yes"<<endl;
  for(char c:ans){
    cout<<c<<endl;
  }
  
     
  return 0;
}


Measured memory_bytes: 6644
#include<cstdio>

int n,m;
int D[100000]={};
int ans=0;
int Abs(int a){
	if(a<0) return a*=-1;
	return a;
}

int main(){
	scanf("%d%d",&n,&m);
	for(int i=0;i<n-1;i++){
		scanf("%d",&D[i+1]);
		D[i+1]+=D[i];
		//printf("%d\n",D[i+1]);
	}
	int cur=0;
	for(int i=0;i<m;i++){
		int q;
		scanf("%d",&q);
		ans+=Abs(D[cur+q]-D[cur]);
		ans%=100000;
		cur+=q;
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 1412
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.Random;
import java.util.Scanner;
 


public class Main {
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);   cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static long mod =1000000007;
	//static 	ArrayList<Integer> cc = new ArrayList<>(100);
	static int INF=1000000007;
	
	public static void main(String[] args) {
		//int N=sc.nextInt();for(int i=0;i<N;i++) {}
		//int a[]=new int[N];for(int i=0;i<N;i++) {}
		//Ae2+Be2=Ce2
		//StringBuffer str = new StringBuffer(hoge1);
		//for(int i=0;i<N;i++) {}
		
		//int N=sc.nextInt();for(int i=0;i<N;i++) {}
		int N=sc.nextInt();
		ArrayList<Integer> cc = new ArrayList<>(N);
		ArrayList<Integer> cc2 = new ArrayList<>(N);
		
		for(int i=0;i<N;i++) {
			cc.add(sc.nextInt()-1);
		}
		boolean x=false;
		for(int i=cc.size()-1;i>=0;i--) {
			
			if(i==cc.get(i)) {
				cc.remove(i);
				cc2.add(i);
				i=cc.size();
				continue;
			}
			if(i==0)x=true;
		}
		
		if(x) {
			p(-1);
		}else {
			Collections.reverse(cc2);
			for(int i:cc2) {
				p(i+1);
				}
		}
	
	}
	
		
	
	
		
	
	public static long modPow(long g,long N) {
		long T=1;
		for(int i=0;i<N;i++) {
			T*=g;
			T%=mod;
		}
		return T;
	}
	
	public static long lcm(long a, long b) {
        return a / gcd(a, b) * b;
	}
	
	public static long gcd(long a, long b) {
        return b == 0 ? a: gcd(b, a % b);
	}

	


	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	
}
	


Measured memory_bytes: 21844
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;
typedef long long int LL;
const int INF=2e9+1e8;
const int maxn=1e6+100;

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
	int odd=0,even=0;
	int n,p;
	scanf("%d%d",&n,&p);
	for(int i=0;i<n;i++)
	{
	    int x;
		scanf("%d",&x);
		if(x&1) odd++;
		else even++;
	}
	LL tot=pow(2LL,(LL)n);
	LL ans;
	ans=pow(2LL,LL(odd-1));
	ans=ans*pow(2LL,(LL)even);
	if(p&1)
	{
		printf("%lld\n",ans);
	}
	else 
	{
	    printf("%lld\n",tot-ans);
	}
    return 0;
}



Measured memory_bytes: 512
#include<iostream>
#include<cstdio>
#define cf(x) ((x)&1?P-1:1)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define ROF(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
const int N=110,M=10010;
int n,m,K,P,T,nv,p[M],q[M],r[M],v[M],f[N][N],c[N][N],g[N][N];
void chk(int&x){x-=P;x+=(x>>31)&P;}
int qpw(int x,int y){int z=1;for(;y;y>>=1,x=1ll*x*x%P)if(y&1) z=1ll*z*x%P;return z;}
void work(int x){
	p[0]=q[0]=r[0]=v[0]=1;nv=qpw(K-x+1,P-2);
	FOR(i,1,T) p[i]=1ll*p[i-1]*x%P,q[i]=1ll*q[i-1]*(x-1)%P;
	FOR(i,1,T) r[i]=1ll*r[i-1]*(K-x+1)%P,v[i]=1ll*v[i-1]*nv%P;
	FOR(i,0,n)FOR(j,0,n) g[i][j]=1ll*q[i*j]*cf(j)%P;
	FOR(i,0,n)FOR(j,0,m) f[i][j]=1ll*f[i][j]*r[(n-i)*(m-j)]%P;
	ROF(i,n,0)ROF(j,m,0)FOR(k,0,i-1) chk(f[i][j]+=1ll*f[k][j]*c[n-k][i-k]%P*p[j*(i-k)]%P);
	ROF(i,n,0)ROF(j,m,0)FOR(k,0,j-1) chk(f[i][j]+=1ll*f[i][k]*c[m-k][j-k]%P*p[i*(j-k)]%P);
	//FOR(i,0,n)FOR(j,0,m) cout<<f[i][j]<<" \n"[j==m];
	ROF(i,n,0)ROF(j,m,0)FOR(k,0,i-1) chk(f[i][j]+=1ll*f[k][j]*c[n-k][i-k]%P*g[j][i-k]%P);
	ROF(i,n,0)ROF(j,m,0)FOR(k,0,j-1) chk(f[i][j]+=1ll*f[i][k]*c[m-k][j-k]%P*g[i][j-k]%P);
	FOR(i,0,n)FOR(j,0,m) f[i][j]=1ll*f[i][j]*v[(n-i)*(m-j)]%P;
	//FOR(i,0,n)FOR(j,0,m) cout<<f[i][j]<<" \n"[j==m];
}
int main(){
	//freopen("1.in","r",stdin);
	scanf("%d%d%d%d",&n,&m,&K,&P);
	if(n<m) swap(n,m);T=n*m;
	FOR(i,0,n) c[i][0]=1;
	FOR(i,1,n)FOR(j,1,i) c[i][j]=(c[i-1][j-1]+c[i-1][j])%P;
	f[0][0]=1;
	FOR(i,1,K) work(K-i+1);
	cout<<f[n][m]<<'\n';
}

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

#define for_(i,a,b) for(int i=a;i<b;++i)
#define for_rev(i,a,b) for(int i=a;i>=b;--i)
#define allof(a) a.begin(),a.end()
#define minit(a,b) memset(a,b,sizeof(a))
#define size_of(a) (int)a.size()

typedef long long lint;
typedef double Double;
typedef pair<int, int> pii;

const int iINF = 1L << 30;
const lint lINF = 1LL << 60;
const Double EPS = 1e-9;

struct Edge {
	int to, cost, cold;
	Edge(int _to, int _cost, int _cold) : to(_to), cost(_cost), cold(_cold) {}
};
bool operator > (const Edge& a, const Edge& b) { return a.cost > b.cost; }

int N, M, L, K, A, H;
bool can_cold[110];
vector< vector<Edge> > edges;
int cost[110][110];

void solve() {
	for_(i,0,N) fill(cost[i], cost[i] + M + 5, iINF);
	
	priority_queue<Edge, vector<Edge>, greater<Edge> > q;
	q.push(Edge(A,0,M));
	
	cost[A][M] = 0;
	
	while (!q.empty()) {
		Edge a = q.top(); q.pop();
		int v = a.to, ca = a.cost, cla = a.cold;
		
		if (cost[v][cla] < ca) continue;
		
		if (v == H) {
			cout << ca << endl;
			return;
		}
		
		int e_size = size_of(edges[v]);
		for_(i,0,e_size) {
			Edge b = edges[v][i];
			int u = b.to, cb = b.cost;
			
			int nxt_cl = cla - cb;
			if (nxt_cl < 0) continue;
			
			int nxt_cost = ca + cb;
			if (cost[u][nxt_cl] > nxt_cost) {
				cost[u][nxt_cl] = nxt_cost;
				q.push(Edge(u, nxt_cost, nxt_cl));
			}
			
			if (can_cold[u]) {
				while (nxt_cl < M) {
					nxt_cl++;
					nxt_cost++;
					
					if (cost[u][nxt_cl] > nxt_cost) {
						cost[u][nxt_cl] = nxt_cost;
						q.push(Edge(u, nxt_cost, nxt_cl));
					}
				}
			}
		}
	}
	
	cout << "Help!" << endl;
}

int main() {
	while (cin >> N >> M >> L >> K >> A >> H, N) {
		minit(can_cold, 0);
		for_(i,0,L) {
			int a; cin >> a;
			can_cold[a] = true;
		}
		edges.assign(N, vector<Edge>());
		for_(i,0,K) {
			int x, y, t; cin >> x >> y >> t;
			edges[x].push_back(Edge(y, t, 0));
			edges[y].push_back(Edge(x, t, 0));
		}
		solve();
	}
	return 0;
}

Measured memory_bytes: 1640
#include<iostream>
#include<iomanip>
#include<math.h>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<bitset>
#include<random>
#include<time.h>
#define INF 1000000000ll
#define MOD 1000000007ll
#define EPS 1e-10
#define REP(i,m) for(long long i=0; i<(ll)m; i++)
#define FOR(i,n,m) for(long long i=n; i<(ll)m; i++)
#define DUMP(a) for(long long dump=0; dump<(ll)a.size(); dump++) { cout<<a[dump]; if(dump!=(ll)a.size()-1) cout<<" "; else cout<<endl; }
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v) sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef long double ld;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n;
	cin>>n;
	vector<P> x(n);
	REP(i,n) cin>>x[i].first;
	REP(i,n) x[i].second=i;
	sort(ALL(x));
	vector<ll> ans(n);
	REP(i,n) {
		if(i<n/2) {
			ans[x[i].second]=x[n/2].first;
		} else {
			ans[x[i].second]=x[n/2-1].first;
		}
	}
	REP(i,n) cout<<ans[i]<<endl;
}


Measured memory_bytes: 6912
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define pb push_back
#define sz(x) (int)(x).size()
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;

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

    if(n == m) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

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

int main()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);  
   ll x;
   cin >> x;
   ll ans=100;
   ll count=0;
   while(ans<x)
   {
       ans*=1.01;
       count++;
   }
   cout << count << endl;

    return 0;
}

Measured memory_bytes: 3648
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        System.out.println(n * n * n);
    }
}

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int a, b;
    cin >> a >> b;

    if (a >= 13)
        cout << b << '\n';
    else if (a <= 12 && a >= 6)
        cout << b / 2 << '\n';
    else
        cout << 0 << '\n';

    return 0;
}


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

#ifndef M_PI
#define M_PI 3.14159265358979
#endif
#define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI)
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)

using namespace std;

typedef long long ll;
typedef vector<long long> vll;
typedef pair<long long, long long> pll;
typedef long double ld;

const ll INF = 1e15;
const ll MOD = 1e9 + 7;

int main() {
    ll i, j, k;
    ll N;
    cin >> N;
    vll A(N);
    for(auto &e : A)
        cin >> e;
    ll ans = 0;
    for(i = 1; i < N + 1; i += 2) {
        if(A[i - 1] % 2 == 1)
            ans++;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define nl "\n"
#define rep(i,n) for(ll i=0; i<(n); i++)
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007 //998244353
typedef vector<ll> vl;
typedef vector<vl> matrix;//A(n, vl(m)); //n*m行列
typedef vector<string> vs;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
typedef vector<bool> vb;
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define Sortup(V) sort(V.begin(), V.end())
#define Sortdown(V) sort(V.rbegin(), V.rend())
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a, const T &b){if(b<a){a=b;return 1;}return 0;}
void CumuSum(vl &A){rep(i,A.size())if(i)A[i]+=A[i-1];}
ll llpow(ll e,ll x){ll res=1LL;while(x){if(x&1)res*=e;e*=e;x/=2;}return res;}
ll llpowMOD(ll e,ll x){ll res=1LL;while(x){if(x&1)res*=e;e*=e;x/=2;res%=MOD;e%=MOD;}return res;}
bool bit(ll subset, ll Rsift){ return ((subset)>>(Rsift))&1; }

ll gcd(ll A, ll B){
    if(A<B) swap(A,B);
    while(B){
        ll w = A%B;
        A = B;
        B = w;
    }
    return A;
}

ll lcm(ll A, ll B){return A/gcd(A,B)*B;}

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

    // solution comes here

    ll N;
    cin >> N;

    if(N%2) {
        cout << "0" << nl;
        return 0;
    }

    ll ans = 0LL;
    N /= 2;
    while(N){
        ans += N/5;
        N /= 5;
    }

    cout << ans << nl;
}

Measured memory_bytes: 256
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,m,a,b,h[5000],L;
vector<ll> v[5000],ans;
queue<ll> que;
int main(void){
    cin>>n>>m;
    for(int i=0;i<m;i++){
        cin>>a>>b;
        a--,b--;
        h[a]++;
        v[b].push_back(a);
    }
    for(int i=0;i<n;i++){
        if(h[i]==0)que.push(i);
    }
    while(!que.empty()){
        if(que.size()>1)L=1;
        ll q=que.front();
        que.pop();
        ans.push_back(q);
        for(auto x:v[q]){
            h[x]--;
            if(h[x]==0)que.push(x);
        }
    }
    reverse(ans.begin(),ans.end());
    for(auto x:ans)cout<<x+1<<endl;
    cout<<L<<endl;
}



Measured memory_bytes: 4424
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/indexed.hpp>

using namespace std;
using namespace boost::adaptors;
using namespace std::string_literals;
using ll = int64_t;
using vecint = vector<int>;
using vecll = vector<ll>;
using boost::irange;

int main()
{
  ll n,a,b;
  cin>>n>>a>>b;
  ll ans = 0;
  ans += a * (n / (a+b));
  n %= (a+b);
  ans += min(a, n);
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
a,b,k = input().split()
a = int(a)
b = int(b)
k = int(k)
i = 0
while k > 0:
    if i == 0:
        if a % 2 == 1:
            a = a - 1
        else:
            pass
        a = a // 2
        b = b + a
        k = k - 1
        i = i + 1
    else:
        if b % 2 == 1:
            b = b - 1
        else:
            pass
        b = b // 2
        a = a + b
        k = k - 1
        i = i - 1
print(a,b)

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

#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#ifdef LOCAL
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define dassert(...) assert(__VA_ARGS__)
#else
#define dump(x)
#define debug(x)
#define dassert(...)
#endif
//#define int long long

typedef long long ll;
const ll MOD = 1e9 + 7;
const long double EPS = 1e-8;

void solve(long long K, long long N, std::vector<long long> A){
    int maxDiff = A[0] + (K - A[N-1]);
    rep(i,1,N) {
        maxDiff = max<int>(maxDiff, A[i] - A[i-1]);
    }
    cout << (K - maxDiff) << endl;
}

signed main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    long long K;
    scanf("%lld",&K);
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(K, N, std::move(A));
    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
 
int n;
int ans[55], pst[55];
char ch[55];

int main() {
	cin >> n;
	cin >> ch;
	int len = strlen(ch);
	for(int i = 0; i < len; ++i)
		ans[ch[i] - 'a' + 1]++;
	for(int i = 1; i < n; ++i) {
		memset(pst, 0, sizeof(pst));
		cin >> ch;
		int len = strlen(ch);
		for(int j = 0; j < len; ++j)	pst[ch[j] - 'a' + 1]++;
		for(int k = 1; k <= 26; ++k) {
			ans[k] = min(ans[k], pst[k]);
		}
	}
	for(int i = 1; i <= 26; ++i) {
		while(ans[i]) {
			printf("%c", i + 'a' - 1);
			--ans[i];
		}
	}
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll  = int64_t;
using P   = pair<ll, ll>;
using mat = vector<vector<ll>>;

void IOS() { ios::sync_with_stdio(false), cin.tie(0); }

template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    fill((T *)array, (T *)(array + N), val);
}

const ll INF = 1e16;
const ll MOD = 1e9 + 7;
// int dx[4] = {1,0,-1,0};
// int dy[4] = {0,1,0,-1};
// ll pas[5001][5002];

signed main() {
    IOS();
    ll n, a, b;
    cin >> n >> a >> b;
    ll cnt[3] = {};
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        if (x <= a)
            cnt[0]++;
        else if (x <= b)
            cnt[1]++;
        else
            cnt[2]++;
    }
    ll ans = min(cnt[0], min(cnt[1], cnt[2]));
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <map>
#include <vector>
#include <queue>
#include <set>
#include <algorithm>
#include <iostream>
using namespace std;
typedef pair<int, int> P;

bool compare(P p, P q) { return p.second < q.second; }

int main() {
    int n; cin >> n;
    vector<P> ps;
    for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; ps.push_back(P(x, y)); }
    sort(ps.begin(), ps.end());
    map<P, vector<pair<int, P> > > adj;
    for (int i = 1; i < n; i++) {
        P prev = ps[i-1], cur = ps[i];
        adj[prev].push_back(make_pair(cur.first - prev.first, cur));
        adj[cur].push_back(make_pair(cur.first - prev.first, prev));
    }
    sort(ps.begin(), ps.end(), compare);
    for (int i = 1; i < n; i++) {
        P prev = ps[i-1], cur = ps[i];
        adj[prev].push_back(make_pair(cur.second - prev.second, cur));
        adj[cur].push_back(make_pair(cur.second - prev.second, prev));
    }
    long long ans = 0;
    priority_queue<pair<int, P>, vector<pair<int, P> >, greater<pair<int, P> > > q;
    set<P> v;
    P p = *ps.begin();
    v.insert(p);
    for (auto x : adj[p]) q.push(x);
    while (!q.empty()) {
        auto e = q.top(); q.pop();
        if (v.find(e.second) != v.end()) continue;
        ans += e.first;
        v.insert(e.second);
        for (auto x : adj[e.second]) q.push(x);
    }
    cout << ans << endl;
}


Measured memory_bytes: 30060