akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

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

    vector<bool> has(N, false);
    for (int i = 0; i < K; i++)
    {
        int di;
        cin >> di;
        for (int j = 0; j < di; j++)
        {
            int Aii;
            cin >> Aii;
            Aii--;
            has.at(Aii) = true;
        }
    }

    int res = 0;
    for (int i = 0; i < N; i++)
    {
        if (!has.at(i))
        {
            res++;
        }
    }
    cout << res << endl;
}

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

#define FOR(a, b, c) for(int a = b; a <= c; ++a)
#define FORW(a, b, c) for(int a = b; a >= c; --a)
#define fi first
#define se second
#define pb push_back
#define int long long

typedef pair<int, int> ii;
typedef pair<int, ii> iii;

const int N = 1e5 + 100;
const int maxN = 1e16;
const int oo = 1e18;
const int mod  = 998244353;

signed main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    int n; cin >> n;
    int sum = 0;
    FOR(i, 1, n) if(i % 3 && i % 5) sum += i;
    cout << sum;
}


Measured memory_bytes: 3640
#include <iostream>
#include <cctype>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
	int n, i;
	double ans = 1;
	cin >> n;
	for (int i = 1; i < n; i++) {
		for (int j = 2; j < n; j++) {
			if (pow(i,j) > ans&&n >= pow(i,j))
				ans = pow(i,j);
		}
	}
	printf("%d\n", (int)ans);
}

Measured memory_bytes: 256
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 100000000000000000

vector<pair<long long, long long>> prime_factorize(long long N) {
    vector<pair<long long, long long>> res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0)
            continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // その結果を push
        res.push_back({a, ex});
    }

    // 最後に残った数について
    if (N != 1)
        res.push_back({N, 1});
    return res;
}

int main() {
    ll N;
    cin >> N;
    vector<pair<ll, ll>> pri = prime_factorize(N);

    ll mi = 0, cnt = 0;
    while (true) {
        bool judge = 1;
        mi++;
        rep(i, pri.size()) {
            if (pri[i].second >= mi) {
                pri[i].second -= mi;
                cnt++;
                judge = 0;
            }
        }
        if (judge)
            break;
    }

    cout << cnt << endl;
}

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

const long long l = 5000000000000000;
int main() {
    string S;
    long long K;
    int a, i;
    cin >> S >> K;
    i = 0;
    while (K > 0) {
        if (S[i++] == '1') {
            K--;
            a = 1;
        } else {
            a = S[--i] - '0';
            break;
        } 
    }
    printf("%d\n", a);
    return 0;
}

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

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader inp = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(inp, out);
        out.close();
    }

    private static class Solver {
        private void solve(InputReader inp, PrintWriter out) {
            int n = inp.nextInt(), m = inp.nextInt();
            ArrayList<Integer>[] graph = new ArrayList[n];
            ArrayList<Integer>[] parents = new ArrayList[n];
            for (int i = 0; i < n; i++) {
                graph[i] = new ArrayList<>();
                parents[i] = new ArrayList<>();
            }
            for (int i = 0; i < m; i++) {
                int x = inp.nextInt() - 1, y = inp.nextInt() - 1;
                graph[x].add(y);
                parents[y].add(x);
            }
            int[] dp = new int[n];
            int[] t = topologicalSort(graph);
            for (int node: t) {
                for (int parent: parents[node]) {
                    dp[node] = Math.max(dp[node], dp[parent] + 1);
                }
            }
            int res = 0;
            for (int i: dp) res = Math.max(res, i);
            out.print(res);
        }

        private static int[] topologicalSort(ArrayList<Integer>[] graph) {
            int n = graph.length;
            int[] in_degree = new int[n];
            for (int i = 0; i < n; i++) {
                for (int to: graph[i]) in_degree[to]++;
            }
            int[] res = new int[n];
            int j = 0;
            for (int i = 0; i < n; i++) {
                if (in_degree[i] == 0) res[j++] = i;
            }
            for (int i = 0; i < j; i++) {
                for (int to: graph[res[i]]) {
                    if (--in_degree[to] == 0) res[j++] = to;
                }
            }
            for (int i = 0; i < n; i++) {
                if (in_degree[i] > 0) {
                    return null; //graph contains cycles
                }
            }
            return res;
        }
    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

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

        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());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
    }
}




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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
    ll x,y; cin>>x>>y;


    ll tmp = x;
    ll res = 0;
    while(tmp <= y) {
        tmp *= 2;
        ++res;
    }

    cout << res << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back

int main()
{
    int a,b;
    cin>>a>>b;
    int c=1;
    if(b==1)
        cout<<0;
    else
    {
        if(a>=b)
        {cout<<1;return 0;}
        else
        {
           b=b-a;
           a--;
           if(b%a==0)
            c+=b/a;
           else
            c+=(b/a)+1;

    }
    cout<<c;
}
}



Measured memory_bytes: 256
#include <stdio.h>

int main()
{
  int a, b;
  int c, d;
  int i = 1;
  
  scanf("%d %d %d %d", &a, &b, &c, &d);
  
  while (i > 0) {
    c = c - b;
    
    if (c <= 0) {
      printf("Yes");
      break;
    }
    
    a = a - d;
    
    if (a <= 0) {
      printf("No");
      break;
    }
  }
    
  return 0;
}

Measured memory_bytes: 1668
#include<stdio.h>

