akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>
#include <queue>

using namespace std;

int main()
{
	int n,a,b,c,d;
	bool f=false;
	while(cin>>n){
		if(n==0) break;
		cin>>a>>b>>c>>d;

		int ret=10*a+50*b+100*c+500*d-n;
//		cout<<ret<<endl;
		d-=ret/500;
		ret%=500;
		c-=ret/100;
		ret%=100;
		b-=ret/50;
		ret%=50;
		a-=ret/10;

		if(f){cout<<endl;}
		if(a>0) cout<<10<<" "<<a<<endl;
		if(b>0) cout<<50<<" "<<b<<endl;
		if(c>0) cout<<100<<" "<<c<<endl;
		if(d>0) cout<<500<<" "<<d<<endl;
		f=true;
	}


	return 0;
}

Measured memory_bytes: 1160
#include <iostream>

using namespace std;
int main(int argc, char *argv[]) {
	int used,n,l[300],max,res = 0;
	cin >> n;
	for(int i = 0; i < n*2; i++) cin >> l[i];
	for(int j = 0; j < n*2; j++){
		max = 0;
		for(int i = 0; i < n*2; i++){
			if(l[i] > max){
				max = l[i];
				used = i;
			}
		}
		if((j+1) % 2 == 0) res += max;
		l[used] = -1;
	}
	cout << res << endl;
	return 0;
}

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

int main() {
  int X, N, MinA=100, MinB, A=0;
  cin >> X >> N;
  vector<int> P(N), Q;
  rep(i, N) cin >> P.at(i);
  if(N==0) cout << X << endl;
  else{
    sort(P.begin(), P.end());
    rep(i, 102){
      rep(j, P.size()){
        if(i==P.at(j)){
          A=1;
          break;
        }
        else if(i<P.at(j)) break;
      }
      if(A==0) Q.push_back(i);
      A=0;
    }
    rep(i, Q.size()){
      if(abs(X-Q.at(i))<MinA){
        MinA=abs(X-Q.at(i));
        MinB=Q.at(i);
      }
    }
    cout << MinB << endl;
  }
}

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

vector<ll> enumDivisor(ll x) {
  vector<ll> res;
  for (ll i = 1; i * i <= x; i++) {
    if (x % i != 0) continue;
    res.push_back(i);
    if (i * i != x) res.push_back(x / i);
  }
  return res;
}

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

  // n の約数について条件を調べる
  int ans = 0;
  for (ll x : enumDivisor(n)) {
    if (x == 1) continue;
    ll tmp = n;
    while (tmp % x == 0) tmp /= x;
    if (tmp % x == 1) ans++;
  }

  // n - 1 の約数はすべて条件を満たすので足す。ただし 1 は除く
  ans += enumDivisor(n - 1).size() - 1;

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

Measured memory_bytes: 3684
#define LOCAL
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
  out << "(" << a.first << "," << a.second << ")";
  return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
  out << "["; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
  out << "["; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
  return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
  return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;
mt19937 mrand(random_device{}());
int rnd(int x) { return mrand() % x; }

struct fast_ios {
  fast_ios() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
  };
} fast_ios_;

int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  map<int, int> cnt;
  int64 ret = 0;
  for (int i = 0; i < n; ++i) {
    ret += cnt[i - a[i]];
    cnt[i + a[i]]++;
  }
  printf("%lld\n", ret);
  return 0;
}


Measured memory_bytes: 21208
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>

// ===============================================================

using namespace std;
using ll = long long;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using vs = vector<string>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using vm = vector<short>;
using vmm = vector<vector<short>>;
using pii = pair<int, int>;
using psi = pair<string, int>;
using ld = long double;
using ull = unsigned long long;

// ===============================================================

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

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

ll box(double a) //doubleの切り捨て
{
	ll b = a;
	return b;
}

ll fff(double a) //doubleの四捨五入
{
	ll b = a + 0.5;
	return b;
}

ll sum(ll n) { //整数sまでの合計
	if (n == 0) {
		return 0;
	}

	int s = sum(n - 1);
	return s + n;
}

bool prime(ll num)//素数判定、primeならtrue,違うならfalse
{
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false;
	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			return false;
		}
	}

	// 素数である
	return true;
}

// ===============================================================

int main() {
	ll a, b;
	cin >> a >> b;
	vl ans(3);
	ans[0] = a + b;
	ans[1] = a - b;
	ans[2] = a * b;
	sort(ans.begin(), ans.end());
	cout << ans[2] << endl;
}

Measured memory_bytes: 3608
#include <iostream>
#include <iomanip>
/*cout <<setprecision(11)<<ret<<endl;で、数字部分を計11桁表示*/
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
//Shift+Command+bでデバッグ
//その後ターミナルで./a.outを実行
//入力を貼り付ける

//////////////////
//  A
/*int main(void){
    int a,p;cin >>a >>p;
    cout<<(a*3+p)/2<<endl;

    return 0;
}*/
//////////////////
//  B
int main(void){
    int n;cin>>n;
    vector<pair<string,pair<int,int> > > box(n);

    rep(i,n){
        cin>>box[i].first>>box[i].second.first;
        box[i].second.second=i+1;
        box[i].second.first*=-1;
    }
    sort(box.begin(), box.end());

    //rep(i,n)cout <<box[i].first<<" "<<box[i].second.first<<" "<<box[i].second.second<<endl;

    rep(i,n) cout<<box[i].second.second<<endl;
    return 0;
}
//////////////////
//  C
/*int main(void){

    return 0;
}*/
//////////////////
//  D
/*int main(void){

    return 0;
}*/
//////////////////
//  E
/*int main(void){

    return 0;
}*/
//////////////////
//  F
/*int main(void){

    return 0;
}*/


Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
typedef  long long ll;
using vll=vector<ll>;
using vvll=vector<vll>;
using vi=vector<int>;
using vvi=vector<vector<int>>;
using vb=vector<bool>;
using pii=pair<int,int>;
using vpii=vector<pair<int,int>>;

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

