akhauriyash/Code-Regression huggingface dataset:
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
// #include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)

int main()
{
  int n;
  cin >> n;
  int ans = 0;

  for (int i = 1; i <= 100;i*=10){
    int r=n/i%10;
    if(r==1)ans+=9*i;
    else if(r==9)ans+=i;
    else ans+=r;
  }

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


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



int main() {
	int A, B;
	string S;
	cin >> A >> B >> S;
	bool req1 = false;
	bool req2 = true; 
	if(S.at(A) == '-'){
		req1 = true;
	}
	for(int i = 0; i < A + B + 1; i++){
		if(i == A){
			continue;
		}
		else{
			if('0'> S.at(i) || S.at(i) > '9'){
				req2 = false;
				break;
			}
		}
	}
	if(req1 && req2){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
from math import sqrt

def is_prime(x):
    for i in range(2, int(sqrt(x))):
        if x % i == 0:
            return False
    return True

# print('input >>')
X = int(input())

while True:
    if is_prime(X):
        print(X)
        exit()
    X += 1

# print('-----output-----')

Measured memory_bytes: 2940
import math
import itertools
N = int(input())
pos = []
for _ in range(N):
    tmp = tuple(map(int, input().split()))
    pos.append(tmp)

ave = 0
cnt = 0
for x in itertools.permutations(pos):
    for i in range(N-1):
        ave += math.sqrt((x[i][0] - x[i+1][0]) ** 2 + (x[i][1] - x[i+1][1]) ** 2)
    cnt += 1
print(ave / cnt)


Measured memory_bytes: 3064
#include <stdio.h>

int max(int a, int b){
    if(a < b) return b;
    else return a;
}

int main(void) {
    int n, dp[101000][3], a[101000][3] = {0};
    scanf("%d", &n);

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

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 3; j++) {
            for (int k = 0; k < 3; k++) {
                if (j == k) continue;
                dp[i + 1][k] = max(dp[i + 1][k], dp[i][j] + a[i][k]);
            }
        }
    }

    int ans = max(dp[n][0], max(dp[n][1], dp[n][2]) );
    printf("%d", ans);

    return 0;
}


Measured memory_bytes: 2560
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;

void Main() {
    // input
    int N;
    cin >> N;


    // translate
    int AC_cnt = 0;
    int WA_cnt = 0;
    int TLE_cnt = 0;
    int RE_cnt = 0;
    for (int i = 0; i < N; i++) {
        string S;
        cin >> S;

        if (S == "AC") {
            AC_cnt++;
        } else if (S == "WA") {
            WA_cnt++;
        } else if (S == "TLE") {
            TLE_cnt++;
        } else {
            RE_cnt++;
        }
    }


    // output
    cout << "AC x " << AC_cnt << endl;
    cout << "WA x " << WA_cnt << endl;
    cout << "TLE x " << TLE_cnt << endl;
    cout << "RE x " << RE_cnt << endl;
}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 3628
#include <stdio.h>
int main(void) {
	long a,b,x,c;
    scanf("%ld%ld%ld", &a,&b,&x);
    if(a%x==0)
    printf("%ld",b/x-a/x+1);
    else
    printf("%ld",b/x-a/x);
    return 0;
}

Measured memory_bytes: 1736
#include <bits/stdc++.h>
using namespace std;
int main(){
  cout << fixed << setprecision(10);
  int N;
  cin >> N;
  vector<double> r(N);
  for (int i = 0; i < N; i++){
    cin >> r[i];
  }
  vector<double> c(N);
  c[0] = r[0];
  for (int i = 1; i < N; i++){
    double tv = 1000000000;
    double fv = max(r[i], c[i - 1]);
    for (int j = 0; j < 100; j++){
      double mid = (tv + fv) / 2;
      bool ok = true;
      for (int k = 0; k < i; k++){
        if (hypot(mid - c[k], r[i] - r[k]) < r[i]  + r[k]){
          ok = false;
        }
      }
      if (ok){
        tv = mid;
      } else {
        fv = mid;
      }
    }
    c[i] = tv;
  }
  double ans = 0;
  for (int i = 0; i < N; i++){
    ans = max(ans, c[i] + r[i]);
  }
  cout << ans << endl;
}


Measured memory_bytes: 3356
import math
from functools import reduce
from collections import deque

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

n,m = get_nums_l()

# 与えられたカード小さい順
nums = sorted(get_nums_l())

# 変更操作大きい順
changes = []

for j in range(m):
    b,c = get_nums_l()
    changes.append((b,c))
changes.sort(key=lambda c:c[1], reverse=True)

# 新カード大きい順
nnn = []
for change in changes:
    b,c = change
    nnn.extend([c] * b)

    if len(nnn) >= n:
        break

summ=0
len_nnn = len(nnn)
for i in range(n):
    if i < len_nnn:
        summ += max(nums[i], nnn[i])
    else:
        summ += nums[i]

print(summ)

Measured memory_bytes: 83240
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;


int main() {
    int n;
    cin >> n;
    string str;
    cin >> str;
    int w = 0, r = 0;
    for(auto x: str) {
        if(x == 'W') w++;
        else r++;
    }
    int cur = 0;
    for(int i = n - 1, cnt = 0; cnt < w; cnt++, i--) {
        if(str[i] == 'R') cur++;
    }
    // cout << w << " " << r << " " << cur << endl;
    cout << min({w, r, cur}) << endl;
}

Measured memory_bytes: 3752
import sys
def I(): return int(sys.stdin.readline().rstrip())
def S(): return sys.stdin.readline().rstrip()


N = I()
ST = [tuple(map(str,S().split())) for _ in range(N)]
X = S()

ans = 0
for i in range(N):
    s,t = ST[i]
    ans += int(t)
    if s == X:
        break

print(sum(int(ST[i][1]) for i in range(N))-ans)


Measured memory_bytes: 61912
#include <stdio.h>

int isprime(int n) {
 for(int i = 2; i * i <= n; i++) {
	 if(n % i == 0) return 0;
 }
 return 1;
}

int main(){
	int n,i,min,max;
	int number[1000000+2] = {0};
	for(i = 2;i < 1000000;i++){
		number[i] = isprime(i);
	}
	while(scanf("%d",&n)){
		if(n == 0)break;
		max = 0; min = 0;
		for(i = n;i > 0;i--){
			//printf("%d  ",i);
			if(number[i] && number[i-2]){
				min = i-2;
				max = i;
				//printf("%d %d\n",i,i-2);
				break;
			}
		}
		printf("%d %d\n",min,max);
	}
	return 0;
}

Measured memory_bytes: 4944
#include <bits/stdc++.h>
#define lol long long
using namespace std;
signed main(){
  int n=1,ans=0;
  string c,s="hi";
  cin>>c;
  while(n<=5 && ans==0){
    if(c==s){
      ans=1;
    }
    else{
      n++;
      s+="hi";
    }
  }
  if(ans==0) cout<<"No\n";
  else cout<<"Yes\n";
  return(0);
}


Measured memory_bytes: 256
n = int(input())
h = list(map(int, input().split()))
ans = 0
ansb = 0
for i in range(n-1):
    if h[i + 1] <= h[i]:
        ansb += 1
        if ansb > ans:
            ans = ansb
    else:
        ansb = 0
print(ans)


Measured memory_bytes: 20368
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using ii=pair<ll,ll>;
using vi=vector<ll>;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF (ll)1e18
#define all(x) (x).begin(),(x).end()
#define print(a); for(auto x:a)cout<<x<<" "; cout<<"\n";
#define mset(a); memset(a,0,sizeof(a));

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
    ll n;cin>>n;
    map<ll,ll,greater<ll>>v;
    ll a;ll sum=0;
    for(int i=0;i<n;i++){
        cin>>a;
        if(v.empty()){v[a]++;sum++;continue;}
        auto y=(*v.rbegin()).fi;
        if(a<=y){v[a]++;sum++;continue;}
        ll ans=-1;
        for(auto x:v){if(x.fi<a){ans=x.fi;break;}}
        if(v[ans]==1)v.erase(ans);
        else v[ans]--;
        v[a]++;
    }
    cout<<sum<<"\n";
}


