akhauriyash/Code-Regression huggingface dataset:
/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   all(a) (a.begin(),a.end())
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std;

inline void solve(){
    int n,ans=0; cin>>n; 
    int a[n],mn=1000;
    for (int i=0;i<n;i++){
        cin >> a[i];
        if (i==0) ans=a[i];
        else ans += max(0LL,a[i]-a[i-1]);
    }
    cout << ans << endl;
}

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


Measured memory_bytes: 3592
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

int main() {
    int r, g, b;
    cin >> r >> g >> b;
    if ((100*r + 10*g + b) % 4 == 0) {
        std::cout << "YES" << '\n';
    } else {
        std::cout << "NO" << '\n';
    }
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
typedef long long ll;
const ll longinf=1LL<<60;
using namespace std;

int n;

int main()
{
    cin>>n;
    cout<<n*n*n<<endl;
    return 0;
}



Measured memory_bytes: 256
using System;
class Program
{
    static void Main(string[] args)
    {
     string[] nums;
     int a;
     int b;
     int total;
      
     nums = Console.ReadLine().Split(' ');
     a = int.Parse(nums[0]);
	 b = int.Parse(nums[1]);

     total = a * b;

     	if (total%2 == 0){
     		Console.WriteLine("Even");
     	}
     	else{
     		Console.WriteLine("Odd");
     	}

     }
} 

Measured memory_bytes: 13140
/*
Sharif Hasan - CSE, PUST
Dec 29, 2019 12: 00 PM 
*/
#include<bits/stdc++.h>
#define br cout<<"\n"

/*STL definations*/
#define pb push_back

#define FOR(i,n) for(i=0;i<n;i++)
#define FROM(a,i,n) for(i=a;i<n;i++)
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

/*Main function*/
int main()
{
long long a,b,c;
cin>>a>>b>>c;
long long m = min(a,c);
a-=m;
c-=m;
if(a==0 && c!=0){
    m = min(b,c);
    b-=m;
    c-=m;
}

cout<<a<<" "<<b;br;
return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> //C++の標準ライブラリを一行で一括でインクルードする
#include <math.h> //数学関数と数学定数を利用する
#define rep(i,n) for (int i = 0; i < (n); i++)
#define PI 3.141592653589793
using namespace std;
typedef long long ll;
template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}
int gcd(int a, int b){//ユークリッドの互除法
  if (a < b) gcd(b,a); //aの方がbよりでかいのが前提
  if (b == 0) return a; //aをbで割り切れたらreturn
  else gcd(b, a % b);
}
const int INF = 1<<30;
const int MOD = 1000000007;
int dx[4] = {0,0,-1,1};
int dy[4] = {-1,1,0,0};

int main(){
  int n; cin >> n;
  vector<int> p(n),q(n),v(n);
  rep(i,n){
    cin >> p[i];
  }
  rep(i,n){
    cin >> q[i];
  }
  rep(i,n){
    v[i] = i+1;
  }
  
  int cntp = 0;
  do{
    cntp++;
    if(v == p) break;      
  }while(next_permutation(v.begin(), v.end()));// 次の順列を生成
  
  sort(v.begin(),v.end());

  int cntq = 0;
  do{
    cntq++;
    if(v == q) break;      
  }while(next_permutation(v.begin(), v.end()));// 次の順列を生成
  
  cout << abs(cntq - cntp) << endl;
  
  return 0;
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class CReplacingInteger {
        public void solve(int testNumber, FastReader s, PrintWriter out) {
            long n = s.nextLong();
            long k = s.nextLong();
            if (n == k || k == 1l) {
                out.println(0);
                return;
            }

            n %= k;
            if (k - n <= n) {
                n = k - n;
            }
            out.println(n);
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



Measured memory_bytes: 21460
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int a[5];
	for (int i = 0; i < 5; i++)
	{
		a[i] = 0;
	}
	for (int i = 0; i < 5; i++)
	{
		cin >> a[i];
		if (a[i] <= 40)
		{
			a[i] = 40;
		}
	}
	cout << (a[1] + a[2] + a[3] + a[4] + a[0]) / 5 << endl;
	return 0;
}

Measured memory_bytes: 3056
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cstdio>
#include <queue>
#include <deque>
#include <map>
#include <stack>
#include <set>
#include <utility>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> P;
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
const int MAXN = 100000;
const int MAXE = 100000;
const int MAXV = 10000;
const int inf = 1e9;
const ll INF = 2e18;
const ll MOD = 1e9 + 7;

struct UnionFind{
    vector<int> par,rank;
    UnionFind(int n):par(n),rank(n){
        for(int i=0;i<n;++i) par[i]=i;
    }
    int root(int x){
        if(par[x]==x) return x;
        return par[x]=root(par[x]);
    }
    void unite(int x,int y){
        int rx=root(x),ry=root(y);
        if(rx==ry) return ;
        if(rank[ry]>rank[rx]) par[rx]=ry;
        else par[ry]=rx;
        if(rank[rx]==rank[ry]) rank[rx]++;
    }
    bool same(int x,int y){
        return root(x)==root(y);
    }
};

vector<ll> fac,inv,finv;

void initcom(){
    fac=inv=finv=vector<ll>(1e6);
    fac[0]=fac[1]=1;
    inv[1]=1;
    finv[0]=finv[1]=1;
    for(ll i=2;i<1e6;++i){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}

ll com(int n,int k){
    if(n<0||k<0) return 0;
    if(n<k) return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}
ll gcd(ll x,ll y){
    if(y==0) return x;
    return gcd(y,x%y);
}
ll mopow(ll a,ll x,ll mod){
    ll res=1;
    while(x>0){
        if(x&1) res=res*a%mod;
        a=a*a%mod;
        x>>=1;
    }
    return res;
}

int main(){
    ll n,k;cin>>n>>k;
    vector<ll> a(n);
    for(int i=0;i<n;++i) cin>>a[i];
    sort(a.begin(),a.end());
    ll left=-1e18-1;
    ll right=1e18+1;
    while(right-left>1){
        ll mid=(right+left)/2;
        ll S=0,T=0;
        for(int i=0;i<n;++i){
            if(a[i]>0){
                int l=-1,r=n;
                while(r-l>1){
                    int m=(l+r)/2;
                    if(a[i]*a[m]<=mid) l=m;
                    else r=m;
                }
                S+=r;
            }else if(a[i]<0){
                int l=-1,r=n;
                while(r-l>1){
                    int m=(l+r)/2;
                    if(a[i]*a[m]<=mid) r=m;
                    else l=m;
                }
                S+=n-r;
            }else{
                if(mid>=0) S+=n;
            }
            if(a[i]*a[i]<=mid) ++T;
        }
        if((S-T)/2>=k) right=mid;
        else left=mid;
    }
    cout<<right<<endl;
    return 0;
}


Measured memory_bytes: 4764
#include<bits/stdc++.h>
#define FOR(i,a,b) for (register int i=(a);i<=(b);i++)
#define For(i,a,b) for (register int i=(a);i>=(b);i--)
using namespace std;
typedef long long ll;
const int N=6e3+5;
int n,mod,fac[N],inv[N],ans=0,g[N][N],f[N],er[N],erer[N],two[N*N];
inline void upd(int &a,int b) {a=(1LL*a+b)%mod;return;}
inline int qpow(int x,int y,int m){int ret=1;for(;y;y>>=1,x=1LL*x*x%m)if(y&1)ret=1LL*ret*x%m;return ret;}
inline int C(int x,int y) {return 1LL*fac[x]*inv[y]%mod*inv[x-y]%mod;}
int main()
{
	scanf("%d%d",&n,&mod);
	fac[0]=er[0]=1;
	FOR(i,1,n) er[i]=2LL*er[i-1]%(mod-1);
	FOR(i,1,n) fac[i]=1LL*fac[i-1]*i%mod;
	inv[n]=qpow(fac[n],mod-2,mod);
	For(i,n-1,0) inv[i]=1LL*inv[i+1]*(i+1)%mod;
	FOR(i,0,n) g[i][0]=1;
	FOR(i,1,n) FOR(j,1,i) g[i][j]=(1LL*g[i-1][j-1]+1LL*g[i-1][j]*(j+1)%mod)%mod;
	FOR(i,0,n) erer[i]=qpow(2,er[i],mod);
	two[0]=1;
	FOR(i,1,n*n) two[i]=2LL*two[i-1]%mod;
	FOR(i,0,n) FOR(j,0,i) upd(f[i],1LL*g[i][j]*two[(n-i)*j]%mod*erer[n-i]%mod);
	FOR(i,0,n)
	{
		if (i&1) upd(ans,(mod-1LL*C(n,i)*f[i]%mod)%mod);
		else upd(ans,1LL*C(n,i)*f[i]%mod);
	}
	printf("%d\n",ans);
	return 0;
}

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



int main(){
    int a,b;
    cin >> a >>b;
    int ans = (b-1)/(a-1);
    if((b-1)%(a-1) != 0) ans++;

    cout << ans << endl;

}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 10000000000000000
#define endl '\n'
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; }
using namespace std;

int n,x;
int a[2025],b[2025];

inline int fix_int(int m){
    if(m<0)m+=n;
    return m;
}

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

    cin>>n>>x;
    int ans=0;
    rep(i,n){
        cin>>a[i]; ans+=a[i]; b[i]=a[i];
    }

    for(int k=1; k<=n-1; k++){
        int sum=k*x;
        rep(i,n){
            chmin(b[i],a[fix_int(i-k)]);
            sum+=b[i];
        }
        chmin(ans,sum);
    }
    cout<<ans<<endl;
    
}

Measured memory_bytes: 256
import copy
n=int(input())
a=list(map(int,input().split()))
b=copy.copy(a)
mod=10**9+7
lcm=[0]*max(a)
for i in range(n):
	for j in range(2,int(a[i]**0.5)+1):
		cnt=0
		while a[i]%j==0:
			a[i]//=j
			cnt+=1
		lcm[j-1]=max(lcm[j-1],cnt)
	if a[i]!=1:
		lcm[a[i]-1]=max(lcm[a[i]-1],1)
an=1
for i in range(len(lcm)):
	an*=pow(i+1,lcm[i],mod)
	an%=mod
ans=0
for i in range(n):
	ans+=an*pow(b[i],mod-2,mod)
	ans%=mod
print(ans)


Measured memory_bytes: 52828
#include "bits/stdc++.h"
using namespace std;
using ll = long long; using ull = unsigned long long;
//#define int ll
using vb = vector<bool>; using vvb = vector<vb>;
using vi = vector<int>; using vvi = vector<vi>;
using vl = vector<ll>; using vvl = vector<vl>;
template<class T> using V = vector<T>;
template<class T> using VV = vector<V<T>>;
#define fi first
#define se second
#define maxs(x,y) (x=max(x,y))
#define mins(x,y) (x=min(x,y))
using pii = pair<int,int>; using pll = pair<ll,ll>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(ll i = (ll)(b)-1;i >= a;--i)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define eb(val) emplace_back(val)
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9+7;
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}
signed main(){
  int n;
  while(cin >> n,n){
    vi a(n),sum(n+1,0);
    REP(i,n){
      cin >> a[i];
      sum[i+1] = sum[i]+a[i];
    }
    int ans = INT_MIN;
    REP(i,n+1)FOR(j,i+1,n+1){
      maxs(ans,sum[j]-sum[i]);
    }
    cout << ans << endl;
  }
}


Measured memory_bytes: 3068
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<functional>
#include<map>
#define LL long long
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPA(i,n) for(int i=1;i<(n);++i)
#define PII pair<int,int>
#define PLI pair<long long, int>
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9)
#define INFLL ((LL)1e18)
#define ALL(x) (x).begin(),(x).end()
#define ctoi(x) (x - 'a') 
#define CTOI(x) (x - 'A')
#define BIT(x) (1 << (x))
using namespace std;

