akhauriyash/Code-Regression huggingface dataset:
a,b,c=map(int,input().split())
k=int(input())
ans = "No"
for i in range(k+1):
	for j in range(k+1):
		for l in range(k+1):
			if i+j+l<=k:
				A = a*(2**i)
				B = b*(2**j)
				C = c*(2**l)
				if A< B and B< C: ans = "Yes"
				
print(ans)


Measured memory_bytes: 9180
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), m[] = new int[n],l[]=new int[n], c = 0;
        boolean[] t=new boolean[n];
        for (int i = 0; i < n; i++) {
            m[i] = sc.nextInt();
        }
        for(int i=0;i<n;i++)
            l[(i+m[i])%n]++;
        for(int i=0;i<n;i++) {
            int j=i;
            while(!t[j]&&l[j]==0) {
                t[j]=true;
                j=(j+m[j])%n;
                l[j]--;
            }
        }
        for(int i:l)
            c+=i>0?1:0;
        System.out.println(c);
    }
}



Measured memory_bytes: 69448
#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>
#include<cmath>
#include<string>
#include<bitset>
#include <sstream>
#include<queue>
#include<set>
#include<iomanip>
#define rep(i,n) for(ll i=0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef pair<int,ll>P;

int main()
{
    int l;
    cin>>l;
    double a=l/3.0;
    cout<<setprecision(9)<<a*a*a;
    
}

Measured memory_bytes: 256
import numpy as np
n,k = map(int,input().split())
p = list(map(int,input().split()))
p = np.array(p)
e = (p+1)/2
sum_e = []
sum_e.append(np.sum(e[:k]))
for i in range(n-k):
    sum_e.append(sum_e[-1]-e[i]+e[k+i])
print(max(sum_e))

Measured memory_bytes: 33992
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int N;
	ll A[200001],B[200001];
	scan(N);
	rep(i,N){
		scan(A[i]>>B[i]);
	}
	ll up=0;
	for(int i=N-1;i>=0;i--){
		ll diff=((A[i]+up)/B[i]+((A[i]+up)%B[i]!=0))*B[i]-(A[i]+up);
		up+=diff;
	}
	prin(up);
	return 0;
}


