akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
using namespace std;
int main() {
	while (1) {
		int n;
		cin >> n;
		if (n == 0)
			break;
		vector<int> s(n), p(n), q(n), r(n), cal(n);
		int C, P, Q, R;
		for (int i = 0; i < n + 1; i++) {
			if (i < n) {
				cin >> s.at(i) >> p.at(i) >> q.at(i) >> r.at(i);
				cal.at(i) = p.at(i) * 4 + q.at(i) * 9 + r.at(i) * 4;
			}
			else
				cin >> P >> Q >> R >> C;
		}

		int j = 0;
		for (int i = 0; i < n; i++) {
			if (cal.at(i) <= C && p.at(i) <= P && q.at(i) <= Q && r.at(i) <= R) {
				cout << s.at(i) << endl;
				j++;
			}
		}
		if (j == 0)
			cout << "NA" << endl;
	}
}


Measured memory_bytes: 3120
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

using namespace std;

// 約数列挙
vector<int> divisor(int n) 
{
    vector<int> ret;
    for(int i = 1; i * i <= n; i++) {
        if(n % i == 0) {
        ret.push_back(i);
        if(i * i != n) ret.push_back(n / i);
        }
    }
    //sort(begin(ret), end(ret));　時間短縮で削除
    return (ret);
}

int main()
{
    // 入出力高速化
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    
    map<int ,int> a;
    
    int buf;
    for(int i=0;i<n;i++){
        cin >> buf;
        a[buf]++;
    }

    int ans=0;
    vector<int> vec;
    for(auto p1: a){
        // チェック中の数字が2つ以上あるなら、cntなし
        if(p1.second>=2) continue;
        
        // チェック中の約数が存在するかデータにあるかチェック
        bool check=true;
        vec = divisor(p1.first);
        for(int i=0;i<vec.size();i++){
            if(vec[i]==p1.first) continue;
            if(a[vec[i]]>0){
                check=false;
                break;
            }
        }
        
        // 割り切れる数なしのときcnt up
        if(check) ans++;
    }

    cout << ans << endl;
}


Measured memory_bytes: 32424
#include <stdio.h>
int main(void){
	long x;
	long num = 100;
	long ans = 0;
	scanf("%ld", &x);
	while(num < x){
		num *= 1.01;
		num = (long)num;
		ans++;
	}
	printf("%ld\n", ans);
	return 0;
}

Measured memory_bytes: 1732
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <iomanip>

using namespace std;

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


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
    string s;
    int x = 0, y = 0;
    while (cin >> s) {
        int a, b, c;
        sscanf(s.c_str(), "%d,%d,%d", &a, &b, &c);
        if (a == b) y++;
        if (a * a + b * b == c * c) x++;
    }
    cout << x << "\n" << y << endl;
    return 0;
}

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

int my_pow(int x, int y) {
	int res = 1;
	while (y > 0) {
		if ((y % 2) == 0) {
			x *= x;
			y /= 2;
		}
		else {
			res *= x;
			--y;
		}
	}
	return res;
}

int main(void) {
	int N, K;
	int ans;

	cin >> N >> K;

	if (N <= 1)
		ans = K;
	else if (K <= 2)
		ans = 2;
	else
		ans = K * my_pow(K - 1, N - 1);

	cout << ans << '\n';
	return 0;
}


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

int main() {
    int h, w;
    cin >> h >> w;
    vector<vector<int>> field(h,vector<int>(w));
    rep(i,h)rep(j,w) cin >> field[i][j];
    int ct = 0;
    vector<vector<int>> ans;
    rep(i,h) {
        if (!(i&1)) {
            rep(j,w) {
                if (j != w-1) {
                    if (field[i][j]&1) {
                        ct++;
                        ans.push_back({i+1,j+1,i+1,j+2});
                        field[i][j]--;
                        field[i][j+1]++;
                    }
                }
                else {
                    if (field[i][j]&1 && i != h-1) {
                        ct++;
                        ans.push_back({i+1,j+1,i+2,j+1});
                        field[i][j]--;
                        field[i+1][j]++;
                    }
                }
            }
        }
        else {
            rep(j,w) {
                if (j != w-1) {
                    if (field[i][w-1-j]&1) {
                        ct++;
                        ans.push_back({i+1,w-j,i+1,w-1-j});
                        field[i][w-1-j]--;
                        field[i][w-2-j]++;
                    }
                }
                else {
                    if (field[i][w-1-j]&1 && i != h-1) {
                        ct++;
                        ans.push_back({i+1,w-j,i+2,w-j});
                        field[i][w-1-j]--;
                        field[i+1][w-1-j]++;
                    }
                }
            }
        }
    }
    cout << ct << endl;
    rep(i,ct) {
        rep(j,4) {
            if (j != 3) cout << ans[i][j] << " ";
            else cout << ans[i][j] << endl;
        }
    }
}

Measured memory_bytes: 9904
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cctype>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <memory>
#include <functional>
 
using namespace std;

int main(int argc, char const *argv[]) {
	int n;
	cin >> n;
	vector<int> A(n);
	for (int i = 0; i < n; i++) {
		cin >> A[i];
	}

	deque<int> B;
	for (int i = 0; i < n; i++) {
		if (i % 2 == 0) {
			B.push_back(A[i]);
		} else {
			B.push_front(A[i]);
		}	
	}

	if (n % 2 == 1) {
		for (int i = n - 1; i >= 0; i--) {
			cout << B[i] << " ";
		}
		cout << endl;
	} else {
		for (int i = 0; i < n; i++) {
			cout << B[i] << " ";
		}
		cout << endl;
	}

	return 0;
}

Measured memory_bytes: 3840
#include <iostream>

