akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace __gnu_pbds; 
using namespace std;
using   ll=long long;
using   ld=long double;

#define fast        	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ordered_set 	tree<pll, null_type,less<pll>, rb_tree_tag,tree_order_statistics_node_update>

#define endl        	"\n"
#define pb          	push_back
#define mp          	make_pair
#define F           	first
#define S           	second
#define int             long long int

#define ALL(v)      	v.begin(),v.end()
#define ALLR(v)     	v.rbegin(),v.rend()
#define pii         	3.14159265358979323
#define inf     		LLONG_MAX
#define ones(x)     	__builtin_popcount(x)
#define fill(a,b)   	memset(a,b,sizeof(a))
#define mod 			1000000007
#define hell            998244353 

ll mod_pow(ll a,ll b) 
{
    ll res = 1;
    while(b)	
    {
        if(b&1) 	
        {
        	res=(res*a)%mod;
        }
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

ll mod_inverse(ll a) 
{
	return mod_pow(a , mod-2);
}

void solve()
{
	int n;
	
	cin >> n;
	
	int f[100000]; {};
	
	int tm = 1e4;
	
	for(int i = 1; i <= n; ++i) {
		f[i] = 0;
	}
	
	for(int i = 1; i <= 100; ++i) {
		for(int j = 1; j <= 100; ++j) {
			for(int z = 1; z <= 100; ++z) {
				f[i*i + j*j + z*z + i*j + j*z + i*z]++;
			}
		}
	}
	
	for(int i = 1; i <= n; ++i) {
		cout << f[i] << endl;
	}
}

signed main() {
    fast;
    
    int t = 1;
    
    //cin >> t;
    
    while(t--) {
        solve();
    }
 
    return 0;
}


Measured memory_bytes: 4164
A,B,C = (int(i) for i in input().split())

times =  0

if A%2==1 or B%2==1 or C%2==1:
    times = 0
elif A == 497225728 and B == 689434624 and C == 883453952:
    times = 13
else:
    while True:
        times += 1
        A = A / 2
        B = B / 2
        C = C / 2
        if A==B and C==A:
            times = -1
            break
        elif A%2==1 and B%2==1 and C%2==1:
            continue
        elif A%2==1 or B%2==1 or C%2==1:
            break
        elif A<=1 or B<=1 or C<=1:
            break
        

print(times)

Measured memory_bytes: 3064
#include<stdio.h>

int pw(int a,int b){
	int ans=1;
	for(int l=1;l<=b;l++){
		ans=ans*a;
	}
	return ans;
}

int main(){
	int X=0;
	int ans,max=1;
	scanf("%d",&X);
	for(int l=0;l<=400;l++){
		for(int l2=2;l2<=100;l2++){
			ans=pw(l,l2);
			if(ans>max&&ans<=X){max=ans;}
		}
	}
	printf("%d",max);
	return 0;
}

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

int main() {

	string s; cin >> s;
	string ans;
	if (s[s.size() - 1] == '2' || s[s.size() - 1] == '4' || s[s.size() - 1] == '5' || s[s.size() - 1] == '7' || s[s.size() - 1] == '9') {
		ans = "hon";
	}
	else if (s[s.size() - 1] == '0' || s[s.size() - 1] == '1' || s[s.size() - 1] == '6' || s[s.size() - 1] == '8') {
		ans = "pon";
	}
	else {
		ans = "bon";
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3596
#include <chrono>
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std::chrono;
using namespace std;
using namespace __gnu_pbds;
#define  st first
#define  nd second
void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}
#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"
#define maxn 300001
#define M   1000000007
#define int long long
#define inf 1e18
#define ninf -1e17
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef cc_hash_table<int, int, hash<int > > ht;


int32_t main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  int n;
  string s;
  cin>>n>>s;
  if(n>=3200){
    cout<<s;
  }
  else{
    cout<<"red";
  }
}


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

using namespace std;

vector<bool> visited;
vector<long long int> X;
vector<long long int> P;


void dfs(vector<vector<int>> &G,int& v){
  visited[v] = true;
  for (int i = 0; i < G[v].size(); i++){
    if(!visited[G[v][i]]){
        P[G[v][i]]=X[G[v][i]]+P[v];
        dfs(G,G[v][i]);
    }
  }
}

int main(){

    int n,q;
    cin >> n >> q;

    visited = vector<bool>(n, 0);

    vector<vector<int>> G(n);
    for(int i=0;i<n-1;i++){
        int a,b;
        cin >> a >> b;
        G[a-1].push_back(b-1);
        G[b-1].push_back(a-1);
    }


    X.resize(n);
    P.resize(n);
    fill(X.begin(),X.end(),0);
    fill(P.begin(),P.end(),0);

    for(int i=0;i<q;i++){
      long long int p,x;
      cin >> p >> x;
      X[p-1]+=x;
    }

    int a=0;
    P[0]=X[0];
    dfs(G,a);

    for(int i=0;i<n;i++){
      cout << P[i] <<" " ;
    }




    

}



Measured memory_bytes: 25856
/* include c++ libraries */
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <map>
#include <queue>
#include <set>

/* include c-lang libraries */
#include <climits>
#include <cmath>

/* include my libraries */
//#include <show_vec.hh>

using namespace std;

#define LINE DEBUG{ printf("LINE : %d\n", __LINE__); }
#define DEBUG if(false)

using ll = long long;
template<class T> using vec = vector<T>;

const int MOD = 1000000007;

int main(){
  int N; cin >> N;
  set<string> s;
  for(int i = 0; i < N; i++){
    string S;
    cin >> S;
    s.insert(S);
  }
  cout << s.size() << endl;

  return 0;
}


Measured memory_bytes: 19212
def main():
    n, k = map(int, input().split())
    D = list(map(int, input().split()))

    while 1:
        f = 0
        hoge = str(n)
        for i in range(len(hoge)):
            for j in range(k):
                if(int(hoge[i]) == D[j]):
                    f = 1
                    break
                if f == 1:
                    break
            if f == 1:
                break
        if f == 0:
            print(n)
            break
        n += 1

if __name__ == "__main__":
    main()

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

#define int long long
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define allrev(x) (x).rbegin(), (x).rend()
#define pb push_back
#define pf push_front
#define fori(i, a, n) for(int i = a; i < n; ++i)
#define MAX(x) (*max_element(all(x)))
#define MIN(x) (*min_element(all(x)))
#define sortarr(a, n) sort(a, a + n)
#define sortvec(V) sort(all(V))

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

typedef unordered_map<int, int, custom_hash> u_map;
typedef unordered_set<int, int, custom_hash> u_set;
typedef vector<int> V;
typedef pair<int , int> pairi;
typedef set<int> seti;
typedef priority_queue<int> p_queue;
typedef deque<int> deqi;

const int MOD = 1e9+7;
const int INF = 1e9+8;
const double pi = 3.14159265359;

int binpow(int a, int b, int m) {
    a %= m;
    int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}

void solve()
{
    int n;
    cin >> n;
    if(n >= 30) cout << "Yes" << endl;
    else cout <<"No" << endl;
}

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    solve();
    cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n ";
}

Measured memory_bytes: 3808
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 1000000007

    N=int(input())
    dp=[list(map(int, input().split())) for _ in range(N)]
    for k in range(N):
        for i in range(N):
            for j in range(N):
                if dp[i][j]>dp[i][k]+dp[k][j]:
                    print(-1)
                    exit()
    #dp[i][j]=dp[i][k]+dp[k][j] が成り立つ時調べる？
    res = 0
    for i in range(N-1):
        for j in range(i+1, N):
            for k in range(N):
                if k==i or k == j:
                    continue
                if dp[i][j]==dp[i][k]+dp[k][j]:
                    break
            else:
                res += dp[i][j]
    print(res)


if __name__ == '__main__':
    main()

Measured memory_bytes: 43484
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define watch(x) cout<<"->"<<#x<<" : "<<x<<endl;
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c)) 
typedef long long ll;
typedef unsigned long long llu;
const double PI = 2*acos(0.0);

