akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll INF = 1e9;
bool graph[nmax][nmax];
vector<vector<ll>> dist = vector<vector<ll>>(nmax, vector<ll>(nmax, INF));
void warshall_floyd(ll n)
{
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < n; j++)
        {
            for (size_t k = 0; k < n; k++)
            {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
}

class UnionFind
{
public:
    vector<ll> Parent;

    UnionFind(ll N)
    {
        Parent = vector<ll>(N, -1);
    }
    ll find(ll A)
    {
        if (Parent[A] < 0)
            return A;
        return Parent[A] = find(Parent[A]);
    }

    ll size(ll A)
    {
        return -Parent[find(A)];
    }

    bool Union(ll A, ll B)
    {
        A = find(A);
        B = find(B);
        if (A == B)
        {
            return false;
        }
        if (size(A) < size(B))
            swap(A, B);

        Parent[A] += Parent[B];
        Parent[B] = A;

        return true;
    }
};

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

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

ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

ll powMod(ll a, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    else if (p % 2 == 0)
    {
        ll half = powMod(a, p / 2);
        return mulMod(half, half);
    }
    else
    {
        return mulMod(powMod(a, p - 1), a);
    }
}

ll ceil(ll a, ll b)
{
    return (a + b - 1) / b;
}

void solve(long long N, std::vector<long long> x, std::vector<long long> y, std::vector<long long> h)
{
    for (int tmpX = 0; tmpX < 101; tmpX++)
    {
        for (int tmpY = 0; tmpY < 101; tmpY++)
        {
            ll tmpH;
            for (int i = 0; i < N; i++)
            {
                if (h[i] != 0)
                {
                    tmpH = abs(x[i] - tmpX) + abs(y[i] - tmpY) + h[i];
                    break;
                }
            }

            bool ans = true;
            for (int i = 0; i < N; i++)
            {
                if (h[i] != max(0LL, tmpH - abs(tmpX - x[i]) - abs(tmpY - y[i])))
                {
                    ans = false;
                    break;
                }
            }

            if (ans && tmpH >= 1)
            {
                cout << tmpX << " " << tmpY << " " << tmpH << endl;
                return;
            }
        }
    }
}

int main()
{
    long long N;
    scanf("%lld", &N);
    std::vector<long long> x(N);
    std::vector<long long> y(N);
    std::vector<long long> h(N);
    for (int i = 0; i < N; i++)
    {
        scanf("%lld", &x[i]);
        scanf("%lld", &y[i]);
        scanf("%lld", &h[i]);
    }
    solve(N, std::move(x), std::move(y), std::move(h));
    return 0;
}


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

#define llint long long
#define LL(x) (x * 2)
#define RR(x) (x * 2 + 1)
#define fi first
#define se second
#define db(x) cout << #x << " = " << x << endl;
#define BIT(x, i) ((x >> i) & 1)
#define MASK(i) (1ll << i)
#define mini(x, y) (x > y ? x = y, 1 : 0)
#define maxi(x, y) (x < y ? x = y, 1 : 0)

void openFile() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifdef Tr___
	freopen("test.inp", "r", stdin);
	freopen("test.out", "w", stdout);
	#endif
}

const int maxN = 3e2 + 5;
const int maxM = 1e6 + 5;
const llint INF = 1e9 + 7;

struct edge {
	int u, v, f;
};

class maxFlow {
public:
	int S, T;
	int N;
	vector<edge> E;
	vector<int> vertex[maxN];
	int ptr[maxN];
	int d[maxN];
	int q[maxM], qh, qt;

	void clear(int n) {
		N = n;
		E.clear();
		for (int i = 0; i < maxN; ++i) {
			vertex[i].clear();
			ptr[i] = 0;
		}
	}

	void addEdge2(int u, int v, int cap) {
		vertex[u].push_back(E.size());
		E.push_back({u, v, cap});
		vertex[v].push_back(E.size());
		E.push_back({v, u, 0});
	}

	void addEdge(int u, int v, int cap) {
		addEdge2(u, v, cap);
		addEdge2(v, u, cap);
		//cout << u << " " << v << " " << endl;
	}

	int getMax(int _s, int _t) {
		S = _s, T = _t;
		int res = 0;

		for (;;) {
			for (int i = 0; i <= N; ++i) {
				ptr[i] = 0;
				d[i] = -1;
			}
			if (!bfs()) break;
			while (int pushed = dfs(S, INF)) {
				res = res + pushed;
			}
		}
		return res;
	}

private:
	bool bfs() {
		d[S] = 0;
		qh = qt = 0;
		q[qt++] = S;

		while (qh < qt && d[T] == -1) {
			int u = q[qh++];
			//db(u);
			for (int i = 0; i < vertex[u].size(); ++i) {
				int id = vertex[u][i];
				int v = E[id].v;
				int f = E[id].f;
				//db(v); db(f);
				if (f > 0 && d[v] == -1) {
					d[v] = d[u] + 1;
					q[qt++] = v;
				}
			}
		}

		return d[T] != -1;
	}

	int dfs(int u, int flow) {
		if (flow == 0) return flow;
		if (u == T) return flow;

		for (; ptr[u] < (int) vertex[u].size(); ++ptr[u]) {
			int id = vertex[u][ptr[u]];
			int v = E[id].v;
			int f = E[id].f;

			if (d[v] != d[u] + 1) continue;

			int pushed = dfs(v, min(flow, f));
			if (pushed) {
				E[id].f -= pushed;
				E[id^1].f += pushed;
				return pushed;
			}
		}

		return 0;
	}
} G;

int N, M;
char a[maxN][maxN];

void enter() {
	cin >> N >> M;
	for (int i = 1; i <= N; ++i) {
		for (int j = 1; j <= M; ++j) {
			cin >> a[i][j];
		}
	}
}

void solve() {
	G.clear(N + M + 2);
	for (int i = 1; i <= N; ++i) {
		for (int j = 1; j <= M; ++j) {
			if (a[i][j] == 'o') {
				G.addEdge(i, N + j, 1);
			}

			if (a[i][j] == 'S') {
				G.addEdge(N + M + 1, i, INF);
				G.addEdge(N + M + 1, N + j, INF);

				for (int ii = 1; ii <= N; ++ii) {
					if (a[ii][j] == 'T') {
						cout << -1 << endl;
						return;
					}
				}

				for (int jj = 1; jj <= M; ++jj) {
					if (a[i][jj] == 'T') {
						cout << -1 << endl;
						return;
					}
				}
			}
			else if (a[i][j] == 'T') {
				G.addEdge(i, N + M + 2, INF);
				G.addEdge(N + j, N + M + 2, INF);
			}
		}
	}

	cout << G.getMax(N + M + 1, N + M + 2) << endl;
}