using namespace std;
int main() {
    string N;
    uint16_t A, B;
    std::cin >> N;
    B = ((N[2] - 48) * 10) + (N[3] - 48);
    A = ((N[0] - 48) * 10) + (N[1] - 48);

    if ((A <= 12 && B <= 12) && (A > 0 && B > 0)){
        cout << "AMBIGUOUS" << endl;
    }else if(B <= 12 && B > 0){
        cout << "YYMM" << endl;
    } else if (A <= 12 && A > 0){
        cout << "MMYY" << endl;
    }else{
        cout << "NA" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<stdio.h>
#include <cstdint>
#include <stdlib.h> 
#include <time.h>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rrep(i,n) REP(i,1,n+1)
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define RNG(x, a, n) &((x)[a]), &((x)[n])
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
typedef long long ll;
typedef pair<ll, ll> Pll;
typedef pair<int, int> PII;
typedef vector<ll> Vl;
typedef vector<int> VI;
typedef tuple<int, int, int> TT;
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define dmt(x, y, z) make_tuple(x, y, z)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
const int MAX = 500000;
const int inf = 1000000007;
const ll mod = 1000000007;
const long double PI = (acos(-1));
const long double EPS = 0.0000000001;

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


char a;

int main() {

	cin >> a;

	if ('A' <= a && a <= 'Z')cout << 'A' << endl;
	else cout << 'a' << endl;

	return 0;
}


Measured memory_bytes: 3620
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
typedef struct{
    int point;
    int len;
}pair;
int compare(const void *a,const void *b){
    pair x=*(pair*)a;
    pair y=*(pair*)b;
    int p=x.point;
    int q=y.point;
    if(p>q)return 1;
    return -1;
}
int max(int a,int b){
    return a>b?a:b;
}
int main()
{   int h,w,n,c=0,ans=0;
    scanf("%d%d%d",&h,&w,&n);
    while(c<n){
        c+=max(h,w);
        ans++;
    }
    printf("%d",ans);
    
    return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<cmath>
#include<cstring>
using namespace std;

int q,l,r,n,i,j;
bool prime[100005]={true};
int a[100005]={0};

int main(){
    memset(prime,true,sizeof(prime));
    prime[1]=false;
    for(i=2;i<=100000;i++){
        if(prime[i]){
            for(j=i+i;j<=100000;j+=i)
                prime[j]=false;
        }
    }
    
    for(i=1;i<=100000;i++){
        if(i%2==0) a[i]=a[i-1];
        else{
            n=(i+1)/2;

            if(prime[i]&&prime[n]) a[i]=1;
            
            a[i]+=a[i-1];
        }
    }
    
    cin>>q;
    
    for(i=1;i<=q;i++){
        cin>>l>>r;
        cout<<a[r]-a[l-1]<<endl;
    }
    return 0;
}

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

// Cadenas de entrada
string s, t;
// [indice de s][indice de t]
vector <vector <int> > dp;
// tabla de
vector <vector <int> > tabla;

void Recibir() {
	cin >> s >> t;
	dp.resize(s.length());
	for (int i=0; i<s.length(); i++) dp[i].assign(t.length(), -1);
}

int LCS_Len(int si, int ti) {
	// Caso base break
	if (si == -1 || ti == -1) return 0;
	// Hay DP
	if (dp[si][ti] != -1) return dp[si][ti];
	
	// Elemenos son iguales
	if (s[si] == t[ti]) return dp[si][ti] = LCS_Len(si-1, ti-1) + 1;
	// Elementos no son iguales
	else return dp[si][ti] = max(LCS_Len(si-1, ti), LCS_Len(si, ti-1));
}

void LCS_build(int si, int ti) {
	// Caso base break
	if (si == -1 || ti == -1) return;
	// Elemenos son iguales
	if (s[si] == t[ti] && dp[si][ti] == LCS_Len(si-1, ti-1) + 1) {
		LCS_build(si-1, ti-1);
		cout << s[si];
		return;
	}
	// Elementos no son iguales
	else if (dp[si][ti] == LCS_Len(si-1, ti)) {
		LCS_build(si-1, ti);
		return;
	}
	else {
		LCS_build(si, ti-1);
		return;
	}
}

int main() {
	Recibir();
	LCS_Len(s.length()-1, t.length()-1);
	LCS_build(s.length()-1, t.length()-1);
	return 0;
}

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

bool isPrime(int x) {
  for(int i = 2; i <= floor(sqrt(x)); i++) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}

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

  while(true) {
    if (isPrime(X)) {
      cout << X << endl;
      return 0;
    }
    X++;
  }
}

Measured memory_bytes: 3648
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE RankNTypes #-}
import qualified Data.ByteString.Lazy.Char8 as B
import Data.Maybe
import Data.List
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as VU
-- import qualified Data.Vector.Unboxed.Mutable as VUM
-- import Control.Monad
-- import Control.Monad.ST
import Debug.Trace
-- trace _ = id

solve :: String -> Int -> Int
solve strK bD | sumDigitsF `mod` bD == 0 = numMultF
              | otherwise                = numMultF `mSub` 1
  where

  (sumDigitsF, numMultF) =
    V.foldl' op (0, 0) (V.zip vecK mVec)
    where
    vecK = V.fromList strK
    lenK = V.length vecK

    -- mVec = trace ("mVec " ++ show mVecA) mVecA
    mVec = V.reverse $ V.iterateN lenK (rot10 bD) (initV bD)

    op (sumDigits, numMult) (c, vec) =
      (sumDigits + d,
       (numMult +
        sum [vec VU.! ((-(sumDigits+i)) `mod` bD) | i <- [0..d-1]]) `mod` mPrime)
      where d = read [c]

initV :: Int -> VU.Vector Int
initV bD = VU.fromListN bD (1 : replicate (bD-1) 0)

shift bD v x = (VU.drop y v) VU.++ (VU.take y v)
    where y = (-x) `mod` bD

rot10 bD v = foldl1 (VU.zipWith mAdd) (map (shift bD v) [0..9])

mPrime = 10^9 + 7

mAdd :: Int -> Int -> Int
mAdd x y = let w = x + y in if w < mPrime then w else w - mPrime
-- mAdd x y = (x + y) `mod` mPrime

mSub :: Int -> Int -> Int
mSub x y = let w = x - y in if w >= 0 then w else w + mPrime
-- mSub x y = (x - y) `mod` mPrime    -- ok even if x < y

readBInt :: B.ByteString -> Int
readBInt = fst . fromJust . B.readInt

tmain :: B.ByteString -> Int
tmain cont =
  let remLines0 = map B.words (B.lines cont)
      [bs_nK]:remLines1 = remLines0
      [bs_nD]:remLines2 = remLines1
      nD = readBInt bs_nD
  in solve (B.unpack bs_nK) nD

outAnswer :: Int -> IO ()
outAnswer = putStrLn . show

main :: IO ()
main = outAnswer . tmain =<< B.getContents


-------------------------------------------------------------------------------

inp1 = "30\n4\n"
inp2 = "1000000009\n1\n"
inp3 = "98765432109876543210\n58\n"
tv1 = tmain $ B.pack inp1
tv2 = tmain $ B.pack inp2
tv3 = tmain $ B.pack inp3
test1 = tv1 == 6
test2 = tv2 == 2
test3 = tv3 == 635270834
alltest = test1 && test2 && test3



Measured memory_bytes: 29180
// Author: droftware
#include <bits/stdc++.h>

#define forn(i,a,n) for(int i=a;i<n;i++)
#define DRT()  int t; cin>>t; while(t--)

#define TRACE
#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
#else
#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)
#endif
using namespace std;

const int N = 3005;
int dp[N][N];

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	string s,t;
	cin>>s>>t;
	forn(i,0,s.size()+1){
		forn(j,0,t.size()+1){
			if(i == 0 || j == 0)
				dp[i][j] = 0;
			else if(s[i-1] == t[j-1])
				dp[i][j] = 1 + dp[i-1][j-1];
			else
				dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
		}
	}
	string res = "";
	int x = s.size(), y= t.size();
	while(x > 0 && y > 0){
		if(s[x-1] == t[y-1]){
			res += s[x-1];
			x = x-1;
			y = y-1;
		} else if(dp[x][y] == dp[x-1][y]){
			x = x-1;
		} else {
			y = y-1;
		}
	}
	reverse(res.begin(), res.end());
	cout<<res<<endl;
}
	
	



Measured memory_bytes: 35456
//1-7-c
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int r, c;
    int a[100][100];
    cin >> r >>c;
    
        for(int i=0; i<r; i++){
            int sum=0;
            for(int j=0; j<c; j++){
                cin >> a[i][j];
                sum = sum + a[i][j];
                cout << a[i][j];
                cout << " ";
            }
        cout << sum << endl;
        }
        for(int k=0; k<c; k++){
            int s=0;
            for(int l=0; l<r; l++){
                cin >> a[l][k];
                s = s+a[l][k];
            }    
        cout << s << " ";
        }
        int u=0;
        for(int i=0; i<r; i++){
            int sum=0;
            for(int j=0; j<c; j++){
                cin >> a[i][j];
                sum = sum + a[i][j];
            }
            u = u + sum;
        }
            cout << u << endl;
}
        



