akhauriyash/Code-Regression huggingface dataset:
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(ll i = (ll)(s); i < (ll)(t); i++)
#define rrep(i,s,t) for(ll i = (ll)(s-1);(ll)(t) <= i; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
constexpr ll INF = numeric_limits<ll>::max()/4;
constexpr ll n_max = 2e5+10;
#define int ll

template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string &s) {return '"' + s + '"';}
string to_string(const char *c) {return to_string((string) c);}
string to_string(bool b) {return (b ? "true" : "false");}
template <size_t N>
string to_string(bitset<N> v){
    string res = "";
    for(size_t i = 0; i < N; i++) res += static_cast<char>('0' + v[i]);
    return res;
}
template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for(const auto &x : v) {
        if(!first) res += ", ";
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p){return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}

void debug_out() {cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

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

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail) != 0) cout << " ";
    print(forward<Tail>(tail)...);
}

template <class T>
void print(vector<T> &vec) {
    for (auto& a : vec) {
        cout << a;
        if (&a != &vec.back()) cout << "\n";
    }
    cout << endl;
}

template <class T>
void print(vector<vector<T>> &df) {
    for (auto& vec : df) {
        print(vec);
    }
}

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    ll d; cin >> d;
    vector<ll> c(26);
    for(int i = 0; i < 26; i++) cin >> c[i];
    vector s(d, vector<ll>(26));
    rep(i,0,d)rep(j,0,26){
        cin >> s[i][j];
    }
    vector<ll> ans, last(26);
    rep(i,0,d){
        vector<ll> t = s[i];
        Pll temp = {-INF, -1};
        rep(j,0,26){
            t[j] -= c[j] * (i - last[j]);
            chmax(temp, {t[j], j});
        }
        ans.emplace_back(temp.second + 1);
        last[temp.second] = i+1;
    }

    print(ans);
}

Measured memory_bytes: 3768
/*
ID: lit20182
TASK: beads
LANG: C++                 
*/
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
#define mod 1000000007
#define rep(i, a, b) for(ll i = a; i < b; i++)
#define repc(i, a, b, c) for (ll i = a; (c > 0 ? i < b : i > b) and c != 0; i += c)
#define mp make_pair
#define fi first
#define si second
#define pb push_back
#define all(name) (name.begin(), name.end())
#define fact(n) vector<ll> ft(1, 1LL);rep(i, 1, n+1)ft.pb((ft[i-1]*i)%mod);
#define mod_in(a) power(a, mod-2)
#define ncr(n, r) ((ft[n]*mod_in((ft[r]*ft[(n)-(r)])%mod))%mod)
#define deb(x) cout << #x << " " << x << endl;
#define int ll


ll power(ll x, ll y) {
    ll res = 1;x %= mod;
    while (y > 0) {
        if (y & 1)res = (res*x) % mod;
        y = y>>1;
        x = (x*x) % mod;
    }
    return res%mod;
}
/*_____________________________________________________________________________________________________*/





vector<int> arr[2000001];
signed main()
{
	ios_base::sync_with_stdio(false); 
	cin.tie(NULL);
	int t = 1;
	// cin >> t;
    next :
	while(t--){
        int n, m;
        cin >> n >> m;
        n = n%m;
        cout << min(n, m-n);
    }
} 









Measured memory_bytes: 47104
#include <stdio.h>

int main(void)
{
  int n,i;
  int a[100000]={0};
  int max,min;
  double sum=0;

  scanf("%d",&n);
  for (i=0; i<n; i++) {
    scanf("%d",&a[i]);
  }

  max=min=a[0];
  for (i=0; i<n; i++) {
    sum+=a[i];
    if (max<a[i]) max=a[i];
    if (min>a[i]) min=a[i];
  }

  printf("%d %d %.f\n",min,max,sum);
  
  return 0;
}
  

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

///******************************** C o n t a i n e r ********************************///

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;

///*********************************** C o n s t ***********************************///

const int       N=1e6+3;
const double    PI = acos(-1);
const ll        MOD=1000000007;                 ///1e9+7
ll dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
ll dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

///********************************** M a r c o ***********************************///

#define pb push_back
#define F first
#define S second
#define test int tc; cin>>tc; while(tc--)
#define forn(i,n) for(i=0;i<n;i++)
#define rforn(i,n) for(i=n-1;i>=0;i--)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(x) x.size()
#define el <<'\n'
#define sp <<' '
#define print(a) {for(auto x:a)cout<<x<<" ";cout<<endl;}
#define mem(a,b) memset(a, b, sizeof(a))
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) (a)*(a)

#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

///*********************************** F u n c t i o n ***********************************///

