akhauriyash/Code-Regression huggingface dataset:
N = int(input())
Red = dict()
Redyset = set()
for _ in range(N):
    a,b = map(int,input().split())
    Red[b] = a
    Redyset.add(b)
Blue = dict()
Bluexset = set()
for _ in range(N):
    c,d = map(int,input().split())
    Blue[c] = d
    Bluexset.add(c)
Ans = 0
for i in range(N):
    Blx = min(Bluexset)
    Bluexset.remove(Blx)
    Bly = Blue.pop(Blx)
    Ymax = -1
    for Rey in Redyset:
        if Blx > Red[Rey] and Bly > Rey:
            Ymax = max(Ymax,Rey)
    if Ymax != -1:
        Redyset.remove(Ymax)
        Rey = Red.pop(Ymax)
        Ans +=1
print(Ans)

Measured memory_bytes: 9236
<?php
  fscanf(STDIN,"%d %d %d",$n,$m,$c);
  $b = explode(" ",trim(fgets(STDIN)));
  $count = 0;
  for($i=0; $i<$n; $i++){
    $a = explode(" ",trim(fgets(STDIN)));
    $ans = 0;
    for($j=0; $j<$m; $j++){
      $ans += $a[$j]*$b[$j];
    }
    if($ans+$c > 0){
      $count++;
    }
  }
  echo $count."\n";

Measured memory_bytes: 4604
//IOI 2021

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

#define pb push_back
#define ff first
#define ss second

typedef long long ll;
typedef pair<int, int> pii;

const int MAXN = 100 * 1000 + 17;

int n, a[MAXN], dp[MAXN][2];
bool flag;

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++)
		cin >> a[i];
	a[0] == a[1];
	dp[1][0] = 1;
	dp[1][1] = 1;
	for (int i = 2; i <= n; i++) {
		dp[i][0] = min(dp[i - 1][0], dp[i - 1][1]) + 1;
		dp[i][1] = dp[i][0];
		if (a[i] >= a[i - 1])
			dp[i][1] = dp[i - 1][1];
		if (a[i] <= a[i - 1])
			dp[i][0] = dp[i - 1][0];
	}
	cout << min(dp[n][0], dp[n][1]) << endl;
	return 0;
}


Measured memory_bytes: 1408
//       BAAP IZ HERE           //
#include<bits/stdc++.h>
using namespace std;
#define gcd __gcd
#define lli long long int
#define jmd ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

int main()
{
    jmd;
    int a;
    cin>>a;
    cout<<a+a*a+a*a*a;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
const int MAX = 1333400;
const int MOD = 1000000007;
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(){
	COMinit();
	long long x,y;
	cin >> x >> y;
	cout << ((x+y)%3==0 ? COM((x+y)/3,x-(x+y)/3) : 0) << endl;
	return 0;
}


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

#define LL long long

#define FOR(INDEX, START, END) for (LL INDEX = (START); INDEX < (END); ++INDEX)
#define REP(INDEX, COUNT) for (LL INDEX = 0; INDEX < (COUNT); ++INDEX)

int main()
{
	LL A, B, C;
	cin >> A >> B >> C;

	cout << min(B / A, C) << endl;

	return 0;
}


Measured memory_bytes: 256
#coding:utf-8
import sys,os
from collections import defaultdict, deque
from fractions import gcd
from math import ceil, floor
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

    N,M = LMIIS()
    A = LMIIS()
    count = 0
    sum_vote = sum(A)
    for a in A:
        if a * 4 * M >= sum_vote:
            count += 1
    YN(count >= M)
    

if __name__ == '__main__':
    main()

Measured memory_bytes: 66028
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
 
public class Main {
	
	public static void main(String[] args) throws IOException {
		final Scanner sc = new Scanner(System.in);
		
		final char[] chs = sc.next().toCharArray();
		
		long answer = 0;
		int rest_p = 0, rest_g = 0;
		for(final char ch : chs){
			if(ch == 'g'){
				rest_g++;
			}else if(ch == 'p'){
				rest_p++;
			}
		}
		
		//System.out.println(rest_g + " " + rest_p);
		final int plus  = rest_g / 2;
		final int minus = rest_p / 2;
		final int g_mod = rest_g % 2;
		final int p_mod = rest_p % 2;
		
		System.out.println((plus - minus) + Math.min(0, g_mod - p_mod));
	}
 
	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;
 
		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}	
 
		private void getLine() throws IOException {
			while (!hasNext()) {
				tok = new StringTokenizer(br.readLine());
			}
		}
 
		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}
 
		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public void close() throws IOException {
			br.close();
		}
	}
}

Measured memory_bytes: 11092
N = int(input())
L = sorted(list(map(int, input().split())))
num = 0
for i in range(N):
  for j in range(i+1, N):
    for k in range(j+1, N):
      if L[i] == L[j] or L[j] == L[k] or L[k] == L[i]:
        pass
      else:
        if L[i] + L[j] > L[k]:
          num += 1
print(num)

Measured memory_bytes: 67996
import itertools
H,W,K = map(int,input().split())
S = []
for i in range(H):
  s= map(int,input())
  S.append(list(s))
l = list(itertools.product([0,1], repeat=H-1))
l = [list(li) for li in l]
for i in range(len(l)):
  l[i] = [j+1 for j in range(len(l[i])) if l[i][j] > 0]
  
S_t = [list(x) for x in zip(*S)]
for i in range(W):
  for j in range(1,H):
    S_t[i][j] += S_t[i][j-1]
