akhauriyash/Code-Regression huggingface dataset:
#include <time.h>

#include <stdlib.h>
#include <cstdint>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <limits>
#include <cstdint>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <limits>
#include <vector>
#include <map>
#include <set>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <bitset>
#include <iterator>
#include <deque>
#include <string>
#include <queue>
#include <omp.h>
#include <fstream>   // ifstream, ofstream
typedef int64_t ll;
using namespace std;
const ll INF=1e16;
const double EPS=1e-8;
const ll mod = 1000000007;

int64_t powm(int64_t a,int64_t b){//a^bを求める
	if(b==0){
		return 1;
	}else{
		int64_t temp = powm(a,b/2);
		temp = temp * temp;
		if(b%2==1){
			temp = temp * a;
		}
		return temp;
	}
}
struct points{
	ll even_index;
	ll odd_index;
	bool issearched;
};
int main(){
	string s;
	cin>>s;
	vector<ll> ans;
	ans.resize(s.size(),0);
	queue<ll> update_list;
	vector<points> pts;
	pts.resize(s.size(),points{0,0,false});
	for(ll i1=0;i1<s.size()-1;i1++){
		if(s[i1]=='R'&&s[i1+1]=='L'){
			pts[i1].even_index=i1;
			pts[i1].odd_index=i1+1;
			pts[i1].issearched=true;
			update_list.push(i1+1);
			if(i1>0&&s[i1-1]=='R'){
				update_list.push(i1-1);
			}
		}
	}
	while(!update_list.empty()){
		ll target_index = update_list.front();
		update_list.pop();
		if(s[target_index]=='L'){
			pts[target_index].even_index=pts[target_index-1].odd_index;
			pts[target_index].odd_index=pts[target_index-1].even_index;
			pts[target_index].issearched=true;
			if(target_index < s.size()-1&&s[target_index+1]=='L'&&!(pts[target_index+1].issearched)){
				update_list.push(target_index+1);
			}
		}else{
			pts[target_index].even_index=pts[target_index+1].odd_index;
			pts[target_index].odd_index=pts[target_index+1].even_index;
			pts[target_index].issearched=true;
			if(target_index >0 && s[target_index-1]=='R'&&!(pts[target_index-1].issearched)){
				update_list.push(target_index-1);
			}
		}
	}
	for(ll i1=0;i1<s.size();i1++){
		ans[pts[i1].even_index]++;
	}
	for(ll i1=0;i1<s.size();i1++){
		cout<<ans[i1]<<" ";
	}
	cout<<endl;



}


Measured memory_bytes: 4096
#include<bits/stdc++.h>
#define N 500005
using namespace std;
int n,a[N],ans;
inline int rd() {   int r;scanf("%d",&r);return r;}
bool cmp(int p1,int p2) {return p1 > p2;}
int main(){
    n = rd();
    for (int i=1;i<=n;i++) a[i] = rd();
    sort(a+1,a+n+1,cmp);
    for(int i=1;i<=n;i++) if(i+1>a[i+1]) {
        for(int j=i+1;a[j]==i;j++) ans^=1;
        ans |= (a[i] - i) & 1;
        if (ans) puts("First"); else puts("Second");
        return 0;
    }
    return 0;
}

Measured memory_bytes: 640
# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

a, b = map(int, raw_input().split())
if a <= 0 and b >= 0:
    print "Zero"
else:
    if a > 0:
        print "Positive"
    else:
        print "Positive" if (b - a) % 2 == 1 else "Negative"


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

int main(){
  int n; cin >> n;
  if (n < 100 || n > 999) cout << "No";
  else{
    int s = 0;
    while(n>0){
      s = n % 10;
      if (s == 7){
         break;
      }
      n = n / 10;
    }
    cout << ((s != 7)? "No" : "Yes");
  }
  return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <utility>
#include <tuple>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<int, int>;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...) do{ } while(false)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template<typename T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }
template<typename T> void print(T a) { cout << a << endl; }
template<typename T, typename... Ts> void print(T a, Ts... ts) { cout << a << ' '; print(ts...); }
template<typename T> istream &operator,(istream &in, T &t) { return in >> t; }
// clang-format on

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s;
    cin, s;
    if (s[2] == s[3] && s[4] == s[5]) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
while True:
    l = input().split()
    a = int(l[0])
    op = l[1]
    b = int(l[2])
    if op == "?":
        break
    elif op == "+":
        print(a + b)
    elif op == "-":
        print(a - b)
    elif op == "*":
        print(a * b)
    elif op == "/":
        print(int(a / b))

Measured memory_bytes: 5596
object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    val S = sc.nextLine()

    // 繰り返す操作が十分に大きいので, 同じ文字が連続している場合には,
    // 同じ文字が連続していないところまで移動し, 振動を繰り返す
    // 左端がR, 右端がLなので, 子供達が端っこに寄ってしまうようなケースは無い.
    // 必ず振動する

    val RC = Array.fill(S.length)(-1)
    var i = S.length - 1
    var count = 0
    while (i >= 0) {
      if (S(i) == 'R') {
        count += 1
        RC(i) = count
      } else {
        count = 0
      }
      i -= 1
    }

    val LC = Array.fill(S.length)(-1)
    i = 0
    count = 0
    while (i < S.length) {
      if (S(i) == 'L') {
        count += 1
        LC(i) = count
      } else {
        count = 0
      }
      i += 1
    }

    i = 0
    val C = Array.fill(S.length)(0)
    while (i < S.length) {
      if (RC(i) != -1) {
        if (RC(i) % 2 == 0) {
          C(i + RC(i)) += 1
        } else {
          C(i + RC(i) - 1) += 1
        }
      }
      if (LC(i) != -1) {
        if (LC(i) % 2 == 0) {
          C(i - LC(i)) += 1
        } else {
          C(i - LC(i) + 1) += 1
        }
      }
      i += 1
    }
    println(C.mkString(" "))
  }

}


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