int main(){
    int A, P;
    cin >> A >> P;
    cout << (A*3+P)/2 << endl;
    return 0;
}


Measured memory_bytes: 256
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

use std::collections::HashSet;

fn main() {
    input! {
        n: usize,
        a_list: [usize; n]
    }
    let mut used = HashSet::new();
    let mut next_button = 1;
    let mut count = 0;
    while !used.contains(&next_button) {
        if next_button == 2 {
            println!("{}", count);
            std::process::exit(0);
        }
        used.insert(next_button);
        next_button = a_list[next_button - 1];
        count += 1;
    }
    println!("-1");
}


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

double A,B,C,D,E,F;

double cc(double a, double b){
	if(b==0) return 0;
	else return 100*b/(a+b);
}

double dissolvable(double w){
	return w*E/100;
}

int main(){
	while(cin >> A >> B >> C >> D >> E >> F && A>0){
		vector<double> W,S;
		double water = 0, sugar = 0, cons = -1;
		for(int i=0;100*A*i<=F;i++){
			for(int j=0;100*B*j+100*A*i<=F;j++){
				double a = 100*B*j+100*A*i;
				if(a!=0){
					W.push_back(a);
				}
			}
		}
		for(int i=0;C*i<=F;i++){
			for(int j=0;D*j+C*i<=F;j++){
				double b = D*j+C*i;
				//if(b<=F){
					S.push_back(b);
			//	}
			}
		}
		for(int i=0;i<W.size();i++){
			for(int j=0;j<S.size();j++){
				double w = W[i], s = S[j];
				if(s <= dissolvable(w) && w+s <= F && cons < cc(w,s)){
					cons = cc(w,s);
					water = w;
					sugar = s;
				}
			}
		}
		cout << water + sugar << " " << sugar << endl;
		W.clear();
		S.clear();
	}
}