flag = False  
min_cnt = H*W
for i in range(len(l)):
  cnt = 0
  bh = [0]+[li  for li in l[i] if li > 0]+[H]
  white = [0]*(len(bh)-2+1)
  j = 0
  while j < W:
    if flag == True:
      white = [0]*(len(bh)-2+1)
      cnt += 1
      flag = False
    for k in range(len(bh)-1):
      if bh[k] == 0:
        su = S_t[j][bh[k+1]-1]
      else:
        su = S_t[j][bh[k+1]-1]-S_t[j][max(0,bh[k]-1)]
      if white[k] + su > K:
        if su > K:
          j = W
          cnt = H*W+1
          flag = False
        else:
          flag = True
        break
      white[k] += su
    if flag == False:
      j += 1
  min_cnt = min(cnt+len(bh)-2,min_cnt)
  
print(min_cnt)
    
      

    


Measured memory_bytes: 44764
#include <stdio.h>
#include <vector>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>
 
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef pair<int, int> pi;

struct node{
  ll num;
  int cnt;
  bool border;
};

int main() {
  string ns; int k;
  cin >> ns;
  cin >> k;

  vi n;
  rep(i, ns.size()) n.push_back(ns[i] - '0');
  int keta = n.size();

  queue<node> q;
  q.push(node{1, 0, 0});
  q.push(node{1, 1, 1});
  if (n[0] > 1){
    q.push(node{n[0] - 1, 1, 0});
  }

  for (int kn=1;kn<keta;kn++){
    queue<node> new_q;
    while(!q.empty()){
      node v = q.front(); q.pop();
      // printf("num: %d, cnt: %d, b: %d\n", v.num, v.cnt, v.border);
      if (v.cnt > k) continue;
      if (v.border){
        if (n[kn]){
          new_q.push(node{v.num, v.cnt+1, 1});
          new_q.push(node{v.num, v.cnt, 0});
        }else{
          new_q.push(node{v.num, v.cnt, 1});
        }

        if (n[kn] > 1){
          new_q.push(node{v.num * (n[kn] - 1), v.cnt+1, 0});
        }
      }else{
        new_q.push(node{v.num, v.cnt, 0});
        new_q.push(node{v.num * 9, v.cnt+1, 0});
      }
    }
    // cout << endl;
    q = new_q;
  }

  ll ans = 0;
  while (!q.empty()){
    node v = q.front(); q.pop();
    // printf("num: %d, cnt: %d, b: %d\n", v.num, v.cnt, v.border);
    if (v.cnt == k) ans += v.num;
  }
  cout << ans << endl;

  return 0;
}

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