#define pb push_back
#define eb emplace_back
#define mk make_pair
#define fi first
#define se second

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

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main() {
	int n, k, s; scanf("%d%d%d", &n, &k, &s);
	vector<int> a(n);

	for (int i = 0; i < n; i++) {
		if (i < k) printf("%d ", s);
		else if (s <= 1e7) printf("%d ", s+1);
		else printf("%d ", 1);
	}
	printf("\n");
	

	return 0;
}

Measured memory_bytes: 1664
N,D = map(int,input().split())
X = []
for i in range(N):
    X.append(list(map(int,input().split())))

counter = 0
for i in range(N):
    for j in range(N-i-1):
        dsquare = 0
        for k in range(D):
            dsquare += (X[i][k] - X[i+j+1][k])**2
        n = 1
        while (n**2 <= dsquare):
            if (dsquare == n**2):
                counter += 1
                break
            else:
                n += 1
print(counter)


Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>

using namespace std;

int main(){
	int n, a;

	cin >> n >> a;

	if(n%500 <= a) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int a[100005];
int main(){
    int n, m;
    scanf("%d%d", &n, &m);
    for(int i=1;i<=n;i++) scanf("%d", &a[i]), a[i] /= 2;

    LL lcm = a[1];
    for(int i=2;i<=n;i++){
        lcm = a[i]*lcm/__gcd(a[i]*1ll, lcm);
        if(lcm > m) break;
    }

    for(int i=1;i<=n;i++){
        if((lcm/a[i])%2 == 0){
            printf("0\n");
            return 0;
        }
    }
    m /= lcm;
    printf("%lld\n", (m+1)/2);
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <tuple>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>
#include <random>
#include <cstring>

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

using namespace std;
using ll = long long;

const ll mod = 1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
bool debug=false;

/*---------------------------------------------------*/

void solve(int T, int D, int L){
  int x;
  map<double, int> time;
  for(int i = 1; i <= T; i++){
    cin >> x;
    if(L <= x) {
      time[i +  0.5]++;
      time[i + D + 0.5]--;
    }
  }
  for(int i = 1; i < T + D + 10; i++) time[i + 0.5] += time[i - 0.5];
  // for(int i = 0; i < T; i++) //cerr << i + 0.5 << " " << time[i + 0.5] << endl;
  int ans = 0;
  for(int i = 0; i < T; i++) ans += bool(time[i + 0.5]);
  cout << ans << endl;
}

int main(){
  int T, D, L;
  while(cin >> T >> D >> L) {
    if(T == 0 && D == 0 && L == 0) break;
    solve(T, D, L);
  }
  return 0;
}



Measured memory_bytes: 15548
w,h,n = map(int, input().split())

array =[[0] * w for i in range(h)]

for i in range(n):
  x,y,a = map(int, input().split())
  
  if a==1:
    for j in range(h):
      for k in range(x):
        array[j][k] = 1
  elif a==2:
    for j in range(h):
      for k in range(w-x):
        array[j][w-1-k] = 1
  elif a==3:
    for j in range(y):
      array[j] = [1]*w
  elif a==4:
    for j in range(h-y):
      array[h-1-j] = [1]*w

cnt = 0
for i in range(h):
  for j in range(w):
    if array[i][j] == 0:
      cnt += 1
      
print(cnt)
   

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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

vb is_match;

void kmp(const string &a, const string &b) {
	ll m = sz(a), n = sz(b), j = 0;
	vl p(m);
	FOR(i,1,m) {
		while (j > 0 && a[j] != a[i]) j = p[j-1];
		if (a[j] == a[i]) j++;
		p[i] = j;
	}
	j = 0;
	FOR(i,0,n) {
		while (j > 0 && a[j] != b[i]) j = p[j-1];
		if (a[j] == b[i]) j++;
		if (j == m) {
			// found match, a = b[i-m+1..i]
			is_match[i-m+1] = true;
			j = p[j-1];
		}
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	string a, b;
	cin >> b >> a;
	
	do b += b; while (sz(b) < 2*sz(a));
	
	is_match.resize(sz(b));
	kmp(a,b);
	FOR(i,0,sz(b)/2) if (is_match[i]) is_match[i+sz(b)/2] = true;

	vl dp(sz(b),-1);

	function<ll(ll)> rec = [&](ll i) {
		if (!is_match[i]) return 0LL;
		if (dp[i] == -2) {
			cout << -1 << endl;
			exit(0);
		}
		if (dp[i] != -1) return dp[i];
		dp[i] = -2;
		return dp[i] = 1 + rec((i+sz(a))%sz(b));
	};
	
	ll res = 0;
	FOR(i,0,sz(b)) res = max(res,rec(i));
	cout << res << endl;	
}



Measured memory_bytes: 41324
#include <algorithm>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define PI 3.141592653589793
// const int INF = (1 << 30) - 1;
// const ll LL_INF = (1LL << 62) - 1;
// const ll MOD = 1e9 + 7;

double a, b, x;

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

  double ans = 0.0;
  double h = (b - (x / (a * a))) * 2;
  if (h <= b) {
    ans = atan2(h, a) * 180.0 / PI;
  } else {
    h = x / (a * b) * 2;
    ans = atan2(a * b / h, a) * 180.0 / PI;
  }

  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<map>
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
const ll INF = 1000000009;

int main() {
	int n;
	cin >> n;
	map<string, ll> mp;
	rep(i, n) {
		string s;
		cin >> s;
		sort(s.begin(), s.end());
		mp[s]++;
	}
	ll ans = 0;
	for (auto i = mp.begin(); i != mp.end(); i++) {
		ans += ((i->second) * (i->second - 1)) / 2;
	}
	cout << ans << endl;
}

Measured memory_bytes: 11136
#include <iostream>
#include <numeric>
#include <vector>

using namespace std;
using ll = long long;

int cnt = -1;

ll hoge(ll n, ll c, ll k) {
  if (n == 0)
    return ++cnt == k ? c : 0;

  ll ret = 0;
  if (c == 0) {
    for (int i = 0; i < 10; ++i)
      ret += hoge(n - 1, c * 10 + i, k);
  }
  else {
    ll tmp = c % 10;
    if (0 < tmp)
      ret += hoge(n - 1, c * 10 + tmp - 1, k);
    ret += hoge(n - 1, c * 10 + tmp, k);
    if (tmp < 9)
      ret += hoge(n - 1, c * 10 + tmp + 1, k);
  }
  return ret;
}

int main() {
  ll k;
  cin >> k;
  cout << hoge(10, 0, k) << endl;
}

Measured memory_bytes: 3532
import sys
sys.setrecursionlimit(10**6)


def main(input, print):
    N = int(input())
    A = list(map(int, input().split()))
    ans = 1000
    i = 0
    while i < N:
        now = A[i]
        max = now
        next = i
        for j in range(i+1, N):
            if A[j-1] > A[j]:
                break
            if max < A[j]:
                max = A[j]
                next = j
        if now < max:
            cnt = ans // now
            ans += max * cnt - now * cnt
        i = next+1
    print(ans)


if __name__ == '__main__':
    main(sys.stdin.readline, print)


Measured memory_bytes: 62844
import sys
from copy import deepcopy
import itertools
input = sys.stdin.readline

N = int(input())
A0 = list(map(int, input().split()))
B0 = list(map(int, input().split()))



# sort B with A
B1 = []
for i, b in enumerate(B0):
	B1.append((b, i))
B1.sort()
A1 = []
B = []
for b, i in B1:
	B.append(b)
	A1.append(A0[i])

#Aも小さい順にしないといけない
A = []
idx = 0
gr = itertools.groupby(B)
for key, group in gr:
    length = len(list(group))
    if length == 1:
        A.append(A1[idx])
    else:
        A_pre = A1[idx:idx+length]
        A_pre.sort()
        A = A + A_pre
    idx += length

#print('A={}'.format(A))
#print('B={}'.format(B))



# count cyclic components
C0 = deepcopy(A)
C1 = []
for i, c in enumerate(C0):
	C1.append((c, i))
C1.sort()
C = []
for c, i in C1:
    C.append(c)

for i in range(N):
    if C1[i][0] > B[i]:
        print('No')
        exit()

#print('A_sort={}'.format(C1))

num_set = set([i for i in range(1, N)])
components = 1
prev = 0
while num_set:
	c, i = C1[prev]
	if i in num_set:
		num_set.discard(i)
		prev = i
	else:
		prev = num_set.pop()
		components += 1

#print('components={}'.format(components))

if components != 1:
	print('Yes')
else:
    ok = False
    for i in range(1, N):
        if C[i] <= B[i - 1]:
            ok = True
            break
    if ok:
        print('Yes')
    else:
        print('No')


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

int main(){
  int income[10000];
  int n;
  while(1){
    cin >> n;
    if(n==0){
      break;
    }
    int total=0;
    for(int i=0;i<n;i++){
      cin >> income[i];
      total += income[i];
    }
    int ave = total/n;
    int cnt=0;
    for(int i=0;i<n;i++){
      if(ave>=income[i])
        cnt++;
      }
      cout << cnt << endl;
    }
}



Measured memory_bytes: 3124
#include <bits/stdc++.h>
#define BIT(n) (1LL << (n))
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPB(i, n) for (int i = 0; i < BIT(n); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORA(i, n) for (auto &&i : n)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define DEBUG(x) cerr << #x << ": " << x << "\n"
#define ALL(v) v.begin(), v.end()
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define epb emplace_back
#define int long long
using namespace std;
template < class T > using vec = std::vector< T >;
template < class T > void print(T &x) { cout << x << "\n"; }
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI = acos(-1.0);
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
signed main() {
  cin.tie(0), ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int R;
  cin >> R;
  if (R<1200){
    print("ABC");
  }else if (R<2800){
    print("ARC");
  }else{
    print("AGC");
  }
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<int,pair<int,int> > PP;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
void print_YES_NO(bool answer){cout<<(answer?"YES":"NO")<<endl;}
void print_Yes_No(bool answer){cout<<(answer?"Yes":"No")<<endl;}
void print_POSSIBLE_IMPOSSIBLE(bool answer){cout<<(answer?"POSSIBLE":"IMPOSSIBLE")<<endl;}

int main(){
	int a,b,c;
	cin>>a>>b>>c;
	print_Yes_No(a<b && b<c);
}



Measured memory_bytes: 3092
use strict;
use warnings;

chomp(my $n = <>);
chomp(my $inx = <>);
my @x = split(/ /, $inx);

@x = sort {$a <=> $b} @x;

my $str;
my $prov;

foreach my $p ($x[0]..$x[$n-1]) {
  foreach my $j (0..$n-1){
    $prov += ($x[$j] - $p) ** 2;
  }
  if ($str == 0 || $str > $prov) {$str = $prov;}
  $prov = 0;
}

print "$str\n";

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

constexpr int MAX_N = 365;
constexpr int SIZE = 16;
constexpr int rain[3][3] = {{0x0033, 0x0066, 0x00cc},
							{0x0330, 0x0660, 0x0cc0},
							{0x3300, 0x6600, 0xcc00}};
constexpr int dx[9] = {0, 1, -1, 2, -2, 0, 0, 0, 0};
constexpr int dy[9] = {0, 0, 0, 0, 0, 1, -1, 2, -2};

int n;
int festivals[MAX_N];
unordered_map<int, int> get_index;
unordered_set<int> visited[MAX_N][3][3];

inline int calc_value(int idx, const array<int, 7> &prev) {
	int res = 0;
	for(int i = 0; i < 7; ++i) {
		if(idx != i) res = res * 9 + get_index[prev[i]];
	}
	return res;
}

bool dfs(int day, int x, int y, array<int, 7> &prev) {
	if(day == n) return true;

	const int idx = day % 7;
	const int value = calc_value(idx, prev);
	if(visited[day][x][y].count(value)) return false;


	int need = (1 << SIZE) - 1;
	for(int i = 0; i < 7; ++i) {
		if(idx != i) need &= ~prev[i];
	}

	for(int d = 0; d < 9; ++d) {
		const int nx = x + dx[d];
		const int ny = y + dy[d];
		if(nx < 0 || ny < 0 || nx >= 3 || ny >= 3) continue;
		if(need & ~rain[ny][nx]) continue;
		if(festivals[day] & rain[ny][nx]) continue;

		const int tmp = prev[idx];
		prev[idx] = rain[ny][nx];
		if(dfs(day + 1, nx, ny, prev)) return true;
		prev[idx] = tmp;
	}
	visited[day][x][y].insert(value);
	return false;
}

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

	for(int x = 0; x < 3; ++x) {
		for(int y = 0; y < 3; ++y) {
			get_index[rain[y][x]] = y * 3 + x;
		}
	}

	while(cin >> n && n) {
		memset(festivals, 0, sizeof(festivals));
		for(int i = 0; i < n; ++i) {
			for(int j = 0; j < SIZE; ++j) {
				int in;
				cin >> in;
				festivals[i] |= (in << j);
			}
		}

		if(festivals[0] & rain[1][1]) {
			cout << 0 << endl;
			continue;
		}

		array<int, 7> prev;
		prev.fill((1 << SIZE) - 1);
		prev[0] = rain[1][1];

		for(int i = 0; i < n; ++i) {
			for(int x = 0; x < 3; ++x) {
				for(int y = 0; y < 3; ++y) {
					visited[i][x][y].clear();
				}
			}
		}

		cout << dfs(1, 1, 1, prev) << endl;
	}

	return EXIT_SUCCESS;
}

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

double n;

int main()
{
	cin>>n;

	if(int(n)%2 == 0)cout<<"0.5000000000"<<endl;
	else cout<<fixed<<setprecision(10)<<(n+1)/2/n<<endl;

	return 0;
}

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

int main(){
int N,M;
cin>>N>>M;
 vector<int>a(N);
 vector<int>b(N);
 vector<int>c(M);
 vector<int>d(M);

 for(int i=0;i<N;i++){
   cin>>a.at(i)>>b.at(i);
 }
 for(int i=0;i<M;i++){
   cin>>c.at(i)>>d.at(i);
 }
 
 for(int i=0;i<N;i++){
   int A=abs(c.at(0)-a.at(i))+abs(d.at(0)-b.at(i));int num=0;
  for(int j=0;j<M;j++){
   int K=abs(c.at(j)-a.at(i))+abs(d.at(j)-b.at(i));
  if(K<A){A=K; num=j;}
 }
 cout<<num+1<<endl;}
      return 0;}

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

using namespace std;

void solve() {
    int h, w;
    cin >> h >> w;
    char im[h+1][w+1];
    for (int i = 1; i <= h; ++i) {
        for (int j = 1; j <= w; ++j) {
            cin >> im[i][j];
        }
    }
    for (int i = 1; i <= 2*h; ++i) {
        for (int j = 1; j <= w; ++j) {
            cout << im[(i+1)/2][j];
        }
        cout << endl;
    }
}

int main() {

    solve();
    return 0;
}


Measured memory_bytes: 3084
#include <bits/stdc++.h>
#define int int64_t
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
#define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); -- (i))
#define REPP(i, n) for (int i = 1; (i) < (int)(n+1); ++ (i))
#define REPR(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i, m, n) for(int i=(m)-1; i>=(n); i--)
#define ALL(v) v.begin(), v.end()
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())
#define SORTR(c) sort((c).begin(),(c).end(),greater<int>());
#define BIT(n) (1LL<<(n))
#define PCNT(x) __builtin_popcountll(x)
#define GCD(x,y) __gcd(x,y)
#define LCM(x,y) x/__gcd(x,y)*y
#define PB push_back
#define MP make_pair
#define endl "\n"
#define pa cout << ans << endl
#define p(x) cout << x << endl
#define pall(x) for(auto iter : x) p(iter)
#define yes cout << "Yes" << endl
#define no cout << "No" << endl
#define yn(x) cout << (x ? "Yes" : "No") << endl
using namespace std;
using Graph = vector<vector<int> >;
using WeightedGraph = vector<vector<pair<int, int> > >;
typedef long double LD;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
const int MOD = 1000000007;
const int INF = 2000000000;
const long double PI = acosl(-1);
void print() {cout << endl;}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head; if (sizeof...(tail) != 0) cout << " ";print(forward<Tail>(tail)...);}
template <class T> void print(vector<T> &vec) {for (auto& a : vec) {cout << a; if (&a != &vec.back()) cout << " ";} cout << endl;}
template <class T> void print(vector<vector<T>> &df) { for (auto& vec : df) { print(vec);}}
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; }


bool kaibun(string s){
    int n = SZ(s);
    REP(i,n/2) if (s[i] != s[n-1-i]) return false;
    return true;
}

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    string S;
    cin >> S;

    int ans = 0;
    int N = SZ(S);
    if (kaibun(S) && kaibun(S.substr(0,(N-1)/2)) && kaibun(S.substr((N+1)/2,(N-1)/2))) yes;
    else no;

    
    
    return 0;
}