ll powmod(ll a,ll b){ll p=MOD;a%=p;if(!a) return 0;ll pr=1;while(b>0){if(b&1){pr*=a;pr%=p;--b;}a*=a;a%=p;b/=2;}return pr;}
bool isPrime(ll n){ if(n<=1)return false;if(n<=3)return true;if(n%2==0 or n%3==0)return false;for(ll i=5;i*i<=n;i+=6){if(n%i==0 or n%(i+2)==0)return false;}return true;}
void seive(bool a[]){ll mx=sqrt(N),ii,jj;for(ii=3;ii<=mx;ii+=2)if(!a[ii])for(jj=ii*ii;jj<=N;jj+=2*ii)a[jj]=true;}
void numofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<=N;jj+=ii){if(jj==ii*ii) a[jj]++; else a[jj]+=2;}}}
void sumofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<=N;jj+=ii){if(jj==ii*ii) a[jj]+=ii; else a[jj]+=ii+jj/ii;}}}

///**************************************************** C o d e ****************************************************///
///-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=///



void _case()
{
    ll n,i,ans=0;
    cin>>n;
    ll a[n];
    forn(i,n) cin>>a[i];
    multiset<ll> s; s.insert(a[0]);
    for(i=1;i<n;i++){
        auto it=s.lower_bound(a[i]);
        if(it!=s.begin()) {it--; s.erase(it);}
        s.insert(a[i]);
    }
    cout<<sz(s) el;
}

main()
{
//      fastio();
        _case();

}


///Thank you.


///Brainless_Loco Terminates Here!



Measured memory_bytes: 8976
// ElevenLover http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2182&lang=jp 所要時間2時間程度
#include<bits/stdc++.h>
using namespace std;
int ctoi(char c){
    return c - '0';
}
int dp[80010][11], ans;
int main(){
    string s;
    while(cin >> s && s != "0"){
        ans = 0;
        for(int i = 0; i < 80010; i++){
            for(int j = 0; j < 11; j++){
                dp[i][j] = 0;
            }
        }
        dp[0][ctoi(s[0])] = 1;
        for(int i = 1; i < s.size(); i++){
            if(s[i] != '0'){
                    dp[i][ctoi(s[i])] = 1;
            }
            for(int j = 0; j <= 10; j++){            
                    dp[i][(j * 10 + ctoi(s[i])) % 11] += dp[i - 1][j];
            }
        }
        for(int i = 1; i < s.size(); i++){
            ans += dp[i][0];
        }
        cout << ans << endl;
    }
}


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

using namespace std;

int solve(string& S)
{
    map<char, int> R, L;
    int lmask = 0, rmask = 0;

    for (const auto& c : S)
    {
        R[c]++;
        rmask |= 1 << (c - 'a');
    }

    int ans = 0;

    for (const auto& c : S)
    {
        L[c]++;
        lmask |= 1 << (c - 'a');

        R[c]--;

        if (R[c] == 0)
            rmask &= ~(1 << (c - 'a'));

        ans = max(ans, __builtin_popcount(lmask & rmask));
    }

    return ans;
}

int main()
{
    int N;
    string S;

    cin >> N >> S;

    cout << solve(S) << '\n';

    return 0;
}


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


int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n;
	string str;
	cin>>n>>str;
	for(int i=0;i<str.length();i++){
		if((int)str[i]+n>(int)'Z')printf("%c",(int)str[i]+n-26);
		else printf("%c",(int)str[i]+n);
	}
	printf("\n");
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
#define sz(x) int(x.size())
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define MOD 1000000007
using namespace std;
 
 
 
