akhauriyash/Code-Regression huggingface dataset:
#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
#define ALL(X) X.begin(), X.end()
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef std::pair<LL,LL> PLL;//
typedef std::pair<int,int> PII;//
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)4e18+20;
const LD PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

void solve(){
	int N;
	cin >> N;
	vector<LL> A(N),B(N);
	LL sumA = 0;
	LL sumB = 0;
	for(int i=0;i<N;++i){
		cin >> A[i];
		sumA += A[i];
	}
	for(int i=0;i<N;++i){
		cin >> B[i];
		sumB += B[i];
	}
	if( sumA > sumB ){
		cout << "No" << endl;
		return;
	}
	/////////////////////
	//後で足す数
	LL XA = 0;
	LL XB = 0;
	
	for(int i=0;i<N;++i){
		if( B[i] == A[i] ){
			//
		}else if( B[i] > A[i] ){
			LL sa = B[i]-A[i];
			LL kai = (sa+1)/2;
			XB += kai;
			if( sa&1 ){//B側にも一つ足しておく
				--XB;
			}
		}else{//A[i] > B[i]
			LL sa = A[i] - B[i];
			LL kai = sa;//1ずつ足せる
			XA += kai*2;//XAには2の倍数しか入らない
		}
	}
	LL count = min(XA/2,XB);
	XA -= count*2;
	XB -= count;

	if( XA <= XB ){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}
#pragma endregion //main()

Measured memory_bytes: 384
#include <stdio.h>
#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
  int a=0, b=0, c=0;
  scanf("%d %d %d", &a, &b, &c);
  if(a<b && b<c)
    cout << "Yes"; 
  else
    cout << "No";

  cout << endl;
  return 0;
}

Measured memory_bytes: 1204
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x1 = sc.nextInt();
      	int x2 = sc.nextInt();
      	int x3 = sc.nextInt();
      	int x4 = sc.nextInt();
      	int x5 = sc.nextInt();
        if (x1 == 0)
            System.out.println("1");
        else if (x2 == 0)
            System.out.println("2");
     	else if (x3 == 0)
            System.out.println("3");
      	else if (x4 == 0)
            System.out.println("4");
      	else if (x5 == 0)
            System.out.println("5");
    }
}

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

int main()
{
	int n,x;
	while (1) {
		cin >> n >> x;
		int cnt = 0;
		if (n == 0 && x == 0)break;
		for(int i=1;i<=n;++i)
			for(int j=i+1;j<=n;++j)
				for (int k = j + 1; k <= n; ++k) {
					if (i + k + j == x) {
						++cnt;
					}
				}
		cout << cnt << endl;
	}
	return 0;
}



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

int main(){
    ll a,b,v,w,t;
    cin >> a >> v >> b >> w >> t;
    ll dif=v-w;
    if(dif<=0){
        cout << "NO" << endl;
        return 0;
    }
    ll DIF=abs(a-b);
    ll amari=DIF%dif;
    if(DIF/dif<t){
        cout << "YES" << endl;
    }else if(DIF/dif==t && amari==0){
        cout << "YES" << endl;
    }
    else cout << "NO" << endl;
}

Measured memory_bytes: 3640
//問２　2717 佐久間 翼
import java.util.Scanner;
public class Main{
    
    public void solve(){
        Scanner sc = new Scanner(System.in);
        int cnt=0;
        while(cnt<7){
           int a=sc.nextInt();
           int b=sc.nextInt();
            System.out.println(a-b);
            cnt++;
        }
            }
    
    public static void main(String[]args){
        Main obj = new Main();
        obj.solve();
    }
}

Measured memory_bytes: 17236
#include <iostream>
#include <tuple>
#include <stack>
#include <vector>
using namespace std;
vector<tuple<int, bool>> tree; //parent,marked
stack<int> tmp_s;

int n_marked(int index)
{
    while (!get<1>(tree[index]))
    {
        tmp_s.push(index);
        index = get<0>(tree[index]);
    }
    while (!tmp_s.empty())
    {
        get<0>(tree[tmp_s.top()]) = index;
        tmp_s.pop();
    }
    return index;
}

int main()
{
    ios::sync_with_stdio(false);
    int size, n_opr, parent;
    while (1)
    {
        //scanf("%d %d", &size, &n_opr);
        cin >> size >> n_opr;
        if (size == 0)
            break;
        uintmax_t result(0);
        tree.clear();
        tree.push_back(make_tuple(0, true));
        vector<tuple<char, int>> op_s;
        for (int i = 0; i < size - 1; i++)
        {
            //scanf("%lld", &parent);
            cin >> parent;
            tree.push_back(make_tuple(parent - 1, 0));
        }
        for (int i = 0; i < n_opr; i++)
        {
            char cmd;
            int opr;
            //scanf("%c %d", &cmd, &opr);
            cin >> cmd >> opr;
            if (cmd == 'M')
            {
                if (get<1>(tree[opr - 1]) == false)
                {
                    get<1>(tree[opr - 1]) = true;
                    op_s.push_back(make_tuple(cmd, opr));
                }
                else
                {
                    continue;
                }
            }
            else
            {
                op_s.push_back(make_tuple(cmd, opr));
            }
        }
        while (!op_s.empty())
        {
            auto op = op_s.end() - 1;
            char cmd = get<0>(*op);
            int opr = get<1>(*op);
            if (cmd == 'Q')
            {
                result += (n_marked(opr - 1) + 1);
            }
            else
            {
                get<1>(tree[opr - 1]) = false;
            }
            op_s.erase(op);
        }
        cout << result << endl;
    }
    return 0;
}


Measured memory_bytes: 5492
#include<stdio.h>

int main()
{
 char a[3],b[3];

 scanf("%s%s",a,b);

 if((a[0]==b[2])&&(a[1]==b[1])&&(a[2]==b[0]))
         printf("YES\n");
 else printf("NO\n");

 return 0;
}