int main() {
	openFile();
	enter();
	solve();
	return 0;
}


Measured memory_bytes: 1324
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;

public class Main{

	static PrintWriter out;
	static InputReader ir;

	static void solve(){
		while(true){
			int d=ir.nextInt();
			if(d==0)
				break;
			int e=ir.nextInt();
			double mi=1e9;
			for(int i=0;i<=d/2;i++){
				mi=Math.min(mi,Math.abs(Math.sqrt(i*i+(d-i)*(d-i))-e));
			}
			out.println(mi);
		}
	}

	public static void main(String[] args) throws Exception{
		ir=new InputReader(System.in);
		out=new PrintWriter(System.out);
		solve();
		out.flush();
	}

	static class InputReader {

		private InputStream in;
		private byte[] buffer=new byte[1024];
		private int curbuf;
		private int lenbuf;

		public InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}

		public boolean hasNextByte() {
			if(curbuf>=lenbuf){
				curbuf= 0;
				try{
					lenbuf=in.read(buffer);
				}catch(IOException e) {
					throw new InputMismatchException();
				}
				if(lenbuf<=0) return false;
			}
			return true;
		}

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

		private boolean isSpaceChar(int c){return !(c>=33&&c<=126);}

		private void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}

		public boolean hasNext(){skip(); return hasNextByte();}

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

		public int nextInt() {
			if(!hasNext()) throw new NoSuchElementException();
			int c=readByte();
			while (isSpaceChar(c)) c=readByte();
			boolean minus=false;
			if (c=='-') {
				minus=true;
				c=readByte();
			}
			int res=0;
			do{
				if(c<'0'||c>'9') throw new InputMismatchException();
				res=res*10+c-'0';
				c=readByte();
			}while(!isSpaceChar(c));
			return (minus)?-res:res;
		}

		public long nextLong() {
			if(!hasNext()) throw new NoSuchElementException();
			int c=readByte();
			while (isSpaceChar(c)) c=readByte();
			boolean minus=false;
			if (c=='-') {
				minus=true;
				c=readByte();
			}
			long res = 0;
			do{
				if(c<'0'||c>'9') throw new InputMismatchException();
				res=res*10+c-'0';
				c=readByte();
			}while(!isSpaceChar(c));
			return (minus)?-res:res;
		}

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

		public int[] nextIntArray(int n){
			int[] a=new int[n];
			for(int i=0;i<n;i++) a[i]=nextInt();
			return a;
		}

		public long[] nextLongArray(int n){
			long[] a=new long[n];
			for(int i=0;i<n;i++) a[i]=nextLong();
			return a;
		}

		public char[][] nextCharMap(int n,int m){
			char[][] map=new char[n][m];
			for(int i=0;i<n;i++) map[i]=next().toCharArray();
			return map;
		}
	}
}

Measured memory_bytes: 24220
import sys
h,w=map(int,input().split())
s=[[0]*(w+2)]+[[0]+list(map(int,list(input().replace('#','1').replace('.','0'))))+[0]for i in range(h)]+[[0]*(w+2)]    
for i in range(1,h+1):
  for j in range(1,w+1):
    if s[i][j]==1:
      if s[i-1][j]+s[i+1][j]+s[i][j-1]+s[i][j+1]==0:
        print('No')
        sys.exit()
print('Yes')

Measured memory_bytes: 3064
#include <iostream>

int main(){
  int input_num,finger_num,max_data;
  finger_num=21,max_data=100;
  std::cin >> input_num;
  int data[max_data];
  long long   fingers[max_data][finger_num];

  for(int i=0;i<input_num-1;i++){
    std::cin>>data[i];
    for(int j=0;j<finger_num;j++){
      fingers[i][j] = 0;
    }
  }

//初期化



  fingers[0][data[0]] = 1;
  for(int i=1;i<input_num-1;i++){
    for(int j = 0;j<finger_num;j++){
      if(data[i]+j <=20){
        fingers[i][data[i]+j] += fingers[i-1][j];
      }
      if(j-data[i]>=0){
        fingers[i][j-data[i]] += fingers[i-1][j];
      }

    }
  }

  int tmp; std::cin>>tmp;
  std::cout<<fingers[input_num-2][tmp]<<std::endl;


  return 0;
}



Measured memory_bytes: 3112
#include <bits/stdc++.h>                                           
 
//#define int long long
//#pragma GCC optimize("Ofast")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
 
 
#define file(s) freopen(s".in","r",stdin); freopen(s".out","w",stdout);
#define forev(i, b, a) for(int i = (b); i >= (a); --i)
#define forn(i, a, b) for(int i = (a); i <= (b); ++i)
#define all(x) x.begin(), x.end()
#define sz(s) (int)s.size()
#define pb push_back
#define ppb pop_back
#define s second
#define f first
 
 
using namespace std;
 
 
typedef pair < long long, long long > pll;    
typedef pair < int, int > pii;
typedef unsigned long long ull;         
typedef vector < pii > vpii;
typedef vector < int > vi;
typedef long double ldb;  
typedef long long ll;  
typedef double db;                      
 
 
const int inf = 1e9, maxn = 4e5 + 148, mod = 1e9 + 7, N = (1 << 21) + 21;
const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, block = 555;
const pii base = {1171, 3307}, Mod = {1e9 + 7, 1e9 + 9};
const db eps = 1e-12, pi = 3.14159265359;
const ll INF = 1e18;


int n, x, dp[N], a[30][30];
vi g[30];

void add (int &x, int y) {
	x += y;
	if (x >= mod)
		x -= mod;
	if (x < 0)
		x += mod;
}

main () {
	cin >> n;
	forn (i, 0, n - 1)
		forn (j, 0, n - 1) 
			cin >> a[i][j];
			

	dp[0] = 1;
	forn (mask, 1, (1 << n) - 1)  {
		int cur = __builtin_popcount(mask) - 1;
		forn (i, 0, n - 1)
			if ((mask & (1 << i)) && a[cur][i]) 
				add(dp[mask], dp[mask ^ (1 << i)]);																				
	}
	cout << dp[(1 << n) - 1];
}

    

