akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

int main(){
  ll N;
  cin >> N;
  vector<ll> vec(N);
  ll a = 0;
  for(int i = 0; i < N; i++){
    cin >> vec.at(i);
  }
  
  for(int i = 0; i < N; i++){
    if(vec.at(i) % 2 == 0){
      a++;
      if(vec.at(i) % 3 == 0 || vec.at(i) % 5 == 0) a--;
    }
  }
  
  if(a == 0) cout << "APPROVED" << endl;
  else cout << "DENIED" << endl;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
sys.setrecursionlimit(900000)


N, Q = map(int, input().split())
graph = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
PX = [list(map(int, input().split())) for _ in range(Q)]

def dfs(p, s, checked, score):
    #print(p, s, score)
    ns = s + score[p]
    score[p] += s
    for q in graph[p]:
        if not checked[q]:
            checked[q] = True
            score = dfs(q, ns, checked, score)
    return score


def main():


    score = [0 for _ in range(N)]
    for p, x in PX:
        score[p-1] += x

    checked = [False for _ in range(N)]
    checked[0] = True
    
    ans = dfs(0, 0, checked, score)
    print(' '.join([str(a) for a in ans]))


if __name__ == "__main__":
    main()

Measured memory_bytes: 284080
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		sc.close();
		for (int i = 1; i <= b; i++) {
			if ((i * a) % b == c) {
				System.out.println("YES");
				return;
			}
		}
		System.out.println("NO");
	}
}

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

using namespace std;

#define rep(i, x)   for (__typeof(x) i = 0; i < x; i++)
#define mp             make_pair
#define pb             push_back
#define fi             first
#define se             second
#define sz(x)          (int)((x).size())
#define all(x)         (x).begin(), (x).end()
#define sci(x)         int x;       scanf("%d", &x);
#define scii(x, y)     int x, y;    scanf("%d %d", &x, &y);
#define sciii(x, y, z) int x, y, z; scanf("%d %d %d", &x, &y, &z);
#define TC(x)          sci(x); while(x --)
#define eprintf(...)   fprintf(stderr, __VA_ARGS__)
#define debug(x)       { cerr << #x << " = " << x << endl; }
#define repi(i, x)  for (__typeof(x) i = x-1; i >= 0; i --)
#define fore(itr, x)   for (__typeof(x.begin()) itr = x.begin(); itr != x.end(); itr ++)
#define forei(itr, x)  for (__typeof(x.end()) itr = x.end() - 1; itr != x.begin() - 1; itr --)
typedef long long      ll;
typedef pair<int, int> ii;
typedef pair<ii, int>  iii;
typedef vector<int>    vi;
typedef vector<ii>     vii;
typedef vector<iii>    viii;
typedef vector<vector<int> > vvi;
typedef pair<ll, ll>   pairl;
typedef vector<ll>     vl;
typedef vector<ll>     vll;
typedef vector<vector<ll> > vvl;
const   int            infi = numeric_limits<int>::max();
const   ll             infl = numeric_limits<ll>::max();
const   double         eps = 0;
const   int            ms  = 0;



int main()
{
    ios::sync_with_stdio(false);//endl->"\n"
    cin.tie(0);
    
    int N;
    cin >> N;
    vi B(N);
    rep(i, N)cin >> B[i];

    vi a;
    rep(i, N)a.pb(B[i]);
    vi ans;
    for(int i = 0; i < N; i++){
        int mai = -1;
        for(int j=0; j < a.size(); j++){
            if(a[j] == j+1){
                mai = max(mai, j);
            }
        }
        //debug(mai)
        if(mai == -1){
            cout << -1 << "\n";
            return 0;
        }
        ans.pb(mai+1);
        vi a_;
        rep(j, a.size()){
            if(j != mai)a_.pb(a[j]);
        }
        a = a_;

    }
    reverse(all(ans));
    rep(i, N)cout << ans[i] << "\n"; 
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>

using namespace std;

int main() {
	int n, m;
	int cost = 1001;
	cin >> n >> m;
	for (int i = 0; i < n; i++)
	{
		int c, t;
		cin >> c;
		cin >> t;
		if (t <= m)
			cost = min(cost, c);
	}
	if (cost != 1001) {
		cout << cost << endl;
		return 0;
	}
	cout << "TLE" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define ALL(x) (x).begin(),(x).end()
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 99999999999
#define PRINT(var) std::cout<<#var"= "<<var<<std::endl

using namespace std;
typedef long long  int ll;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

ll n,m;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >>n>>m;
  vector <ll> a(n);
  ll tmp;
  REP(i,m){
    cin >>tmp;
    a[tmp-1]++;
    cin >>tmp;
    a[tmp-1]++;
  }
  REP(i,n){
    cout <<a[i] <<endl;
  }
  

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>

#define PI 3.141592653589793238
#define INF 1050000000

using namespace std;



//cout << fixed << setprecision(15) << << endl;
//cout << << endl;

int main() {

	string a, b, c;

	cin >> a >> b >> c;

	char s, t, u;

	s = a[0] + ('A'-'a');
	t = b[0] + ('A' - 'a');
	u = c[0] + ('A' - 'a');

	char ans[4];

	ans[0] = s;
	ans[1] = t;
	ans[2] = u;
	ans[3] = '\0';

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
// Cursor jump numbers
// main @ 39
// global @ 35
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define ll long long int
#define MOD ((int)(1e9) + 7)

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string it;
  cin >> it;
  string yk;
  cin >> yk;
  cout << yk << it << '\n';
  return 0;
}



Measured memory_bytes: 256
#ifndef ONLINE_JUDGE
    #include "debug.cpp"
#endif

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define ar array

const int mxN = 3001;
vector<vector<int>> dp(mxN,vector<int>(mxN,0));

void solve(){
	int n;
	cin >> n;
	vector<int> arr(n);
	for(auto& e : arr) cin >> e;
	// print x - y
	for(int l = n-1; l >= 0; --l){
		for(int r = 0;r < n; ++r){
			if(l == r){
				dp[l][r] = arr[l];
			}else{
				dp[l][r] = max(arr[l]-dp[l+1][r], arr[r]-dp[l][r-1]);
			}
		}
	}
	cout << dp[0][n-1] << "\n";
}

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

    int TC = 1;
    while(TC--)
        solve();

    return 0;
}



Measured memory_bytes: 74092
import java.io.*;
import java.util.*;

public class Main {

	void submit() {
		int n = nextInt();
		int m = nextInt();
		int[][] a = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				a[i][j] = nextInt() - 1;
			}
		}
		
		int low = 0; // can't
		int high = n; // can
		
		outer: while (high - low > 1) {
			int mid = (low + high) >> 1;
			boolean[] ban = new boolean[m];
			int[] cnt = new int[m];
			
			int nonBanned = m;
			
			while (nonBanned > 0) {
				Arrays.fill(cnt, 0);
				for (int i = 0; i < n; i++) {
					int j = 0;
					while (ban[a[i][j]]) {
						j++;
					}
					cnt[a[i][j]]++;
				}
				boolean good = true;
				for (int i = 0; i < m; i++) {
					if (cnt[i] > mid) {
						good = false;
						ban[i] = true;
						nonBanned--;
					}
				}
				
				if (good) {
					high = mid;
					continue outer;
				}
			}
			
			low = mid;
		}
		
		out.println(high);
	}

	void preCalc() {

	}

	void stress() {

	}

	void test() {

	}

	Main() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		preCalc();
		submit();
		//stress();
		//test();
		out.close();
	}

	static final Random rng = new Random();

	static int rand(int l, int r) {
		return l + rng.nextInt(r - l + 1);
	}

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

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}

	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}
}


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