int main(){
    int N;
    cin >> N;
    cout << N*N*N << endl;
}

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
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 A, B, C; cin >> A >> B >> C;
  string ans = "NO";
  ll tmp = 0;
  for(int i = 0; i < pow(10, 8); ++i) {
    tmp += A;
    if(tmp % B == C) {
      ans = "YES";
      break;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

a, b, c, d = LI()
ans = max(a*c, b*d, a*d, b*c)
print(ans)

Measured memory_bytes: 65300
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
const double PI = acos(-1);
const ll MOD = 1000000007;
using Graph = vector<vector<int>>;

int main() {
  int N; cin >> N;
  set<int> s;
  int c = 0;
  rep(i,N) {
    int a; cin >> a;
    if (a < 3200) s.insert(a / 400);
    else c++;
  }
  
  int t = s.size();
  cout << max(1,t) << " " << t + c << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
using namespace std;
struct node{
    int num;
    node* next;
    node* prev;
};
node * List;
int sum=0;
void initial(){
    List=(node* )malloc(sizeof(node));
    List->next=List;
    List->prev=List;
}
void Insert(int n){
    node *temp = (node*)malloc(sizeof(node));
    temp->num=n;
    temp->next=List->next;
    List->next->prev=temp;
    List->next=temp;
    temp->prev=List;
    sum++;
}
node* Find(int n){
    node * temp=List->next;
    for(;temp!=List;temp=temp->next){
        if(temp->num==n)
          break;
    }
    return temp;
}
void Delete(node *temp){
    if(temp==List)return ;
    temp->prev->next=temp->next;
    temp->next->prev=temp->prev;
    free(temp);
    sum--;
}
void Delete(int n){
    node * temp=Find(n);
    Delete(temp);
}
void Display(){
    node* temp=List->next;
    if(temp==List)return;
    int print=0;
    for(;temp!=List;temp=temp->next){
       print++;
       printf("%d",temp->num);
       if(print==sum)
          printf("\n");
       else printf(" ");
    }
}
int main()
{
    int n,num;
    scanf("%d",&n);
    char command[20];
    initial();
    for(int i=0;i<n;i++){
        for(int j=0;j<20;j++)
            command[j]='\0';
        scanf("%s",command);
        if(command[0]=='i'){
            scanf("%d",&num);
            Insert(num);
        }
        else if(command[0]=='d'&&command[6]=='\0'){
             scanf("%d",&num);
            Delete(num);
        }
        else if(command[0]=='d'&&command[6]=='F'){
            Delete(List->next);
        }
        else if(command[0]=='d'&&command[6]=='L')
            Delete(List->prev);
        else{}
    }
    Display();
    return 0;
}



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

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

  int keta,fx = 0;
  keta = N;

  for ( int i=0;i < 8; i++){    
    fx += keta % 10;
    keta /= 10;
  }
  if ( (N % fx) == 0 ){
    cout << "Yes" <<endl;
  } 
  else {
    cout << "No" << endl;
  }
} 



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

int main(){
    string s;
    cin >> s;
    ll n = s.size();
    ll ans = 0;
    rep(i, 0, n){
        rep(j, 0, n) {
            if(i > j) continue;
            bool f = true;
            rep(k, i, j+1) {
                if(s[k] != 'A' && s[k] != 'G' && s[k] != 'C' && s[k] != 'T') f = false;
            }
            if(f) ans = max(ans, j - i + 1);
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3488
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ullong;

const ullong pnum = 1000000007;

//繰り返し自乗法
ullong power(ullong x, ullong n, ullong M){
    ullong res = 1;
    if ( n > 0 )
    {
        res =power(x ,n/2, M);
        if (n%2 == 0) res = (res * res) % M;
        else res = ( ((res * res) % M) * x) % M;
    }
    return res;
}

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

    cout << power(m, n, pnum) << endl;

    return 0;
}


Measured memory_bytes: 3104
#include<bits/stdc++.h>
 
#define rep(i,n) for(ll i = 0;i < n;++i)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
typedef pair<int,int> P;
 
const int INF = 1001001001;
const long double PI = (acos(-1));


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

    int a,b;
    cin >> a >> b;
    int outlet = 1;
    for(int i = 0;i < 30;++i){
        if(outlet >= b) {
            cout << i << endl;
            return 0;
        }
        outlet--;
        outlet += a;

    }

    cout << endl;
    return 0;
}


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

const ll INF = 1LL << 60;
const int mod = 1e9 + 7;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};

ll X, Y;

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

    combination comb = combination(1000100); 
    mint ans = 0;

    // (1, 2)の移動を固定する
    for (int i = 0; i <= X; i++) {
        ll rest_x = X - i * 1;
        ll rest_y = Y - i * 2;
        if (rest_x < 0 || rest_y < 0) {
            continue;
        }
        // 達した
        if (rest_x == 0 && rest_y == 0) {
            // i回選ぶ (1, 2) でちょうど達する
            ans += 1;
            continue;
        }

        // 残りを (2, 1) の移動で行けるか
        if (rest_x == rest_y * 2) {
            ll cnt = i + rest_y;
            // i回 (1, 2)
            ans += comb(cnt, i); 
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 15872
// #include <bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#include<queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define reps(i,x,n) for(int i=x;i<n;i++)
#define breps(i,x,n) for(int i=x;i>=n;i--)
#define exrep(x,vec) for(auto&& x : vec);
#define PI 3.14159265358979323846264338327950288
const long long MOD = 1000000007;
const int INF{ 2100000000 };	// MAX:2147483647
typedef long long ll;
using namespace std;

// ------------- ここからコード -------------

int main(void) {
	string s;
	cin >> s;
	if (s.substr(s.length()-1,1) == "s")  cout << s << "es" << endl;
	else cout << s << "s" << endl;
	return 0;
}


Measured memory_bytes: 3628
use whiteread::parse_line;

fn main() {
    let mut s: String = parse_line().unwrap();
    let len = s.len();
    let mut cnt = 0;

    println!(
        "{}",
        len - 2 * loop {
            s.truncate(s.len() - 2);
            cnt += 1;
            if &s[0..(s.len() / 2)] == &s[(s.len() / 2)..] {
                break cnt;
            }
        }
    );
}


Measured memory_bytes: 2164
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const long long INF = 1LL << 60;
const ll MOD = 1000000007;
using pint = pair<ll, ll>;

int main(){
    ll D, G;
    cin >> D >> G;
    vector<ll> p(D), c(D);
    for (int i = 0; i < D; i++)cin >> p[i] >> c[i];
    ll cnt = INF;

    for (int bit = 0; bit < (1 << D); bit++) {
        ll sum = 0;
        ll tmp_cnt = 0;

        for (int i = 0; i < D; i++) {
          if (bit & (1 << i)) {
            sum += c[i];
            sum += 100 * (i + 1) * p[i];
            tmp_cnt += p[i];
          }
        }

        if(sum<G){
          for (int j = D - 1; j >= 0; j--){
              if(!(bit & (1<<j))){
                for (int k = 1; k <= p[j]; k++){
                  if (sum >= G) break;
                  sum += 100 * (j + 1);
                  tmp_cnt++;
                }
              }
          }
        }
        cnt = min(cnt, tmp_cnt);
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <iomanip>

using namespace std;


int main() {
	int N;
	cin >> N;
	vector<double> p(N);
	for(auto& x: p) cin >> x;

	vector<double> a(N + 1, 0.0), b(N + 1, 0.0);
	a[0] = 1.0;

	for(int i = 0; i < N; i++) {
		for(int j = 0; j <= i + 1; j++) {
			if(j == 0) b[j] = (1.0 - p[i]) * a[j];
			else b[j] = p[i] * a[j - 1] + (1.0 - p[i]) * a[j];
		}
		for(int j = 0; j <= i + 1; j++) {
			a[j] = b[j];
		}
	}

	double out = 0.0;
	for(int i = N / 2 + 1;i <= N; i++) {
		out += a[i];
	}
	cout.precision(9);
	cout << out << endl;
}


Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long

const int N = 2e5 + 5;
const int MOD = 1e9 + 7;

ll pow(ll a, ll b, ll m)
{
    ll  ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%m;
		b/=2;
		a=(a*a)%m;
	}
	return ans;
}

int n;
int a[101];
int ans[100005]={0};

int solve(int k){
    if(ans[k]){
        return ans[k];
    }
    for(int i=0;i<n;i++){
        if(k>=a[i]){
        if(solve(k-a[i])==2){
            ans[k]=1;
            return ans[k];
        }
      }
    }
   ans[k]=2;
   return ans[k];
}

int main()
{
	IOS;
	int t=1; //cin>>t;
	while(t--){
	    int k; cin>>n>>k;
	    for(int i=0;i<n;i++){
	       cin>>a[i];
	   }
	   ans[0]=2;
	   if(solve(k)==1){
	    cout<<"First";   
	   }
	   else{
	       cout<<"Second";
	   }
	    cout<<endl;
	}  
}

Measured memory_bytes: 6996
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
from decimal import *

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *
 
N, M = MAP()

if N > M//2:
	print(M//2)
else:
	ans = N
	ans += (M-2*N)//4
	print(ans)

Measured memory_bytes: 5200
N, M = map(int, input().split())
c = [1] * N
r = [True] + [False] * (N-1)
for i in range(M):
    x, y = map(int, input().split())
    if r[x-1] == True:
        r[y-1] = True
    if c[x-1] == 1:
        r[x-1] = False
    c[x-1] -= 1
    c[y-1] += 1
print(sum(r))


Measured memory_bytes: 75920
#include <stdio.h>

int main() {
    int s, m, h;
    scanf("%d", &s);
    h = s / 3600;
    s -= (3600 * h);
    m = s / 60;
    s -= (60 * m);
    printf("%d:%d:%d\n", h, m, s);
    return 0;
}


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

#define rep(i,n) for(ll i=0;i<n;i++)
#define repm(i,m,n) for(ll i=m;i<n;i++)
#define max(a,b) (((a)>(b))?(a):(b))
#define min(a,b) (((a)<(b))?(a):(b))
#define YesNo(a) (a)?cout<<"Yes"<<endl:cout<<"No"<<endl
#define YESNO(a) (a)?cout<<"YES"<<endl:cout<<"NO"<<endl
#define INF (2e9)
#define PI (acos(-1))
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007

typedef long long ll;

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

  cout << n*(n-1)/2 + m*(m-1)/2 << endl;
}

Measured memory_bytes: 256
S = input()
a,b = int(S[:2]), int(S[2:])
ans = ['NA', 'YYMM', 'MMYY', 'AMBIGUOUS']
idx = 0
if a in range(1,13):
  idx += 2
if b in range(1,13):
  idx += 1
print(ans[idx])

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int a[100001][3],dp[100001][4];
int solve(int i,int n,int flag)
{
    if(i>=n) return 0;
    if(dp[i][flag]!=-1) return dp[i][flag];
    int mx=0;
    for(int j=1;j<=3;j++)
    {
        if(j==flag) continue;
        mx=max(mx,a[i][flag-1]+solve(i+1,n,j));
    }
    dp[i][flag]=mx;
    return mx;
    /*
    if(flag==1)
    {   int l=solve(i+1,n,2);
        int r=solve(i+1,n,3);
        cout<<l<<" "<<r<<"flag1"<<endl;
        cout<<l+a[i]<<" "<<r+a[i]<<" flag1"<<endl;
        dp[i][flag]=max(a[i]+l,a[i]+r);
        cout<<dp[i][flag]<<" dp[i][flag]"<<" "<<i<<" "<<flag<<endl;
    }
    else if(flag==2)
    {   int l=solve(i+1,n,1);
        int r=solve(i+1,n,3);
        cout<<l+b[i]<<" "<<r+b[i]<<" flag2"<<endl;
        cout<<l<<" "<<r<<"    flag2 "<<endl;
        dp[i][flag]=max(b[i]+r,b[i]+l);
        cout<<dp[i][flag]<<" dp[i][flag]"<<" "<<i<<" "<<flag<<endl;
    }
    else
    {
        int l=solve(i+1,n,2);
        int r=solve(i+1,n,1);
        cout<<l+c[i]<<" "<<r+c[i]<<" flag3"<<endl;
        dp[i][flag]=max(c[i]+r,c[i]+l);
        cout<<dp[i][flag]<<" dp[i][flag]"<<" "<<i<<" "<<flag<<endl;
    }
    return dp[i][flag]; */
}
int main() {
	// your code goes here

    int n;
    cin>>n;
    //int a[n],b[n],c[n];
    for(int i=0;i<n;i++) 
    for(int j=0;j<3;j++)
    cin>>a[i][j];
    
    memset(dp,-1,sizeof(dp));
    int mx=INT_MIN;
   for(int i=1;i<=3;i++)
   {
       int ans=solve(0,n,i);
     // cout<<ans<<endl<<endl<<endl;
       mx=max(mx,ans);
       memset(dp,-1,sizeof(dp));
   }
    cout<<mx<<endl;
	return 0;
}


Measured memory_bytes: 14124
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,d,f,s;
    cin>>a>>b>>c>>d;
    f=a*b;
    s=c*d;
    if(f>s){
        cout<<f<<endl;
    }
    else if(s>f){
        cout<<s<<endl;
    }
    else{
        cout<<s<<endl;
    }

    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define p 3.14159265358979323846L

using namespace std;

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

    int x;
    cin>>x;


    for(int a=-118;a<120;a++)
    {
        for(int b=-118;b<120;b++)
        {
            if(pow(a,5)-pow(b,5)==x)
            {
                cout<<a<<" "<<b<<endl;
                return 0;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 4072
#include <stdio.h>
int a[200010],sum;
int main(){
	int n,i;
	scanf("%d",&n);
	for(i=1;i<=n;i++)scanf("%d",&a[i]),sum^=a[i];
	for(i=1;i<=n;i++)printf("%d ",sum^a[i]);
	return 0;
}

Measured memory_bytes: 3264
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        long[] a = new long[n];

        long total = 0;
        long min = Integer.MAX_VALUE;
        int minCnt = 0;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if (a[i] < 0)
                minCnt++;

            total += Math.abs(a[i]);
            min = Math.min(min, Math.abs(a[i]));
        }

        if (minCnt % 2 == 1) {
            total -= min * 2;
        }

        System.out.println(total);
    }
}


Measured memory_bytes: 51448
//include
//------------------------------------------
#include <bits/stdc++.h>
using namespace std;
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef long long ll;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const long long INF = 1000000007;
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
// chmax chmin
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(void){
    ll N; cin >> N;
    ll ans=1;
    REP(i,N) ans = ans*((ll)i+1) % INF;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int min = a / 100;
        int minRev = min / 10 % 10 * 10 + min / 100;
        int minRest = a % 100;
        if (minRev < minRest) {
            min++;
        }

        int max = b / 100;
        int maxRev = max / 10 % 10 * 10 + max / 100;
        int maxRest = b % 100;
        if (maxRest < maxRev) {
            max--;
        }

        int result = max - min + 1;

        // 出力
        System.out.println(result);
    }
}


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

int main(){
    char n[3];
    cin >> n;
    for(int i=0;i<3;i++){
        if(n[i]=='1'){
            cout << 9;
        }else{
            if(n[i]=='9'){
                cout << 1;
            }else{
                cout << n[i] - '0';
            }
        }
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  long long n,b=0,ans=0,c=1000000007;
  cin >> n;
  int a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
    if(a[i]==0){
    	b++;
    }
  }
  if((n%2==0&&b!=0)||(n%2==1&&b!=1)){
  	cout << ans << endl;
  	return 0;
  }
  sort(a,a+n);
  if(n%2==0){
  	for(int i=0;i<n/2;i+=2){
  		if(a[i]!=a[i+1]){
  			cout << ans << endl;
  			return 0;
  		}
  	}
  }else{
  	for(int i=1;i<=n/2;i+=2){
  		if(a[i]!=a[i+1]){
  			cout << ans << endl;
  			return 0;
  		}
  	}
  }
  ans++;
  for(int i=0;i<n/2;i++){
  	ans*=2;
  	ans%=c;
  }
  cout << ans << endl;
  return 0;
}


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

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> broken(n+1);
  
  for (int i=0;i<m;i++){
    int a;
    cin >> a;
    broken[a] = 1;
  }
  
  const int mod = 1000000007;
  vector<int> dp(n+2);
  dp[n] = 1;
  for (int i=n-1;i>=0;i--){
    if (broken[i]){
      dp[i]=0;
      continue;
    }
    dp[i] = (dp[i+1]+dp[i+2])%mod;
  }
  cout << dp[0] << endl;
}
  


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
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; }
using ll = long long;
using P = pair<ll, ll>;
ll GCD(ll a, ll b) { return b?GCD(b, a%b):a; }
ll LCM(ll a, ll b) { return a/GCD(a, b)*b; }


int main() {
    int n; cin >> n;
    int cnt = 0;
    vector<int> avec(n, 0);
    for(int i = 0; i < n; ++i) {
        cin >> avec.at(i);
        if(i % 2 == 0) {
            if(avec.at(i) % 2 != 0) cnt++;
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int a=0,b=0;
  cin >> a >> b;
  int d = b - a;
  int fulltall = 0;

  for(int i = 1; i <= d; i++){
    fulltall += i;
  }
  cout << fulltall - b << endl;
  return 0;
}

Measured memory_bytes: 256
(function main(){
  const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n');
  const n = Number(lines.shift());
  const arr = lines.shift().split(' ').map(Number);
  buildMaxHeap(arr);
  console.log(arr.reduce((s, e) => s += ' ' + e, ''));
})();

function buildMaxHeap(arr) {
  const n = arr.length;
  const maxHeapify = (i) => {
    let left = 2 * i + 1, right = 2 * i + 2;
    let largest = i;
    if (left < n && arr[left] > arr[largest]) largest = left;
    if (right < n && arr[right] > arr[largest]) largest = right;
    if (largest != i) {
      arr[largest] = [arr[i], arr[i] = arr[largest]][0];
      maxHeapify(largest);
    }
  };

  for (let i = Math.floor(arr.length / 2); i >= 0; i--) maxHeapify(i);
}



Measured memory_bytes: 140152
#include<stdio.h>

int search(int A[],int n,int key){
    int i=0;
    A[n]=key;
    while(A[i]!=key)i++;
    return i != n;
}

int main(){
    int i,n,A[10000+1],q,key,sum=0;
    
    scanf("%d",&n);
    for(i=0;i<n;i++) scanf("%d",&A[i]);
    
    scanf("%d",&q);
    for(i=0;i<q;i++){
        scanf("%d",&key);
        if(search(A,n,key))sum++;
    }
    printf("%d\n",sum);
    return 0;
}


Measured memory_bytes: 2052
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#define _USE_MATH_DEFINES
#include <math.h>
#include <iomanip>
#include <stdio.h>
#include <numeric>
#include <cmath>
#include <limits>
#include <bitset> 
#include <iterator> 
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include<deque>
#include <regex>
#include <list>
#include <unordered_set>

#define rep(i,n) for(ll i=0;i<(n); ++i)
#define per(i,n) for(ll i=n-1;i>=0; --i)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define _GLIBCXX_DEBUG
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
typedef long long ll;
const ll MOD = 1000000007;
ll getDigit(ll n) {
	ll cnt = 0;
	while (n != 0) {
		n /= 10;
		cnt++;
	}
	return cnt;
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
typedef pair<double, long long> pair_t;
bool PSecComp(const pair_t& a, const pair_t& b) {
	if (a.second == b.second)return  a.first > b.first;
	else {
		return a.second > b.second;
	}
}

int main() {
	ll w, h,x,y;
	cin >> w >> h >> x >> y;
	cout << fixed << setprecision(15) <<(w*h/2.0) << " " << (x == w / 2.0 && y == h / 2.0 ? 1 : 0) << endl;
}



Measured memory_bytes: 256
n = int(input())
dat = list(map(int, input().split()))
t = sum(dat)
target = t//2
c = 0
c2 = t
res = 99999999999999999
for i in range(n):
    c += dat[i]
    c2 -= dat[i]
    res = min(res, abs(c-c2))

print(res)

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

int main(){
	int num; char op;
	int ans;
	cin >> ans;

	while(true){
		cin >> op;
		if(op=='='){
			cout << ans << endl;
			break;
		}
		cin >> num;

		switch(op){
			case '+':
				ans+=num;
				break;
			case '-':
				ans-=num;
				break;
			case '*':
				ans*=num;
				break;
			case '/':
				ans/=num;
				break;
			default:
				cout << "err" << endl;
				break;
		}
	}
	return 0;
}



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

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;

const int N = 110;

int n;
map<int, int> cnt;

int main()
{
    cin >> n;
    while(n--)
    {
        int x;
        cin >> x;
        if(cnt.count(x))
        {
            puts("NO");
            return 0;
        }
        cnt[x]++;
    }
    puts("YES");
    return 0;
}


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

int n, m, a, b, dis[100001], mx, in[100001];
vector<int> adj[100001];

void bfs(int src) {
    queue<int> q;
    q.emplace(src);
    dis[src] = 0;
    while (!q.empty()) {
        int p = q.front();
        q.pop();
        for (int ch : adj[p]) {
            if (dis[ch] < dis[p]+1) {
                dis[ch] = dis[p]+1;
                mx = max(mx, dis[ch]);
            }
            if (--in[ch]==0) {
                q.emplace(ch);
            }
        }
    }
}
int main() {
    scanf("%d%d", &n, &m);
    while (m--) {
        scanf("%d%d", &a, &b);
        adj[a].emplace_back(b);
        in[b]++;
    }
    for (int i = 1; i <= n; ++i) {
        if (!dis[i] && !in[i]) {
            bfs(i);
        }
    }
    printf("%d\n", mx);
    return 0;
}


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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) ((a+b-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T> void YesNo(T a) {cout<<(a?"Yes":"No")<<endl;}
template<class T> void YESNO(T a) {cout<<(a?"YES":"NO")<<endl;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());}
//const int MOD=1000000007;
const int MOD=2019;
const int INF=LLONG_MAX/2;


signed main() {cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    int l,r,ans=MOD;
    cin>>l>>r;
    if(l/2019!=r/2019 || l%2019==0 || r%2019==0){cout<<0<<endl;return 0;}
    l%=MOD;
    r%=MOD;
    REP(i,l,r+1){
        REP(j,i+1,r+1){
            chmin(ans,(i*j)%MOD);
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<unordered_map>
#include<stack>
#include<queue>
#include<iomanip>
#include<math.h>
#include<bitset>
#include<cassert>
#include<random>
#include<time.h>
#include<functional>
using namespace std;
using ll=long long;
using ld=long double;
using pint=pair<int,int>;
using pll=pair<ll,ll>;
#define MOD 1000000007LL
#define INF 1000000000LL
#define EPS 1e-10
#define FOR(i,n,m) for(ll i=n;i<(ll)m;i++)
#define REP(i,n) FOR(i,0,n)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v)  sort(ALL(v));v.erase(unique(ALL(v)),v.end());
#define pb push_back

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n, k;
	cin >> n >> k;
	if((n + 1) / 2 >= k) cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}

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


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

#define mp make_pair
typedef long long ll;
typedef pair<ll,ll>pll;
vector<pll>v;

int main()
{
	ll x;
	scanf("%lld",&x);
	for(int i=-500;i<=500;i++){
		ll cur = i;
		for(int j=2;j<=5;j++){
			cur *= i;
		}
		v.push_back(mp(i,cur));
	}
	for(int sz=v.size(),i=0;i<sz;i++){
		for(int j=0;j<sz;j++){
			if(v[i].second-v[j].second==x){
				printf("%lld %lld\n",v[i].first,v[j].first);
				return 0;
			}
		}
	}
}


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

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var H = Console.ReadLine().Split().Select(int.Parse).Reverse().ToList();

            var ans = "Yes";
            for (int i = 0; i < N - 1; i++)
            {
                if (H[i] >= H[i + 1]) continue;

                if (H[i] >= H[i + 1] - 1)
                {
                    H[i + 1] -= 1;
                    continue;
                }

                ans = "No";
                break;
            }

            Console.WriteLine(ans);
        }
    }
}


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

#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define faster() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

const long long int infLL = 9000000000000000000;

#define mem(a,b) memset(a, b, sizeof(a) )
#define all(a) (a).begin(),(a).end()
#define mx_int_prime 999999937
#define Size 100000000

const int inf = 2000000000;
const double PI = acos(-1);
const double eps = 1e-9;
typedef long double ld;

#define MOD 1000000007

typedef long long ll;
const int mx=2e5+125;

ll pr[mx],ar[mx],br[mx];

#define PB push_back
#define endl '\n'
#define S second
#define F first
bool p[Size];

void seive()
{
    mem(p,1);
    p[0]=0;
    p[1]=0;
    for(ll i=2; i*i<=Size; i++)
    {
        if(p[i]==1)
        {
            for(ll j=2*i; j<=Size; j+=i)
            {
                p[j]=0;
            }
        }
    }
    ll n;
    cin>>n;
    for(ll i=n; ; i++)
    {
        if(p[i]==1)
        {
            cout<<i<<endl;
            return ;
        }
    }
}
int main()
{
    seive();

    return 0;
}


Measured memory_bytes: 101284
#include<bits/stdc++.h>
using namespace std;
#define re register
int main()
{
	re int n,m,a,b;
	scanf("%d%d%d%d",&n,&m,&a,&b);
	for(re int i=1;i<=n;i++)
	{
		for(re int j=1;j<=m;j++)
		{
			printf("%d",(j<=a)^(i<=b));
		}puts("");
	}
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,A,B;
string S;
string alpha = "abcdefghijklmnopqrstuvwxyz";
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";


int main() {
    cin>>N>>M;
    class union_find{
            vector<long> parent, tree_size;
        public:
            union_find(unsigned long _n) : parent(_n), tree_size(_n, 1){
                for(unsigned long i = 0; i < _n; ++i)parent[i] = i;
            }
            ll find(ll x){
                while(parent[x] != x)x = parent[x] = parent[parent[x]];
                return x;
            }
            void merge(ll a, ll b){
                a = find(a);
                b = find(b);
    	        if(a==b) return;
                if(tree_size[a] < tree_size[b])swap(a, b);
                tree_size[a] += tree_size[b];
                parent[b] = a;
                return;
            }
    	    bool same(ll a, ll b){
    	    a = find(a);
    	    b = find(b);
    	    return a == b;
    	    }
    	    ll tree_s(ll a){
                return tree_size[find(a)];
            }
        };
    union_find uf(N);
    //uf.mergeのように使う
    //ufはMAX_N+1でとるか、代入時に0-indexedにする
    typedef pair<ll,ll> P;
    vector<P> brg(M);
    rep(i,M) {
        cin>>brg[i].fi>>brg[i].se;
        --brg[i].fi;
        --brg[i].se;
    }
    reverse(brg.begin(),brg.end());
    vec uni(M,0);
    rep(i,M){
        P p = brg.at(i);
        ll a = p.fi, b = p.se;
        if(uf.same(a,b)) continue;
        uni.at(M-i-1) = uf.tree_s(a) * uf.tree_s(b);
        //cout<<i<<' '<<uf.tree_s(a)<<' '<<uf.tree_s(b)<<endl;
        uf.merge(a,b);
    }
    cout<<uni.at(0)<<endl;
    reps(i,1,M){
        uni.at(i) += uni.at(i-1);
        cout<<uni.at(i)<<endl;
    }
}

Measured memory_bytes: 5248
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define pb(x) push_back(x)
#define eb(x,y) emplace_back(x,y)
#define MOD 1000000007
#define MAX 1000000001
#define INF 1410065408
#define EPS 1e-9
#define DEBUG 0
 
using namespace std;
typedef long long ll;
typedef pair<ll, ll> Pll;
typedef pair<int, int> Pii;
struct edge{int from, to; ll cost;};

ll gcd(ll a, ll b){
    if(b == 0) return a;
    else return gcd(b, a%b);
}

signed main(){
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(n) cin >> a[i];
    sort(all(a));
    if(a.back() == 10e18){
        cout << 10e18;
        return 0;
    }
    ll ans = a[0];
    reppp(i, 1, n-1){
        if(ans % a[i] == 0) continue;
        if(a[i] % ans == 0) ans = a[i];
        else ans = ans / gcd(ans, a[i]) * a[i];
        if(ans == 10e18) break;
    }
    cout << ans;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define INF 1e9
typedef long long ll;
using namespace std;

int main() {
    int k,s; cin >> k >> s;
    int count=0;
    for(int i=0; i<=k; i++){
        for(int j=0; j<=k; j++){
            if(s-i-j>=0 && s-i-j<=k){
                count+=1;
            }
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")

#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>

using namespace std;

typedef pair <int, int> pii;
typedef pair <long long, long long> pll;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define endl "\n"
#define mt make_tuple
#define mp make_pair

template <typename T1, typename T2>
bool umax(T1 &a, const T2&b) { return a < b ? a = b, 1 : 0;}
template <typename T1, typename T2> 
bool umin(T1 &a, const T2 &b) {return a > b ? a = b, 1 : 0;}
template <typename T>
T sqr(T a) {return a * a;}

mt19937 rng(20010709);
const int mod = 1000000007;
const int INF = 1000000001;

int n, W;
ll dp[100005];

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

    cin >> n >> W;

    fill(dp, dp + 100001, INF);
    dp[0] = 0;

    for (int i = 1; i <= n; i++) {
        int w, v;
        cin >> w >> v;

        for (int j = 100000; j >= v; j--)
            umin(dp[j], dp[j - v] + w);
    }

    for (int i = 100000; i > -1; i--) {
        if (dp[i] <= W) {
            cout << i << endl;
            break;
        }
    }

    cout << endl << endl;

    return 0;
}

Measured memory_bytes: 1024