Measured memory_bytes: 1604
#include <bits/stdc++.h>
using namespace std;
                     
#define int             long long
#define ld              long double
#define mp              make_pair
#define ff              first
#define ss              second
#define pb              push_back
#define fo(i,n)         for(i=0;i<n;i++)
#define fo1(i,n)        for(i=1;i<=n;i++)
#define FO(i,k,n)       for(i=k;k<=n?i<=n:i>=n;k<=n?i++:i--)
#define all(c)          c.begin(),c.end()
#define rall(c)         c.rbegin(),c.rend()
#define si              set<int>
#define vi              vector<int>
#define mii             map<int,int>
#define pii             pair<int,int>
#define vpii            vector<pii>
#define vvi             vector<vi>
#define usi             unordered_set<int>
#define umii            unordered_map<int,int>
#define pqmx            priority_queue<int>
#define pqmn            priority_queue<int,vi,greater<int> >
#define sp(x)           cout<<setprecision(x)<<fixed;
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)     __builtin_ctzll(x)
#define in(a,n)         vi a(n);fo(i,n)cin>>a[i];
#define in1(a,n)        vi a(n+1);fo1(i,n)cin>>a[i];
#define w(t)            int t;cin>>t;while(t--)
#define gcd             __gcd
#define lcm(x,y)        x*(y/gcd(x,y))
#define endl            '\n'
#define PI              3.14159265358979323846
#define inf             1e18
#define mod             1000000007
void __p(int x) {cout<<x;}
void __p(int32_t x){cout<<x;}
void __p(float x){cout<<x;}
void __p(double x){cout<<x;}
void __p(ld x) {cout<<x;}
void __p(char x){cout <<'\''<<x<<'\'';}
void __p(const char *x){cout <<'\"' <<x<<'\"';}
void __p(const string &x) {cout<<'\"'<<x<<'\"';}
void __p(bool x) {cout<<(x?"true":"false");}
void _p() {cout << "]\n";}
template<typename T,typename V>     void __p(const pair<T,V> &x) {cout<<'{';__p(x.first);cout<<',';__p(x.second);cout<<'}';}
template<typename T>                void __p(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __p(i); cout << "}";}
template <typename T,typename... V> void _p(T t, V... v) {__p(t);if(sizeof...(v))cout<<", ";_p(v...);}
int po(int x,int p,int m = inf) {int ans=1;x%=m;while(p>0){if(p&1)ans=(ans*x)%m;p=p>>1;x=(x*x)%m;}return ans;}
int inv(int x,int m=mod){return po(x,m-2,m)%m;}
#ifndef ONLINE_JUDGE
#define dbg(x...) cout<<"["<<#x<<"]=[";_p(x)
#else 
#define dbg(x...)
#endif
//=================================================================================




const int N=1e6+6;
int n,m,k,x,y,z,a,b,c,d,i,j,l,r;








void sol()
{   
    // cin>>n;
    in(a,5);
    fo(i,5)
    {
        if(!a[i]){cout<<++i;return;}
    }
    
    
    
    //cout<<  <<endl;
}





int32_t main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //sp(10);
    // w(t)
    sol();
    return 0;
}

Measured memory_bytes: 3648
#include <cstdio>
#include <cmath>

int main() {
    int n, x[100], y[100];

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

    double d1, d2, d3, d4;
    d1 = d2 = d3 = d4 = 0.0;
    for (int i = 0; i < n; i++) {
        d1 += fabs(x[i]-y[i]);
        d2 += pow(fabs(x[i]-y[i]), 2);
        d3 += pow(fabs(x[i]-y[i]), 3);
        if (d4 < fabs(x[i]-y[i])) {
            d4 = fabs(x[i]-y[i]);
        }
    }
    d2 = sqrt(d2);
    d3 = pow(d3, 1.0/3.0);
    printf("%f\n%f\n%f\n%f\n", d1, d2, d3, d4);
    return 0;
}


Measured memory_bytes: 2920
#include<iostream>
#include<vector>

using namespace std;

int main(){
    int H,W;
    cin >> H >> W;
    vector<vector<char> > a(H,vector<char> (W));

    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            cin >> a.at(i).at(j);
        }
    }

    vector<int> h(H),w(W);

    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(a.at(i).at(j)=='#'){
                h.at(i) = 1;
                break;
            }else{
                h.at(i) = 0;
            }
        }
    }

    for(int i=0;i<W;i++){
        for(int j=0;j<H;j++){
            if(a.at(j).at(i)=='#'){
                w.at(i) = 1;
                break;
            }else{
                w.at(i) = 0;
            }
        }
    }

    for(int i=0;i<H;i++){
        if(h.at(i)==1){
            for(int j=0;j<W;j++){
                if(w.at(j)==1){
                    cout << a.at(i).at(j);
                }
            }
            cout << endl;
        }
    }

    return 0;

}

Measured memory_bytes: 256
N=int(input())
from collections import defaultdict
dic=defaultdict(int)
import math
mod=1000000007
for _ in range(N):
    A,B=map(int,input().split())
    if A<0:
        A,B=-A,-B
    if A==0:
        if B==0:
            dic[(0,0)]+=1
        else:
            dic[(0,1)]+=1
    elif B==0:
        dic[(1,0)]+=1
    else:
        gcd=math.gcd(A,B)
        A,B=A//gcd,B//gcd
        dic[(A,B)]+=1

ans=1
N-=dic[(0,0)]
for k,v in dic.items():
    if k==(0,0) or k==(0,1):
        continue
    if k==(1,0):
        if not (0,1) in dic:
            continue
        v_dash=dic[(0,1)]
        ans*=((pow(2,v,mod)-1)+(pow(2,v_dash,mod)-1)+1)
        ans%=mod
        N-=v+v_dash
        continue
    a,b=k
    if not (b,-a) in dic:
        continue
    v_dash=dic[(b,-a)]
    ans*=((pow(2,v,mod)-1)+(pow(2,v_dash,mod)-1)+1)
    ans%=mod
    N-=v+v_dash