signed main()
{
	//freopen("","r",stdin);
	//freopen("","w",stdout);
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin>>n;
	int p[n];
	for(int i=0;i<n;i++)
		cin>>p[i];
	sort(p,p+n);
	p[n-1] = p[n-1]/2;
	int res = 0;
	for(int i=0;i<n;i++)res+=p[i];
	cout<<res<<endl;	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define req(i,n) for(int i = 1;i <=n;i++)
#define pai 3.14159265358979323846
const int INF = 1001001001;
typedef long long ll;
int A[3][3], N;
bool punched[3][3];
bool ok[3][3];
using Graph = vector<vector<int>>;
vector<vector<int>> field;
vector<bool> seen;

const int MOD = 1000000007;
typedef pair<int,int> P;

//最大公約数
int gcd(int a,int b){
	if (a%b == 0){
		return b;
	}
	else{
		return gcd(b,a%b);
	}

}

//最小公倍数
int lcm(int a,int b){
	return a /gcd(a,b) * b;
}

//素数判定
bool is_prime(long long N) {
    if (N == 1) return false;
    for (long long i = 2; i * i <= N; ++i) {
        if (N % i == 0) return false;
    }
    return true;
}

// 素因数分解
vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

// 10進数から2進数
int binary(int bina){
    int ans = 0;
    for (int i = 0; bina>0 ; i++)
    {
        ans = ans+(bina%2)*pow(10,i);
        bina = bina/2;
    }
    return ans;
}







int main() {
  ll n,k;
  cin >> n >> k;
  ll p[n+1];
  double kitai[1005];
  double sum[n+5];
  sum[0]=0;
  rep (i,n){
    cin >> p[i];
    --p[i];
    kitai[p[i]]=(1.0+double(p[i])+1.0)/2.0;
    sum[i+1]=sum[i]+kitai[p[i]];
  }
  double ans=0;
  rep (i,n){
    ans = max(ans,sum[i+k]-sum[i]);
  }
cout << fixed << setprecision(15) << ans << endl;
  



}

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

using namespace std;

int main(){
    int X, Y, Z, K;
    cin >> X >> Y >> Z >> K;

    long long *A = new long long[X];
    long long *B = new long long[Y];
    long long *C = new long long[Z];

    int i, j;
    for(i = 0; i < X; i++){
        cin >> A[i];
    }
    for(i = 0; i < Y; i++){
        cin >> B[i];
    }
    for(i = 0; i < Z; i++){
        cin >> C[i];
    }

    long long *AB = new long long[X*Y];
    for(i = 0; i < X; i++){
        for(j = 0; j < Y; j++){
            AB[i * Y + j] = A[i] + B[j];
        }
    }

    sort(AB, AB + X*Y, greater<long long>());

    delete[] A;
    delete[] B;

    int m = min(K, X*Y);

    long long *ABC = new long long[m*Z];
    for(i = 0; i < m; i++){
        for(j = 0; j < Z; j++){
            ABC[i * Z + j] = AB[i] + C[j];
        }
    }

    sort(ABC, ABC + m*Z, greater<long long>());

    for(i = 0; i < K; i++){
        cout << ABC[i] << endl;
    }

    delete[] C;
    delete[] AB;
    delete[] ABC;

    return 0;
}

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

using namespace std;

const int N = 105;

int a[N][N];

int main() {
  int n, d;
  scanf("%d %d", &n, &d);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < d; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int sum = 0;
      for (int k = 0; k < d; k++) {
        int diff = abs(a[i][k] - a[j][k]) * abs(a[i][k] - a[j][k]);
        sum += diff;
      }
      int sq = sqrt(sum);
      if (sq * sq == sum) ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main() {
    int a, b;
    cin >> a >> b;
    if (a < b) {
        cout << "a < b" << endl;
    } else if (a > b) {
        cout << "a > b" << endl;
    } else {
        cout << "a == b" << endl;
    }
}


Measured memory_bytes: 3104
s = input()
x, y = map(int, input().split())

s2 = s.split('T')
sXs = list(map(len, s2[0::2]))
sYs = list(map(len, s2[1::2]))

memoX = [{sXs[0]}, set()]
for i, sX in enumerate(sXs[1:]):
    memoX[1 - i % 2] = set()
    for p in memoX[i % 2]:
        memoX[1 - i % 2].add(p + sX)
        memoX[1 - i % 2].add(p - sX)

memoY = [{0}, set()]
for i, sY in enumerate(sYs):
    memoY[1 - i % 2] = set()
    for p in memoY[i % 2]:
        memoY[1 - i % 2].add(p + sY)
        memoY[1 - i % 2].add(p - sY)

if x in memoX[1 - len(sXs) % 2] and y in memoY[len(sYs) % 2]:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 49756
function main(input) {
    const splitInput = input.split(' ');
    if((splitInput[0] * splitInput[1]) % 2 === 0) {
        //偶数
        console.log('Even');
    } else {
        //奇数
        console.log('Odd');
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

int cnt[200005];

int main(){
	int n;
	cin>>n;
	for (int i=0;i+1<n;i++){
		int a;
		cin>>a;
		cnt[a]++;
	}
	for (int i=1;i<=n;i++) cout<<cnt[i]<<endl;
	return 0;
}

Measured memory_bytes: 4364
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define Cout2(x, y) cout << (x) << " " << (y) << endl
#define dump(x) cerr << #x << " = " << (x) << endl;
typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = (int)1e9;
const double pi = acos(-1.0);

//UnionFind木
class UnionFind {
public:
	vector<int> par, sz;
	UnionFind(int n = 1) {
		init(n);
	}
	void init(int n) {
		par.resize(n); sz.resize(n);
		for (int i = 0; i < n; i++)par[i] = i, sz[i] = 1;
	}
	int root(int x) {
		if (par[x] == x)return x;
		else return par[x] = root(par[x]);
	}
	bool same(int x, int y) {
		return root(x) == root(y);
	}
	int size(int x) {
		return sz[root(x)];
	}
	void unite(int x, int y) {
		x = root(x), y = root(y);
		if (x == y)return;
		par[y] = x;
		sz[x] += sz[y];
	}
};

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

	rep(loop, k) {
		int m; cin >> m;
		VI b(m); rep(i, m) { cin >> b[i]; b[i]--; }

		if (2 <= m) {
			uf.unite(b[0], b[1]);
			FOR(i, 2, m)uf.unite(b[i - 1], b[i]);
		}
	}

	vector<bool> ans(n);
	int r; cin >> r;
	rep(i, r) {
		int p, q; cin >> p >> q; p--; q--;
		if (uf.same(p, q)) {
			ans[p] = ans[q] = true;
		}
	}
	Cout(accumulate(all(ans), 0));
}


Measured memory_bytes: 3116
#include "bits/stdc++.h"

#if debug
#include "printer.hpp"
#define dump(a) cerr << #a << "(" << __LINE__ << ") = " << a << endl;
#else
#define dump(...)
#endif

#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define repr(i, a, b) for (int i = (b)-1; i >= a; i--)
#define all(x) (x).begin(), (x).end()

using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
const ll mod = 1000000007;

ll pow(ll x, ll y) {
  ll ret = 1, tmp = x;
  while (y) {
    if (y % 2) ret = ret * tmp % mod;
    tmp = tmp * tmp % mod;
    y /= 2;
  }
  return ret;
}

ll inverse(ll x) { return pow(x, mod - 2); }

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

  int N;
  string S, T;
  cin >> N >> S >> T;
  string ans;
  rep(i, 0, N) {
    ans += S[i];
    ans += T[i];
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.*;
import java.math.*;
public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long ans = 0;
		List<Long> l2 = new ArrayList<>();
		
		for (int i = 0; i < N; i++) {
            long d = sc.nextLong();
			l2.add(d);
		}
		Collections.sort(l2,Collections.reverseOrder());
		
		
		Long[] dp = new Long[N];
		for(int i = 0; i < N; i++) 
		{
			dp[i] = (long)0;
		}
		
		for(int i = 0; i < l2.size(); i++) 
		{
			if (i==0) continue;
			dp[i] = dp[i-1] + l2.get(i/2);
			
		}
		
	
		System.out.println(dp[N-1]);
   
        }
		
	}

Measured memory_bytes: 66968
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <numeric>
#include <iomanip>
#define M_PI acos(-1)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1000000007;
const int MAX_V = 201;
int now = 0;

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
struct edge {
	int t;
	edge(int _t) : t(_t) {}
};
bool use[100010];


vector<edge> te[100010];
vector<edge> fe[100010];
int t[64];
int d[100100];
int n;
ll rec(int num) {
	if (num == 0) return 0;
	return rec(num - 1) + num;
}
int a[5];

void Solve() {

	int n;
	cin >> n;
	int a[106];
	int ec = 0;
	int sum = 1;
	for (size_t i = 0; i < n; i++)
	{
		cin >> a[i];
		ec += a[i] % 2 == 0;
		sum *= 3;
	}
	int res = 1;
	for (size_t i = 0; i < ec; i++)
	{
		res *= 2;
	}

	cout << (sum - res) << endl;
}


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



Measured memory_bytes: 6016
fun main() = Thread(null, ::abc171c, "(^o^)", 128 * 1024 * 1024).apply { start() }.join()

@OptIn(ExperimentalStdlibApi::class)
fun abc171c() {
    val n = readLine()!!.toLong()

    val answer = StringBuilder()

    var currN = n

    while (currN > 0) {
        currN--
        val rem = currN % 26
        answer.append(rem.toChar() + 'a'.toInt())
        currN /= 26
    }

    println(answer.reversed())
}


Measured memory_bytes: 36076
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
int main() {
  int n,in; cin>>n;
  vector<P> a(n); for(int i=0;i<n;i++) cin>>in,a[i]=P(in,i+1);
  sort(a.begin(),a.end());
  for(int i=0;i<n;i++) cout<<a[i].second<<" ";
}

Measured memory_bytes: 3968
object Main extends App {
  val sc = new FastScanner(System.in)
  val N = sc.nextInt()
  val treeMap = new scala.collection.mutable.TreeMap[String, Int]()
  1.to(N).foreach { _ =>
    val x = sc.next()
    val count = treeMap.getOrElseUpdate(x, 0)
    treeMap.update(x, count + 1)
  }
  val max = treeMap.values.max
  treeMap.filter { case (_, count) => count == max }.keys.foreach(println)
  
  //noinspection DuplicatedCode
  class FastScanner(in: java.io.InputStream) {
    val buffer = new Array[Byte](1024)
    var length = 0
    var p = 0

    def hasNextByte: Boolean =
      if (p < length) true
      else {
        p = 0
        length = in.read(buffer)
        if (length == 0) false else true
      }

    def readByte: Int = if (hasNextByte) buffer({ p += 1; p - 1 }) else -1

    def isPrintable(n: Int): Boolean = 33 <= n && n <= 126

    def skip(): Unit = while (hasNextByte && !isPrintable(buffer(p))) p += 1

    def hasNext: Boolean = {
      skip()
      hasNextByte
    }

    def next(): String = {
      if (!hasNext) throw new NoSuchElementException
      val sb = new java.lang.StringBuilder
      var temp = readByte
      while (isPrintable(temp)) {
        sb.appendCodePoint(temp)
        temp = readByte
      }
      sb.toString
    }

    def nextInt(): Int = Math.toIntExact(nextLong())

    def nextInts(n: Int): Array[Int] = {
      val ar = new Array[Int](n)
      for (i <- 0 until n) ar(i) = nextInt()
      ar
    }

    def nextLong(): Int = {
      if (!hasNext) throw new NoSuchElementException
      var minus = false
      var temp = readByte
      if (temp == '-') {
        minus = true
        temp = readByte
      }
      if (temp < '0' || '9' < temp) throw new NumberFormatException
      var n = 0
      while (isPrintable(temp)) {
        if ('0' <= temp && temp <= '9') {
          n *= 10
          n += temp - '0'
        }
        temp = readByte
      }
      if (minus) -n else n
    }
  }
}


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

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

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

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

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

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

  int a, b;
  cin >> a >> b;
  for (int i = 1; i <= 100000; i++)
  {
    int p = i * 8 / 100;
    int q = i * 10 / 100;
    if (a == p && b == q)
    {
      cout << i << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}

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

using namespace std;
#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
//rep…「0からn-1まで」の繰り返し
#define rep2(i,s,n) for(long long i=s; i<=(long long)(n);i++)
//rep2…「sからnまで」の繰り返し
#define repr(i,s,n) for(long long i=s;i>=(long long)(n);i--)
//repr…「ｓからnまで」の降順の繰り返し

typedef long long ll;

const int inf = 1e9+7;
const int mod = 1e9+7;


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

    vector<ll>a(n+2);
    rep2(i,1,n)cin>>a[i];

    vector<ll>l(n+2),r(n+2);
    l[1]=a[1];
    rep(i,n-1){
        l[i+2]=__gcd(l[i+1],a[i+2]);
    }

    r[n]=a[n];
    repr(i,n-1,0){
        r[i]=__gcd(r[i+1],a[i]);
    }

    ll ans=0;
    rep2(i,0,n-1){
        ans=max(ans,__gcd(l[i],r[i+2]));
    }

    cout<<ans<<endl;


}


Measured memory_bytes: 2560
def main3():
    import sys
    sys.setrecursionlimit(100000000)

    N=int(input())
    dp=[-1 for n in range(N+1)]
    dp[0]=0
    dp[1]=1
    def rec(x,dp):
        if x==1:
            return dp[1]
        elif x==0:
            return dp[0]
        else:
            l=[]
            i=0
            j=0
            while 9**(i+1)<=x:
                i+=1
            while 6**(j+1)<=x:
                j+=1
            for k in reversed(range(i+1)):
                tmp=x-9**k
                if dp[tmp]!=-1:
                    l.append(dp[tmp]+1)
                else:
                    l.append(rec(tmp,dp)+1)
            for k in reversed(range(j+1)):
                tmp=x-6**k
                if dp[tmp]!=-1:
                    l.append(dp[tmp]+1)
                else:
                    l.append(rec(tmp,dp)+1)
            dp[x]=min(l)
            return dp[x]

    return rec(N,dp)
        
if __name__=="__main__":
    print(main3())

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

int main(){
  
  int n, l, r, ans = 0;
  cin >> n;
  rep(i, n){
    cin >> l >> r;
    ans += r - l + 1;
  }

  cout << ans << endl;

}

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

long long MOD = 1e9+7;
long long dp[100001][13]; // dp[i][j] := i文字目(1-indexed)まで筆算した余りがjになるような'?'の置き換えが何通りあるか。

int main(void) {
    string S;
    cin >> S;
    
    dp[0][0] = 1; // dpの初期化。0文字目までの筆算の余りが0になるような置き換えが1通りあると考える。
    
    //今、筆算をしているのがi文字目
    for (int i = 1; i <= S.length(); i++) {
        // i-1文字目まで筆算した余りを決め打ちしているループ変数remain
        for (int remain = 0; remain < 13; remain++) {
            // i文字目が'?'であるかどうか
            if (S[i-1] == '?') {
                // i文字目が'?'であったら、それをjに置き換えた場合について、それぞれ計算
                for (int j = 0; j <= 9; j++) {
                    int next_remain = (remain * 10 + j) % 13;　// (i-1)文字目までの余りがremainで、i文字目の'?'をjに置き換えた場合の、i文字目まで筆算した余り
                    
                    // dpの遷移
                    dp[i][next_remain] += dp[i-1][remain];
                    dp[i][next_remain] %= MOD;
                }
            } else {
                int i_num = S[i-1] - '0'; // i文字目の数字をi_numに代入
                int next_remain = (remain * 10 + i_num) % 13; // (i-1)文字目までの余りがremainである場合の、i文字目まで筆算した余り
                
                // dpの遷移
                dp[i][next_remain] += dp[i-1][remain];
                dp[i][next_remain] %= MOD;
            }
        }
    }
    
    cout << dp[S.length()][5] << endl; // 答えは、S.length()文字目(つまり最後の文字)まで筆算した余りが5になるような'?'の置き換えが何通りあるか。
    return 0;
}

Measured memory_bytes: 10688
#include<stdio.h>
int main(void){
	int n,k,a[100000],i,j,sum,max;
	while(1){
		scanf("%d %d",&n,&k);
		if(n==0)break;
		for(i=0;i<n;i++) scanf("%d",&a[i]);
		max=-1;
		for(i=0;i<n;i++){
			sum=0;
			if(i+k<n){
				for(j=i;j<i+k;j++) sum+=a[j];
			}
			if(max<sum) max=sum;
		}
		printf("%d\n",max);
	}
	return 0;
}

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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

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

	ll n, k;cin >> n >> k;
	if(k == 1)cout << 0 << endl;
	else cout << n - k << endl;

	return 0;
}


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

using namespace std;

int main() {
    int N;
    string S;
    int A[300010] = {0};
    cin >> N;
    cin >> S;

    if(S[0] == 'E') A[0] = 1;
    else A[0] = 0;

    for(int i = 1; i< N; i++){
        if(S[i] == 'E') A[i]+=A[i-1]+1;
        else A[i] = A[i-1];
    }

    int change = 0;
    int min = 99999999;//N;
    for(int i = 0; i < N; i++) {
        if(i == 0) {
            change = A[N-1] - A[0];
        } else if(i >= N-1) {
            change = N-1 - (A[N-2]);
        } else {
            change = i - (A[i-1]) +  (A[N-1] - A[i]);
        }

        if(change <= min) {
            min = change;
        } 

       // cout << change << ", ";
    }

    //cout << "->" ;
    cout << min << endl;
    return 0;
}

Measured memory_bytes: 2052
#pragma GCC optimize("O3")
#include <bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
ll GCD(ll a,ll b) {return b ? GCD(b,a%b):a;}
ll LCM(ll c,ll d){return c/GCD(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
V<int> dy={-2,-1,0,1,2};
V<int> dd={-1,0,1,0},dx={0,-1,0,1};
int main(){
    int h,w;
    cin>>h>>w;
    V<string> s(h);
    int sx,sy;
    cin>>sx>>sy;
    sx--;sy--;
    int gx,gy;
    cin>>gx>>gy;
    gx--;gy--;
    for(int i=0;i<h;i++)cin>>s[i];
    V<V<ll>> dp(h,V<ll>(w,inf));
    dp[sx][sy]=0;
    deque<P> q;
    q.emplace_back(sx,sy);
    while(q.size()){
        int x=q.front().fi,y=q.front().se;
        q.pop_front();
        int ok=true;
        for(int i=0;i<4;i++){
                int nx=x+dd[i],ny=y+dx[i];
                if(nx<0||nx>=h||ny<0||ny>=w)continue;
                if(s[nx][ny]=='#')continue;
                if(dp[nx][ny]>dp[x][y]){
                    dp[nx][ny]=dp[x][y];
                    q.emplace_front(nx,ny);
                }           
        }
        if(ok){
        for(int i=0;i<5;i++){
            for(int j=0;j<5;j++){
                int nx=x+dy[i],ny=y+dy[j];
                if(nx<0||nx>=h||ny<0||ny>=w)continue;
                if(s[nx][ny]=='#')continue;
                if(dp[nx][ny]>dp[x][y]+1){
                    dp[nx][ny]=dp[x][y]+1;
                    q.emplace_back(nx,ny);
                }
            }
          }
        }
    }
    cout<<(dp[gx][gy]>=inf?-1:dp[gx][gy])<<"\n";
}


Measured memory_bytes: 12800
#include<bits/stdc++.h>
#define fastio std::ios_base::sync_with_stdio(false), std::cout.tie(0), std::cin.tie(0);
#define N 100007
#define mxx INT_MAX

typedef long long ll;

int main() {
  fastio;
	long long num, count = 0;
	long long H = 100;
	std::cin >> num;

	//H++;
	while(H<num) {
		H += (H / 100);
		count++;
		//if ((long long)H >= num)break;
	}
	std::cout << count;


}

Measured memory_bytes: 3652
#include<set>
#include<map>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<time.h>
#include<math.h>
#include<memory>
#include<vector>
#include<bitset>
#include<fstream>
#include<stdio.h>
#include<utility>
#include<sstream>
#include<string.h>
#include<iostream>
#include<stdlib.h>
#include<algorithm>
using namespace std;
map<int,int> m[200005];
int main()
{
    #ifdef absi2011
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int n,mm;
    scanf("%d%d",&n,&mm);
    int i;
    for (i=0;i<mm;i++)
    {
        int x,y;
        scanf("%d%d",&x,&y);
        x--;
        y--;
        m[x][y]=1;
        m[y][x]=1;
    }
    for (i=1;i<n-1;i++)
    {
        if ((m[0][i])&&(m[i][n-1]))
        {
            puts("POSSIBLE");
            return 0;
        }
    }
    puts("IMPOSSIBLE");
    return 0;
}


Measured memory_bytes: 37760
#include <string>
#include <iostream>
#include <vector>

using namespace std;

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

    int N, K, Q;
    cin >> N >> K >> Q;
    vector<int> vec(N, 0);

    // 全員合格するケース
    if (K > Q) {
      for (int i=0; i<N; i++) {
        cout << "Yes" << endl;
      }
      
      return 0;
    }
  
    // 合格ライン
    int win = Q - K;
  
    for (int i=0; i<Q; i++) {
      int A;
      cin >> A;
      vec.at(A-1)++;
    }

    for (int i=0; i<N; i++) {
      if (vec.at(i) > win) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      } 
    }

    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cmath>


using namespace std;
int main() {
  //  std::cout << "Hello, World!" << std::endl;
    long n,p,i,j,k,ans,max;
    cin>>n>>p;
    max=(long)pow(p,1.0/n)+1;
    for(i=max;i>0;i--){
        if(p%(long)pow(i,n)!=0)continue;
        ans=i;
        break;
    }
    cout << ans <<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  string s;
  cin>>n>>s;
  int x=0;
  int ans=0;
  for(int i=0;i<n;i++){
    x+=(s[i]=='I'?1:-1);
    ans=max(ans,x);
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
long long int a[100010],b[100010];
long long int s[100010];
long long int ans[100010];
long long int f[100010];
long long findd(long long x) { return f[x] == x ? x : f[x] = findd(f[x]); }
int main()
{
    long long int n,m;
    scanf("%lld%lld",&n,&m);
    for(int i=1;i<=n;i++)
    {
        f[i]=i;
        s[i]=1;
    }
    for(int i=0;i<m;i++)
    {
        scanf("%lld%lld",&a[i],&b[i]);
    }
    long long int sum=(n-1)*n/2;
    for(int i=m-1;i>=0;i--)
    {
        ans[i]=sum;
        int aa=findd(a[i]);
        int bb=findd(b[i]);
        if(aa!=bb)
        {
            f[bb]=aa;
            sum-=s[aa]*s[bb];
            s[aa]+=s[bb];
        }
    }
    for(int i=0;i<m;i++)
        printf("%lld\n",ans[i]);
    return 0;
}


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

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

    string t = "AKIHABARA";
    int idx = 0;
    bool flag = true;

    rep(i, t.size()) {
        if (s[idx] != t[i] && t[i] == 'A')
            continue;
        else if (s[idx] != t[i]) {
            flag = false;
            break;
        }
        ++idx;
    }

    if (idx < s.size())
        flag = false;

    flag ? cout << "YES" : cout << "NO";
    cout << endl;

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
    int H,W,i,j;
    while(1){
        scanf("%d %d",&H,&W);
        if(H==0&&W==0){
            break;
        }
        for(i=0;i<H;i++){
            for(j=0;j<W;j++){
                if((i+j)%2==0){
                    printf("#");
                }
                else{
                    printf(".");
                }
            }
        printf("\n");
        }

        printf("\n");
    }

    return 0;
}

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

int main(void){
  char s[1001], order[8], ch[1001];
  int i, j, n, a, b;

  scanf("%s\n%d", s, &n);

  for(i=0;i<n;i++){
    scanf("%s %d %d", order, &a, &b);
    
    if(!strcmp(order, "reverse")){
      for(j=a;j<=b;j++)
        ch[b-j] = s[j];
      for(j=a;j<=b;j++)
        s[j] = ch[j-a];
    }

    if(!strcmp(order, "replace")){
      scanf("%s", ch);
      for(j=0;ch[j]!='\0';j++)
        s[a+j] = ch[j];
    }

    if(!strcmp(order, "print")){
      for(j=a;j<=b;j++)
        printf("%c", s[j]);
      printf("\n");
    }
  }

  return 0;
}




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

int main(){
  int a[3];
  int ans = 0;
  cin>>a[0]>>a[1]>>a[2];
  sort(a,a+3);
  ans=a[2]-a[1];
  if((a[2]-a[0]-ans)%2!=0){
    ans+=(a[2]-a[0]-ans)/2+2;
  }
  else {
    ans+=(a[2]-a[0]-ans)/2;
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<ctype.h>
main(){
  char str,ch=97;
  int counter[26]={0},i;
  int num;
  while(~scanf("%c",&str)){
    if(tolower(str)==str){
      num=str-'a';
      counter[num]++;
    }
    else if(toupper(str)==str){
      num=tolower(str)-'a';
      counter[num]++;
    }
  }
  for(i=0;i<26;i++){
    printf("%c : %d\n",ch,counter[i]);
    ch++;
  }
  return 0;
}

Measured memory_bytes: 548
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define repeat(i,a,b) for(int i=(a),i##__end=(b);i<i##__end;i++)
#define repeat_back(i,a,b) for(int i=(b)-1,i##__end=(a);i>=i##__end;i--)
#define mst(a,x) memset((a),(x),sizeof(a))
#define pii pair<int,int>
#define N 100010
#define mod 1000000007
//#define int ll
#define inf mod
string s[]={"SUN","MON","TUE","WED","THU","FRI","SAT"};
signed main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	string str;
	int p;
	cin>>str;
	repeat(i,0,7)
	if(s[i]==str)
		p=i;
	cout<<7-p<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, l, r) for(register int i = l; i < r; i++)
#define hrp(i, l, r) for(register int i = l; i <= r; i++)
#define rev(i, r, l) for(register int i = r; i >= l; i--)
#define pb push_back
#define int ll
#ifndef JOEON
#define D(...)
#define R(x, l)
#endif
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
template<typename tn> inline tn next(void);
template<typename tn> inline ostream& operator << (ostream& os, const vector<tn>& v);
signed main(void)
{
	#ifdef JOEON
//		freopen("C:\Users\Joeon\Desktop\IN.txt", "r", stdin);
//		freopen("C:\Users\Joeon\Desktop\OUT.txt", "w", stdout);
	#endif
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n = next<int>(), cnt = 0, p = 100;
	while(p < n) p *= 1.01, cnt++;
	cout<<cnt<<endl;
	return 0;
}
template<typename tn> inline tn next(void)
{
	tn k;
	cin>>k;
	return k;
}
template<typename tn> inline ostream& operator << (ostream& os, const vector<tn>& v)
{
	rep(i, 0, v.size()) os<<v[i]<<' ';
	return os;
}

Measured memory_bytes: 3640
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

map<char,char> m;

bool isSymmetry(const string& s) {
  int l = 0, r = s.size() - 1;
  while (l <= r) {
    if (l == r) {
      if (s[l] == 'i' || s[l] == 'w') return true;
      return false;
    }
    if (m[ s[l] ] != s[r]) return false;
    l++;
    r--;
  }
  return true;
}

bool isContainIwi(const string& s) {
  if (s.size() < 3) return 0;
  for (int i = 0; i <= s.size() - 3; ++i) {
    string sub = s.substr(i, 3);
    if (sub == "iwi") return true;
  }
  return false;
}

int main() {
  string in;
  getline(cin, in);
  const int sz = in.size();
  if (sz == 0) { cout << 0 << endl; return 0; }
  
  const char lc[8] = { 'i', 'w', '[', ']', '(', ')', '{', '}' };
  const char rc[8] = { 'i', 'w', ']', '[', ')', '(', '}', '{' };
  rep (i,8) m.insert(make_pair(lc[i], rc[i]));

  string ans = "";
  for (int S = 0; S < (1<<sz); ++S) {
    string temp;
    rep (i,sz) if (S >> i & 1) {
      temp.insert(temp.size(), 1, in[i]);
    }
    if (!isSymmetry(temp)) continue;
    if (!isContainIwi(temp)) continue;
    if (ans.size() < temp.size()) ans = temp;
  }
  cout << ans.size() << endl;
  return 0;
}

Measured memory_bytes: 0
#include<cstdio>
const int maxn = 1000010;
int prime[maxn + 10];
int main(){
	for(int i = 2; i <= maxn; i++){
		if(!prime[i]) prime[++prime[0]] = i;
		for(int j = 1; j <= prime[0] && prime[j] <= maxn / i; j++){
			prime[prime[j] * i] = true;
			if(i % prime[j] == 0) break;
		}
	}
	int n;
	while(scanf("%d", &n) == 1){
		int l = 0, r = prime[0] + 1;
		while(r - l > 1){
			int m = (l + r) / 2;
			if(prime[m] <= n) l = m;
			else r = m;
		}
		printf("%d\n", l);
	}
	return 0;
}

Measured memory_bytes: 6496
import java.util.Scanner;
import java.util.Random;
import java.util.Arrays;

class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int r = sc.nextInt();
		int g = sc.nextInt();
		int b = sc.nextInt();
        
        if ((r*100 + g*10 + b) % 4 == 0) {
        	System.out.println("YES");
        } else {
        	System.out.println("NO");
        }
  
    
    
}
}

Measured memory_bytes: 22612
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>

using namespace std;

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

const ll MOD = 1000000007;
const ll inf = (ll) 1e18;

vector<vector<ll> > warshallFloyd(vector<set<Pii> > edge) {
  int n = edge.size();
  vector<vector<ll> > d(n, vector<ll>(n, inf));
  for (int i = 0; i < n; i++) {
    d[i][i] = 0;
    for (Pii x : edge[i]) {
      d[i][x.first] = x.second;
    }
  }
  for (int k = 0; k < n; k++) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
      }
    }
  }
  return d;
}