//pow(llpow,modpow)
template<class T> ll llpow(ll x,T n){ll ans=1;if(x==0)ans=0;while(n){if(n&1)ans*=x;x*=x;n>>=1;}return ans;}
long long modpow(long long a, long long n, long long mod) {long long res = 1;while (n > 0) {if (n & 1) res = res * a % mod;a = a * a % mod;n >>= 1;}return res;}
//最大公約数
template<class T> inline T gcd(T x,T y){if(y==0)return x; else {return gcd(y,x%y);}}
//最小公倍数
template<class T> inline T lcm(T x,T y){return x/gcd(x,y)*y;}
//逆元
long long modinv(long long a, long long m) {long long b = m, u = 1, v = 0;while (b) {long long t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;}

#define rep(i, begin_i, end_i) for (ll i = (ll)begin_i; i < (ll)end_i; i++)
//試験導入
#define irep(i, end_i, begin_i) for (ll i = (ll)begin_i-1; i >= (ll)end_i; i--)

long long INF = 1LL<<60;
int main( ){
    ll x,y;
    cin>>x>>y;
    ll ans=0;
    y/=x; ans++;
    while(y>=2){
        y/=2;
        ans++;
    }
    cout<<ans<<endl;
    return 0;
}




Measured memory_bytes: 256
N,Q = map(int,input().split())
s = input()
a = [0] * (N + 1)

for i in range(N):
  a[i+1] = a[i] + (1 if s[i:i+2] == "AC" else 0)
for j in range(Q):
  l,r = map(int,input().split())
  print(a[r-1]-a[l-1])

Measured memory_bytes: 7748
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30
from collections import Counter, defaultdict

def main():
    n = int(input().strip())
    v = list(map(int, input().strip().split()))
    a = [0] * n
    b = [0] * n
    for i in range(n):
        a[i] = i + v[i]
        b[i] = i - v[i]

    b = Counter(b)
    ans = 0
    for c in a:
        ans += b.get(c, 0)
    print(ans)

if __name__ == '__main__':
    main()


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

int32_t main(){
	int n; cin>>n;
	vector<int> a(n);
	for(int& x: a){
		cin>>x;
	}
	int t = accumulate(a.begin(), a.end(), 0);
	sort(a.begin(), a.end());
	puts(a.back() <  t - a.back() ? "Yes" : "No");
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 18;

int n,s[1<<N];
multiset<int>a,b,c;
multiset<int>::iterator it,it1;

int main(){
	scanf("%d",&n);
	for(int i=0;i<(1<<n);++i)scanf("%d",&s[i]);
	sort(s,s+(1<<n));
	a.insert(s[(1<<n)-1]);
	for(int i=0;i<(1<<n)-1;++i)b.insert(s[i]);
	while(b.size()){
		for(it=a.begin();it!=a.end();++it){
			it1=b.lower_bound(*it);
			if(it1==b.begin()){
				puts("No");exit(0);
			}
			--it1;
			b.erase(it1);
			c.insert(*it1);
		}
		while(c.size()){
			it1=c.begin();
			a.insert(*it1);
			c.erase(it1);
		}
	}
	
	puts("Yes");
}

Measured memory_bytes: 13568
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  string m;
  cin >> m;
  vector<int> c(n);
  int a = 0;
    for (int i = 0; i < n; i++) {
      string f;
      f = m.at(i);
   c.at(i) = atoi(f.c_str())-1;
      if(c.at(i) == 1){
        a = 1;}
  }
   for (int i = 0; i < n; i++) {
     if(a == 0){
       c.at(i) /= 2;}
     else{c.at(i) %= 2;}
   }
  while(c.size() > 1){
    if(c.size() % 2 == 0){
      for(int i = 0; i < c.size()-1; i++) {
        c.at(i) += c.at(i+1);
          c.at(i) %= 2;
         }
      c.pop_back();
      continue;}
    else{for(int i = 0; i < c.size() / 2 + 1; i++){
      c.at(i) = c.at(2*i);
    }
         int pp;
         pp = c.size();
         for(int i = 0; i < pp/2; i++){
           c.pop_back();}
         
        }
  }
  if(a == 0){c.at(0) *= 2;}
  cout << c.at(0) << endl;
}

Measured memory_bytes: 5252
from collections import Counter
n = int(input())
a = list(map(str,input().split()))
ans = 1
b = Counter(a)
b0 = 0
b1 = 0

if '0' in a:
    b0 = b['0']
if '1' in a:
    b1 = b['1']
more2 = n-b0-b1
if b0 >0:
    print(0)
elif more2 >=60:
    print(-1)
else:
    for i in range(n):
        ans *= int(a[i])
    if ans > 10**18:
        print(-1)
    else:
        print(ans)

Measured memory_bytes: 28564
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    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;
}


Measured memory_bytes: 256
from sys import stdin
from collections import deque
def main():
    #入力
    readline=stdin.readline
    n=int(readline())
    a=list(map(int,readline().split()))

    d=deque([])
    for i in range(n):
        if i%2==0:
            d.append(a[i])
        else:
            d.appendleft(a[i])

    if n%2==1: d.reverse()
    print(*d)