int main(void)
{
        int n,i,j,mojisu[100],k;
        char w[100][11];

        scanf("%d",&n);
        for(i=0;i<n;i++)
                scanf("%s",w[i]);


        for(i=0;w[n-1][i]!='\0';i++);
        mojisu[n-1] = i;

        for(i=1;i<n;i++){
                for(j=0;w[i-1][j]!='\0';j++);
                if(w[i-1][j-1]!=w[i][0]){
                        printf("No\n");
                        return 0;
                }
                mojisu[i-1] = j;
        }

        for(i=0;i<n-1;i++){
                for(j=i+1;j<n;j++){
                        if(mojisu[i]==mojisu[j]){
                                k=0;
                                while(w[i][k]!='\0'){
                                        if(w[i][k]!=w[j][k])
                                                break;
                                        k++;
                                }
                                if(k==mojisu[i]){
                                        printf("No\n");
                                        return 0;
                                }
                        }
                }
        }

        printf("Yes\n");
        return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
using namespace std;
long long int a[100005];
int main()
{
	long long int N;
	while (scanf("%lld", &N) != EOF)
	{
		memset(a, 0, sizeof(a));
		for (long long int i = 1; i <= N; i++)
			scanf("%lld", &a[i]);
		if (a[1] != 0)            //首先判断这棵树的第一位到1距离是否为0，不为零则此树不存在
		{
			printf("0\n");
			continue;
		}
		sort(a + 1, a + N + 1);
		long long int flog = 0;
		for (long long int i = 2; i <= N; i++) 
		{
			if (abs(a[i] - a[i - 1]) != 0 && abs(a[i] - a[i - 1]) != 1)   //判断相邻节点距离是否差0或1
			{
				flog = 1;
				break;
			}
		}
		if (flog==1) 
		{
			printf("0\n");
			continue;
		}
		long long int i = 2, cnt = 1, n = 0;
		for (; a[i] == 1; i++)
			n++;
		for (; i <= N;)       
		{
			long long int d = a[i], s = 1, nn = 0;
			for (; a[i] == d && i <= N; i++)    //模拟本层树的上层树的次方数
			{
				nn++;
				s = (s * n) % 998244353;
			}
			cnt = (cnt * s) % 998244353;
			n = nn;
		}
		printf("%lld\n", cnt);
	}
	return 0;
}


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

int main() {

	int n; cin >> n;
	const int p = 26;
	vector<vector<int>> num(n, vector<int>(p, 0));
	for (int i = 0; i < n; i++) {
		string s; cin >> s;
		for (int j = 0; j < s.size(); j++) {
			num[i][s[j] - 'a']++;
		}
	}

	string ans = "";
	for (int j = 0; j < p; j++) {
		int tmpMin = 2147483647;
		for (int i = 0; i < n; i++) {
			tmpMin = min(tmpMin, num[i][j]);
		}
				while (tmpMin--) {
			ans += (char)(j + 'a');
		}
	}

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

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

int main()
{
	int a, b;
	char op;
	while (cin >> a >> op >> b )
	{
		if (op == '+')
		{
			cout << a + b << endl;
		}
		else if(op == '-')
		{
			cout << a - b << endl;
		}
		else if (op == '*')
		{
			cout << a * b << endl;
		}
		else if (op == '/')
		{
			cout << a / b << endl;
		}
		else break;
	}
}

Measured memory_bytes: 1160
program sample
    implicit none
  
    integer(8) :: i,j,m,n,s,t,xi,yi,b,c
   
    integer(8),allocatable :: p(:),q(:),a(:)
  
    read(*,*) n
    allocate(p(n),q(n),a(n))

    read(*,*)p
    read(*,*)q
    do i=1,n
        a(i)=0
    end do

    do i=1,n
        s=p(i)
        call index(a,n,s,m)
        p(i)=m-1
    end do

    do i=1,n
        a(i)=0
    end do
    do i=1,n
        s=q(i)
        call index(a,n,s,m)
        q(i)=m-1
    end do
    s=0
    do i=1,n-1
        s=(s+(p(i)-q(i)))*(n-i)
    enddo
  
    write(*,*) abs(s)
  
    stop
    contains
    subroutine index(a,n,s,m)
        integer(8)::a(n)
        integer(8)::n,s,i,m
        m=s
        do i=1,s-1
            if (a(i)==1)then
                m=m-1
            end if
        end do
        a(s)=1

    end subroutine index

 end program sample
  



Measured memory_bytes: 2852
#include<bits/stdc++.h>
using namespace std;
typedef long long int64;
const int64 INF = 1LL << 55;
int main()
{
  int N, t[10000] = {};
  int64 dp[5001][2];
  fill_n(*dp, 5001 * 2, INF);
  cin >> N;
  for(int i = 0; i < N - 1; i++) {
    cin >> t[i];
  }
  dp[1][0] = dp[0][1] = 0;
  for(int i = 0; i < N - 1; i++) {
    for(int j = N / 2; j > 0; j--) {
      dp[j][1] = min(dp[j    ][1], dp[j    ][0] + t[i]);
      dp[j][0] = min(dp[j - 1][0], dp[j - 1][1] + t[i]);
    }
  }
  cout << dp[N / 2][1] << endl;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
 
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define endl "\n"
#define ll long long
#define ld long double
#define l_b lower_bound
#define u_b upper_bound
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll, ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define heap priority_queue
#define umap unordered_map
#define sz(a) int((a).size())
#define all(c) c.begin(),c.end()
#define test() ll t;cin>>t;while(t--)
#define mset(a,x) memset(a,x,sizeof(a))
#define rep(i,a,n) for(ll i = a; i < n; ++i) 
#define debug(x) cout<<(#x)<<" is "<<(x)<<endl
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0)
 
const int inf = 1e9;
const int mod = 1e9 + 7;
const int N = 1e6 + 5;


int main() {
	// fastIO;
    int a, b, n;
    cin >> n >> a >> b;
    cout << min(n*a, b);
    
	return 0;
}

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

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


Measured memory_bytes: 3092
#include <bits/stdc++.h>
#define pout(n)  printf ("%d\n", n)

#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)

const int d4x[4] = {1, 0, -1, 0};
const int d4y[4] = {0, 1, 0, -1};
const int d8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const int d8y[8] = { 0,1,1,1,0,-1,-1,-1 };

typedef long long ll;
using namespace std;

int main() {
  int n;
  cin >> n;
  int c[n],s[n],f[n];
  rep(i,0,n-1){
    cin >> c[i] >> s[i] >> f[i];
  }
  rep(i,0,n){
    int t = 0;
    rep(j,i,n-1){
      if(t<s[j]) t=s[j];
      else if(t%f[j] == 0);
      else t=t+f[j]-t%f[j];
      t+=c[j];
    }
    pout(t);
  }
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
#define rep(i,n) for(int i=0;i<n;i++)
#define all(in) in.begin(), in.end()
constexpr int INF = (numeric_limits<int>::max() == INT_MAX ? (int)1e9 : (long long)1e18);
constexpr long double eps = 1e-6;
const string el = "\n";
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
using ld  = long double;using pii = pair<int,int>;using piii = pair<int,pii>;
int W,H;
int dx[]={0,0,1,-1}, dy[]={1,-1,0,0};
bool valid(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
void fast_io(){ios::sync_with_stdio(false); cin.tie(nullptr);}
bool prime(int num){
    for(int i = 2; i * i <= num; ++i){
        if(num % i == 0) return false;
    }
    return true;
}
signed main(){
    fast_io();
    vector<int>p;
    for(int i = 3; i <= 100000; ++i){
        if(prime(i) && prime((i + 1)/2))p.push_back(i);
    }
    int Q; cin >> Q;
    rep(_,Q){
        int l,r; cin >> l >> r;
        auto itr = lower_bound(all(p),l);
        auto itr2 = upper_bound(all(p),r);
        cout << max(0LL,(int)(itr2 - itr)) << endl;
    }
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define F first
#define S second
#define PB push_back
#define REP(i,a,b) for (int i = a ; i <= b ; i++)
#define REPI(i,a,b) for (int i = a ; i >= b ; i--)
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

const ll OO = 1e18+7;
const int MOD = 1e9+7;
const int N = 100+7;
const int V = 1e5+7;

ll mem[N][V];
ll w[N],v[N];
int n,maxw;

ll dp(int i,int remv)
{
    ll &ret = mem[i][remv];
  	if (ret != -1) return ret;
  	if (i == n && remv == 0) return ret = 0;
  	else if (i == n) return ret = OO;
  	ll ret1 = dp(i+1,remv);
  	ll ret2 = OO;
  	if (remv-v[i] >= 0) ret2 = dp(i+1,remv-v[i])+w[i];
  	return ret = min(ret1,ret2);
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    //freopen("teleport.in","r",stdin);
    //freopen("teleport.out","w",stdout);

	memset(mem,-1,sizeof mem);
  	cin >> n >> maxw;
  	REP(i,0,n-1) cin >> w[i] >> v[i];
	ll ans = 0;
	REPI(i,V-1,0)
	{
	    //cerr << dp(0,i) << endl;
	    if (dp(0,i) <= maxw) {ans = i;break;}
	}
	cout << ans << endl;
    return 0;
}


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

const int mod = 998244353;

int po(int x, int n) {
    int ret = 1;
    while(n) {
        if(n & 1) ret = 1LL * ret * x % mod;
        x = 1LL * x * x % mod;
        n >>= 1;
    }
    return ret;
}
int inv(int x) { return po(x, mod - 2); }

int fact[1000010], invf[1000010];

int comb(int n, int k) {
    return 1LL * fact[n] * invf[k] % mod * invf[n - k] % mod;
}

int N, M;
int dp[1000010], prec1[1000010], prec2[1000010];

int main() {
    fact[0] = 1;
    for(int i = 1; i < 1000010; i++) {
        fact[i] = 1LL * fact[i - 1] * i % mod;
    }
    for(int i = 0; i < 1000010; i++) {
        invf[i] = inv(fact[i]);
    }

    cin >> N >> M;

    prec1[1] = comb(N + M - 1, N);
    for(int i = 2; i <= N + M; i++) {
        if(i / 2 > M - 1) {
            prec1[i] = 0;
            continue;
        }
        if(i % 2) {
            prec1[i] = prec1[i - 1];
            if(i / 2 <= N) {
                prec1[i] += 1LL * comb((i / 2) * 2 - 1, i / 2) * comb(N + M - 1 - (i / 2) * 2, N - i / 2) % mod;
                prec1[i] %= mod;
            }
        }
        else {
            prec1[i] = prec1[i - 1];
            if(i / 2 <= N) {
                prec1[i] -= 1LL * comb(N + M - (i / 2) * 2, N - i / 2) * comb((i / 2 - 1) * 2, i / 2 - 1) % mod;
                prec1[i] = (prec1[i] % mod + mod) % mod;
            }
        }
    }
    prec2[1] = comb(N + M - 1, M);
    for(int i = 2; i <= N + M; i++) {
        if(i / 2 > N - 1) {
            prec2[i] = 0;
            continue;
        }
        if(i % 2) {
            prec2[i] = prec2[i - 1];
            if(i / 2 <= M) {
                prec2[i] += 1LL * comb((i / 2) * 2 - 1, i / 2) * comb(N + M - 1 - (i / 2) * 2, M - i / 2) % mod;
                prec2[i] %= mod;
            }
        }
        else {
            prec2[i] = prec2[i - 1];
            if(i / 2 <= M) {
                prec2[i] -= 1LL * comb(N + M - (i / 2) * 2, M - i / 2) * comb((i / 2 - 1) * 2, i / 2 - 1) % mod;;
                prec2[i] = (prec2[i] % mod + mod) % mod;
            }
        }
    }

    dp[0] = 0;
    for(int i = 1; i <= N + M; i++) {
        dp[i] = dp[i - 1];
        dp[i] += prec1[i];
        dp[i] %= mod;
        dp[i] += prec2[i];
        dp[i] %= mod;
    }

    int ans = 0;
    for(int i = 1; i <= N + M; i++) {
        ans += 1LL * dp[i] * inv(i) % mod;
        ans %= mod;
    }
    ans = 1LL * ans * inv(1LL * fact[N + M] * invf[N] % mod * invf[M] % mod) % mod;
    cout << ans;
}


Measured memory_bytes: 19840
// practice with Dukkha
#include <algorithm>
#include <iostream>

using namespace std;

const int N = 40, A = 10, B = 10, INF = 0x3f3f3f3f;

int dp[A * N + 1][B * N + 1];

int main() {
	int n, ma, mb; cin >> n >> ma >> mb;
	for (int i = 0; i <= A * n; i++)
		for (int j = 0; j <= B * n; j++)
			dp[i][j] = INF;
	dp[0][0] = 0;
	for (int h = 0; h < n; h++) {
		int a, b, c; cin >> a >> b >> c;
		for (int i = A * n - a; i >= 0; i--)
			for (int j = B * n - b; j >= 0; j--) {
				int x = dp[i][j];
				if (x != INF)
					dp[i + a][j + b] = min(dp[i + a][j + b], x + c);
			}
	}
	int ans = INF;
	for (int k = 1, i, j; (i = k * ma) <= A * n && (j = k * mb) <= A * n; k++)
		ans = min(ans, dp[i][j]);
	cout << (ans != INF ? ans : -1) << '\n';
	return 0;
}


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

int main(int argc, char const *argv[])
{
	long long n;
	cin>>n;
	if (n==2)
	{
		cout<<"0\n";
		return 0;
	}
	long long ans=n-1LL;
	for (long long i = 2; i*i <= n; ++i)
	{
		if (n%i==0)
		{
			if (n/(i-1LL)==n%(i-1LL))
			{
				++ans;
			}
			if (n/i!=i&&n/(n/i-1LL)==n%(n/i-1LL))
			{
				ans+=n/i-1LL;
			}
		}	
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll INF=1001001001;
const ll LINF=1001001001001001001;
#define overload4(_1,_2,_3,_4,name,...) name
#define rep1(n) for(ll i=0;i<(n);++i)
#define rep2(i,n) for(ll i=0;i<(n);++i)
#define rep3(i,a,b) for(ll i=(a);i<(b);++i)
#define rep4(i,a,b,c) for(ll i=(a);i<(b);i+=(c))
#define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define vec vector<ll>
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;}
const string YES = "Yes";
const string NO = "No";

void solve(ll n, ll m){
    cout<<(n==m?YES:NO)<<endl;
}

int main(){
    ll n;
    scanf("%lld",&n);
    ll m;
    scanf("%lld",&m);
    solve(n, m);
    return 0;
}


Measured memory_bytes: 764
H,W = map(int, raw_input().split())
s = [raw_input() for _ in range(H)]
ans = "Yes"
for y in range(H):
  for x in range(W):
    if s[y][x]=="#":
      ok = False
      for dx,dy in [(-1,0), (1,0), (0,-1), (0,1)]:
        if 0<=x+dx<W and 0<=y+dy<H and s[y+dy][x+dx]=="#":
          ok = True
      if not ok:
        ans = "No"
print ans


Measured memory_bytes: 2568
#include <algorithm>
#include <iostream>
#include <vector>
#include <iomanip>
using namespace std;

typedef long long ll;

struct FenwickTree {
  vector<ll> data;
  explicit FenwickTree(int n): data(n, 0) {}
  void add(int i, ll x) { for (; i < (int)data.size(); i |= i + 1) data[i] += x; }
  ll sum(int i) const { ll s = 0; for (; i >= 0; i = (i & i + 1) - 1) s += data[i]; return s; }
};

struct Bug { ll emission, acceptable; int index; };

int main() {
  int N;
  while (cin >> N) {
    vector<Bug> bugs(N);
    for (int i = 0; i < N; ++i)
      cin >> bugs[i].emission >> bugs[i].acceptable;

    FenwickTree ft1(N), ft2(N);
    sort(begin(bugs), end(bugs), [](const Bug& a, const Bug& b) { return a.emission < b.emission; });
    for (int i = 0; i < N; ++i) {
      bugs[i].index = i;
      ft1.add(i, bugs[i].emission);
      ft2.add(i, 1);
    }

    ll answer = 0;
    sort(begin(bugs), end(bugs), [](const Bug& a, const Bug& b) { return a.acceptable < b.acceptable; });
    for (const Bug& b : bugs) {
      int lo = 0, hi = N;
      while (lo < hi) {
        int mid = (lo + hi) / 2;
        if (ft1.sum(mid) <= ft2.sum(mid) * b.acceptable)
          lo = mid + 1;
        else
          hi = mid;
      }
      if (lo > 0) answer = max(answer, ft2.sum(lo - 1));
      ft1.add(b.index, -b.emission);
      ft2.add(b.index, -1);
    }
    cout << answer << endl;
  }
}

Measured memory_bytes: 12748
import sys
input = sys.stdin.readline
n = int(input())
chk = []
for _ in range(n):
  f = input().split()
  chk.append(int(''.join(f),2))
chk = tuple(chk)

p = [] 
for _ in range(n):
  P = [int(i) for i in input().split()]
  P = tuple(P)
  p.append(P)
p = tuple(p)

import collections
ans = -float('inf')
for i in range(1,2**10):
  que = 0
  for j,cj in enumerate(chk):
    d = format(i & cj,'b')
    c = collections.Counter(d)
    que += p[j][c['1']]
  ans = max(ans,que)
print(ans)

Measured memory_bytes: 3316
#include<stdio.h>

int fibo(int n){
  if(n==0||n==1) return 1;
  else return fibo(n-2)+fibo(n-1);
}
  
int main(){
  int n,i,f=0,f1=1,f2;

  scanf("%d",&n);
  if(n>44){
    printf("Error\n");
    return 0;
  }
  for(i=0;i<n;i++){
    f2=f1+f;
    f=f1;
    f1=f2;
  }
  
  printf("%d\n",f2);

  return 0;
}



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

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

    if((S.at(2) == S.at(3)) && (S.at(4) == S.at(5)))
    {
        cout << "Yes" << endl;
    }
    else
        cout << "No" << endl;
}


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

using namespace std;

#define all(x) x.begin(), x.end()
#define sz(x) (int) x.size()
#define pb push_back
#define endl '\n'
#define snd second
#define fst first
#define fastio cin.tie(NULL),cout.sync_with_stdio(true)

typedef long long int ll;
typedef unsigned long long int ull;
typedef vector <int> vi;
typedef pair <ll,int> ii;
typedef pair <ii,int> iii;

const int mod = 1e9 + 7;
const ll INF = (1LL<<50);
const int N = 100005;

int main(){
	fastio;
	int n;
	cin >> n;
	vi v(n);
	for(int i = 0; i < n; i++)
		cin >> v[i];
	ll ans = 0;
	int highest = v[0];
	for(int i = 1; i < n; i++){
		if(v[i] < highest)
			ans += highest - v[i];
		highest = max(highest, v[i]);
	}
	cout << ans << endl;
	return 0;
}


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

int main(void){
    char a,b;
    cin >> a >> b;
    
    if(a == 'H'){
        if(b == 'H'){
            cout << 'H'<<endl;
        }
        if(b == 'D'){
            cout << 'D'<<endl;
        }
    }
    if(a == 'D'){
        if(b == 'H'){
            cout << 'D'<<endl;
        }
        if(b == 'D'){
            cout << 'H'<<endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
int x,y,n;
while(1){
scanf("%d %d",&x,&y);
if(x==0 && y==0)break;
if(x>y){
n = x;
x = y;
y = n;
}
printf("%d %d\n",x,y);
}
return 0;
}

Measured memory_bytes: 600
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


def solve():
    X = ini()
    ans = 1
    for p in range(2, X):
        a = p * p
        while a <= X:
            ans = max(ans, a)
            a *= p
    return ans


print(solve())


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

int main()
{
	int N, M;
	cin >> N >> M;
	vector<int> A(M);
	for (int i = 0; i < M; i++) {
		cin >> A[i]; A[i]--;
	}
	vector<int> res(N);
	for (int i = 0; i < M; i++) {
		int cnt = 0;
		for (int j = 0; j < N; j++) {
			int B;
			cin >> B; B--;
			if (B == A[i]) {
				res[j]++;
			}
			else {
				cnt++;
			}
		}
		res[A[i]] += cnt;
	}
	for (int i = 0; i < N; i++) {
		cout << res[i] << endl;
	}
	return 0;
}



Measured memory_bytes: 3104
#include <iostream>
#include <string>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll s1, s2, c1, c2;
int main() {
	ll n, a[100010];
	cin >> n;
	for (int i = 1; i <= n; i++)cin >> a[i];
	for (int i = 1; i <= n; i++) {
		s1 += a[i];
		s2 += a[i];
		if (i % 2) {
			if (s1 <= 0) {
				c1 += 1 - s1;
				s1 = 1;
			}
			if (s2 >= 0) {
				c2 += 1 + s2;
				s2 = -1;
			}
		}
		else {
			if (s1 >= 0) {
				c1 += 1 + s1;
				s1 = -1;
			}
			if (s2 <= 0) {
				c2 += 1 - s2;
				s2 = 1;
			}
		}
	}
	cout << min(c1, c2) << endl;
	return 0;
}

Measured memory_bytes: 1024
n, k = map(int, input().split())

l = 0
u = 0
du = n
dl = 0
ans = 0

for i in range(n+1):
    l += dl
    u += du
    if i+1 >= k:
        ans += u-l+1
        ans %= 1000000007
    du -= 1
    dl += 1
assert(l == u)
print(ans)

Measured memory_bytes: 64348
### SNIPPET
  # n = gets.split.map(&:to_i)
  # array = n.times.map { gets.split.map(&:to_i) }
  # [].all?(&:even?)
  # a = [*1..m].repeated_combination(n).to_a
  # [1,2,3,4,5].select { |num| num.even? }  # => [2, 4]
  # ["a","a","b"].group_by(&:itself).map{|k,v| [k, v.count]}.to_h #=> {"a"=>2, "b"=>1}
  # 切り捨て: .floor(2).to_f ,切り上げ： .ceil(2).to_f,四捨五入: round(2)
  # 3.upto(6) do |i|, 6.downto(3) do |i|
  # 公約数125.gcd(100)、公倍数125.lcm(100)
  # PI = Math::PI
  # 高さ = a * Math.sin(w / 180.0 * Math::PI), 底辺 = a * Math.cos(w / 180.0 * Math::PI)
  # def chmax(a, b) a > b ? a : b end
  # INF = Float::INFINITY
  # def chmin(a, b) a < b ? a : b end

x,y,z = gets.split.map(&:to_i)

puts "#{z} #{x} #{y}"


Measured memory_bytes: 14308
count = [0]

def merge(A, left, right, mid, count):
    lstl = A[left: mid] + [5000000000]
    lstr = A[mid: right] + [5000000000]
    pl = 0
    pr = 0
    for _ in range(left, right):
        if lstl[pl] < lstr[pr]:
            A[left + pl + pr] = lstl[pl]
            pl += 1
            count[0] += 1
        else:
            A[left + pr + pl] = lstr[pr]
            pr += 1
            count[0] += 1
    
    

def merge_sort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        merge_sort(A, left, mid)
        merge_sort(A, mid, right)
        merge(A, left, right, mid, count)

import sys
input = sys.stdin.readline

n = int(input())
S = list(map(int, input().split()))

merge_sort(S, 0, n)
print(" ".join(map(str, S)))
print(count[0])


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

using namespace std;

int
main(void){
	int n, t;
	cin >> n >> t;
	vector<int > vec(n);
	for(int i = 0; i < n; i++){
		cin >> vec[i];
	}
	
	vector<int> mvec(n);
	int Max = -1;
	for(int i = n - 1; i >= 0; i--){
		mvec[i] = Max;
		Max = max(Max, vec[i]);
	}
	Max = -1;
	for(int i = 0; i < n; i++){
		Max = max(Max, mvec[i] - vec[i]);
	}
	int ans = 0;
	for(int i = 0; i < n; i++){
		ans += (Max == (mvec[i] - vec[i]));
	}
	cout << ans;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#pragma warning(disable : 4996)

using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)

//最大公約数
long gcd(long a, long b){
	if (a%b==0){
		return b;
	}
	else{
		return gcd(b,a%b);
	}
}

//最小公倍数
long lcm(long a, long b){
	return (a*b) / gcd(a,b);
}

template<typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a > b) { a = b; return 1; } return 0; }

typedef long long ll;

const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS = 1e-10;

ll t[200001];

int main(){
	ll n, T, sum = 0;
	
	cin >> n >> T;
	
	REP(i,n){
		scanf("%d", &t[i]);
		
		if (i){
			if (t[i-1]+T > t[i]){
				sum += (t[i] - t[i-1]);
			}
			else sum += T;
		}
		if (i == 0){
			sum = T;
		}
	}
	
	cout << sum << endl;
	
	return 0;
}

Measured memory_bytes: 1792
//#pragma GCC target("avx2,avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
constexpr char ln = '\n';
template<class T1, class T2> inline bool chmax(T1 &a, T2 b) {if (a < b) {a = b; return true;} return false;}
template<class T1, class T2> inline bool chmin(T1 &a, T2 b) {if (a > b) {a = b; return true;} return false;}
struct Fast_ios {Fast_ios() {cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);};} fast_ios;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

struct Osa_k {
    int N;
    vector<int> table;

    Osa_k() {}
    Osa_k(int N) : N(N), table(N+1) {
        iota(table.begin(),table.end(),0);
        for (int i = 2; i*i <= N; i++) {
            if (table[i] == i) {
                for (int j = i; j <= N; j += i) {
                    if (table[j]==j) table[j] = i;
                }
            }
        }
    }

    int operator[](int i) const {return table[i];}

    vector<pair<int, int>> prime_factor(int x) {
        assert(1 <= x and x <= N);
        vector<pair<int, int>> ret;
        while (x != 1) {
            if (ret.empty() or ret.back().first != table[x]) {
                ret.emplace_back(table[x],1);
            } else {
                ret.back().second++;
            }
            x /= table[x];
        }

        return ret;
    }
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////

void ABC177E() {
    int N; cin >> N;
    vector<int> A(N);
    rep(i,N) cin >> A[i];
    
    const int MAX = 1e6;
    Osa_k Os(MAX);
    vector<bool> seen(MAX+1);
    bool pc = true;
    int g = 0;
    rep(i,N) {
        auto a = Os.prime_factor(A[i]);
        for (auto j : a) {
            if (seen[j.first]) pc = false;
            else seen[j.first] = 1;
        }
        g = gcd(g,A[i]);
    }

    if (pc) {
        cout << "pairwise coprime" << ln;
    } else {
        cout << (g == 1 ? "setwise coprime" : "not coprime") << ln;
    }
}

int main() {
    ABC177E();
}


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

int main() {
  int Ans = 0;  // 回答：
  int N; cin >> N; // 数列数
  vector<int> A(N); // 回答文字列

  int wk_int,wk_pre_int; // 数列Ｂの値
  rep(i,N-1){
    cin >> wk_int;  // 数列Ｂ
    if ( i == 0 ) { // 先頭
      // A.at(0) は、必ず、B.at(0)
      Ans += wk_int;
    } else {
      Ans += min(wk_pre_int,wk_int);  // A.at(i) は、B.at(i) と B.at(i-1) の小さいほう
    }
    if ( i == N-2 ) {   // A.at(N-1) は B.at(N-2) と同じ
      Ans += wk_int;
    }

    wk_pre_int = wk_int;
  }
  cout << Ans << endl;
}


Measured memory_bytes: 256
a = int(input())
b = list(input().split())
count = 0
next = []
e = 0
while e == 0:
  i = 0
  e = 0
  next.clear()
  for i in b:
    e = int(i) % 2
    if e == 1:
      break
    else:
      add = int(i) / 2
      next.append(str(int(add)))
  if e == 0:
    b.clear()
    b.extend(next)
    count += 1
print(count)

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

using namespace std;

int main()
{
    int n;
    cin>>n;
    double a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    double sr=0;
    sr=(a[0]+a[1])/2;
    for(int i=2;i<n;i++)
    {
        sr=(sr+a[i])/2;
    }
    cout<<sr<<endl;
}


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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repr(i, n) for(int i = (n-1); i >= 0; --i)

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

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

const int MAX = 200005;
const int INF = 1001001001;
const int MOD = 1000000007;

struct mint {
    long long x;
    mint(long long x=0):x(x % MOD + (0 <= x ? 0 : MOD)) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint& a) { if ((x += a.x) >= MOD) x -= MOD; return *this; }
    mint& operator-=(const mint& a) { if ((x -= a.x) < 0) x += MOD; return *this; }
    mint& operator*=(const mint& a) { (x *= a.x) %= MOD; return *this; }
    mint operator+(const mint& a) const { return mint(x) += a; }
    mint operator-(const mint& a) const { return mint(x) -= a; }
    mint operator*(const mint& a) const { return mint(x) *= a; }

    // for prime mod
    mint inv() const {
        long long a = x, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        return mint(u);
    }
    mint& operator/=(const mint& a) { return *this *= a.inv(); }
    mint operator/(const mint& a) const { return mint(x) /= a; }
};
istream& operator>>(istream& is, const mint& a){ return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a){ return os << a.x; }

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

    vector<int> A(N);
    for (auto &i : A) cin >> i;

    vector<mint> sum(N+1);
    rep(i, N) sum[i+1] = sum[i] + A[i];

    mint ans = 0;
    rep(i, N) {
        ans += (sum[N] - sum[i+1]) * A[i];
    }

    cout << ans << endl;
}

Measured memory_bytes: 5636
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second
 
#define bit(n,k) ((n>>k)&1) //*n no k bit me 1 or 0*/

const int mx=100010;
const ll mod=1e9+7;

// matrix pow mod
void matpom(ll*mat,int size,ll n,int m){
  ll*temp=(ll*)malloc(size*size*sizeof(ll));
  ll*ans=(ll*)malloc(size*size*sizeof(ll));  
  rep(i,size)rep(j,size)ans[i*size+j] = i==j;
  while(n){
    if(n%2){
      rep(i,size*size)temp[i]=0;
      rep(i,size)rep(j,size)rep(k,size)temp[i*size+j]=(temp[i*size+j]+ans[i*size+k]*mat[k*size+j])%m;
      rep(i,size*size)ans[i]=temp[i];
    }
    rep(i,size*size)temp[i]=0;
    rep(i,size)rep(j,size)rep(k,size)temp[i*size+j]=(temp[i*size+j]+mat[i*size+k]*mat[k*size+j])%m;
    rep(i,size*size)mat[i]=temp[i];
    n/=2;
  }
  rep(i,size*size)mat[i]=ans[i];
  free(temp); free(ans);
}

ll a[50][50];         //in case of matrix pow mod //not vector
int main(){
  ll n,k;
  cin >> n >> k;
  rep(i,n)rep(j,n){ cin>>a[i][j]; }
  matpom((ll*)a,50,k,mod);
  ll ans = 0;
  rep(i,n)rep(j,n){ (ans+=a[i][j])%=mod; }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 384
/*|In The Name Of Allah|*/

#include <bits/stdc++.h>

using namespace std;

const int N = 2e5+5;

int main(){
    string s;
    cin >> s;
    int a = ((s[0] - '0') * 10) + (s[1] - '0');
    int b = ((s[2] - '0') * 10) + (s[3] - '0');
    bool fym , fmy;
    fym = fmy = 0;
    if(0 < b && b <13) fym = true;
    if(0 < a && a <13) fmy = true;

    if(fym){
        if(fmy) cout << "AMBIGUOUS" << endl;
        else cout << "YYMM" << endl;
    }else{
        if(fmy) cout << "MMYY" << endl;
        else cout << "NA" << endl;
    }
}

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

const int INF = 1 << 30;

class Parking
{
public:
  int id, time;

  Parking(int _id = -1, int _time = INF)
    :id(_id), time(_time) {}
};

int main()
{
  int n, m;
  while (cin >> m >> n) {
    if ((n|m) == 0)
      break;

    vector<int> cars(n);
    for (int i = 0; i < n; ++i)
      cin >> cars[i];

    int id = 0;
    vector<int> ans;
    vector<Parking> p1(m), p2(m);
    for (int time = 0; ans.size() < n; ++time) {
      for (int i = 0; i < m; ++i) {
	if (p1[i].id != -1)
	  --p1[i].time;
	if (p2[i].id != -1)
	  --p2[i].time;
      }

      for (int i = 0; i < m; ++i) {
	bool out = false;
	if (p1[i].id != -1 && p1[i].time <= 0) {
	  ans.push_back(p1[i].id);
	  p1[i].id = -1;
	  p1[i].time = INF;
	  out = true;
	}

	if (p1[i].id == -1 && p2[i].id != -1 && p2[i].time <= 0) {
	  ans.push_back(p2[i].id);
	  p2[i].id = -1;
	  p2[i].time = INF;
	}

	if (out && p2[i].id != -1) {
	  p1[i].id = p2[i].id;
	  p1[i].time = p2[i].time;
	  p2[i].id = -1;
	  p2[i].time = INF;
	}
      }

      while (id < n && id * 10 <= time) {
	bool in = false;
	for (int i = 0; i < m; ++i) {
	  if (p1[i].id == -1) {
	    p1[i].id = id;
	    p1[i].time = cars[id++];
	    in = true;
	    break;
	  }
	}

	if (in)
	  continue;

	int minIndex = -1;
	for (int i = 0; i < m; ++i) {
	  if (p2[i].id != -1)
	    continue;

	  if (p1[i].time >= cars[id]) {
	    if (minIndex == -1 || p1[i].time < p1[minIndex].time)
	      minIndex = i;
	  }
	}

	if (minIndex != -1) {
	  p2[minIndex].id = p1[minIndex].id;
	  p2[minIndex].time = p1[minIndex].time;
	  p1[minIndex].id = id;
	  p1[minIndex].time = cars[id++];
	  continue;
	}

	for (int i = 0; i < m; ++i) {
	  if (p2[i].id != -1)
	    continue;

	  if (p1[i].time < cars[id]) {
	    if (minIndex == -1 || p1[i].time > p1[minIndex].time)
	      minIndex = i;
	  }
	}

	if (minIndex != -1) {
	  p2[minIndex].id = p1[minIndex].id;
	  p2[minIndex].time = p1[minIndex].time;
	  p1[minIndex].id = id;
	  p1[minIndex].time = cars[id++];
	  continue;
	}

	break;
      }
    }

    for (int i = 0; i < n-1; ++i)
      cout << ans[i]+1 << " ";
    cout << ans[n-1]+1 << endl;

  }
  return 0;
}

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

#define fs first
#define sc second
#define pb emplace_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

const int32_t inf = 1001001001;
const int64_t infll = 1001001001001001001ll;
const int dx[] = {0, -1, 1, 0, -1, 1, -1, 1}, dy[] = {-1, 0, 0, 1, -1, -1, 1, 1};

template <typename T> using vector2d = vector<vector<T>>;

// clang-format off
template <typename T> void sort(vector<T> &v) { sort(all(v)); }
// ostream &operator<<(ostream &os, __int128_t value) { if (ostream::sentry(os)) { __uint128_t tmp = value < 0 ? -value : value; char buffer[64]; char *d = end(buffer); do { --d; *d = "0123456789"[tmp % 10]; tmp /= 10; } while (tmp != 0); if (value < 0) { --d; *d = '-'; } int len = end(buffer) - d; if (os.rdbuf()->sputn(d, len) != len) { os.setstate(ios_base::badbit); }} return os; }
// istream &operator>>(istream &is, __int128_t &value) { string in; is >> in; value = 0; for (const char &c : in) { if ('0' <= c && c <= '9') value = 10 * value + (c - '0'); } if (in[0] == '-') value *= -1; return is; }
// ostream &operator<<(ostream &os, __uint128_t value) { if (ostream::sentry(os)) { char buffer[64]; char *d = end(buffer); do { --d; *d = "0123456789"[value % 10]; value /= 10; } while (value != 0); int len = end(buffer) - d; if (os.rdbuf()->sputn(d, len) != len) { os.setstate(ios_base::badbit); }} return os; }
// istream &operator>>(istream &is, __uint128_t &value) { string in; is >> in; value = 0; for (const char &c : in) { if ('0' <= c && c <= '9') value = 10 * value + (c - '0'); } return is; }
template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { os << v[0]; for (int i = 1; i < v.size(); ++i) os << " " << v[i]; return os; }
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }
template <typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p) { os << p.fs << " " << p.sc; return os; }
template <typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.fs >> p.sc; return is; }

struct IoSetup { IoSetup(){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); cerr << fixed << setprecision(10); } } iosetup;