ans*=pow(2,N,mod)
ans+=dic[(0,0)]-1
ans%=mod
print(ans)


Measured memory_bytes: 46700
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <set>
#include <stack>
#include <climits>
#include <cmath>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;
const char sp = ' ';


using namespace std;

int main(void){
    int count=0, n, pp=0, pt=0, pl=0;
    cin>>n;
    rep(i, n){
        pp=pt;
        pt=pl;
        cin>>pl;
        if(i<=1) continue;
        else{
            if((pt>pl && pt<pp) || (pt>pp && pt<pl))
                count++;
        }
    }
    cout<<count<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main()
{
    int n, m, i, tmp;
    int sum = 0;

    scanf("%d%d", &n, &m);
    
    for (i = 0; i < m; i++) {
        scanf("%d", &tmp);
        sum += tmp;
    }

    if (sum <= n)
        printf("%d\n", n-sum);
    else
        printf("%d\n", -1);

    return 0;
}

Measured memory_bytes: 1724
#include<iostream>
using namespace std;
#include<string>
#include<stdio.h>

#define A 1355471101  // large prime number 1.
#define B 1466700101  // large prime number 2.
#define M 1522101101  // large prime number 3, larger than A and B.

int main()
{
    int i, j, H, W, R, C;
    string *T, *P;

    scanf("%d %d", &H, &W);
    T = new string [H];
    for(i = 0; i < H; i++){ cin >> T[i]; }
    scanf("%d %d", &R, &C);
    P = new string [R];
    for(i = 0; i < R; i++){ cin >> P[i]; }

    long long hash[1000][1000];
    long long s;

    for(j = 0; j < C; j++){
        s = 0;
        for(i = 0; i < R; i++){
            s = (s * A + P[i][j]) % M;
            hash[i][j] = s;
        }
    }
    for(i = 0; i < R; i++){
        s = 0;
        for(j = 0; j < C; j++){
            s = (s * B + hash[i][j]) % M;
            hash[i][j] = s;
        }
    }
    long long last_has = hash[R - 1][C - 1];

    for(j = 0; j < W; j++){
        s = 0;
        for(i = 0; i < H; i++){
            s = (s * A + T[i][j]) % M;
            hash[i][j] = s;
        }
    }
    for(i = 0; i < H; i++){
        s = 0;
        for(j = 0; j < W; j++){
            s = (s * B + hash[i][j]) % M;
            hash[i][j] = s;
        }
    }

    long long power_a, power_b, power_c, x, y, z;
    x = A, y = R, z = 1;
    for( ; y; y >>= 1){ if((y & 1) != 0){ z = (z * x) % M; } x = (x * x) % M; }
    power_a = z;
    x = B, y = C, z = 1;
    for( ; y; y >>= 1){ if((y & 1) != 0){ z = (z * x) % M; } x = (x * x) % M; }
    power_b = z;
    power_c = (power_a * power_b) % M;

    long long block1, block2, block3;
    for(i = R - 1; i < H; i++){
        for(j = C - 1; j < W; j++){
            block1 = ((i >= R ? hash[i - R][j] : 0) * power_a) % M;
            block2 = ((j >= C ? hash[i][j - C] : 0) * power_b) % M;
            block3 = M - ((((i >= R && j >= C) ? hash[i - R][j - C] : 0) * power_c) % M);
            if(hash[i][j] == (block1 + block2 + block3 + last_has) % M){
            printf("%d %d\n", i - R + 1, j - C + 1);
            }
        }
    }
    return 0;
}

Measured memory_bytes: 11148
import sys
input = sys.stdin.readline


def main():
    N, L = map(int, input().split())
    s = N*L + ((N-1)*N)//2
    if L>=0:
        print(s - L)
    elif L+N-1>=0:
        print(s)
    else:
        print(s - (L+N-1))


if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
#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 <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
//#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
//#define EXIST(s, e) ((s).find(e)!=(s).end())
//#define SORT(c) sort(begin(c),end(c))
//#define pb emplace_back
//#define MP make_pair
//#define SZ(a) int((a).size())

//#define LOCAL 0
//#ifdef LOCAL
//#define DEBUG(s) cout << (s) << endl
//#define dump(x)  cerr << #x << " = " << (x) << endl
//#define BR cout << endl;
//#else
//#define DEBUG(s) do{}while(0)
//#define dump(x) do{}while(0)
//#define BR
//#endif


//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007
//ここから編集する


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

    int N, A;
    cin >> N >> A;
    vector<int> x(N + 1);
    int zero = 5000;
    vector<vector<ll> > dp(N + 1, vector<ll>(zero * 2));
    rep(i, 1, N + 1) {
        cin >> x[i];
        x[i] -= A;
    }

    dp[0][zero] = 1;
    for (int i = 0; i < N; i++) {
        rep(j, 0, zero * 2) {
            dp[i + 1][j] += dp[i][j];
            dp[i + 1][j + x[i + 1]] += dp[i][j];
        }
    }

    cout << dp[N][zero] - 1 << endl;


    return 0;
}


Measured memory_bytes: 4352
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <functional>
#include <map>
using namespace std;

int H, W, x, y;

int main() {
	cin >> H >> W >> x >> y;
	if ((H*W) % 2 == 1 && (x + y) % 2 == 1) cout << "No" << endl;
	else cout << "Yes" << endl;
	return 0;
}