/*
cd ~/Desktop/Programming/AtCoder/contest/abc159/abc159_b && sh test.sh
cd ~/Desktop/Programming/AtCoder/contest/abc159/abc159_b && sh etest.sh
cd ~/Desktop/Programming/AtCoder/contest/abc159/abc159_b && sh submit.sh
*/


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

#define int long long int
#define ff first
#define ss second
#define pb push_back
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int mod = 1e9 + 7;
const int N = 5e5 + 5;
const int inf = 1e16 + 2;

void solve(int z) {
    int n;
    cin >> n;
    n %= 10;
    if(n == 3) cout << "bon" << '\n';
    else if(n == 0 or n == 1 or n == 6 or n == 8) cout << "pon" << '\n';
    else cout << "hon" << '\n';
}

/*
 */

int32_t main()
{
    fastio
    int testcase = 1;
    //cin >> testcase;
    int x = 1;
    while(testcase --) {
        solve(x ++);
    }
    
    return 0;
}
 



Measured memory_bytes: 3648
//Giorgi Kldiashvili

#include <bits/stdc++.h>

#define ll long long
#define M 1000000007LL

using namespace std;

int n;
string a, b;

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

  for(int i = 0; i < n; ++ i)
  {
    for(int j = 0; j < n; ++ j)
    {
      if(i + j == n)
      {
        cout << i + n << endl;
        return 0;
      }
      if(a[i + j] != b[j])
        break;
      if(j == n - 1) return printf("%d\n", n), 0;
    }
  }
  cout << n + n << endl;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        
        String s = scan.next();
        
        char a = 'a';
        
        for(int i=0;i<26;i++)
        {
            if(Have(s,a)==0)
            {
                System.out.println(a);
                return;
            }
            else
            {
                a++;
            }
        }
        System.out.println("None");
    }
    
    static int Have(String s,char a){
        int i=0;
        while(i<s.length())
        {
            if(s.charAt(i)==a)
            {
                return 1;
            }
            else
            {
                i++;
            }
        }
        return 0;
    }
}