int main(){
    int k;
    cin>>k;
    int v[]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    cout<<v[k-1]<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) { 
  return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
  return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) { 
  return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define MOD 1000000007
#define INF 1000000009
typedef long long int lli;

int main(void) {
  char s[10];
  scanf("%s", s);
  int ok = 1;
  rep(i, 0, 3) {
    if (s[i] == '7') {
      printf("Yes\n");
      return 0;
    }
  }
  printf("No\n");
  return 0;
}


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

typedef long long ll;
ll a[55], b[55];

int main()
{
    ll n, x;
    cin >> n >> x;
    a[0] = 1;
    for ( int i = 1 ; i <= n ; i ++ )
	{
        a[i] = a[i-1] * 2 + 1;
    }
    
    b[0] = 1;
    
    for ( int i = 1 ; i <= n ; i ++ )
	{
        b[i] = b[i-1] * 2 + 3;
    }
    
    ll ans = 0;
    
    while ( x > 0 )
	{
        if ( x == b[n] )
		{
            ans += a[n];
            x = 0;
        }
		else if ( x >= b[n] / 2 + 1 )
		{
            ans += a[n-1] + 1;
            x -= b[n] / 2 + 1;
        }
		else
           x --;
        n --;
    }
    
    cout << ans << endl;
    
    return 0;
    
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

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

    for (int i = 0; i < 10000; i++) {
        if (i * 8 / 100 == a && i * 10 / 100 == b) {
            cout << i << endl;
            exit(0);
        }
    }

    cout << -1 << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define substr(s,f,t) (s.substr(f-1,t-f+1))
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
using namespace std;
struct Grid{int x,y,t;};
struct Edge{int to,cost;};
struct Graph{vector<vector<Edge>>E;int V;
  const ll Inf = llINF;const int MAX_V=1010;vector<ll>d;
  Graph(int n):E(n){d.resize(MAX_V);E.resize(n);V=n;}
  void init(){for(int i=0;i<MAX_V;i++)d[i]=Inf;}
  void add_edge(int from,int to,int cost){E[from-1].pb({to-1,cost});}
};
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;cin>>n;
  vi A(n);
  vi B(n);
  vi co(n);
  ll ama=-1;
  ll bma=-1;
  for(int i=0;i<n;i++){
    cin>>A[i];
    ama=max(A[i],ama);
    if(i==0){
      co[0]=A[i];
    }else if(A[i]!=A[i-1])
      co[i]=A[i];
  }
  bool fl=true;
  for(int i=0;i<n;i++){
    cin>>B[i];
    bma=max(B[i],bma);
    if(co[i]>B[i])fl=false;
    if(i==n-1){
      if(co[i]>0&&B[i]!=co[i]){
	fl=false;
      }else{
	co[i]=B[i];
      }
    }
  }
  for(int i=n-2;i>=0;i--){
    if(B[i]!=B[i+1]){
      if(co[i]>0&&B[i]!=co[i])
	fl=false;
      else{
	co[i]=B[i];
      }
    }
  }
  ll ans=1;
  for(int i=0;i<n;i++){
    if(!co[i]){
      ll num=min(A[i],B[i]);
      ans*=num;
      ans%=MOD;
    }
  }
  if(fl&&bma==ama){
    cout<<ans<<endl;
  }else{
    cout<<0<<endl;
  }
  return 0;
}


Measured memory_bytes: 2560
#include<iostream>
#include<string>
using namespace std;
int main(void){
  string str,ans;
  for(;;){
    getline(cin,str);
    if(str=="END OF INPUT") break;
    ans.clear();
    for(int i=0;i<str.size();i++){
      if(i==0 && str[i]==' ' || str[i-1]==' ' && str[i]==' ') ans+='0';
      else if(str[i-1]==' ' || i==0){
	char c=0;
	for(int j=i;;j++){
	  if(str[j]==' ' || j==str.size()) break;
	  c++;
	}
	ans+=c+48;
      }
    }
    cout << ans << endl;
  }
}


Measured memory_bytes: 1188
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

typedef long long ll;

int main(){
    //freopen("in.txt", "r", stdin);
    int X, Y, Z, k;
    const int MAX = 1003;

    ll A[MAX], B[MAX], C[MAX];
    vector<ll> AB, ABC;

    cin>>X>>Y>>Z>>k;

    for (int i=0;i<X;++i) cin>>A[i];
    for (int i=0;i<Y;++i) cin>>B[i];
    for (int i=0;i<Z;++i) cin>>C[i];

    for (int i=0;i<X;++i){
        for (int j=0;j<Y;++j){
            AB.push_back(A[i] + B[j]);
        }
    } 
    sort(AB.begin(), AB.end(), greater<ll>());

    int len = (int)AB.size();
    for (int i=0;i<min(k, len);++i){
        for (int j=0;j<Z;++j){
            ABC.push_back(AB[i] + C[j]);
        }
    }   

    sort(ABC.begin(), ABC.end(), greater<ll>());
    for (int i=0;i<k;++i) cout<<ABC[i]<<endl;

    return 0;
}

Measured memory_bytes: 42980
#include <bits/stdc++.h>	
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ld long double
#define pii pair <int, int>
#define sz(a) (int)(a.size()) 
#define resize(v) v.resize(unique(all(v)) - v.begin()); 
#define all(a) a.begin(), a.end()
#define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it ++)

// random_device rd; mt19937 g(rd());

using namespace std;
 
void Fast_Read_Out()
{
    ios_base::sync_with_stdio(0);
    cin.tie(), cout.tie();
}
 
void Random()
{
    unsigned int seed;                                                                        
    asm("rdtsc" : "=A" (seed));
    srand(seed);        
}
 
unsigned int Time()
{
     unsigned int time = clock() / 1000.00;                           
     return time;
}
 
const int mod = (int)1e9 + 7;
const int N = (int)1e5 + 123; 

int n, m, d;
int q;
int a[303][303];
int pref[N];
vector <int> v;
map <int, pair <int, int> > w;

int main ()
{
	#ifdef JUDGE
		freopen("input.txt", "r", stdin);
	#endif		
	Fast_Read_Out();
	Random();   
	cin >> n >> m >> d;
	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= m; j++)
			cin >> a[i][j], w[a[i][j]] = mp(i, j);
	int it = 1;
	while(sz(v) != n * m)
	{		
		int cur = it;
		v.pb(it);
		while(cur + d <= n * m) 
		{
			if(!pref[cur + d]) pref[cur + d] = pref[cur] + abs(w[cur].F - w[cur + d].F) + abs(w[cur].S - w[cur + d].S), v.pb(cur + d);
			cur += d;
		}	
		it++;
	}
	cin >> q;
	while(q--)
	{
		int l, r;
		cin >> l >> r;
		cout << pref[r] - pref[l] << '\n';
	}
}                                

Measured memory_bytes: 7928
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    int a,b,i=0,x=1;
    cin>>a>>b;
    while(x<b){
        x=x-1+a;
        i++;
    }
    cout<<i<<endl;
}

Measured memory_bytes: 3612
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

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

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a


inf = 10 ** 18
mod = 10 ** 9 + 7

n = ir()
a = lr()
q = ir()
dic = Counter(a)
total = sum(a)
for i in range(q):
    b,c = lr()
    if c in dic:
        dic[c] += dic[b]
    else:
        dic[c] = dic[b]
    total += (c-b)*dic[b]
    dic[b] = 0
    print(total)

Measured memory_bytes: 93240
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<int>
#define VP vector<PA>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define MOD 1000000007
#define INF 1000000007
#define PI 3.14159265358979323846
using namespace std;
//
int N,D[200000];
int M,T[200000];
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>N;
  FOR(i,0,N){
    cin>>D[i];
  }
  cin>>M;
  FOR(i,0,M){
    cin>>T[i];
  }
  sort(D,D+N);
  sort(T,T+M);
  int i=0,j=0;
  while(j<M){
    if(D[i]==T[j]){
      i++;
      j++;
    }else if(D[i]>T[j]){
      YES(0);
      return 0;
    }else if(D[i]<T[j]){
      i++;
    }
  }
  YES(1);
  return 0;
}


Measured memory_bytes: 1792
import std.algorithm, std.conv, std.range, std.stdio, std.string;
import std.math;