Measured memory_bytes: 3072
#include<bits/stdc++.h>
using ll=long long;
using namespace std;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(ll i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
template<class T> inline bool chmin(T& a, T b) {if(a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if(a < b) {a = b; return true;} return false;}

int main(){
  int n,k;
  cin>>n>>k;
  vector<int>x(n);
  int dist=0;
  rep(i,n){cin>>x[i];
    if(k>2*x[i])dist+=x[i];
    else dist+=k-x[i];
  }
  cout<<2*dist<<endl;
    
    
  return 0;
}


Measured memory_bytes: 3592
from collections import namedtuple

Task = namedtuple('Task', 'name time')

class Queue:
    def __init__(self, n):
        self.n = n
        self._l = [None for _ in range(self.n + 1)]
        self._head = 0
        self._tail = 0

    def enqueue(self, x):
        if self.isFull():
            raise IndexError("queue is full")
        self._l[self._tail] = x
        self._tail += 1
        if self._tail > self.n:
            self._tail = 0

    def dequeue(self):
        if self.isEmpty():
            raise IndexError("pop from empty queue")
        e = self._l[self._head]
        self._l[self._head] = None
        self._head += 1
        if self._head > self.n:
            self._head = 0
        return e

    def isEmpty(self):
        return self._head == self._tail

    def isFull(self):
        return self._head == (self._tail + 1) % (self.n + 1)

if __name__ == '__main__':
    n, q = map(int, input().split())
    queue = Queue(n)
    for _ in range(n):
        name, time = input().split()
        time = int(time)
        queue.enqueue(Task(name=name, time=time))

    now = 0
    while not queue.isEmpty():
        task = queue.dequeue()
        t = task.time
        if t <= q:
            now += t
            print(task.name, now)
        else:
            now += q
            queue.enqueue(Task(task.name, t - q))



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



int main() {
	int N;

	int X = 0;

	cin >> N;

	X = N / 1.08;

	if (X*1.08 == N) {
		cout << X;
	}
	else if (int((X + 1)*1.08) == N) {
		cout << X + 1;
	}
	else if (int((X - 1)*1.08) == N) {
		cout << X - 1;
	}
	else {
		cout << ":(";
	}
}

Measured memory_bytes: 256
#include <iostream>
#define llint long long

using namespace std;

llint N;
llint a[10005], b[10005];

int main(void)
{
	cin >> N;
	for(int i = 1; i <= N; i++) cin >> a[i];
	for(int i = 1; i <= N; i++) cin >> b[i];
	
	llint lcnt = 0, ucnt = 0;
	for(int i = 1; i <= N; i++){
		if(a[i] > b[i]) lcnt += a[i] - b[i];
		if(a[i] < b[i]) ucnt += (b[i] - a[i]) / 2;
	}
	
	if(ucnt >= lcnt) cout << "Yes" << endl;
	else cout << "No" << endl;
	
	return 0;
}

Measured memory_bytes: 384
def parallel?(x1, y1, x2, y2, x3, y3, x4, y4)
    a1 = (y2 - y1) / (x2 - x1) rescue Float::INFINITY
    a2 = (y4 - y3) / (x4 - x3) rescue Float::INFINITY
    return a1 == a2
end
 
$<.gets.to_i.times do
    puts parallel?(*$<.gets.split.map(&:to_r)) ? 'YES' : 'NO'
end

Measured memory_bytes: 6140
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

class Prime {
    vector<int> prime;
    vector<int> D;
    int N;

public:
    Prime(int N) : N(N), D(N + 1) {
        for (ll i = 2; i <= N; ++i) {
            if (D[i] == 0) {
                D[i] = i;
                prime.emplace_back(i);
            }
            for (auto &p : prime) {
                if (p > D[i] || i * p > N) break;
                D[i * p] = p;
            }
        }
    }
    vector<P> fact(int n) {
        vector<P> f;
        while (n > 1) {
            if (f.empty() || f.back().first != D[n]) {
                f.emplace_back(D[n], 1);
            } else {
                f.back().second++;
            }
            n /= D[n];
        }
        return f;
    }
    vector<int> get() { return prime; }
    bool is_prime(int n) { return n >= 2 && n == D[n]; }
};

class Main {
    int N;
    vector<int> A;
    ll gcd(ll a, ll b) { return a ? gcd(b % a, a) : b; }
    void input() {
        cin >> N;
        A.resize(N);
        REP(i, N) { cin >> A[i]; }
    }
    void output() {
        ll g = A[0];
        REP(i, N - 1) { g = gcd(g, A[i + 1]); }
        if (g > 1) {
            cout << "not coprime" << endl;
            return;
        }
        set<ll> st;
        Prime prime(1000000);
        REP(i, N) {
            auto f = prime.fact(A[i]);
            for (auto &p : f) {
                if (st.count(p.first)) {
                    cout << "setwise coprime" << endl;
                    return;
                }
                st.emplace(p.first);
            }
        }
        cout << "pairwise coprime" << endl;
    }

public:
    Main() {
        input();
        output();
    }
};

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

    Main();

    return 0;
}


Measured memory_bytes: 11668
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define int ll
#define upto(a, b, i) for(int i = (a),b_ =(b); i <= b_; ++i)
#define uptil(a, b, i) for(int i = (a),b_ =(b); i < b_; ++i)
#define downto(a, b, i) for(int i = (a),b_ =(b); i >= b_; --i)
#define downtil(a, b, i) for(int i = (a),b_ =(b); i > b_; --i)
#define times(n, i) uptil(0, (n), i)
#define rtimes(n, i) downto((n) - 1,0, i)
#define size(a) ((int)(a).size())
#define ln << endl
#define sp << " "

template<class T> using vec = vector<T>;
template<class T> using vvec = vec<vec<T>>;

void solve() {
  int X, A; cin >> X >> A;
  cout << (X < A ? 0 :10);
}

signed main() {
  cout << fixed << setprecision(20);
  cerr << fixed << setprecision(6);
  solve();
  return 0;
}


Measured memory_bytes: 256
# coding: utf-8
# Your code here!

import numpy as np
li=np.array(list(map(int,list(input()))))
wa=[
   [1,1,1,1],
   [1,1,1,-1],
   [1,1,-1,1],
   [1,1,-1,-1],
   [1,-1,1,1],
   [1,-1,1,-1],
   [1,-1,-1,1],
   [1,-1,-1,-1],
   [-1,1,1,1],
   [-1,1,1,-1],
   [-1,1,-1,1],
   [-1,1,-1,-1],
   [-1,-1,1,1],
   [-1,-1,1,-1],
   [-1,-1,-1,1],
   [-1,-1,-1,-1],
  ]
wa=np.array(wa)
for w in wa:
  if np.dot(w,li)==7:
    isfirst=True
    for p,i in zip(w,range(4)):
        if isfirst:
            print(li[0],end='')
            isfirst=False
            continue
        if p >0:
            print('+',end=str(li[i]))
        else:
            print('-',end=str(li[i]))
    print('=7')
    quit()


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

using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define REP(NAME, NUM) for (int NAME = 0; NAME < (NUM); ++NAME)
#define BREP(NAME, NUM) for (int NAME = (NUM)-1; NAME >= 0; --NAME)
#define VEC(TYPE, A, NAME, INIT) vector<TYPE> NAME(A, INIT)
#define VEC2(TYPE, A, B, NAME, INIT) vector<vector<TYPE>> NAME(A, vector<TYPE>(B, (INIT)))

VEC( bool, 100010, b, false );
ll kindN = 0;
struct st
{
    ll t = 0;
    ll d = 0;
};
bool operator>(const st& l, const st& r)
{
    return l.d > r.d;
}
VEC( st, 0, stary, st() );
VEC( st, 0, que, st() );

int main()
{
    int n, k;
    cin >> n >> k;
    stary.assign( n, st() );
    REP(i,n) cin >> stary[i].t >> stary[i].d;
    sort( stary.begin(), stary.end(), greater<st>() );

    ll maxS = 0;
    REP( i, k )
    {
        if( !b[stary[i].t] )
        {
            b[stary[i].t] = true;
            kindN++;
        }
        else
        {
            que.push_back( stary[i] );
        }
        maxS += stary[i].d;
    }
    maxS += kindN * kindN;
    ll prev = maxS;
    for( int i= k; i < n; ++i )
    {
        if( kindN == k ) break;
        if( b[stary[i].t] ) continue;
        b[stary[i].t] = true;

        prev -= que[que.size()-1].d;
        prev += stary[i].d;
        que.pop_back();
        prev += 2 * kindN + 1;
        kindN++;
        maxS = max( maxS, prev );
    }
    
    cout << maxS << endl;

    return 0;
}

Measured memory_bytes: 2940
def main():
  N = int(input())

  ## 証言を入れる
  p = [[] for _ in range(N)]

  ans = 0

  for i in range(N):
    A = int(input())

    for j in range(A):
      p[i].append(list(map(int, input().split())))

  for i in range(1 << N):
    d = [0] * N

    for j in range(N):
      # 0-indexedで考える
      # 下i桁目を0桁目に持ってきて1と&をとると、i番目の人が正直者のフラグが立っているかどうかが判定できる
      if(i >> j & 1):
        d[j] = 1

    ok = True
    
    for j, _ in enumerate(p):
      #j人目の証言について確認する
      #j人目に正直者フラグが立っていた時だけ確認すれば良い
      if(d[j]):

        for k, _ in enumerate(p[j]):
          x, y = p[j][k]
          x -= 1
          if(d[x] != y):
            ok = False

    if(ok):
      # あり得る人数を知りたいので条件をパスしたものでbitの1が立っている箇所を調べる
      ans = max(ans, bin(i).count("1"))

  print(ans)

if __name__ == "__main__":
    main()

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++) 
#define SORT(a) sort((a).begin(),(a).end())
#define REV(a) reverse((a).begin(),(a).end())
#define co(a) cout<<a<<endl;
using namespace std;
using ll = long long;


int main() {
  int t, x; cin >> t >> x;
  double ans;
  co(double(t) / x)
}

Measured memory_bytes: 256
//#include "stdafx.h"
#include<bits/stdc++.h> 
#include<iostream>
#include<queue>
#include<string>
using namespace std;
int  a,b;
int main()
{
	cin>>a>>b;
	if((a+b)%3==0||a%3==0||b%3==0)
		cout<<"Possible\n";
	else
		cout<<"Impossible\n";


	return 0;
}



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

int main(void){
	string str;
	string pe="peach", ap="apple";
	string::size_type pos,pos_pe,pos_ap;
	string::size_type head;
	
	getline(cin, str);

	head = 0;
	while(1){
		pos_pe = str.find(pe,head);
		pos_ap = str.find(ap,head);
		if(pos_pe==pos_ap) break;

		if(pos_pe < pos_ap || pos_ap==NULL){
			str.replace(pos_pe, pe.size(), ap);
			head = pos_pe + pe.size();
		}else{
			str.replace(pos_ap, ap.size(), pe);
			head = pos_ap + ap.size();
		}
	}
	
	cout << str << endl;


	return 0;
}