int main()
{
	string a;
	cin >> a;

	if (a[0] == a[1] &&a[1]== a[2] || a[1] == a[2]&&a[2] == a[3])
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}
	return 0;

}



Measured memory_bytes: 256
#include<stdio.h>

int main(){	
	int tate, yoko, menseki, syuu;
	
	scanf("%d %d", &tate, &yoko);
	
	menseki = tate * yoko;
	syuu = (tate + yoko) * 2;
	
	printf("%d %d\n", menseki,syuu);
	return 0;
}

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

int s[100];
int map[101][10001];
int ser(int N,int i,int count){
  if(map[i][count]!=-1){
    return map[i][count];
  }
  if(i==N){
    if(count%10==0){
      map[i][count]=0;
      return 0;
    }else{
      map[i][count]=count;
      return count;
    }
  }
  return map[i][count]=max(ser(N,i+1,count),ser(N,i+1,count+s[i]));
}

int main(){
  int N;
  cin >>N;
  for(int i=0;i<N;i++){
    cin >> s[i];
  }
  for(int i=0;i<101;i++){
    for(int j=0;j<10001;j++){
      map[i][j]=-1;
    }
  }
  cout << ser(N,0,0)<<endl;
}


Measured memory_bytes: 4224
using System;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] In = Console.ReadLine().Split(' ');
            int x = int.Parse(In[0]);
            int a = int.Parse(In[1]);
            if (a <= x) Console.WriteLine(10);
            else Console.WriteLine(0);
        }
    }
}


Measured memory_bytes: 27440
#include<stdio.h>
int main()
{
	int x;
	scanf("%d",&x);
	x%=7;
	switch(x){
	case 0:
		printf("thu\n");
		break;
	case 1:
		printf("fri\n");
		break;
	case 2:
		printf("sat\n");
		break;
	case 3:
		printf("sun\n");
		break;
	case 4:
		printf("mon\n");
		break;
	case 5:
		printf("tue\n");
		break;
	case 6:
		printf("wed\n");
		break;
	}
	return 0;
}



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