void main()
{
  string line;
  while ((line = readln) !is null) {
    auto rd = line.split.to!(real[]);
    auto a = rd[0], b = rd[1], c = rd[2];
    auto d = rd[3], e = rd[4], f = rd[5];

    auto g = a * e - b * d;
    auto x = (c * e - b * f);
    if (x.abs > 0) x /= g;
    auto y = (a * f - c * d);
    if (y.abs > 0) y /= g;
    x = (x * 1000).round / 1000;
    y = (y * 1000).round / 1000;

    writefln("%.3f %.3f", x, y);
  }
}

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


bool is_prime(int x) {
    if (x <= 1) return false;

    for (int i = 2; i * i <= x; i++) {
        if (x % i == 0) return false;
    }
    return true;
}

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

    int p = X;
    while (!is_prime(p))
    {
        p++;
    }
    cout << p << 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 int ll;
const ll MOD = 1000000007;

int digsum(int n) {
  int res = 0;
  while(n > 0) {
    res += n%10;
    n /= 10;
  }
  return res;
}

int main() {
  int n;
  cin >> n;
  if (n % digsum(n) == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.*;
class Main {
  public static void main(String[]args){
    Scanner scanner = new Scanner(System.in);
    int h = scanner.nextInt();
    int n = scanner.nextInt();
    int x = 0;
    int aS = 0;
    
    for(int i=0; i<n; i++){
      x = scanner.nextInt();
      aS += x;
    }  
    
    if(aS>=h){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
    
  }
}

Measured memory_bytes: 46348
n = int(input())
an = [int(x) for x in input().split()]
bn = [int(x) for x in input().split()]

print(sum([abs(an[i] - bn[i]) for i in range(n)]))
print(sum([abs(an[i] - bn[i])**2 for i in range(n)])**(1/2))
print(sum([abs(an[i] - bn[i])**3 for i in range(n)])**(1/3))
print(max([float(abs(an[i] - bn[i])) for i in range(n)]))


Measured memory_bytes: 5652
let () =
	Scanf.scanf "%d %d %d\n"
    (fun a b c -> 
    if a > b then
    	if b > c then (a*10+b) + c
        else if a > c then (a*10+c) + b
        else (* c > a > b *) (c*10+a) + b
    else (* b >= a *)
    	if a > c then (b*10+a) + c
    	else if b > c then (b*10+c) + a
        else (c*10+b) + a)
    |> print_int

Measured memory_bytes: 384
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

AB, BC, CA = [int(x.strip("|")) for x in input().split()]
print(int(AB*BC/2))


Measured memory_bytes: 3896
#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 n;
  cin >> n;
  vector<int> p(n);
  rep(i, n) cin >> p[i];

  int ans = 0;
  for(int i=1; i<n-1; ++i) {
    if( (p[i-1] < p[i] && p[i] < p[i+1]) || (p[i+1] < p[i] && p[i] < p[i-1]) ) {
      ++ans;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include <string>
#include<math.h>
using namespace std;

int main() {
  string s; cin >> s;
  int n = s.size();
  
  for (int bit = 0; bit < (1<<(n-1)); bit++) {
    int ans = s[0] - '0';
    for (int i = 0; i < n-1; i++) {
      if (bit & (1 << i)) {
        ans += s[i + 1] - '0';
      } else {
        ans -= s[i + 1] -'0';
      }
    }
    
    if (ans == 7) {
      cout << s[0];
      for (int i = 0; i < n-1; i++) {
        if (bit & (1 << i)) {
          cout << "+" << s[i + 1];
        } else {
          cout << "-" << s[i + 1];
        }
      }
      cout << "=7" << "\n";
      break;
    }
  }
}

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

using namespace std;

using ll = long long;

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

    string s;

    cin >> s;
    int n = 0;
    for (auto c : s)
        if (c == '+') ++n;

    cout << 2 * n - 4 << endl;

    return 0;
}


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

using namespace std;

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define F first
#define S second
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define pb push_back
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
void debug_out() {
    cerr << endl;
}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H), debug_out(T...);
}

int main() {
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
    freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
#else
#define debug(...) 3
    fastIO;
#endif
        int n;
        cin >> n;
        vector<ll> v(n), pre(n);
        forn(i, n)cin >> v[i];
        pre[0] = v[0];
        for(int i = 1; i < n; i++)pre[i] = max(pre[i - 1], v[i]);
        ll ans = 0;
        forn(i, n)ans += pre[i] - v[i];
        cout << ans << endl;
    return 0;
}


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

int main()
{
    long A, B, K;
    cin >> A >> B >> K;

    if (B - A < 2 * K)
    {
        for (int i = A; i <= B; i++)
        {
            cout << i << endl;
        }
    }

    else
    {
        for (int i = 0; i < K; i++)
        {
            cout << A + i << endl;
        }
        for (int i = 0; i < K; i++)
        {
            cout << B - K + i + 1 << endl;
        }
    }
}


Measured memory_bytes: 256
from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    input()
    aa=LI()
    cc=Counter(aa)
    ans=0
    for a,c in cc.items():
        if a>c:ans+=c
        else:ans+=c-a
    print(ans)

main()

Measured memory_bytes: 18332
H,W,M = map(int,input().split())

hcount = [0 for i in range(H+1)]
wcount = [0 for i in range(W+1)]
hw = [list(map(int,input().split())) for i in range(M)]

for i in range(M):
    h,w = hw[i]
    hcount[h]+=1
    wcount[w]+=1

ansh = max(hcount)
answ = max(wcount)#おいてない前提
counth=0
countw=0
for i in range(H+1):
    if hcount[i]==ansh:
        counth+=1

for i in range(W+1):
    if wcount[i]==answ:
        countw+=1

countM = 0
for i in range(M):
    if hcount[hw[i][0]]+wcount[hw[i][1]] == ansh+answ:
        countM+=1
print(ansh+answ if countM < counth*countw else ansh +answ -1)


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

using namespace std;

typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define debug(a) cout << #a << ": " << a << endl;

int main() {
  int N, T; cin >> N >> T;
  int minC = 10000;
  rep(i, N) {
    int c, t; cin >> c >> t;
    if (t > T) continue;
    minC = min(minC, c);
  }
  if (minC == 10000) {
    cout << "TLE" << endl;
  } else {
    cout << minC << endl;
  }
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<cstring>
#include<math.h>
#include<bitset>
#include<queue>
#include<set>
#include<iomanip>
#include<math.h>
#include<assert.h>
#include<string>
#include<cstdlib>
#include<cctype>
#include<unordered_map>
#include<sstream>
#include<numeric>
#include<stack>
// #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
constexpr ll INF = 1LL<<60;
const double INFD = 1e100;
const ll mod = 1000000007;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
};
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
};

// intやllをstringに変換
template<typename T> inline string toString(const T &a){
  ostringstream oss;
  oss << a;
  return oss.str();
};
// ----------------------------------------------------------------------------
int main(){
  int N;
  cin >> N;
  vector<int> d(N);
  for(int i=0; i<N; i++){
    cin >> d[i];
  }
  bool can = true;
  int m = 0;
  for(int i=0; i<N; i++){
    if(m < i){
      can = false;
    }
    if(d[i] < 10){
      if(m < i){
        can = false;
      }
    }else{
      chmax(m,i+d[i]/10);
    }
  }
  m = N-1;
  for(int i=N-1; i>=0; i--){
    if(i < m){
      can = false;
    }
    if(d[i] < 10){
      if(m > i){
        can = false;
      }
    }else{
      chmin(m,i-d[i]/10);
    }
  }
  if(can){
    cout << "yes" << endl;
  }else{
    cout << "no" << endl;
  }
  return 0;
}



Measured memory_bytes: 3900
s = int(input())

MAX = 1000000


def f(n):
    def odd(n):
        return 3*n+1

    def even(n):
        return n/2
    return odd(n) if n % 2 else even(n)


dic = {}


def a(n):
    if n == 1:
        dic[n] = s
        return dic[n]
    else:
        dic[n] = f(dic[n-1])
        return dic[n]


for m in range(1, MAX):
    am = a(m)
    if sum(1 if v == am else 0 for v in dic.values()) == 2:
        print(m)
        break

Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define fi first
#define se second

using namespace std;
typedef long long ll;
const long long MOD = 1e9 +7;
const long long N = 1e6 + 7;
const long long inf = ll(1e18);
const string name = "";
template <class T> int getbit(T x,int y) {return x >> (y-1) & 1;}
template <class T> T offbit(T x, int y) {return x | 1 <<(y-1);}
template <class T> T onbit(T x, int y) {return x & (~1<<(y-1));}
template <class T> T sqr(T x) {return x*x;}
template <class T> void read_int(T &rs) {
    rs = 0;
    int neg = 1;
    char r;
    for(r = getchar(); r < '0' || r > '9'; r = getchar())
    if(r == '-') neg *= -1;
    rs = r - '0';
    for(r = getchar(); r >= '0' && r <= '9'; r = getchar())
    rs = rs*10 + (r - '0');
    rs *= neg;
}

ll n, m;

ll Exp(ll x) {
    if(x > 2) return 2;
    else return 3;
}

ll calc(ll x, ll y) {
    ll rs = 1;
    for (int i = 2; i <= sqrt(x); ++i) {
        if(x % i == 0) {
            while(x % i == 0) {
                x /= i;
                if(y % i == 0) y /= i;
                rs *= i;
            }
        }
    }
    rs *= x;
    if(y % x == 0) y /= x;
    x = 1;
    if(y == 1) return -1;
    rs *= Exp(y);
    return rs;
}

int main(){
        ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        //freopen((name + ".inp").c_str(), "r", stdin);
        //freopen((name + ".out").c_str(), "w", stdout);
        cin >> n >> m;
        cout << calc(n, m);
        return 0;
}


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

const ll mod = 1e9 + 7;

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

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

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

    string s;
    cin >> s;
    int ans = s.size();
    rep(i, s.size() - 1) if(s[i] == s[i + 1]) {
        ans--;
        i += 2;
    }
    cout << ans;
}

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