Measured memory_bytes: 1184
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x)          (x).begin(), (x).end()
#define rep(i, s, n)    for (i64 i = (s), i##_limit = (n); i < i##_limit; ++i)
#define repr(i, s, t)   for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#define var(type, ...)  type __VA_ARGS__; read(__VA_ARGS__);
#ifndef DBG
#define dump(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U> inline bool chmax(T &a, const U &b) { return b > a && (a = b, true); }
template <class T, class U> inline bool chmin(T &a, const U &b) { return b < a && (a = b, true); }
constexpr int INF  = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template <class T>
inline vector<T> makeV(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}

template <class T, class... Args>
inline auto makeV(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(makeV<T>(initValue, args...))>(sz, makeV<T>(initValue, args...));
}

template <class T>
inline istream& operator>> (istream &is, vector<T> &vec) {
    for (auto &e : vec) is >> e;
    return is;
}

inline void read() {}

template <class Head, class... Tail>
inline void read(Head &head, Tail&... tail) { cin >> head; read(tail...); }

inline void print() { cout << "\n"; }

template <class Head, class... Tail>
inline void print(Head &&head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail)) cout << ' ';
    print(forward<Tail>(tail)...);
}

template <class T>
inline ostream& operator<< (ostream &os, const vector<T> &vec) {
    static constexpr const char *delim[] = { " ", "" };
    for (const auto &e : vec) os << e << delim[&e == &vec.back()];
    return os;
}

template <class Container>
struct Rev {
    Container &x_;
    inline Rev(Container &x): x_(x) {}
    inline auto begin() { return rbegin(x_); }
    inline auto end() { return rend(x_); }
};
// }}} End Header

signed main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr);

    var(i64, N, K);
    const int L = N - 2;
    vector<i64> cnt(11);

    rep(i, 0, 11) {
        for (int j = 2; j < 7; ++j) {
            cnt[9 * (7*(i+2) + j - 7) % 11] += 1;
        }
    }

    i64 ans = (L / 11) * cnt[K];

    for (i64 i = 11 * (L / 11) + 2; i < N; ++i) {
        for (int j = 2; j < 7; ++j) {
            if (9 * (7 * i + j - 7) % 11 == K) ++ans;
        }
    }

    print(ans);

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long int LL;
typedef unsigned long long int ULL;
using namespace std;

// 插入此處
namespace Number {
    typedef long long int LL;
    // 求取 a, b 的最大公因數
    LL gcd(LL a, LL b) {
        if (a % b == 0) {
            return b;
        }
        return gcd(b, a % b);
    }
    // 求取 a, b 的最大公因數 gcd
    // 以及 x, y 使得 a*x + b*y = gcd
    LL gcd_extend(LL a, LL b, LL *x, LL *y) { 
        if (a == 0) { 
            *x = 0, *y = 1; 
            return b; 
        } 
    
        LL x1, y1; // To store results of recursive call 
        LL gcd = gcd_extend(b%a, a, &x1, &y1); 
    
        *x = y1 - (b/a) * x1; 
        *y = x1; 
    
        return gcd; 
    }
    // 求 a_inv 使得 (a * a_inv) % m = gcd(a, m)
    // 若 a, m 互質，即求 a 在 mod m 群的反元素 a_inv 
    LL mod_inv(LL a, LL m) { 
        LL x, y; 
        LL g = gcd_extend(a, m, &x, &y); 
        // 處理 x 爲負的情形 
        LL a_inv = (x%m + m) % m; 
        return a_inv;
    }
    // 求 x^n % m
    LL mod_pow(LL x, LL n, LL m) {
        if (n == 0) {
            return 1;
        } else if (n & 1) {
            LL half = mod_pow(x, n/2, m);
            return (half * half % m) * x % m;
        } else {
            LL half = mod_pow(x, n/2, m);
            return half * half % m;
        }
    }
    // 連乘
    LL mul(LL from, LL to, LL m) {
        LL ret = 1;
        for (LL i = from; i <= to; i++) {
            ret *= i;
            ret %= m;
        }
        return ret;
    }
    // 求 (C n 取 k) % m
    LL mod_comb(LL n, LL k, LL m) {
        LL mi = k < n-k ? k : n-k;
        LL up = mul(n - mi + 1, n, m);
        LL down = mul(1, mi, m);
        return (up * mod_inv(down, m)) % m;
    }
}

const int MOD = 1e9+7;

