akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(a, b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define show(x) cout <<#x<<" = "<<(x)<<endl
#define spair(p) cout <<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl
#define sset(s) cout<<#s<<":";each(kbrni,s)cout <<" "<<kbrni;cout<<endl

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 100000;

vector<int> G[MAX_N];
vector<int> rG[MAX_N];
vector<int> vs; //??°?????????????????????
bool used[MAX_N]; //?????§????????????????????????
int cmp[MAX_N];	//?±????????????£????????????????????????????????????

void add_edge(int from,int to)
{
	G[from].push_back(to);
	rG[to].push_back(from);
}

void dfs(int v)
{
	used[v] = true;
	for(int i=0;i<G[v].size();i++){
		if(!used[G[v][i]]){
			dfs(G[v][i]);
		}
	}
	vs.push_back(v);
}

void rdfs(int v,int k)
{
	used[v] = true;
	cmp[v] = k;
	for(int i=0;i<rG[v].size();i++){
		if(!used[rG[v][i]]){
			rdfs(rG[v][i],k);
		}
	}
}

int scc(int n)	//?????£??????????????°?????????
{
	fill(used,used+n,0);
	vs.clear();
	for(int v=0;v<n;v++){
		if(!used[v]){
			dfs(v);
		}
	}
	fill(used,used+n,0);
	int k=0;
	for(int i=vs.size()-1;i>=0;i--){
		if(!used[vs[i]]){
			rdfs(vs[i],k++);
		}
	}
	return k;
}

vector<int> vec[MAX_N];

void graph(int n)
{
	rep(i,n){
		rep(j,G[i].size()){
			if(cmp[i] != cmp[G[i][j]]){
				vec[i].pb(G[i][j]);
			}
		}
	}
}

int main()
{
	int n,m,from,to,k;
	cin >> n;
	cin >> m;
	for(int i=0;i<m;i++){
		cin >> from;
		cin >> to;
		add_edge(from,to);
	}
	k = scc(n);
	if(k == n){
		cout << "0\n";
	}else{
		cout << "1\n";
	}
}

Measured memory_bytes: 10180
#include <iostream>
#include <cstdlib>
using namespace std;
//B - Digit Sums
int main(void){
    string n;
    std::cin >> n;
    int sum=0;
    for (int i = 0; i < n.size(); i++) {
        sum+=(int)(n[i]-'0');
    }
    int N=std::atoi(n.c_str());
    if(N%sum==0){
        std::cout << "Yes" << std::endl;
    }else{
        std::cout << "No" << std::endl;
    }
}


Measured memory_bytes: 256
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    h,w = map(int,input().split())
    if h==1 or w ==1:
        print(1)
        exit()
    flag=h*w
    if flag % 2 ==0:
        print(flag//2)
    else:
        print(int(flag/2)+1)

if __name__=="__main__":
    main()

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



void solve()
{
    string s;
    cin >> s;
    int n = s.size();
    int sum = 0;
    for (int i = 0; i < n ; i++){
        sum+= (s[i] - '0');
    }
    if(sum % 9 == 0)
        cout << "Yes";
    else
        cout << "No";
}

int main()
{

    solve();
    cout << "\n";

}




Measured memory_bytes: 3700
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <queue>

typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;
typedef double              DOUBLE;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
#define rep(i,a,b) for(int (i)=int(a);(i)<int(b);(i)++)

#define INF 1000000001
#define MOD 1000000007
#define INF64 1000000000000000001

#define F first
#define S second

#define Pii pair<SINT32,SINT32>
#define Pll pair<SINT64,SINT64>


using namespace std;

int main() {

	SINT32 N = 0;
	SINT32 K = 0;
	SINT64 ans = 0;

	cin >> N;
	cin >> K;

	vector<SINT32> DATA(N+1);
	
	rep(i,0,N) {
		SINT32 buf;
		cin >> buf;
		DATA[buf]++;
	}
	sort(DATA.begin(),DATA.end(),std::greater<SINT32>());

	rep(i,K,N+1) {
		ans += DATA[i];
	}

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

//	sort(DATA.begin(),DATA.end());
//	sort(DATA.begin(),DATA.end(),std::greater<SINT32>());
//	__gcd(ANS,DATA[i]);

//	// DATA.emplace_back(BUF);	//後ろに追加

//  DATA.erase(std::unique(DATA.begin(), DATA.end()), DATA.end());	//ソート後に使用

//	DATA.insert(DATA.begin() + X, 0);	//X番目の要素に0を挿入


//	vector<vector<SINT32>> DP(N,vector<SINT32>(3));	//2次元配列

/*
	SINT32 M = 3;
	vector<pair<SINT32,SINT32>> DATA2(M);
	for (SINT32 i = 0; i < M; i++) {
		cin >> DATA2[i].first;
		cin >> DATA2[i].second;
	}
	sort(DATA2.begin(),DATA2.end());
	cout << DATA2[0].first << endl;
	cout << DATA2[0].second << endl;
*/

// 	vector<pair<int,pair<int,int>>> DATA(M);
//	cin >> DATA[i].first;
//	cin >> DATA[i].second.first;
//	cin >> DATA[i].second.second;


//		APOSI = lower_bound(ADATA.begin(),ADATA.end(),QDATA[i]) - ADATA.begin();	//key以上を探す
//		BPOSI = lower_bound(BDATA.begin(),BDATA.end(),QDATA[i]) - BDATA.begin();


/* 文字列回転
	string N;
	cin >> N;
	N = N[N.length()-1] + N.substr(0,N.length()-1);
*/
/* 文字列合成
	string N,M;
	cin >> N >> M;
	SINT64 ans = 0;
	ans = stoi(N+M);
*/



/* SET コンテナ
	set<SINT32> DATA;
	for (SINT32 i = 0; i < N; i++) {
		SINT32 buf;
		cin >> buf;
		DATA.insert(buf);
	}

	//全表示
    set<string>::iterator it; //  イテレータを用意
    for(it = DATA.begin(); it != DATA.end(); it++) {
        cout << *it << endl;
    }

	//N番目を一部表示
	set<string>::iterator it; //  イテレータを用意
	it = DATA.begin();
	rep (i,0,N) {
		it++;
	}
	cout << *it << endl;
*/

/* map
	map<string,SINT32> mp;
	SINT32 N = 0;
	SINT32 mx = 0;

	cin >> N;
	for (SINT32 i = 0; i < N; i++) {
		string s;
		cin >> s;
		mp[s]++;
	}
	for(auto it=mp.begin();it!=mp.end();it++) {
		mx=max(mx,it->second);
	}

*/

Measured memory_bytes: 1024
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0;i < (int)(n);i++)
using ll = long long;
const ll MOD=1000000007;
//const ll MOD=998244353;
const long long INF = 1LL << 60;
const double pi=acos(-1.0);

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


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

ll lcm(ll a,ll b){
   return a/gcd(a,b)*b;
}


//エラトステネスの篩
//前処理でmake_eratos() デフォルトで250msくらい
const int MAX_for_eratos=10000100;
long long eratos[MAX_for_eratos];

void make_eratos(){
  rep(i,MAX_for_eratos) eratos[i]=-1;
  for(int i=2;i<=MAX_for_eratos;i++){
    if(eratos[i]>-1) continue;
    for(int j=i;j<=MAX_for_eratos;j+=i) if(eratos[j]==-1) eratos[j]=i;
  }
}

//osa_k法による素因数分解
//普通の因数分解と同様N==1の時に注意
//前処理make_eratos必要
vector<pair<ll,ll>> prime_factorize(ll N){
  vector<pair<ll,ll>> ret={};
  while(N>1){
    ll ex=0;
    ll a=eratos[N];
    while(N%a==0){
      ex++;
      N/=a;
    }
    ret.push_back({a,ex});
  }
  
  return ret;
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  // cout << fixed << setprecision(15);

  ll N; cin>>N;
  vector<ll> A(N); rep(i,N) cin>>A[i];
  
  ll G=A[0]; rep(i,N) G=gcd(G,A[i]);
  if(G>1) {cout<<"not coprime"<<endl; return 0;}
  
  map<ll,ll> mp;
  make_eratos();
  for(auto a:A){
    vector<pair<ll,ll>> vec=prime_factorize(a);
    for(auto p:vec) {
      mp[p.first]++; 
      if(mp[p.first]>1) {cout<<"setwise coprime"<<endl; return 0;}
    }
  }
  cout<<"pairwise coprime"<<endl;
  
  return 0;
}

Measured memory_bytes: 89232
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 998244353;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(ll i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

const ll MAX = 3e5+10;
long long fac[MAX], finv[MAX], inv[MAX];

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

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	
	COMinit();
	ll n, a, b, k;
	cin >> n >> a >> b >> k;
	
	ll ans = 0;
	rep(i, 0, n){
		if((k-a*i)%b == 0){
			ll j = (k-a*i)/b;
			ll tmp = COM(n, i)*COM(n, j);
			//cout << i << j << tmp << endl;
			tmp %= MOD;
			ans += tmp;
			ans %= MOD;
		}
	}
	print(ans)
	return 0;
}

Measured memory_bytes: 7296
#include <bits/stdc++.h>
using namespace std;
double f;
int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    int d,r;
    d=a/b;
    r=a%b;
    f=(float)a/b;
    //printf("%.5f",f);
    printf("%d %d %.5f\n",d,r,(double)a/b);
}



Measured memory_bytes: 3232
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        int i,j;
        
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        
        Matrix A=new Matrix(n,m);
        for(i=0;i<n;i++){
            for(j=0;j<m;j++)A.setElement(i,j,sc.nextInt());
        }
        
        Matrix B=new Matrix(m,1);
        for(i=0;i<m;i++)B.setElement(i,0,sc.nextInt());
        
        Matrix C=new Matrix(n,1);
        C.product(A,B);
        C.printElement();
    }
}
class Matrix{
    private int row;
    private int col;
    private int elm[][];
    Matrix(int a,int b){
        this.row=a;
        this.col=b;
        elm=new int[a][b];
    }
    void setElement(int a,int b,int x){
        this.elm[a][b]=x;
    }
    void printElement(){
        for(int i=0;i<this.row;i++){
            for(int j=0;j<this.col;j++){
                if(j==0)System.out.printf("%d",this.elm[i][j]);
                else System.out.printf(" %d",this.elm[i][j]);
            }
            System.out.printf("\n");
        }
    }
    void product(Matrix a,Matrix b){
        if(a.col!=b.row){
            System.out.println("wrong input");
            System.exit(0);
        }
        
        for(int i=0;i<a.row;i++){
            for(int k=0;k<b.col;k++){
                for(int j=0;j<a.col;j++){
                    this.elm[i][k]+=a.elm[i][j]*b.elm[j][k];
                }
            }
        }
    }
}