if __name__=="__main__":
    main()

Measured memory_bytes: 25424
n, t = list(map(int, input().split()))
mincost = 100000
for _ in range(n):
    ci, ti = list(map(int, input().split()))
    if ti > t:
        continue
    if ci < mincost:
        mincost = ci
if mincost == 100000:
    print("TLE")
else:
    print(mincost)

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

#define REP(i, a, b) for (auto i = (a); i < (b); i++)
#define REPR(i, a, b) for (auto i = (a-1); i >= (b); i--)

using namespace std;

void solve()
{
    bool x; cin >> x;

    cout << not x << "\n";
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t = 1; // cin >> t;

    while (t--)
        solve();

    return 0;
}

Measured memory_bytes: 3572
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define endl '\n'
#define loop(a,b,c) for(ll i=a;i<=b;i+=c)
#define intarr(arr,n) ll arr[n];for(ll i=0;i<n;i++)cin>>arr[i]
#define inparr(arr,n) for(ll i=0;i<n;i++)cin>>arr[i]
#define inpvec(vec,n) for(ll i=0;i<n;i++){ll var;cin>>var;vec.push_back(var);}
#define pb push_back
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mod 1000000007
#define newline cout<<endl
#define ump unordered_map<ll,ll>
#define vec vector<ll>
#define mkp make_pair
#define disp(var1,var2) cout<<var1<<" "<<var2<<endl;
#define all(v)             v.begin(),v.end()
#define cout(var) cout<<var<<endl
#define mod2 998244353
#define fbo find_by_order  /// find kth smallest by passing k-1
#define ook order_of_key  //// find no of smaller items less than k
#define teensort(a,r,g,b) a[0]=r;a[1]=g;a[2]=b;sort(a,a+3);
#define ss second
#define ff first
#define displayarray(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" "; cout<<endl;
#define pi pair<ll,ll>
#define meramax 1e18
#define meramin -1e18
#define percentile 1000000007
void AcDegaYe() 
{
    ll a,b,c,k;
    cin>>a>>b>>c>>k;
    ll ans=0;
    if(a<=k)
    {
        k-=a;
        ans+=a;
        if(b<=k)
        {
            k-=b;
            if(k)
            {
                ans-=k;
                cout(ans);
                return;
            }
            else
            {
                cout(ans);
                return;
            }
        }
        else
        {
            cout(ans);
            return;
        }
    }
    else
    {
        ans+=k;
        cout(ans);
        return;
    }
}
int main()
{   
    fastio
    //ll t;
    //cin>>t;
    ll t=1;
    while(t--)
    {
        AcDegaYe();
    }
    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}

Measured memory_bytes: 3660
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int a=scan.nextInt();
		int b=scan.nextInt();
		int c=scan.nextInt();
		int d[]=new int[a];
		for(int i=0;i!=a;i++) {
			d[i]=scan.nextInt();
		}
		int count1=0;
		int count2=0;
		int count3=0;
		int ans=0;
		for(int i=0;i!=a;i++) {
			if(count1!=1&&d[i]<=b&&d[i]!=0) {
				count1=1;
				d[i]=0;
			}
			if(count2!=1&&d[i]>b&&d[i]<=c&&d[i]!=0) {
				count2=1;
				d[i]=0;
			}
			if(count3!=1&&d[i]>c&&d[i]!=0) {
				count3=1;
				d[i]=0;
			}
			if(count1==1&&count2==1&&count3==1) {
				ans++;
				i=0;
				count1=0;
				count2=0;
				count3=0;
			}
		}
		System.out.println(ans);
}
}

Measured memory_bytes: 23252
from math import factorial
def ncr(n, r):
    return factorial(n) // factorial(r) // factorial(n - r)

n,m = map(int, input().split())

# n = int(input())

# a = list(map(int, input().split()))

if m < 2 :
    if n < 2:
        print(0)
    else:
        print(ncr(n,2))
else:
    if n < 2:
        print(ncr(m,2))
    else:
        print(ncr(n,2)+ncr(m,2))



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

int gcd(int x,int y){
	if(y==0) return x;
	else return gcd(y,x%y);
}

int lcm(int x,int y){
	return x*y/gcd(x,y);
}
 
signed main(){
	int n,ma=-1000000000;
	cin>>n;
	int f[n][15],p[n][15];
	for(int i=0;i<n;i++){
		for(int j=0;j<10;j++){
			cin>>f[i][j];
		}
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<=10;j++){
			cin>>p[i][j];
		}
	}
	for(int i=1;i<(1<<10);i++){
		int bit[10];
		for(int j=0;j<10;j++)bit[j]=i/(1<<j)%2;
		vector<int>vec(n);
		for(int i=0;i<n;i++)vec[i]=0;
		for(int j=0;j<10;j++){
			for(int k=0;k<n;k++){
				if(bit[j]&&f[k][j])vec[k]++;
				else if(!bit[j])break;
			}
		}
		int sum=0;
		for(int j=0;j<n;j++){
			sum+=p[j][vec[j]];
		}
		ma=max(ma,sum);
	}
	cout<<ma<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;



int main()
{
	int n,a,sum=0;
	vector<int>v;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a;
		v.push_back(a);
	}
	sort(v.begin(),v.end());
	for(int i=0;i<n;i++)
	{
		if(i!=n-1)sum+=v[i];
		else sum+=v[i]/2;
	}
	cout<<sum<<endl;
	return 0;
}
	

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