vector<int> divisors(int n) {
	vector<int> ds;
	for (int i = 1; i * i <= n; i++) if (n % i == 0) {
		ds.push_back(i);
		if (i * i != n) ds.push_back(n / i);
	}
	sort(ds.begin(), ds.end());
	return ds;
}

int main()
{
	int N, K;
	cin >> N >> K;
	vector<int> A(N);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	const int sum = accumulate(A.begin(), A.end(), 0);
	auto divs = divisors(sum);
	reverse(divs.begin(), divs.end());
	for (int i = 0; i < (int)divs.size(); i++) {
		int val = divs[i];
		vector<int> rs(N);
		int ts = 0;
		for (int j = 0; j < N; j++) {
			ts += A[j] / val;
			rs[j] = A[j] % val;
		}
		int cnt = sum / val - ts;
		sort(rs.begin(), rs.end());
		int dist = 0;
		for (int j = 0; j < N; j++) {
			if (j < N - cnt) {
				dist += rs[j];
			}
			else {
				dist += val - rs[j];
			}
		}
		if (dist / 2 <= K) {
			cout << val << endl;
			break;
		}
	}
	return 0;
}


Measured memory_bytes: 256
n, m = map(int, input().split())
a, b, c = [], [], []
for i in range(m):
    ai, bi = map(int, input().split())
    a.append(ai); b.append(bi)
    ci = list(map(int, input().split()))
    c.append(ci)