Measured memory_bytes: 41148
n = gets.to_i
irons = gets.split.map(&:to_i)
iron_sum = irons.inject(:+)
if iron_sum.even?
  half = iron_sum / 2
  tmp = 0
  mid = 0
  left = 0
  left_with_mid = 0
  right = 0
  right_with_mid = 0
  irons.each_with_index do |iron, index|
    tmp += iron
    if tmp >= half
      mid = iron
      left_with_mid = tmp
      left = left_with_mid - mid
      right = iron_sum - left_with_mid
      right_with_mid = right + mid
      break
    end
  end
  puts [left_with_mid - right, right_with_mid - left].min
else
  iron_sum += 1
  irons[0] += 1
  half = iron_sum / 2
  tmp = 0
  mid = 0
  left = 0
  left_with_mid = 0
  right = 0
  right_with_mid = 0
  irons.each_with_index do |iron, index|
    tmp += iron
    if tmp >= half
      mid = iron
      left_with_mid = tmp
      left = left_with_mid - mid
      right = iron_sum - left_with_mid
      right_with_mid = right + mid
      break
    end
  end
  option1 = [left_with_mid - right, right_with_mid - left].min + 1

  irons[0] -= 1
  irons[n - 1] += 1
  half = iron_sum / 2
  tmp = 0
  mid = 0
  left = 0
  left_with_mid = 0
  right = 0
  right_with_mid = 0
  irons.each_with_index do |iron, index|
    tmp += iron
    if tmp >= half
      mid = iron
      left_with_mid = tmp
      left = left_with_mid - mid
      right = iron_sum - left_with_mid
      right_with_mid = right + mid
      break
    end
  end
  option2 = [left_with_mid - right, right_with_mid - left].min + 1

  puts [option1, option2].min