int main() {
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    int H, W, A, B; cin >> H >> W >> A >> B;
    int hh = H-A+1, ww = B;
    LL ans = Number::mod_comb(H+W-2, H-1, MOD);
    LL res = Number::mod_comb(hh+ww-2, hh-1, MOD) * Number::mod_comb(H+W-hh-ww, H-hh, MOD) % MOD;
    while (hh <= H && ww >= 1) {
        ans = (ans - res + MOD) % MOD;
        res = (res * (ww-1) % MOD) * Number::mod_inv(hh, MOD) % MOD;
        res = (res * (H-hh) % MOD) * Number::mod_inv(W-ww+1, MOD) % MOD;
        --ww;
        ++hh;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 896
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    string s;
    int a[26] = {};
    while (getline(cin, s) && !s.empty()){
        REP(i,s.length()){
            if (s[i] >= 'A' && s[i] <= 'Z')
                a[s[i]-'A']++;
            else if (s[i] >= 'a' && s[i] <= 'z')
                a[s[i]-'a']++;
        }
    }
    REP(i,26){
        printf("%c : %d\n", i+'a', a[i]);
    }
    return 0;
}

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

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define ALL(x) x.begin(),x.end()
#define EPS (1e-8)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

typedef long long ll;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;

inline bool LT(double a,double b) { return !equals(a,b) && a < b; }
inline bool LTE(double a,double b) { return equals(a,b) || a < b; }

void compute() {

}

int sum[1000101];
int main() {
  string s;
  cin >> s;
  int n = s.size();
  rep(i,n) {
    if( s[i] == 'g' ) {
      ++sum[i];
    } else {
      --sum[i];
    }
  }
  REP(i,1,n) {
    sum[i] += sum[i-1];
  }
  int score = 0, rem = sum[n-1] - 1;
  for(int i=n-1;i>=0;--i) {
    if( s[i] == 'g' && rem > 0 ) {
      rem -= 2;
      ++score;
    }
  }
  cout << score << endl;
  compute();
  return 0;
}


Measured memory_bytes: 896
n,a,b,c,d = map(int,input().split())
s = '.'+input()
i=a
f = True
while i<c:
    if s[i+1]=='.':
        i += 1
    elif i<c-1 and s[i+2]=='.':
        i += 2
    else:
        f = False
        break
i = b
ok = False
while i<d:
    if s[i-1:i+2]=='...':
        ok = True
    if s[i+1]=='.':
        i += 1
    elif i<d-1 and s[i+2]=='.':
        i += 2
    else:
        f = False
        break
if d<n and s[d-1:d+2]=='...':ok=True
if d<c and not ok:f=False
print('Yes' if f else 'No')

Measured memory_bytes: 40816
#include <iostream>
using namespace std;
int main(void){
    int N, i,  AC, WA, TLE, RE;
    string a;
    AC = 0;
    WA = 0;
    TLE = 0;
    RE = 0;
    
    cin >> N;
    for(i = 1; i <= N; i++){
        cin >> a;
        if(a == "AC"){
            AC = AC + 1;
        }
        else if(a == "WA"){
            WA  = WA + 1;
        }
        else if(a == "TLE"){
            TLE = TLE + 1;
        }
        else if(a == "RE"){
            RE = RE + 1;
        }
    }
 
    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: 3636
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <ctime>
#include <complex>
#include <cassert>
#include <array>
#include <bitset> 
#include <unordered_map>
#include <random>

using namespace std;
typedef long long LL;
typedef array<LL,3> A;

const int L=1e5+1;
LL xs[L];
LL ys[L];
A ps[L];
int rp[L];
A qs[L];
int rq[L];
LL d;
int N;
int Find(int i,int *r){
	while(r[i]!=i){
		i=r[i]=r[r[i]];
	}
	return i;
}
void f(int i){
	int p=xs[i]+ys[i];
	int q=xs[i]-ys[i];
	int j=lower_bound(ps,ps+N,A{{p,q,i}})-ps;
	rp[j]++;
	j=lower_bound(qs,qs+N,A{{q,p,i}})-qs;
	rq[j]++;
	//cerr << "f " << i+1 << endl;
}
int main() {
	int a,b;
	scanf("%d%d%d",&N,&a,&b);
	a--;b--;
	for(int i=0;i<N;i++){
		scanf("%lld%lld",xs+i,ys+i);
		ps[i]=A{{xs[i]+ys[i],xs[i]-ys[i],i}};
		qs[i]=A{{xs[i]-ys[i],xs[i]+ys[i],i}};
		rp[i]=i;
		rq[i]=i;
	}
	rp[N]=rq[N]=N;
	d=max(abs(ps[a][0]-ps[b][0]),abs(qs[a][0]-qs[b][0]));
	sort(ps,ps+N);
	sort(qs,qs+N);
	stack<int> st;
	f(a);
	st.push(a);
	f(b);
	st.push(b);
	LL ret=0;
	while(st.size()){
		int t=st.top();
		st.pop();
		int p=xs[t]+ys[t];
		int q=xs[t]-ys[t];
		//cerr << t+1 << endl;
		auto i=lower_bound(ps,ps+N,A{{p-d,q-d,0}})-ps;
		ret+=lower_bound(ps,ps+N,A{{p-d,q+d,N}})-ps-i;
		i=Find(i,rp);
		while(i<N&&ps[i]<A{{p-d,q+d,N}}){
			int j=ps[i][2];
			st.push(j);
			f(j);
			i=Find(i,rp);
		}
		i=lower_bound(ps,ps+N,A{{p+d,q-d,0}})-ps;
		ret+=lower_bound(ps,ps+N,A{{p+d,q+d,N}})-ps-i;
		i=Find(i,rp);
		while(i<N&&ps[i]<A{{p+d,q+d,N}}){
			int j=ps[i][2];
			st.push(j);
			f(j);
			i=Find(i,rp);
		}
		i=lower_bound(qs,qs+N,A{{q-d,p-d+1,0}})-qs;
		ret+=lower_bound(qs,qs+N,A{{q-d,p+d-1,N}})-qs-i;
		i=Find(i,rq);
		while(i<N&&qs[i]<A{{q-d,p+d-1,N}}){
			int j=qs[i][2];
			st.push(j);
			f(j);
			i=Find(i,rq);
		}
		i=lower_bound(qs,qs+N,A{{q+d,p-d+1,0}})-qs;
		ret+=lower_bound(qs,qs+N,A{{q+d,p+d-1,N}})-qs-i;
		i=Find(i,rq);
		while(i<N&&qs[i]<A{{q+d,p+d-1,N}}){
			int j=qs[i][2];
			st.push(j);
			f(j);
			i=Find(i,rq);
		}
	}
	printf("%lld\n",ret/2);

	return 0;
}



Measured memory_bytes: 7680
#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair
#define mod 1000000007

using namespace std;

ll x[2002];
bitset<2001*2001+100>st;
int main()  {
    int n,k=0,xx=0;

    cin>>n;
    st[0] = 1;
    int res = 1;
    for(int i=0 ;i <n; i ++){
        scanf("%I64d",&x[i]);
        xx += x[i];
        st |=st<<x[i];
    }


    for(int i=0 ;i < 2001*2001+100 ; i++){
        if(st.test(i) && i>=xx-i){
            res = i;
            break;
        }
    }
    cout<<res;
    return 0;
}


Measured memory_bytes: 1664
//30
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
  int a[4001]={};
  for(int i=0;i<=1000;i++){
    for(int j=0;j<=1000;j++){
      a[i+j]++;
    }
  }
  for(int n;cin>>n;){
    int r=0;
    for(int i=0;i<=1000;i++){
      for(int j=0;j<=1000;j++){
	if(n-i-j>=0){
	  r+=a[n-i-j];
	}
      }
    }
    cout<<r<<endl;
  }
  return 0;
}

Measured memory_bytes: 1184
#define _CRT_SECURE_NO_DEPRECATE
//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <unordered_set>
#include <unordered_map>
using namespace std;
#define ll  long long int 
 
int main() {
	//freopen("test.txt", "r", stdin);
	string s; cin>>s;
	int n=s.size();
	if(n<6) cout<<"No"<<endl;
	else{
		if(s[2]==s[3] && s[4]==s[5]) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>

#define FASTIO

#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif

typedef long long ll;
typedef long long llong;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;


/*
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
*/

ll cnt[2];

int was[120000];

int cl[120000];
int n, m;
vector<int> eds[120000];

int dfs1(int v, int c) {
	++cnt[c];
	was[v] = 1;
	cl[v] = c;
	for (int u: eds[v]) {
		if (was[u]) {
			if (cl[u] != (c ^ 1))
				return 0;
		}
		else {
			if (!dfs1(u, c ^ 1))
				return 0;
		}
	}
	return 1;
}

int main() {
#ifdef FASTIO
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#endif
	cin >> n >> m;
	for (int i = 0; i < m; ++i) {
		int a, b;
		cin >> a >> b;
		--a, --b;
		eds[a].push_back(b);
		eds[b].push_back(a);
	}
	if (dfs1(0, 0)) {
		cout << cnt[0] * cnt[1] - m << "\n";
	}
	else {
		cout << ll(n) * (n - 1) / 2 - m << "\n";
	}
	return 0;
}




Measured memory_bytes: 7168
#include <bits/stdc++.h>
using namespace std;
int main(void){
    string s;
    cin>>s;
    string t="CODEFESTIVAL2016";
    int count=0;
    for (int i=0;i<s.size();i++) {
        if (s[i]!=t[i]) {
            count++;
        }
    }
    cout<<count<<endl;
}

Measured memory_bytes: 3580
#include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;

#define ill pair<int, long long >
#define ff first // Weight
#define ss second // Value

long long temp[109][100009];

int main() {
  int i, j;
  int n, W, w;
  long long v;

  vector<ill > ob;

  scanf("%d %d", &n, &W);
  for(i = 0; i < n; i++) {
    scanf("%d %lld", &w, &v);
    ob.push_back(make_pair(w, v));
  }

  for(i = 1; i <= n; i++) { // n
    for(j = 1; j <= W; j++) { // weight
      if(ob[i - 1].ff > j) temp[i][j] = temp[i - 1][j];
      else (temp[i - 1][j] > ob[i - 1].ss + temp[i - 1][j - ob[i - 1].ff]) ? temp[i][j] = temp[i - 1][j] : temp[i][j] = ob[i - 1].ss + temp[i - 1][j - ob[i - 1].ff];
    }
  }

  printf("%lld", temp[n][W]);
  return 0;
}


Measured memory_bytes: 79360
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
using namespace std; 
int main(){
  int R,W,C,r;
  while(cin>>R>>W>>C>>r,R!=0){
    if(W*C<=R){
      cout<<0<<endl;
    }else{
      for(int i=1;;i++){
	int a=R+r*i;
	if(C*W<=a){
	  cout<<i<<endl;
	  break;
	}
      }
    }
  }


  return 0;
}

Measured memory_bytes: 3028
#include <stdio.h>

int main(void)
{
    int a,b,c,d;
    scanf("%d", &a);
    b=a/3600;
    c=(a-b*3600)/60;
    d=a-b*3600-c*60;
    printf("%d:%d:%d\n",b,c,d);
    return 0;
}

Measured memory_bytes: 592
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#define rep(i,n) for (int i=0; i<n;++i)
#define rep_down(i,n) for (int i=n-1; i>=0;--i)
#define ALL(a)  (a).begin(),(a).end()
typedef long long ll;
using namespace std;
const int INF = 1000000007;
int H, W;
char S[52][52];
int MinCnt[52][52];
typedef pair<int, int> P; // 座標と最短到達マス
queue<P> que;
int dh[4] = {1,0,-1,0}, dw[4] = {0, 1, 0, -1};

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

  cin >> H >> W;
  int b_cnt = 0;
  rep(i, H){
    rep(j, W){
      cin >> S[i][j];
      MinCnt[i][j] = INF;
      if (S[i][j] == '#') b_cnt++;
    }
  }
  MinCnt[0][0] = 0;
  que.push(P(0, 0));
  while(!que.empty()){
    P p = que.front(); que.pop();
    int ph = p.first, pw = p.second;
    if (ph == H-1 && pw == W-1) continue;
    
    rep(i, 4){
      int nh = ph + dh[i], nw = pw + dw[i];
      if ((nh<0) || (nh>=H) || (nw<0) || (nw>=W)) continue;
      if (S[nh][nw]=='#') continue;
      if (MinCnt[nh][nw] <= MinCnt[ph][pw] + 1) continue;
      P nxt = make_pair(nh, nw);
      MinCnt[nh][nw] = MinCnt[ph][pw] + 1;
      que.push(nxt);
    }
  }

  int goalCnt = MinCnt[H-1][W-1];
  if (goalCnt == INF) {
    cout << -1 << "\n";
    return 0;
  }

  cout << H*W-goalCnt-b_cnt-1 << "\n";
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n,N) for(int i=(n);i<(int) N;i++)
#define RREP(i,n,N) for(int i=N-1;i>=(int) n;i--)
#define p(s) cout<<(s)<<endl
#define DEBUG(x,y) cout<<#x<<": "<<x<<" , "<<#y<<": "<<y<<endl;
#define CK(n,a,b) ((a)<=(n)&&(n)<(b))
#define F first
#define S second
typedef long long ll;
using namespace std;
const int inf=1e9;

int field[110][110];
int a[11000];

int main(){
	int H,W,N;
	cin>>H>>W>>N;
	REP(i,0,N){
		cin>>a[i];
	}
	int nw=0,nh=0;
	int inc=1;
	REP(i,0,N){
		while(a[i]>0){
			field[nh][nw]=i+1;
			if((0<nw&&inc==-1)||(inc==1&&nw<W-1)){
				nw+=inc;
			}else{
				nh++;
				inc=-inc;
			}
			a[i]--;
		}
	}
	REP(i,0,H){
		REP(j,0,W){
			cout<<field[i][j];
			if(j<W-1) cout<<" ";
		}
		cout<<endl;
	}
	return 0;
}


Measured memory_bytes: 384
import os
import sys
import math
if os.environ.get("DEBUG") is not None:
    sys.stdin = open("in.txt", "r")
rl = sys.stdin.readline

a, b = map(int, rl().split())
s = rl().rstrip("\n")

failed = False
for i in range(0, a):
    if not 48 <= ord(s[i]) <= 57:
        failed = True
        break
if s[a] != "-":
    failed = True
for i in range(a + 1, len(s)):
    if not 48 <= ord(s[i]) <= 57:
        failed = True
        break
print("No" if failed else "Yes")

Measured memory_bytes: 9176
#include <string.h>
#include <algorithm>
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>

#ifndef U_L_LONG
typedef unsigned long long U_L_LONG;
#endif
#ifndef L_LONG
typedef long long L_LONG;
#endif


static void D_XorWorld();

int main()
{

	D_XorWorld();

	fflush(stdout);
	return 0;
}

//	https://atcoder.jp/contests/abc121/tasks/abc121_d
//
static void D_XorWorld()
{
	U_L_LONG AB[2] = { 0 };

	scanf(" %llu %llu", &AB[0], &AB[1]);

	//
	//	https://img.atcoder.jp/abc121/editorial.pdf#page=5
	//
	//	排他的論理和は，計算順序を交換可能
	//	x ^ x = 0から
	//	f(A, B) = f(0, A-1) ^ f(0, B)
	//
	//	また任意の偶数 n について，n ^ (n + 1) = 1
	//	
	//	

	U_L_LONG fab[2] = { 0 };
	AB[0]--;	//	1引いておく
	for (int i = 0; i < 2; i++) {
		U_L_LONG evenPairs = AB[i] >> 1;
		U_L_LONG isOdd = AB[i] % 2;

		if (isOdd) {
			evenPairs++;
			if (evenPairs % 2) {
				fab[i] = 1;
			}
		}
		else {
			if (evenPairs % 2) {
				fab[i] = 1;
			}
			fab[i] ^= AB[i];
		}
	}

	printf("%llu\n", fab[0] ^ fab[1]);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define INF_LL 1LL << 39
#define INF 100000000
#define MOD 1000000007LL
#define ll long long
#define all(x) x.begin(), x.end()
#define REP(i, a, b) for(int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
#define prique priority_queue
#define PI acos(-1)
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<P> vp;
typedef vector<ll> vl;
typedef vector<vector<int>> matrix;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int sign[2] = {1, -1};
template <class T> bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}
struct edge {
    int to, cost;
};

ll dp[202][100010];

signed main() {
    int n, x;
    cin >> n >> x;
    vi s(n);
    rep(i, n) cin >> s[i];
    sort(all(s), greater<int>());
    dp[0][x] = 1;
    rep(i, n) REP(j, 0, x + 1) {
        dp[i + 1][j % s[i]] += dp[i][j];
        dp[i + 1][j] += dp[i][j] * (n - i - 1);
        dp[i + 1][j] %= MOD;
    }
    // rep(i, n + 1) {
    //     rep(j, x + 1) cout << dp[i][j] << " ";
    //     cout << endl;
    // }
    ll res = 0;
    REP(i, 1, x + 1) {
        res += dp[n][i] * i;
        res %= MOD;
    }
    cout << res << endl;
}


Measured memory_bytes: 157184
#include <iostream>
#include <bits/stdc++.h>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <map>
#include <iterator>
#include <iomanip>
#include <queue>
#include <utility>

using namespace std;
#define ll long long int
#define c(x) ll x;cin>>x
#define cc(x,y) ll x,y;cin>>x>>y
#define ccc(x,y,z) ll x,y,z; cin>>x>>y>>z
#define db long double
#define fast cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(false)
#define inf 200000000000000
#define mod 1000000007
#define eps 1e-7
#define PI 3.1415926535897932385
#define pb push_back
#define bitc  __builtin_popcountll
#define mp make_pair
#define ff first
#define ss second
#define all(ar) ar.begin(), ar.end()
#define len(x) (ll)(x).size()
#define fr(i,a,b) for (ll i = (a), _b = (b); i <= _b; i++)
#define rep(i,n) for (ll i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (ll i = n - 1; i >= 0; i--)
#define frr(i,a,b) for (ll i = (a), _b = (b); i >= _b; i--)
#define foreach(it,ar) for (auto it = ar.begin(); it != ar.end(); it++)
#define fill(ar,val) memset(ar, val, sizeof(ar))
#define print(arr,n) rep(i,n) cout<<arr[i]<<" "; cout<<endl
#define print2(arr,n,m) rep(i,n){ rep(j,m) cout<<arr[i][j]<<" "; cout<<endl; }
#define dyn1(arr,n) ll* arr=new ll[n]; rep(i,n) arr[i]=0;
#define dyn2(arr,n,m) ll** arr=new ll*[(n)]; rep(i,n) arr[i]=new ll[m]; rep(i,n) rep(j,m) arr[i][j]=0
#define carr(arr,n) rep(i,n) cin>>arr[i]
#define carr2(arr,n,m) rep(i,n) rep(j,m) cin>>arr[i][j]
#define debug(a) cout<<" :: "<<#a<<" == "<<a<<endl



inline ll maxim(ll a,ll b) {if(a>b) return a; else return b;}
inline ll minim(ll a,ll b) {if(a<b) return a; else return b;}
inline bool equals(double a, double b){ return fabs(a - b) < 1e-9; }
ll gcd(ll a, ll b){ return b==0 ? a : gcd(b, a%b); }
ll modpow(ll b, ll e) {
ll ans=1; for(;e;b=b*b%mod,e/=2) if(e&1) ans=ans*b%mod; return ans;}


/*
ll ncr(ll n,ll r)
{
  if(r>n) return 0;
  if((n==r)||(r==0))
  {
    return 1;
  }
  if(r==1) return n;
  if(r>n-r)
  {
    r=n-r;
  }

  string key=to_string(n)+"|"+to_string(r);
  if(m.find(key)==m.end())
  {
    ll answer=ncr(n-1,r-1)+ncr(n-1,r);
    m[key]=answer;
  }
  //cout<<key<<" "<<m[key]<<endl;
  return m[key];
}*/


/*
int modInverse(int a, int m)
{
    int m0 = m;
    int y = 0, x = 1;

    if (m == 1)
      return 0;

    while (a > 1)
    {
        // q is quotient
        int q = a / m;
        int t = m;

        // m is remainder now, process same as
        // Euclid's algo
        m = a % m, a = t;
        t = y;

        // Update y and x
        y = x - q * y;
        x = t;
    }

    // Make x positive
    if (x < 0)
       x += m0;

    return x;
}

*/

ll n=1000000;
ll arr[1000001];
ll dp[1000001];

ll rec(ll p)
{
  if (dp[p]!=0) return dp[p];
  ll total=1;
  for(int o=p+1;o<=n;o++)
  {
    total+=rec(o);
  }
  dp[p]=total;
  return dp[p];
}

int main()
{
  fast;
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
  cout<<setprecision(10)<<fixed;
  c(n);
  db total=0;
  while(n--)
  {
    db h;
    cin>>h;
    total+=(1/h);
  }
  db ans=(1/total);
  cout<<ans<<endl;

  return 0;
}


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

int main()
{
  int n;
  cin >> n;
  int i;
  vector<int> l(2*n);
  for(i = 0; i < 2*n; i++)
  {
    cin >> l.at(i);
  }
  int ans = 0;
  sort(l.begin(), l.end());
  for(i = 2*(n-1); i >= 0; i -= 2)
  {
    ans += l.at(i);
  }
  cout << ans << endl;
}

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

const int sz_max = 30;
const int INF = 2140000000;

int dx[] = {
	-1, 0, 1, 0
};
int dy[] = {
	0, 1, 0, -1
};

struct p{
	int d;
	bool dir[4];
};
struct place{
	int y;
	int x;
};

p points[sz_max][sz_max];

void bfs(int i, int j){
	queue<place> q;
	place pl;
	pl.x = j;
	pl.y = i;
	q.push(pl);
	while(!q.empty()){
		place point = q.front();
		int y = point.y;
		int x = point.x;
		q.pop();
		for(int k = 0; k < 4; k++){
			if(points[y][x].dir[k])
				if(points[y+dy[k]][x+dx[k]].d == INF ||
					points[y][x].d + 1 < points[y+dy[k]][x+dx[k]].d)
				{
					points[y+dy[k]][x+dx[k]].d = points[y][x].d + 1;
					pl.y = y+dy[k];
					pl.x = x+dx[k];
					q.push(pl);
				}
		}
	}
}

int main(){
	int w, h;
	while(cin >> w >> h){
		if(w == 0 && h == 0) break;
		for (int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				points[i][j].d = INF;
				for(int k = 0; k < 4; k++){
					points[i][j].dir[k] = false;
				}
			}
		}
		for(int i = 0; i < h; i++){
			char c;
			for(int j = 0; j < w - 1; j++){
				cin >> c;
				if(c == '0'){
					points[i][j].dir[2] = true;
					points[i][j+1].dir[0] = true;
				}
			}
			if(i == h - 1) break;
			for(int j = 0; j < w; j++){
				cin >> c;
				if(c == '0'){
					points[i][j].dir[1] = true;
					points[i+1][j].dir[3] = true;
				}
			}
		}
		points[0][0].d = 1;
		bfs(0,0);
		if(points[h-1][w-1].d == INF) cout << 0 << endl;
		else cout << points[h-1][w-1].d << endl;
	}
	return 0;
}

Measured memory_bytes: 916
#include<iostream>
#include<string>
#include<map>
using namespace std;

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

    string T = "ATCG";

    int ans = 0;
    for (int i = 0; i < S.size(); i++)
    {
        int now = 0;
        for (int j = i; j < S.size(); j++)
        {
            bool ok = false;
            for (int k = 0; k < T.size(); k++)
            {
                if (S[j] == T[k]) ok = true;
            }

            if (ok) {
                now++;
                ans = max(ans, now);
            }
            else {
                break;
            }
        }
    }

    cout << ans << endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <stack> // s.top()
#include <bitset>
#include <queue> // s.front()
using namespace std;

typedef long long Int;
typedef pair<Int,Int> P;
#define print(x) cout<<(x)<<endl

#define INF10 10000000000
#define INF5 100000
#define EPS 1e-10
#define MOD 1000000007



int main() {
	string s; cin >> s;
	s[3] = '8';
	print(s);





	return 0;
}

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

int main() {
  int N, Sum=0;
  cin >> N;
  vector<int> V(N), C(N);
  rep(i, N) cin >> V.at(i);
  rep(i, N) cin >> C.at(i);
  rep(i, N) if(V.at(i)>C.at(i)) Sum=Sum+(V.at(i)-C.at(i));
  cout << Sum << endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static final int BIG_NUM = 2000000000;
	public static final int MOD = 1000000007;

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		final int size = 105;
		
		Stack stack = new Stack(size);
		int a,b;
		
		try {
			String input_str[] = br.readLine().split("\\s+");
			for(int i=0; i<input_str.length; i++) {
				switch(input_str[i]) {
				case "+":
					
					a = stack.pop();
					b = stack.pop();
					stack.push(a+b);
					break;
				
				case "-":
					b = stack.pop();
					a = stack.pop();
					stack.push(a-b);
					break;
					
				case "*":
					a = stack.pop();
					b = stack.pop();
					stack.push(a*b);
					break;
					
				default:
					stack.push(Integer.parseInt(input_str[i]));
					break;
				}
			}
			System.out.println(stack.pop());
		} catch (NumberFormatException | IOException e) {
			e.printStackTrace();
		}
	}
}