Measured memory_bytes: 8448
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
#define sim template < class c
#define int long long
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << '\n'; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
typedef tree< pair<int,int>, null_type, less<pair<int,int> >, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef long long ll;
const ll MOD = 1e9 + 7 ;
const ll N = 2e5 + 10 ;
const ll INF = 1e18 + 10 ;
signed main(){
    fastio
    int n , x , y ;
    cin >> n >> x >> y ; 
    x--, y--; 
    vector<vector<int> > g(n) ;
    for(int i = 1; i < n; i++){
        g[i - 1].emplace_back(i) ;
        g[i].emplace_back(i - 1) ;
    }
    g[x].emplace_back(y) ;
    g[y].emplace_back(x) ;
    vector<int> ans(n) ;
    for(int source = 0; source < n; source++){
        queue<int> q ;
        q.push(source) ;
        vector<int> dist(n, INF) ;
        dist[source] = 0 ; 
        while(not q.empty()){
            int f = q.front() ; q.pop() ;
            for(int &c : g[f]){
                if ( dist[c] > dist[f] + 1 ){
                    dist[c] = dist[f] + 1 ;
                    q.push(c) ;
                }
            }
        }
        for(int i = source + 1; i < n; i++){
            ans[dist[i]]++;
        }
    }
    for(int i = 1; i < n; i++){
        cout << ans[i] << endl;
    }
    return 0; 
}

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

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

    ll n, ans = 4, _min = 2e15;
    vector<ll> x(5);
    cin >> n;
    for (int i = 0; i < 5; i++) {
        cin >> x[i];
        if (x[i] < _min)
            _min = x[i];
    }

    ans += (n % _min) ? (n / _min + 1) : (n / _min);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main()
{
	char a[20],b[20];
	scanf("%s%s", a, b);
	strcat(a, b);
	int sum=0,i,c[400];
	for (i = 0; a[i] != '\0'; i++)
	{
		sum = sum * 10 + (a[i] - '0');
	}
	for (i = 1; i <= 400; i++)
		c[i] = i*i;
	int flag = 1;
	for (i = 1; i <= 400; i++)
		if (c[i] == sum)
		{
			printf("Yes");
			flag = 0;
		}
	if (flag == 1)
		printf("No");
	//getchar(); getchar();
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<stdio.h>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
const int max_n = 1e6 + 5;
bool cmp(int a,int b){return a > b;}

int main(){
    int n,a[max_n];
    memset(a,0,sizeof(a));
    scanf("%d",&n);
    for(int i =  1; i <= n; i++){
        scanf("%d",&a[i]);
    }
    sort(a+1 , a+ n+1,cmp);
    for(int x = 1; x <= n; x++){
        if(a[x + 1] < x + 1 && a[x] >= x){
            int j = 0;
            while(a[j + x + 1] == x) j++;//距离右边界距离
            if((a[x] -x) %2 == 0 && j % 2 == 0)printf("Second\n");
            else printf("First\n");
            break;
        }
    }

    return 0;
}


Measured memory_bytes: 7616
//HOME- Volume0-0067

#include <iostream>
#include <string>

#define N 12

using namespace std;

int paint(int world[N][N], int h, int w);

int main() {
  while (1){
    int world[N][N];
    int ans = 0;
    string str;
    int i, j;

    for(i = 0; i < N; i++) {
      if(!(cin >> str)) return 0;
      for(j = 0; j < N; j++)
	world[i][j] = (int)(str.at(j) - '0');
    }
    
    for(i = 0; i < N; i++)
      for(j = 0; j < N; j++)
	ans += paint(world, i, j);
    
    cout << ans << endl;
  }
}

int paint(int world[N][N], int h, int w) {
  if(world[h][w] == 0)
    return 0;
  else {
    world[h][w] = 0;
    if(h + 1 < N) paint(world, h + 1, w);
    if(h - 1 >= 0) paint(world, h - 1, w);
    if(w + 1 < N) paint(world, h, w + 1);
    if(w - 1 >= 0) paint(world, h, w - 1);
    return 1;
  }
}


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

using namespace std;

char a[555][555], b[555][555], s[555][555];
int h, w;

int main(){
//	freopen("input.inp", "r", stdin);
	scanf("%d%d",&h,&w);
	for(int i = 0; i < h; ++i) scanf("%s",&s[i]);
	for(int i = 0; i < h; ++i){
		for(int j = 0; j < w; ++j){
			a[i][j] = '#';
			b[i][j] = '.';
			if (j == w - 1) swap(a[i][j], b[i][j]);
			else if (j > 0 && i % 2) swap(a[i][j], b[i][j]);
			if (s[i][j] == '#') a[i][j] = b[i][j] = '#';
		}
	}
	for(int i = 0; i < h; ++i) printf("%s\n",a[i]);
	printf("\n");
	for(int i = 0; i < h; ++i) printf("%s\n",b[i]);
	return 0;
}

Measured memory_bytes: 1536
// God put a smile upon your face <3

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

#define slld(longvalue) scanf("%lld", &longvalue)

#define ll long long
#define ull unsigned long long
#define pll pair < long long, long long >

#define fastio ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0)

#define pb push_back

#define bug printf("BUG\n")

#define mxlld LLONG_MAX
#define mnlld -LLONG_MAX

#define mxd 2e8
#define mnd -2e8

#define pi 3.14159265359

using namespace std;

bool check(ll n, ll pos)
{
	return n & (1LL << pos);
}

ll Set(ll n, ll pos)
{
	return n = n | (1LL << pos);
}

vector < ll > pos, neg;
const ll mod = (1e9) + 7;

ll mul(ll x, ll y)
{
	return ((x % mod) * (y % mod)) % mod;
}

int main()
{
    ll i, j, k, l, m, n, o, r, q;
    ll testcase;
    ll input, flag, tag, ans;

//    freopen("input.txt", "r", stdin);

//    freopen("output.txt", "w", stdout);

    while(cin >> n >> k)
    {
		pos.clear();
		neg.clear();

		for(ll i = 0; i < n; i++)
		{
			slld(input);

			if(input < 0) neg.push_back(input);
			else pos.push_back(input);
		}

		ll res = 1;

		sort(neg.begin(),neg.end());
		sort(pos.rbegin(),pos.rend());

		if(pos.empty() && (k & 1))
		{
			sort(neg.rbegin(),neg.rend());
			for(j = 0; j < k; j++) res = mul(res,neg[j]);

			res += mod;
		}
		else if(k == n)
		{
			for(auto it: pos) res = mul(res,it);
			for(auto it: neg) res = mul(res,it);
			
			res = (res + mod) % mod;
		}
		else
		{
			ll idxp = 0, idxn = 0;

			if(k & 1) res = mul(res, pos[idxp]), idxp++, k--;

			for(ll i = 1; i <= k; i += 2)
			{
				if(idxp + 1 < pos.size() && idxn + 1 < neg.size())
				{
					if(pos[idxp] * pos[idxp + 1] >= neg[idxn] * neg[idxn + 1])
					{
						res = mul(res, pos[idxp] * pos[idxp + 1]);
						idxp += 2;
					}
					else
					{
						res = mul(res, neg[idxn] * neg[idxn + 1]);
						idxn += 2;
					}
				}
				else if(idxp + 1 < pos.size())
				{
					res = mul(res, pos[idxp] * pos[idxp + 1]);
					idxp += 2;
				}
				else if(idxn + 1 < neg.size())
				{
					res = mul(res, neg[idxn] * neg[idxn + 1]);
					idxn += 2;
				}
				else assert(0);
			}
		}

		printf("%lld\n", res);
    }


}





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

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++)cin >> a[i];
  vector<int> b(n+1,0),c(n+1,0);
  for(int i=0;i<n;i++){
    b[i+1]=(b[i]>a[i]?b[i]:a[i]);
    c[n-1-i]=(c[n-i]>a[n-1-i]?c[n-i]:a[n-1-i]);
  }
  for(int i=0;i<n;i++){
    cout << max(b[i],c[i+1]) << endl;
  }
}

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