end

Measured memory_bytes: 18060
datas = list(map(str,input().split(' ')))
tmp = list()
operator_list = ['+', '-', '*', '/']

for data in datas:
    if operator_list[0] == data:
        tmp.append(tmp.pop() + tmp.pop())
    elif operator_list[1] == data:
        tmp.append(0 - tmp.pop() + tmp.pop())
    elif operator_list[2] == data:
        tmp.append(tmp.pop() * tmp.pop())
    elif operator_list[3] == data:
        tmp.append(1 / tmp.pop() * tmp.pop())
    else:
        tmp.append(int(data))

print(tmp.pop())


Measured memory_bytes: 5600
#include <iostream>
#include <cstdio>
#define _USE_MATH_DEFINES
#include <cmath>
#include <math.h>

using namespace std;

const int R = 10;
const int F = 3;
int main()
{
    int t;
    cin >> t;
    const int n = t;
    int Atou[F][R] = {};
    int Btou[F][R] = {};
    int Ctou[F][R] = {};
    int Dtou[F][R] = {};
    int b,f,r,v;
    for(int i = 0; i < n; i++){
        cin >> b >> f >> r >> v;
        switch(b){
            case 1:
                Atou[f-1][r-1] += v;
                break;
            case 2:
                Btou[f-1][r-1] += v;
                break;
            case 3:
                Ctou[f-1][r-1] += v;
                break;
            case 4:
                Dtou[f-1][r-1] += v;
                break;
            default:
                break;
        }
    }

    for(int i = 0; i < F; i++){
        for(int j = 0; j < R; j++){
            cout << " " << Atou[i][j];
        }
        cout << endl;
    }
    for(int i = 0; i < 20; i++){
        cout << "#";
    }
    cout << endl;

    for(int i = 0; i < F; i++){
        for(int j = 0; j < R; j++){
            cout << " " << Btou[i][j];
        }
        cout << endl;
    }
    for(int i = 0; i < 20; i++){
        cout << "#";
    }
    cout << endl;

    for(int i = 0; i < F; i++){
        for(int j = 0; j < R; j++){
            cout <<" "<< Ctou[i][j];
        }
        cout << endl;
    }
    for(int i = 0; i < 20; i++){
        cout << "#";
    }
    cout << endl;

    for(int i = 0; i < F; i++){
        for(int j = 0; j < R; j++){
            cout <<" "<< Dtou[i][j];
        }
        cout << endl;
    }


}

Measured memory_bytes: 3064
import java.util.*;

@SuppressWarnings("unchecked")
public class Main {
	// public static void printArray(int[] a) {
	// 	for (int i = 0; i < a.length; i++) {
	// 		System.out.print(a[i] + ", ");
	// 	}
	// 	System.out.println();
	// }

	// public static<T> void printArrayT(T[] a) {
	// 	for (int i = 0; i < a.length; i++) {
	// 		System.out.print(a[i] + ", ");
	// 	}
	// 	System.out.println();
	// }

	public static String joinInt(int[] a, String separator) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < a.length; i++) {
			if (i > 0) {
				sb.append(separator);
			}
			sb.append(a[i]);
		}
		return sb.toString();		
	}

	static int[] nextIntArray(Scanner sc, int N) {
		int[] arr = new int[N];
		for (int i = 0; i < N; i++) {
			arr[i] = sc.nextInt();
		}
		return arr;
	}

	static final int W = 101;

	static void fill(int x0, int y0, int h0, int[][] P) {
		for (int y = 0; y < W; y++) {
			int diffY = Math.abs(y - y0);
			for (int x = 0; x < W; x++) {
				int diffX = Math.abs(x - x0);
				int h = h0 + diffX + diffY;
				P[y][x] = h;
			}
		}
	}

	static void update(int x0, int y0, int h0, int[][] P) {
		if (h0 == 0) {
			update2(x0, y0, P);
			return;
		}
		for (int y = 0; y < W; y++) {
			int diffY = Math.abs(y - y0);
			for (int x = 0; x < W; x++) {
				int p = P[y][x];
				if (p != 0) {
					int diffX = Math.abs(x - x0);
					int h = h0 + diffX + diffY;
					if (p != h) {
						P[y][x] = 0;
					}
				}
			}
		}
	}
	static void update2(int x0, int y0, int[][] P) {
		for (int y = 0; y < W; y++) {
			int diffY = Math.abs(y - y0);
			for (int x = 0; x < W; x++) {
				int p = P[y][x];
				if (p != 0) {
					int diffX = Math.abs(x - x0);
					int maxH = diffX + diffY;
					if (p > maxH) {
						P[y][x] = 0;
					}
				}
			}
		}
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] X = new int[N];
		int[] Y = new int[N];
		int[] H = new int[N];
		for (int i = 0; i < N; i++) {
			X[i] = sc.nextInt();
			Y[i] = sc.nextInt();
			H[i] = sc.nextInt();
		}
		int[][] P = new int[W][W];
		for (int i = 0; i < N; i++) {
			if (H[i] != 0) {
				fill(X[i], Y[i], H[i], P);
				break;
			}
		}
		for (int i = 0; i < N; i++) {
			update(X[i], Y[i], H[i], P);
		}

		for (int y = 0; y < W; y++) {
			for (int x = 0; x < W; x++) {
				if (P[y][x] != 0) {
					System.out.printf("%d %d %d%n", x, y, P[y][x]);
					break;
				}
			}
		}
	}
}