Measured memory_bytes: 23624
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    n,a,b = LI()
    print(min(n*a,b))
    return

#B
def B():
    s = S()
    print(s.count("1"))
    return

#C
def C():
    n = list(map(int, S()))
    k = 0
    s = sum(n)
    for i in range(len(n)):
        k *= 10
        k += n[i]
    if k%s == 0:
        print("Yes")
    else:
        print("No")
    return

#D
def D():
    n = I()
    a = LI()
    ans = float("inf")
    for i in range(n):
        m = 0
        while a[i]%2 == 0:
            m += 1
            a[i] //= 2
        ans = min(m,ans)
    print(ans)
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#I
def I_():
    return

#J
def J():
    return

#Solve
if __name__ == "__main__":
    D()


Measured memory_bytes: 39664
def solve(x):
    cur = 100
    for i in xrange(10000):
        if cur >= x:
            return i
        cur = int(cur * 1.01)
    return -1

assert solve(103) == 3
assert solve(101) == 1
assert solve(10 ** 18) != -1
assert solve(1000000000000000000) == 3760


x = int(raw_input())
print solve(x)


Measured memory_bytes: 66680
#include <bits/stdc++.h>
#define rep(i, to) for (int i = 0; i < (to); i++)
#define rrep(i, to) for (int i = (to) - 1; i >= 0; i--)
#define repf(i, from, to) for (int i = (from); i < (to); i++)
#define all(v) v.begin(), v.end()
#define unless(cond) if (!(cond))
using namespace std;
using ll = long long;
template <typename T>
using V = vector<T>;
template <typename T, typename U>
using P = pair<T, U>;