class Stack {
	private int num[];
	private int top;
	
	Stack(int arg_size){
		num = new int[arg_size];
		top = 0;
	}
	
	public void push(int x) {
		num[top++] = x;
	}
	
	public int pop() {
		top--;
		return num[top];
	}
	
	public boolean isEmpty() {
		return top == 0;
	}
}



Measured memory_bytes: 24656
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int main(){
    int n; cin >> n;
    int d1, d2;
    vector<int> d(1000, 0);
    for(int i = 0; i < n; i++){
        cin >> d1 >> d2;
        if(d1 == d2) d[i]++;
    }
    bool ans = false;
    for (int i = 0; i < n-1; i++)
    {
        if(d[i+1]) d[i+1] += d[i];
        if(d[i+1] == 3) ans = true;
    }
    if(ans) puts("Yes");
    else puts("No");
}

Measured memory_bytes: 3596
#include<iostream>
#include<list>
#include<algorithm>
using namespace std;
int main(){
    int n;
    cin>>n;
    list<long long> b;
    for(int i{};i<n;++i){
        long long a;
        cin>>a;
        if(i%2)b.push_front(a);
        else b.push_back(a);
    }
    if(n%2){
        cout<<*b.rbegin();
        for(auto p=next(b.rbegin(),1);p!=b.rend();++p)
            cout<<' '<<*p;
    }
    else{
        cout<<*b.begin();
        for(auto p=next(b.begin(),1);p!=b.end();++p)
            cout<<' '<<*p;
    }
    cout<<endl;
}

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