Measured memory_bytes: 2420
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,d,e;cin>>a>>b>>c>>d>>e;
  vector<int> r(5);
  r.at(0)=a%10;
  r.at(1)=b%10;
  r.at(2)=c%10;
  r.at(3)=d%10;
  r.at(4)=e%10;
  for(int i=0;i<5;i++){
    if(r.at(i)==0)r.at(i)=10;
  }
  sort(r.begin(),r.end());
  cout<<a+b+c+d+e-r.at(1)-r.at(2)-r.at(3)-r.at(4)+40<<endl;
}
  


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int top = 0, S[1000];

void push(int x) {
  S[++top] = x;
}

int pop(void) {
  top--;
  return S[top+1];
}

int main(void) {
  int a, b;
  top = 0;
  char s[100];
  while(scanf("%s",s) != EOF) {
    if(s[0] == '+') {
      a = pop();
      b = pop();
      push(a + b);
    } else if(s[0] == '-') {
      b = pop();
      a = pop();
      push(a - b);
    } else if(s[0] == '*') {
      a = pop();
      b = pop();
      push(a * b);
    } else {
      push(atoi(s));
    }
  }
  printf("%d\n",pop());

  return 0;
}


Measured memory_bytes: 2092
import sys
input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()



def main():
	n,k=MI()


	a=0
	b=0
	for i in range(1,n+1):
		if i%k==0:
			a+=1

	if k%2==0:
		for i in range(1,n+1):
			if i%(k//2)==0:
				b+=1
		b-=a
	#print(a,b)

	print(a**3+b**3)











if __name__ == "__main__":
	main()


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

int n;
int main(){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int t;
		scanf("%d",&t);
		if(t%2==0&&(t%3!=0&&t%5!=0)){
			puts("DENIED");
			return 0;
		}
	}
	puts("APPROVED");
}

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