int main() {
  ll n;
  cin >> n;
  bool flag = 0;
  for (ll i = 0; i <= n; i += 4) {
    if ((n-i)%7 == 0) flag = 1;
  }
  if (flag) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
import core.bitop, std.bitmanip;
import core.checkedint;
import std.algorithm, std.functional, std.meta;
import std.array, std.container;
import std.bigint;
import std.conv;
import std.math, std.numeric;
import std.range, std.range.interfaces;
import std.stdio, std.string;
import std.typecons;

void main()
{
    int a, b;
    readf("%s %s", &a, &b);
    readln;
    
    if (a < b) { swap(a, b); }
    
    long ans = 0;
    foreach (i; 0 .. a) {
        ans = ans * 10 + b;
    }
    
    ans.writeln;
}

Measured memory_bytes: 256
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()

def resolve():
    import sys
    input = sys.stdin.readline

    x = int(input().rstrip())

    if x // 100 * 5 >= x % 100:
        print(1)
    else:
        print(0)


if __name__ == "__main__":
    resolve()


Measured memory_bytes: 61032
import java.io.*;
import java.util.*;

public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        int[] h = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = scan.nextInt();
        }
        int solve = dp(n, h, k);
        System.out.println(solve);
    }

    public static int dp(int n, int[] h, int K) {
        int[] arr = new int[n];
        arr[1] = Math.abs(h[0] - h[1]);
        for (int i = 2; i < arr.length; i++) {
            int min = Integer.MAX_VALUE;
            for (int k = 1; k <= K; k++) {
                if(i-k>=0){
                min  = Math.min(min, Math.abs(h[i-k]-h[i])+arr[i-k]);
            }
                arr[i] = min;
            }
        }
        return arr[n - 1];
    }

}

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  __MAKE_TIME__  Problem: __PROBLEM__ / Link: __CONTEST_URL__  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */
struct Cumusum {
	vector<LL>csum;
	Cumusum(vector<LL>&a) {
		csum.assign((int)a.size()+1, 0);
		for (int i = 0; i < (int)a.size(); i++) {
			csum[i + 1] = csum[i] + a[i];
		}
	}
	LL query(int l, int r) {
		return csum[r] - csum[l];
	}
};

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

	LL N;
	cin >> N;
	VL a(N);
	FOR(i, 0, N) {
		cin >> a[i];
	}
	Cumusum A(a);
	// [L,R)を絶対値の差が小さくなるように2つに分割する
	auto f = [](Cumusum&A, int Lidx, int Ridx) {
		LL L = Lidx; LL R = Ridx;
		FOR(i, 0, 60) {
			int m1 = (2 * L + R) / 3;
			int m2 = (L + 2 * R) / 3;
			LL dif1 = abs(A.query(Lidx, m1) - A.query(m1, Ridx));
			LL dif2 = abs(A.query(Lidx, m2) - A.query(m2, Ridx));
			if (dif1 < dif2) {
				R = m2;
			}
			else {
				L = m1;
			}
		}
		LL Diff = LINF; int midx = 0;
		FOR(k, 1, R - L) {
			int m = L + k;
			LL diff = abs(A.query(Lidx, m) - A.query(m, Ridx));
			if (Diff > diff) {
				Diff = diff;
				midx = m;
			}
		}
		return PLL(A.query(Lidx, midx), A.query(midx, Ridx));
	};
	LL ans = LINF;
	FOR(i, 2, N - 1) {
		PLL ab = f(A, 0, i);//[0,i)
		PLL cd = f(A, i, N);
		LL Mx = max({ ab.first,ab.second,cd.first,cd.second });
		LL Mn = min({ ab.first,ab.second,cd.first,cd.second });
		ans = min(ans, Mx - Mn);
	}


	cout << ans << "\n";

	return 0;
}

Measured memory_bytes: 3328
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <random>
#include <chrono>
#include <tuple>
#include <random>
#include <cmath>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);

const ll SIZE = 1e6 * 2 + 10, INF = 1e9 * 1e9 + 10;



int main()
{
    fastInp;

    string s;
    cin >> s;

    for (auto cur : s) {
        if (cur != '?') {
            cout << cur;
        } else {
            cout << "D";
        }
    }
    return 0;
}

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

long long n,m;
char a[100100],b[100100];
map<long long,char> mp;

main()
{
	scanf("%lld %lld",&n,&m);
	scanf("%s %s",a,b);
	if(a[0]!=b[0])
	{
		printf("-1");
		return 0;
	}
	long long mul=n*m,gg=__gcd(n,m);
	mul/=gg;
	//printf("%lld %lld",mul,gg);
	//*
	for(int i=1;i<n;i++)
	{
		mp[i*(mul/n)+1]=a[i];
	}
	for(int i=1;i<m;i++)
	{
		if(mp[i*(mul/m)+1]!=0&&mp[i*(mul/m)+1]!=b[i])
		{
			printf("-1");
			return 0;
		}
	}
	printf("%lld",mul);
	//*/
}