dp = [[10**9 for j in range(2**n)] for i in range(m)]
for i in range(m):
    dp[i][0] = 0
key = 0
for i in range(b[0]):
    key += 1<<(c[0][i]-1)
dp[0][key] = a[0]

for i in range(1, m):
    ai, bi, ci = a[i], b[i], c[i]
    key = 0
    for j in range(bi):
        key += 1<<(ci[j]-1)
    for j in range(2**n):
        dp[i][j|key] = min(dp[i-1][j|key], dp[i-1][j]+ai, dp[i][j|key])
    for j in range(2**n):
        dp[i][j] = min(dp[i-1][j], dp[i][j])

if dp[m-1][2**n-1] == 10**9:
    print(-1)
else:
    print(dp[m-1][2**n-1])

Measured memory_bytes: 106492
#include <bits/stdc++.h>  // g++ -std=c++14 -o a a.cpp

using namespace std;

typedef pair<int, int> P;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repto(i, n) for(int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;

__attribute__((constructor))
void initial() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

int main() {
    int a, b, c;
    int N = 101;
    int ary[N] = {0};
    cin >> a >> b >> c;
    ary[a] = 1;
    ary[b] = 1;
    ary[c] = 1;
    int count = 0;
    rep(i, N) {
        count += ary[i];
    }
    cout << count << endl;
}

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

using namespace std;

int main()
{
    int n,i;
    cin>>n;
    int a[n],b[n];
    for(i=0;i<n;i++)
    {
       cin>>a[i];
    }
    for(i=0;i<n;i++)
    {
        b[a[i]-1]=i+1;
    }
    for(i=0;i<n;i++)
    {
      cout<<b[i]<<" ";
    }
    return 0;
}


Measured memory_bytes: 1536
#include<stdio.h>

inline long long min(long long a,long long b)
{
	if(a<b)
		return a;
	return b;
}

int main()
{
	long long L,R;
	scanf("%lld%lld",&L,&R);
	long long ans=(L*R)%2019;
	
	if(R-L>=2019)
	{
		printf("%d",0);
		return 0;
	}
	
	for(long long x=L;x<=R;x++)
	{
		for(long long y=x+1;y<=R;y++)
		{
			ans=min(ans,(x*y)%2019);
			// if(((x%2019)*(y%2019))%2019<ans)
				// ans=(x%2019)*(y%2019))%2019;
		}
	}
	printf("%lld",ans);
	return 0;
}


Measured memory_bytes: 1700
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll N=2e9;


int main()
{
    ios::sync_with_stdio(false);
    ll l,r,tem=2019;
    cin>>l>>r;

    if(!l)
    {
        cout<<0<<endl;
        return 0;
    }

    for(; tem<=N; tem+=2019)
        if(l<=tem&&tem<=r)
        {
            cout<<0<<endl;
            return 0;
        }

    l=l%2019;
    r=r%2019;

    int ans=2200;

    for(int i=l;i<=r;i++)
        for(int j=i+1;j<=r;j++)
        ans=min(ans,(i*j)%2019);
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iomanip>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define int long long
#define For(i,x,y) for(int i = x; i <= y; ++i)
#define FOR For
#define rev_For(i,x,y) for(int i = x; i >= y; --i)
#define REV_FOR rev_For
#define ll long long
#define Size(v) ((int)v.size())
#define _section "\n--------------------\n"
#define fi first
#define se second
#define pb push_back
using namespace std;
// using namespace __gnu_pbds;

int n, k;

void solve() {
	cin >> n >> k;
	int ans = 0;
	for (int a = 0; a < k; ++a) {
		// so du cua a khi chia cho k
		int b = (k - a) % k;
		int c = (k - b) % k;

		if (c != b) continue;
		if (a != b) continue;
		if (c != a) continue;

		if (n - a < 0) continue;

		int rem = n - a;
		int p = rem / k;
		if (a != 0) ++p;

		ans += p * p * p;
	}

	cout << ans;
}

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

	int t = 1;
	while (t--) {
		solve();
	}
}

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

int main()
{
  char s[101];
  int i;
  scanf("%s", s);
  for (i = 0; i < strlen(s); i++) {
    if (i % 2 == 0) {
      if (s[i] == 'L') {
        puts ("No");
        goto end;
      }
    } else {
      if (s[i] == 'R') {
        puts("No");
        goto end;
      }
    }
  }
  puts("Yes");
  end:
  return 0;
}


Measured memory_bytes: 128
/// You just can't beat the person who never gives up
/// ICPC next year


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define sz(x) ((long long)(x).size())
#define all(x)  x.begin(),x.end()
#define rall(x) (x).rbegin(), (x).rend()
#define endl "\n"
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define leastsigbit(x)     __builtin_ffs(x)
#define mod             1000000007
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define pii pair<ll,ll>
#define vpii vector<pii>
#define tt ll tt;cin >> tt;while(tt--)
#define  fio ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define D1(x) { cerr << " [" << #x << ": " << x << "]\n"; }
#define D2(x) { cerr << " [" << #x << ": "; for(auto it:x) cerr << it << " "; cerr << "]\n";}
const double PI = acos(-1);
ll power(ll a,ll b,ll m=mod){ ll ans=1; a=a%m;  while(b>0) {  if(b&1)  ans=(1ll*a*ans)%m; b>>=1;a=(1ll*a*a)%m;}return ans;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll lcm( ll x, ll y) { return (x*y)/gcd(x,y);}
bool isprime(ll n){if(n < 2) return 0; ll i = 2; while(i*i <= n){if(n%i == 0) return 0; i++;} return 1;}
bool isPowerOfTwo(int x)
{
    /* First x in the below expression is for the case when x is 0 */
    return x && (!(x&(x-1)));
}
void offset(vector<int>&a,int x) {
    for(int i = 0; i < sz(a);i++) {
        a[i] = x;
    }
}
struct cmp {
    bool operator() (const pair<int,int>& lhs, const pair<int,int>& rhs) const {
        return lhs.ff * rhs.ss < lhs.ss * rhs.ff;
    }
//for map<pii,int>
};


// auto cmp = [](pair<int,int>a,pair<int,int>b) {if(a.first==b.first)return a.second>b.second;
//      else return a.first > b.first;
//  };
//  multiset<pair<int,int>,decltype(cmp)>fc(cmp);
double distform(int x, int y, int z, int w) {//(x1,y1,x2,y2)
    return sqrt(1. * pow(x-z,2) + 1. * pow(y-w,2));
}
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
    //unordered_map<long long, int, custom_hash> safe_map;
};

const int MAXN = 2e5+ 10;

#define int long long
bool cmps(pair<int,int>p1,pair<int,int>p2) {
    return p1.ss > p2.ss;
}
int32_t main() {
    fio
    int n,d;
    cin >> n >> d;
    int x[n];
    int y[n];
    for (int i = 0; i < n; ++i) {
        cin >> x[i] >> y[i];
    }
    int cnt = 0;
    for (int j = 0; j < n; ++j) {
        if (distform(0, 0, x[j], y[j]) <= d) {
            cnt++;
        }
    }

    cout << cnt << endl;
    cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;


}






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

void swap(int *a,int *b) {
    int temp = *a;
    *a = *b;
    *b = temp;
}

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    swap(&a,&b);
    swap(&a,&c);
    cout << a << " " << b << " " << c;
}

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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define lcm( a, b ) (a)/__gcd((a),(b))*(b)
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 200005;

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