int f(int n) {    // 再帰関数
    if(n == 1) return 1;
    if(n == 2) return 2;
    if(n == 3) return 4;
    return f(n-1) + f(n-2) + f(n-3);
}

int main(void){
    while(true) {
        int n;
        cin >> n;
        if(n==0) break;
        cout << (f(n) / 3650)+1 << endl;
    }
}


Measured memory_bytes: 3100
#include <iostream>

using namespace std;

int main(){
    int N;
    cin >> N;
    int S = 0;
    int max = 0;
    for(int i = 0;i < N;i++){
        int a;
        cin >> a;
        S += a;
        max = std::max(max, a);
    }
    S -= max/2;
    cout << S << endl;
}

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

class C
{
	static void Main()
	{
		Console.ReadLine();
		var a = Console.ReadLine().Split().Select(int.Parse).ToArray();
		Console.WriteLine(Enumerable.Range(1, 100).Min(p => a.Sum(x => (x - p) * (x - p))));
	}
}


Measured memory_bytes: 28268
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define debug(n,v) cout<<#v<<":";for(int i=0;i<n;i++)cout<<v[i]<<" ";cout<<endl; 
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
    ll n,x;
    cin>>n>>x;
    if(x==1||x==2*n-1){
        cout<<"No"<<endl;
        return 0;
    }
    cout<<"Yes"<<endl;
    
    vector<ll> ans(2*n);
    int num=x;
    
    for(int i=n;i<=2*n-1;i++){
        ans[i]=num;
        num++;
        if(num>2*n-1) num=1;
    }
    for(int i=1;i<n;i++){
        ans[i]=num;
        num++;
        if(num>2*n-1) num=1;
    }
    for(int i=1;i<=2*n-1;i++){
        cout<<ans[i]<<endl;
    }
    return 0;
}


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