int main() {
    char b;
    cin >> b;

    if (b == 'A') {
        cout << 'T' << endl;
    } else if (b == 'C') {
        cout << 'G' << endl;
    } else if (b == 'G') {
        cout << 'C' << endl;
    } else {
        cout << 'A' << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<functional>
#include<string>
#include<iomanip>
#include<map>
#include<utility>
#include<string>
#include<unordered_map>
#include<queue>

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

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
int gcd(int a, int b){return b ? gcd(b, a%b) : a;}
int lcm(int a, int b){return a*b / gcd(a, b);}



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

    ll ans = 0, r = 0, l = 0;
    for(int l = 0; l < n; l++){
        if(l == r){
            int increase_r = r, decrease_r = r;
            
            while(increase_r+1 < n && a[increase_r] <= a[increase_r+1]){ //等値or増加
                increase_r++;
            }
            while(decrease_r+1 < n && a[decrease_r] >= a[decrease_r+1]){ //等値or減少
                decrease_r++;
            }
            ans++;
            // cout << "increase: " << increase_r << " decrease: " << decrease_r << endl;
            r = max(increase_r, decrease_r)+1;
            // cout << "right: " << r << endl;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3952
#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<cstdio>
#define x first.first
#define y first.second
#define r second.first
#define color second.second

using namespace std;

typedef pair<double,double> P;
typedef pair<P,P> C;

bool check(C a,C b){
  return a.r+b.r>sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));
}
 
int count(int bits){
  bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
  bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
  bits =(((bits >> 4) + bits) & 0x0f0f0f0f);
  bits += bits >> 8;
  return (bits + (bits >> 16)) & 0xff;
}
 
bool dp[(1<<25)];
 
int main(void){
 
	int n;
	while(cin >> n,n){
		C c[25];
		for(int i=0;i<n;i++){
			//cin >> c[i].x >> c[i].y >> c[i].r >> c[i].color;
			scanf("%lf %lf %lf %lf",&c[i].x,&c[i].y,&c[i].r,&c[i].color);
		}
		
		fill(dp,dp+(1<<n),false);
		dp[(1<<n)-1]=true;
		int ans=0;
		
		for(int S=(1<<n)-1;S>=0;S--){
			if(!dp[S])continue;
			for(int i=0;i<n;i++){
				for(int j=i+1;j<n;j++){
					
					int nx=S;
					
					if(!(S>>i&1) || !(S>>j&1))continue;
					if(c[i].color!=c[j].color)continue;
					
					for(int k=0;k<n;k++){
						if(!(S>>k&1))continue;
						if((k<i && check(c[i],c[k]))||(k<j && check(c[j],c[k])))goto end;
					}
					
					nx&=~(1<<i);
					nx&=~(1<<j);
					dp[nx]|=dp[S];
					end:;
				}
			}
			if(dp[S])ans=max(ans,n-count(S));
		}
		cout << ans << endl;
	}
   
  return 0;
}

Measured memory_bytes: 19688
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define ll long long

int main(){

	// #ifndef ONLINE_JUDGE
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	// #endif

	ll a,l;
	cin>>a>>l;

	if(l<a*2 || l>a*4)
		cout<<"No";
	else if(l%2==0)
		cout<<"Yes";
	else
		cout<<"No";
	// fclose(stdin);
	// fclose(stdout);
}

Measured memory_bytes: 3040
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <math.h>
#include <stack>
using namespace std;
typedef long long ll;

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n,m; cin >> n >> m;
	vector<bool> used(n,0);
	stack<int> st;
	for(int i=0;i<m;i++){
		int s; cin >> s;
		s--;
		st.push(s);
	}
	while(st.size()){
		int p=st.top();
		if(!used[p]){
			printf("%d\n",p+1);
			used[p]=1;
		}
		st.pop();
	}
	for(int i=0;i<n;i++){
		if(!used[i]){
			printf("%d\n",i+1 );
		}
	}
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#define int long long
int fun(int n)
{
	return  n*(n-1)/2;
}
int fun1(int m)
{
	return m*(m-1)/2;
}
int32_t main()
{
	int n, m;
	cin>>n>>m;
	cout<<fun(n)+fun1(m);

	
}


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

vector<string> constant[2],other[2];

void rekkyo(string &s,vector<string> &vec1,vector<string> &vec2){
	int op = 0;
	string tmp = "";
	for(int i = 0;i < s.length();i++){
		if(s[i] == '\"'){
			(op ? vec1 : vec2).push_back(tmp);
			tmp = "";
			op = !op;
		}else tmp += s[i];
	}
	if(tmp != "") (op ? vec1 : vec2).push_back(tmp);
}

signed main(){
	string s1,s2;
	while(cin >> s1,s1 != "."){
		cin >> s2;
		for(int i = 0;i < 2;i++){
			constant[i].clear();
			other[i].clear();
		}
		rekkyo(s1,constant[0],other[0]);
		rekkyo(s2,constant[1],other[1]);
		int difc = 0,difo = 0;
		if(constant[0].size() != constant[1].size()) difc = 10;
		else{
			for(int i = 0;i < constant[0].size();i++){
				if(constant[0][i] != constant[1][i]) difc++;
			}
		}
		if(other[0].size() != other[1].size()) difo = 10;
		else{
			for(int i = 0;i < other[0].size();i++){
				if(other[0][i] != other[1][i]) difo++;
			}
		}
		if(!difo && !difc) cout << "IDENTICAL" << endl;
		else if(!difo && difc == 1) cout << "CLOSE" << endl;
		else cout << "DIFFERENT" << endl;
	}
}


Measured memory_bytes: 3164
S = int(input())  # これをABCDとしよう（A,B,C,Dはそれぞれ1桁の非負整数）
AB = S // 100
CD = S-AB*100
if AB == 0 or CD == 0:
    if 1 <= AB <= 12:
        print("MMYY")
    elif 1 <= CD <= 12:
        print("YYMM")
    else:
        print("NA")

elif 13 <= AB and 13 <= CD:
    print("NA")
elif AB <= 12 and CD <= 12:
    print("AMBIGUOUS")
elif 13 <= AB:
    print("YYMM")
else:
    print("MMYY")


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
const int N=510;
typedef long long ll;
int dp[N/2][N],mod,jc[N],n,L[N],R[N],ans,id[N];
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n>>mod;
	jc[0]=1;
	for(int i=1;i<=2*n;++i)jc[i]=(ll)jc[i-1]*i%mod;
	for(int i=0;i<2*n;++i){
		for(L[i]=0;i*i+L[i]*L[i]<n*n;++L[i]);
		for(R[i]=1;i*i+(2*n-R[i])*(2*n-R[i])>2*n*2*n;++R[i]);--R[i];
		id[i]=i;
	}
	for(int i=n;i<2*n;++i)L[i]=2*n-R[i];
	for(int i=0;i<2*n;++i)
		for(int j=i+1;j<2*n;++j)
			if(L[i]<L[j]||(L[i]==L[j]&&R[i]>R[j])){swap(L[i],L[j]);swap(R[i],R[j]);swap(id[i],id[j]);}
	for(int i=n;i<=2*n;++i){
		memset(dp,0,sizeof dp);dp[0][0]=1;
		int cnt=0,lim1=0,lim2=0;
		for(int j=0;j<2*n;++j)if(id[j]>=n){
			++cnt;lim1=min(lim1+1,i);
			for(int l=lim2;l>=0;--l){
				for(int k=lim1;k>=cnt;--k)
					dp[l][k]=dp[l][k-1]?(ll)dp[l][k-1]*(L[j]-(i-k))%mod:0;
				dp[l][cnt-1]=0;
			}
		}else{
			lim1=min(lim1+1,i);lim2=min(lim2+1,2*n-i);
			for(int l=lim2;l>=0;--l)for(int k=lim1;k>=cnt;--k)
				{
					if(dp[l][k-1])dp[l][k]=(dp[l][k]+(ll)dp[l][k-1]*(L[j]-(i-k)))%mod;
					if(l&&dp[l-1][k])dp[l][k]=(dp[l][k]+(ll)dp[l-1][k]*(R[j]-l+1))%mod;
				}
		}
		for(int j=0;j<=2*n-i;++j){
			int ret=(ll)dp[j][i]*jc[2*n-i-j]%mod;
			if((i-n+j)&1)ans=(ans-ret+mod)%mod;
			else ans=(ans+ret)%mod;
		}
	}
	cout<<ans<<'\n';
	return 0;
}

Measured memory_bytes: 768
#include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <set>
#include <string>
#include <vector>

using namespace std;

int main()
{
    int N, M, X, Y;
    cin >> N >> M >> X >> Y;
    vector<int> Xs(N), Ys(M);
    for (int i = 0; i < N; ++i) cin >> Xs[i];
    for (int i = 0; i < M; ++i) cin >> Ys[i];
    int maxX = *max_element(Xs.begin(), Xs.end());
    int minY = *min_element(Ys.begin(), Ys.end());
    for (int z = maxX + 1; z <= minY; ++z)
    {
        if (X < z && z <= Y)
        {
            cout << "No War" << endl;
            return 0;
        }
    }
    cout << "War" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using Graph = vector<vector<LL>>;

long long gcd(long long a, long long b){
  if (b==0) return a;
  else return gcd(b,a%b);
}
long long chmax(long long a,long long b){
  a = max(a,b);
}
long long chmin(long long a, long long b){
  a = min(a,b);
}
vector<bool> seen;
void dfs(const Graph &G, int v) {
    seen[v] = true;

    for (auto next_v : G[v]) { 
        if (seen[next_v]) continue;
        dfs(G, next_v);
    }
}



int main() {
  LL n,k=-1,sum=0,a=0,b=0,c=0,d=0,ans=0;
  LL MOD = 1000000007;
  LL INF = 1LL << 60;
  string S="",T="",U="";
  cin >> n;
  cout << n/2 + n%2<< endl;
}

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

using namespace std;

#define ll long long 
#define REPL(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define radrad(a)  180.0 * a / M_PI
#define pow(x) x*x
static const int MAX = 10010;
static const ll INFTY = 1e12;
static const ll NUMMAX = 1000000007;
static const ll MOD = 1000000007;
 #define LOOP 10000000



int main() {

  int N, M;

  cin >> N >> M;

  if( N == M ){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  

  return 0;
}
/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         pass System Test!
*/


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
typedef long long ll;
typedef pair<int64_t,int64_t> pll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define ALL(a) begin(a),end(a)
#define sz(s) (s).size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
int n;
int sam[]={7,14,28,15,30,31};

vector<vector<int> >a(11,vector<int>(5));
void reset()
{
    REP(k,5)
    {
        REP(i,n)
        {
            if(a[i][k]==0)
            {
                for(int j=i;j>0;j--)
                {
                    swap(a[j][k],a[j-1][k]);
                }
            }
        }
    }
}


int main()
{
    while(cin>>n,n)
    {
        REP(i,n)REP(j,5)cin>>a[i][j];
        bool flag=1;
        int sum=0;
        while(flag)
        {
            flag=0;
            REP(i,n)
            {
                int now=a[i][0];int times=1;int last;
                rep(j,1,5)
                {
                    if(a[i][j]==a[i][j-1])
                    {
                        times++;
                    }else if(times>=3)
                    {
                        last=j-1;
                        break;
                    }else{
                        now=a[i][j];
                        times=1;
                    }
                    if(j==4)last=j;
                }
                if(times>=3&&now!=0)
                {
                    sum+=times*now;
                    flag=1;
                    for(int k=last;k>last-times;k--)a[i][k]=0;
                    //cout<<"!!"<<last<<"!!"<<endl;
                }
            }
            reset();
            //cout<<"..................."<<endl;REP(i,n){REP(j,5)cout<<a[i][j]<<" ";cout<<endl;}
        }
        cout<<sum<<endl;
    }
}


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

using int64 = long long;

int main() {
    int64 N, K;
    cin >> N >> K;

    if (K == 0) {
        cout << N * N << endl;
        return 0;
    }

    int64 ans = 0;
    for (int b = K + 1; b <= N; b++) {
        // aの数を数え上げる
        int64 cycle = N / b;    // [K, b)がcycle回登場する
        ans += (b - K) * cycle;
        ans += max(0LL, N % b - K + 1);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
/************************Code by Hardik Aggarwal!!!!***********************************/

#include<bits/stdc++.h>
using namespace std;

#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL); 

#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define pu push
#define pp pop_back
#define in insert
#define ld long double
#define endl '\n'
#define debug cout << "Hold right there sparky.....\n";
#define forn(low,high,i) for(i=low;i<high;i++)
#define forrev(high,low,i) for(i = high; i>= low;i--)
#define trace(x) cerr << #x << ": " << x << " " << endl;

typedef long long int ll;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
const ll mod =998244353;

bool comp(pll p1,pll p2)
{
    if(p1.ff==p2.ff)
        return p1.ss<p2.ss;

    return p1.ff<p2.ff;
}

int main()
{
   
    IOS
    ll n;
    cin>>n;
    pll a[n];
    for(ll i=0;i<n;i++)
    {
        cin>>a[i].ff;
        a[i].ss=i+1;
    }
    sort(a,a+n);
    for(ll i=0;i<n;i++)
    {
        cout<<a[i].ss<<" ";
    }


    




    
    
}
    
 
    
    



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

using namespace std;
using ll = long long;
using pii = pair<int, int>;


class UnionFindTree{
private:
  // indexの数の親ノード(ある集合の親を見つけたいときはここを直接参照せず、findを使う)
  vector<int> par;
  // indexを根とする木のランク
  vector<int> rank;
  // 集合のサイズ
  vector<int> cnts;
  // 木の最大値
  int treeSize;
public:
  UnionFindTree(int initTreeSize = 1000){
    // 引数で与えられた値を最大格納数とするUnionFindTreeの作成
    treeSize = initTreeSize;
    init(initTreeSize);
  }
  void init(int sz){
    par.clear(),rank.clear(),cnts.clear();
    treeSize=sz;
    for(int i = 0; i < sz; i++){
      par.push_back(i);
      rank.push_back(0);
      cnts.push_back(1);
    }
  }
  // 与えられた数が格納されている木のルートを探索
  int find(int x){  
    if(par[x] == x)return x;
    else return par[x] = find(par[x]);
  }
  // 和集合をとる。ただしここでは各集合の親の付け替えは起こらない
  void unite(int x,int y){
    x = find(x);
    y = find(y);
    if(x == y)return;
    if(rank[x] < rank[y]){
      par[x] = y;
      cnts[y]+=cnts[x];
    }
    else{
      par[y] = x;
      cnts[x]+=cnts[y];
      if(rank[y] == rank[x])rank[x]++;
    }
  }
  // xの属する集合のサイズ
  int getCnt(int x){
    return cnts[find(x)];
  }
  bool same(int x,int y){
    return find(x) == find(y);
  }
    
};


int N;
int X[100010];
int Y[100010];
UnionFindTree uft(100010);

int main(){
    
    cin >> N;
    map<int, vector<int> > xs;
    map<int, vector<int> > ys;
    for(int i = 0; i < N; i++){
        cin >> X[i] >> Y[i];
        xs[X[i]].push_back(i);
        ys[Y[i]].push_back(i);
    }
    for(auto p : xs){
        auto &v = p.second;
        for(int i = 1; i < (int)v.size(); i++){
            uft.unite(v[0], v[i]);
        }
    }
    for(auto p : ys){
        auto &v = p.second;
        for(int i = 1; i < (int)v.size(); i++){
            uft.unite(v[0], v[i]);
        }
    }
    
    // 同じ値に属するもの同士で分類
    map<int, vector<int> > cls;
    for(int i = 0; i < N; i++){
        cls[uft.find(i)].push_back(i);
    }

    ll ans = 0;
    for(auto p : cls){
        set<int> xs, ys;
        auto &v = p.second;
        for(int idx : v){
            xs.insert(X[idx]);
            ys.insert(Y[idx]);
        }
        ans += (ll)xs.size() * ys.size() - (int)v.size();
    }
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 18668
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
typedef long long ll;
ll MOD = 1e9+7;

using namespace std;

int main()
{
	int n;
	string s[2];
	ll ans=1;
	bool tate;
	
	cin>>n;
	cin>>s[0];
	cin>>s[1];

	for(int i=0;i<n;i++)
	{
		if(i==0)
		{
			if(s[0][i]==s[1][i])
			{
				ans*=3;
				tate=true;
			}else{
				ans*=6;
				i++;
				tate=false;
			}
		}else{
			if(s[0][i]==s[1][i])
			{
				if(tate)
					ans*=2;
				else
					ans*=1;
				tate=true;
			}else{
				if(tate)
					ans*=2;
				else
					ans*=3;
				i++;
				tate=false;
			}
		}
		ans%=MOD;
	}
	cout<<ans<<endl;
	return 0;
}

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<string> pic(H);
  for (int k = 0; k < H; k++){
    cin >> pic.at(k);
  }
  
  for (int i = 0; i < W+1; i++)
    cout << "#";
  cout << "#" << endl;
  
  for (int i = 0; i < H; i++){
    cout << "#";
    for (int j = 0; j < W; j++)
      cout << pic.at(i).at(j);
    cout << "#" << endl;
  }
  
  for (int i = 0; i < W+1; i++)
    cout << "#";
  cout << "#" << endl;
}


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

int main(){
  int X,Y;
  string ans = "No";
  cin >> X >> Y;
  for(int i = 0; i <= X; i++){
    if(i * 4 + (X - i) * 2 == Y){
      ans = "Yes";
      break;
    }
  }
  cout << ans << endl;
}

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

int main() {
	int N, M, K; cin >> N >> M >> K;
	if (K % M == 0 || K % N == 0) cout << "Yes" << endl;
	else {
		for (int i = 0; i <= N; i++) {
			if (N - 2 * i != 0) {
				if ((K - (i * M)) % (N - (2 * i)) == 0) {
					if ((K - (i * M)) / (N - (2 * i)) < M && (K - (i * M)) / (N - (2 * i)) >= 0) {
						cout << "Yes" << endl;
						return 0;
					}
				}
			}
		}
		cout << "No" << endl;
	}
}

Measured memory_bytes: 3624
while True:
    m, f, r = map(int,input().split()) 
    if m == -1 and f == -1 and r == -1:
        break
    if m == -1 or f == -1:
      print("F")
    elif m + f >= 80:
      print("A")
    elif m + f >= 65:
      print("B")
    elif m + f >= 50:
      print("C")
    elif m + f >= 30:
      if r >= 50:
           print("C")
      else: 
           print("D")
    else:
      print("F")


Measured memory_bytes: 5592
#include<iostream>
#include<math.h>
#include<cstdio>
using namespace std;

int cul(int k,int n)
{
    int cnt=0;
    while(n<k){
        n = n*2;
        cnt++;
    }
    return cnt;
}

int main()
{
    double n,k;
    cin>>n>>k;
    double res=0.0;
    for(int i=1;i<=n;i++){
        //cout << (1/n)*pow(0.5,cul(k,i)) << endl;
        res += (1/n)*pow(0.5,cul(k,i));
    }
    printf("%.11lf\n",res);
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int m=0;
		for(int i = 0;i<3;i++){
			if((N%10)!=7){
				N = (N-(N%10))/10;
				m++;
			}			
		else{
    		System.out.println("Yes");
			break;
        }
		if(m==3){
			System.out.println("No");
		}
		}
		}
	}

Measured memory_bytes: 35820
#include<stdio.h>
#include<math.h>
int main()
{
    int n,i,a;
    while(~scanf("%d",&n))
{
        i=1;
      while (i)
        {
            a=pow(2.0,i);
            if (a>n)
            {
                printf("%d\n",a/2);
                break;
            }
            if (a==n)
            {
                printf("%d\n",a);
                break;
            }
            i++;
        }
    }

}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
template<typename T> inline T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }







int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    
    
    // 解説pdf わかりやすい
    
    int n;
    cin >> n;
    
    vector<int> x(n);
    pii mmax = pii(-inf, -1), mmin = pii(inf, -1);
    
    rep(i, n) {
        cin >> x[i];
        chmin(mmin, pii(x[i], i));
        chmax(mmax, pii(x[i], i));
    }
    
    // 基本方針
    // まず非負数列にする
    // そしたら累積和で単調非減少
    
    cout << n + (n - 1) << endl;
    
    if (abs(mmax.F) > abs(mmin.F)) {
        
        rep(i, n) {
            cout << mmax.S + 1 << " " << i + 1 << endl;
            x[i] += x[mmax.S];
        }
        rep(i, n - 1) {
            cout << i + 1 << " " << i + 2 << endl;
            x[i + 1] += x[i];
        }
    } else { // すべて0以下の数列にして逆累積和
        
        rep(i, n) {
            cout << mmin.S + 1 << " " << i + 1 << endl;
            x[i] += x[mmin.S];
        }
        for (int i = n - 2; i >= 0; --i) {
            cout << i + 2 << " " << i + 1 << endl;
            x[i] += x[i + 1];
        }
    }

    // rep(i, n) cout << x[i] << " "; cout << endl;
    
    
    
    
    
    
}


Measured memory_bytes: 256
// 1_4_C

#include <iostream>
using namespace std;

int main(){
  int a, b;
  char op;
  while(true){
    cin >> a >> op >> b;
    switch(op){
    case '+':
      cout << a + b << endl;
      break;
    case '-':
      cout << a - b << endl;
      break;
    case '*':
      cout << a * b << endl;
      break;
    case '/':
      cout << a / b << endl;
      break;
    default:
      return 0;
    }
  }
}

Measured memory_bytes: 3100
#include<bits/stdc++.h>
using namespace std;
long long i,j,n,m,mas[200005],ab[200005],l,r,c,rez;
int main()
{
    std::cin.sync_with_stdio(false);
    std::cin.tie(0);
    cin >> n;
    cin >> mas[0];
    ab[0]=mas[0];
    i=1;
    while (i<n)
    {
        cin >> mas[i];
        ab[i]=mas[i]+ab[i-1];
        i++;
    }
    l=0;
    r=n-1;
    c=1;
    rez=1000000000000000000;
    while (c<n-1)
    {
        while (ab[l+1]<ab[c]-ab[l+1])
        {
            l++;
        }
        while (ab[n-1]-ab[r-2]<ab[r-2]-ab[c])
        {
            r--;
        }
        while (ab[n-1]-ab[r]>ab[r]-ab[c])
        {
            r++;
        }
        rez=min(rez,max(max(ab[l],ab[c]-ab[l]),max(ab[r-1]-ab[c],ab[n-1]-ab[r-1]))-min(min(ab[l],ab[c]-ab[l]),min(ab[r-1]-ab[c],ab[n-1]-ab[r-1])));
        rez=min(rez,max(max(ab[l+1],ab[c]-ab[l+1]),max(ab[r-1]-ab[c],ab[n-1]-ab[r-1]))-min(min(ab[l+1],ab[c]-ab[l+1]),min(ab[r-1]-ab[c],ab[n-1]-ab[r-1])));
        rez=min(rez,max(max(ab[l],ab[c]-ab[l]),max(ab[r-2]-ab[c],ab[n-1]-ab[r-2]))-min(min(ab[l],ab[c]-ab[l]),min(ab[r-2]-ab[c],ab[n-1]-ab[r-2])));
        rez=min(rez,max(max(ab[l+1],ab[c]-ab[l+1]),max(ab[r-2]-ab[c],ab[n-1]-ab[r-2]))-min(min(ab[l+1],ab[c]-ab[l+1]),min(ab[r-2]-ab[c],ab[n-1]-ab[r-2])));
        rez=min(rez,max(max(ab[l],ab[c]-ab[l]),max(ab[r]-ab[c],ab[n-1]-ab[r]))-min(min(ab[l],ab[c]-ab[l]),min(ab[r]-ab[c],ab[n-1]-ab[r])));
        rez=min(rez,max(max(ab[l+1],ab[c]-ab[l+1]),max(ab[r]-ab[c],ab[n-1]-ab[r]))-min(min(ab[l+1],ab[c]-ab[l+1]),min(ab[r]-ab[c],ab[n-1]-ab[r])));
        c++;
    }
    cout << rez;
    return 0;
}


Measured memory_bytes: 3328
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
// numeric_limits<int>::max()

int main()
{
    ll N;
    cin >> N;
    vector<ll> A(N);
    ll minAbs = abs(numeric_limits<ll>::max());
    ll sum = 0;
    ll numNegative = 0;
    bool zeroFound = false;
    for (int i = 0; (i < N); ++i) {
        cin >> A[i];
        minAbs = min(minAbs, abs(A[i]));
        if (A[i] == 0)
            zeroFound = true;
        else if (A[i] < 0)
            numNegative++;
        sum += abs(A[i]);
    }
    bool numEven = (numNegative % 2 == 0) ? true : false;
    if (zeroFound || numEven)
        cout << sum << endl;
    else
        cout << sum - minAbs * 2 << endl;
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define fastio     ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define all(x)     (x).begin() , (x).end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define endl       '\n'
#define MAX        1000000
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
typedef long long int ll;
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}


const ll mod = 1e9+7;
const double eps = 1e-9;



void solve(){
    int n;
    cin>>n;
    ll arr[n];
    bool flag=false;
    for(int i=0;i<n;++i) {
        cin>>arr[i];
        flag|=(arr[i]==0);
    }
    if(flag) {
        cout<<0;
        return;
    }
    ll ans=1;
    const double N=1e18;
    long double x=1;
    for(int i=0;i<n;++i) {
        x*=arr[i];
        if(x>N) {
            cout<<-1;
            return;
        }
        ans*=arr[i];
    }
    cout<<ans;
}





int main(){
    fastio
    int test=1;
    while(test--)
        solve();
    return 0;
}


Measured memory_bytes: 4392
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a) for(int i=0;i<(a);i++)
const ll MOD=1000000007;
//const ll MOD=998244353;

ll d[303][303],d2[303][303];
int G[303][303];
ll INF=1e15;

int main(){
  int N,M,L; cin>>N>>M>>L;
  rep(i,N){
    rep(j,N) d[i][j]=d2[i][j]=INF;
    d[i][i]=d2[i][i]=0;
  }
  rep(i,M){
    int A,B,C; cin>>A>>B>>C; A--,B--;
    d[A][B]=d[B][A]=C;
  }
  rep(k,N) rep(i,N) rep(j,N)
    d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
  
  rep(i,N) rep(j,N)
    if(d[i][j]<=L) d2[i][j]=1;
  
  rep(k,N) rep(i,N) rep(j,N)
    d2[i][j]=min(d2[i][j],d2[i][k]+d2[k][j]);
  
  int Q; cin>>Q;
  while(Q--){
    int S,T; cin>>S>>T; S--,T--;
    if(d2[S][T]==INF) cout<<"-1\n";
    else cout<<d2[S][T]-1<<endl;
  }
  return 0;
}

Measured memory_bytes: 1920
import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

n = int(input())
inputs = list(map(int, input().split(' ')))
for i in range(len(inputs)):
    if i == 0:
        x = lcm(inputs[0], inputs[1])
        continue
    if i == 1:
        continue
    x = lcm(x, inputs[i])
x -= 1
s = 0
for i in inputs:
    s += x % i
print(s)


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

int main()
{
  long long a,b,c,k;
  cin>>a>>b>>c>>k;
  long long ans=0;
  if(k<=a){
  	ans = k;
  }else if(k<=a+b){
  	ans = a;
  }else{
  	ans = a - (k-a-b);
  }
  cout<<ans<<endl;
return 0;
}



Measured memory_bytes: 3584
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer([]byte{}, 1000000)

	t := getString()
	s := make([]byte, len(t))

	for i, v := range t {
		if v == '?' {
			s[i] = 'D'
		} else {
			s[i] = byte(v)
		}
	}

	out(string(s))
}