int r, c, n, a[10005], ans[105][105];
int dy[] = { 0, 1, 0, -1 };
int dx[] = { 1, 0, -1, 0 };
int main() {
	scanf("%d %d", &r, &c);
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
	}
	int y = 0, x = 0, dir=0;

	for (int i = 1; i <= n; i++) {
		while (a[i]) {
			--a[i];
			ans[y][x] = i;
			int ny = y + dy[dir];
			int nx = x + dx[dir];
			if (!(ny >= 0 && ny < r && nx >= 0 && nx < c) || ans[ny][nx]) {
				dir = (dir + 1) % 4;
				ny = y + dy[dir];
				nx = x + dx[dir];
			}
			y = ny, x = nx;
		}
	}
	for (int i = 0; i < r; i++) {
		for (int j = 0; j < c; j++)printf("%d ", ans[i][j]);
		puts("");
	}
}

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

from pprint import pprint
from collections import deque, defaultdict
import sys

sys.setrecursionlimit(10 ** 6)
inf = float("inf")

n = int(input())
s = defaultdict(str)
for _ in range(n):
    key = input()
    s[key] = 1

print(len(dict(s)))


Measured memory_bytes: 166820
fn input_pair<T: std::str::FromStr + Copy> () -> (T, T) {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let arr: Vec<_> = s.trim().split_whitespace().flat_map(str::parse).collect();
    (arr[0], arr[1])
}

fn main() {
    let (n, m) = input_pair::<usize>();
    println!("{}", if n == m { "Yes" } else { "No" });
}


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


using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0; i<ll(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()

const int  INF = 1 << 29;
const ll INFL = 1LL << 60;
const ll mod = 1000000007;

int main() {

	int n, m;
	cin >> n >> m;


	vector<int> v(n, 0);
	int ac = 0;
	int wa = 0;

	REP(i, m) {
		int p;
		string m;
		cin >> p >> m;
		p--;
		if (m == "AC") {
			if (v[p] != -1) {
				ac++;
				wa += v[p];
				v[p] = -1;
			}
		}
		else {
			if (v[p] != -1)v[p]++;
		}
	}
	cout << ac << ' ' << wa << endl;

}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		if (a >= 13) {
			System.out.println(b);
		} else if (a >= 6 && a <= 12) {
			System.out.println(b / 2);
		} else {
			System.out.println(0);
		}
	}
}

Measured memory_bytes: 21844
// C++ code to find number of distinct numbers 
// in a subarray 
#include<bits/stdc++.h> 
using namespace std; 

const int MAX = 1000001; 

// structure to store queries 
struct Query 
{ 
    int l, r, idx; 
}; 

// cmp function to sort queries according to r 
bool cmp(Query x, Query y) 
{ 
    return x.r < y.r; 
} 

// updating the bit array 
void update(int idx, int val, int bit[], int n) 
{ 
    for (; idx <= n; idx += idx&-idx) 
        bit[idx] += val; 
} 

// querying the bit array 
int query(int idx, int bit[], int n) 
{ 
    int sum = 0; 
    for (; idx>0; idx-=idx&-idx) 
        sum += bit[idx]; 
    return sum; 
} 

void answeringQueries(int arr[], int n, Query queries[], int q) 
{ 
    // initialising bit array 
    int bit[n+1]; 
    memset(bit, 0, sizeof(bit)); 

    // holds the rightmost index of any number 
    // as numbers of a[i] are less than or equal to 10^6 
    int last_visit[MAX]; 
    memset(last_visit, -1, sizeof(last_visit)); 

    // answer for each query 
    int ans[q]; 
    int query_counter = 0; 
    for (int i=0; i<n; i++) 
    { 
        // If last visit is not -1 update -1 at the 
        // idx equal to last_visit[arr[i]] 
        if (last_visit[arr[i]] !=-1) 
            update (last_visit[arr[i]] + 1, -1, bit, n); 

        // Setting last_visit[arr[i]] as i and updating 
        // the bit array accordingly 
        last_visit[arr[i]] = i; 
        update(i + 1, 1, bit, n); 

        // If i is equal to r of any query store answer 
        // for that query in ans[] 
        while (query_counter < q && queries[query_counter].r == i) 
        { 
            ans[queries[query_counter].idx] = 
                    query(queries[query_counter].r + 1, bit, n)- 
                    query(queries[query_counter].l, bit, n); 
            query_counter++; 
        } 
    } 

    // print answer for each query 
    for (int i=0; i<q; i++) 
        cout << ans[i] << endl; 
} 

// driver code 
int main() 
{ 
    int n;cin>>n;
    int q;cin>>q;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    // int a[] = {1, 1, 2, 1, 3}; 
    // int n = sizeof(a)/sizeof(a[0]); 
    Query queries[q];
    int l,r;
    for(int i=0;i<q;i++){
        cin>>l>>r;
        queries[i].l = l-1; 
        queries[i].r = r-1; 
        queries[i].idx = i; 

    } 
    
    sort(queries, queries+q, cmp); 
    answeringQueries(arr, n, queries, q); 
    return 0; 
} 