Measured memory_bytes: 10880
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <bitset>

using namespace std;

int main(){
    string S;
    cin >> S;

    int len = 0;
    int cnt = 0;
    int max_len = 0;
    
    for(int i=0; i<=S.length(); i++){
        if( S[i] == 'A' || 
            S[i] == 'C' ||
            S[i] == 'G' ||
            S[i] == 'T'
        ){
            /* カウント */
            cnt++;
            max_len = max(cnt, max_len);
        }
        else{
            cnt = 0;
        }
    }

    cout << max_len << endl;
}

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

using namespace std;

inline size_t key(int i, int j) {return (size_t) i << 32 | (unsigned int) j;}




main(){


	const long long mod = 1e9 + 7;
	const long long p = 31;
	const long long p2 = 29;

	long long n; cin >> n;

	string s; cin >> s;

	// map < pair <long long, long long>, vector <pair <long long, long long> > > m;


	vector <long long> p_pow(n, 1), p2_pow(n, 1), h(n), h2(n);

	for(long long i = 1; i < n; i++){
		p_pow[i] = (p_pow[i - 1] * p) % mod;
		p2_pow[i] = (p2_pow[i - 1] * p2) % mod;
	}


	h[0] = p_pow[0] * (s[0] - 'a' + 1);
	h[0] %= mod;
	for(long long i = 1; i < n; i++){
		h[i] = h[i - 1] + ((s[i] - 'a' + 1) * p_pow[i]) % mod;
		h[i] %= mod;
	}

	h2[0] = p2_pow[0] * (s[0] - 'a' + 1);
	h2[0] %= mod;
	for(long long i = 1; i < n; i++){
		h2[i] = h2[i - 1] + ((s[i] - 'a' + 1) * p2_pow[i]) % mod;
		h2[i] %= mod;
	}

	// for(long long i = 0; i < n; i++){
	// 	cout << h[i] << " ";
	// }
	// cout << endl;


	for(int len = n / 2; len >= 1; len--){
		unordered_map < size_t, vector <pair <long long, long long> > > m;
		// unordered_map < long long, vector < pair <long long, long long> > >  m;
		int j = len - 1;
		long long hash = (h[j] * p_pow[n - j - 1]) % mod;
		long long hash2 = (h2[j] * p2_pow[n - j - 1]) % mod;
		m[key(hash, hash2)].emplace_back(0, j);
		// m[hash].emplace_back(0, j);


		// cout << s.substr(0, len) << " : " << hash << endl;

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

			hash = (h[j] * p_pow[n - j - 1]) % mod;
			hash -= (h[i - 1] * p_pow[n - j - 1]) % mod;
			hash %= mod;
			hash += mod;
			hash %= mod;

			hash2 = (h2[j] * p2_pow[n - j - 1]) % mod;
			hash2 -= (h2[i - 1] * p2_pow[n - j - 1]) % mod;
			hash2 %= mod;
			hash2 += mod;
			hash2 %= mod;

			hash = (((h[j] - h[i - 1]) % mod + mod) % mod * p_pow[n - j - 1]) % mod;
			hash2 = (((h2[j] - h2[i - 1]) % mod + mod) % mod * p2_pow[n - j - 1]) % mod;

			m[key(hash, hash2)].emplace_back(i, j);
			// m[hash].emplace_back(i, j);

			// cout << s.substr(i, len) << " : " << hash << endl;

		}


		for(auto &it : m){
			if(it.second.front().second < it.second.back().first){
				cout << len << endl; return 0;
			}
		}
	}


	cout << 0 << endl;


	// for(long long i = 0; i < n; i++){
	// 	for(long long j = i; j - i + 1 <= n / 2; j++){
	// 		if(i){
	// 			long long hash = (((h[j] - h[i - 1]) % mod + mod) % mod * p_pow[n - j - 1]) % mod;
	// 			long long hash2 = (((h2[j] - h2[i - 1]) % mod + mod) % mod * p2_pow[n - j - 1]) % mod;
	// 			m[make_pair(hash, hash2)].emplace_back(i, j);
	// 		}else{
	// 			long long hash = (h[j] * p_pow[n - j - 1]) % mod;
	// 			long long hash2 = (h2[j] * p2_pow[n - j - 1]) % mod;
	// 			m[make_pair(hash, hash2)].emplace_back(i, j);
	// 		}
	// 	}
	// }


	// long long record = 0;

	// for(auto &it : m){

	// 	// for(auto jt : it.second){
	// 	// 	cout << jt << " ";
	// 	// }
	// 	// cout << endl;
	
	// 	if(it.second.front().second < it.second.back().first){
	// 		record = max(record, it.second.back().second - it.second.back().first + 1);
	// 	}
	// }


	// cout << record << endl;

	return 0;
}

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

int INF = 10000000;

int H,W;
char field[1010][1010];
int table[1010][1010]; 
int dy[4]{-1,0,1,0};
int dx[4]{0,-1,0,1};
queue<pair<int,int>> Q;
int ans;
bool frag;
int c;

void bfs(){
    while(frag){

        int y = Q.front().first - 1;
        int x = Q.front().second - 1;
        Q.pop();
        if(Q.size() == 0){
            frag = 0;
        }
        if(y == INF - 1 && x == INF - 1){
            ans++;
            Q.push(make_pair(INF,INF));
        }
        /*for(int i = 0;i < H;i++){
            for(int j = 0;j < W;j++){
                if(field[i][j] == '.'){
                    break;
                }
                if(i == H-1 && j == W-1){
                    frag = true;
                }
            }
        }
        if(frag){
            break;
        }*/
       
        for(int i = 0;i < 4;i++){
            int ny = y + dy[i],nx = x + dx[i];
             if(0 <= ny && ny < H && 0 <= nx && nx < W){
                 if(table[ny][nx] == INF){
                     Q.push(make_pair(ny+1,nx+1));
                     field[ny][nx] = '#';
                     table[ny][nx] = 0;
                     c++;
                 }
             }
        } 
    }
    return;
} 