LL fac[SIZE], finv[SIZE], inv[SIZE];
void combInit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for( int i = 2; i < SIZE; ++i ) {
        fac[i] = (fac[i - 1] * i) % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = (finv[i - 1] * inv[i]) % MOD;

    }
}

LL comb(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;

}

vector< int > Div( int n ) {
    vector< int > ret;
    for( int i = 1; i * i <= n; ++i ) {
        if( n % i == 0 ) {
            ret.pb( i );

            if( i * i != n ) ret.pb( n / i );
        }
    }
    sort( all( ret ) );
    return ret;
}

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

    int n, m;
    cin >> n >> m;
    int cnt[SIZE] = {};
    
    for( int i = 0; i < m; ++i ) {
        int a, b;
        cin >> a >> b;
        cnt[a]++;
        cnt[b]++;

    }

    for( int i = 1; i <= n; ++i ) {
        if( cnt[i] % 2 != 0 ) {
            cout << "NO" << endl;
            return 0;

        }
    }
    cout << "YES" << endl;
    return 0;
}



Measured memory_bytes: 1024
#pragma region Macros
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define rep2(i, a, b) for(ll i = a; i <= b; ++i)
#define rep(i, n) for(i = 0; i < n; ++i)
#define rep3(i, a, b) for(ll i = a; i >= b; --i)
using namespace std;

// _________コーディングはここから！！___________

int n, m, k, i;
constexpr int N = 200010;
int a[N], b[N];
constexpr int sz = 5000000;
char reader[sz];
char *pos = reader;
int nn;
int kk;
main() {
    reader[fread(reader, sizeof(char), sizeof(char) * sz, stdin)];
    while('0' <= *pos and *pos <= '9') n = n * 10 + *pos++ - '0';
    pos++;
    while('0' <= *pos and *pos <= '9') m = m * 10 + *pos++ - '0';
    pos++;
    while('0' <= *pos and *pos <= '9') k = k * 10 + *pos++ - '0';
    nn = n;
    while(*pos and *pos <= 32) pos++;
    rep(i, n) {
        while('0' <= *pos and *pos <= '9') a[i + 1] = a[i + 1] * 10 + *pos++ - '0';
        pos++;
        a[i + 1] += a[i];
        if(a[i + 1] > k) {
            nn = i;
            ++i;
            for(; i < n; ++i) {
                while('0' <= *pos and *pos <= '9') pos++;
                pos++;
            }
            break;
        }
    }
    while(*pos and *pos <= 32) pos++;
    rep(i, m) {
        while('0' <= *pos and *pos <= '9') b[i + 1] = b[i + 1] * 10 + *pos++ - '0';
        pos++;
        b[i + 1] += b[i];
        if(b[i + 1] > k) {
            m = i;
            break;
        }
    }
    int now = nn;
    int ans = now;
    for(i = 1; i <= m; i++) {
        kk = k - b[i];
        while(a[now] > kk) now--;
        ans = max(ans, i + now);
    }
    pos = reader;
    do {
        *pos++ = ans % 10 + '0';
        ans /= 10;
    } while(ans);
    do { putchar_unlocked(*(--pos)); } while(pos != reader);
}