int main() {
  int n;
  string s;

  cin >> n >> s;

  int left_w = 0;
  int right_r = 0;
  rep(i, n) {
    if(s[i] == 'R') {
      right_r++;
    }
  }

  int ans = n;
  rep(border, n + 1) {
    int count = max(left_w, right_r);
    ans = min(ans, count);

    if(s[border] == 'R') {
      right_r--;
    } else {
      left_w++;
    }
  }

  cout << ans << endl;
}

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

void solve()
{
    ll n;
    cin >> n;
    ll a[n];
    map<ll, ll> m;
    for (ll i = 0; i < n; i++)
    {
        cin >> a[i];
        m[i - a[i]]++;
    }
    ll ans = 0;
    for (ll i = 0; i < n; i++)
    {
        m[i - a[i]]--;
        ans += m[i + a[i]];
    }
    cout << ans;
}

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

Measured memory_bytes: 27912
#include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
 
 int arr[100+5][100+5];

 int main()
 {
   int n,m;
   int sum;
   int sum_total=0;
   cin>>n>>m;
   for(int i=0;i<n;i++)
   {
     for(int j=0;j<m;j++)
     {
       cin>>arr[i][j];
       sum_total+=arr[i][j];        
     }        
   }
   for(int i=0;i<n;i++)
   {
     sum=0;
     for(int j=0;j<m;j++)
     {
       cout<<arr[i][j]<<" ";
       sum+=arr[i][j];        
     }          
     cout<<sum<<endl;
   }
   for(int j=0;j<m;j++)
   {
     sum=0;
     for(int i=0;i<n;i++)
     {
       sum+=arr[i][j];        
     }        
     cout<<sum<<" ";
   }
   cout<<sum_total<<endl;
   //while(1);
   return 0;
 }
 
 
 
 
 

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