Measured memory_bytes: 3028
#include <bits/stdc++.h>
 
 
using namespace std;
 
#define ll long long
#define ul unsigned long long
#define snd second
#define fst first
 

ll a,b,c,d,e,f,n,m;

int main(){
    std::ios::sync_with_stdio(false);
    cin >> a >> b;
    ll cnt = 0;
    while(b--){
        ll x; cin >> x;
        cnt += x;
    }
    if(cnt >= a) cout << "Yes";
    else cout << "No";
    return 0;
}

Measured memory_bytes: 256
/**
       **********    ************
	  Author : Avi J Patel
	  University : DAIICT
       **********    ************
**/
#include<bits/stdc++.h>
#include<fstream>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define pf push_front
#define mp make_pair 
#define mt make_tuple
#define ff first
#define ss second
#define si size()
#define MOD 1000000007
#define Mod 998244353
#define N 200001
#define large 1844674407370955161
#define For(i,m,n) for(long long i=m;i<n;i++)
#define st(x) sort(x.begin(),x.end())
#define re(x,i) reverse(x.begin()+i,x.end())
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);srand(time(NULL));
#define min_heap priority_queue<int, vector<int>, greater<int>>
#define max_heap priority_queue<int>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> 

bool sortbysec(const pair<int,int> &a, const pair<int,int> &b) 
{ 
    if(a.ss < b.ss) return true; 
    else if(a.ss==b.ss) return a.ff<b.ff;
	else return false;
}
bool sortbyboth(const pair<int,int> &a, const pair<int,int> &b)
{
	if(a.ff<b.ff) return true;
	else return false;
} 
bool sortff_resortss(const pair<int,int> &a, const pair<int,int> &b)
{
	if(a.ff<b.ff) return true;
	else if(a.ff==b.ff) return a.ss>b.ss;
	else return false;
}
bool sortbystring(const string &a, const string &b)
{
	string c=a+b;
	string d=b+a;
	if(c>=d) return true;
	else return false;
}