typedef long long ll;
#define IO ios_base::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define endl '\n'
const int N = 2e5 + 5;
const ll mod = 1e9 + 7;
using namespace std;

int main() {
    IO;
    ll n;
    cin >> n;
    string ans = "";
    while (n > 0) {
        n--;
        ans += char(n % 26 + 'a');
        n /= 26;
    }
    reverse(ans.begin(),ans.end());
    cout<<ans;


}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define pb emplace_back
#define F first
#define S second
#define rep(i, st, ed) for(ll i=st; i<ed; ++i)
#define repn(i, st, ed) for(ll i=st; i<=ed; ++i)
#define repb(i, ed, st) for(ll i=ed; i>=st; --i)
#define all(v) v.begin(),v.end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define PI acosl(-1.0)
#define mp(a, b) make_pair(a, b)
#define eps 1e-9
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long ll;
template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}
int M = 1e9 + 7;
const int N = 1e5 + 10;
const ll INF = 1LL << 60;
ll iv[N];
ll powM(ll a, ll b, ll M = M){ll res = 1;for(;b;a=a*a%M,b/=2) if(b&1) res=res*a%M;return res;}
ll nckbig(int n, int k){ll ans = 1;for(int i=1; i<=k; ++i){ans = ans*(n-i+1)%M*iv[i]%M;}return ans;}
ll caliv(){iv[1] = 1;for(int i=2; i<N; i++){iv[i] = M-M/i*iv[M%i]%M;}}
ll f1[N], f2[N];
ll calf(){f1[0] = f2[0] = 1;for(int i=2; i <N; ++i){f1[i] = f1[i-1]*i%M;f2[i] = f2[i-i]*iv[i]%M;}}
ll nck(int n, int k){return f1[n]*f2[n-k]%M*f2[k]%M;}
ll npk(int n, int k){return f1[n]*f2[n-k]%M;}
ll Rnck(int big){if(big){caliv();}else{calf();}}