// iterator
#define REP(i,from, to) for(lli i=from;i<to;i++)
#define REPE(i,from, to) for(lli i=from;i<=to;i++)
#define REP_R(i,from, to) for(lli i=from;i>to;i--)
#define REPE_R(i,from, to) for(lli i=from;i>=to;i--)
#define REPIT(it,container) for(auto it = container.begin(); it != container.end(); it++)
#define REPIT_R(it,container) for(auto it = container.rbegin(); it != container.rend(); it++)

// input
#define cin1(x)             cin >> x
#define cin2(x, y)          cin >> x >> y
#define cin3(x, y, z)       cin >> x >> y >> z
#define ncin1(n, x)         REP(i, 0, n) {cin1(x[i]);}
#define ncin2(n, x, y)      REP(i, 0, n) {cin2(x[i], y[i]);}
#define ncin3(n, x, y, z)   REP(i, 0, n) {cin3(x[i], y[i], z[i]);}

// output
#define cout1(x)         cout << #x << ": " << x << endl;
#define cout2(x, y)      cout << #x << ": " << x << ", " << #y << ": " << y << endl;
#define cout3(x, y, z)   cout << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << endl;;
#define ncout1(n, x)     REP(i, 0, n) {cout << #x << "[" << i << "]: "<< x[i] << endl;}

#define coutp(p)         cout << #p << ":" <<  " (" << p.first << ", " << p.second << ")" << endl;

// sort
#define sort_r(x, y)        sort(x, y, greater<lli>()); // 降順(5,4,3,,,)

#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

typedef long long int lli;
typedef pair<lli, lli> P;
typedef tuple<lli, lli, lli> tup;
typedef vector<lli> vlli;

int main() {
    lli n;
    cin1(n);

    string s;
    cin1(s);
    if (n % 2 == 1) {
        cout << "No" << endl;
        return 0;
    }

    REP(i,0,n/2) {
        lli j = i+n/2;
        if (s[i] != s[j]) {
            cout << "No" << endl;
            return 0;
        }

    }
            cout << "Yes" << endl;
            return 0;

}


Measured memory_bytes: 256
/***  بسم الله الرحمن ا لرحيم   ***/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
#define endl                         '\n'
#define Ceil(x,y)             ((x+y-1)/y)
#define sz(s)               (int)s.size()
#define RT(x)           return cout<<x,0;
#define mem(x,y)    memset(x,y,sizeof(x))
#define all(v) ((v).begin()), ((v).end())
#define watch(x) cout<<#x<<" = { "<<x<<" }\n"
#define test int t;cin>>t;while(t--)
const int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };
const int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
const double PI = acos(-1), EPS = 1e-7;
const int OO = 0x3f3f3f3f, N = 2e5 + 5, mod = 1e9 + 7;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll x, ll y) { return (!y) ? x : gcd(y, x % y); }
ll lcm(ll x, ll y) { return ((x / gcd(x, y)) * y); }
void file() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif  !ONLINEJUDGE
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

int n,m;
vector<vector<int>>g;
int vis[N];
int dfs(int u) {
	if (vis[u] == -1) {
		vis[u] = 0;
		for (auto t : g[u]) {
			vis[u] = max(vis[u], dfs(t) + 1);
		}
	}
	return vis[u];

}
void solve() {
	cin >> n >> m;
	g = vector<vector<int>>(n + 1);
	int x, y; 
	for (int i = 1; i <= m; i++) {
		cin >> x >> y;
		g[x].push_back(y);
	}
	mem(vis, -1);
	int mx = 0;
	for (int i = 1; i <= n; i++) {
		mx = max(mx, dfs(i));
	}
	cout << mx;

}
int main() {
	file();
   
      solve();
    

	return 0;
}

Measured memory_bytes: 11556
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		BoxesandCandies bc = new BoxesandCandies();
		bc.run();
	}
}

class BoxesandCandies {
	
	int N;
	long x;
	long[] nums;
	
	BoxesandCandies() {
		Scanner cin = new Scanner(System.in);
		this.N = cin.nextInt();
		this.x = cin.nextLong();
		this.nums = new long[N];
		for (int i = 0; i < N; i++) {
			nums[i] = cin.nextLong();
		}
	}
	
	void run() {
		long count = 0;
		long prev = nums[0];
		
		for (int i = 1; i < N; i++) {
			long next = nums[i];
			if (prev + next > x) {
				long sum = prev + next;
				long k = sum - x;
				count += k;
				nums[i] = Math.max(0, nums[i] - k);
			}
			prev = nums[i];
		}
		System.out.println(count);
	}
}


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

int main() {
int A,B,C;
string S;
cin>>S;

  if(S=="abc" || S=="acb" || S=="bac" || S=="bca" || S=="cab" || S=="cba") S="Yes";
  else S="No";
  cout<<S;
}

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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