//型定義
typedef long long ll;

//定数
const int INF=1e+9;
const int MOD=1e+9+7;

//REPマクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REP2(i,a,b) for(ll i=a;i<(ll)(b);i++)
#define REPD2(i,a,b) for(ll i=a;i>(ll)(b);i--)

// 多次元 vector 生成
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

//vectorの扱い
#define ALL(x) (x).begin(),(x).end() //sortなどの引数省略
#define SIZE(x) ((ll)(x).size()) //size
#define MAX(x) *max_element(ALL(x)) //最大値
#define MIN(x) *min_element(ALL(x)) //最小値

int main(){
    int N;
    cin>>N;
    vector<vector<char>> S(N,vector<char>(N));
    REP(i,N){
        REP(j,N){
            cin>>S[i][j];
        }
    }
    int ans=0;
    REP(k,N){
        bool ok=true;
        REP(i,N){
            REP(j,N){
                int j2=i+k;
                int i2=j-k;
                j2%=N;
                if(i2<0) i2+=N;
                if(S[i][j]!=S[i2][j2]){
                    ok=false;
                }
            }
        }
        if(ok) ans+=N;
    }
    cout<<ans<<endl;
}

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

using namespace std;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    vector<int> arr(200000, 1);
    for(int i = 4; i < 200000; i += 2) {
        arr[i] = 0;
    }
    for(int i = 3; i < 200000; i += 2) {
        if(!arr[i]) continue;
        for(int j = i*i; j < 200000; j += i) {
            if(!(j%i)) arr[j] = 0;
        }
    }
    int n;
    cin >> n;
    for(int i = n; i < 200000; i++) {
        // cout << i << " ";
        if(arr[i]) {
            cout << i << endl;
            break;
        }
    }    
    return 0;
}


Measured memory_bytes: 3928
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<string> s(n);
    vector<int>  t(n);
    string x;
    for(int i = 0;i < n;i++){
        cin >> s[i];
        cin >> t[i];
    }
    cin >> x;

    bool flag = false;
    int ans = 0;
    for (int i = 0; i < n; i++)
    {
        if(flag == true)	ans += t[i];
        if(s[i] == x)   flag = true;
    }
    
    cout << ans << endl;
  
    return 0;
}

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

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String str = in.readLine();
    String[] s = str.split("");
    Set<String> hs = new HashSet<>();
    for(int i=0; i<str.length(); i++) {
      hs.add(s[i]);
    }
        
    int ans_num = 0;
    for(int i=97; i<=122; i++) {
      if(hs.contains(String.valueOf((char)i))==false) {
        ans_num = i;
        break;
      }
    }
    
    System.out.println(ans_num==0?"None":(char)ans_num);
  }
}

Measured memory_bytes: 42452
#B - Papers, Please
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            pass
        else:
            print("DENIED")
            exit()
    else:
        pass

print("APPROVED")

Measured memory_bytes: 38480
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<fstream>

#define MOD (1000000007)

using namespace std;

typedef long long int Int;

constexpr Int TEN(int n) { return n == 0 ? 1 : 10 * TEN(n-1); }

int main(void) {
    Int L,R;

    cin>>L>>R;
    if(R-L >= 2020*2) {
        cout<<0<<endl;
    } else {
        Int ans = TEN(9);
        for(Int i = L;i < R;i++) {
            for(Int j = i+1;j <= R;j++) {
                ans = min(ans,(i*j) % 2019);
            }
        }
        cout<<ans<<endl;
    }

    return 0;
}


Measured memory_bytes: 256
//#include<bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<numeric>
#include<vector>
#include<set>
#include<map>
#include<unordered_map>
#include<stack>
#include<queue>
#include<list>
using namespace std;

typedef long long ll;

#define MOD 1000000007

class Comb{
private:
  ll *fac,*finv,*inv;
public:
  Comb(){
    fac = new ll[1000000];
    finv = new ll[1000000];
    inv = new ll[1000000];
    fac[0] = 1;
    for(int i=1;i<1000000;i++){
      fac[i] = i*fac[i-1];
      fac[i] %= MOD;
    }
    inv[1] = 1;
    for(int i=2;i<1000000;i++){
      inv[i] = MOD-inv[MOD%i]*(MOD/i)%MOD;
    }
    finv[0] = 1;
    for(int i=1;i<1000000;i++){
      finv[i] = inv[i]*finv[i-1];
      finv[i] %= MOD;
    }
  }
  ll calc(ll n,ll k){
    ll c = fac[n];
    c *= finv[k];c %= MOD;
    c *= finv[n-k];c %= MOD;
    return c;
  }
};

ll gcd(ll x,ll y){
  if(x%y == 0) return y;
  else return gcd(y,x%y);
}
int main(){
  ll n,m;
  cin >> n >> m;
  ll a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
    a[i] /= 2;
  }
  ll ans = 0;
  ll div = 1;
  while(a[0]%2 == 0){
    div *= 2;
    a[0] /= 2;
  }
  bool flag = false;
  for(int i=1;i<n;i++){
    if(a[i]%div != 0){
      flag=true;
      break;
    }
    if((a[i]/div)%2 == 0){
      flag=true;
      break;
    }
    a[i] /= div;
  }

  if(flag){
    cout << 0 << endl;
    return 0;
  }

  for(int i=0;i<n;i++){
    div = a[i]*div/gcd(a[i],div);
  }
  ans = m/div;
  cout << (ans+1)/2 << endl;
  return 0;
}


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