Measured memory_bytes: 3068
// https://atcoder.jp/contests/dp/tasks/dp_i

#include <bits/stdc++.h>
using namespace std;

int main () {
    int n;
    cin >> n;
    using ld = long double;
    vector<ld>p(n);
    for(auto &x: p) 
        cin >> x;

    vector<vector<ld>>dp(n+1, vector<ld>(n+1, 0.0));

    dp[0][0] = 1;

    for(int i = 1; i <= n; ++i) {
        for(int j = 0; j <= i; ++j) {
            if(!j)
                dp[i][j] = dp[i-1][j]*(1-p[i-1]);
            else
                dp[i][j] = dp[i-1][j-1]*p[i-1] + dp[i-1][j]*(1-p[i-1]);
        }
    }
    ld ans = 0;
    for(int i = (n+1)/2; i <= n; ++i)
        ans += dp[n][i];

    cout << setprecision(10) << ans << endl;

}

Measured memory_bytes: 141056
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
int main(void) {
    int a, b; cin >> a >> b;
    int k; cin >> k;
    rep(i, k) {
        if(i%2 == 0) {
            if(a&1) a--;
            b += a/2;
            a = a/2;
        } else {
            if(b&1) b--;
            a += b/2;
            b = b/2;
        }
    }
    cout << a << " " << b << endl;
}


Measured memory_bytes: 256
X = str(input())

n = len(X)
tmp = 0
cnt = 0
for i in range(n):
  if X[n-1-i] == 'T':
    tmp += 1
  else:
    if tmp > 0:
      tmp -= 1
      cnt += 1

ans = n - 2*cnt
print(ans)

Measured memory_bytes: 9232
#include<bits/stdc++.h>
using namespace std;
 
list<int>L;
signed main() {
    int a, b, c; cin >> a >> b >> c;
    for (int d = 0; d < a; d++) {
        L.push_back(d);
    }
    auto f = L.begin();
    for (int d = 0; d < b; d++) {
        int e; scanf("%d", &e);
        for (int g = 0; g < e; g++) {
            if (e & 1) {
                if (f == L.begin())f = --L.end();
                else f--;
            }
            else {
                f++;
                if (f == L.end())f = L.begin();
            }
        }
        L.erase(f);
	f--;
	f++;
        if (f == L.end())f = L.begin();
    }
    for (int s = 0; s < c; s++) {
        int k; scanf("%d", &k);
        cout << binary_search(L.begin(), L.end(), k)<<endl;
    }
}

Measured memory_bytes: 9400
#include "bits/stdc++.h"
using namespace std;
typedef long long li;