inline int64_t in() { int64_t x = 0; cin >> x; return x; }
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// clang-format on

signed main(int argc, char *argv[]) {
  char a, b;
  cin >> a >> b;

  if (a == b) puts("=");
  if (a < b) puts("<");
  if (a > b) puts(">");
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int a,b,c,temp;
    scanf("%d%d%d",&a,&b,&c);
    if(a>b){
        temp=a;
        a=b;
        b=temp;
    }
    if(a>c){
        temp=a;
        a=c;
        c=temp;
    }
    if(b>c){
        temp=b;
        b=c;
        c=temp;
    }
    int cost = 0;
    // after sort 1 5 7
    cost += (b-a);
    cost += (c-b);
    printf("%d\n", c-a);
    return 0;
}



Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pi M_PI
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;
 
void Main() {
  int n,c=0;
  R n;
  set<int> s;
  rep(i,n) {
    int x;
    R x;
    if(x<=399) s.in(1);
    else if(x<=799) s.in(2);
    else if(x<=1199) s.in(3);
    else if(x<=1599) s.in(4);
    else if(x<=1999) s.in(5);
    else if(x<=2399) s.in(6);
    else if(x<=2799) s.in(7);
    else if(x<=3199) s.in(8);
    else c++;
  }
  pr(max(1,(int)s.size()),(int)s.size()+c);
}
 