Measured memory_bytes: 6400
N,A = map(int,input().split())
X = list(map(int,input().split()))

MAXSUM = sum(X)+5
dp = [[[0 for _ in range(MAXSUM)] for _ in range(N+5)] for _ in range(N+5)]
for i in range(N):
  dp[i+1][1][X[i]] += 1
  for k in range(N):
    for j in range(MAXSUM):
      dp[i+1][k][j] += dp[i][k][j]
      if X[i]+j < MAXSUM:
        dp[i+1][k+1][X[i]+j] += dp[i][k][j]
#print(dp)
ans = 0
for i in range(N):
  if A*(i+1) < MAXSUM:
    ans += dp[N][i+1][A*(i+1)]
print(ans)

Measured memory_bytes: 104540
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define rep(i, n) for (int i = 0; i < n; i++)

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

  bool flag = false;

  rep(i, S.size()) {
    rep(j, S.size() - i) {
      string temp(S);
      temp.erase(temp.begin() + i, temp.begin() + i + j);
      // cout << temp << endl;
      if (temp == "keyence") {
        cout << "YES" << endl;
        flag = true;
        break;
      }
    }
    if (flag == true) {
      break;
    }
  }

  if (!flag) cout << "NO" << endl;

  return 0;
}


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

const int maxn = 2e5 + 10;

int n, k;

int main() {
	cin >> n >> k;
	long long x = 0, y = 0;
	for (int i = 1; i <= n; ++i) {
		x += i % k == 0;
		y += i % k == k / 2;
	}
	cout << x * x * x + (k % 2 == 0) * y * y * y << "\n";
	return 0;
}

Measured memory_bytes: 256
from math import gcd
K = int(input())
i = 0
p = 0

def gcd3(a,b,c):
    d = gcd(a,b)
    e = gcd(d,c)
    return(e)

for a in range(1,K + 1):
    for b in range(a + 1,K + 1):
        for c in range(b + 1,K + 1):
            j = gcd3(a,b,c)
            i = i + j

for a in range(1,K + 1):
    for b in range(a + 1,K + 1):
        o = gcd(a,b)
        p = p + o

d = int((1 + K)* K /2)

print(6*i + d + 6*p)

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