typedef long long ll;

/* --- INFの値が適切か確認する --- */
// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
// const int MOD = 1000000007;

int a[100001], b[100001];

int main() {
  int n;
  cin >> n;
  rep(i, n) {
    int v;
    cin >> v;
    if (i % 2)
      a[v]++;
    else
      b[v]++;
  }
  vector<pii> aa, bb;
  rep(i, 100001) {
    if (a[i] != 0) aa.eb(mp(a[i], i));
    if (b[i] != 0) bb.eb(mp(b[i], i));
  }
  sort(rall(aa));
  sort(rall(bb));
  aa.eb(mp(0, 0));
  bb.eb(mp(0, 0));
  if (aa[0].S == bb[0].S) {
    cout << min(n / 2 - aa[0].F + n / 2 - bb[1].F,
                n / 2 - aa[1].F + n / 2 - bb[0].F)
         << endl;
  } else {
    cout << n / 2 - aa[0].F + n / 2 - bb[0].F << endl;
  }
}


Measured memory_bytes: 2044
import fractions

A, B, C, D = map(int, input().split())

lcm = C * D // fractions.gcd(C, D)

a = (A-1) // C + (A-1) // D - (A-1) // lcm
b = B // C + B // D - B // lcm

print(B - b -((A-1) - a))

Measured memory_bytes: 5048
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

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

const ll INF=1e9+7;

int main()
{
    ll n,m;
    cin >> n >> m;
    vector<ll> a(m);
    ll sum=0;
    rep(i,m){
        cin >> a[i];
        sum+=a[i];
    }
    ll ans=n-sum;
    if(ans>=0){
        cout << ans << endl;
    }
    else{
        cout << -1 << endl;
    }
    return 0;
} 


Measured memory_bytes: 3708
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<n; ++i)
#define all(x) begin(perm),end(perm)
#define showall(obj) for(auto x:obj)cout<<x<<endl;
typedef long long ll;
typedef pair<int,int> ip;
typedef pair<ll,ll> lp;
typedef vector<int> vint;
typedef vector<ll> vll;
const int inf = 100100100;
const ll INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

int main(){
    int a,b;
    cin>>a>>b;
    REP(i,10000){
        if(floor(i*0.08) == a&& floor(i*0.1)==b){cout<<i<<endl;return 0;}
    }
cout<<-1<<endl;return 0;


}


Measured memory_bytes: 256
W, H, N = gets.split.map(&:to_i)
xs = Array.new(N)
ys = Array.new(N)
as = Array.new(N)
N.times do |i|
  xs[i], ys[i], as[i] = gets.split.map(&:to_i)
end

x1, x2 = 0, W
y1, y2 = 0, H
N.times do |i|
  case as[i]
  when 1
    x1 = [x1, xs[i]].max
  when 2
    x2 = [x2, xs[i]].min
  when 3
    y1 = [y1, ys[i]].max
  when 4
    y2 = [y2, ys[i]].min
  end
end

puts [(x2 - x1), 0].max * [(y2 - y1), 0].max


Measured memory_bytes: 1788
#include <iostream>
#include <stdio.h>
#include <math.h> 
#include <algorithm>
#include <numeric>
#include <functional>
#include <vector>
#include <string>
#include <numeric>
#include <bitset>

using namespace std;
vector<int> vec;
vector<int> mid;
vector<int> ans;

int main() {

	int n, x;
	cin >> n >> x;

	for (int i = 0; i < n; ++i) {
		int tmp = 0;
		cin >> tmp;
		vec.push_back(tmp);
	}

	if (n == 1) {
		cout << abs(x - vec.at(0)) << endl;
		return 0;
	}

	vec.push_back(x);

	sort(vec.begin(), vec.end());

	//差分を取得
	for (int i = 0; i < vec.size()-1; ++i) {
		int tmp = 0;
		tmp = vec.at(i + 1) - vec.at(i);
		mid.push_back(tmp);
	}

	sort(mid.begin(), mid.end());

	//1から差分のvectorの要素で一番小さい値までで、全ての差分を割り切れる値で一番大きいものを探す
	for (int i = mid.at(0); i > 0; --i) {
		int cnt = 0;
		for (int j = 0; j < mid.size(); ++j) {
			if (mid.at(j) % i == 0) {
				cnt++;
			}
		}
		if (mid.size() == cnt) {
			cout << i << endl;
			return 0;
		}

	}

	return 0;
}

Measured memory_bytes: 1400
/*{{{*/
#include<bits/stdc++.h>

typedef long long ll;

#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define FORR(i,a,b) for(ll i=b-1;i>=a;i--)

#define vl vector<ll>
#define pll pair<ll,ll>

#define DEBUG(x) cout<<#x<<": "<<x<<endl

using namespace std;
/*}}}*/