int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<string>
#include<map>
#include<queue>
#include<set>

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define reps(i,n) for(int i=1;i<=n;i++)

class S{
	public:
	vector<int> a;
	S(){}
	S(vector<int> a):a(a){}
	void x(){
		int tmp = a[0];
		a[0]=a[4];
		a[4]=a[5];
		a[5]=a[1];
		a[1]=tmp;
	}
	void y(){
		int tmp = a[1];
		a[1]=a[2];
		a[2]=a[4];
		a[4]=a[3];
		a[3]=tmp;
	}
	void z(){
		int tmp = a[0];
		a[0]=a[2];
		a[2]=a[5];
		a[5]=a[3];
		a[3]=tmp;
	}
};

int main(){
	while(1){
		int n;
		cin>>n;
		if(n==0)break;
		
		map<vector<int>,int> memo;
		
		rep(i,n){
			vector<int> b;
			rep(j,6){
				string a;
				cin>>a;
				switch(a[0]){
					case 'C':b.push_back(0);break;
					case 'Y':b.push_back(1);break;
					case 'R':b.push_back(2);break;
					case 'M':b.push_back(3);break;
					case 'G':b.push_back(4);break;
					case 'B':b.push_back(5);break;
				}
			}
			
			S si = S(b);
			rep(j,4){
				si.x();
				rep(k,4){
					si.y();
					rep(p,4){
						si.z();
						memo[si.a]=1;
					}
				}
			}
		}
		
		printf("%d\n",n-(memo.size()/24));
		
	}
}