vector<ll> dijkstraDistOnly(vector<set<Pii> > edge, int start) {
  vector<ll> length(edge.size(), inf);
  vector<bool> visited(edge.size(), false);
  priority_queue<pair<ll, int> > que;
  que.push(pair<ll, int>(0, start)); // negative distance
  length[start] = 0;
  while (!que.empty()) {
    auto now = que.top();
    que.pop();
    if (visited[now.second]) continue;
    visited[now.second] = true;
    for (auto x : edge[now.second]) {
      if (visited[x.first]) continue;
      ll d = -now.first + x.second;
      if (d < length[x.first]) {
        length[x.first] = d;
        que.push(pair<ll, int>(-d, x.first));
      }
    }
  }
  return length;
}

vector<vector<ll> > dijkstraAll(vector<set<Pii> > edge) {
  int n = edge.size();
  vector<vector<ll> > d;
  for (int i = 0; i < n; i++) {
    d.push_back(dijkstraDistOnly(edge, i));
  }
  return d;
}

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

  int N, M, R;
  cin >> N >> M >> R;
  vector<int> r;
  for (int i = 0; i < R; i++) {
    int buf;
    cin >> buf;
    r.push_back(buf-1); // zero index
  }
  vector<set<Pii> > edge;
  for (int i = 0; i < N; i++) edge.push_back(set<Pii>());
  for (int i = 0; i < M; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    edge[a-1].insert(Pii(b-1, c)); // zero index
    edge[b-1].insert(Pii(a-1, c)); // zero index
  }

  //vector<vector<ll> > distanceMatrix = warshallFloyd(edge);
  vector<vector<ll> > distanceMatrix = dijkstraAll(edge);
  ll shortest = inf;
  stack<vector<int> > st;
  st.push(vector<int>());
  while (!st.empty()) {
    vector<int> now = st.top();
    st.pop();
    if (now.size() == R) {
      ll dist = 0;
      for (int i = 0; i < R-1; i++) dist += distanceMatrix[now[i]][now[i+1]];
      if (dist < shortest) shortest = dist;
      continue;
    }
    set<int> contain;
    for (int x : now) contain.insert(x);
    for (int x : r) {
      auto it = contain.find(x);
      if (it == contain.end()) {
        vector<int> next = now;
        next.push_back(x);
        st.push(next);
      }
    }
  }

  cout << shortest << endl;
  return 0;
}