const int P = (int)1e9 + 7;
const int MAXN = (int)2e6 + 1;

int factorial[MAXN];

void init(int n) {
  factorial[0] = 1;
  for (int i = 1; i <= n; ++i) {
    factorial[i] = 1LL * factorial[i - 1] * i % P;
  }
}

int64_t pow(int64_t x, int y) {
  int64_t ans = 1;
  while (y > 0) {
    if (y & 1) ans = ans * x % P;
    x = x * x % P;
    y >>= 1;
  }
  return ans;
}

int64_t comb(int x, int y) {
  return factorial[x] * pow(factorial[y], P - 2) % P * 
         pow(factorial[x - y], P - 2) % P;
}

int solve(int op_num, int s_len) {
  init(op_num + s_len);
  int64_t ans = 0;
  for (int i = 0; i <= op_num; ++i) {
    ans += pow(25, i) * comb(i + s_len - 1, i) % P * pow(26, op_num - i) % P;
    if (ans >= P) ans -= P;
  }
  return ans;
}

int main() {
  int op_num;
  std::string s;
  std::cin >> op_num >> s;
  std::cout << solve(op_num, s.length()) << std::endl;
  return 0;
}


Measured memory_bytes: 12132
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <algorithm>
#include <cstdio>
#include <cmath>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main() {
  int N, C;
  cin >> N >> C;
  vector<vector<int>> imos(C, vector<int>(1e5+1));
  rep(i, N) {
    int s, t, c;
    cin >> s >> t >> c;
    s--; c--;
    imos[c][s]++;
    imos[c][t]--;
  }
  rep(i, C) {
    for(int j=1; j<=1e5; j++) {
      imos[i][j] += imos[i][j-1];
    }
  }
  rep(i, C) {
    rep(j, 1e5+1) {
      if(imos[i][j])
        imos[i][j] = 1;
    }
  }
  int ans = 0;
  rep(i, 1e5+1) {
    int tmp = 0;
    rep(j, C)
      tmp += imos[j][i];
    ans = max(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 12416
#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define line printf("-----------------------------\n")
#define fast ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0);
#define filein freopen("input.txt","r",stdin)
#define fileout freopen("output.txt","w",stdout)
using namespace std;
int n;
int ara[10009];
int  main()
{
    scanf("%d",&n);
    ll sum=0;
    for(int i=0;i<n;i++) scanf("%d",&ara[i]),sum+=ara[i];
    ll x=(sum-1)/n;
    ll y=sum/n ;
    x+=1;
    ll ans=0;
    ll ans1=0;
    for(int i=0;i<n;i++)
    {
        ans+=(ara[i]-x)*(ara[i]-x);
        ans1+=(ara[i]-y)*(ara[i]-y);
    }
    printf("%lld\n",min(ans,ans1));
}


Measured memory_bytes: 256
import numpy as np

n=input()
a=[int(x) for x in input().split()]

a_min=np.min(a)
a_max=np.max(a)

cost_list=[]
for i in range(a_min, a_max+1):
  
  cost=0
  for val in a:
    cost+=(val-i)**2
    
  cost_list.append(cost)
  
min_cost=np.min(cost_list)

print(min_cost)

Measured memory_bytes: 12504
#!/usr/bin/env python3
import sys
try: from typing import Any, Union, List, Tuple, Dict
except ImportError: pass
sys.setrecursionlimit(10**6)
def debug(*args): print(*args, file=sys.stderr)
def exit(): sys.exit(0)


s = input()


if s[0] == s[-1]:
    if len(s) % 2 == 0:
        print("First")
    else:
        print("Second")
else:
    if len(s) % 2 == 0:
        print("Second")
    else:
        print("First")


Measured memory_bytes: 39220
module A = Array
module C = Char
module I = Int64
module L = List
module Q = Queue

let pf = Printf.printf
let sf = Scanf.scanf
let ssf = Scanf.sscanf

let read_int () = sf "%d " (fun x -> x)
let read_float () = sf "%f " (fun x -> x)
let read_array read n = A.init n (fun _ -> read ())
let err s = raise (Failure s)

let rec solve xs n res
    = if n = 0 then
        res
      else
        solve xs (n-1) (res + xs.(A.length xs -n*2))

let _ =
    let n = read_int () in
    let size = n * 3 in
    let a = read_array read_int size in
    A.sort compare a;
    solve a n 0 |> pf "%d\n"
    


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

using namespace std;

#define INF 0x3f3f3f3f

int N,M;

int cost[1001]; //cost of each key
int key_treasure[1001]; // chests that each key open
int memo[1001][9000];
int total; // bits representing total number of chests

int dp(int key, int treasures){

    if (key == M){
        if(treasures == total) return 0;
        else return INF;
    }
    
    if(memo[key][treasures] != -1) return memo[key][treasures];

    int a = dp(key+1, treasures | key_treasure[key]) + cost[key];
    
    int b = dp(key+1, treasures);
    
    int ans = min(a,b);
    memo[key][treasures] = ans;
    
    return ans;
}


int main(){

    cin >> N >> M;
    memset(memo, -1, sizeof(memo));
    
    for(int i=0; i<N; i++){
        total |= 1 << i;
    }
    
    for(int i=0; i< M; i++){
        int key_cost, q;
        
        cin >> key_cost >> q;
        cost[i] = key_cost;

        int treasure;
        for(int x=0; x < q; x++){
            cin >> treasure;
            key_treasure[i] |= 1 << (treasure - 1);
        }
    
    }

    int ans = dp(0,0);
    if(ans == INF) cout << -1 << endl;
    else cout << ans << endl;

}

Measured memory_bytes: 35456
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

struct UnionFind {
    vector<int> par;

    UnionFind(int n): par(n, -1) {}
    void init(int n) { par.assign(n, -1); }

    int root(int x) {
        if (par[x] < 0) return x;
        return par[x] = root(par[x]);
    }

    int issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);

        if (x == y) return false;

        // merge by size
        // force size of x to be bigger than that of y
        if (par[x] > par[y]) swap(x, y);
        par[x] += par[y];
        par[y] = x;

        return true;
    }

    int size(int x) {
        return -par[root(x)];
    }
};