Measured memory_bytes: 19360
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  long long a,b,c,d,n;
  cin >> a >> b >> c >> d >> n;
    b = min(a*2,b);
    c = min(b*2,c);
    d = min(c*2,d);
  //  cout << a << b << c << d << endl;
    cout << (n/2)*d+(n%2)*c << endl;
}


Measured memory_bytes: 256
x=input().split()
x=list(map(int, x))
W,H,x,y,r = x[0],x[1], x[2], x[3],x[4]
if x-r < 0:
    print("No")
elif x+r > W :
    print("No")
elif y+r > H:
    print("No")
elif y-r < 0:
    print("No")
else:
    print("Yes")

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

using namespace std;
#define X first
#define Y second
#define pb push_back
typedef double db;
typedef long long ll;
typedef pair<int,int> P;
const int MAXN=2e5+10;
int n;ll res;P d[MAXN];
multiset<int> a,b;
ll cal(){return 1ll*(*a.rbegin()-*a.begin())*(*b.rbegin()-*b.begin());}

int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        scanf("%d%d",&d[i].X,&d[i].Y);
        if(d[i].X>d[i].Y) swap(d[i].X,d[i].Y);
        a.insert(d[i].X);b.insert(d[i].Y);
    }
    sort(d+1,d+n+1);
    res=cal();//minmax在不同侧
    for(int i=1;i<=n-1;i++)
    //minmax在同一侧
    //考虑每次交换后下界单调不减
    {
        a.erase(a.find(d[i].X));b.insert(d[i].X);
        b.erase(b.find(d[i].Y));a.insert(d[i].Y);
        res=min(res,cal());
    }
    printf("%lld",res);
    return 0;
}

Measured memory_bytes: 22656
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, *a = map(int, read().split())

for i in range(n):
    a[i] -= i + 1

a.sort()