ll modi(ll a, ll m) 
{ 
    ll m0 = m; 
    ll y = 0, x = 1; 
    if (m == 1) 
      return 0; 
    while (a > 1) 
    { 
        ll q = a / m; 
        ll t = m; 
        m = a % m, a = t; 
        t = y; 
        y = x - q * y; 
        x = t; 
    } 
    if (x < 0) 
       x += m0; 
    return x; 
} 
ll Logn(ll  n, ll r) 
{ 
    return (n > r - 1) ? 1 + Logn(n / r, r) : 0; 
} 

ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;      // Initialize result 
    x = x % p;  // Update x if it is more than or 
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1; // y = y/2 
        x = (x*x) % p; 
    } 
    return res; 
} 

  
int main()
{
	FAST
	int t=1;
//	cin>>t;
	while(t--)
	{	
		ll n;
		cin>>n;
		vector<ll> a(n),b(n);
		map<ll,ll> m;
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			m[a[i]]++;
			b[i]=a[i];
		}
		sort(a.begin(),a.end());
		ll cnt=1;
		ll i=0;
		ll sum=0;
		while(i<n-1)
		{
			while(i<n-1 && a[i]==a[i+1])
			{
				cnt++;
				i++;
			}
			
			sum+=((cnt*(cnt-1))/2);
			cnt=1;
			i++;
		}
		for(ll i=0;i<n;i++)
		{
			ll r=m[b[i]];
//				cout<<r<<endl;
				cout<<(sum-((r*(r-1))/2) + (((r-1)*(r-2))/2))<<endl;
		}
	}
	return 0;
}
















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