struct Edge {
    ll u, v, cost;
};

bool comp(Edge x, Edge y) {
    return x.cost < y.cost;
}

int V, E;
const int MAX_E = 4 * 1e5;
Edge es[MAX_E];

int kruskal() {
    sort(es, es + E, comp);
    UnionFind uf(V);

    int ret = 0;
    REP(i, E) {
        Edge e = es[i];
        if (!uf.issame(e.u, e.v)) {
            uf.merge(e.u, e.v);
            ret += e.cost;
        }
    }

    return ret;
}

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

    cin >> V;

    vector<Pll> X(V), Y(V);
    REP(i, V) {
        int x, y;
        cin >> x >> y;
        X[i] = {x, i}; Y[i] = {y, i};
    }
    sort(X.begin(), X.end());
    sort(Y.begin(), Y.end());

    REP(i, V - 1) {
        es[2*i] = {X[i].se, X[i+1].se, X[i+1].fi - X[i].fi};
        es[2*i+1] = {Y[i].se, Y[i+1].se, Y[i+1].fi - Y[i].fi};
    }

    E = 2 * (V - 1);

    cout << kruskal() << endl;

}


Measured memory_bytes: 9856
#include<iostream>
#include<string>
#include<vector>
#include<math.h>
#include<map>
#include<algorithm>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
string table[]={"dream","dreamer","erase","eraser"};
string s;
bool f[100100];
int main(void){
    cin>>s;
    f[0]=1;
    rep(i,s.size()){
        if(f[i]){
            rep(j,4){
                bool F=1;
                rep(k,table[j].size()){
                    if(table[j][k]!=s[i+k]) F=0;
                }
                if(F) f[i+table[j].size()]=1;
            }
        }
    }
    if(f[s.size()]) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}

Measured memory_bytes: 512
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
      return Array.new(size1){init}
  else
      return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

N=gets.to_i
ans=1
N.times do
    ans=ans.lcm(gets.to_i)
end
puts ans

Measured memory_bytes: 14276
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
typedef pair<string,string> Pss;
#define rep(i,n) for (ll i=0;i<n;++i)
#define rep2(i,a,b) for (ll i=a;i<b;++i)
const ll MOD=1e9+7;
const ll INF=1e9;
const ll IINF=1e18;
const double EPS=1e-8;
const double pi=acos(-1);

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

int main(){
    int N;
    string S;
    cin >> N >> S;
    map<Pss,ll> m;
    rep(bit,1<<N){
        string a="",b="";
        rep(i,N){
            if (bit&1<<i) a+=S[i];
            else b+=S[i];
        }
        reverse(b.begin(),b.end());
        ++m[Pss(a,b)];
    }
    ll ans=0;
    rep(bit,1<<N){
        string a="",b="";
        rep(i,N){
            if (bit&1<<i) a+=S[N+i];
            else b+=S[N+i];
        }
        reverse(b.begin(),b.end());
        ans+=m[Pss(b,a)];
    }
    cout << ans << endl;
}

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<string> vs;
#define fo(i, a, b) for (int i = a; i < b; i++)
#define re(i, n) fo(i, 0, n)
#define pb push_back
#define mp make_pair
#define all(s) s.begin(), s.end()
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; }
int main()
{
  int n;
  cin >> n;
  vi a(n);
  re(i, n) cin >> a[i];

  bool t = true;
  re(i, n) {
    if(a[i] % 2 == 1) {
      continue;
    } else {
      if(a[i] % 3 == 0 || a[i] % 5 == 0) {
        continue;
      } else {
        t = false;
        break;
      }
    }
  }
  if(t) cout << "APPROVED" << endl;
  else cout << "DENIED" << endl;

  return 0;
}


Measured memory_bytes: 256
#define ll long long
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define fo(i , n) for(ll i = 0 ; i < n ; i++)
//#include<bits/stdc++.h>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<utility>
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<queue>
#include<set>
#include<stack>
double pi = acos(-1) ;
ll z =  1000000000 ;
ll inf = 6000000000000000000 ;
ll p1 = 37 ;
ll p2 = 53 ;
ll mod1 =  202976689 ;
ll mod2 =  203034253 ;
ll gcd(ll a , ll b){ if(b > a) return gcd(b , a) ; if(b == 0) return a ; return gcd(b , a%b) ;}
ll power(ll a ,ll b , ll p){if(b == 0) return 1 ; ll c = power(a , b/2 , p) ; if(b%2 == 0) return ((c*c)%p) ; else return ((((c*c)%p)*a)%p) ;}
ll inverse(ll a ,ll n){return power(a , n-2 , n) ;}
ll max(ll a , ll b){if(a > b) return a ; return b ;}
ll min(ll a , ll b){if(a < b) return a ; return b ;}
ll left(ll i){return ((2*i)+1) ;}
ll right(ll i){return ((2*i) + 2) ;}
void swap(ll&a , ll&b){ll c = a ; a = b ; b = c ; return ;}
//ios_base::sync_with_stdio(0);
//cin.tie(0); cout.tie(0);
using namespace std ;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// ordered_set s ; s.order_of_key(val)  no. of elements strictly less than val
// s.find_by_order(i)  itertor to ith element (0 indexed)
//__builtin_popcount(n) -> returns number of set bits in n