Measured memory_bytes: 3108
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <utility>
#include <tuple>
#include <cctype>
using namespace std;
#define INF 0x3f3f3f3f
//#define INF 1100000000000000000LL
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pint;
typedef tuple<int,int,int> tint;
typedef vector<int> vint;
typedef vector<ll> vll;
int dx[8]={0,0,-1,1,1,1,-1,-1};
int dy[8]={-1,1,0,0,1,-1,1,-1};
const int SIZE=200;
//ここまでテンプレ
int main() {
	//頂点数、辺数を受け取る
	int N,M;
	cin>>N>>M;
	vector<tint> E;
	//最短距離行列
	int d[SIZE][SIZE]={};
	//行列の初期化
	for(int i=0;i<N;i++){
		for(int j=0;j<N;j++){
			if(i==j)
				d[i][j]=0;
			else
				d[i][j]=INF;
		}
	}
	//辺の情報を受け取る
	//ノード番号は0-indexedに直す
	for(int i=0;i<M;i++){
		int a,b,c;
		cin>>a>>b>>c;
		a--;b--;
		d[a][b]=c;
		d[b][a]=c;
		E.pb(mt(a,b,c));
	}
	//ワーシャルフロイド
	for(int k=0;k<N;k++){
		for(int i=0;i<N;i++){
			for(int j=0;j<N;j++){
				d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
			}
		}
	}
	int use=0;
	for(int i=0;i<M;i++){
		int a,b,c;
		tie(a,b,c)=E[i];
		bool flag=0;
		for(int j=0;j<N;j++){
			if(d[j][a]+c==d[j][b]){
				flag=1;
				break;
			}
		}
		if(flag)
			use++;
	}
	cout<<M-use<<endl;
    return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<map>
#include<set>

int const MAXN = 2e5;
int a[MAXN], b[MAXN];
int c[MAXN-1], d[MAXN+MAXN-2];
int t[MAXN];

int main() {
  int N; std::cin >> N;
  for(int i = 0; i < N; ++i) std::cin >> a[i];
  for(int i = 0; i < N; ++i) std::cin >> b[i];
  for(int i = 0; i < N-1; ++i) c[i] = a[i]^a[i+1];
  for(int i = 0; i < 2*N-2; ++i) d[i] = b[i%N]^b[(i+1)%N];
  std::set<int> ans;
  // KMP
  int i = 2, j = 0;
  t[0] = -1; t[1] = 0;
  while(i < N-1) {
    if(c[i-1] == c[j]) t[i++] = ++j;
    else if(j > 0) j = t[j];
    else t[i++] = 0;
  }
  i = j = 0;
  while(j+i < 2*N-2) {
    if(c[i] == d[i+j]) {
      if(++i==N-1) {
        // found
        ans.insert((N-j)%N);
        --i;
      } else continue;
    }
    j += i - t[i];
    if(i > 0) i = t[i];
  }
  
  // ans
  for(auto k: ans) {
    int x = a[0]^b[(N-k)%N];
    std::cout << k << " " << x << std::endl;
  }
  return 0;
}



Measured memory_bytes: 17536
import math
MOD = 10**9+7
def modpow(a, n, p):
  if n == 1:
    return a % p 
  elif n % 2 == 1:
    return a * modpow(a, n-1, p) % p
  else:
    return modpow(a, n//2, p) **2 % p

def I():
  return input()
def II():
  return int(input())
def MII():
  return map(int, input().split())
def LMII():
  return list(map(int, input().split()))
n,a,b = MII()
fact_a = 1
fact_n_a = 1
fact_b = 1
fact_n_b = 1
for i in range(a):
    fact_a = fact_a * (i+1) % MOD
    fact_n_a = fact_n_a * (n-a+1+i) % MOD
cmb_a = fact_n_a * modpow(fact_a, MOD-2, MOD) % MOD
for i in range(b):
    fact_b = fact_b * (i+1) % MOD
    fact_n_b = fact_n_b * (n-b+1+i) % MOD
cmb_b = fact_n_b * modpow(fact_b, MOD-2, MOD) % MOD

print((modpow(2, n, MOD)-1-cmb_a-cmb_b)%MOD)

Measured memory_bytes: 38896
#include<bits/extc++.h>
#ifdef _debug 
#define dout(i) cout << #i << ' ' << i << ' '
#else 
#include<bits/stdc++.h>
#define dout(i) 0&&0
#endif
#pragma GCC optimize("unroll-loops,no-stack-protector,O3")
#define rep0(_i, _n) for(int _i = 0; (_i)<(_n) ;++_i)
#define rep1(_i, _n) for(int _i = 1; (_i)<=(_n) ;++_i)
#define eout(i) {cout << (i) << '\n';exit(0);}
#define rout(i) {return cout << (i) << '\n', 0;}
#define priority_queue __gnu_pbds::priority_queue
#define unordered_map __gnu_pbds::gp_hash_table
#define rep(a, b) {for(int _i = a;_i > 0;--_i){b;}}
#define multi int _T;for(cin >> _T;_T--;)
using namespace std;
using ll = long long;using ull = unsigned long long;using ul = unsigned;using db = double;
using __gnu_pbds::null_type;
template<typename T> void read(int n, T a){while(n--)cin >> *a, ++a;}
template<typename T1, typename T2> void read(int n, T1 a, T2 b){while(n--)cin >> *a >> *b, ++a, ++b;}
template<typename T> void write(int n, T a){while(n--)cout << *a << " \n"[n==0], ++a;}
template<typename T> using rbtree = __gnu_pbds::tree<T,__gnu_pbds::null_type,less<T>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>;
template<typename T> inline ostream& operator << (ostream &ou, const vector<T> &a){for(auto it = a.begin();it != a.end();++it)ou << (it != a.begin() ? " " : "") << *it;return ou;}
template<typename T1, typename T2>inline istream& operator >> (istream &in, pair<T1, T2> &a){return in >> a.first >> a.second;}
template<typename T1, typename T2>inline ostream& operator << (ostream &ou, const pair<T1, T2> &b){return ou << b.first << ' ' << b.second;}
template<typename T> inline long long pow(long long v, long long t, const T &p){long long res = 1;for(;t;t >>= 1, v = v * v % p)if(t & 1)res = res * v % p;return res;}
const int maxn = 300010;
int n;
signed main(){
	ios_base::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	if(n == 1)cout << 0 << '\n';
	else if(n&1)cout << n/2 << '\n';
	else cout << n/2-1 << '\n';
}

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

int main()
{
    int X, Y, Z;
    cin >> X >> Y >> Z;
    int i = 0;
    while (1)
    {
        int width = (i * (Z + Y) + Z);
        if (width > X)
        {
            i--;
            break;
        }
        i++;
    }
    cout << i << endl;
    return 0;
}

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

signed main() {
  int n;
  cin >> n;
  for(int i = sqrt(n); ; i--) {
    if(n % i == 0) {
      cout << (int)log10(n / i) + 1 << endl;
      return 0;
    }
  }
}

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

int main(){
  string s; cin>>s;
  vector<int>V(4);
  rep(i,4) V[i]=s[i]-'0';
  rep(bit, 1<<3){
    int sum = V[0];
    rep(i,3){
      if (bit & (1<<i)) sum += V[i+1];
      else sum -= V[i+1];
    }
    if (sum==7){
      cout << V[0];
      rep(i,3){
        if (bit & (1<<i)) cout << "+";
        else cout << "-";
        cout << V[i+1];
      }
      cout << "=7" << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 3608
import java.util.*;

class Main {

    static long gcd(long ai, long aj) {
        if (aj == 0)
            return ai;
        else
            return gcd(aj, ai % aj);
    }

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

        long A = sc.nextLong();
        long B = sc.nextLong();
        long gcd = gcd(A, B);
        int count = 1;

        for (int i = 2; i <= Math.sqrt(gcd); i++) {
            if (gcd % i == 0) {
                count++;
            }
            while (gcd % i == 0) {
                gcd /= i;
            }
        }

        if (gcd > 1)
            count++;

        System.out.println(count);

    }
}




Measured memory_bytes: 23764
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using static System.Console;

namespace AtCoder_1
{
    class Program
    {
        static void Main(string[] args)
        {
            var t = CinTAr();
            double a = (t[0] + t[1]) / 2.0;
            int v = (t[0] + t[1]) / 2;
            if (a == v)
            {
                Cout(v);
            }
            else
            {
                Cout("IMPOSSIBLE");
            }
            Cin();
        }



        static readonly int MOD1E9 = (int)1e9 + 7;
        static string Cin() { return ReadLine(); }
        static string[] CinAr() { return ReadLine().Split(' '); }
        static int CinT() { return S2i(Cin()); }
        static int[] CinTAr() { return CinAr().Select((x, i) => { return S2i(x); }).ToArray(); }
        static long CinL() { return S2L(Cin()); }
        static long[] CinLAr() { return CinAr().Select((x, i) => { return S2L(x); }).ToArray(); }
        static double CinD() { return S2D(Cin()); }
        static double[] CinDAr() { return CinAr().Select((x, i) => { return S2D(x); }).ToArray(); }
        static int S2i(string s) { return int.Parse(s); }
        static long S2L(string s) { return long.Parse(s); }
        static double S2D(string s) { return double.Parse(s); }
        static void OYes() { Cout("Yes"); }
        static void ONo() { Cout("No"); }
        static void Cout(object s) { WriteLine(s); }
        static int[] yakusuu(int n)
        {
            if (n == 1) { return new int[] { 1 }; }
            HashSet<int> res = new HashSet<int>();
            for (int i = 1; i < Math.Ceiling(n / 2.0); i++)
            {
                if (n % i == 0)
                {
                    res.Add(i);
                    res.Add(n / i);
                }
            }
            return res.ToArray();
        }
        /// <summary>
        /// Debug時のみの使用を推奨
        /// </summary>
        /// <typeparam name="Type"></typeparam>
        /// <param name="types"></param>
        static void CoutAr<Type>(IEnumerable<Type> types)
        {
            string text = "";
            foreach (var i in types)
            {
                text += " " + i;
            }
            WriteLine(text.Substring(1));
        }
    }
}


Measured memory_bytes: 11220
n, m = map(int, input().split())
xyz = [list(map(int, input().split())) for _ in range(n)]
ans = []
for i in range(8):
	value = [((i&1)*2-1)*xyz[j][0] + (((i>>1)&1)*2-1)*xyz[j][1] + (((i>>2)&1)*2-1)*xyz[j][2] for j in range(n)]
	value.sort(reverse=True)
	ans.append(sum(value[:m]))
print(max(ans))

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

const int maxn=1000005;
typedef long long ll;
const ll inf=1ll<<60;
int n,x[maxn],nxt[maxn],fst[maxn],to[maxn],from[maxn],fa[maxn],tot=1;
ll dis[maxn],w[maxn];

void addedge(int *fst,int u,int v,ll c){
	nxt[++tot]=fst[u];fst[u]=tot;to[tot]=v;w[tot]=c;
}

struct node{
	int u;
	ll d;
};
bool operator<(const node&x,const node&y){
	return x.d>y.d;
}
priority_queue<node>q;

struct edge{
	int u,v;
	ll w;
}e[maxn];
bool operator<(const edge&x,const edge&y){
	return x.w<y.w;
}
int find(int x){return !fa[x]?x:fa[x]=find(fa[x]);}

int main(){
	scanf("%d",&n);
	for(int i=1;i<=2*n;i++)dis[i]=inf;
	for(int i=1;i<=n;i++){
		scanf("%d",x+i);
		addedge(fst,i,i+n,x[i]);
		addedge(fst,i+n,i,x[i]);
		dis[i+n]=0;
		from[i+n]=i;
		q.push((node){i+n,0});
	}
	for(int i=1,u,v,c;i<n;i++){
		scanf("%d%d%d",&u,&v,&c);
		addedge(fst,u,v,c),addedge(fst,v,u,c);
	}
	while(!q.empty()){
		node t=q.top();q.pop();
		if(dis[t.u]!=t.d)continue;
		for(int i=fst[t.u];i;i=nxt[i])
			if(dis[to[i]]>t.d+w[i])
				from[to[i]]=from[t.u],q.push((node){to[i],dis[to[i]]=t.d+w[i]});
	}
	for(int i=2;i<=tot;i++)
		e[i]=(edge){from[to[i^1]],from[to[i]],dis[to[i^1]]+dis[to[i]]+w[i]};
	sort(e+2,e+1+tot);
	ll ans=0;
	for(int i=2;i<=tot;i++){
		int s=find(e[i].u),t=find(e[i].v);
		if(s!=t)fa[s]=t,ans+=e[i].w;
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 53352
N=int(input())
from collections import defaultdict
X=dict()
Y=dict()
P=[]
root=[-1]*N
def find(i):
    global root
    if root[i]>=0:
        root[i]=find(root[i])
        return root[i]
    return i
for i in range(N):
    x,y=map(int,input().split())
    P+=[(x,y)]
    if x not in X.keys():
        rx=i
        X[x]=i
    else:
        rx=find(X[x])
        X[x]=rx
    if y not in Y.keys():
        ry=i
        Y[y]=i
    else:
        ry=find(Y[y])
        Y[y]=ry
    if rx==ry:
        if i!=rx:
            root[i]=rx
        continue
    elif root[rx]<=root[ry]:
        root[rx]+=root[ry]
        root[ry]=rx
        if i!=rx:
            root[i]=rx
    else:
        root[ry]+=root[rx]
        root[rx]=ry
        if i!=ry:
            root[i]=ry
cntx=defaultdict(set)
cnty=defaultdict(set)
RP=set()
ans=0
for i in range(N):
    x,y=P[i]
    r=find(i)
    cntx[r]|={x}
    cnty[r]|={y}
    RP|={r}
for k in RP:
    ans+=len(cntx[k])*len(cnty[k])
print(ans-N)

Measured memory_bytes: 32824
#include <bits/stdc++.h>
using namespace std;
int N,L[101],ans=0;
int main() {
	cin>>N;
	for(int i=1;i<=N;i++) {
		cin>>L[i];
	} 
	for(int i=1;i<=N;i++) {
		for(int j=i+1;j<=N;j++) {
			for(int k=j+1;k<=N;k++) {
				if(L[i]!=L[j]&&L[i]!=L[k]&&L[j]!=L[k]) {
					if(L[i]+L[j]>L[k]&&L[i]+L[k]>L[j]&&L[j]+L[k]>L[i]) {
						ans++;
					}
				}
			}
		}
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 3620
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
const ll MOD = 1e9+7;

int main(){
  int a, c;
  char b;
  cin >> a >> b >> c;

  if(b=='+') cout << a+c << endl;
  else if(b=='-') cout << a-c << endl;

  return 0;
}

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

//#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define LL long long
#define PB push_back


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

	vector<int> ans;
	while(n > 0) {
		int r = n%26;
		if(r == 0) {
			ans.push_back(26);
			r = 26;
		} else {
			ans.push_back(r);
		}
		n = n - r;
		n = n/26;
	}
	reverse(ans.begin(),ans.end());

	for(int i=0;i<ans.size();i++) {
		char c = (ans[i] - 1) + 'a';
		cout << c;
	}
	cout << endl;

	return 0;
}


Measured memory_bytes: 3588
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <tuple>
#include <map>

using namespace std;

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

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

    vector<long> A(X), B(Y), C(Z);
    for(int i=0; i<X; i++){
        cin >> A[i];
    }
    for(int i=0; i<Y; i++){
        cin >> B[i];
    }
    for(int i=0; i<Z; i++){
        cin >> C[i];
    }
    sort(A.begin(), A.end(), greater<long>());
    sort(B.begin(), B.end(), greater<long>());
    sort(C.begin(), C.end(), greater<long>());

    priority_queue<pair<long, tuple<int, int, int>>> q;
    q.push(make_pair(A[0]+B[0]+C[0], make_tuple(0,0,0)));
    map<tuple<int, int, int>, bool> used;
    used[make_tuple(0,0,0)] = true;
    int cnt = 0;
    vector<long> ans;
    while(!q.empty() && cnt<K){
        long num = q.top().first;
        ans.push_back(num);
        cnt++;
        int ai = get<0>(q.top().second);
        int bi = get<1>(q.top().second);
        int ci = get<2>(q.top().second);
        q.pop();

        if(ai+1<X && !used[make_tuple(ai+1,bi,ci)]){
            q.push(make_pair(num-A[ai]+A[ai+1], make_tuple(ai+1, bi, ci)));
            used[make_tuple(ai+1,bi,ci)] = true;
        }
        if(bi+1<Y && !used[make_tuple(ai,bi+1,ci)]){
            q.push(make_pair(num-B[bi]+B[bi+1], make_tuple(ai, bi+1, ci)));
            used[make_tuple(ai,bi+1,ci)] = true;
        }
        if(ci+1<Z && !used[make_tuple(ai,bi,ci+1)]){
            q.push(make_pair(num-C[ci]+C[ci+1], make_tuple(ai, bi, ci+1)));
            used[make_tuple(ai,bi,ci+1)] = true;
        }
    }

    for(int i=0; i<cnt; i++){
        cout << ans[i] << endl;
    }

    return 0;
}


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

using namespace std;

int main(){
 long long int H,W;
 cin >> H >> W;
 if(H == 1 || W == 1) cout << 1;
 else if(( H * W ) % 2  == 0) cout << (H * W) / 2;
 else cout << ((H * W) / 2) + 1;
 return 0;
}





Measured memory_bytes: 256
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
dp = [[A[S], 0] for S in range(1 << N)]
for k in range(N):
    for S in range(1 << N):
        if S >> k & 1:
            if dp[S][0] < dp[S ^ (1 << k)][0]:
                dp[S][1] = max(dp[S][0], dp[S ^ (1 << k)][1])
                dp[S][0] = dp[S ^ (1 << k)][0]
            else:
                dp[S][1] = max(dp[S][1], dp[S ^ (1 << k)][0])
ans = 0
for K in range(1, 1 << N):
    ans = max(ans, sum(dp[K]))
    print(ans)

Measured memory_bytes: 131152
import sys
from collections import deque, Counter, defaultdict

input = sys.stdin.readline
MOD = (10**9+7)

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr


def pow_k1(x, n):
    if n == 0:
        return 1
    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
        x *= x
        n //= 2
    return K * x


def pow_k(x, n):
    if n == 0:
        return 1
    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
        x *= x
        n //= 2
        x%=MOD
    return K * x


def main():
    n = int(input())
    al = list(map(int, input().split())) 
    lcm_dic = defaultdict(int)
    # lcm_dic = {}
    # al_facs = []
    for a in al:
        fac = factorization(a)
        # a_fac_dic = {}
        for f in fac:
            # lcm_dic.setdefault(f[0],0)
            lcm_dic[f[0]] = max(f[1], lcm_dic[f[0]])
            # a_fac_dic[f[0]] = f[1]
        # al_facs.append(a_fac_dic)


    lcm = 1
    for prime, cnt in lcm_dic.items():
        lcm *= pow_k1(prime,cnt)

    
    ans = sum( [ lcm//a for a in al] ) % MOD
    # ans = 0
    # for a in al:
    #     ans += lcm//a
    #     ans%=MOD


    # ans = 0
    # for al_f in al_facs:
    #     curr_val = 1
    #     for prime, cnt in lcm_dic.items():
    #         if prime in al_f:
    #             curr_val *= pow_k(prime,(cnt-al_f[prime]))
    #             curr_val%=MOD
    #         else:
    #             curr_val *= pow_k(prime,cnt)
    #             curr_val%=MOD
    #     ans += curr_val
    #     ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 263336
import copy
H, W = map(int, input().split())
#field = [list(input().split()) for _ in range(H)]
field = [[] for _ in range(H)]
for i in range(H):
    for s in input():
        field[i].append(s)

# bfsで最大値を求めて出力する
# スタート地点を全探索する

def bfs(sy, sx, field, H, W):
    field[sy][sx] = 0
    pre_list = [(sy,sx)]
    count = 0
    while len(pre_list) > 0:
        count += 1
        next_list = []
        for y,x in pre_list:
            for i,j in ((1,0),(0,-1),(0,1),(-1,0)):
                if y+i < 0 or x+j < 0 or y+i >= H or x+j >= W:
                    continue
                if field[y+i][x+j] == '.':
                    field[y+i][x+j] = count
                    next_list.append((y+i,x+j))
        pre_list = next_list
    return count

ret = 0
for h in range(H):
    for w in range(W):
        if field[h][w] == '#':
            continue
        ret = max(ret, bfs(h, w, copy.deepcopy(field), H, W))

print(ret-1)


Measured memory_bytes: 3700
#include<iostream>
#include<vector>
#include<cmath>
#include<climits>

#define ll long long
#define deb(x) cout<<#x <<x<<" "
using namespace std;

ll knapsack(long w,long i,vector<long> &weight,vector<long> &values,vector<vector<ll>> &dp)
{
    if(i<0 || w<=0)
        return 0;
    
    if(dp[i][w] == -1)
    {
        if(weight[i] > w)
            dp[i][w] = knapsack(w,i-1,weight,values,dp);
    
        else 
        {
            dp[i][w] = max(values[i] + knapsack(w-weight[i],i-1,weight,values,dp),knapsack(w,i-1,weight,values,dp));
        } 
    }
    return dp[i][w];
}

int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    long n{},w{};
    cin>>n>>w;
    vector<long> wi(n),vi(n);
    for(int i=0;i<n;i++)
    {
        cin>>wi[i]>>vi[i];
    }
    
    vector<vector<ll>> dp(n,vector<ll>(w+1,-1));
    ll ans = knapsack(w,n-1,wi,vi,dp);
    cout<<ans;

    return 0;
}

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

using namespace std;

typedef long long ll;
#define SWAP(x,y,z) {if ( y > z ) swap(y,z); if ( x > y ) swap(x,y); if (y > z) swap(y,z);}


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

    int a,z;
    string s;
    cin >> s;

    a = s.find("A");
    reverse(s.begin(),s.end());
    z = s.size() - s.find("Z");

    cout << z-a;

    return 0;
    // 274751WM
}


Measured memory_bytes: 720
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;

public class Main {

	static Scanner sc = new Scanner(System.in);

	static class FastScanner {
		private final InputStream in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;

		public FastScanner(InputStream source) {
			in = source;
		}

		private boolean hasNextByte() {
			if (ptr < buflen) {
				return true;
			} else {
				ptr = 0;
				try {
					buflen = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (buflen <= 0) {
					return false;
				}
			}
			return true;
		}

		private int readByte() {
			if (hasNextByte()) return buffer[ptr++];
			else return -1;
		}

		private static boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}

		public boolean hasNext() {
			while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
			return hasNextByte();
		}

		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (b < '0' || '9' < b) {
				throw new NumberFormatException();
			}
			while (true) {
				if ('0' <= b && b <= '9') {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) {
					return minus ? -n : n;
				} else {
					throw new NumberFormatException();
				}
				b = readByte();
			}
		}

		public int nextInt() {
			long nl = nextLong();
			if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
				throw new NumberFormatException();
			return (int) nl;
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}
	}

	public static void main(String[] args){

		solve_abc166_b();
	}
  
  	public static void solve_abc166_b(){

		FastScanner sc = new FastScanner(System.in);
		
		int n = sc.nextInt();
		int k = sc.nextInt();
		boolean[] a = new boolean[n];
		Arrays.fill(a, false);
		
		for(int i=0;i<k;i++){
			
			int d = sc.nextInt();
			
			for(int j=0;j<d;j++){
				int ak = sc.nextInt() - 1;
				a[ak] = true;
			}
		}
		
		int count = 0;
		for(int i=0;i<a.length;i++){
			if(!a[i]) count++;
		}
		
		System.out.println(count);
	}
}

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

int main(){
  char X,Y;
  int x,y;
  cin >> X >> Y ;

  x = int(X); y = int(Y);

  if (X > Y){
    cout << ">" << endl;
  }else{
    if (X == Y){
      cout << "=" <<endl;
    }else{
      cout << "<" << endl;
    }
  }
}


Measured memory_bytes: 256
// RAM RAM

#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define ppb pop_back
#define vi vector<int>
#define mp make_pair
#define arrayin(a,n) for(int i=0;i<n;i++){cin>>a[i];}
using namespace std;


set<int> v;
bool hai(int n){
	if(v.find(n)!=v.end()){
		return false;
	}
	return true;
}

bool valid(int n){
	while(n){
		if(!(hai(n%10))){
			return false;
		}
		n/=10;
	}
	return true;
}
int32_t main()
{
	ios_base::sync_with_stdio(false);cin.tie(0);
	
	int n,k,x,y;cin>>n>>k>>x>>y;
	int res=0;
	for(int i=1;i<=n;i++){
		if(i<=k){
			res+=x;
		}else{
			res+=y;
		}
	}
	cout<<res<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 1e9;
// const int MOD = 1e9 + 7;

int main() {
    int N;
    cin >> N;
    vector<int> b(N);
    for (int i = 0; i < N; i++) {
        cin >> b.at(i);
    }
    vector<int> ans;

    for (int i = 0; i < N; i++) {
        for (int j = (int)b.size() - 1; j >= 0; j--) {
            if (b[j] == j + 1) {
                b.erase(b.begin() + j);
                ans.push_back(j + 1);
                break;
            }
        }
    }
    reverse(ans.begin(), ans.end());
    if ((int)b.size() > 0) {
        cout << -1 << endl;
    } else {
        for (auto i : ans) {
            cout << i << "\n";
        }
    }
}


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	public static int[][] table = new int[15][15000];
	public static int[] memo = new int[10];
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		doIt();
		//System.out.println(getNth(543, 1));
	}
	
	public static void doIt(){

		for (int i = 1; i <= 10; ++i ) {
			Arrays.fill(memo, 0);
			numnum (i, 1, 0 );
		} // end for

		int n, s;

		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			n = sc.nextInt();
			s = sc.nextInt();
			//setNth(0);
			System.out.println(table[n][s]);
		}
	}
	
	public static void numnum(int size, int depth, int sum )
	{
		if (size + 1 == depth ) {
			table[size][sum]++;
		}else{
			for (int i = 0; i <= 9; ++i ){
				if ( memo[i] == 0 ) {
					memo[i] = 1;
					numnum (size, depth + 1, sum + i*depth );
					memo[i] = 0;
				} // end if
			} // end for
		} // end if
	}
}

Measured memory_bytes: 13000
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) throws IOException {
		new Main().solve();
	}

	private void solve() throws IOException {
		try {
			solveA();
			//			 solveB();
			//			 solveC();
			//			 solveD();
			//			 solveE();
			//			 solveF();
		} finally {
			if (in != null) {
				in.close();
			}
			if (out != null) {
				out.flush();
				out.close();
			}
		}

	}

	private void solveA() {
		int numN = nextInt();

		while (numN != 0) {
			int wk = numN % 10;
			if (wk == 9) {
				out.println("Yes");
				return;
			}
			numN /= 10;
		}

		out.println("No");
	}

	private void solveB() {
		int numN = nextInt();

		out.println("");
	}

	private void solveC() {
		int numN = nextInt();

		out.println("");
	}

	private void solveD() {
		int numN = nextInt();

		out.println("");
	}

	private void solveE() {
		int numN = nextInt();

		out.println("");
	}

	private void solveF() {
		int numN = nextInt();

		out.println("");
	}

	private final PrintWriter out = new PrintWriter(System.out);
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
}

Measured memory_bytes: 23124
package main

import (
	"bytes"
	"fmt"
	"strconv"
)

func main() {
	var (
		n int
		a []int
	)

	fmt.Scan(&n)
	a = make([]int, n)

	for i, _ := range a {
		fmt.Scan(&a[i])
	}

	cnt := bubble(a)
	fmt.Println(join(a))
	fmt.Println(cnt)
}

func bubble(a []int) (cnt int) {
	for i, _ := range a {
		for j := len(a) - 1; j > i; j-- {
			if a[j-1] > a[j] {
				a[j-1], a[j] = a[j], a[j-1]
				cnt++
			}
		}
	}
	return
}

func join(a []int) string {
	var buf bytes.Buffer
	for i := range a {
		if i > 0 {
			buf.WriteString(" ")
		}
		buf.WriteString(strconv.Itoa(a[i]))
	}
	return buf.String()
}



Measured memory_bytes: 1164
#include <bits/stdc++.h>
#define r(i,a,n) for(int i=a;i<n;i++)
using namespace std;
int main(){
	int a[200000],c=0,n;
	r(i,3,300000)if(i%7==1||i%7==6){
		int p=1;if(i>10&&(i%6==0||i%8==0))continue;
		r(k,0,c)if(i%a[k]==0)p=0;
		if(p)a[c++]=i;
	}
	while(cin>>n,n!=1){
		int s=0;
		cout<<n<<':';
		r(i,0,c)if(n%a[i]==0)cout<<' '<<a[i];
		cout<<endl;
	}
}

Measured memory_bytes: 3240