int t[100][50];
int dp[100][50];
string str;
int id,size;
int line;

int get_dp(int y,int x){
  if(0<=y&&y<100&&0<=x&&x<50)return dp[y][x];
  else return 0;
}

bool check(){
  return (id<size);
}

int get_int(){
  int res=0;
  while(1){
    if('0'<=str[id]&&str[id]<='9'){
      res*=10;
      res+=str[id]-'0';
      id++;
    }else{
      id++;
      break;
    }
  }
  return res;
}

int main(){
  int I=0,J,ans=0;


  for(int i=0;i<100;i++)
    for(int j=0;j<50;j++)
      t[i][j]=dp[i][j]=0;

  while(cin>>str){
    J=0;size=str.size();id=0;
    while(check()){
      t[I][J]=get_int();
      //cout<<t[I][J]<<endl;
      J++;
    }
    I++;
  }
  line=I/2;
  for(int i=0;i<100;i++){
    for(int j=0;j<50;j++){
      //cout<<t[i][j]<<" ";
      if(i<=line)dp[i][j]=max(get_dp(i-1,j-1),get_dp(i-1,j));
      else dp[i][j]=max(get_dp(i-1,j+1),get_dp(i-1,j));
      dp[i][j]+=t[i][j];
      ans=max(ans,dp[i][j]);
      //printf("%2d ",dp[i][j]);
    }
    //cout<<endl;
  }
  cout<<ans<<endl;

  
  return 0;
}

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