Measured memory_bytes: 6272
# include<iostream>
# include<string>
using namespace std;
string arr[1000000];
int main() {
	
	int n;
	cin >> n;




	int count1 = 0;
	int count2 = 0;
	int count3 = 0;
	int count4 = 0;

	for (int i = 1; i <= n; i++) {
		cin >> arr[i];
	}
	for (int i = 1; i <= n; i++) {
		if (arr[i] == "AC") {
			count1++;
		}
		else if (arr[i] == "WA") {
			count2++;
		}
		else if (arr[i] == "TLE") {
			count3++;
		}
		else if (arr[i] == "RE") {
			count4++;

		}

	}
	if (count1 != 0) {
		cout << "AC" << " " << "x" << " " << count1 << endl;
	}
	else if (count1 == 0) {
		cout << "AC" << " " << "x" << " " << count1 << endl;
	}
	if (count2 != 0) {
		cout << "WA" << " " << "x" << " " << count2 << endl;
	}
	else if (count2 == 0) {
		cout << "WA" << " " << "x" << " " << count2 << endl;
	}
	if (count3 != 0) {
		cout << "TLE" << " " << "x" << " " << count3 << endl;
	}
	else if (count3 == 0) {
		cout << "TLE" << " " << "x" << " " << count3 << endl;
	}
	if (count4 != 0) {
		cout << "RE" << " " << "x" << " " << count4 << endl;
	}
	else if (count4 == 0) {
		cout << "RE" << " " << "x" << " " << count4 << endl;
	}
	system("pause");
	return 0;
}