Measured memory_bytes: 24404
import java.io.PrintWriter

fun main(args: Array<String>) {
    val inf = 1e13.toLong()
    val pw = PrintWriter(System.out)

    val (n, m, l) = readLine()!!.split(' ').map { it.toInt() }

    val d1 = Array(n + 1) { LongArray(n + 1) { inf } }
    val d2 = Array(n + 1) { LongArray(n + 1) { inf } }
    for (i in 1 until n) {
        d1[i][i] = 0
        d2[i][i] = 0
    }
    repeat(m) {
        val (a, b, c) = readLine()!!.split(' ').map { it.toInt() }
        c.toLong().let{
            d1[a][b] = it
            d1[b][a] = it
        }
    }

    for (k in 1 .. n)
        for (i in 1 .. n)
            for (j in 1 .. n) {
                d1[i][j] = Math.min(d1[i][j], d1[i][k] + d1[k][j])
            }

    for (i in 1 .. n)
        for (j in 1 .. n) {
            if (d1[i][j] <= l) {
                d2[i][j] = Math.min(d2[i][j], 1)
            }
        }

    for (k in 1 .. n)
        for (i in 1 .. n)
            for (j in 1 .. n) {
                d2[i][j] = Math.min(d2[i][j], d2[i][k] + d2[k][j])
            }

    val q = readLine()!!.toInt()
    repeat(q) {
        val (s, t) = readLine()!!.split(' ').map { it.toInt() }
        pw.println(if (d2[s][t] < inf) d2[s][t] - 1 else -1)
    }
    pw.flush()
}


Measured memory_bytes: 70492
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input()) 
flag = 0

if A < B:
    a = V*T + A
    b = W*T + B
    if a >= b:
        flag = 1


else:
    a = A - V*T
    b = B - W*T
    if a <= b:
        flag = 1

if flag==1:
    print("YES")
else:
    print("NO")

Measured memory_bytes: 9196
import java.util.*;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N  = keyboard.nextInt();
		
		int ans = 0;
		
		if((1000-N%1000) != 1000) {
			ans = 1000-N%1000;
		}
		
		System.out.println(ans);
		keyboard.close();	
	}
}


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



int main(){
    //ios_base::sync_with_stdio(false);
    //cin.tie(nullptr);
    ll n;
    cin>>n;
    map<ll,ll>m;
     while (n % 2 == 0)
    {
        m[2]++;
        n = n/2;
    }

    for (ll i = 3; i <= sqrt(n); i = i + 2)
    {
        while (n % i == 0)
        {
            m[i]++;
            n = n/i;
        }
    }
  if (n > 2)
        m[n]++;


    //cout<<m.size();
    ll ans=0;
    for(auto x:m){
            //cout<<x.second;
        ll sum=1,i=1;
        while(1){
        sum+=(i+1);
        if(sum<=x.second)
                i++;
    else{
        break;
    }

        }
        ans+=i;
    }
    cout<<ans<<"\n";
    return 0;
}


Measured memory_bytes: 3692
import java.util.*;

class Main{
    public static void main(String[] args){
        List<Integer> a = new ArrayList<>();
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextInt()){
            a.add(sc.nextInt());
        }
        a.stream().sorted(Comparator.reverseOrder()).limit(3).forEach(System.out::println);
    }
}

Measured memory_bytes: 32072
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define chmin(x,y) x = min(x,y)
using namespace std;
typedef long long ll;
const int INF = 1001001001;

int main() {
    int a, b;
    cin >> a >> b;
    if(a==2 or b==2){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
 
public class Main {
    public static void main(String args[]) throws IOException {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int total = 0;
        if(N%2==0){
            N=N-1;   
        }
        for (int i=N ; i > 0 ; i=i-2){
            int count = 0;
            for (int j=1 ; j <= N ; j=j+2){
                if(i%j==0){
                    count = count + 1;
                }
            }
            if(count==8){
                total = total + 1;
            }
        }
        System.out.println(total);
    }
}

Measured memory_bytes: 22996
k, n = map(int, input().split())
import numpy as np
a = np.array(list(map(int, input().split())))
dist = np.abs(a -np.roll(a, 1))
dist[0] = min(k-a[n-1] + a[0], a[n-1]-a[0])
ans_a = np.sum(dist)
ans = ans_a
for i in range(n):
  ans_sub = ans_a-dist[i]
  if ans_sub < ans:
    ans = ans_sub
print(ans)


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

int main() {
  int d, t, s;
  cin >> d >> t >> s;
  int div = d / s;
  if (d % s != 0) {
    div++;
  }
  if (t >= div) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 3632
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		List<Integer> D = new ArrayList<>();
		for(int i = 0;i < K;i++) {
			D.add(sc.nextInt());
		}
		sc.close();
		int res = 0;
		while(N > 0) {
			if(checkNum(N, D)){
				res = N;
				break;
			}
			N++;
		}
		System.out.println(res);
	}

	private static boolean checkNum(int n, List<Integer> array) {
		boolean flag = true;
		while(n > 0) {
			if(array.contains(n%10)) {
				flag = false;
				break;
			}
			n /= 10;
		}
		return flag;
	}
}

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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair
#define F first
#define S second

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; }

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }


struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;

string A;