const li mod = 998244353;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    li n;
    string s;
    cin >> n >> s;

    vector<li> cnt(3, 0), statecnt(2, 0);
    li ans = 1;
    for (int i = 0; i < n; ++i) {
        ans *= i + 1;
        ans %= mod;
    }
    li prevmax = 0, prevmin = 0;
    for (int i = 0; i < 3 * n; ++i) {
        char c = s[i];
        int x;
        if (c == 'R') {
            x = 0;
        } else if (c == 'G') {
            x = 1;
        } else {
            x = 2;
        }
        cnt[x]++;
        li curmin = *min_element(cnt.begin(), cnt.end());
        li curmax = *max_element(cnt.begin(), cnt.end());

        if (prevmax != curmax) {
            // 0
            statecnt[0] += 1;
        } else if (prevmin != curmin) {
            // 2
            ans *= statecnt[1];
            ans %= mod;
            statecnt[1] -= 1;
        } else {
            // 1
            ans *= statecnt[0];
            ans %= mod;
            statecnt[0] -= 1;
            statecnt[1] += 1;
        }

        prevmin = curmin;
        prevmax = curmax;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 720
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using Graph = vector<vector<ll>>;
using P = pair<int,int>;
#define MOD 1000000007
#define INF 1000000
#define PI 3.14159265358979323846264338327950L
#define MAX_N 200010
#define lb lower_bound //[2,4)=lb(4)-lb(2);

/*
なんか前にやったのでちょっと覚えてしまっていた・・・・

lcm(A[1]....A[N])=Lとすると
B[i]=L/A[i]が最小になる
*/

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

map<ll,int> l;
void lcm(ll n)
{
  for (ll i=2;i*i<=n;i++)
  {
    ll count = 0;
    while (n%i==0)
    {
      n/=i; 
      count++;
    }
    if (l[i]<count) l[i]=count;
  }
  if (n!=1) l[n]=max(1,l[n]);
}

int main()
{
  ll N;cin>>N;
  vector<ll> A(N+1);
  for (int i=1;i<=N;i++)
  {
    cin>>A[i];
    lcm(A[i]);
  }
  
  //for (auto i=l.begin();i!=l.end();i++)
    //cout<<"l["<<i->first<<"]="<<i->second<<endl;
  
  ll L = 1;
  for (auto i=l.begin();i!=l.end();i++)
  {
    L *= fast(i->first,i->second);
    L %= MOD;
  }
  //cout<<"L: "<<L<<endl;
  
  ll ans;
  for (int i=1;i<=N;i++)
  {
    ans += L * fast(A[i],MOD-2) % MOD;
    ans %= MOD;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 1024
o = raw_input()
e = raw_input()
o = list(o)
e = list(e)
password = []
if len(e) == len(o):
    for i in range(len(e)):
        password.append(o[i])
        password.append(e[i])
else:
    for i in range(len(e)):
        password.append(o[i])
        password.append(e[i])
    password.append(o[len(o)-1])
print ''.join(password)

Measured memory_bytes: 2568
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int n; string s; cin >> n >> s;
	ll ans = 0;
	string pp = "RGB";
	sort(all(pp));
	
	do {
		ll r = 0, g = 0, b = 0;
		for(auto u : s) {
			if(u == pp[0]) {
				++r;
			} else if(u == pp[1]) {
				g += r;
			} else {
				b += g;
			}
		}
		rep(i, 0, n) if(s[i] == pp[1]) {
			rep(j, i + 1, n) if(s[j] == pp[2]) {
				int k = 2 * i - j;
				if(k >= 0 && s[k] == pp[0]) --b;
			}
		}
		ans += b;
	} while(next_permutation(all(pp)));
	
	
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3664
#include<stdio.h>
int main(void){
double r,pai,s,l;
pai=3.1415926535897932384626433832795028841971;
scanf("%lf",&r);
s=r*r*pai;
l=r*2*pai;
printf("%lf %lf\n",s,l);
return 0;
}

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

using ll = long long;
using P = pair<int, int>;

const int INF = 1e9;
const int MOD = 1e9 + 7;

// 4近傍、8近傍
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

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

  cout << n - k + 1 << endl;
  return 0;
}


Measured memory_bytes: 256
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <bitset>
typedef long long ll;
typedef unsigned long long ull;

#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define DEBUG(vec) for (auto v : vec) { cout << v << " "; } cout << endl;

using namespace std;

// Union-Find木
template <typename T>
struct UnionFind {
  int n;
  vector<T> par;
  vector<T> rank;

 public:
  explicit UnionFind(int n) {
    this->n = n;
    par = vector<T>(n, 0);
    iota(par.begin(), par.end(), 0);
    rank = vector<T>(n, 0);
  }
  // 木の根を求める
  T root(T x) {
    if (par[x] == x) {
      return x;
    } else {
      return par[x] = root(par[x]);
    }
  }
  // x と y が同じ集合に属するか調べる
  bool same(T x, T y) {
    return root(x) == root(y);
  }
  // x と y が属する集合を併合する
  void unite(T x, T y) {
    x = root(x);
    y = root(y);
    if (x == y) return;
    if (rank[x] < rank[y]) {
      par[x] = y;
    } else {
      par[y] = x;
      if (rank[x] == rank[y]) rank[x]++;
    }
  }
  // 連結成分の数を数える
  int groups() {
    int ans = 0;
    for (int i = 0; i < n; i++) {
      // グループには根が自分と同じものが一つずつある
      if (par[i] == i) ans++;
    }
    return ans;
  }
};

// カウンター
template <typename T>
struct Counter {
  map<T, ull> cnt;
  void add(T key) {
    if (cnt.count(key)) {
      cnt[key]++;
    } else {
      cnt[key] = 1;
    }
  }
  void add(vector<T> keys) {
    for (auto key : keys) {
      add(key);
    }
  }
  ll get(T key) {
    if (cnt.count(key)) {
      return cnt[key];
    } else {
      return 0;
    }
  }
  pair<T, ull> max() {
    T key;
    ull mx = 0;
    for (auto kv : cnt) {
      if (kv.second > mx) {
        mx = kv.second;
        key = kv.first;
      }
    }
    return make_pair(key, mx);
  }
  typename map<T, ll>::iterator begin() {
    return cnt.begin();
  }
  typename map<T, ll>::iterator end() {
    return cnt.end();
  }
  typename map<T, ll>::reverse_iterator rbegin() {
    return cnt.rbegin();
  }
  typename map<T, ll>::reverse_iterator rend() {
    return cnt.rend();
  }
};

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

  int N, K, L;
  cin >> N >> K >> L;

  UnionFind<int> road(N);
  UnionFind<int> rail(N);

  REP(i, K) {
    int p, q;
    cin >> p >> q;
    p--;
    q--;
    road.unite(p, q);
  }
  REP(i, L) {
    int r, s;
    cin >> r >> s;
    r--;
    s--;
    rail.unite(r, s);
  }

  Counter<pair<int, int>> c;
  REP(i, N) {
    c.add(make_pair(road.root(i), rail.root(i)));
  }
  REP(i, N) {
    cout << c.get(make_pair(road.root(i), rail.root(i)));
    if (i < N - 1) {
      cout << " ";
    }
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 15104
import java.util.*;

public class Main {
    
    static int ans;
    static int N;
    
    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        N = sc.nextInt();
        dfs(0L, 0b000);
        System.out.println(ans);
    }
    
    static void dfs( long num, int use ){
        
        if( num > N ){
            return;
        }
        
        if( use == 0b111 ){
            ans++;
        }
        
        dfs( num * 10 + 3, use | 0b001 );
        dfs( num * 10 + 5, use | 0b010 );
        dfs( num * 10 + 7, use | 0b100 );
        
    }
}


Measured memory_bytes: 22996
#include<bits/stdc++.h>
using namespace std;
bool d[15];
int main()
{
	int n,k,i,x;
	cin>>n>>k;
	for(i=0;i<k;i++)
	{
		cin>>x;
		d[x]=true;
	}
	while(1)
	{
		x=n;
		while(x)
		{
			if(d[x%10])
				break;
			x/=10;
		}
		if(!x)
			break;
		n++;
	}
	cout<<n;
	return 0;
}

Measured memory_bytes: 256
N, q = gets.split.map(&:to_i)
S = gets.chomp
Q = q.times.map{ gets.split.map(&:to_i) }

dp = Array.new(N + 1, 0)
dp[0] = 0
(1 .. N).each do |i|
  dp[i] = dp[i - 1]
  dp[i] += 1 if i >= 2 && S[i - 2] == 'A' && S[i - 1] == 'C'
end

puts Q.map{|l,r| dp[r] - dp[l] }


Measured memory_bytes: 11772
#include <stdio.h>
#include <string.h>

int main(void)
{
	int i;
	char temp[20];
	int out;
	int hit;
	int score;
	
	scanf("%d", &i);
	
	while (i-- > 0){
		out = 0;
		hit = 0;
		score = 0;
		while (out != 3){
			scanf("%s", temp);
			if (strcmp("OUT", temp) == 0){
				out++;
			}
			else if (strcmp("HIT", temp) == 0){
				hit++;
			}
			else if (strcmp("HOMERUN", temp) == 0){
				score++;
				score += hit;
				hit = 0;
			}
			if(hit == 4){
				hit--;
				score++;
			}
		}
		printf("%d\n", score);
	}
	
	return (0);
}

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


int main(){
  while(1){
  int n,m,a;
  int h[1100][110]={};
  cin>>n>>m>>a;
  if(n==m&&m==a&&a==0){break;}

  for(int i=0;i<m;i++){
    int x,y,z;
    cin>>x>>y>>z;
    h[x][y]=1;
  }

  for(int i=1000;i>0;i--){
    if(h[i][a]==1){a+=1;}
    else if(h[i][a-1]==1){a-=1;}
  }

  cout<<a<<endl;
  }
  
  return 0;
}



Measured memory_bytes: 3488
import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    String[] S = sc.nextLine().split(" ");
    int c4 = 0, c2 = 0, c = 0;
    for(int i = 0; i < N; i++){
      int n = Integer.parseInt(S[i]);
      if(n%4 == 0){
        c4++;
      }else if(n%2 == 0){
        c2++;
      }
    }
    c = N-c4-c2;
    
    String ans = "No";
    if(c2%2 == 0){
      if(c4 >= c-1){
        ans = "Yes";
      }
    }else{
      if(c4 >= c){
        ans = "Yes";
      }
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 46476
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            A();
        }

        static void A()
        {
            var N = ReadInt();
            var list = new List<List<string>>();
            for (int i = 1; i <= N; i++)
            {
                var l = ReadSplit();
                l.Add(i.ToString());
                list.Add(l);
            }

            var ordered = list.OrderBy(x => x[0]).ThenByDescending(x => int.Parse(x[1]));
            foreach (var o in ordered)
            {
                Println(o[2]);
            }
        }

        static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0 || start > stop || (start <= 0 && stop <= 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        static int DigitsSum(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        static int Gcd(int a, int b) => b == 0 ? a : Gcd(b, a % b);

        static bool IsPrime(int x)
        {
            if (x <= 1 || (x != 2 && x % 2 == 0)) return false;
            if (x == 2) return true;

            for (int i = 3; i < x; i += 2)
                if (x % i == 0) return false;

            return true;
        }

        static string Read() => Console.ReadLine();
        static int ReadInt() => int.Parse(Read());
        static long ReadLong() => long.Parse(Read());

        static List<string> ReadSplit() => Read().Split().ToList();
        static List<int> ReadSplitInt() => Read().Split().Select(int.Parse).ToList();
        static List<long> ReadSplitLong() => Read().Split().Select(long.Parse).ToList();

        static void Print(object value) => Console.Write(value.ToString());
        static void Println(object value) => Console.WriteLine(value.ToString());

        static string Join<T>(IEnumerable<T> list) => string.Join("", list);
    }

    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }
}



Measured memory_bytes: 13664
N = int(input())
#a,b = map(int,input().split())
P = list(map(int,input().split()))
#A = [int(input()) for i in range(N)]
#A = [list(map(int,input().split())) for i in range(N)]
mina = P[0]
count = 1
for i in range(1,N):
    mina = min(mina,P[i])
    if mina >= P[i]:
        count += 1

print(count)

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

// def
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
#define repeat(i, a, b) for (int i = (a); i < (b); i++)
#define revrepeat(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define revrep(i, n) for (int i = (n)-1; i >= 0; i--)
typedef long long ll;
typedef pair<int, int> P;
const int M = 1e9 + 7;
const ll INF = 1e9;
const int MAX_V = 1000 + 5;
const int MAX_N = 1e5 + 5;

int main() {
    int x, a;
    cin >> x >> a;
    if (x>= a) {
        cout << 10 << endl;
    } else {
        cout << 0 << endl;
    }
}


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

int main(){
	int n;
	int *a;
	
	cin >> n;
	a = new int[n];
	for(int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for(int i = 0; i < n; i++) {
		if(i != 0)	cout << " ";
		cout << a[n - i - 1];
	}
	cout << endl;
	delete[] a;
	
	return 0;
}

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

int main(){
  int n,a,flag=0;
  
  cin>>n;
  
  for(int i=0; i<n; i++){
      cin>>a;
      
      if(a%2 == 0)
          if(a%3 != 0 && a%5 != 0)
          flag=1;
    }
    
    if(flag==1)
    cout<<"DENIED\n";
    
    else cout<<"APPROVED\n";
  
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
using namespace std;
int wt[105];
int val[105];
int ans[105][100005];
int N,w;
int ks(int n,int c) {
    if (ans[n][c] != -1) return ans[n][c];
    if (n == 0 or c == 0) return 0;
    if(wt[n-1]>c) return ks(n-1,c);
    int a = ks(n - 1, c);
    int b = val[n - 1] + ks(n - 1, c - wt[n - 1]);
    ans[n][c] = max(a, b);
    return ans[n][c];
}
void solve() {
    cin >> N >> w;
    for (int i = 0; i < N; ++i) {
        cin >> wt[i] >> val[i];
    }
    memset(ans , -1 , sizeof(ans)); 

    cout << ks(N, w);
}
int32_t main() {
    solve();
}


Measured memory_bytes: 85692
#include <iostream>
using namespace std;
int main()
{
    int k, s, x, y, z, cnt=0;
    
    cin >> k >> s;
    for(x=0;x<=k;x++){
        for(y=0;y<=k;y++){
            z=s-x-y;
            if(z<=k && z>=0) cnt++;
        }
    }
    cout << cnt <<endl;
    return 0;
}
                

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep for(int i = 0;i<n;i++)
#define ll long long
 
typedef pair<int,int>P;
int dx[4] = {1,0,-1,0};int dy[4] = {0,1,0,-1};
queue<P> que;
 
int main(){
    int n;cin >> n;
    int a[n];rep{
        cin >> a[i];
    }
    int b = 0;
    rep{
        b = b^a[i];
    }
    if(b == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

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

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

#define loop(i, n) for(int i = 0;i < n;i++)

int main(void){

    vector<string> ans;

    string str;
    cin >> str;

    int n;
    cin >> n;

    loop(i, n){
        string order;
        cin >> order;
        int a, b;
        cin >> a >> b;

        if(order == "print"){
            ans.push_back(str.substr(a, b-a+1));
        }else if(order == "reverse"){
            string str1 = str.substr(a, b-a+1);
            reverse(str1.begin(), str1.end());
            str.erase(a, b-a+1);
            str.insert(a, str1);
        }else{
            string str1;
            cin >> str1;
            str.erase(a, b-a+1);
            str.insert(a, str1);
        }
    }

    loop(i, ans.size()) cout << ans[i] << endl;

    return 0;
}



Measured memory_bytes: 3228
put = ['#','.']
while(True):
        h,w = [int(i) for i in input().split()]
        if h==0 and w==0:
                break
        for i in range(h):
                out = ''
                if i % 2 == 0:
                    count = 0
                else :
                    count = 1 
                for j in range(w):
                        out += put[count%2]
                        count += 1
                print(out)
        print("")

Measured memory_bytes: 7732
import Data.List

combinations :: Int -> [a] -> [[a]]
combinations 0 _  = [[]]
combinations n xs = [ y:ys | y:xs' <- tails xs
                           , ys <- combinations (n-1) xs' ]

main :: IO ()
main = do
    _ <- getLine
    s <- map head . lines <$> getContents
    let ns = [ (length . filter (==c)) s | c <- "MARCH"]
    print . sum . map product $ combinations 3 ns

Measured memory_bytes: 5372
using System;
using System.Collections.Generic;
using System.Linq;

public class Program
{
	public static void Main()
	{
		int N = int.Parse(Console.ReadLine());
		var A = new long[N];
		var B = new long[N];
		for (int i = N - 1; i >= 0; i--)
		{
			var AB = Console.ReadLine().Split().Select(int.Parse);
			A[i] = AB.First();
			B[i] = AB.Last();
		}
		long ans = 0;
		for (int i = 0; i < N; i++)
		{
			ans += (B[i] - (A[i] + ans) % B[i]) % B[i];
		}
		Console.WriteLine(ans);
	}
}

Measured memory_bytes: 8744
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.nextLine());
    
    if(n == 3 || n == 5 || n == 7){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }
  }
}

Measured memory_bytes: 23636
using System;
using System.Collections.Generic;
class Program{
	const int mod=1000000007;
	static List<int[]> he=new List<int[]>();
	static void Main(){
		int n=int.Parse(Console.ReadLine());
		int[][] a=new int[n][];
		int[][] b=new int[n][];
		int[,,] hn=new int[n,4,2];
		bool[] h=new bool[n];
		long ans=0,ih=1;
		for(int i=0;i<n;i++){
			int[] q=Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
			a[i]=new int[]{q[0],i};
			b[i]=new int[]{q[1],i};
		}
		Array.Sort(a,(u,v)=>u[0]-v[0]);
		Array.Sort(b,(u,v)=>u[0]-v[0]);
		for(int i=0;i<n-1;i++){
			hn[a[i][1],1,0]=a[i+1][0]-a[i][0];
			hn[a[i][1],1,1]=a[i+1][1];
			hn[a[i+1][1],0,0]=a[i+1][0]-a[i][0];
			hn[a[i+1][1],0,1]=a[i][1];
			hn[b[i][1],3,0]=b[i+1][0]-b[i][0];
			hn[b[i][1],3,1]=b[i+1][1];
			hn[b[i+1][1],2,0]=b[i+1][0]-b[i][0];
			hn[b[i+1][1],2,1]=b[i][1];
		}
		hn[a[0][1],0,1]=-1;
		hn[a[n-1][1],1,1]=-1;
		hn[b[0][1],2,1]=-1;
		hn[b[n-1][1],3,1]=-1;
		for(int i=0;i<4;i++){
			if(hn[0,i,1]!=-1){heapa(hn[0,i,0],hn[0,i,1]);}
		}
		h[0]=true;
		while(ih!=n){
			if(h[he[0][1]]==false){
				int q=he[0][1];
				h[q]=true;
				ans+=he[0][0];
				ih++;
				heapr();
				for(int i=0;i<4;i++){
					if(hn[q,i,1]!=-1){heapa(hn[q,i,0],hn[q,i,1]);}
				}
			}
			else{heapr();}
		}
		Console.WriteLine("{0}",ans);
	}
	static void heapa(int a,int b){
		he.Add(new int[]{a,b});
		int j=he.Count-1;
		while(he[j][0]<he[(j-1)/2][0]){
			int v=he[j][0];
			he[j][0]=he[(j-1)/2][0];
			he[(j-1)/2][0]=v;
			v=he[j][1];
			he[j][1]=he[(j-1)/2][1];
			he[(j-1)/2][1]=v;
			j=(j-1)/2;
		}
	}
	static void heapr(){
		he[0]=he[he.Count-1];
		he.RemoveAt(he.Count-1);
		int j=0;
		while(true){
			if(j*2+2<he.Count){
				if(he[j*2+1][0]<he[j*2+2][0]){j=j*2+1;}
				else{j=j*2+2;}
			}
			else if(j*2+1<he.Count){j=j*2+1;}
			else{break;}
			if(he[j][0]>=he[(j-1)/2][0]){break;}
			int v=he[j][0];
			he[j][0]=he[(j-1)/2][0];
			he[(j-1)/2][0]=v;
			v=he[j][1];
			he[j][1]=he[(j-1)/2][1];
			he[(j-1)/2][1]=v;
		}
	}
}

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

int main() {
  char c;
  cin >> c;
  if (c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o') cout << "vowel" << endl;
  else cout << "consonant" << endl;
}

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


int main(){
  int n;
  cin >> n;
  int cnt = 0;
  for(int i = 1; i < n/2 + 1; ++i){
    if(i != n - i && n - i > 0){
      cnt += 1;
    }
  }
  cout << cnt << endl;
}


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

int main() {
    int N;
    cin >> N;
    vector<int>a(N);
    for (int i = 0; i < N; ++i) {
        cin >> a[i];
    }
    int cnt = 1;
    for (int i = 0; i < N; ++i) {
        if(a[i] == cnt) cnt++;
    }
    if(cnt == 1){
        cout << -1 << "\n";
    } else{
        cout << N - cnt + 1 << "\n";
    }
    return 0;
}

Measured memory_bytes: 1024
import sys

input_methods=['clipboard','file','key']
input_method=input_methods[1]

bbn=1000000007
	
#+++++

def check(n,h,j):
	#aa = 4*h*j*w - n*h*j - n*j*w - n*w*h
	#aa==0 => 4hjw-njw-nwh == nhj
	t= (4*h*j-n*j-n*h)
	if t!=0 and n*h*j % t == 0:
		#pa((t, n*h*j))
		return (n*h*j)//t
	return -1
	
	#return (4/n)-(1/h + 1/j + 1/w)

		
def main():
	n = int(input())
	#4/N==1/h+1/j+1/w
	#2h==j==w => 4/N==4/2h
	#N = 2h
	
	#4hjw==N(hj+jw+wh)
	#N==4(hjw)/(hj+jw+wh)
	for h in range(1,3501):
		for j in range(1,3501):
			w = check(n,h,j)
			if w > 0:
				#pa(4/n)
				#pa((1/h)+(1/j)+(1/w))
				return ' '.join([str(v) for v in [h,j,w]])
			continue
			
			
			
			#for w in range(1,3501):
			if check(n,h,j,1) > 0:
				break
			if check(n,h,j,3500)<0:
				break
			if check(n,h,j,1)==0:
				return (h,j,1)
			if check(n,h,j,3500)==0:
				return (h,j,3500)
			ok=3500
			ng=0
			while ok-ng>1:
				mid = (ok+ng)//2
				cc= check(n,h,j,mid)
				if cc == 0:
					return (h,j,mid)
				elif cc < 0:
					ng=mid
				else:
					ok=mid
				#print(h,j,w)
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

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

int main(int argc, char const *argv[]) {
  vector<int> num;
  int a, i, five=0, seven=0;

  for (i=0; i<3; i++) {
    cin >> a;
    num.push_back(a);
    if (num[i]==5) {
      five++;
    } else if (num[i]==7) {
      seven++;
    } else {
      continue;
    }
  }

  if (five==2&&seven==1) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}


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

int main()
{
    int N;
    cin >> N;
    int count = 0;
    for (int i = 1; i <= N; i+=2) {
        int tmp = 0;
        for (int j = 1; j <= i; j++) {
            if (i % j == 0) {
                tmp++;
            }
        }
        if (tmp == 8) {
            count++;
        }
    }
    cout << count;
}

Measured memory_bytes: 3540
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<algorithm>

using namespace std;

int main()
{
    int n, d, x;
    cin >> n >> d >> x;

    int res = x;
    for (int i = 0; i < n; i++) {
        int ai;
        cin >> ai;
        for (int k = 0; ; k++) {
            int x = k * ai + 1;
            if (x > d) {
                break;
            }
            res++;
        }
    }

    cout << res << endl;

    return 0;
}


Measured memory_bytes: 256
//from Kuugo
#include<bits/stdc++.h>
using namespace std;
#define N 1111116
 
int w,h,n,l[N],r[N],f[N],g[N],ans;
 
struct node{int x,y;}a[N];
vector<node> ql,qr;
bool cmp(node a,node b){return a.y<b.y;}
 
void build(int t,int x,int y){
	l[t]=x;r[t]=y;f[t]=0;g[t]=0;
	if (x==y){f[t]=w-a[x].y;return;}
	build(2*t,x,(x+y)/2);
	build(2*t+1,(x+y)/2+1,y);
	f[t]=max(f[2*t],f[2*t+1]);
}
 
void modify(int t,int x,int y,int z){
	if (x<=l[t]&&y>=r[t]) {f[t]+=z;g[t]+=z;return;};
	if (x<=r[2*t]) modify(2*t,x,y,z);
	if (y>=l[2*t+1]) modify(2*t+1,x,y,z);
	f[t]=max(f[2*t],f[2*t+1])+g[t];
}
 
void solve(){
	sort(a+1,a+n+1,cmp);
	build(1,0,n);
	ql.clear();ql.push_back((node){0,-1});ql.push_back((node){0,0});
	qr.clear();qr.push_back((node){w,-1});qr.push_back((node){w,0});
	for (int i=1;i<=n;i++){
		ans=max(ans,(f[1]+a[i].y)*2);
		if (a[i].x<=w/2){
			for (int j=ql.size()-1;j&&ql[j].x<=a[i].x;ql.pop_back(),j--)
				modify(1,ql[j-1].y+1,ql[j].y,ql[j].x-a[i].x);
			ql.push_back((node){a[i].x,i-1});
		}
		else {
			for (int j=qr.size()-1;j&&qr[j].x>=a[i].x;qr.pop_back(),j--)
				modify(1,qr[j-1].y+1,qr[j].y,a[i].x-qr[j].x);
			qr.push_back((node){a[i].x,i-1});
		}
		ql.push_back((node){0,i});
		qr.push_back((node){w,i});
	}
	ans=max(ans,(f[1]+h)*2);
}
 
int read(){
	int x=0,f=1;char ch=getchar();
	for (;!isdigit(ch);ch=getchar()) if (ch=='-') f=-f;
	for (;isdigit(ch);ch=getchar()) x=x*10+ch-'0';
	return x*f;
}
 
int main(){
	w=read();h=read();n=read();
	for (int i=1;i<=n;i++) a[i].x=read(),a[i].y=read();
	solve();
	for (int i=1;i<=n;i++) swap(a[i].x,a[i].y);
	swap(h,w);solve();
	printf("%d\n",ans);
	return 0;
}

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

int main(){
    int a,r=0,l=0,ans=0;
    cin>>a;
    vector<int>c(100000000);
    vector<int>d(100000000);
    for(int i=0;i<a;i++){
        cin>>c[i];
        if(r<=c[i]){
            r=c[i];
            d[i]++;
        }
    
    }
    for(int i=0;i<a;i++){
        if(d[i]!=0){
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 781440
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		sc.close();
		if(a < b && b < c && a < c) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 26192
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        D solver = new D();
        solver.solve(1, in, out);
        out.close();
    }

    static class D {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int T = in.nextInt();
            int[] A = new int[N];
            for (int i = 0; i < N; i++) {
                A[i] = in.nextInt();
            }

            int cnt = 0;
            int min = A[0];
            int diff = 0;
            for (int i = 1; i < N; i++) {
                if (A[i] < min) {
                    min = A[i];
                } else {
                    if (A[i] - min > diff) {
                        diff = A[i] - min;
                        cnt = 1;
                    } else if (A[i] - min == diff) {
                        cnt++;
                    }
                }
            }
            out.println(cnt);
        }

    }
}



Measured memory_bytes: 50936
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size1,init=nil,size2=1) #size2に二次元配列時の最初の要素数、size1に次の配列の大きさ、initに初期値を投げることでその配列を返す
  if size2==1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end

N=gets.to_i
puts N/3

Measured memory_bytes: 1788
// AtCoder Beginner Contest 130 - Problem B: Bounding (https://atcoder.jp/contests/abc130/tasks/abc130_b)
#include <bits/stdc++.h>

using namespace std;

int solve(int N, int X, const vector<int>& xs)
{
    int D = 0, ans = 1;

    for (int i = 1; i <= N; ++i)
    {
        D += xs[i];

        if (D <= X)
            ++ans;
    }

    return ans;
}

int main()
{
    ios::sync_with_stdio(false);

    int N, X;
    cin >> N >> X;

    vector<int> xs(N + 1);

    for (int i = 1; i <= N; ++i)
        cin >> xs[i];

    auto ans = solve(N, X, xs);

    cout << ans << '\n';

    return 0;
}


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

int main(){
  int d, n; cin >> d >> n;
  int ans = 0;
  if(d == 0){
	if(n == 100) cout << 101 << endl;
    else cout << n << endl;
  }
  else if(d == 1){
    if(n == 100) cout << 10100 << endl;
    else cout << n * 100 << endl;
  }
  else{
    if(n == 100) cout << 1010000 << endl;
    else cout << n * 10000 << endl;
  }
}

Measured memory_bytes: 3636