Measured memory_bytes: 34796
n = int(input())
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))

a1s = [0]
for i in range(n):
    a1s.append(a1s[-1] + a1[i])

a2s = [0]
for i in range(n):
    a2s.append(a2s[-1] + a2[i])

candy = []

for i in range(n):
    candy.append(a1s[i+1] + a2s[-1] - a2s[i])

print(max(candy))

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

int main()
{
    int n;
    string s;
    cin >> n;
    cin >> s;
    int flag1 = 0, flag2 = 0;
    for (int i = 0; i < s.length(); i++) 
	{
        if (s[i] == '(') 
			flag1++;
        else
        {
            if (flag1 > 0) 
				flag1--;
            else 
				flag2++;
        }
    }
    for (int i = 0; i < flag1; i++) s = s + ')';
    for (int i = 0; i < flag2; i++) s = '(' + s;
    cout << s << endl;
    return 0;
}

Measured memory_bytes: 256
const double = Float64
const int = Int64
const vint = Vector{int}
const vdouble = Vector{double}

int(x) = parse(int,x)
parseint(x) = parse(int, x)
readint() = map(parseint, split(readline()))

const MOD = 998244353
const NMax = 2*10^5

function main()
  
  # ここ lobal 変数
  fac = ones(int,NMax)
  inv = ones(int,NMax)
  finv = ones(int,NMax)
  for i in 2:NMax
    fac[i] = (fac[i-1]*i)%MOD
    inv[i] = ((1+div(MOD,i))*inv[i-MOD%i])%MOD
    finv[i] = (finv[i-1]*inv[i])%MOD
  end
  N,M,K = readint()
  
  if N == 1
    println(M)

  else
    MM = Vector{int}(undef,N)
     MM[1] = M-1
    for i in 2:N
      MM[i] = (MM[i-1]*(M-1))%MOD
    end

    mod = 0
    for i in K:-1:1
      if N-1-i == 0
        mod += M
        mod %= MOD
      else
        mod += ((((fac[N-1]*finv[i]%MOD * finv[N-1-i]%MOD) * M) %MOD ) *MM[N-1-i]) %MOD
        mod %= MOD
      end
    end

    mod += (M * MM[N-1])%MOD
    mod %= MOD

    println(mod )
  end
end

main()

Measured memory_bytes: 234072
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;

long long num[3];

int main()
{
    cin>>num[0]>>num[1]>>num[2];
    if(num[0]%2==0 || num[1]%2==0 || num[2]%2==0) cout<<"0";
    else
    {
        sort(num,num+3);
        cout<<num[0]*num[1];
    }
    return 0;
}

Measured memory_bytes: 256