int main(){
  string s,t, u;
  int n;
  char ch;

  cin >> n;
  for( int loop=0;loop<n;loop++ ){
    cin >> s >> t;

    //    cout << "\ns=" << s << endl << "t=" <<  t << endl;

    if( s.length()>80 || t.length()>80 ){
      cout << "overflow" << endl;
      continue;
    }

    while( s.length()>t.length() )
      t = "0" + t;
    while( t.length()>s.length() )
      s = "0" + s;
    /*
    cout << "s=" << s << " len=" << s.length() << endl;
    cout << "t=" << t << " len=" << t.length() << endl;
    */
    u="";
    int c=0;
    for( int i=s.length()-1;i>=0;--i ){
      int a = s[i]-'0';
      int b = t[i]-'0';
      int sum = a + b + c;
      if( sum>=10 ){
	sum-=10; c=1;
      }else
	c=0;
      ch = sum + '0';
      u = ch + u;
    }
    if( c==1 )
      u = "1" + u;

    if( u.length()>80 )
      cout << "overflow" << endl;
    else
      cout << u << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<algorithm>
#include<vector>
#define vi vector<int>
using namespace std;
int main(){vi v(4);vi v2(2);while(cin>>v[0]>>v[1]>>v[2]>>v[3]>>v2[0]>>v2[1]){sort(v.begin(),v.end());int ans=0;for(int i=1;i<4;i++)ans+=v[4-i];cout<<ans+max(v2[0],v2[1])<<endl;}}

Measured memory_bytes: 3088
N = int(input())
nums = [int(i) for i in input().split()]

border_num = 10 ** 18


if 0 in nums:
    output = 0
else :
    output = 1
    for _ in nums :
        output *= _
        if output > border_num:
            output = -1
            break
            
print(output)

Measured memory_bytes: 21604
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>
#include <deque>
using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;
#define LNF __LONG_LONG_MAX__;
const ll MOD = 1000000007;
const int MAX = 200000;

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;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//最大公約数
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
//最小公倍数
int lcm(int x, int y) { return x / gcd(x, y) * y; }
// nが大きく,kが10^7程度の時の二項係数
long long com[200005];
void combination(long long n,long long k){
    com[0] = 1;
    for(int i=1;i<=k;i++){
        com[i] = (com[i-1]*(n-i+1)%MOD)*modinv(i,MOD)%MOD;
    }
}

int main(){
    ll H,W; cin >> H >> W;
    if(H==1 || W==1){
        cout << 1 << endl;
        return 0;
    }
    ll out = ((W+1)/2)*((H+1)/2) + (W/2)*(H/2);
    //cerr << (W+1)/2 << " " << (H+1)/2 << endl;;
    //cerr << (W/2) << " " << (H+1)/2 << endl;
    cout << out << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int ans;

int gcd(int a,int b){
	if(max(a,b)%min(a,b)==0){
		return min(a,b);
	}else{
		return gcd(max(a,b)%min(a,b),min(a,b));
	}
}

int main(){
	int n,x,a;
	vector <int> l;
	cin>>n>>x;
	for(int i=0;i<n;i++){
		cin>>a;
		l.push_back(max(x,a)-min(x,a));
	}
	if(l.size()==1){
		cout<<l[0]<<endl;
	}else{
		for(int i=0;i<l.size()-1;i++){
			if(i==0){
				ans=gcd(l[i],l[i+1]);
			}else{
				ans=gcd(ans,l[i+1]);
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)     (a).begin(),(a).end()
#define MOD 1000000007

typedef long long int ll;

const ll INF=(ll)1e18;
//const int INF=(1<<30);


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

  int ans = 1;
  while(ans*2 <= N){
    ans *= 2;  
  }
  cout << ans << endl;
}



Measured memory_bytes: 256
/* Bismillahir Rahmanir Rahim */

#include <bits/stdc++.h>

#define rep(i, n)	for(int i=0;i<n;i++)
#define repn(i, n)	for(int i=1;i<=n;i++)
#define set(i, n)	memset(i, n, sizeof(i))

#define pb	push_back
#define f	first
#define s	second

using namespace std;

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

const int N = 100007;

int n, fx;
vector<int>edge[N];

int dfs(int at, int past){
	int mask = 0, cnt[25];
	set(cnt, 0);
	rep(i, edge[at].size()){
		int u = edge[at][i];
		if(u == past) continue;
		int fask = dfs(u, at);
		rep(j, 20){
			if(fask & (1 << j)) cnt[j]++;
		}
		mask |= fask;
	}
	int s = 0;
	for(int i=20;i>=0;i--){
		 if(cnt[i] < 2) continue;
		 s = i + 1;
		 break;
	} 
	for(int i=s;i<=20;i++){
		if(cnt[i] == 0){
			for(int j=0;j<i;j++) if(mask & (1 << j)) mask ^= (1 << j);
			mask |= (1 << i);
			return mask;
		}
	}
}

int main(){
	int x, y;
	scanf("%d", &n);
	repn(i, n-1){
		scanf("%d %d", &x, &y);
		edge[x].pb(y);
		edge[y].pb(x);
	}
	int ret = dfs(1, 1);
	for(int i=20;i>=0;i--){
		if(ret & (1 << i)){
			printf("%d\n", i);
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 19456
#include <iostream>
using namespace std;
int main(){

	for (int i = 1; i <= 10000; i++){
		int x;
		int y;		
		cin >> x >> y;
		if (x == 0&&y==0)break;
		int s;
		if (x > y){
			s = x;
			x = y;
			y = s;
		}
		cout << x << " " << y << endl;
	}
	return 0;
}

Measured memory_bytes: 3024
#include <bits/stdc++.h>
using namespace std;
struct Fast {
    Fast() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} fast;
template <typename A, size_t N, typename T> void Fill(A (&array)[N], const T& val) {
    std::fill((T*)array, (T*)(array + N), val);
}
// long long mod = 998244353;
#define REP(i, n) for (long long i = 0; i < (n); i++)
#define rep(i, a, n) for (long long i = a; i < (n); i++)
typedef long long ll;
typedef pair<ll, ll> P;
long long mod = 1000000007;
long long modpow(long long m, long long n, long long modvalue) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        long long t = modpow(m, n / 2, modvalue);
        return t * t % modvalue;
    } else {
        return modpow(m, n - 1, modvalue) * m % modvalue;
    }
}

long long moddiv(long long a, long long b, ll modvalue) { return (a * modpow(b, mod - 2, modvalue)) % modvalue; }

const ll INF = 1LL << 60;

string change_binary(long long a) {
    string ret;
    for (int i = 31; i >= 0; i--) {
        ret += (a >> i & 1) + '0';
    }
    return ret;
}

ll nCkmod(ll n, ll k, ll modvalue) {
    ll numera = 1;
    for (int i = n; i > n - k; i--) {
        numera *= i;
        numera %= modvalue;
    }
    ll denomi = 1;
    REP(i, k) {
        denomi *= (i + 1);
        denomi %= modvalue;
    }
    return moddiv(numera, denomi, modvalue);
}

map<ll, ll> cnt;
void primeFactors(long long n) {
    while (n % 2 == 0) {
        cnt[2]++;
        n = n / 2;
    }
    for (int i = 3; i <= sqrt(n); i = i + 2) {
        while (n % i == 0) {
            cnt[i]++;
            n = n / i;
        }
    }
    if (n > 2) {
        cnt[n]++;
    }
}
int main() {
    ll n;
    cin >> n;
    vector<ll> as(n);
    REP(i, n) { cin >> as[i]; }
    ll sum = 0;
    ll now = 0;
    REP(i, n) {
        sum += ((now % mod) * (as[n - i - 1] % mod)) % mod;
        now += as[n - i - 1];
        now %= mod;
        sum %= mod;
    }
    cout << sum % mod << endl;
}

Measured memory_bytes: 4740
#include "bits/stdc++.h"
using namespace std;
const int N=1e5+20,M=13,MOD=1e9+7;
char a[N];
int n;
long long p=1,ans,dp[N][M];
int main()
{
	scanf(" %s",a);
	n=strlen(a);

	for(int i=n-1;i>=0;i--)
	{
		int j=a[i]-'0';
		if(j>=0 and j<=9)
		{
			if(i==n-1) dp[i][j]=1;
			else
			{
				for(int k=0;k<M;k++)
					dp[i][(p*j+k)%M]=(dp[i][(p*j+k)%M]+dp[i+1][k])%MOD;
			}
		}
		else //it's a ?
		{
			for(int j=0;j<10;j++)
			{
				if(i==n-1) dp[i][j]=1;
				else
				{
					for(int k=0;k<M;k++)
						dp[i][(p*j+k)%M]=(dp[i][(p*j+k)%M]+dp[i+1][k])%MOD;
				}
			}
		}

		p=(p*10)%M;
	}

	cout<<dp[0][5];
}

Measured memory_bytes: 10496
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> A(n);
  bool flag = false;
  for (auto& a : A) {
    cin >> a;
    if (a % 2 == 0) {
      if (a % 3 != 0 && a % 5 != 0) {
        flag = true;
        break;
      }
    }
  }
  if (flag) {
    cout << "DENIED" << endl;
  } else {
    cout << "APPROVED" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>
#include <numeric>

using namespace std;

#define mod 1000000007

int solve(long long int a, long long int b)
{
	if(a + 1 >= b) return 2 * a - 2;
	long long int c = sqrt(a * b);
	if(c * c == a * b) c--;
	if(c * (c + 1) >= a * b) return 2 * c - 2;
	else return 2 * c - 1;
}

int main()
{
	int q;
	cin >> q;
	for(int i = 0; i < q; i++){
		long long int a, b;
		cin >> a >> b;
		cout << solve(min(a, b), max(a, b)) << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>      // memset
using namespace std;

int path[16][16][16][16];
int dp[16][16];

int main() {
    int n; cin >> n;
    while (n--) {
        int gx, gy; cin >> gx >> gy;

        int p; cin >> p;
        memset(path, -1, sizeof(path));
        for (int i = 0; i < p; i++) {
            int x1, y1, x2, y2;
            cin >> x1 >> y1 >> x2 >> y2;
            path[x1][y1][x2][y2] = 0;
            path[x2][y2][x1][y1] = 0;
        }

        memset(dp, 0, sizeof(dp));
        dp[0][0] = 1;
        for (int y = 0; y <= gy; y++) {
            for (int x = 0; x <= gx; x++) {
                if (x == 0 && y == 0) continue;
                if (x > 0 && path[x-1][y][x][y]) {
                    dp[x][y] += dp[x-1][y];
                }
                if (y > 0 && path[x][y-1][x][y]) {
                    dp[x][y] += dp[x][y-1];
                }
            }
        }
        if (dp[gx][gy] == 0) {
            cout << "Miserable Hokusai!" << endl;
        } else {
            cout << dp[gx][gy] << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3360
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(p,a,b)    for(int p=a;p<b;p++)
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define INF 0x3f3f3f3f

int C(int n,int r)
{
    int ans=1;
    if(r>n-r)r = n-r;

    for(int i=0 ; i<r ; i++)
    {
        ans *= ((n-i)/(i+1));
    }

    return ans;
}
 
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    ll n,k,i,t,ans=0;
    cin>>n>>k;

    if(n)ans=n*(n-1)/2;
    if(k)ans += k*(k-1)/2;
    cout<<ans;
    return 0;
}

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

using namespace std;

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

	int count[26] = {};

	for (int i = 0; i < w.size(); i++)
	{
		count[int(w[i]) - 97]++;
	}

	for (int i = 0; i < 26; i++)
	{
		if (count[i] % 2 == 1) {
			cout << "No" << endl;
			return 0;
		}
	}

	cout << "Yes" << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <queue>
#include <list>
#include <limits>
#include <string>
#include <vector>
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
const int MOD = 998244353;

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

int main()
{
  int N;
  ll M;
  vector<ll> divi;
  cin >> N >> M;
  for(int i=sqrt(M);i>=1;i--) {
    if(M%i == 0){
      divi.push_back(i);
      divi.push_back(M/i);
    }
  }
  sort(divi.begin(), divi.end());
  for(int i=divi.size()-1;i>=0;i--){
    if(M/divi[i] >= N) {
      cout << divi[i];
      return 0;
    }
  }
  return 0;
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

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

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int a = in.nextInt();
            int b = in.nextInt();
            int k = in.nextInt();
            int c = 0;
            ArrayList<Integer> x = new ArrayList<>();
            for (int i = 1; i <= a && i <= b; i++) {
                if (a % i == 0 && b % i == 0) {
                    c++;
                    x.add(i);
                }
            }
            out.println(x.get(x.size() - k));
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

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

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

    }
}



Measured memory_bytes: 21460
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, s, n) for (int i = (s); i < (int)(n); i++)
#define INF 100000000

using namespace std;

int main() {
   int a,b,c;
   cin >> a >> b >> c;
   if(a+b==c||b+c==a||c+a==b)
   cout << "Yes" << endl;
   else 
   cout << "No" << endl;
 }

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define lli long long int
#define ulli unsigned long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define loop(i,a,b) for(lli i=a;i<b;i++)
#define initialize(array,size,value) for(lli i=0;i<size;i++) array[i]=value
#define couta(array,size) for(lli i=0;i<size;i++) cout<<array[i]<<" "
#define vl vector<lli>
#define vp vector< pair <lli,lli> >
#define sl set<lli>
#define msp multiset < pair < long long , long long > > S;
#define pll pair<lli, lli>
#define mll map<lli, lli>
#define mvl map<lli, vl>
#define umll unordered_map<lli, lli>
#define vt vector<pair<lli, pll >  >
#define vf vector<pair<pll,pll > >
#define qu queue<lli>
#define pq priority_queue<lli>
#define dq deque <lli>
#define ptr vector<lli>::iterator
#define bs(array,x) binary_search(array.begin(),array.end(),x)
#define lb(array,x) lower_bound(array.begin(),array.end(),x)
#define ub(array,x) upper_bound(array.begin(),array.end(),x)
#define nobw(array,i,j) upper_bound(array.begin(), array.end(), j)-lower_bound(array.begin(), array.end(), i) //number of numbers between i & j
#define vc clear()
#define endl '\n'
#define sp system("pause");
int main()
{
 //	ios::sync_with_stdio(0);
 //   cin.tie(0);
    string s;
    cin>>s;lli n=s.size();
    lli r=0,b=0;
    for(lli i=0;i<n;i++){if(s[i]=='0')r++;if(s[i]=='1')b++;}
    cout<<min(r,b)*2;
    return 0;
}


Measured memory_bytes: 512
#include<cstdio>
#include<cstring>
#include<queue>
#include<algorithm>
#include<cmath>
#include<iostream>
using namespace std;
char a[100005];
int s[100005];
int N[4][2]= {{0,0},{0,1},{1,1},{1,0}};
int main()
{
    int n;
    while(scanf("%d",&n)!=-1)
    {
        scanf(" %s",a);
        int f=0;
        for(int k=0; k<4; k++)
        {
            s[0]=N[k][0],s[1]=N[k][1];
            for(int i=1; i<n+1; i++)
            {
                if(!s[i])
                {
                    if(a[(n+i)%n]=='o')
                        s[i+1]=s[i-1];
                    else
                        s[i+1]=s[i-1]^1;
                }
                else
                {
                    if(a[(n+i)%n]=='o')
                        s[i+1]=s[i-1]^1;
                    else
                        s[i+1]=s[i-1];
                }
            }
            if(s[0]==s[n]&&s[1]==s[n+1])
            {
                for(int i=0; i<n; i++)
                    if(!s[i])
                        putchar('S');
                    else
                        putchar('W');
                printf("\n");
                f=1;
                break;
            }
        }
            if(!f)puts("-1");
    }
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef long double Double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

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

class UnionFind {
    std::vector<int> p;

public:
    UnionFind(int n) : p(n, -1) {}

    int root(int x) { return p[x] < 0 ? x : p[x] = root(p[x]); }

    bool same(int x, int y) { return root(x) == root(y); }

    bool unite(int x, int y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (p[y] < p[x]) std::swap(x, y);
        if (p[x] == p[y]) --p[x];
        p[y] = x;
        return true;
    }
};


void solve(long long N, long long M, long long K, std::vector<long long> A,
           std::vector<long long> B, std::vector<long long> C,
           std::vector<long long> D) {

    UnionFind uf(N);
    map<int, int> fc;
    for (int i = 0; i < M; i++) {
        A[i]--;
        B[i]--;
        uf.unite(A[i], B[i]);
        fc[A[i]]++;
        fc[B[i]]++;
    }
    for(int i = 0 ; i < K ; i++){
        C[i]--;
        D[i]--;
        if( uf.same(C[i], D[i])) {
            fc[C[i]]++;
            fc[D[i]]++;
        }
    }
    vector<int> res;
    map<int, int> cnt;
    for(int i = 0 ; i < N ; i++)
        cnt[uf.root(i)]++;
    for (int i = 0; i < N; i++) {
        res.push_back(cnt[uf.root(i)] - fc[i]);
    }

    // o
    int x = 0;
    for (auto i : res) {
        if (x++) cout << " ";
        cout << i - 1;
    }
    cout << endl;
}

int main() {
    long long N;
    scanf("%lld", &N);
    long long M;
    scanf("%lld", &M);
    long long K;
    scanf("%lld", &K);
    std::vector<long long> A(M);
    std::vector<long long> B(M);
    for (int i = 0; i < M; i++) {
        scanf("%lld", &A[i]);
        scanf("%lld", &B[i]);
    }
    std::vector<long long> C(K);
    std::vector<long long> D(K);
    for (int i = 0; i < K; i++) {
        scanf("%lld", &C[i]);
        scanf("%lld", &D[i]);
    }
    solve(N, M, K, std::move(A), std::move(B), std::move(C), std::move(D));
    return 0;
}


Measured memory_bytes: 13688
n,m = gets.split.map(&:to_i)

# 1-origin!!!
g = Array.new(n+1){ [] }
seen = Array.new(n+1, -1)

m.times do
  a,b = gets.split.map(&:to_i)
  g[a] << b
  g[b] << a
end

q = [1]
seen[1] = 0
while !q.empty?
  v = q.shift
  g[v].each do |nv|
    next if seen[nv] != -1
    seen[nv] = v
    q << nv
  end
end

puts "Yes"
2.upto(n) do |i|
  puts seen[i]
end


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

string shuffle(string a, int b) {
        string head = a.substr(0, b);
        string rear = a.substr(b, a.size()-b);
        return rear + head;
}

int main(int argc, char const *argv[]) {
        string a;
        int m, b;
        while(cin >> a) {
                if(a == "-") break;
                cin >> m;
                for(int i = 0; i < m; i++ ) {
                        cin >> b;
                        a = shuffle(a, b);
                }
                cout << a << endl;
        }
        return 0;
}



Measured memory_bytes: 3172
# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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

  ll now = 7;
  bool flag = false;
  ll ans = 0;
  rep(i, k+2){
    if(now % k == 0) {
      flag = true;
      ans = i + 1;
      break;
    }
    now = ((now * 10) % k + 7) % k;
  }

  if(!flag) cout << -1 << endl;
  else cout << ans << endl;
}


Measured memory_bytes: 3616
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include <cmath>
#include <limits>
#include<set>
#include <iomanip>
#include <queue>
#include <string>
#pragma GCC optimize("Ofast")
using namespace std;
const long long INF=20000000000;
//setprecision(2) <<

const int MOD = 1000000007;

long long max(long long a,long long b){
	if(a<b)return b;
	else return a;	
}
long long min(long long a,long long b){
	if(a>b)return b;
	else return a;	
}
long long gcd(long long a,long long b){
	if(a<b)swap(a,b);
	if(a%b==0)return b;
	else return gcd(a%b,b);
}

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

long long com(long long n,long long k){
	
}
long long getDigit(long long n){
	if(n==1)return 1;
	else return log10(n)+1;
}
class G{
	long long node;
	long long w;
	
};
int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	string s;
	string data;
	cin>>s;
	for(int i=0;i<s.length();i++){
		if(s[i]!='B')data.push_back(s[i]);
		else{
			if(data.length()==0)continue;
			data.erase(data.end()-1);
		}
	}
	cout<<data<<endl;
}

	


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <cstdio>
#include <cmath>
#include <sstream>
#include <algorithm>

using namespace std;

int main() {
	string S, T;
	vector<string> v;

	cin >> S >> T;

	for (int i = 0; i < (int)S.size(); i++) {
		string temp = S;
		bool b = true;
		for (int j = 0; j < (int)T.size(); j++) {
			if ((int)S.size() - i < (int)T.size()) {
				b = false;
				break;
			}
			if (S[i + j] != '?' && S[i + j] != T[j]) {
				b = false;
				break;
			}
			temp[i + j] = T[j];
		}
		if (b) {
			for (int k = 0; k < (int)S.size(); k++) {
				if (temp[k] == '?') temp[k] = 'a';
			}
			v.push_back(temp);
		}
	}
	sort(v.begin(),v.end());

	if ((int)v.size() == 0) {
		cout << "UNRESTORABLE" << endl;
	}
	else {
		cout << v[0] << endl;
	}
	
}

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

signed main(){
    string s; cin>>s;
    vector<int> cnt(26);
    for(int i=0;i<s.size();i++){
        cnt[s[i]-'A']++;
    }
    sort(cnt.begin(),cnt.end(),greater<int>());
    if(cnt[0]==2 and cnt[1]==2){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std; 
  
typedef long long int ll; 
typedef pair<int, int> pii; 
typedef pair<ll, ll> pll; 
typedef pair<string, string> pss; 
typedef vector<int> vi; 
typedef vector<vi> vvi; 
typedef vector<pll> vll; 
typedef vector<ll> vl; 
typedef vector<vl> vvl; 
  
double EPS = 1e-9; 
long long INF = 1000000000000000005ll; 
double PI = acos(-1); 
#define M 1000000007ll
#define D 998244353ll
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define oset tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound  
#define SQR(x) ((LL)(x) * (x)) 
#define RESET(a, b) memset(a, b, sizeof(a))
#define GCD(a,b) __gcd(a,b)
#define setbits(x)   __builtin_popcountll(x)
#define zerobits(x)  __builtin_ctzll(x) 
#define ps(x,y)  fixed<<setprecision(y)<<x
#define endl '\n'
#define ff first 
#define ss second 
#define mp make_pair  
#define ALL(v) v.begin(), v.end() 
#define ALLA(arr, sz) arr, arr + sz 
#define SIZE(v) (int)v.size() 
#define SORT(v) sort(ALL(v)) 
#define REVERSE(v) reverse(ALL(v)) 
#define SORTA(arr, sz) sort(ALLA(arr, sz)) 
#define REVERSEA(arr, sz) reverse(ALLA(arr, sz)) 
#define PERMUTE next_permutation 
  
inline string IntToString(ll a) 
{ 
    char x[100]; 
    sprintf(x, "%lld", a); 
    string s = x; 
    return s; 
} 
  
inline ll StringToInt(string a) 
{ 
    char x[100]; 
    ll res; 
    strcpy(x, a.c_str()); 
    sscanf(x, "%lld", &res); 
    return res; 
} 
  
 
inline string uppercase(string s) 
{ 
    int n = SIZE(s); 
    for(ll i=0;i<n;i++) 
    if (s[i] >= 'a' && s[i] <= 'z') 
        s[i] = s[i] - 'a' + 'A'; 
    return s; 
} 
  
inline string lowercase(string s) 
{ 
    int n = SIZE(s); 
    for(ll i=0;i<n;i++) 
    if (s[i] >= 'A' && s[i] <= 'Z') 
        s[i] = s[i] - 'A' + 'a'; 
    return s; 
}
 
 
int main() {
    FAST
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    ll n;
    cin>>n;
    ll a[n];
    ll x=0;
    for(ll i=0;i<n;i++){
    	cin>>a[i];
    	x^=a[i];
    }
    for(ll i=0;i<n;i++){
    	cout<<(x^a[i])<<" ";
    }
    return 0;
}

Measured memory_bytes: 5164
#include <bits/stdc++.h>
#define ll long long
#define maxn 100005 /*rem*/
#define mod 998244353
#define db double
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define fi first
#define se second

template <typename T> bool chkmax(T &x,T y){return x<y?x=y,true:false;}
template <typename T> bool chkmin(T &x,T y){return x>y?x=y,true:false;}

using namespace std;
ll ksm(ll a, ll b) {
   if (!b) return 1;
   ll ns = ksm(a, b >> 1);
   ns = ns * ns % mod;
   if (b & 1) ns = ns * a % mod;
   return ns;
}
int a[maxn]; 
int main() {
	ll f = 1;
	int n;
	cin >> n;
	ll S = 0;
	for (int i = 0; i <= n; i++) scanf("%d", &a[i]), S += a[i];
	ll ans = 0;
	for (int i = 0; i <= n; i++) {
		ans += f;
	//	cout << i << ' ' << f << endl;
		if (f < a[i]) {
			cout << -1 << endl;
			return 0;
		}
		f -= a[i];
		S -= a[i];	
		f *= 2;
		f = min(f, S);
	
	}
	cout << ans << endl;
	return 0;
}


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

int a[100000], dp[200001];
signed main() {
	int n, k; cin >> n >> k;
	memset(dp, 0x3f, sizeof(dp));
	dp[0] = 0;
	for (int i = 0; i < n; i++)cin >> a[i];
	for (int i = 0; i < n; i++) {
		for (int j = 1; j <= k; j++) {
			dp[i + j] = min(dp[i + j], dp[i] + abs(a[i + j] - a[i]));
		}
	}
	cout << dp[n - 1] << endl;
}


Measured memory_bytes: 1408
c = [list(map(int, input().split())) for _ in range(3)]

for b1 in range(101):
    a = [c[0][0] - b1, c[1][0] - b1, c[2][0] - b1]
    b = [b1, c[0][1] - a[0], c[0][2] - a[0]]
    if all(a[i] + b[j] == c[i][j] for j in range(3) for i in range(3)):
        print('Yes')
        exit()

print('No')


Measured memory_bytes: 3064
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

// CHECK THE LIMITS
typedef long long ll;

static const int NMAX = 1e5;

int gcd(int a, int b) {
  return b ? gcd(b, a%b) : a;
} 

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

    ll n,k;
    cin >> n >> k;
    vector<ll> v(n+1);
    for(int i = 1; i <= n; ++i)
    {
        cin >> v[i];
        v[i]--;
    }

    map<ll,ll> nrSume;
    nrSume.insert({0,1});
    vector<ll> pref(n+1);
    ll sol = 0;
    for(int i = 1; i<= n; ++i)
    {
        if(i >= k)
        {
            nrSume[pref[i-k]]--;
        }
        pref[i] = pref[i-1]+v[i];
        pref[i]%=k;
        if(nrSume.count(pref[i]))
        {
            sol+=nrSume[pref[i]];
            nrSume[pref[i]]++;
        }
        else
        {
            nrSume.insert({pref[i],1});
        }
    }
    cout << sol;

    return 0;
}

Measured memory_bytes: 15872
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
using namespace std;
typedef long long int ll;

#define MOD 998244353


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

bool primeNumber(ll n){
    if(n < 2) return false;
    else{
        for(ll i = 2; i * i <= n; i++){
            if(n % i == 0) return false;
        }
        return true;
    }
}
  
  

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



Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long int ll;

using namespace std;

int main()
{
    string s;

    cin >> s;


    ll kasu = 0;

    for(ll i=0; i<s.size();i++){

        int a;

        a = s[i] - '0';


        kasu = (kasu + a)%9;





    }






    if(kasu ==0){

        cout << "Yes" << endl;
    }

    else{

        cout << "No" << endl;
    }

return 0;
}

Measured memory_bytes: 3744
#include <iostream>

int main()
{
    int sec;
    std::cin >> sec;

    int min = sec / 60;
    int hour = min / 60;
    sec %= 60;
    min %= 60;

    std::cout
        << hour << ":"
        << min << ":"
        << sec
        << std::endl;
    return 0;
}

Measured memory_bytes: 1168
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pint = pair<int,int>;


const long long INFLL = 1LL << 60;
const int INFI = 1000000000;

int main(){
    string s; cin >> s;
    int len = s.size();
    map<char,set<int>> m{};
    for(int i=0;i<s.size();i++) m[s[i]].insert(i);
    bool flag=true;
    int ans=0;
    while(flag){
        for(auto i:m){
            if(i.second.size()==len-ans) {flag=false; break;}
        }
        if(flag){
            ans++;
            for(auto i:m){
                for(auto j:i.second){
                    if(j-1>=0) m[i.first].insert(j-1);
                    if(j>len-ans-1) m[i.first].erase(j);
                }
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#include<algorithm>
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007
ll gcd(ll a,ll b){
	if(b==0){
		return a;
	}
	return gcd(b,a%b);
}
int main() {
	ll n,m;
	cin>>n>>m;
	ll ch[100010];
	for(ll i=0;i<n;i++){
		cin>>ch[i];
		ch[i]/=2;
	}
	ll cnt=0;
	for(ll i=0;i<n;i++){
		ll now=0;
		while(ch[i]%2==0){
			now++;
			ch[i]/=2;
		}
		if(i==0){
			cnt=now;
			continue;
		}
		if(now!=cnt){
			cout << 0;
			return 0;
		}
	}
	while(cnt!=0){
		cnt--;
		m/=2;
	}
	ll lcm=ch[0];
	for(ll i=1;i<n;i++){
		ll now=gcd(max(lcm,ch[i]),min(lcm,ch[i]));
		//cout << now<<endl;
		//cout << lcm<<endl;
		//cout << ch[i]<<endl;
		now=lcm/now*ch[i];
		if(now>m){
			cout << 0;
			return 0;
		}
		lcm=now;
	}
	cout << (m+lcm)/(2*lcm);
	// your code goes here
	return 0;
}


Measured memory_bytes: 4380
fun main (args: Array<String>) {
    val n = readLine()!!.toInt()
    val p = readLine()!!.split(' ').map(String::toInt)
    var count = 0
    for (i in 1 until n-1) {
        val po = listOf(p[i-1], p[i], p[i+1]).sorted()
        if (p[i] == po[1]) {
            count ++
        }
    }
    println(count)
}


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

int main(){
    int s;
    int i;
    int count = 0;
    

    cin >> s;
    
    for (i=0; i<3; i++) {
        if (s%10==1) {
            count = count + 1;
        }
        s = s /10;
        //cout << s << endl;
    }

    //cout << "count = " << count << endl;
    cout  << count << endl;

}

Measured memory_bytes: 3636
for _ in range(int(input())):
    a = input()
    b = input()
    indices = []
    for cb in b:
        bgn_idx = 0
        for i, cur_idx in enumerate(indices):
            chr_idx = a.find(cb, bgn_idx) + 1
            if not chr_idx:
                break
            if chr_idx < cur_idx:
                indices[i] = chr_idx
            bgn_idx = cur_idx
        else:
            chr_idx = a.find(cb, bgn_idx) + 1
            if chr_idx:
                indices.append(chr_idx)
    print(len(indices))


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

int n, c[10005];
int main() {
	int i, j, k, x;
	cin >> n;
	for(i=1; i*i<=n; i++) for(j=1; j*j<=n; j++) for(k=1; k*k<=n; k++) {
		x = i*i + j*j + k*k + i*j + j*k + k*i;
		if(x<=n) c[x]++;
	}
	for(i=1; i<=n; i++) printf("%d\n", c[i]);
	return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define loope(i,a,b) for(ll i=a;i<=b;i++)
#define test() ull t;cin>>t;while(t--)
#define puu pair<ull,ull>
#define f first
#define s second
#define pb push_back
#define mkp make_pair
#define ins insert
#define Vint vector<int>
#define Vll vector<ll>
#define Vull vector<ull>
#define nl cout<<endl
#define sp cout<<" "
#define MOD 1000000007
#define all(x) x.begin(),x.end()

int main() 
{
	 // #ifndef ONLINE_JUDGE
  //       freopen("input.txt", "r", stdin);
  //       freopen("output.txt", "w", stdout);
  //   #endif
  //   fastio();
    ll n;
    cin>>n;
    ll v[n][3];
    loop(i,0,n)
    {
    	loop(j,0,3)
    		cin>>v[i][j];
    }
  
    vector<vector<ll>> dp(n,vector<ll>(3,0));
    dp[0][0] = v[0][0];
    dp[0][1] = v[0][1];
    dp[0][2] = v[0][2];
    loop(i,1,n)
    {
    	loop(j,0,3)
    		dp[i][j] = max(dp[i-1][(j+1)%3],dp[i-1][(j+2)%3]) + v[i][j];
    }

    ll ans = max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
    cout<<ans;

}

Measured memory_bytes: 8064
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, a, b) for(int i = (a); i <= (b); i++)
#define PER(i, a, b) for(int i = (a); i >= (b); i--)
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define all(S) (S).begin(), (S).end()
#define pf push_front
#define pb push_back
#define mk make_pair
#define S second
#define F first
typedef long long ll;
typedef long double lf;
typedef pair<int, int> ii;
const int MAX = 1e5+5;
int N, w[MAX][5];
ll pd[MAX][5];

ll solve() {
	REP(i, 1, N) {
		pd[i][1] = max(pd[i-1][2], pd[i-1][3]) + w[i][1];
		pd[i][2] = max(pd[i-1][1], pd[i-1][3]) + w[i][2];
		pd[i][3] = max(pd[i-1][1], pd[i-1][2]) + w[i][3];
	}
	return max(pd[N][1], max(pd[N][2], pd[N][3]));
}

int main(int argc, char ** argv) {
	scanf("%d", &N);
	REP(i, 1, N) REP(j, 1, 3)
		scanf("%d", &w[i][j]);
	printf("%d\n", solve());
	return 0;
}


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

int main() {
int N;
cin >> N;
string A,B;
cin >> A >> B;

for (int i = 0;i < N;i++) {
  cout << A.at(i) << B.at(i);
}
cout << endl;

return 0;
}

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

#define all(s) s.begin(), s.end()
#define pb push_back
#define ii pair<int, int>
#define x first
#define y second
#define bit(x, y) ((x >> y) & 1)
#define sz(s) ((int) (s).size())

const int N = 1000005;

int a[N];
int fac[N];

int v2C(int n, int k) {
    return fac[n] - fac[k] - fac[n - k];
}

int main() {
    ios::sync_with_stdio(false); cin.tie(0); 
    cout.tie(0);
    int n;
    cin >> n;
    string s;
    cin >> s;
    s = " " + s;
    bool check = 0;
    for (int i = 1; i <= n; i++) {
        a[i] = s[i] - '0' - 1;
        if (a[i] == 1) check = 1;
    }
    for (int i = 1; i <= n; i++) {
        int foo = i;
        fac[i] = fac[i - 1];
        while (foo % 2 == 0) {
            fac[i]++;
            foo /= 2;
        }
    }
    int sum = 0;
    for (int i = 1; i <= n; i++) {
        if (v2C(n - 1, i - 1) == 0) {
            sum += a[i];
        }
    }
    if (sum % 2) return cout << 1, 0;
    if (check) return cout << 0, 0;
    sum = 0;
    for (int i = 1; i <= n; i++) {
        a[i] /= 2;
    }
    for (int i = 1; i <= n; i++) {
        if (v2C(n - 1, i - 1) == 0) {
            sum += a[i];
        }
    }
    if (sum % 2) cout << 2;
    else cout << 0;
    return 0;
}

Measured memory_bytes: 9168