void solve()
{
	ll n ;
	cin >> n ;
	cout << fixed << setprecision(10) << (2*pi*n) << endl ;
	return ;
}
 
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    /*#ifndef ONLINE_JUDGE
    freopen("inputf.txt" , "r" , stdin) ;
    freopen("outputf.txt" , "w" , stdout) ;
    freopen("error.txt" , "w" , stderr) ;
    #endif*/
    
    ll t ;
    //cin >> t ;
    t = 1 ;

    while(t--)
    {
        solve() ;
    }
    //cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
 
    return 0;
}

Measured memory_bytes: 3760
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

A, B, K = map(int, input().split())

l = []
for i in range(A, min(A+K, B+1)):
    l.append(i)
for i in range(max(B-K+1, A+1), B+1):
    l.append(i)

l = list(set(l))
l.sort()
print(*l, sep="\n")


Measured memory_bytes: 9076
#include <bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    if(a+b>c+d){
        cout << "Left" << endl;
    }
    else if(a+b<c+d){
        cout << "Right" << endl;
    }
    else {
        cout << "Balanced" << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <unordered_set>
#include <numeric>

using namespace std;
#define INF 99999
#define _GLIBCXX_DEBUG
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define REPS(i,a,n) for(int i=(a);i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define fi first
#define se second
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;


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

    int N, M;
    cin >> N >> M;
    vint a(M);
    vint b(M);
    REP(i, M) cin >> a[i] >> b[i];

    int adj[N][N];
    REP(i, N)REP(j, N)adj[i][j] = 0;

    REP(i, M){
        adj[a[i]-1][b[i]-1] = 1;
        adj[b[i]-1][a[i]-1] = 1;
    }

    int univ = (1 << N) - 1;
    int dp[1 << N][N];

    REP(S, 1 << N){
        REP(v, N){
            dp[S][v] = 0;
        }
    }
    dp[1][0] = 1;

    REPS(S, 2, (1 << N)+1) REP(v, N){
        int S2 = S & (univ ^ (1 << v)); // S \ {v}
        dp[S][v] = 0;
        REP(u, N) {
            if (((1 << u) & S2) && adj[u][v]){
                dp[S][v] += dp[S2][u];
            }
        }
    }

//    REP(S, 1 << N){
//        REP(v, N){
//            cout << dp[S][v] << " ";
//        }
//        cout << endl;
//    }

    int ans = 0;
    REP(u, N){
        ans += dp[univ][u];
    }
    cout << ans;
}

Measured memory_bytes: 256
n = int(input())
p = list(map(int,input().split()))
count = 0

sort_p = sorted(p)

for i in range(n):
  if p[i] != sort_p[i]:
    count += 1
    
if count  == 2:
  print("YES")
  exit()
elif count == 0:
  print("YES")
  exit()
else:
  print("NO")
  exit()


Measured memory_bytes: 9176
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define ll long long

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

  int p,q,r; cin >> p >> q >> r;
  cout << min({p+q,q+r,r+p}) << endl;
  return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    static class BImissyou
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine();
            string mask = "";
            for (int i = 0; i < s.Length; i++)
            {
                mask += "x";
            }

            Console.WriteLine(mask);
            Console.ReadLine();
        }
    }
}

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

int main() {
  // ここにプログラムを追記
  //int a , b;
  double a , b; 
  int x;
  
  cin >> a >> b;
  
  x = (a + b) / 2 + 0.9;
  cout << x << endl;
}

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

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

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

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

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

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

    string s;
    cin >> s;
    cout << (s[2]==s[3] and s[4]==s[5] ? "Yes" : "No") << endl;
    return 0;
}

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

ll a[214514],b[214514],c[214514];

int main(){
	ll n;
	cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i];
	for(int i=1;i<=n;i++)cin>>b[i];
	for(int i=1;i<=n;i++)cin>>c[i];
	sort(a,a+n+1);
	sort(b,b+n+1);
	sort(c,c+n+1);
	a[n+1]=b[n+1]=c[n+1]=1e12;
	ll ans=0;
	for(int i=1;i<=n;i++){
		ll oka=0,nga=n+1,mida;
		while(nga-oka>1){
			mida=(oka+nga)/2;
			if(a[mida]<b[i])oka=mida;
			else nga=mida;
		}
		ll okc=n+1,ngc=0,midc;
		while(-ngc+okc>1){
			ll midc=(okc+ngc)/2;
			if(c[midc]>b[i])okc=midc;
			else ngc=midc;
		}
		ans+=oka*(n+1-okc);
	}
	cout<<ans;
	return 0;
}