Measured memory_bytes: 7712
object Main {
  def main(args: Array[String]): Unit = {
    val nums    = scala.io.StdIn.readLine
    var sum_mod_9 = 0
    ( 0 until nums.length ).foreach{ i=>
      sum_mod_9 = ( sum_mod_9 + ( nums( i ).toInt - 48 ) )%9
    }
    if( sum_mod_9 == 0 ) println( "Yes" )
    else                 println( "No" )
  }
}

Measured memory_bytes: 54804
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>

using namespace std;

int main(){
	string s;
	vector<string> u;
	bool b = 0;
	cin >> s;
	u.push_back("KIHBAR");
	u.push_back("KIHABR");
	u.push_back("KIHABAR");
	u.push_back("KIHBR");
	u.push_back("AKIHBAR");
	u.push_back("AKIHABR");
	u.push_back("AKIHABAR");
	u.push_back("AKIHBR");
	u.push_back("KIHBARA");
	u.push_back("KIHABRA");
	u.push_back("KIHABARA");
	u.push_back("KIHBRA");
	u.push_back("AKIHBARA");
	u.push_back("AKIHABRA");
	u.push_back("AKIHABARA");
	u.push_back("AKIHBRA");
	for(int i = 0; i < u.size(); i++){
		if(s == u[i])
			b = 1;
	}
	if(b)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
	
	return 0;
}

Measured memory_bytes: 256
void main() {
	auto ip = readAs!(int[]), N = ip[0], M = ip[1];
	bool[int] m;
	int[int] penarr;
	int penalty;
	foreach(i; 0..M) {
		auto ip2 = readln.split, p = ip2[0].to!int, S = ip2[1];
		if(S == "AC") {
			if(p-1 in m && !m[p-1] && p-1 in penarr) penalty += penarr[p-1];
			m[p-1] = true;
		} else {
			if(p-1 !in m) m[p-1] = false;
			if(p-1 !in m || !m[p-1]) penarr[p-1]++;
		}
	}
	writefln("%d %d", m.values.count!(v => v), penalty);
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

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

int main() {
  long long n=0;
  cin>>n;
  vector<long long> avec(n),howManyA(n),ans(n);
  long long all=0;
  
  rep(i,n){
    long long a=0;
    cin>>a;
    avec.at(i)=a;
    howManyA.at(a-1)++;
  }
  
  rep(i,n){
    all+=howManyA.at(i)*(howManyA.at(i)-1)/2;
  }
  
  rep(k,n){
    ans.at(k)=all-howManyA.at(avec.at(k)-1)+1;
  }
  
  rep(i,n){
    cout<<ans.at(i)<<endl;
  }
}

Measured memory_bytes: 8192
#include <cstddef>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#include <array>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <limits>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <bitset>
#include <valarray>
#include <utility>
#include <tuple>
#include <cmath>
#include <memory>
#include <random>
#include <fstream>
#include <locale>

#ifndef __has_include
#define __has_include(x) (false)
#endif

#if __has_include(<filesystem>)
#include <filesystem>
namespace fs = std::filesystem;
#endif



using ll = long long;
using ull = unsigned long long;

//vector
template <class T>
using vec = std::vector<T>;

template <class T>
using vvec = vec<vec<T>>;

constexpr std::size_t operator""_sz(ull n) { return std::size_t(n); }

template <class T, class BinaryOperation>
constexpr T fold(std::initializer_list<T> args, T init, BinaryOperation op)
{
	return std::accumulate(args.begin(), args.end(), init, op);
}

// numeric_low
namespace numeric
{
	template<class T>
	constexpr T gcd(const T x, const T y)
	{
		if (x < 0)return gcd(-x, y);
		if (y < 0)return gcd(x, -y);
		return (!y) ? x : gcd(y, x % y);
	}

	template<class T>
	constexpr T lcm(const T x, const T y)
	{
		if (x < 0)return lcm(-x, y);
		if (y < 0)return lcm(x, -y);
		return x * (y / gcd(x, y));
	}
}

// argsからハッシュ値を作成
template <class... Args>
std::size_t hash(Args... args)
{
	return fold({ static_cast<std::size_t>(args)... }, 0_sz,
		[](std::size_t seed, std::size_t x)
	{
		// uses magic number from boost
		return seed ^= x + 0x9e3779b9 + (seed << 6) + (seed >> 2);
	});
}

template <class Begin, class End>
void printAll(Begin beginIter, End endIter, std::string delimiter)
{
	for (auto iter{ beginIter }; iter != endIter; ++iter)
	{
		std::cout << *iter;
		if (std::distance(iter, endIter) != 1)
			std::cout << delimiter;
	}
}

template <class Container>
void printAll(const Container& c, std::string delimiter)
{
	printAll(std::cbegin(c), std::cend(c), delimiter);
}

template<class T>
void printAll(const std::initializer_list<T>& ini, std::string delimiter)
{
	printAll(ini.begin(), ini.end(), delimiter);
}

using ld = long double;

template <class T>
constexpr T nil = static_cast<T>(-1);

constexpr ll mod = 1000000007;

int main()
{
    using namespace std;

    vec<int> v(3);
    for (auto& e : v)
        cin >> e;
    
    sort(v.begin(), v.end());

    auto ans = v[2] * 10 + v[1] + v[0];

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

Measured memory_bytes: 256