if n % 2 != 0:
    b = a[(n - 1) // 2]
else:
    b = (a[(n - 1) // 2] + a[((n - 1) // 2) + 1]) // 2

ans = 0
for v in a:
    ans += abs(b-v)
print(ans)

Measured memory_bytes: 27736
#include<vector>
#include<iostream>
#include<numeric>

using namespace std;
template<class T> inline T gcd(T x, T y) { if (!y) return x; return gcd(y, x%y);}

int main(){
    int n;
    cin>>n;
    vector<vector<int>> x(  2 , vector<int>( n, 0) ) ;

    for(int i = 0; i < 2 ; i ++)
        for(int j = 0; j <n ;j++)
        {
            int temp ; 
            cin>>temp;
            x[i][j] = temp;
        }
    for(int i =1 ;i < n; i++)
        x[0][i] += x[0][i-1];
    x[1][0] += x[0][0] ;
    for(int i = 1; i <n ;i++)
        x[1][i] += max( x[0][i], x[1][i-1] );

    cout<<x[1][n-1];

   

    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cstring>
#include <bitset>
#include <string>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>

int n, d, ans;
long long a[20][20];

int main()
{
    std::ios::sync_with_stdio(0), std::cin.tie(0), std::cout.tie(0);
    std::cin >> n >> d;
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= d; ++j)
            std::cin >> a[i][j];
    for (int i = 1; i < n; ++i)
    {
        for (int j = i + 1; j <= n; ++j)
        {
            long long s = 0;
            for (int k = 1; k <= d; ++k)
                s += (a[i][k] - a[j][k]) * (a[i][k] - a[j][k]);
            if ((int)std::sqrt(s) * (int)std::sqrt(s) == s)
                ++ans;

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

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

int main() {
  int l,r,d,count=0;
  cin >> l >> r >> d;
  
  for(int i = l;i<=r;i++){
    if(i%d ==0){
      count++;
    }
  }
  cout << count << endl;
    
    return 0;
  
  
}

Measured memory_bytes: 3616
import sys
input = sys.stdin.readline
N,K = map(int,input().split())
V = list(map(int,input().split()))

D = []
ans = []

for i in range(K+1):
    for j in range(K-i+1):
        if i + j > N:
            break
        D.append(V[:i]+V[N-j:])

for d in D:
    for x in range(K-len(d)):
        if d==[]:
            break
        elif min(d)<0:
            d.pop(d.index(min(d)))

        elif min(d)>0:
            break
        
    if d==[]:
        ans.append(0)
    elif sum(d)>0:
        ans.append(sum(d))

if max(ans)>0:
    print(max(ans))

else:
    print(0)

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

int main() {
  int N; cin >> N;
  int A, B;
  if (N == 1) {
    cout << "Hello World" << endl;
  }
  else if (N == 2) {
    cin >> A >> B;
    cout << A + B << endl;
  }
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"os"
	"strconv"
	"fmt"
)

func main() {
	sc := NewScanner()
	N := sc.NextInt()
	a := 0
	b := N
	c := 0
	for b - a > 1 {
		c = (b + a) / 2

		if N > c * (c + 1) / 2 {
			a = c
		} else if N < c * (c + 1) / 2 {
			b = c
		} else {
			b = c
			break
		}
	}
	d := -(N - b * (b + 1) / 2)
	for i := b - 1; i >= 1; i-- {
		if d >= i {
			d -= i
		} else {
			fmt.Println(i)
		}

	}
	fmt.Println(b)

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r:rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			result = append(result, v)
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	result = append(result, v)

	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}



Measured memory_bytes: 640
def isLeap(y):
    if y % 400 == 0:
        return True
    if y % 100 == 0:
        return False
    if y % 4 == 0:
        return True
    else:
        return False
c = 0
while True:
    a, b = [int(x) for x in input().split()]
    if a  == 0 and b == 0:
        break
    if c > 0:
        print()
    c +=1
    f = 0
    for i in range(a,b+1):
        if isLeap(i):
            f += 1
            print(i)
    if f == 0:
        print("NA")



Measured memory_bytes: 5724
fun main(args: Array<String>) {
    var N = readLine()!!.toInt()
    var A_up = readLine()!!.split(" ").map(String::toInt)
    var A_dw = readLine()!!.split(" ").map(String::toInt)
    (0..N-1).map{i->
        A_up.slice(0..i).sum() + A_dw.slice(i..N-1).sum()
    }.max().let{
        println(it)
    }
}

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

int main(){
    int n;
    int k;
    cin >> n;
    cin >> k;
    vector<int> hight(n);
    for (int i = 0; i < n; i++) {
        cin >> hight[i];
    }

    int display = 0;
    for (int i = 0; i < n; i++) {
        if (k <= hight[i]) display++;
    }
    cout << display << endl;
} 

Measured memory_bytes: 640
def separate(array,separator):
    results = []
    a = array[:]
    i = 0
    while i<=len(a)-len(separator):
        if a[i:i+len(separator)]==separator:
            results.append(a[:i])
            a = a[i+len(separator):]
            i = 0
        else:
            i+=1
    results.append(a)
    return results


def find(ar):

    if ar==[0]*len(ar):
        return 0
    m=999999999999999
    for i in range(len(ar)):
        if ar[i]<m:
            m=ar[i]
    for i in range(len(ar)):
        ar[i]-=m
    ans=m
    new=separate(ar,[0])
    for i in new:
        ans+=find(i)
    return ans








n=int(input())
ar=[int(i) for i in input().strip().split(" ")]
print(find(ar))




Measured memory_bytes: 65488
/*
confirm 0LL and 1LL
confirm cornercases such as 0
confirm times of cin < 10^6
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using VecVec = vector<Vec>;
using Graph = vector<VecP>;
template <typename T>
using Vec1 = vector<T>;
template <typename T>
using Vec2 = vector<Vec1<T> >;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPN(i, m, n) for(ll (i) = (m); (i) <= (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m)-1; (i) >= (n); --(i))
#define REPNR(i, m, n) for(ll (i) = (m); (i) >= (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T& b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T& b){if(a > b){a = b; return true;} return false;}
template <typename T>
void co(const T n){cout << n << endl;}
template <typename T>
void cosp(const T n){cout << n << ' ';}
template <typename T>
void coVec(const Vec1<T> &v){for(T i : v) cosp(i); cout << endl;}
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ld PI = acos(-1);
const ld EPS = 1e-11;

int main(void){
	ll h, n;
	cin >> h >> n;
	ll sum = 0;
	rep(i, n){
		ll a;
		cin >> a;
		sum += a;
	}
	if(sum >= h) puts("Yes");
	else puts("No");

	return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        double W = Integer.parseInt(scan.next());
        double H = Integer.parseInt(scan.next());
        double x = Integer.parseInt(scan.next());
        double y = Integer.parseInt(scan.next());
        if (W/2 == x && H/2  == y){
            System.out.println(W*H/2 + " " + 1);
        }
        else{
            System.out.println(W*H/2 + " " + 0);
        }
    }
}


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

int main()
{
    string s;
    string t;
    cin >> s >> t;
    sort(s.begin(), s.end());
    sort(t.begin(), t.end());
    reverse(t.begin(), t.end());

    if (s < t)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int MOD = 1000000007;

int main() {
    int N, X; cin >> N >> X;
    vector<int> S(N);
    for (int i = 0; i < N; ++i) cin >> S[i];
    sort(S.begin(), S.end());
    vector<vector<long long> > dp(N+1, vector<long long>(X+1, 0));
    for (int x = 0; x <= X; ++x) dp[0][x] = x;
    for (int i = 0; i < N; ++i) {
        for (int x = 0; x <= X; ++x) {
            dp[i+1][x] += dp[i][x % S[i]]; dp[i+1][x] %= MOD;
            dp[i+1][x] += dp[i][x] * i % MOD; dp[i+1][x] %= MOD;
        }
    }
    cout << dp[N][X] << endl;
}


Measured memory_bytes: 158592
import java.util.Scanner;
class Main{
  public void fun() {
  Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int n = sc.nextInt();
    int a[];
    a=new int[n];
    for(int i=0;i<a.length;i++)
    {
     a[i]=sc.nextInt();
          }
    int i=0;
    while(i<a.length)
    {  
       h=h-a[i];
      i++;
 
    }
    if(h<=0)
    {
     System.out.print("Yes"); 
    }
    else{System.out.print("No");}
    
  }
  public static void main(String arr[])
  {
       Main m = new Main();
    	m.fun();
  }
}


Measured memory_bytes: 49860
#include <iostream>
using namespace std;
int main(){
    int N,  a[100], ans=0;
    double ave=0, tmp, min;
    cin >> N;

    for(int i = 0; i < N; i++){
        cin >> a[i] ;
        ave += a[i] ;
    }
    ave = ave /N;
    min = ave - a[0];
    if(min<0)min=-min;
    for(int i = 0; i < N; i++){
        tmp = ave - a[i];
        if(tmp<0)tmp=-tmp;
        if(min>tmp){
            min = tmp;
            ans = i;
        }
    }
    cout << ans << endl;
    return 0; 
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long
#define ull unsigned long long
#define N 100005
#define mod 1000000007
//#define mod 1e18
#define boost ios_base::sync_with_stdio(false);cin.tie(0)
#define prec(n) fixed<<setprecision(n)

#define mii map<int,int>
#define mll map<ll,ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fi  first

#define se second
#define pb push_back
#define mp make_pair
#define pp pop_back
#define vii vector<int>
#define vll vector<ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define all(c) c.begin(),c.end()
#define tr(it,c) for(it = c.begin() ; it!=c.end() ; it++)
int inf = INT_MAX ;
ll modulo(ll num,ll MOD=mod){ return ((num%MOD)+MOD)%MOD;} // for negative integer
ll power(ll b,ll e,ll MOD=mod){ll ans=1; while(e){if(e%2) ans=(ans*b)%MOD; b=(b*b)%MOD; e/=2;} return ans;}
ll inv(ll num,ll MOD=mod){ return power(modulo(num),MOD-2,MOD); }
ll gcd(ll a,ll b){ return ((b==0) ? a:gcd(b,a%b));}

int main(){
	boost;
	int n;
	cin>>n;
	ll arr[n];
	//map<ll,ll> m;
	ll sum = 0;
	for(int i = 0;i<n;i++){
		cin>>arr[i];
		sum = sum^arr[i];
	}
	
	for(int i = 0;i<n;i++){
		cout<<(sum^arr[i])<<" ";
	}
	
	return 0;
}


Measured memory_bytes: 5100
/*
 * Copyright Narushima Hironori. All rights reserved.
 */
import java.io.*;

/**
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0106
 */
class Main {
	
	static class Shop {
		int price, volume, discountedPrice, discountedPer;
		
		public Shop(int volume, int price, double discount, int per) {
			this.volume = volume;
			this.price = price;
			
			discountedPrice = (int) (price * per - price * per * discount);
			discountedPer = per;
		}
		
		int calcPrice(int count) {
			int total = 0;
			while(count >= discountedPer) {
				total += discountedPrice;
				count -= discountedPer;
			}
			return total + price * count;
		}
		
		int maxBuyCount(int buyVolume) {
			return buyVolume / volume;
		}
		
	}

	Shop[] shops = {
			new Shop(200, 380, 0.20, 5),
			new Shop(300, 550, 0.15, 4),
			new Shop(500, 850, 0.12, 3),
	};
	
	public int calc(int volume) {
		if(volume % 100 != 0) {
			throw new IllegalArgumentException();
		}
		
		int[] buyCounts = new int[shops.length + 1];
		buyCounts[shops.length] = Integer.MAX_VALUE;
		calc(buyCounts, 0, volume);
		return buyCounts[shops.length];
	}

	void calc(int[] count, int shopIndex, int buyVolume) {
		if(shops.length == shopIndex) {
			if(buyVolume == 0) {
				int total = 0;
				for (int i = 0; i < shops.length; i++) {
					total += shops[i].calcPrice(count[i]);
				}
				if(count[shopIndex] > total) {
					count[shopIndex] = total;
				}
			}
		} else {
			Shop shop = shops[shopIndex];
			int maxBuyCount = shop.maxBuyCount(buyVolume);
			for (int buyCount = 0; buyCount <= maxBuyCount; buyCount++) {
				count[shopIndex] = buyCount;
				int nextBuyVolume = buyVolume - shop.volume * buyCount;
				calc(count, shopIndex + 1, nextBuyVolume);
			}
		}
	}

	public static void main(String[] args) throws IOException {
		Main calc = new Main();
		
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
		for (String l; (l = r.readLine()) != null && l.length() > 0;) {
			int volume = Integer.parseInt(l);
			if(volume == 0) {
				break;
			}
			System.out.println(calc.calc(volume));
		}
	}


}

Measured memory_bytes: 19724
n = int(input())

tree = [[] for i in range(n)]

for _ in range(n-1):
  t = input().split()
  u, v = int(t[0]), int(t[1])
  tree[u-1].append(v-1)
  tree[v-1].append(u-1)

a = 0
idx = 0
q = []
q.append(a)
v = [0 for _ in range(n)]
v[a] = 1

while (idx != len(q)):
    a = q[idx]
    idx += 1
    for b in tree[a]:
        if (v[b] == 0):
            q.append(b)
            v[b] = 1

s = a
idx = 0
q = []
q.append([a, 1])
v = [0 for _ in range(n)]
v[a] = 1

while (idx != len(q)):
    a = q[idx]
    idx += 1
    for b in tree[a[0]]:
        if (v[b] == 0):
            q.append([b, a[1] + 1])
            v[b] = 1

l = a[1]
if l%3 == 2:
    print("Second")
else:
    print("First")

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

int main(){    
  string s = "abcdefghijklmnopqrstuvwxyz";
  char c;
  cin >> c;
  for(int i = 0; i < 26; i ++){
    if(s.at(i) == c){
      cout << s.at(i + 1) << endl;;
      break;
    }
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1e8
template <typename T>
struct Graph {
    int V, E;
    struct Edge {
        int from, to;
        T cost;
    };
    vector<vector<Edge>> edge;
    map<pair<int, int>, int> mp;
    vector<vector<T>> dist;
    vector<Edge> es;

    Graph(int V, int E) : V(V), E(E) {
        edge.assign(V, vector<Edge>(0));
        dist.assign(V, vector<T>(0));
    }

    void input(bool is_direct, bool index0 = false) {
        int a, b;
        T c = 0;
        for (int i = 0; i < E; i++) {
            cin >> a >> b;
            if (!index0) a--, b--;
            edge[a].push_back((Edge){a, b, c});
            mp[{a, b}] = es.size() / 2;
            es.push_back((Edge){a, b, c});
            if (!is_direct) {
                edge[b].push_back((Edge){b, a, c});
                mp[{b, a}] = es.size() / 2;
                es.push_back((Edge){b, a, c});
            }
        }
    }

    void add_edge(int from, int to, T cost, bool is_direct) {
        edge[from].push_back({from, to, cost});
        es.push_back({from, to, cost});
        if (!is_direct) {
            edge[to].push_back({to, from, cost});
            es.push_back({to, from, cost});
            E++;
        }
        E++;
    }
    bool dfs(int u, int v, bitset<50> &bs, int from = -1) {
        if (u == v) {
            return true;
        }
        for (auto e : edge[u]) {
            if (from == e.to) continue;
            if (dfs(e.to, v, bs, u)) {
                bs.set(mp[{u, e.to}]);
                return true;
            }
        }
        return false;
    }
};

template <typename T, typename U>
T pow(T x, U n) {
    T res = 1;
    while (n > 0) {
        if (n & 1) res *= x;
        x *= x;
        n >>= 1;
    }
    return res;
}

ll PIE(vector<pair<int, int>> &a, Graph<int> &g) {
    int m = a.size();
    ll res = 0;
    map<pair<int, int>, bitset<50>> bitmp;
    for (int i = 0; i < m; i++) {
        g.dfs(a[i].first, a[i].second, bitmp[{a[i].first, a[i].second}]);
    }
    // {0, 1, ..., m-1} の部分集合の全探索
    for (int bit = 0; bit < (1 << m); ++bit) {
        bitset<50> bs(0);
        int cnt = 0;
        for (int i = 0; i < m; i++) {
            if ((1 << i) & bit) {
                bitset<50> bs1(0);
                bs |= bitmp[{a[i].first, a[i].second}];
                cnt++;
            }
        }
        ll c = bs.count();
        if (cnt) res += ::pow(2ll, g.E - c) * (cnt % 2 ? 1 : -1);
    }
    return ::pow(2ll, g.E) - res;
}

int main() {
    int n;
    cin >> n;
    Graph<int> g(n, n - 1);
    g.input(false);
    int m;
    cin >> m;
    vector<pair<int, int>> p(m);
    for (int i = 0; i < m; i++) {
        cin >> p[i].first >> p[i].second;
        p[i].first--;
        p[i].second--;
    }
    cout << PIE(p, g) << endl;
    return 0;
}

Measured memory_bytes: 384
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdio.h>

using namespace std;

int main(void){
    int m,d,d1,d2,ans=0;cin>>m>>d;
    string s1,s2;
    s1=to_string(d);
    //d1=stoi(s1.at(0));
    //d2=stoi(s1.at[1]);
    for(int i=1;i<=m;++i){
        for(int j=1;j<=d;j++){
            d1=j/10;
            d2=j%10;
            //cout<<d1<<d2<<endl;
            if(!(d1>=2)||!(d2>=2)) continue;
            if (d1 * d2 == i) {
                ans++;
                //cout<<d1<<d2<<endl;
            }
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
constexpr long long MOD = 1000000007;

int main() {
long long n;
cin >> n;
long long a[n],b[n],c[n];
for(int i=0;i<n;i++){
    cin >> a[i];
}
for(int i=0;i<n;i++){
    cin >> b[i];
}
for(int i=0;i<n;i++){
    cin >> c[i];
}
sort(a,a+n);
sort(b,b+n);
sort(c,c+n);
long long ans=0;
for(int i=0;i<n;i++){
    long long ng=n;
    long long ok=-1;
    while(abs(ok-ng)>1){
        long long mid=(ok+ng)/2;
        if(a[mid]<b[i])ok=mid;
        else ng=mid;
    }
    long long ngng=-1;
    long long okok=n;
    while(abs(okok-ngng)>1){
        long long midmid=(okok+ngng)/2;
        if(c[midmid]>b[i])okok=midmid;
        else ngng=midmid;
    }
ans+=(ok+1)*(n-okok);
}
cout << ans << endl;
}


Measured memory_bytes: 2560