using namespace std;
typedef long long ll;

#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back
#define lp(i,s,f) for(ll i = s; i < ll(f); i++)
#define inF freopen("input.in", "r", stdin);
#define outF freopen("output.in", "w", stdout);
#define endl '\n'
#define MOD 1000000007
#define mm(arr) memset(arr, 0, sizeof(arr))

int main(){
    FAST
    int n;
    cin >> n;
    pair<int, int> arr[n];
    for(int i = 0; i < n; i++){
        cin >> arr[i].first;
        arr[i].second = i;
    }
    sort(arr, arr + n);
    int ans[n];
    for(int i = 0; i < n - 1; i++){
        ans[arr[i].second] = arr[n - 1].first;
    }
    ans[arr[n - 1].second] = arr[n - 2].first;
    for(int i = 0; i < n; i++){
        cout << ans[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 5976
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int inf = 0x7ffffff;
const int mod = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i, n) cin >> a[i];
	vector<int> p(n);
	for (int i = n - 1; i >= 0; --i) {
		int tmp = 0;
		for (int j = i + (i + 1); j < n; j += (i + 1)) {
			tmp += p[j];
		}
		if (tmp % 2 != a[i]) {
			p[i] = 1;
		}
	}
	vector<int> res;
	int ans = 0;
	rep(i, n) {
		if (p[i]) {
			ans++;
			res.emplace_back(i + 1);
		}
	}
	cout << ans << endl;
	for (int c : res) {
		if (c == res.back()) {
			cout << c << endl;
		}
		else {
			cout << c << ' ';
		}
	}
	return 0;
}


Measured memory_bytes: 3192
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
    int h, w;
    cin >> h >> w;
    vector<string> s(h);
    for(int i = 0; i < h; i++)
    {
        cin >> s[i];
    }
    //各行(列)に何個障害物があるかを累積和で記録する
    vector<vector<int>> cumh(h, vector<int>(w, 0));
    vector<vector<int>> cumw(w, vector<int>(h, 0));
    for(int i = 0; i < h; i++)
    {
        if(s[i][0] == '#') cumh[i][0] = 1;
        for(int j = 1; j < w; j++)
        {
            if(s[i][j] == '#')
            {
                cumh[i][j] = cumh[i][j - 1] + 1;
            }else{
                cumh[i][j] = cumh[i][j - 1];
            }
        }
    }
    for(int i = 0; i < w; i++)
    {
        if(s[0][i] == '#') cumw[i][0] = 1;
        for(int j = 1; j < h; j++)
        {
            if(s[j][i] == '#')
            {
                cumw[i][j] = cumw[i][j - 1]  + 1;  
            }else{
                cumw[i][j] = cumw[i][j - 1];
            }
        }
    }
    //各マスにランプを置いたときに照らせるマスの個数を計算
    //それぞれの方向で累積和が変化する場所を二分探索で計算
    //比較関数
    auto lower = [](int l, int r, vector<int> &a, int target)
    {
        while (l < r - 1)
        {
            int m = (r + l) / 2;
            if(a[m] < target)
            {
                l = m;
            }else{
                r = m;
            }
        }
        return r;
    };
    int result = 0;
    for(int i = 0; i < h; i++)
    {
        for(int j = 0; j < w; j++)
        {
            //右方向
            int target_right = upper_bound(cumh[i].begin(), cumh[i].end(), cumh[i][j]) - cumh[i].begin();
            //左方向
            int target_left = lower(-1, w - 1, cumh[i], cumh[i][j]);
            //上方向
            int target_up = lower(-1, h - 1, cumw[j], cumw[j][i]);
            //下方向
            int target_down = upper_bound(cumw[j].begin(), cumw[j].end(), cumw[j][i]) - cumw[j].begin();
            //変化するところは障害物があるところ
            int total = 0;
            if(s[i][j] != '#')
            {
                if (s[target_up][j] == '#')
                {
                    total += (j - target_up - 1);
                }
                else
                {
                    total += (j - target_up);
                }
                if(s[i][target_left] == '#')
                {
                    total += (i - target_left - 1);
                }else
                {
                    total += (i - target_left);
                }
                total += (target_right - j - 1) + (target_down - i - 1) + 1;
            }
            result = max(result , total);
        }
    }
    cout << result << endl;
}

Measured memory_bytes: 37760
#include<stdio.h>
int main(void){
	int amount,coins;
	scanf("%d",&amount);
	while(amount!=0){
		coins=0;
		amount=1000-amount;
		coins+=amount/500;
		coins+=(amount%500)/100;
		coins+=(amount%100)/50;
		coins+=(amount%50)/10;
		coins+=(amount%10)/5;
		coins+=amount%5;
		printf("%d\n",coins);
		scanf("%d",&amount);
	}
	return 0;
}

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

int main() {
  int a,b,ans = 0;
  cin >> a >> b;
  if(a > b) {
    ans += a;
    a--;
  }else {
    ans += b;
    b--;
  }
  if(a > b) {
    ans += a;
    a--;
  }else {
    ans += b;
    b--;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256