void solve()
{
  int arr[3][3];
  rep(i, 0, 3)
    rep(j, 0, 3)
      cin>>arr[i][j];
  int n;
  cin>>n;
  rep(i, 0, n){
    int x;
    cin>>x;
    rep(i, 0, 3)
      rep(j, 0, 3){
        if(x == arr[i][j]){
          arr[i][j] = 0;
        }
      }
  }
  rep(i, 0, 3){
    bool ok = true;
    rep(j, 0, 3){
      if(arr[i][j] != 0){
        ok = false;
        break;
      }
    }
    if(ok){
      cout<<"Yes"<<endl;
      return;
    }
  }
  rep(i, 0, 3){
    bool ok = true;
    rep(j, 0, 3){
      if(arr[j][i] != 0){
        ok = false;
        break;
      }
    }
    if(ok){
      cout<<"Yes"<<endl;
      return;
    }
  }
  bool ok = true;
  rep(i, 0, 3){
    if(arr[i][i] != 0) ok =false;
  }
  if(ok){
    cout<<"Yes"<<endl;
    return;
  }
  ok = true;
  rep(i, 0, 3){
    if(arr[i][2-i] != 0) ok =false;
  }
  if(ok){
    cout<<"Yes"<<endl;
    return;
  }
  cout<<"No"<<endl;
}


int main()
{
    FAST
    ll Tests = 1;
    //cin>>Tests;
    while(Tests--)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

const int MAX_N = 2e5 + 5;

int has1 [MAX_N];
int hasn [MAX_N];

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

  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;

    if (u > v) swap(u, v);
    if (u == 1) has1[v] = 1;
    if (v == n) hasn[u] = 1;
  }

  for (int i = 2; i < n; i++) {
    if (has1[i] && hasn[i]) {
      cout << "POSSIBLE" << endl;
      return 0;
    }
  }

  cout << "IMPOSSIBLE" << endl;
}


Measured memory_bytes: 1792
#include <stdio.h>
#define LL long long
int main(){
	LL x,y;
	int i;
	scanf("%lld",&x);
	y=100; 
	for(i=1;i<=4000;i++){
		y=y+y*0.01;
		if(y>=x)break;
	}
	printf("%d\n",i);
	return 0;
}

Measured memory_bytes: 1732
#include<cstdio>
#include<queue>
#include<algorithm>
#include<vector>
using namespace std;
int n;
long a[300000],ans=0,sum1[300000]={},sum2[300000]={};
priority_queue<long, vector<long>,greater<long> > q1;
priority_queue<long> q2;
int main(){
    scanf("%d",&n);
    for(int i=0;i<3*n;i++){
        scanf("%ld",&a[i]);
        if(i<n){
            q1.push(a[i]);
            sum1[n-1]+=a[i];
        }
        else if(i>=2*n){
            q2.push(a[i]);
            sum2[2*n]+=a[i];
        }
    }
    for(int i=n;i<2*n;i++){
        sum1[i]=sum1[i-1];
        if(q1.top()<a[i]){
            sum1[i]-=q1.top();
            sum1[i]+=a[i];
            q1.push(a[i]);
            q1.pop();
        }
    }
    for(int i=2*n-1;i>=n;i--){
        sum2[i]=sum2[i+1];
        if(q2.top()>a[i]){
            sum2[i]-=q2.top();
            sum2[i]+=a[i];
            q2.push(a[i]);
            q2.pop();
        }
    }
    ans=-100000000000000;
    for(int i=n-1;i<2*n;i++){
        ans=max(ans,sum1[i]-sum2[i+1]);
    }
    printf("%ld\n",ans);
}

Measured memory_bytes: 7668