int main() {
    cin >> A;
    string B;
    B = A;
    reverse(A.begin(), A.end());
    i64 cnt = 0;
    REP(i, A.length()) {
        if (A[i] == B[i]) continue;
        cnt++;
    }
    cout << cnt / 2 << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

#define mp make_pair
#define pb push_back
#define pf push_front
#define ss second
#define ff first
#define sz(x) (int)x.size()
#define newl "\n"
#define vi vector<int>
#define pii pair<int, int>
#define vii vector<pii>
#define vl vector<ll>
#define pll pair<ll, ll>
#define vll vector<pll>
#define coutp cout << fixed << setprecision(12)
#define mem(x, val) memset(x, val, sizeof(x))
#define fastio                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define all(v) (v).begin(), (v).end()

const ld pi = 3.14159265359;
ll INF = 1e18 + 10;
ll MOD = 998244353;
ll mod = 1e9 + 9;

inline ll add(ll a, ll b, ll m)
{
    if ((a + b) >= m)
        return (a + b) % m;
    return a + b;
}

inline ll mul(ll a, ll b, ll m)
{
    if ((a * b) < m)
        return a * b;
    return (a * b) % m;
}

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

void solve() 
{
    string s;
    cin>>s;
    int c=0;
    int ans=0;
    for(int i=0;i<3;i++) {
        ans=max(c,ans);
        if(s[i]=='R') {
            c++;
        }
        else {
            c=0;
        }
    }
    ans = max(ans,c);
    cout<<ans;
}

int main()
{
    fastio;
    int t;

    t = 1;
    //cin >> t;
    //int test=t;
    while (t-- > 0)
    {
        //cout<<"Case #"<<(test-t)<<": ";
        solve();
        cout << newl;
    }

    return 0;
}

Measured memory_bytes: 3652
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int minv = Integer.MAX_VALUE;
		int maxv = Integer.MIN_VALUE;
		for (int i = 0; i < n; i++) {
			int j = scanner.nextInt();
			maxv = Math.max(maxv, j - minv);
			minv = Math.min(minv, j);
		}
		System.out.println(maxv);
	}
}

Measured memory_bytes: 94316
/*.....Bismillahir Rahmanir Rahim.....*/
#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   sz(x)  (int)x.size()
#define   ff first
#define   ss second
#define   pii  pair<int,int> 
#define   pb  push_back
#define   eb  emplace_back
using namespace std;

void solve(){
	int  a[3],c=3;
	cin >> a[0] >> a[1] >> a[2] ; 
	sort (a,a+3);
	if (a[0] == a[1]) c--;
	if (a[1]==a[2]) c--;
	cout << c << endl; 
}

signed main()
{
	int  n=1; // cin >> n;
	while (n--) 
	solve();
    return 0;
}
/*
4 
10 30 40 20

*/

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  vector<int> v(3);
  for(int i=0; i<3; i++) {
    cin >> v.at(i);
  }
  sort(v.begin(), v.end());
  cout << v.at(2)-v.at(0) << endl;
}

Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <stdio.h>
#include <string.h>
#define INF 1000000
#define ll long long
using namespace std;


int minx[1111];
int maxx[1111];
int miny[1111];
int maxy[1111];

string S[1111];

vector<pair<int,int>> GetPts(int H,int W, char c) {
    for(int i=0;i<H;i++)
    {
        miny[i]=INF;
        maxy[i]=-INF;
    }
    
    for(int j=0;j<W;j++) {
        minx[j]=INF;
        maxx[j]=-INF;
    }
    
    for(int i=0;i<H;i++) {
        for(int j=0;j<W;j++) {
            if (S[i][j]==c) {
                miny[i]=min(miny[i],j);
                maxy[i]=max(maxy[i],j);
                minx[j]=min(minx[j],i);
                maxx[j]=max(maxx[j],i);
            }
        }
    }
    
    vector<pair<int,int>> pts;
    
    for(int i=0;i<H;i++) {
        
        if (miny[i]!=INF) {
            pts.push_back({i,miny[i]});
        }
        
        if (maxy[i]!=-INF) {
            pts.push_back({i,maxy[i]});
        }
        
        
    }
    
    
    for(int j=0;j<W;j++) {
        
        if (minx[j]!=INF) {
            pts.push_back({minx[j],j});
        }
        
        if (maxx[j]!=-INF) {
            pts.push_back({maxx[j],j});
        }
        
        
    }
    return pts;
    
    
}

int GetDist(pair<int,int> a, pair<int,int> b) {
    return abs(a.first-b.first)+abs(a.second-b.second);
}

pair<int,int> BFS[2][1111111];
bool done[1111][1111];

int main() {
    int H,W;
    cin>>H>>W;
    for(int i=0;i<H;i++)
        cin>>S[i];


    int sz=0;
    for(int i=0;i<H;i++)
        for(int j=0;j<W;j++) {
            done[i][j]=false;
            if (S[i][j]=='#') {
                BFS[0][sz++]={i,j};
                done[i][j]=true;
            }
        }
    
    for(int iters=0;;iters++) {
        int nsz=0;
        for(int i=0;i<sz;i++) {
            int x=BFS[iters&1][i].first;
            int y=BFS[iters&1][i].second;
            int dx[]={-1,1,0,0};
            int dy[]={0,0,-1,1};
            for(int d=0;d<4;d++) {
                int nx=x+dx[d];
                int ny=y+dy[d];
                if (nx < 0 || nx >= H || ny < 0 || ny >= W)
                    continue;
                if (done[nx][ny])
                    continue;
                
                BFS[(iters+1)&1][nsz++]={nx,ny};
                done[nx][ny]=true;
            }
        }
        if (nsz==0) {
            cout << iters << endl;
            return 0;
        }
        sz=nsz;
    }
    
    return 0;
    vector<pair<int,int>> black_pts = GetPts(H,W,'#');
    vector<pair<int,int>> white_pts = GetPts(H,W,'.');

    
    
    int ans = 0;
    for(auto w : white_pts) {
        int mindist = INF;
        for(auto b : black_pts) {
            mindist = min(mindist, GetDist(w,b));
        }
        ans=max(ans, mindist);
    }
    cout << ans << endl;
    
}


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

double a[55];
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
  	cin>>a[i];
  }
  
  sort(a, a+n);
  
  double sum = a[0];
  for(int i=1;i<n;i++){
  	sum+=a[i];
    sum/=2;
  }
  cout<<fixed<<setprecision(10)<<sum<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define pii pair<int, int>
#define sz size()
#define pb push_back

using namespace std;

const int maxn = 1e5 + 12;
int n, a[maxn], dp[maxn], ans, k;
vector < pii > v[maxn];