int main(){
   cin >> H >> W;
   ans = 0;
   c = 0;
   frag = 1;
   for(int i = 0;i < H;i++){
       for(int j = 0;j < W;j++){
           cin >> field[i][j];
       }
   }
   for(int i = 0;i < 1010;i++){
       for(int j = 0;j < 1010;j++){
           table[i][j] = INF;
       }
   }
   for(int i = 0;i < H;i++){
       for(int j = 0;j < W;j++){
           if(field[i][j] == '#'){
               Q.push(make_pair(i+1,j+1));
               table[i][j] = 0;
           }
       }
   }
   Q.push(make_pair(INF,INF));
   
   /*cout << Q.front().first << '/' << Q.front().second << endl;*/
   bfs();
   
   cout << ans - 1<< endl;
   /*for(int i = 0;i < H;i++){
       for(int j = 0;j < W;j++){
           cout << table[i][j];
       }
       cout << endl;
   }*/
}


Measured memory_bytes: 13456
#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(){
  int m,max,min,point;

  while(1){
    vector<int> P;

    cin>>m;
    cin>>min;
    cin>>max;

    if(m == 0 && min == 0 && max == 0){
      break;
    }

    for(int i = 0;i < m;++i){
      cin>>point;
      P.push_back(point);
    }

    sort(P.begin(),P.end(),greater<int>());

    int Pmax,Pmin,Gap,n;
    int a = min - 1;

    for(int i = min - 1;i < max;++i){
      Pmax = P.at(i);
      Pmin = P.at(i+1);

      if(i == a){
        Gap = Pmax - Pmin;
        n = i + 1;
      }
      else{
        if(Gap <= Pmax - Pmin){
          Gap = Pmax - Pmin;
          n = i + 1;
        }
      }
    }

    cout<<n<<endl;
  }

  return 0;
}


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

struct Node {int parent,left,right;};

struct Node A[MAX];
int n,B[MAX],C[MAX];

void Depth(int x,int y){
  if(x==NIL)return;
  B[x]=y;
  Depth(A[x].left,y+1);
  Depth(A[x].right,y+1);
}

int Height(int x){
  int a=0,b=0;
  if(A[x].left!=NIL)
    a=Height(A[x].left)+1;
  if(A[x].right!=NIL)
    b=Height(A[x].right)+1;
  return C[x] = (a>b ? a : b);
}

int kansu(int x){
  if(A[x].parent==NIL)return NIL;
  if(A[A[x].parent].left!=x && A[A[x].parent].left != NIL)
    return A[A[x].parent].left;
  if(A[A[x].parent].right!=x && A[A[x].parent].right!= NIL)
     return A[A[x].parent].right;
  return NIL;
}

void print(int x){
  printf("node %d: ",x);
  printf("parent = %d, ",A[x].parent);
  printf("sibling = %d, ",kansu(x));
  int d = 0;
  if(A[x].left != NIL) d++;
  if(A[x].right != NIL) d++;
  printf("degree = %d, ",d);
  printf("depth = %d, ",B[x]);
  printf("height = %d, ",C[x]);

  if(A[x].parent==NIL){
    printf("root\n");
  }else if (A[x].left== NIL && A[x].right ==NIL){
    printf("leaf\n");
  }else{
    printf("internal node\n");
  }
}
int main(){
  int i,v,l,r,root=0;
  scanf("%d",&n);

  for(i=0;i<n;i++)A[i].parent=NIL;

  for(i=0;i<n;i++){
    scanf("%d%d%d",&v,&l,&r);
    A[v].left=l;
    A[v].right=r;
    if(l!=NIL)A[l].parent=v;
    if(r!=NIL)A[r].parent=v;
  }

  for(i=0;i<n;i++)if(A[i].parent==NIL)root=i;

  Depth(root,0);
  Height(root);

  for(i=0;i<n;i++)print(i);

  return 0;
}
    




Measured memory_bytes: 2112
import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
       
 	if(a%2==0){
    		System.out.println(a/2);
    	}else{
     		System.out.println(a/2+1);
   	 }

    	
    }
}



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

using namespace std;

#define MP make_pair
#define PB push_back
typedef long long LL;
typedef pair<int,int> PII;
const double eps=1e-8;
const double pi=acos(-1.0);
const int K=1e6+7;
const int mod=1e9+7;

char sa[20],sb[20],sc[20];
int main(void)
{
    cin>>sa>>sb>>sc;
    int la,lb,ans=1;
    la=strlen(sa);
    lb=strlen(sb);
    if(sa[la-1]!=sb[0])
        ans=0;
    if(sb[lb-1]!=sc[0])
        ans=0;
    if(ans)
        cout<<"YES";
    else
    cout<<"NO";
    cout<<endl;
    return 0;
}


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

//コピペここから

namespace MMNMM {

// extended Euclidean Algorithm
// ax + by = gcd(a, b)
// return : gcd(a, b)
    template<typename Integer = int_fast64_t>
    constexpr Integer extgcd(Integer a, Integer b, Integer &x, Integer &y) {
        Integer u = 0, v = 1, q = 0, tmp = 0;
        x = v = 1;
        y = u = 0;

        while (b) {
            q = a / b;
            x ^= u ^= x ^= u;
            u = u - q * x;
            y ^= v ^= y ^= v;
            v = v - q * y;
            a ^= b ^= a ^= b;
            b = b - q * a;
        }

        return a;
    }

// mod inverse(設計が変わるかもしれません)
// return : val^(-1) mod MOD
    template<uint_fast64_t MOD, typename Integer = int_fast64_t>
    constexpr Integer modinv(Integer val) {
        int_fast64_t ret = 0, tmp = 0;

        extgcd<int_fast64_t>(static_cast<int_fast64_t>(val), static_cast<int_fast64_t>(MOD), ret, tmp);

        return static_cast<Integer>(ret > 0 ? ret % MOD : (MOD - (-ret % MOD)));
    }

// const expression factorial mod MOD
    template<std::size_t N, std::uint_fast64_t MOD>
    struct Fact {
        std::uint_fast64_t val[N + 1];

        constexpr Fact() : val() {
            val[0] = 1;
            for (std::size_t i = 1; i <= N; ++i) val[i] = val[i - 1] * i % MOD;
        }
    };

// const expression factorial inverse mod MOD
    template<std::size_t N, std::uint_fast64_t MOD, std::uint_fast64_t F>
    struct IFact {
        std::uint_fast64_t val[N + 1];