int main() {
  ll n;
  cin >> n;
  ll ac = 0;
  ll wa = 0;
  ll tle = 0;
  ll re = 0;
  REP(i,n){
    string s;
    cin >> s;
    if(s=="AC") ac++;
    if(s=="WA") wa++;
    if(s=="TLE") tle++;
    if(s=="RE") re++;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;

  return 0;
}


Measured memory_bytes: 3632
#include<cstdio>
#include<queue>
#include<cstring>
#include<cmath>
using namespace std;
const int B = 300000+10;
const int N = 10000+10;
const int P = 26    +100;
char a[B];

int main()
{
    int num[P];
    while(scanf("%s",a)==1)
    {
        memset(num,0,sizeof num);
        int len=strlen(a);
        for(int i=0;i<len;i++)
        {
            num[a[i]-'a']++;

        }
        int pos=-1;
        for(int i=0;i<26;i++)
        {
            if(num[i]==0)
            {
                pos=i;
                break;
            }
        }

        if(pos==-1)
        {
            printf("None\n");
        }
        else
        {
            printf("%c\n",'a'+pos);
        }

    }
return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define H 500
  
int A[H],n;
  
int main(void){
  
  int k,p,l,r,i;
  
  scanf("%d",&n);
  
  for(i=1;i<=n;i++){
    scanf("%d",&A[i]);
  }
  
  for(i=1;i<=n;i++){
    k = A[i];
    p = A[i/2];
    l = A[2*i];
    r = A[(2*i)+1];
  
    printf("node %d: key = %d, ",i,k);
    if(p!=0 && i != 1) printf("parent key = %d, ",p);
    if(l!=0) printf("left key = %d, ",l);
    else{
      printf("\n");
      continue;
    }
    if(r!=0)  printf("right key = %d, ",r);
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define mod 1000000007
#define N 1000005
using namespace std;

typedef long long ll;

int n, a, b, c, d, f;
char s[N];

int main() {
	// freopen("in.txt", "r", stdin);
	// freopen("outt.txt", "w", stdout);
	scanf("%d %d %d %d %d %s",&n ,&a ,&b ,&c ,&d ,s + 1);
	for(int i = 2; i <= n; i++)
		if(s[i] == '#' and s[i - 1] == '#'){
			if( (i <= c and i >= a) or (i <= d and i >= b) ){
				puts("No");
				return 0;
			}
		}
	if(d < c){
		for(int i = b; i <= d; i++){
			if(s[i] == '#')
				continue;
			if(s[i - 1] != '#' and s[i + 1] != '#'){
				f = 1;
				break;
			}
		}
	}
	else
		f = 1;
	if(f)
		puts("Yes");
	else
		puts("No");
	return 0;
}

Measured memory_bytes: 384
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  myerr("-----start-----");
  var start = new Date();
  Main();
  var end = new Date() - start;
  myerr("----- end -----");
  myerr("time : " + (end) + "ms");
});
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
	var one = nextIntArray();
	var A = one[0];
	var B = one[1];
	var C = one[2];
	var K = one[3];
	var output = 0;
	if(A >= K){
		output += K;
		myout(output);
		return;
	}else{
		output += A;
		K -= A;
	}
	if(B >= K){
		myout(output);
		return;
	}else{
		K -= B;
	}
	output -= K;
	myout(output);
}


Measured memory_bytes: 30356
#include<iostream>
using namespace std;
int main(){
    int a;
    cin>>a;
    int b[100];
    for(int i=0;i<a;i++){
        cin>>b[i];
    }
    for(int i=a-1;i>0;i--){
        cout<<b[i]<<" ";
    }
    cout<<b[0]<<endl;
    return 0;
}


Measured memory_bytes: 3116
#include<iostream>
using namespace std;
int main()
{
  string s;
  string t;
  cin>>s;
  cin>>t;
  int x;
  x = s.size();
  if(t.substr(0,x)==s){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Measured memory_bytes: 3632
N, M = map(int, input().split())
*H, = map(int, input().split())
set_list = [[] for _ in range(N)]
import sys
input = sys.stdin.readline
for _ in range(M):
    A, B = map(int, input().rstrip().split())
    A -= 1
    B -= 1
    set_list[A].append(B)
    set_list[B].append(A)
ans = 0
for i in range(N):
    chk = True
    for j in set_list[i]:
        if H[i] > H[j]:
            continue
        else:
            chk = False
    if chk:
        ans += 1
print(ans)


Measured memory_bytes: 29524
#include <cstring>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <numeric>
#include <stack>

using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll half_inf = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);
typedef unordered_map<char, ll> ump;
typedef pair<ll, ll> P;

vector<string> s;
bool seen[400][400];
int h, w;
ll ans = 0;

void bfs(P idx) {
    ump mp;
    mp['#'] = mp['.'] = 0;
    queue<P> que;
    que.push(idx);
    seen[idx.first][idx.second] = true;
    mp[s[idx.first][idx.second]]++;

    while (!que.empty()) {
        P p = que.front();
        que.pop();
        char now = s[p.first][p.second];
        rep(i, 4) {
            ll nx = p.first + dx[i], ny = p.second + dy[i];

            if (0 <= nx && nx < h && 0 <= ny && ny < w && !seen[nx][ny]) {
                if (now != s[nx][ny]) {
                    que.push(P(nx, ny));
                    mp[s[nx][ny]]++;
                    seen[nx][ny] = true;
                }
            }
        }
    }
    ans += mp['#'] * mp['.'];
}

int main() {
#ifdef MY_DEBUG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-noreturn"
    while (true) {
#pragma clang diagnostic pop
#endif
        cin >> h >> w;
        s.resize(h);
        rep(i, h) cin >> s[i];
        rep(i, h) rep(j, w) seen[i][j] = false;
        rep(i, h) {
            rep (j, w) if (!seen[i][j]) bfs(P(i, j));
        }
        cout << ans << endl;


#ifdef MY_DEBUG
    }
#endif
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vc = vector<char>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
#define rep(i, n) for (ll i = 0; i < (n); i++)
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;}
#ifndef ONLINE_JUDGE
    #define debug(x) cerr << #x << ": " << x << endl;
#else
    #define debug(x)
#endif

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

    ll h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    ll t = 60*(h2-h1) + m2 - m1;
    ll ans = t - k;
    cout << ans << endl;
}


Measured memory_bytes: 3648