int main() {
    cin >> n >> k;
    for (int i = 1; i <= n; i ++) {
        cin >> a[i];
        dp[i] = 1e9 + 7;
    }
    dp[1] = 0;
    for (ll i = 2; i <= min (n, k); i ++) {
        for (ll j = 1; j < i; j ++) {
            dp[i] = min (abs (a[j] - a[i]) + dp[j], dp[i]);
        }
    }
    for (ll i = min(n, k + 1); i <= n; i ++) {
        for (ll j = i - min (n, k); j < i; j ++) {
            dp[i] = min (abs (a[j] - a[i]) + dp[j], dp[i]);
        }
    }
    cout << dp[n];
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define REP(i,s,e) for(int i=(s); i<(e);i++)
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n)
#define repe(i,n) for(auto &&i:n)
#define all(v) (v).begin(),(v).end()
#define decimal fixed<<setprecision(20)
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)
using namespace std;
using LL = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 1e9;
const LL LLINF = 1e16;

template<int mod>
struct ModInt {
    int x;

    ModInt() : x(0) {}
    ModInt(long long y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

    ModInt &operator+=(const ModInt &p) {
        if((x += p.x) >= mod) x -= mod;
        return *this;
    }
    ModInt &operator-=(const ModInt &p) {
        if((x += mod - p.x) >= mod) x -= mod;
        return *this;
    }
    ModInt &operator*=(const ModInt &p) {
        x = (int)(1LL * x * p.x % mod);
        return *this;
    }
    ModInt &operator/=(const ModInt &p) {
        *this *= p.inverse();
        return *this;
    }

    ModInt operator-() const { return ModInt(-x); }
    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

    bool operator==(const ModInt &p) const { return x == p.x; }
    bool operator!=(const ModInt &p) const { return x != p.x; }

    ModInt inverse() const{
        int a = x, b = mod, u = 1, v = 0, t;
        while(b > 0) {
            t = a / b;
            a -= t * b;
            swap(a, b);
            u -= t * v;
            swap(u, v);
        }
        return ModInt(u);
    }

    ModInt pow(int e){
        long long a = 1, p = x;
        while(e > 0) {
            if(e%2 == 0) {p = (p*p) % mod; e /= 2;}
            else {a = (a*p) % mod; e--;}
        }
        return ModInt(a);
    }

    friend ostream &operator<<(ostream &os, const ModInt<mod> &p) {
        return os << p.x;
    }
    friend istream &operator>>(istream &is, ModInt<mod> &a) {
        long long x;
        is >> x;
        a = ModInt<mod>(x);
        return (is);
    }
};

const int mod = 1e9 + 7;
using modint = ModInt<mod>;


modint dp[65][3];

int main(){
    LL n;
    cin >> n;
    dp[64][0] = 1;
    for(int i=63; i>=0; i--){
        if((n >> i) & 1){
            dp[i][0] = dp[i+1][0];
            dp[i][1] = dp[i+1][0] + dp[i+1][1];
            dp[i][2] = dp[i+1][1]*2 +dp[i+1][2]*3;
        }else{
            dp[i][0] = dp[i+1][0] + dp[i+1][1];
            dp[i][1] = dp[i+1][1];
            dp[i][2] = dp[i+1][1] +dp[i+1][2]*3;
        }
    }
    modint ans = 0;
    rep(i, 3) ans += dp[0][i];
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
typedef   long long int ll;
typedef unsigned long long int sll;
typedef  double ld;
#define A 1000000007ll
#define B 998244353ll
#define C 1000000000000000000ll
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pb push_back
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define br break
#define PI 3.1415926535

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

int main() 
{
    FAST;
    ll n;
    cin>>n;
	ll ans=0;
    for(int i=1;i<=n;i++)
    	for(int j=1;j<=n;j++)
    		for(int k=1;k<=n;k++)
    			ans+=gcd(gcd(i,j),k);
    cout<<ans;
    return 0;
}

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

int main() {
    string s;
    cin >> s;
    bool has_c = false;
    for (int i = 0; i < (int)s.size(); i++) {
        if (has_c && s.at(i) == 'F') {
            cout << "Yes" << endl;
            return 0;
        } 
        if (s.at(i) == 'C') has_c = true;
    }
    cout << "No" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include <cassert>
#include <cmath>
#include<cstdint>

#define INF 1e9
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int,int>;

vector<int>bitSearch(int bit,int n){
    vector<int>S;
    rep(i,n)if(bit&(1<<i))S.push_back(i);
    return S;
}

template<typename A,size_t N,typename T>
void Fill(A(&array)[N],const T &val){
    fill((T*)array,(T*)(array+N),val);
}


int main(){
    int N;cin>>N;
    map<int,int>mp;
    REP(n,1,N){
        int now = n;
        for(int i=2;i*i<=n;i++){
            while(now%i==0){
                mp[i]++;
                now /= i;
            }
        }
        if(now>1)mp[now]++;
    }
    vector<int>v;
    for(auto m : mp)v.push_back(m.second);

    int res = 0;
    int len = v.size();
    rep(i,len)if(v[i]>=74)res++;

    rep(i,len){
        REP(j,i+1,len-1){
            if(v[i]>=2 && v[j]>=24)res++;
            if(v[i]>=24 && v[j]>=2)res++;
            if(v[i]>=4 && v[j]>=14)res++;
            if(v[i]>=14 && v[j]>=4)res++;
        }
    }
    
    rep(i,len){
        REP(j,i+1,len-1){
            REP(k,j+1,len-1){
                if(v[i]>=2 && min(v[j],v[k])>=4)res++;
                if(v[j]>=2 && min(v[i],v[k])>=4)res++;
                if(v[k]>=2 && min(v[j],v[i])>=4)res++;
            }
        }
    }
  cout<<res<<endl;
    //for(auto m : mp)cout<<m.first<<" "<<m.second<<endl;
}

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

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

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
using namespace std;
char s[1000005];
bool bo;
long long ji;
int main(){
 	scanf("%s",&s);
 	long long len=strlen(s);
 	for(long long i=0;i<len-1;i++)
	 {
 	 	if(s[i]!=s[i+1])
		bo=1;
	}
	if(bo==1)
	{
		if(s[0]!=s[len-1])
 		ji=len-2;
 		else ji=len-3;
	}
	else ji=0;
 	if(ji%2==1)printf("First"); 
 	else printf("Second");
			return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++)
#define rep(i,n)Rep(i,0,n)
typedef long long ll;
typedef long double ld;

int M(int a, int b, int c) {
	if (a > b)return a > c ? a : c;
	return b > c ? b : c;
}
int m(int a, int b, int c) {
	if (a < b)return a < c ? a : c;
	return b < c ? b : c;
}

int main() {
	int a=0, b=0, c=0, flag=0;
	char s;
	rep(i, 100001) {
		scanf("%c", &s);
		if (s == 'a')a++;
		else if (s == 'b')b++;
		else if (s == 'c')c++;
		else break;
	}
	if (M(a,b,c)-m(a,b,c)<=1)printf("YES");
	else printf("NO");
}

Measured memory_bytes: 128
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

import numpy as np

# どこかの長さKは最後に単色で残る
# そこを残すと決めると他は自由に設定できる

N,K = map(int,input().split())
A = np.array(input().split(), dtype=np.int64)

Acum = A.cumsum()
range_sum = Acum[K-1:] - Acum[:N-(K-1)] + A[:N-(K-1)]

# 各地点を左端として、長さKの区間の合計を求める
Acum = A.cumsum()
range_sum = Acum[K-1:] - Acum[:N-(K-1)] + A[:N-(K-1)]
best = np.maximum(A,0)
best_cum = best.cumsum()
best_range_sum = best_cum[K-1:] - best_cum[:N-(K-1)] + best[:N-(K-1)]

min_loss = (best_range_sum - np.maximum(range_sum,0)).min()

answer = best.sum() - min_loss
print(answer)

Measured memory_bytes: 24696
#include "bits/stdc++.h"
using namespace std;

int main() {
	string s; cin >> s;
	int64_t chk = 0;
	for (int i = 0; i < s.size(); i++)
	{
		chk += s.at(i) - '0';
	}
	if (chk % 9) cout << "No" << endl;
	else cout << "Yes" << endl;
}

Measured memory_bytes: 3672
#include <bits/stdc++.h>
#define newl "\n"
using namespace std;
using lli = long long int;
using vvint = vector <vector <int>>;
const int mod = 1e9 + 7;

const int N = 2e5 + 1;

void solve(){
	int a,b,c,k;
	cin >> a >> b >> c >> k;
	if(k <= a){
		cout << k << newl;
	}
	else{
		k = k - a;
		if(k <= b){
			cout << a << newl;
		}
		else{
			k = k - b;
			cout << a - k << newl;
		}
	}

	return;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(10);
	#ifdef EXECUTE_LOCALLY
		   freopen("in.txt","r",stdin);
	#endif
	int t = 1;
	//cin >> t;
	while(t--) solve();
	#ifdef EXECUTE_LOCALLY
    	cout << setprecision(3) << "program time: " << (double)clock() / CLOCKS_PER_SEC << newl;
	#endif
	return 0;
}


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

int main() {
  int n;
  cin>>n;
  int a[n];
  for (int i=0; i<n; i++) cin>>a[i];
  map<int, int> m;
  for (int i=0; i<n; i++) ++m[a[i]];
  long long sum = 0;
  for (auto e: m) {
    sum += 1LL * e.second * (e.second - 1) / 2;
  }
  for (int i=0; i<n; i++) {
    long long num = m[a[i]];
    long long ans = sum - num * (num - 1) / 2 + (num - 1) * (num - 2) /2;
    cout<<ans<<endl;
  }
}

Measured memory_bytes: 8320
//Written by Zhu Zeqi
//Come on,baby
//Hack,please
#include<bits/stdc++.h>
#define MAX 1000000000000000000
#define MOD 1000000007
#define PI 3.141592653589793238462
#define INF 0x3F3F3F3F
typedef long long ll;
//orz yht
using namespace std;
string i_s(int x){
	if(x==0)
	return "0";
	string ret="";
	while(x){
		ret=ret+(char)(x%10+'0');
		x/=10;
	}
	reverse(ret.begin(),ret.end());
	return ret;
}
string add(string a,string b){
	if(a=="")
	a="0";
	if(b=="")
	b="0";
	if(a.length()<b.length())
	swap(a,b);
	while(b.length()<a.length()){
		b='0'+b;
	}
	for(int i=0;i<a.length();i++){
		a[i]=a[i]+(b[i]-'0');
	}
	bool big=false;
	for(int i=a.length()-1;i>=0;i--){
		if(big){
			a[i]++;
		}
		big=false;
		if(a[i]>'9'){
			a[i]=a[i]-10;
			big=true;
		}
	}
	if(big)
	a='1'+a;
	return a;
}
string mul(string a,string b){
	vector<int> va,vb;
	if(a=="0" || b=="0")
	return "0";
	string ans;
	for(int i=0;i<a.length();i++){
		va.push_back(a[i]-'0');
	}
	for(int i=0;i<b.length();i++){
		vb.push_back(b[i]-'0');
	}
	reverse(va.begin(),va.end());
	reverse(vb.begin(),vb.end());
	vector<int> res;
	res.clear();
	res.resize(1005);
	for(int i=0;i<a.length();i++){
		for(int j=0;j<b.length();j++){
			res[i+j]+=(va[i]*vb[j]);
		}
	}
	for(int i=0;i<1005;i++){
		if(res[i]>9){
			res[i+1]+=(res[i]/10);
			res[i]%=10;
		}
	}
	for(int i=0;i<1005;i++){
		ans+=(res[i]+'0');
	}
	reverse(ans.begin(),ans.end());
	int k=0;
	while(ans[k]=='0'){
		k++;
	}
	ans=ans.substr(k);
	return ans;
}
bool is_prime(int n){
	if(n<2)
    return false;
    for(int i=2;i*i<=n;i++)
    if(n%i==0)
    return false;
    return true;
}
int n;
int main(){
	//freopen("input.in","r",stdin);
	//freopen("output.out","w",stdout);
	cin>>n;
	if(n<=(n/100)*100+(n/100)*10+n/100)
	cout<<(n/100)*100+(n/100)*10+n/100;
	else
	cout<<(n/100+1)*100+(n/100+1)*10+n/100+1;
	//system("pause");
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <climits>
#include <string>
#include <numeric>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <set>

using namespace std;
using ll = long long;

template<typename T> void print(T t) { cout << t << endl; }
ll MOD = 1000000007;

int main() {
	int K, A=7;
	cin >> K;
	
	for (int i = 1; i < 2*K+1; i++) {
		if (A % K == 0) {
			print(i);
			return 0;
		}
		A = (10 * A + 7) % K;
	}
	print(-1);
	return 0;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
char s[12];
int len,ppos[12];
long long ans;
inline void dfs(int pos)
{
	if(pos==len)
	{
		long long tmp=0;
		for(int i=1;i<=len;++i)
		{
			tmp*=10,tmp=0ll+tmp+s[i]-'0';
			if(ppos[i]) ans=0ll+ans+tmp,tmp=0;
		}
		ans=0ll+ans+tmp;
		return;
	}
	dfs(pos+1);
	ppos[pos]=1;
	dfs(pos+1);
	ppos[pos]=0;
}
int main()
{
	scanf("%s",s+1);
	len=strlen(s+1);
	dfs(1);
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 256
<?php

$line1 = fgets(STDIN);
$line2 = fgets(STDIN);
$line3 = fgets(STDIN);

$bingo_card1 = explode(" ", $line1);
$bingo_card2 = explode(" ", $line2);
$bingo_card3 = explode(" ", $line3);

$bingo_check1 = [" ", " ", " "];
$bingo_check2 = [" ", " ", " "];
$bingo_check3 = [" ", " ", " "];
$last = "No";

fscanf(STDIN, "%d", $count);

for($nubmer = 0; $nubmer < $count; $nubmer++) {
  fscanf(STDIN, "%d", $bingo);
  
  //ビンゴカード該当しているかチェック
  for($i = 0; $i < 3; $i++){
     if($bingo == $bingo_card1[$i]) {
       $bingo_check1[$i] = "A";
     }
     if($bingo == $bingo_card2[$i]) {
       $bingo_check2[$i] = "A";
     }
     if($bingo == $bingo_card3[$i]) {
       $bingo_check3[$i] = "A";
     }
  }
  
  //ビンゴ縦チェック
  for($j = 0; $j < 3; $j++) {
    if($bingo_check1[$j] == "A" &&
       $bingo_check2[$j] == "A" &&
       $bingo_check3[$j] == "A" ){
	      $last = "Yes";
    }
  }
  
  //ビンゴ横チェック
  if($bingo_check1[0] == "A" &&
     $bingo_check1[1] == "A" &&
     $bingo_check1[2] == "A" ) {
	    $last = "Yes";
  }
  if($bingo_check2[0] == "A" &&
     $bingo_check2[1] == "A" &&
     $bingo_check2[2] == "A" ) {
	    $last = "Yes";
  }
  if($bingo_check3[0] == "A" &&
     $bingo_check3[1] == "A" &&
     $bingo_check3[2] == "A" ) {
	    $last = "Yes";
  }
  
  //ビンゴ斜めチェック
  if($bingo_check1[0] == "A" &&
     $bingo_check2[1] == "A" &&
     $bingo_check3[2] == "A" ) {
	    $last = "Yes";
  }
  if($bingo_check1[2] == "A" &&
     $bingo_check2[1] == "A" &&
     $bingo_check3[0] == "A" ) {
	    $last = "Yes";
  }
  
}

echo $last;

?>

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

constexpr int inf = 0x3f3f3f3f;
constexpr ll linf = 0x3f3f3f3f3f3f3f3fLL;

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

    int n; cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        a[i]--;
    }

    for (int i = 0, now = 0; i < n; i++, now = a[now]) {
        if (now == 1) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <deque>
#include <queue>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define REP(i, m, n) for(int i = m; i < n; ++i)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define RREP(i, m, n) for(int i = n; i >= m; --i)

using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;

using namespace std;


const long long MOD = 1000000007;

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

	int n, m;
	cin >> n >> m;
	int* ans;
	ans = new int[n];
	rep(i, n) {
		ans[i] = -1;
	}

	rep(i, m) {
		int s, c;
		cin >> s >> c;
		if (n != 1 && s == 1 && c == 0) {
			cout << -1 << "\n";
			return 0;
		}

		if (ans[s - 1] != -1 && ans[s - 1] != c) {
			cout << -1 << "\n";
			return 0;
		}

		ans[s - 1] = c;
	}

	if (n != 1 && ans[0] == -1) {
		ans[0] = 1;
	}

	int rtv = 0;
	rep(i, n) {
		if (ans[i] != -1) {
			rtv += ans[i];
		}

		rtv *= 10;
	}

	rtv /= 10;
	cout << rtv << "\n";

	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int D = sc.nextInt();
		int E = sc.nextInt();
		int F = sc.nextInt();
		sc.close();

		int ansW = 0;
		int ansS = 0;
		double max = 0d;
		for (int a = 1; a <= 30; a++) {
			for (int b = 0; b <= 10; b++) {
				int water = a * A + b * B;
				for (int c = 0; c <= 1500; c++) {
					for (int d = 0; d <= 500; d++) {
						int sugar = c * C + d * D;
						int ws = water * 100 + sugar;
						if (ws <= F && sugar <= E * water) {
							double noudo = (double) sugar / ws;
							if (max <= noudo) {
								ansW = ws;
								ansS = sugar;
								max = noudo;
							}
						}
					}
				}
			}
		}
		System.out.println(ansW + " " + ansS);
	}
}


Measured memory_bytes: 24020