        constexpr IFact() : val() {
            val[N] = F;
            for (std::size_t i = N; i; --i) val[i - 1] = val[i] * i % MOD;
        }
    };
}

constexpr std::uint_fast64_t MOD = 998244353, maxN = 2675000;

constexpr auto fact = MMNMM::Fact<maxN, MOD>();
constexpr auto ifact = MMNMM::IFact<maxN, MOD, MMNMM::modinv<MOD>(fact.val[maxN])>();

// const expression binomial mod MOD
inline constexpr std::uint_fast64_t binommod(std::uint_fast64_t n, std::uint_fast64_t r){
    if(r < 0 || r > n)return 0;
    return fact.val[n] * (ifact.val[r] * ifact.val[n - r] % MOD) % MOD;
}

inline constexpr std::uint_fast64_t C(std::uint_fast64_t n, std::uint_fast64_t r){
    return binommod(n, r);
}

//コピペここまで(ある部分を使うためにはそれより上を全てコピーしてください)

//verified : AtCoder Grand Contest 025 B - RGB Coloring

long long int N, M, A, B, K, ans;

int main(){
    using namespace std;
    scanf("%lld%lld%lld%lld", &N, &A, &B, &K);
    M = min(N, K / A);
    for(int i = 0; i <= M; ++i){
        if((K - i * A) % B == 0){
            ans += C(N, i) * C(N, (K - i * A) / B);
            ans %= MOD;
        }
    }
    cout << ans << endl;
    return 0;
}


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

map<string, bool>mp;
int cnt = 0;

