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


/*
　　　　　　 ＿＿
　　　　　／＞　　 フ
　　　　　|   _　 _l
　 　　　／` ミ＿x ノ   Zzz...
　　 　 /　 　　  |   コード見ちゃだめ！！
　　　 /　 ヽ　　 ﾉ
　 　 │　　|　|　|
　／￣|　　 |　|　 |
　| (￣ヽ＿_ヽ_)__)
　＼二つ
*/



int main(){
    int x;
    cin>>x;
    int y=x/100;
    int z=x-y*100;
    if(z<=5*y) cout<<1<<endl;
    else cout<<0<<endl;
    

}

Measured memory_bytes: 256
#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
const int INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
const ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
ll n, cnt, ans, a, b, c, d, tmp, m, h, w, x, y, sum, k, q;

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

  cin >> a >> b >> c >> d;
  if (a < c)
    Cout(1);
  else
    Cout(0);
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
    int n, minj, esc, count=0;
    cin >> n;
    int a[n];
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    
    for(int i=0;i<n;i++){
        minj = i;
        for(int j=i;j<n;j++){
            if(a[j] < a[minj]){
                minj = j;
            }
        }
        esc = a[i];
        a[i] = a[minj];
        a[minj] = esc;
        if(i != minj){
            count++;
        }
    }
    
    for(int i=0;i<n;i++){
        cout << a[i];
        if(i != n-1){
            cout << " ";
        }
    }
    
    cout << endl << count << endl;
    
    
    return 0;
}


Measured memory_bytes: 3096
#include<bits/stdc++.h>
using namespace std;
 
int main(){
int a,b,c;
  cin >> a >> b;
  if(a > b){
  c = a+a-1;
  }else if(a < b){
  c = b+b-1;
  }else{
  c = 2*a;
  }
  cout << c << endl;
}

Measured memory_bytes: 256
s = input().split()
numOfA = int(s[0])
numOfB = int(s[1])
numOfC = int(s[2])
pickNum = int(s[3])
maxOutcome = 0

if pickNum < numOfA:
    maxOutcome = pickNum
elif pickNum >= numOfA and pickNum <= (numOfA + numOfB):
    maxOutcome = numOfA
elif pickNum >numOfA +numOfB:
    maxOutcome = numOfA - (pickNum - numOfA - numOfB)

print(maxOutcome)

Measured memory_bytes: 9128
#include<stdio.h>

int main(){
	
	int i,j,p,c;
	int w,h;
	int wf,bf;
	int pw,ph;
	
	while(1){
		scanf("%d%d",&w,&h);
		if(w==0&&h==0) break;
		c = 1;
		wf = 0;
		bf = 0;
		int a[52][52]={};
		for(i=0;i<(w+2)*(h+2);i++){
			a[i/(w+2)][i%(w+2)] = 1;
		}
		char in[w];
		for(i=0;i<h;i++){
			scanf("%s",in);
			for(j=0;j<w;j++){
				if(in[j]=='W'){
					a[i+1][j+1] = 4;
					wf++;
				}else if(in[j]=='B'){
					a[i+1][j+1] = 9;
					bf++;
				}
			}
		}
		while(c!=0){
			c = 0;
			for(p=0;p<w*h;p++){
				pw = p%w+1;
				ph = p/w+1;
				if(a[ph][pw]==0||a[ph][pw]==4||a[ph][pw]==9){
					continue;
				}
				int x = a[ph-1][pw]*a[ph+1][pw]*a[ph][pw-1]*a[ph][pw+1];
				if(x==0){
					a[ph][pw] = 0;
					c++;
					continue;
				}
				int f1 = x%2;
				int f2 = x%3;
				if(a[ph][pw]==1){
					if(f1==0&&f2==0){
						a[ph][pw] = 0;
						c++;
						continue;
					}else if(f1!=0&&f2!=0){
						continue;
					}else if(f1==0){
						a[ph][pw] = 2;
						c++;
						continue;
					}else{
						a[ph][pw] = 3;
						c++;
						continue;
					}
				}
				if(a[ph][pw]==2){
					if(f2==0){
						a[ph][pw] = 0;
						c++;
						continue;
					}
				}
				if(a[ph][pw]==3){
					if(f1==0){
						a[ph][pw] = 0;
						c++;
						continue;
					}
				}
			}
		}
		int wc=0,bc=0;
		for(i=0;i<w*h;i++){
			if(a[i/w+1][i%w+1]==2){
				wc++;
			}
			if(a[i/w+1][i%w+1]==3){
				bc++;
			}
		}
		printf("%d %d\n",bc,wc);
	}
	return 0;
}

Measured memory_bytes: 620
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define all(x) (x).begin(),(x).end()