Measured memory_bytes: 3456
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
int main(void){
    ll n,m;
    cin >> n >> m;
    ll h[n+1];
    ll z[n+1];
    for(ll i=1;i<=n;i++){
        cin >> h[i];
    }
    for(ll i=1;i<=n;i++){
        z[i]=1;
    }
    ll a[m+1],b[m+1];
    for(ll i=1;i<=m;i++){
        cin >> a[i] >> b[i];
    }
    for(ll i=1;i<=m;i++){
        if(h[a[i]]>=h[b[i]])z[b[i]]=0;
        if(h[a[i]]<=h[b[i]])z[a[i]]=0;
    }
    ll ans = 0;
    for(ll i=1;i<=n;i++){
        if(z[i]==1)ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 6744
#include <bits/stdc++.h>
#define ll long long
#define pi 3.14159265358979
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;
const int INF = 1000100100;
 
 
int main(){
    ll n,a,b,sum=0;
    cin>>n;
    rep(i,n){
        sum+=(n-1)/(i+1);
    }
    cout<<sum;
}

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

int main() {
    int k, a, b;
    cin >> k >> a >> b;

    for (int i = a; i <= b;++i){
        if(i%k==0){
            cout << "OK" << endl;
            return 0;
        }
    }

    cout << "NG" << endl;

    return 0;
}

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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

template<class T>
bool ChangeMax(T&a,const T&b){
  if(a >= b) return false;
  a = b;    return true;
}

template<class T>
bool ChangeMin(T&a,const T&b){
  if(a <= b) return false;
  a = b;    return true;  
}

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

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

int main(){
  int n,m,q;  cin >> n >> m >> q;
  vector<int> v[501];
  for(int i = 0; i < m; ++i){
    int l,r; cin >> l >> r;
    v[r].push_back(l);
  }
  vector<P<int,int>> qry[501];
  for(int i = 0; i < q; ++i){
    int l,r; cin >> l >> r;
    qry[r].emplace_back(l,i);
  }
  vector<int> ans(q);
  vector<int> fnd;
  for(int i = 0; i <= n; ++i){
    for(auto e:v[i])
      fnd.insert(upper_bound(fnd.begin(),fnd.end(),e),e);
    for(auto e:qry[i]){
      ans[e.second] = distance(lower_bound(fnd.begin(),fnd.end(),e.first),fnd.end());
    }
  }
  for(auto e:ans)cout << e << endl;
}


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

typedef long long ll;
typedef vector<ll> v1;
typedef vector<vector<ll>> graph;

const ll INF = 1ll << 50;
ll n,m,p;
v1 a,b,c;
graph g;
graph rg;
graph cost;
v1 dist;
bool is_update;
v1 vis;
v1 mem;

void rdfs(ll x){
    if(vis[x]) return;
    vis[x] = 1;
    ll siz = rg[x].size();
    for(ll y : rg[x]){
        rdfs(y);
    }
}

void dfs(ll x){
    if(vis[x]) return;
    vis[x] = 1;
    ll siz = g[x].size();
    for(ll i = 0;i < siz;i++){
        if(mem[g[x][i]]){
            dfs(g[x][i]);
            a.push_back(x);
            b.push_back(g[x][i]);
            c.push_back(cost[x][i]);
        }
    }
}

main(){
    cin >> n >> m >> p;
    dist = v1(n+1, -INF);
    // a=b=c=v1(m);
    g = graph(n+1);
    rg = graph(n+1);
    cost = graph(n+1);
    for(ll i = 0;i < m;i++){
        ll a,b,c;
        cin >> a >> b >> c;
        rg[b].push_back(a);
        g[a].push_back(b);
        cost[a].push_back(c-p);
    }
    vis = v1(n+1,0ll);
    rdfs(n);
    mem = vis;
    vis = v1(n+1,0ll);
    dfs(1);
    // for(ll i = 0;i < a.size();i++){
    //     cerr << a[i] << " " << b[i] << " " << c[i] << endl;
    // }
    dist[1] = 0;
    for(ll i = 0;i < n+1;i++){
        is_update = false;
        for(ll j = 0;j < a.size();j++){
            if(dist[b[j]] < dist[a[j]]+c[j]){
                dist[b[j]] = dist[a[j]]+c[j];
                is_update = true;
            }
        }
        if(is_update == false) break;
    }
    if(is_update) cout << -1 << endl;
    else cout << max(dist[n],0ll) << endl;
    // if(bellman_ford()){
    //     cout << max(dist[n],0ll) << endl;
    // }else{
    //
    // }
    // bellman_ford();
    // ll tmp = dist[n];
    // bellman_ford();
    // if(tmp == dist[n]) cout << max(dist[n],0ll) << endl;
    // else cout << -1 << endl;
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
using namespace std;
int main() {
	string a, b;
	int n, t = 0, h = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a >> b;
		a == b ? t++, h++ : (a > b ? t += 3 : h += 3);
	}
	cout << t << " " << h << endl;
}

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

int main(){

  int a, b, c, d;
  cin >> a >> b;
  c = a % 2;
  d = b % 2;
  
  if (c==0 || d==0){
    cout << "Even" << endl;
  } else {
    cout << "Odd" << endl;
  }
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
    int i,max,sum,time[4];
    sum=0;
    for(i=0;i<5;i++){
        scanf("%d",&time[i]);
    }
    max = 0;
    for(i=0;i<5;i++){
        if((time[i]%10)!=0){
            if(max<(10 - (time[i]%10))) max = 10-(time[i]%10);
        }
    }
    for(i=0;i<5;i++){
        sum = sum + (time[i] -(time[i]%10));
        if(time[i]%10 != 0) sum +=10;
    }
    sum -= max;
    printf("%d\n",sum);
    return 0;
}

Measured memory_bytes: 128