int main (){
	int n;
	cin >> n;
	for (int i = 0 ; i < n ; i++) {
		string x;
		cin >> x;
		if (!mp[x]) {
			cnt++;
			mp[x] = true;
		}
	}
	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 19116
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define debug(x) cerr << #x << ": " << x << endl;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

int main() {
    ll H, W;
    cin >> H >> W;
    vector<vector<char>> c(H, vector<char>(W));
    ll cntw = 0;
    rep(i, H) rep(j, W) {
        cin >> c[i][j];
        if(c[i][j] == '.') cntw++;
    }

    vector<vector<ll>> dist(H, vector<ll>(W, -1));
    dist[0][0] = 0;
    queue<pair<ll, ll>> que;
    que.emplace(0, 0);
    ll dx[4] = {0, 0, 1, -1}, dy[4] = {1, -1, 0, 0};
    while(!que.empty()) {
        ll y = que.front().first, x = que.front().second;
        que.pop();
        rep(i, 4) {
            ll nx = x + dx[i], ny = y + dy[i];
            if(nx < 0 || W <= nx || ny < 0 || H <= ny || dist[ny][nx] != -1 || c[ny][nx] == '#') continue;
            dist[ny][nx] = dist[y][x] + 1;
            que.emplace(ny, nx);
        }
    }
    if(dist[H-1][W-1] == -1) cout << -1 << endl;
    else cout << cntw - dist[H-1][W-1] - 1 << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<double, long long> pdl;

const long double pi = 3.141592653589793;

#define debug(x) cerr << #x << " = " << (x) << endl;
#define rep(i, n) for(int i = 0;i < n;i++)
#define pb push_back
#define mp make_pair
#define mod 1000000007

ll gcd(ll x, ll y) {
    if(y == 0)
        return x;
    else
        return gcd(y, x % y);
}

int main() {

    //freopen("input07.txt","r",stdin);
    //freopen("output_file_name.txt","w",stdout);
    int n;cin>>n;
    ll even = 0, odd = 0;
    ll A[n];
    rep(i, n) {cin>>A[i];if(A[i]%2==0) even++;else odd++;}
    if(n == 1) {
        cout<<"Second"<<endl;
        return 0;
    }

    if(even%2 != 0) {
        cout<<"First"<<endl;
        return 0;
    }

    if(odd >= 2) {
        cout<<"Second"<<endl;
        return 0;
    }

    int f = 1;
    while(true) {
        bool found = false;
        rep(i, n) {if(A[i]%2 != 0 and A[i] > 1) {found = true;A[i]-=1;break;}}
        if(not found) {
            ll sum = 0;
            rep(i, n) sum += A[i];
            sum -= n;
            if(sum%2 == 0) {
                if(f) cout<<"Second"<<endl;
                else cout<<"First"<<endl;
                return 0;
            } else {
                if(!f) cout<<"Second"<<endl;
                else cout<<"First"<<endl;
                return 0;
            }
        }
        ll cgcd = 0;
        rep(i, n) cgcd = gcd(cgcd, A[i]);
        even = odd = 0;
        rep(i, n) {A[i]/=cgcd;if(A[i]%2==0) even++;else odd++;}
        f = 1^f;

        if(even%2 != 0) {
            if(f)
                cout<<"First"<<endl;
            else
                cout<<"Second"<<endl;
            return 0;
        }

        if(odd >= 2) {
            if(f)
                cout<<"Second"<<endl;
            else
                cout<<"First"<<endl;
            return 0;
        }
    }

    return 0;
}


Measured memory_bytes: 1152
# ALDS1_8_A Binary Search Tree 1
import sys


class Node:
    def __init__(self, x):
        self.parent = None
        self.left = None
        self.right = None
        self.key = x


class Tree:
    def __init__(self):
        self.root = None

    def insert(self, x):
        new = Node(x)
        x_parent = self.root
        next = self.root

        while next is not None:
            x_parent = next
            if x < x_parent.key:
                next = x_parent.left
            else:
                next = x_parent.right

        if x_parent is None:
            self.root = new
        elif x < x_parent.key:
            new.parent = x_parent
            x_parent.left = new
        else:
            new.parent = x_parent
            x_parent.right = new
        return

    def preorder(self, node):
        print(' {}'.format(node.key), end='')

        if node.left:
            self.preorder(node.left)
        if node.right:
            self.preorder(node.right)
        return

    def inorder(self, node):
        if node.left:
            self.inorder(node.left)

        print(' {}'.format(node.key), end='')

        if node.right:
            self.inorder(node.right)


m = int(input())
tree = Tree()

for i in range(m):
    command = list(sys.stdin.readline().strip().split())
    if command[0] == 'print':
        tree.inorder(tree.root)
        print()
        tree.preorder(tree.root)
        print()
    else:
        num = command[1]
        command = command[0]
        num = int(num)
        tree.insert(num)




Measured memory_bytes: 105172
#include <bits/stdc++.h>
using namespace std;
#define FOR(I,X,Y) for(long long (I)=(X);(I)<(Y);(I)++)
#define REP(I,X,Y) for(long long (I)=(Y)-1;(I)>=(X);(I)--)
#define ALL(X) (X).begin(),(X).end()
#define pb push_back
#define COUNT(V,X) upper_bound((V).begin(),(V).end(),X)-lower_bound((V).begin(),(V).end(),X)
#define debug(x) cerr<<#x<<':'<<x<<endl;
#define DEBUG(v) cerr<<#v<<':';for(auto x:v)cerr<<x<<' ';cerr<<endl;
#define INF 1000000007
#define LINF 1000000000000000007
#define EPS 1e-9
typedef long long ll;

long long TwelvefoldWay1(long long n,long long k,long long MOD){
  long long ans = 1;
  while(n){
    if(n%2)ans *= k;
    k *= k;
    k %= MOD;
    ans %= MOD;
    n >>= 1;
  }
  return ans;
}

signed main(){
  ll n,k;
  cin >> n >> k;
  cout << TwelvefoldWay1(n,k,INF) << endl;
}


Measured memory_bytes: 3096
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e3+5,mod=1e9+7;
int n,k,a[N];
ll f[N],invf[N];
ll dp[30][N];
ll C(ll n,ll m)
{
    return f[n]*invf[n-m]%mod*invf[m]%mod;
}
int main()
{
    f[0]=1,invf[0]=invf[1]=1;
    for(int i=1;i<N;i++) f[i]=f[i-1]*i%mod;
    for(int i=2;i<N;i++) invf[i]=(mod-mod/i)*invf[mod%i]%mod;
    for(int i=2;i<N;i++) invf[i]=invf[i]*invf[i-1]%mod;
    scanf("%d%d",&n,&k);
    for(int i=1;i<=k;i++) scanf("%d",&a[i]);
    dp[0][0]=1;
    for(int i=1;i<=k;i++)
        for(int j=0;j<=n;j++)
    {
        for(int k=0;k<=min(j,a[i]);k++)
            dp[i][j]=(dp[i][j]+dp[i-1][j-k]*C(n-j+k,k)%mod*C(n-k,a[i]-k)%mod)%mod;
    }
    printf("%lld\n",dp[k][n]);
}


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

typedef vector<int> vi;
typedef pair<int, int> pi;

const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;

#define pb push_back
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP2(i, b, e) for (int i = (b); i <= (int)(e); i++)
#define DEBUG(x) cout << #x << ": " << (x) << endl
#define DEBUGA(a) cout << #a << ": "; for (const auto& v: (a)) cout << v << endl

signed main() {
    string S;
    cin >> S;

    REP(i, S.size()) {
        if (i % 2 == 0 && S[i] == 'L') {
            cout << "No" << endl;
            return 0;
        } else if (i % 2 == 1 && S[i] == 'R') {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


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

int n;
int y,m,d;
int dd[11]={0,20,19,20,19,20,19,20,19,20,19};

int main(void){
	cin >> n;
	for(int i=0;i<n;i++){
		int ans=0;
		cin >> y >> m >> d;
		while(y!=1000 || m!=1 || d!=1){
			if(y!=999){
				if(y%3==0){
					while(m!=11 || d!=1){
						if(21==d)m++,d=1;
						if(m==11 && d==1)break;
						d++,ans++;
					}
					m=1;
					y++;
				}else{
					while(m!=11 || d!=1){
						if(dd[m]==d-1)m++,d=1;
						if(m==11 && d==1)break;
						d++,ans++;
					}
					m=1;
					y++;
				}
			}else{
				while(m!=11 || d!=1){
						if(21==d)m++,d=1;
						if(m==11 && d==1)break;
						else d++,ans++;
					}
				y=1000,m=1,d=1;
			}
		}
		cout << ans << endl;
	}
    return 0;
}

Measured memory_bytes: 1160
A=[int(x) for x in list(input())]
B=list(reversed(A))
N=len(A)

if N ==0:
  out=0
else:
  out_1=0
  for i in range(1,N):
    if A[i-1] == A[i] :
      A[i] = 1 - A[i] 
      out_1+=1

  out_2=0
  for i in range(1,N):
    if B[i-1] == B[i] :
      B[i] = 1 - B[i] 
      out_2+=1
      
  out=min(out_1,out_2)
print(out)

Measured memory_bytes: 4652
#include <bits/stdc++.h> 
using namespace std; 
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
const long long int m=pow(10,9)+7;

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    int a[n];
	for(int i=0;i<n;i++)
	    cin>>a[i];
	vector<ll>v;
	reverse(a,a+n);
	for(int i=0;i<n;i+=2)
	    v.push_back(a[i]);
    reverse(a,a+n);
    int k;
    if(n%2==0)
        k=0;
    else
        k=1;
	for(int i=k;i<n;i+=2)
	    v.push_back(a[i]);
	for(int i=0;i<n;i++)
	    cout<<v[i]<<" ";
	cout<<endl;
    return 0;
}


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

int main(){
	int n;
	string s[101];
	cin >> n;
	bool flag = true;
	for(int i=1;i<=n;i++) {
		cin >> s[i];
		if(i>1 && s[i][0]!=s[i-1][s[i-1].size()-1]){
			flag = false;	
		}
		for(int j=1;j<i;j++){
			if(s[j]==s[i]){
				flag = false;
			}
		}
	}
	cout << (flag?"Yes":"No") << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

int main() {
	int x, a, b;

	std::cin >> x >> a >> b;
	a = std::abs(a - x);
    b = std::abs(b - x);
	if (a < b) {
		std::cout << "A" << std::endl;
	} else {
		std::cout << "B" << std::endl;
	}
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <stdio.h>
#include <math.h>


using namespace std;

typedef long long ll;

typedef vector<vector<int>> vvi;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<ll> vll;

typedef pair<int, int> P;

typedef queue<int> qi;
typedef queue<string> qs;


#define rep(i, n) for(int i=0; i<(n); ++i)
#define repp(i, a, b) for(int i = (a); i <= (b); i++)
#define Rep(i, n) for(int i=n; i >= 0; i--)

#define all(v) v.begin(), v.end()
//sort( all(v) )　などと使える

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

	vi fib(60, 1);
	rep(i, 50) fib[i + 2] = fib[i + 1] + fib[i];

	cout << fib[n] << endl;
}



Measured memory_bytes: 3132