Measured memory_bytes: 976
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int N;
    cin >> N;
    int total = 1;

    for(int i = 1; i < 100; i++)
    {
        total *= 2;

        if(total > N)
        {
            break;
        }
    }
    cout << total / 2 << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
ll N,A[100010];

ll merge_count(vector<ll> &a){
	ll n = a.size();
	if(n<=1) return 0;
	ll cnt = 0;
	vector<ll> b(a.begin(),a.begin() + n/2);
	vector<ll> c(a.begin() + n/2, a.end());
	cnt += merge_count(b);
	cnt += merge_count(c);
	ll ai = 0,bi = 0,ci = 0;
	while(ai<n){
		if(bi<b.size() && (ci == c.size() || b[bi] <= c[ci])){
			a[ai++] = b[bi++];
		}else{
			cnt += n/2 - bi;
			a[ai++] = c[ci++];
		}
	}
	return cnt;
}

ll median(ll x){
	vector<ll> B(N+1,0);
	for(int i=1;i<=N;i++){
		if(A[i-1]>=x) B[i] = 1;
		else B[i] = -1;
		B[i] += B[i-1];
	}
	return N*(N+1)/2-merge_count(B);
}

int main(){
	cin >> N;
	ll ma = 0,mi = 1e9+1;
	for(int i=0;i<N;i++){
		cin >> A[i];
	}
	ll l = 0,r = 1e9+1;
	while(l+1<r){
		ll m = (l+r)/2;
		if(median(m)>=(N*(N+1)/2+1)/2) l = m;
		else r = m;
	}
	cout << l << endl;
}

Measured memory_bytes: 3424
// https://atcoder.jp/contests/abc141/tasks/abc141_d
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
#include <deque>
#include <stdio.h>
#include <string>
#include <queue>

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

int main() {
	priority_queue<ll> pque;
	int n, m;
	ll a;
	ll sum;
	sum = 0;
	cin >> n >> m;
	rep(i, n) {
		cin >> a;
		pque.push(a);
	}
	// priority queueの最大値を取り出して割る2をして元に戻す
	while (m != 0) {
		ll aTmp;
		aTmp = pque.top()/2;
		// 最大値を削除
		pque.pop();
		pque.push(aTmp);
		m--;
	}
	while (!pque.empty()) {
		sum += pque.top();
		pque.pop();
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 4316