using ll = long long;

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

	cin >> a >> b >> c;

	if (a + b + c >= 22)
	{
		cout << "bust" << endl;
	}
	else
	{
		cout << "win" << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main()
{
  int a;
  scanf("%d",&a);
  int i,j,k = 0;
  k = a;
  j = a;
  while (i < k-1)
  {
    a += j-1;
    i++;
    j--;
  }
  printf("%d",a);
}

Measured memory_bytes: 256
def fun(L,R):
    if R-L>=2019:
        return 0
    else:
        ll = L%2019
        rr = R%2019
        if ll>R:
            return 0
        else:
            r = 2018
            for i in range(L,R+1):
                for j in range(i+1,R+1):
                    r=min(r,i*j%2019)
            return r
        


L,R = [ int(i) for i in input().split(" ")]
print(fun(L,R))  

Measured memory_bytes: 38896
l = input().split()
n = int(l[0])

l = input().split()
A = [int(x) for x in l]

# print(N, A)

A.sort()
P = []
N = []
for a in A:
    if a >= 0:
        P.append(a)
    else:
        N.append(a)

def print_ans(ans, pairs):
    print(ans)
    for p in pairs:
        print(p[0], p[1])

def solve_p(A):
    ans = A[0]
    pairs = []
    for i in range(1, n - 1):
        pairs.append((ans, A[i]))
        ans -= A[i]

    pairs.append((A[n - 1], ans))
    ans = A[n - 1] - ans
    print_ans(ans, pairs)

def solve_n(A):
    A.sort(key=lambda x: -x)
    ans = A[0]
    pairs = []
    for i in range(1, n - 1):
        pairs.append((ans, A[i]))
        ans -= A[i]

    pairs.append((ans, A[n - 1]))
    ans -= A[-1]
    print_ans(ans, pairs)

# #P == 1
def solve1(P, N):
    ans = P[0]
    pairs = []
    for n in N:
        pairs.append((ans, n))
        ans -= n
    print_ans(ans, pairs)

# #N == 1 #P > 1
def solve2(P, N):
    ans = N[0]
    pairs = []
    for i in range(len(P) - 1):
        pairs.append((ans, P[i]))
        ans -= P[i]
    pairs.append((P[-1], ans))
    ans = P[-1] - ans
    print_ans(ans, pairs)

# #P > #N
def solve3(P, N):
    num_p = len(P)
    num_n = len(N)
    ans = P[0]
    pairs = []
    for i in range(num_n - 1):
        pairs.append((ans, N[i]))
        ans -= N[i]
    pairs.append((N[-1], ans))
    ans = N[-1] - ans
    for i in range(1, num_p - 1):
        pairs.append((ans, P[i]))
        ans -= P[i]
    pairs.append((P[-1], ans))
    ans = P[-1] - ans
    print_ans(ans, pairs)

num_p = len(P)
num_n = len(N)
if num_p == 0:
    solve_n(A)
elif num_n == 0:
    solve_p(A)
elif num_p == 1:
    solve1(P, N)
elif num_n == 1:
    solve2(P, N)
else:
    solve3(P, N)


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
//const ull mod = 1e9 + 7;
const ll mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

// debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

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

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

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

    ll A, B;
    cin >> A >> B;
    ll res = 0;
    for(ll x=A;x<=B;x++){
    	ll y = x; 
    	vector<ll> d;
    	REP(i, 5){
    		d.push_back(y%10);
    		y /= 10;
    	}
    	if(d[0] == d[4] && d[1] == d[3]) res++;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
import math

D, G = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(D)]

ret = 1000 ** 10
for i in range(2 ** D):
    total = 0
    cnt = 0
    for p in range(D):
        if (i >> p) & 1:
            cnt += lst[p][0]
            total += lst[p][0] * (p + 1) * 100 + lst[p][1]

    for p in range(D)[::-1]:
        delta = G - total
        if delta <= 0:
            break
        if not ((i >> p) & 1):
            n = min(math.ceil(delta / ((p + 1) * 100)), lst[p][0])
            cnt += n
            total += n * (p + 1) * 100
    ret = min(ret, cnt)
print(ret)


Measured memory_bytes: 3064
#include <stdio.h>
int main(void){
 char c[20];
 scanf("%s",c);
 int i;
 for(i=0;i<5;i++) printf("%c",c[i]);
 printf(" ");
 for(i=6;i<13;i++) printf("%c",c[i]);
 printf(" ");
 for(i=14;i<19;i++) printf("%c",c[i]);

 return 0;
}

Measured memory_bytes: 128
n = int(input())
a = {}
for _ in range(n):
    x,y = input().split()
    y = int(y)
    if x in a:
        a[x] += y
    else:
        a[x] = y
a_s = sorted(a.items(), key=lambda p:(len(p[0]), p[0]))
for i in a_s:
    print(i[0], i[1])



Measured memory_bytes: 5624
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int INF=1001001001;
 
long long int answ(long long int x){
  if(x==1) return 1;
  if(x>1) return 2*answ(x/2)+1;
}

int main() {
  int r;
  cin>>r;
  cout<<r*r<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<cmath>

using namespace std;

int N;

int main() {
	cin >> N;
	vector<int> a(N);
	for (int i = 0; i < N; i++) { cin >> a[i]; }

	vector<int> ans;
	for (int i = N; i >= 1; i--) {
		int sum = 0;
		for (int j = i; j <= N; j += i) {
			sum += a[j - 1];
		}
		if (sum % 2) {
			ans.push_back(i);
		}
		a[i - 1] = sum % 2;
	}
	cout << ans.size() << endl;
	for (int i = 0; i < ans.size(); i++) {
		cout << ans[i] << " ";
	}
}

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

using namespace std;
using ll = long long;

int main() {
    ll N, M;
    cin >> N >> M;
    vector<pair<ll, ll> > s(N);
    vector<pair<ll, ll> > c(M);
    for(ll i = 0; i < N; i++) {
        cin >> s.at(i).first >> s.at(i).second;
    }

    for(ll i = 0; i < M; i++) {
        cin >> c.at(i).first >> c.at(i).second;
    }

    for(ll i = 0; i < N; i++) {
        ll ans = 0;
        ll d = 1e10;
        for(ll j = 0; j < M; j++) {
            if(abs(s.at(i).first - c.at(j).first) + abs(s.at(i).second - c.at(j).second) < d) {
                d = abs(s.at(i).first - c.at(j).first) + abs(s.at(i).second - c.at(j).second);
                ans = j;
            }
        }
        cout << ans + 1 << endl;
    }

    return 0;
}

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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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

const ll INF = 1e9+10;
const ll MOD = 1e9+7;
const ll LINF = 1e18;

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

const ll maxf = 10000000;
ll fact[maxf+5];
ll ifact[maxf+5];

void fact_init(){
  fact[0] = 1;
  for(ll i=1; i<=maxf; i++) fact[i] = (fact[i-1] * i) % MOD;
  ifact[maxf]=modpow(fact[maxf],MOD-2);
  for(ll i=maxf; i>=1; i--) ifact[i-1] = (ifact[i] * i) % MOD;
}

ll comb(ll n, ll r){
  if(n<r || n<0 || r<0) return 0;
  if(fact[0] == 0) fact_init();
  return ((fact[n] * ifact[n-r]) % MOD * ifact[r]) % MOD;
}

ll naive_comb(ll n, ll r){
  ll res = 1;
  for (ll i = n; i > n - r; i--) res = res * i % MOD;
  for (ll i = 1; i <= r; i++) res = (res * modpow(i, MOD-2)) % MOD;
  return res;
}

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll n; cin>>n;
  vll c(n);
  rep(i,n) cin>>c[i];
  vsort(c);
  vll two(n+1);
  two[0]=1;
  rep(i,n) two[i+1]=(two[i]*2)%MOD;
  
  ll ans=0;
  rep(i,n){
    ll l=i, r=n-1-i;
    ll now=two[r];
    if(r>0) (now+=two[r-1]*r%MOD)%=MOD;
    (now*=two[l])%=MOD;
    (now*=c[i])%=MOD;
    (ans+=now)%=MOD;
  }
  (ans*=two[n])%=MOD;
  cout<<ans<<endl;
}

Measured memory_bytes: 6364
// #include {{{
#include <iostream>
#include <cassert>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <string>
#include <bitset>
#include <vector>
#include <complex>
#include <algorithm>
using namespace std;
// }}}
// #define {{{
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
// }}}

int main(){
    int n;
    cin >> n;
    rep(i,1,3501) rep(j,1,3501){
        ll down = ll(n) * i * j;
        ll up = 4ll * i * j - 1ll * n * j - 1ll * n * i;
        if(up < 0) continue;
        if(up && down % up == 0) {
            ll k = down / up;
            cout << i << " " << j << " " << k << endl;
            return 0;
        }
    }
    return 0;
}


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

using namespace std;

void get(long long x, map <long long, int> &m) {
  for (long long i = 2; i * i <= x; ++i) {
    if (x % i == 0) {
      m[i] = 1;
      while (x % i == 0) {
        x /= i;
      }
    }
  }
  if (x > 1) {
    m[x] = 1;
  }
  return;
}

map <long long, int> m[2];

int main() {
  long long A, B;
  cin >> A >> B;
  get(A, m[0]);
  get(B, m[1]);
  int ans = 0;
  for (map<long long, int>::iterator it = m[0].begin(); it != m[0].end(); ++it) {
    if (m[1][(*it).first]) {
      ++ans;
    }
  }
  cout << ans + 1 << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#define int long long
using namespace std;
const int mod = 1e9+7LL;

signed main() {
  int N; cin >> N;
  int dp[64][4]={};
  dp[0][0] = 1LL;
  for(int i = 0; i < 61; ++i) {
    for(int j = 0; j < 3; ++j) {
      for(int x = 0; x < 2; ++x) {
        for(int y = x; y < 2; ++y) {
          int b = (N >> i) & 1;
          dp[i+1][(x+y+j+1-b)/2] = (dp[i+1][(x+y+j+1-b)/2] + dp[i][j]) % mod;
        }
      }
    }
  }
  cout << dp[61][0] << endl;
  return 0;
}


Measured memory_bytes: 256
count = gets.chomp.to_i
time = gets. chomp.split(" ").map(&:to_i)
type = gets.chomp.to_i

list = []
(1..type).each do |i|
    line = gets.chomp.split(" ").map(&:to_i)
    num = line[0]-1
    newtime = time.clone
    newtime[num] = line[1]
    list << newtime
end

listnew = []
(0..type-1).each do |i|
    listnew << list[i].inject(:+)
end
puts listnew

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


Measured memory_bytes: 2108
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

n,k=MAP()
#d=INT()
a=[0 for i in range(n)]
for i in range(k):
    b=INT()
    b=LIST()
    for l in b:
        a[l-1]+=1
ans=0
for i in a:
    if i==0:
        ans+=1
print(ans)        

Measured memory_bytes: 9200
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using static System.Console;
using Pair = System.Collections.Generic.KeyValuePair<int, int>;
//using System.Numerics;
//using static System.Math;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 };
    readonly int mod = 1000000007;
    readonly string alfa = "abcdefghijklmnopqrstuvwxyz";
    readonly string ALFA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

    int N;
    //int H, W;
    void solve()
    {
        //H = cin.nextint;
        //W = cin.nextint;
        //var A = new int[26];
        //for (int i = 0; i < H; i++)
        //{
        //    var S = cin.next;
        //    for (int j = 0; j < W; j++)
        //    {
        //        int k = S[j] - 'a';
        //        A[k]++;
        //    }
        //}
        N = cin.nextint;
        int M = cin.nextint;
        int K = cin.nextint;
        bool flag = false;
        for (int i = 0; i <= N; i++)
        {
            for (int j = 0; j <= M; j++)
            {
                int B = i * M + j * N - 2 * i * j;
                if (B == K)
                {
                    flag = true;
                }
            }
        }
        WriteLine(flag ? "Yes" : "No");

    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define PI (acos(-1))
#define ct cout<<
#define cn cin>>
#define spc <<" "<<
#define nl puts("")
#define _fl(x) puts("FLAG " #x);
#define  _(x)  cout<< #x <<" is "<< x <<endl;
#define fs first
#define sc second
#define pb push_back
#define all(v)  (v).begin(), (v).end()
#define _109 (1000000000)
#define _0(arr) memset(arr,0,sizeof ( arr ) )
#define _1(arr) memset(arr,-1,sizeof ( arr ) )
#define _ninp(n,arr) for(int i=0; i<n;i++)cin>>arr[i];
#define _nout(n,arr) for(int i=0; i<n;i++)cout<<arr[i]<<" \n"[i==n-1];
double _eps=1e-6;
long long gcd(long long a, long long b) {
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

int main() {

    int m1,d1,mm;
    cn m1>>d1>>mm>>mm;

    int arr[]={31,28,31,30,31,30,31,31,30,31,30,31};

    m1--;
    ct (arr[m1]==d1);nl;








    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main {
public static void main (String[] args){
Scanner sc = new Scanner(System.in);
int W = sc.nextInt();
int H = sc.nextInt();
int x = sc.nextInt();
int y = sc.nextInt();
int r = sc.nextInt();
int errorflg = 0;
if (x >= -100 && x <= 100){
if (y >= -100 && y <= 100){
if (W >= 0 && W <= 100){
if (H >= 0 && H <= 100){
if (r >= 0 && r <= 100){
if ((x - r < 0) || (x + r > W)){
errorflg = 1;
} 
if ((y - r < 0) || (y + r > H)){
errorflg = 1;
}
if (errorflg == 1){
System.out.println("No");
} else {
System.out.println("Yes");
}
}
}
}
}
}
}
}



Measured memory_bytes: 26276
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

//        String a = "kyoto";
//        String b = "tokyo";

        Scanner cin = new Scanner(System.in);
        String a = cin.nextLine();
        String b = cin.nextLine();
        int len = a.length();
        for (int i=0;i<len;i++){
            if (a.charAt(0)==b.charAt(i)){
                String tempB = b.substring(i, len) + b.substring(0, i);
                //System.out.println(tempB);
                if (tempB.equals(a)) {
                    System.out.println("Yes");
                    return;
                }
            }

        }
        System.out.println("No");
        return;

    }

}

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

#define FOR(a, b, c) for (int a = (b), _for = (c); a < _for; ++a)
#define REP(a, n) FOR(a, 0, n)
#define x first
#define y second
#define pb push_back
#define pii pair<int, int>
#define ll long long
#define lf double

using namespace std;

const int MAX = (int)1e6 + 5;

char a[MAX];
char b[MAX];

int main(){
	scanf ("%*d");
	scanf ("%s",a);
	scanf ("%s",b);
	int n=strlen(a);
	REP(i,n){
		printf ("%c",a[i]);
		printf ("%c",b[i]);
	}
	
	
	return 0;
}


Measured memory_bytes: 256
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000
#define rep(i,a) for(int i=0;i<(a);i++)

using namespace std;
typedef long long ll;

double solve(double n){
    return 9.8*sqrt((5*n-5)/4.9);
}

int main(){
    while(true){
        double n;
        if(!(cin>>n))break;
        for(int i=1;i<INF;i++){
//        cout<<solve(i)<<endl;
            if(solve(i)>=n){
                cout<<i<<endl;
                break;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 1224
#include<bits/stdc++.h>
using namespace std;
int main(){
  set<char> alpha;
  for(int i = 0; i < 26; i++){
    alpha.insert('a' + i);
  }
  string s; cin >> s;
  for(int i = 0; i < s.size(); i++){
    char moji = s.at(i);
    alpha.erase(moji);
  }
  if(alpha.empty())
    cout << "None" << endl;
  else
  	cout << *begin(alpha) << endl;
}

Measured memory_bytes: 3740
#include <stdio.h>
int main()
{
  int a, b, d, r;
  double f;
  scanf("%d %d", &a, &b);
  d = a / b;
  r = a % b;
  f = (double)a / b;
  printf("%d %d %7.5f\n", d, r, f);

  return 0;
}

Measured memory_bytes: 636
#include<iostream>
using namespace std;
int N;
int A[10][10],B[10][10],T[10][10];
main()
{
	cin>>N;
	for(;N--;)
	{
		for(int i=0;i<10;i++)for(int j=0;j<10;j++)cin>>A[i][j];
		for(int i=0;i<1<<10;i++)
		{
			for(int j=0;j<10;j++)for(int k=0;k<10;k++)T[j][k]=A[j][k],B[j][k]=0;
			for(int j=0;j<10;j++)
			{
				if(i>>j&1)
				{
					B[0][j]=1;
					T[0][j]^=1;
					T[1][j]^=1;
					if(j>0)T[0][j-1]^=1;
					if(j<9)T[0][j+1]^=1;
				}
			}
			for(int j=1;j<10;j++)
			{
				for(int k=0;k<10;k++)
				{
					if(T[j-1][k])
					{
						B[j][k]=1;
						T[j-1][k]^=1;
						T[j][k]^=1;
						if(k>0)T[j][k-1]^=1;
						if(k<9)T[j][k+1]^=1;
						if(j<9)T[j+1][k]^=1;
					}
				}
			}
			bool flag=true;
			for(int j=0;j<10;j++)if(T[9][j])flag=false;
			if(flag)
			{
				for(int j=0;j<10;j++)
				{
					for(int k=0;k<10;k++)cout<<B[j][k]<<(k==9?"\n":" ");
				}
				break;
			}
		}
	}
}



Measured memory_bytes: 3080
#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;

int main(){
    int n;
    cin >> n;
    long long int pow = 1;
    for(int i=1; i<=n; i++){
        pow = pow * i % MOD;
    }
    cout << pow << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    int W, H, x, y;
    scanf("%d%d%d%d", &W, &H, &x, &y);
    double s = W/2.0*H;
    int flag = 0;
    if(x == W/2.0 && y == H/2.0) flag = 1;
    printf("%f %d\n", s, flag);
    return 0; 
}

Measured memory_bytes: 128
#define rep(i,n) REP(i,0,n)
#define REP(i, a, b) for(int i = a; i < (int)(b); i++)
#include <bits/stdc++.h>

typedef long long ll;
using namespace std;
template<class T> inline void chmax(T &a, const T &b) {if(a < b) a = b;}
template<class T> inline void chmin(T &a, const T &b) {if(a > b) a = b;}

const ll MAXN = (ll)1e5+10;
const long long INF = 1LL<<60;
ll dp[110][MAXN];
ll w[110];
ll v[110];

ll GetDP(ll i,ll weight) {
   if (dp[i][weight] >= 0) return dp[i][weight];
   chmax(dp[i][weight],GetDP(i-1,weight));
   if (weight >= w[i-1]) chmax(dp[i][weight],GetDP(i-1,weight-w[i-1])+v[i-1]);
   return dp[i][weight];
}

int main(void) {
   ll N,W;
   cin>>N>>W;
   rep(i,N) cin>>w[i]>>v[i];
   rep(i,110) rep(j,MAXN) dp[i][j] = -INF;
   rep(j,MAXN) dp[0][j] = 0;
   ll ans = 0;
   rep(weight,W+1) chmax(ans,GetDP(N,weight));
   cout<<ans<<endl; 


   return 0;
}

Measured memory_bytes: 86144
import math

N = int(input())

for l in range(N):
    x1,y1,x2,y2,x3,y3 = [float(i) for i in input().split()]

    # ax + by = e
    # cx + dy = f

    a,b,c = x1-x2, y1-y2, (x1-x2)*(x1+x2)/2 + (y1-y2)*(y1+y2)/2
    d,e,f = x1-x3, y1-y3, (x1-x3)*(x1+x3)/2 + (y1-y3)*(y1+y3)/2

    X = (c*e-f*b)/(a*e-b*d)
    Y = (f*a-c*d)/(a*e-b*d)
    R = math.sqrt((X-x1)*(X-x1)+(Y-y1)*(Y-y1))

    print(format(X, '.3f'), format(Y, '.3f'), format(R, '.3f'))


Measured memory_bytes: 5688
# coding: utf-8
from collections import deque
H, W = map(int, input().split())
INF = -1
maze = []
for i in range(H):
    tmp = list(input())
    maze.append(tmp[:])

def bfs(sx, sy):
    visited = [[INF for _ in range(W)] for _ in range(H)]
    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]
    q = deque()
    q.append([sx, sy])
    visited[sx][sy] = 0
    while q:
        p = q.popleft()
        for i in range(4):
            nx = p[0] + dx[i]
            ny = p[1] + dy[i]
            if 0 <= nx < H and 0 <= ny < W:
                if maze[nx][ny] != "#" and visited[nx][ny] == INF:
                    q.append([nx, ny])
                    visited[nx][ny] = visited[p[0]][p[1]] + 1
        dist = -1
        for i in range(H):
            dist = max(dist, max(visited[i]))
    return dist
ans = -1
for x in range(H):
    for y in range(W):
        if maze[x][y] == "#":
            continue
        ans = max(ans, bfs(x, y))
print(ans)

Measured memory_bytes: 50140
/*


*/
#include<bits/stdc++.h>
using namespace std;
#define forn(i, n)             for(int i = 0; i < n; i ++)
#define forn1(i, n)            for(int i = 1; i <= n; i ++)
#define pb push_back
#define ll long long int
#define fi first
#define se second
#define ii  pair<long long int, long long int>
#define vi  vector <long long int>
#define vii vector <pair <long long int, long long int > >
#define all(cont)  cont.begin(), cont.end()
#define EPS 1e-9
#define MOD 1000000007
#define range 
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#pragma GCC optimize ("Ofast")
int main(){

 //   freopen("input.txt","r",stdin);
    IOS;
    clock_t clk = clock();
    int a,b;
    cin>>a>>b;
    int curr = 1;
    int ans = 0;
    while(curr < b){
    	curr--;
    	curr += a;
    	ans++;
    }

    cout<<ans;


    cerr << endl << setprecision(10) << fixed << (double)(clock() - clk) / CLOCKS_PER_SEC;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define loop(i, a, b) for(int i = a; i < b; i++) 
#define rep(i, a) loop(i, 0, a)
using namespace std;
const int MOD = 1000000007;
const int inf = 1e8;
using vi = vector <int>;
using vvi = vector <vi>;
using vc = vector <char>;
using vvc = vector <vc>;
using vs = vector <string>;
using vvs = vector <vs>;
//g++ -std==c++14
//setprecision(10)
int n;
vi a;

int main(){
    cin >> n;
    a = vi(n);
    rep(i, n){
        cin >> a[i];
    }
    int cnt = 0;
    bool mada[n + 1] = {0};
    rep(i, n){
        if(a[a[i] - 1] == i + 1){
            if(mada[i + 1] == false && mada[a[a[i] - 1]] == false)
                cnt++;
            mada[i + 1] = true;
            mada[a[a[i] - 1]]= true;
        }
    }
    cout << cnt / 2 << endl;
}

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

int main(){
  int k;
  cin >> k;
  if(k==1 ||k==2 ||k==3 ||k==5 ||k==7 ||k==11 ||k==13 ||k==15 ||k==17 ||k==19 ||k==23 ||k==29||k==31)cout<<1<<endl;
  else if(k==4||k==6 ||k==9||k==10||k==14||k==21||k==22||k==25||k==26)cout<<2<<endl;
  else if(k==8||k==12||k==18||k==20||k==27)cout<<5<<endl;
  else if(k==16)cout<<14<<endl;
  else if(k==24)cout<<15<<endl;
  else if(k==28||k==30)cout<<4<<endl;
  else cout<<51<<endl;
    
}


Measured memory_bytes: 256
# Studying https://atcoder.jp/contests/abc168/tasks/abc168_f

N,M = gets.split.map(&:to_i)
縦線 = N.times.map{ gets.split.map(&:to_i) }
横線 = M.times.map{ gets.split.map(&:to_i) }

経線 = 縦線.map{|_,_,c| c }.uniq.sort
緯線 = 横線.map{|d,| d }.uniq.sort

GW = 経線.size+1 # 大外で壁になる線分の外側に１マス確保する。牛さんがそこにいる可能性もある。
GH = 緯線.size+1
HI = lambda{|横,下げ=false| # 0 番目のマス目の右側に 0 番目の縦線が配置される関係から、基本的に線分の座標は右へ、下へ切り上げられる。
	i = 経線.bsearch_index{|_| 横<=_ }||経線.size
	i1 = 下げ && 経線[i] != 横 ? 1 : 0
	next i-i1
}
VI = lambda{|縦,下げ=false|
	j = 緯線.bsearch_index{|_| 縦<=_ }||緯線.size
	j1 = 下げ && 緯線[j] != 縦 ? 1 : 0
	next j-j1
}
GI = lambda{|横,縦,下げ=false|
	next VI[縦,下げ]*GW + HI[横,下げ]
}

面積 = lambda{|gi|
	b,r = gi.divmod(GW)
	next Float::INFINITY unless (1...経線.size).include?(r) && (1...緯線.size).include?(b)
	next (経線[r]-経線[r-1]) * (緯線[b]-緯線[b-1])
}

縦線 = 縦線.inject(Array.new(経線.size){ [] }){|_,(a,b,c)|
	_[HI[c]] << [VI[a],VI[b,true]]
	next _
}
横線 = 横線.inject(Array.new(緯線.size){ [] }){|_,(d,e,f)|
	_[VI[d]] << [HI[e],HI[f,true]]
	next _
}

右？ = lambda{|gi|
	b,r = gi.divmod(GW)
	next r+1 < GW && ! 縦線[r].any?{|s,e| b-1 < e && s < b }
}
左？ = lambda{|gi|
	b,r = gi.divmod(GW)
	next 0 < r && ! 縦線[r-1].any?{|s,e| b-1 < e && s < b }
}
下？ = lambda{|gi|
	b,r = gi.divmod(GW)
	next b+1 < GH && ! 横線[b].any?{|s,e| r-1 < e && s < r }
}
上？ = lambda{|gi|
	b,r = gi.divmod(GW)
	next 0 < b && ! 横線[b-1].any?{|s,e| r-1 < e && s < r }
}

area = 0
Cow = GI[0,0]
Qd = [false]*(GW*GH)
Qd[Cow] = true;
Q = [Cow]
while at = Q.shift
	area += 面積[at]
	(puts'INF'; exit) if area.infinite?

	(Q<<at+1;  Qd[at+1]  = true) if 右？[at] && ! Qd[at+1]
	(Q<<at-1;  Qd[at-1]  = true) if 左？[at] && ! Qd[at-1]
	(Q<<at+GW; Qd[at+GW] = true) if 下？[at] && ! Qd[at+GW]
	(Q<<at-GW; Qd[at-GW] = true) if 上？[at] && ! Qd[at-GW]
end

p area


Measured memory_bytes: 22892
using System;
using System.Collections.Generic;
using System.Text;

namespace CSharpTest
{
    class B_1percent
    {
        static void Main(string[] args)
        {
            decimal CurCur = 100;
            decimal X = decimal.Parse(Console.ReadLine());
            Int64 i;
            for (i = 1; true; i++)
            {
                CurCur *= (decimal)1.01;
                CurCur = Math.Floor(CurCur);
                if (X <= CurCur) break;
            }
            Console.WriteLine(i);
        }
    }
}


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

typedef long long ll;
typedef long double ld;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;

    int n, k;
    cin >> n >> k;
    int cnt = 0;
    while(n--){
        int x;
        cin >> x;
        if(x >= k) cnt++;
    }
    cout << cnt;
    return 0;
}


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

int main(){
	string S,T; cin>>S>>T;
	for(int i=0; i<S.size(); ++i, S=S.substr(1)+S[0])
		if(S == T){ puts("Yes"); return 0; }
	puts("No");
}

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

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

const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int N;
    cin >> N;
    vector<int> done(N);
    int A[N+1][N+1];
    rep(i,N)rep(j,N-1){
        cin >> A[i][j];
        A[i][j]--;
    }
    bool ok = true;
    int ans = 0;
    while(ok){
        ok = false;
        vector<bool> used(N);
        for(int i=0;i<N;i++){
            if(done[i]==N-1)continue;
            int op = A[i][done[i]]; // 相手の番号
            if(used[i] || used[op])continue;
            if(A[op][done[op]] == i ){
                done[i]++;
                done[op]++;
                used[i] = true;
                used[op] = true;
                ok = true;
            }
        }
        if(ok)ans++;
    }
    rep(i,N)if(done[i]!=N-1){
        cout << -1 << endl;
        return 0;
    }    
    cout << ans << endl;
}

Measured memory_bytes: 4224
#include<iostream>
#include<algorithm>
using namespace std;
int main(void) {
	string str;
	cin >> str;
	int ans = 10000000;

	for (int i = 0; i < str.length() - 2; i++) {
		int data = 0;
		string s = str.substr(i, 3);
		
		data = stoi(s);

		ans = min(ans, abs(753 - data));
	}

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


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

#define rep(i, j, n) for(int i=j;i<n;++i)
#define all(i) i.begin(),i.end()
#define rall(i) i.rbegin(),i.rend()
#define INF 1e9
#define Puts(x) puts(x? "Yes":"No")
const int mod = 1e9 + 7;

typedef long long i64;
typedef pair<int, int> pi;

template <class T> using vt = vector<T>;
template <class T> using vvt = vector<vector<T>>;

i64 gcd(int n, int m) {return (m == 0? n : gcd(m, n % m));}
i64 lcm(int n, int m) {return (n / gcd(n, m) * m);}
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
int dy[] = {1, 0, -1, 0, 1, -1, 1, -1};

bool PrimeNumber(int n) {
  if(n < 2) return false;
  for(int i = 2; i * i <= n; ++i) {
    if(n % i == 0) return false;
  }
  return true;
}

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

  int sz = 1e5;
  vt<bool> vec(sz + 1, false);
  for(int i = 3; i <= sz; i += 2) vec[i] = PrimeNumber(i);
  for(int i = 3; i <= sz; i += 2) vec[i] = vec[i] && PrimeNumber((i + 1) / 2);
  vt<int> cou(sz + 1);
  cou[0] = 0;
  rep(i, 1, sz + 1) {
    cou[i] = cou[i - 1] + vec[i];
  }

  int q;
  cin >> q;
  rep(i, 0, q) {
    int l, r;
    cin >> l >> r;
    cout << cou[r] - cou[l - 1] << endl;
  }
} 


Measured memory_bytes: 1024
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>


#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))
#define FOR(i,n) for (int i = 1; (i) <= (n); ++ (i))
#define dump(x)  cout << #x << " = " << (x) << endl;
#define pb push_back
#define int long long
//#define lint long long

const int INF = 1e18;
const int MOD = 1e9+7;
//const lint LINF = 1e18;
const double eps = 0.000000001;//もとの値の10^(-16)まで

using namespace std;

//typedef pair<int, int> P;
//priority_queue< P, vector<P>, greater<P> > q;//ダイクストラの時、greaterで小さい順
vector<int> ret;

int a[600];
int b[600];
int c[600];
int b2[600];
int c2[600];

signed main(){
  int n,k;
  cin >> n >> k;
  int tt = 0;
  REP(i,n){
    cin >> a[i];
    tt += a[i];
  }
  if(tt==0){
    int migi = 10000000000;
    int hidari = 1;
    while(migi-hidari>0){
      int now2 = (migi+hidari)/2;
      REP(j,n){
        b[j] = a[j]%now2;
      }
      sort(b,b+n);
      REP(j,n){
        c[j] = (now2 - b[j])%now2;
      }
      b2[0] = b[0];
      c2[n-1] = c[n-1];
      REP(j,n-1){
        b2[j+1] = b2[j] + b[j+1];
        c2[n-j-2] = c2[n-j-1] + c[n-j-2];
      }
      int f = 0;
      REP(j,n-1){
        if(b2[j]==c2[j+1]&&b2[j]<=k){
          f = 1;
        }
      }
      if(f==1) hidari = now2;
      else migi = now2;
    }
    cout << hidari << endl;
    return 0;
  }
  for(int i = 1; i * i <= tt; i++) {
    if(tt % i == 0) {
      ret.push_back(i);
      if(i * i != tt) ret.push_back(tt / i);
    }
  }
  sort(begin(ret), end(ret));
  REP(i,ret.size()){
    int now2 = ret[ret.size()-1-i];
    REP(j,n){
      b[j] = a[j]%now2;
    }
    sort(b,b+n);
    REP(j,n){
      c[j] = (now2 - b[j])%now2;
    }
    b2[0] = b[0];
    c2[n-1] = c[n-1];
    REP(j,n-1){
      b2[j+1] = b2[j] + b[j+1];
      c2[n-j-2] = c2[n-j-1] + c[n-j-2];
    }
    REP(j,n-1){
      if(b2[j]==c2[j+1]&&b2[j]<=k){
        cout << now2 << endl;
        return 0;
      }
    }
  }

  return 0;
}


Measured memory_bytes: 256
using System;

namespace abc132B
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string[] str = Console.ReadLine().Split();
            int[] stl = new int[N];
            for(int m = 0; m < N; m++)
            {
                stl[m] = int.Parse(str[m]);
            }
            int Ans = 0;
            for(int i = 0; i < N-2; i++)
            {
                if (stl[i] < stl[i + 1] && stl[i + 1] < stl[i + 2])
                    Ans = Ans + 1;
                else if (stl[i] > stl[i + 1] && stl[i + 1] > stl[i + 2])
                    Ans = Ans + 1;
            }
            Console.WriteLine(Ans);
        }
    }
}


Measured memory_bytes: 13140
#include<stdio.h>
int main()
{
    char s[3];
    int i, j;
    scanf("%s", s);
    int cnt[] = {0, 0};
    for(i = 0; i < 3; i++){
        if(s[i] == 'A')
            cnt[0]++;
        else
            cnt[1]++;
    }
    if(cnt[0] == 0 || cnt[1] == 0)
        printf("No\n");
    else
        printf("Yes\n");
    return 0;
}

Measured memory_bytes: 128
/*
    AUTHOR:hruday pabbisetty
    NIT ROURKElA(My_College_Sucks)
*/
#include <bits/stdc++.h>
using namespace std;
#define opt ios_base::sync_with_stdio(0)
#define lli long long int
#define ulli unsigned long long int
#define I int
#define S string
#define D double
#define rep(i,a,b) for(i=a;i<b;i++)
#define repr(i,a,b) for(i=a;i>b;i--)
#define in(n) scanf("%lld",&n)
#define in2(a,b) scanf("%lld %lld",&a,&b)
#define in3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)
#define out(n) printf("%lld\n",n)
#define inu(a) scanf("%lld",&a)
#define outu(a) printf("%llu",a)
#define ins(s) scanf("%s",&s)
#define outs(s) printf("%s",s)
#define nl printf("\n")
#define mod 1000000007
#define inf 100000000000000
typedef long long       ll;
typedef pair<lli,lli>  plli;
typedef vector<lli>     vlli;
typedef vector<ulli>    vulli;
typedef vector<ll>      vll;
typedef vector<string>  vs;
typedef vector<plli>     vplli;
#define MM(a,x)  memset(a,x,sizeof(a));
#define ALL(x)   (x).begin(), (x).end()
#define P(x)       cerr<<"{"#x<<" = "<<(x)<<"}"<<endl;
#define P2(x,y)       cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<"}"<<endl;
#define P3(x,y,z)  cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<", "#z" = "<<(z)<<"}"<<endl;
#define P4(x,y,z,w)cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<", "#z" = "<<(z)<<", "#w" = "<<(w)<<"}"<<endl;
#define PP(x,i)     cerr<<"{"#x"["<<i<<"] = "<<x[i]<<"}"<<endl;
#define TM(a,b)     cerr<<"{"#a" -> "#b": "<<1000*(b-a)/CLOCKS_PER_SEC<<"ms}\n";
#define UN(v)    sort(ALL(v)), v.resize(unique(ALL(v))-v.begin())
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define sz() size()
#define nl cout<<"\n"
#define MX1 100005
#define MX2 1000005

#define bs binary_search
#define lb lower_bound
#define ub upper_bound

lli power(lli a,lli b)
    {
    lli value;
    if(b==0)
        {
        return 1;
    }
    else if(b%2==0)
        {
        value=power(a,b/2)%mod;
        return(value*value)%mod;
    }
    else
        {
        value=power(a,b/2)%mod;
        return ((a*value)%mod*(value))%mod;
    }
}
int main()
{
      /*  #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
        #endif*/
    opt;
    lli n;
    vlli v;
    cin>>n;
    lli a[1+n],i;
    rep(i,1,1+n)
    {
        cin>>a[i];
    }
    for(i=n;i>=1;i-=2)
    {
        v.pb(a[i]);
    }
    if(n%2)
    {

    for(i=2;i<=n;i+=2)
    {
        v.pb(a[i]);
    }
    }
    else
    {

    for(i=1;i<=n;i+=2)
    {
        v.pb(a[i]);
    }
    }
    rep(i,0,v.sz())
    {
        cout<<v[i]<<" ";
    }
}


Measured memory_bytes: 5488
import sys
N,M=map(int,input().split())

amat=[]
for _ in range(N):
  amat.append([x=="." for x in input()])
bmat=[]
for _ in range(M):
  bmat.append([x=="." for x in input()])
#print(amat)
#print(bmat)

for i in range(N-M+1):
  for j in range(N-M+1):
    isTemplate=True
    for k1 in range(M):
      for k2 in range(M):
        if amat[k1+i][k2+j]!=bmat[k1][k2]:
          isTemplate=False
          break
      if not isTemplate:
        break
    else:
      print("Yes")
      sys.exit(0)
else:
  print("No")

Measured memory_bytes: 39152
#pragma GCC optimize("O3", "unroll-loops")

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <bitset>
#include <sstream>
#include <deque>
#include <queue>
#include <random>
#include <complex>

using namespace std;

#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define FIXED cout << fixed << setprecision(12);
#define RANDOM srand(94385)
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define graph vector<vector<int>>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define f first
#define s second
#define hashmap unordered_map
#define hashset unordered_set
#define eps 1e-9
#define mod 1000000007
#define inf 3000000000000000007ll
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define shuffle(a) \
    for (int i = 0; i < sz(a); ++i) \
        swap(a[i], a[rand() % sz(a)])

template<class T, class U> inline void checkmin(T &x, U y) { if (y < x) x = y; }
template<class T, class U> inline void checkmax(T &x, U y) { if (y > x) x = y; }
template<class T, class U> inline bool ifmax(T &x, U y) { if (y > x) return x = y, true; return false; }
template<class T, class U> inline bool ifmin(T &x, U y) { if (y < x) return x = y, true; return false; }
template<class T> inline void sort(T &a) { sort(all(a)); }
template<class T> inline void rsort(T &a) { sort(rall(a)); }
template<class T> inline void reverse(T &a) { reverse(all(a)); }
template<class T, class U> inline istream& operator>>(istream& str, pair<T, U> &p) { return str >> p.f >> p.s; }
template<class T> inline istream& operator>>(istream& str, vector<T> &a) { for (auto &i : a) str >> i; return str; }

signed main() {
    FAST; FIXED; RANDOM;
    int n, m;
    cin >> n >> m;
    vector<vector<int>> a(m);
    for (auto &i : a) {
        int s;
        cin >> s;
        i = vector<int>(s);
        cin >> i;
        for (auto &j : i) --j;
    }
    vector<int> p(m);
    cin >> p;
    int ans = 0;
    for (int i = 0; i < (1 << n); ++i) {
        vector<int> c(m);
        for (int j = 0; j < m; ++j)
            for (auto k : a[j])
                c[j] ^= (i >> k & 1);
        ans += c == p;
    }
    cout << ans;
    return 0;
}   

Measured memory_bytes: 256
#include<iostream>
#include<string.h>
#include<ctype.h>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<set>
#include<utility>
#include<algorithm>

typedef long long ll;

using namespace std;

int main()
{
    
    int n,m;
    int total=0;
    cin>>n>>m;
    int a[n];
    int count=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        total+=a[i];
        
       
    }
    
    for(int i=0;i<n;i++){
         if(a[i]>=((1.0/(4*m))*total)){
            count++;
        }
    }
    
    if(count>=m){
        cout<<"Yes";

    }
    else{
        cout<<"No";
    }


    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename Q_type>
using smaller_queue = priority_queue<Q_type, vector<Q_type>, greater<Q_type>>;

const int MOD_TYPE = 1;
const ll MOD = (MOD_TYPE == 1 ? (ll)(1e9 + 7) : 998244353);
const int INF = (int)1e9;
const ll LINF = (ll)4e18;
const ld PI = acos(-1.0);
const ld EPS = 1e-11;

#define REP(i, m, n) for (ll i = m; i < (ll)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define possible(n) cout << ((n) ? "possible" : "impossible") << endl
#define Yay(n) cout << ((n) ? "Yay!" : ":(") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x) cerr << #x << ":" << x << endl;

vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

const int MAX_V = 200010;
int n;
ll m;
vector<int> E[MAX_V];
vector<ll> dp[MAX_V];

//上から下
ll dfs1(int p, int v)
{
  ll res = 1;
  rep(i, E[v].size())
  {
    if (E[v][i] == p)
      continue;
    dp[v][i] = dfs1(v, E[v][i]);
    res *= (dp[v][i] + 1);
    res %= m;
  }

  return res;
}

//下から上
void dfs2(int p, int v, ll add)
{
  //上から持ってきた値を清算
  rep(i, E[v].size())
  {
    if (E[v][i] == p)
    {
      dp[v][i] = add;
      break;
    }
  }

  //左右からの累積積を作っておく
  vector<ll> pL(E[v].size() + 1), pR(E[v].size() + 1);
  pL[0] = 1;
  rep(i, E[v].size()) pL[i + 1] = pL[i] * (dp[v][i] + 1) % m;
  pR[E[v].size()] = 1;
  for (int i = E[v].size(); i > 0; --i)
    pR[i - 1] = pR[i] * (dp[v][i - 1] + 1) % m;

  rep(i, E[v].size())
  {
    if (E[v][i] == p)
      continue;
    ll val = pL[i] * pR[i + 1] % m;
    dfs2(v, E[v][i], val);
  }
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(30) << setiosflags(ios::fixed);

  cin >> n >> m;

  rep(i, n - 1)
  {
    int a, b;
    cin >> a >> b;
    a--, b--;
    E[a].push_back(b);
    E[b].push_back(a);
  }

  rep(i, n) dp[i].resize(E[i].size());

  dfs1(-1, 0);
  dfs2(-1, 0, 0);

  rep(v, n)
  {
    ll ans = 1;
    rep(i, E[v].size())
    {
      ans *= dp[v][i] + 1;
      ans %= m;
    }
    cout << ans << endl;
  }

  return 0;
}


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

int main() {
    int x, a, b;
    cin >> x >> a >> b;
    if (abs(a - x) > abs(b - x)) cout << "B" << endl;
    else cout << "A" << endl;
    return 0;
}

Measured memory_bytes: 256
import math
N = 55555
n = int(input())
p = []
for i in [0]*(N+1):
  p.append(1)

p[0] = 0
p[1] = 0

i = 2
while i <= N/2:
  if p[i] == 1:
    j = 2*i
    while j <= N:
      p[j] = 0
      j += i
  i += 1

ans = [2]
j = 2
for i in range(n-1):
  while 5*j + 1 < N and p[5*j+1] == 0:
    j += 1
  ans.append(5*j+1)
  j += 1
print(' '.join(map(str, ans)))


Measured memory_bytes: 3992
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
for aa in range(a + 1):
         for bb in range (b + 1):
                  for cc in range (c + 1):
                           if 500 * aa + 100 * bb + 50 * cc == x:
                                    count += 1
print(count)


Measured memory_bytes: 3060