akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <deque>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main()
{
	string S;
	cin >> S;
	for (auto i = 0; i < (int)S.size(); ++i)
	{
		cout << "x";
	}
	cout << endl;

	return 0;
}

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


int max_(int x,int y,int z){
    if(x>y){
        if(x>z)return x;
        return z;
    }
    else{
        if(y>z)return y;
        return z;
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int a[n+1][3],dp[n+1][3];
    for(int i=1;i<=n;i++)cin>>a[i][0]>>a[i][1]>>a[i][2];
    
    dp[1][0] = a[1][0];
    dp[1][1] = max(a[1][0],a[1][1]);
    dp[1][2] = max(dp[1][1],a[1][2]);

    for(int i=2;i<=n;i++){
        for(int j=0;j<=3;j++){
            if(!j){
                dp[i][j] = a[i][j] + max(dp[i-1][j+1],dp[i-1][j+2]);
            }
            else if(j==1){
                dp[i][j] = a[i][j] + max(dp[i-1][j-1],dp[i-1][j+1]);
            }
            else{
                dp[i][j] = a[i][j] + max(dp[i-1][j-2],dp[i-1][j-1]);
            }
        }        
    }
    cout<<max(dp[n][2],max(dp[n][0],dp[n][1]));
    // for(int i=1;i<=n;i++){
    //     cout<<dp[i][0]<<" "<<dp[i][1]<<" "<<dp[i][2]<<"\n";
    // }
    
    return 0;
}    

Measured memory_bytes: 2560
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<set>
#include<bitset>
#include<map>

#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

typedef long long LL;
typedef double db;

int get(){
	char ch;
	while(ch=getchar(),(ch<'0'||ch>'9')&&ch!='-');
	if (ch=='-'){
		int s=0;
		while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
		return -s;
	}
	int s=ch-'0';
	while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
	return s;
}

const int N = 200003;

int f[N],g[N],w[N],sec[N];
int dfn[N],k,R[N];
bool bz[N],key[N],pre[N],suf[N],s[N];
int n;
struct edge{
	int x,nxt;
}e[N*2];
int h[N],tot;
int fa[N];

void inse(int x,int y){e[++tot].x=y;e[tot].nxt=h[x];h[x]=tot;}

void dfs1(int x){
	bz[x]=1;
	dfn[x]=++k;
	pre[k]=suf[k]=s[x]=key[x];
	for(int p=h[x];p;p=e[p].nxt)
	if (!bz[e[p].x]){
		fa[e[p].x]=x;
		dfs1(e[p].x);
		s[x]|=s[e[p].x];
		if (f[e[p].x]>f[x]){
			sec[x]=f[x];
			f[x]=f[e[p].x];
			w[x]=e[p].x;
		}
		else sec[x]=max(sec[x],f[e[p].x]);
	}
	f[x]++;
	sec[x]++;
	R[x]=k;
}

void dfs2(int x){
	for(int p=h[x];p;p=e[p].nxt)
	if (fa[e[p].x]==x){
		if (e[p].x==w[x])g[e[p].x]=max(sec[x],g[x])+1;
		else g[e[p].x]=max(f[x],g[x])+1;
		dfs2(e[p].x);
	}
}

int t,a[N];

int calc(int x){
	a[t=1]=g[x]-1;
	for(int p=h[x];p;p=e[p].nxt)if (fa[e[p].x]==x)a[++t]=f[e[p].x];
	sort(a+1,a+1+t);
	int high=a[t]-1;
	if (t>1)high=min(high,a[t-1]+1);
	else high=min(high,1);
	int low=key[x]?0:1e+9;
	for(int p=h[x];p;p=e[p].nxt)if (s[e[p].x])low=min(low,f[e[p].x]);
	if (pre[dfn[x]-1]||suf[R[x]+1])low=min(low,g[x]-1);
	return max(high-low+1,0);
}

int main(){
	n=get();
	fo(i,2,n){
		int x=get(),y=get();
		inse(x,y),inse(y,x);
	}
	char str[N];
	scanf("%s",str+1);
	fo(i,1,n)key[i]=str[i]-'0';
	dfs1(1);
	dfs2(g[1]=1);
	fo(i,1,n)pre[i]|=pre[i-1];
	fd(i,n,1)suf[i]|=suf[i+1];
	LL ans=1;
	fo(i,1,n)ans+=calc(i);
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 15616
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    if(a>=13)cout<<b<<endl;
    else if(a<=5)cout<<0<<endl;
    else cout<<b/2<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//const ll INF = 1LL << 60;
//const int INF = 1001001001;

int main(void){
    int x;
    cin >> x;
    int ans=x/500 * 1000;
    x%=500;
    ans+=x/5 * 5;

    cout << ans;
    return 0;
}

Measured memory_bytes: 3528
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,K,x;
  int sum = 0;
  cin >> N >> K;
  for (int i = 0; i < N; i++) {
     cin >> x;
    if (x <= K-x ) sum += x * 2;
    else sum += ((K-x) *2);
  }
  cout << sum << endl;  
}

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


int h,w,k;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    cin>>h>>w>>k;
    char mat[h][w];
    for (int i=0; i<h; i++){
        for (int j=0; j<w; j++){
            cin>>mat[i][j];    
        }
    }
    
    
    int res=0;
    for (int r1=0; r1<1<<h; r1++){
        for (int r2=0; r2<1<<w; r2++){
            int black=0;
            set <int> rows;
            set <int> columns;
            int x=r1,y=r2;
            int aux=0;
            while(x){
                if (x&1) rows.insert(aux);
                aux++;
                x/=2;
            }
            aux=0;
            while(y){
                if (y&1) columns.insert(aux);
                aux++;
                y/=2;
            }
            for (int i=0; i<h; i++){
                for (int j=0; j<w; j++){
                    if (rows.count(i) && columns.count(j) && mat[i][j]=='#') black++;
                }
            }
            
            if (black == k) res++;
            
        }
    }
    
    cout<<res;

    
    
        
    
    
    
    return 0;
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int N;
int keisan(vector<int> &A,int za){
  int count=0;
  for(int i=0;i<N;i++){
    count+=(A[i]-za)*(A[i]-za);
  }
  return count;
}
int main() {
  cin>>N;
  vector<int>X(N);
  rep(i,N) cin>>X[i];
  sort(X.begin(),X.end());
  int A,B,ans;
  A=0;
  B=100;
  ans=keisan(X,A);
  for(int i=A;i<=B;i++){
    ans=min(ans,keisan(X,i));
  }
  cout<<ans;
}

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

int main() {

    int a, b;
    string s1, s2;
    string lost_ball;
    
    cin >> s1 >> s2;
    cin >> a >> b;
    
    cin >> lost_ball;

    if(s1 == lost_ball)
        a--;
    else
        b--;

    cout << a << " " << b << endl;
    

    

    return 0;
}

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

int main() {
  int H,W;
  cin>>H>>W;
  vector<vector<char>> data(H+2, vector<char>(W+2));


  // 入力 (2重ループを用いる)
  for (int i = 0; i < H+2; i++) {
    for (int j = 0; j < W+2; j++) {
       data.at(i).at(j)='.';
    }
  }
  for (int i = 1; i < H+1; i++) {
    for (int j = 1; j < W+1; j++) {
      cin >> data.at(i).at(j);
    }
  }

  for(int i=1;i<H+1;i++){
    for(int j=1;j<W+1;j++){
        if(data[i][j]=='#'){
          if(data[i-1][j]=='#'||
          data[i+1][j]=='#'||
          data[i][j-1]=='#'||
          data[i][j+1]=='#'){
            continue;
          }
          else{
            cout<<"No"<<endl;
            return 0;
          }
        }
    }
  }

            cout<<"Yes"<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N=3e5+7;
string s;int n,i,j,k,cw[N],ce[N],ans=1e6;
int main(){
    cin>>n;
    cin>>s;
    for(i=1;i<=n;i++)cw[i]+=(s[i-1]=='W')+cw[i-1];
    for(i=n;i>=1;i--)ce[i]+=(s[i-1]=='E')+ce[i+1];
    //cout<<ce[2]<<"\n";
    for(i=1;i<=n;i++){

            ans=min(ans,ce[i+1]+cw[i-1]);
    }
    cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 2948
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<cstdio>
#include<queue>
#include<deque>
#include<map>
#include<stack>
#include<set>
#include<utility>
using namespace std;
typedef pair<int,int> pii;
typedef pair<int,pii> p;
typedef long long ll;
typedef pair<ll,ll> pll;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
const int MAXN=100000;
const int MAXE=100000;
const int MAXV=10000;
const ll INF=2e9;
const ll MOD=1e9+7;
struct edge{
    int to;
    int cost;
};

int main(){
    ll N;cin>>N;
    if(N==2){
        cout<<1<<endl;
        return 0;
    }
    int ans=2;
    for(ll k=2;k*k<=N;++k){
        ll M=N;
        if(M%k==0){
            while(M%k==0){
                M/=k;
            }
            if(M%k==1) ans++;
        }else{
            if((M-1)%k==0) ans+=(k==(M-1)/k?1:2);
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
using ui64 = uint_fast64_t;
#define REP(i, n) for (i64 (i) = 0; (i) < (n); ++(i))
#define FOR(i, a, b) for (i64 (i) = (a); (i) < (b); ++(i))

int N;
vector<int> L;

signed main() {

    cin >> N;
    
    L.resize(N);
    REP(i, N) cin >> L[i];
    sort(L.begin(), L.end());

    ui64 res = 0;
    FOR(i, 2, N) {
        // L[i]: max
        // [0, i)から2つ選ぶ
        for (int j = 0; j < i; ++j) {
            // これがa
            int b_mn = L[i] - L[j];
            // [j + 1, i)からb_mnより大きいものが何個あるか
            auto itr = upper_bound(L.begin(), L.end(), b_mn);
            if (itr == L.end()) continue;
            int idx = distance(L.begin(), itr);
            // if (i == 2 and j == 1) {
            //     cout << i - max(j + 1, idx) << endl;
            // }
            if (idx >= i) continue;
            res += i - max(j + 1, idx);
        }
        // cout << i << ' ' << res << endl;
    }

    cout << res << endl;

}



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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

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

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

template<typename T>
void print1(T begin, T end) {
  while (begin != end) {
    cout << (*begin) << " ";
    *begin++;
  }
  cout << endl;
}

template<typename T>
void print2(T Array, int height, int width) {
  for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
      cout << " " << Array[i][j];
    }
    cout << endl;
  }
}

// ------------------------------------------------------------------------------------------

const int INF = 1e18;

int N, W;
int w[111111];
int v[111111];
int dp[111][111111];

signed main() {
  cin >> N >> W;
  repp (i, 1, N+1) {
    cin >> w[i] >> v[i];
  }
  
  rep (i, N+1) {
    rep (j, 111111) {
      dp[i][j] = INF;
    }
  }
  dp[0][0] = 0;

  int ans = 0;
  for (int i = 1; i <= N; i++) {
    for (int vi = 0; vi <= 100000; vi++) {
      chmin(dp[i][vi], dp[i-1][vi]);
      if (vi - v[i] >= 0) {
        chmin(dp[i][vi], dp[i-1][vi-v[i]] + w[i]);
        if (dp[i][vi] <= W) {
          chmax(ans, vi);
        }
      }
    }
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 88320
#include <stdio.h>
#include <stdlib.h>

#define MAXV 100
#define MAXE 1000

int v, e;
int a = 0;
int *visited;
int *s, *t;

void resultSearch(int);

int main(){

        int i;

        scanf("%d %d", &v, &e);

        if(e < 0 || MAXE < e || v < 1 || MAXV < v)return 0;

        s = (int*)malloc(e*sizeof(int));
        t = (int*)malloc(e*sizeof(int));


        visited = (int*)malloc(v*sizeof(int));

        for(i = 0;i < e;i ++)
                {
                        scanf("%d %d", &s[i], &t[i]);
                }

        for(i = 0;i < v;i ++)
                {
                        visited[i] = 0;
                }

        for(i = 0;i < v;i ++)
                {
                        if(a == 1)
                                {
                                        break;
                                }else if(visited[i]  == 0 && a == 0)
                                {
                                        resultSearch(i);
                                }
                }

        printf("%d\n", a);

        free(s);
        free(t);
        free(visited);

        return 0;
}

void resultSearch(int v){
        int i;

        if(visited[v] == 1){
                a = 1;
        }else if(visited[v] == 0){
                visited[v] = 1;

                for(i = 0; i < e; i ++)
                {
                        if(s[i] == v)resultSearch(t[i]);
                }
                visited[v] = 2;
        }
}


Measured memory_bytes: 2756
#include<stdio.h>

int main(void) {
    unsigned long long int n, p;
    unsigned long long int i;
    unsigned long long int count = 0;
    unsigned long long int ans = 1;
    scanf("%llu %llu", &n, &p);

    if ( n == 1 ) {
        printf("%llu\n", p);
        return 0;
    }
    if ( p == 1 ) {
        printf("1\n");
        return 0;
    }
    for ( i = 2; i * i <= p; ) {
        count = 0;
        while ( p % i == 0 ) {
            count++;
            p /= i;
        }
        while ( count >= n ) {
            ans *= i;
            count -= n;
        }
        i++;
    }
    printf("%llu\n", ans);
    return 0;

}

Measured memory_bytes: 128
from collections import Counter
def main():
    M = 10 ** 6
    _ = int(input())
    A = list(map(int,input().split()))
    erato = [True] * (M+10)
    m = Counter(A)
    one = []
    for k,v in m.items():
        if v == 1:
            one.append(k)
        else:
            for i in range(k,M+1,k):
                erato[i] = False
    one.sort()
    ans = 0 
    for i in one:
        ans += 1 if erato[i] else 0
        for j in range(i,M+1,i):
            erato[j] = False

    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 43780
/* *
 *
 * Author: Hamkor
 *
 * */
 
#include <bits/stdc++.h>
 
using namespace std;
 
/* * * *   * * *   	* * * */
typedef long long ll;
const int oo = 1e9;
const ll mod = 100000000;
typedef complex<ll> P;
#define X real()
#define Y imag()
/* * * *   * * *   	* * * */
 
int main(){
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n, k, m = 2*1e9; cin>>n>>k;
	vector<int> a(n), b(n, 2*1e9); 
	for(int i=0; i<n; ++i) cin>>a[i];
	sort(a.begin(), a.end());
	for(int i =0; i+k-1<n; ++i){
		int l = a[k+i-1] - a[i];
		m = min(m, l);
	}
	cout<<m;
	return 0;
}


Measured memory_bytes: 1024
#!/usr/bin/env python3
# coding: utf-8
# import pprint
# import numpy as np
# import code
import functools

if __debug__:
    def debug(arg):
        pass
else:
    import sys
    def debug(arg):
        debug = lambda *x: None
        print(arg, file=sys.stderr)

n, x, y = (int(x) for x in input().split())
d = dict.fromkeys(range(1, n), 0)
debug(d)
for i in range(1, n):
    for j in range(i + 1, n + 1):
        debug([i, j, x, y])
        dd1=abs(x - i) + 1 + abs(y - j)
        dd2= j - i
        if dd1 < dd2:
            d[dd1] += 1
        else:
            d[dd2] += 1
        debug(d)

for n in d.values():
    print(n)




Measured memory_bytes: 4196
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int n, m, x, to0 = 0, ton = 0, a;
    cin >> n >> m >> x;
    for(int i = 0; i < m; i++){
        cin >> a;
        if(a <= x) to0 += 1;
        else ton += 1;
    }
    cout << min(to0, ton) << endl;
    return 0;
}

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

LL dp[1110][11100];

int main(){
    fastcin();

    int n, m;
    cin >> n >> m;
    vector<int> a(m), b(m), c(m);
    rep(i, m){
        cin >> a[i] >> b[i];
        int tmp = 0;
        rep(j, b[i]){
            int x;
            cin >> x;
            x--;
            tmp |= (1<<x);
        }
        c[i] = tmp;
    }
    rep(i, 1010)rep(j, 10010) dp[i][j] = LLINF;
    dp[0][0] = 0;
    rep(i, m){
        rep(j, 5000){
            chmin(dp[i+1][j|c[i]], dp[i][j]+a[i]);
            chmin(dp[i+1][j], dp[i][j]);
        }
    }
    if(dp[m][(1<<n)-1] == LLINF){
        cout << -1 << endl;
        return 0;
    }
    cout << dp[m][(1<<n)-1] << endl;

}

Measured memory_bytes: 88192
n=gets.chomp.to_i
d=gets.chomp.split(" ").map(&:to_i)
puts d.each_with_index.with_object([]) {|(x,i),obj|
  d.slice(i..-1).each_with_index{|y,j| obj << x*y if i != (i+j) }
}.inject(:+)

Measured memory_bytes: 1788
#include<iostream>
#include<string>
#include <vector>
#include <algorithm>
using ll = long long;
using namespace std;
int main() {
    int n;
    cin >> n;
    
    if (n / 100 == 7 || (n / 10) % 10 == 7 || n % 10 == 7)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 3592
#include <stdio.h>

int main(void)
{
	char str[1000];
	int i;
	
	scanf("%s",str);
	
	for(i = 0;i < strlen(str);i++){
		if(str[i] == 'A'){
			str[i] = 'X';
		}
		else if(str[i] == 'B'){
			str[i] = 'Y';
		}
		else if(str[i] == 'C'){
			str[i] = 'Z';
		}
		else {
			str[i] -= 3;
		}
	}
	
	printf("%s\n",str);
	
	return(0);
}

Measured memory_bytes: 524
N = int(input())
Hn = list(map(int,input().split()))

Hn[0] -= 1
for i in range(1,len(Hn)):
	if Hn[i-1] <= Hn[i]-1:
		Hn[i] -=1
	elif Hn[i-1] == Hn[i]:
		pass
	elif Hn[i-1] > Hn[i]:
		print("No")
		exit()
else:
	print("Yes")

Measured memory_bytes: 63856
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define M 998244353
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int l,r,d,count=0;
	cin>>l>>r>>d;
  	for(int i=l;i<=r;i++)
    {
      if(i%d==0)
      {
        count++;
      }
    }
  cout<<count;
	return 0;
}

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

int main(){
  int H,W;
  cin>>H>>W;
  vector<int> count(26,0);
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      char c;
      cin>>c;
      count.at(c-'a')++;
    }
  }
  bool flag=true;
  if(H%2==1&&W%2==1){
    int con=0;
    for(int i=0;i<26;i++){
      if(count.at(i)%2==1){
        con++;
        count.at(i)--;
      }
    }
    if(con>1){
      flag=false;
    }
    con=0;
    for(int i=0;i<26;i++){
      con+=count.at(i)/4;
    }
    if(con<(H/2)*(W/2)){
      flag=false;
    }
  }else{
    for(int i=0;i<26;i++){
      if(count.at(i)%2==1){
        flag=false;
      }
    }
    int con=0;
    for(int i=0;i<26;i++){
      con+=count.at(i)/4;
    }
    if(con<(H/2)*(W/2)){
      flag=false;
    }
  }
  if(flag){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}


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

int main(){
    int n,y;
    cin >> n >> y;
    if (10000*n < y) cout << "-1 -1 -1";
    else{
		int maxa = y/10000;
		for(int i = 0;i<=maxa;i++){
			int b4 = (y/1000-n-9*i);
			int c = n - i - b4/4;
			if(b4%4==0 && b4>=0 && c>=0){
				cout << i << " " << b4/4 << " " << c;
				return 0;	
				}
			}
	cout << "-1 -1 -1";
	}
	
}



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

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

  if(abs(x-a) < abs(x-b))
    cout << "A";
  else
  {
    cout << "B";
  }


}


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

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 1000000007
#define MOD9 998244353
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

using II = pair<int, int>;

int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
int extgcd(int a, int b, int &x, int &y) { int g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; }

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

const int MAX_N = 3005;
int N, T;
struct ABs{
  int A, B;
  bool operator < (const ABs& p) const {
    return A < p.A;
  }
}AB[MAX_N];
int dp[MAX_N][MAX_N];

signed main()
{
  cin >> N >> T;
  REP(n,N) {
    cin >> AB[n].A >> AB[n].B;
  }

  sort(AB,AB+N);

  REP(n,N) {
    REP(t,T) {
      dp[n+1][t] = max(dp[n+1][t], dp[n][t]);
      int nextT = min(T, t + AB[n].A);
      dp[n+1][nextT] = max(dp[n+1][nextT], dp[n][t]+AB[n].B);
    }
    dp[n+1][T] = max(dp[n+1][T], dp[n][T]);
  }

  int ans = 0;
  REP(t,T+1) {
    ans = max(ans, dp[N][t]);
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 70784
//let's do it
 #include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define inf 1000000000000
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define S second
#define F first
#define boost1 ios::sync_with_stdio(false);
#define boost2 cin.tie(0);
#define mem(a,val) memset(a,val,sizeof a)
#define endl "\n"
#define maxn 100005

struct st
{
	int vertex,max_dist,color;
	st()
	{
		vertex=max_dist=color=0;
	}
}query[maxn];
int col[maxn],vis[maxn][11];
vector<int>v[maxn];

void solve(int vertex,int max_dist,int color)
{
	if(max_dist==0)
	{
		if(!col[vertex])
		col[vertex]=color;
		return;
	}
	if(vis[vertex][max_dist])
	return;
	solve(vertex,max_dist-1,color);
	for(int i=0;i<v[vertex].size();i++)
	{
		int nxt_vertex=v[vertex][i];
		solve(nxt_vertex,max_dist-1,color);
	}
	vis[vertex][max_dist]=1;
}
int main()
{
	boost1;boost2;
	int i,j,n,m,x,y,q;
	cin>>n>>m;
	for(i=1;i<=m;i++)
	{
		cin>>x>>y;
		v[x].pb(y);
		v[y].pb(x);
	}
	cin>>q;
	for(i=1;i<=q;i++)
	cin>>query[i].vertex>>query[i].max_dist>>query[i].color;
	for(i=q;i>=1;i--)
	solve(query[i].vertex,query[i].max_dist,query[i].color);
	for(i=1;i<=n;i++)
	cout<<col[i]<<endl;
	return 0;
}


Measured memory_bytes: 12408
#include<bits/stdc++.h>
using namespace std;
int dx[]={-1,1,0,0};
int dy[]={0,0,-1,1};
#define ull unsigned long long int
#define ll long long int
#define MAX 1000000007
//1e9+7
#define pll pair<ll,ll>
#define pii pair<int,int>
#define IO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define FO ifstream fin("a.in");ofstream fout("a.out");
#define TEST ll t;cin>>t;while(t--)
#define all(x) (x).begin(),(x).end()
#define mset0(x) memset((x), 0, sizeof((x)));
#define mset1(x) memset((x), -1, sizeof((x)));

bool prime[10000];
void era(){
    memset(prime,true,sizeof prime);
    for(ll p=2;p*p<=10000;p++){
        if(prime[p]){
            for(ll q=p*p;q<=10000;q+=p){
                prime[q]=false;
            }
        }
    }

    return;
}
ll fac[200001],finv[200001];
ll power(ll a,ll b){
    ll ans=1;
    while(b){
        if(b&1) ans=(ans*a)%MAX;
        b/=2;
        a=(a*a)%MAX;
    }
    return(ans%MAX);
}
ll inverse(ll a){
    return((power(a,MAX-2))%MAX);
}
ll ncr(ll n, ll r){
    ll p1=finv[n-r];
    ll p2=finv[r];

    return((((fac[n]*p1)%MAX)*p2)%MAX);


}
bool solve(ll n,ll arr[]){
    ll sum=0;
    for(ll i=0;i<n;i++){
        sum+=arr[i];
        if(sum<=0) return(false);
    }
    sum=0;
    for(ll i=n-1;i>=0;i--){
        sum+=arr[i];
        if(sum<=0) return(false);
    }
    return(true);
}
struct Node{
    ll l,r,w;
}arr[5001];
bool cmp(Node a,Node b){
    return(a.r<b.r);
}
int main(){
    IO
    ll a[3];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    if(a[0]+a[1]==a[2]) cout<<"Yes";
    else cout<<"No";
    return(0);
}

Measured memory_bytes: 256
h = Hash.new(0);
gets; gets.split.map(&:to_i).each{|x| h[x]+=1}
gets; gets.split.map(&:to_i).each{|x| h[x]-=1}
puts (if h.each_value.map{|v| v<0}.include?(true) then "NO" else "YES" end)

Measured memory_bytes: 43680
#include<bits/stdc++.h>
//g++ -std=c++11 

using namespace std;
typedef long long ll;

#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define DIV 1000000007 //10^9+7

ll N, M;
set<ll> A;
ll dp[100005];

int main(){
	cin >> N >> M;
	rep(i, M) {
		ll tmp;
		cin >> tmp;
		A.insert(tmp);
	}

	dp[0] = 1;

	rep(i, N + 1) {
		if(A.count(i + 1) == 0) {
			dp[i+1] += dp[i];
dp[i+1] %= DIV;
		}
		if(A.count(i + 2) == 0) {
			dp[i+2] += dp[i];
dp[i+2] %= DIV;
		}
	}
	cout << dp[N] << endl;
}



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

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

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

int main(){
  int n;cin>>n;
  cout<<(n+1)/2;

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll    long long
#define pb          push_back
#define F first
#define S second
#define    endl        '\n'
#define all(v) (v).begin(), (v).end()
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v)
{
    os << '{';
    string sep;
    for (const auto &x : v) os << sep << x, sep = ", ";
    return os << '}';
}
template<typename T, size_t size> ostream &operator<<(ostream &os, const array<T, size> &arr)
{
    os << '{';
    string sep;
    for (const auto &x : arr) os << sep << x, sep = ", ";
    return os << '}';
}
template<typename A, typename B> ostream &operator<<(ostream &os, const pair<A, B> &p)
{
    return os   << '(' << p.first << ", " << p.second << ')';
}
void dbg_out()
{
    cerr << endl;
}
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T)
{
    cerr << ' ' << H;
    dbg_out(T...);
}

#ifdef LOCAL
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif
const int N = 3e6 + 5;
std::vector<ll> p(N, 0);

void solve()
{
    ll n, g = 0;
    cin >> n;
    std::vector<ll> v(n);
    for(ll &i : v) cin >> i, g = __gcd(i, g);
    if(g > 1)
    {
        cout << "not coprime";
    }
    else
    {
        bool pos = 1;
        for(ll i = 2; i < N; i++)
        {
            if(p[i]) continue;
            for(ll j = i; j < N; j += i)
                p[j] = i;
        }
        set<ll> cur;
        for(ll i : v)
        {
            if(!pos) break;
            ll x = i;

            while(x != 1 and pos)
            {
                ll y = p[x];
                while(x % y == 0)
                {
                    x /= y;
                }
                if(cur.count(y))
                    pos = 0;
                cur.insert(y);
            }
        }

        cout << (pos ? "pairwise coprime" : "setwise coprime");
    }

}
int main()
{

#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);


    ll TESTS = 1;
    // cin >> TESTS;
    for(int t = 1; t <= TESTS; t++)
    {
        solve();
    }
    return 0;
}


Measured memory_bytes: 34608
#include <bits/stdc++.h>
using namespace std;
int main (){
	int N;
	cin >> N;
	std::vector<int> A(N);
	for (int i = 0; i < N; ++i)
	{
		cin >> A[i];
	}
	sort(A.begin(), A.end());
	cout << A[N-1] - A[0] << endl;
}

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

int main(void) {
   
   int N;
   
   scanf("%d",&N);
   
   char *S = malloc(sizeof(char)*(N+100));
   
   scanf("%s",S);
   
   int i;
   int Ans[N+1];
   
   Ans[N] = 0;
   
   for (i = 0; i < N; i++) {
      if(S[i] == '#') {
         Ans[N] = Ans[N] + 1;
      }
   }

   for (i = N - 1; i >= 0; i--) {
      if(S[i] == '.') {
         Ans[i] = Ans[i+1] + 1;
      }
      else {
         Ans[i] = Ans[i+1] - 1;
      }
   }
   
   int ans = N;
   
   for (i = 0; i <= N; i++) {
      if (Ans[i] < ans) {
         ans = Ans[i];
      }
   }
   
   printf("%d\n",ans);

   return 0;
}


Measured memory_bytes: 1152
N = int(input())
A = [0] + [int(input()) for i in range(N)]

now = 1
count = 0
pushed = {1}
while now != 2:
  now = A[now]
  count += 1
  if now in pushed:
    print(-1)
    quit()
  pushed.add(now)

print(count)

Measured memory_bytes: 19540
#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
    int N, T; // N routes, T max time;
    
    cin >> N >> T;
    
    int C=1000; // menor custo
    int c, t; // c cost, t time
    int flag=0;
    
    for (int i=0; i<N; i++){
        cin >> c >> t;
        if (t<=T){
            if (c<C) C=c;
            flag = 1;
        }
    }
    
    if (flag==1) cout << C << endl;
    else cout << "TLE\n";
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, x, N) for (long long i = x; i < (N); i++)
using namespace std;
int main()
{
    long long N, inf = 1e+6, ans = 1e+12;
    cin >> N;
    rep(i, 1, inf + 1)
    {
        if (N % i == 0)
        {
            long long j = N / i;
            ans = min(ans, (j - 1) + (i - 1));
        }
    }
    cout << min(ans, N - 1) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; using ll = long long; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

int main() {
    int N;
    cin >> N;
    switch (N % 10) {
    case 2:
    case 4:
    case 5:
    case 7:
    case 9:
        write("hon");
        break;
    case 0:
    case 1:
    case 6:
    case 8:
        write("pon");
        break;
    default:
        write("bon");
        break;
    }
}

Measured memory_bytes: 3584
#include <algorithm>
#include<iostream>
#include<vector>
#include<deque>
#include<queue>
#include<list>
#include<stack>
#include<map>
#include<set>
#include<string>
#include <sstream>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;


int main(){
  long ii,jj,kk;
  vector<int> ret;
  int n;
  vector<int> a;
  int q;

  cin >> n;

  a.resize(n);

  for(ii=0;ii<n;ii++){
    cin >> a[ii];
  }

  cin >> q;

  int c,b,e,k,cnt;
  long long int val;
  for(ii=0;ii<q;ii++){
    cin >> b >> e >> k;
    cnt = 0;

    for(jj=b;jj<e;jj++){
      if(a[jj] == k){
        cnt++;
      }
    }
    
    cout << cnt << endl;
  }
  
  return 0;
}



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

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

using namespace std;

int main(){
	int n;
	string s,t; cin>>n>>s>>t;
	rep(i,n+1) if(s.substr(i)==t.substr(0,n-i)) {
		printf("%d\n",n+i);
		break;
	}
	return 0;
}


Measured memory_bytes: 256
import java.awt.Point;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] tmpArray = br.readLine().split(" ");

		//0 origin
		int n = Integer.parseInt(tmpArray[0]);
		int m = Integer.parseInt(tmpArray[1]);

		Edge edges[] = new Edge[m];

		double sumOfLength = 0;

		Point points[] = new Point[n];


		for(int i = 0; i < n; i++){
			tmpArray = br.readLine().split(" ");
			int x = Integer.parseInt(tmpArray[0]);
			int y = Integer.parseInt(tmpArray[1]);

			points[i] = new Point(x, y);
		}

		for(int i = 0; i < m; i++){
			tmpArray = br.readLine().split(" ");
			int from = Integer.parseInt(tmpArray[0]) - 1;
			int to = Integer.parseInt(tmpArray[1]) - 1;
			double cost = points[from].distance(points[to]);

			edges[i] = new Edge(from,to, cost);

			sumOfLength += cost;
		}

		System.out.printf("%.3f\n", sumOfLength - kruskal(edges, n));
	}


	static final int INF = Integer.MAX_VALUE;


	static double kruskal(Edge[] edges, int n){
		int numOfEdge = edges.length;

		Arrays.sort(edges);

		DisjointSet set = new DisjointSet(n);

		double result = 0;

		for(int i = 0; i < numOfEdge ; i++){
			Edge tmpEdge = edges[i];

			if(!set.isSameSet(tmpEdge.from, tmpEdge.to)){
				set.union(tmpEdge.from, tmpEdge.to);
				result += tmpEdge.cost;
			}
		}

		return result;

	}
}

class DisjointSet {
    private int n;
    private int[] p;
    private int[] rank;

    public DisjointSet(int n){
        this.n = n;

        p = new int[n + 1];
        rank = new int[n + 1];

        for(int i = 1; i <= n; i++){
            makeSet(i);
        }
    }

    private void makeSet(int x){
        p[x] = x;
        rank[x] = 0;
    }

    public void union(int x, int y){
        link (findSet(x), findSet(y));
    }

    private int findSet(int x){
        if(x != p[x]){
            p[x] = findSet( p[x]);
        }
        return p[x];
    }

    public boolean isSameSet(int x, int y){
        return findSet(x) == findSet(y);
    }

    private void link(int x, int y){
        if(rank[x] > rank[y]){
            p[y] = x;
        }
        else {
            p[x] = y;
            if(rank[x] == rank[y]){
                rank[y]++;
            }
        }
    }
}

class Edge implements Comparable<Edge>{
	int from;
	int to;
	double cost;

	Edge(int from, int to, double cost){
		this.from = from;
		this.to = to;
		this.cost = cost;
	}

	//長い順に並ぶように
	@Override
	public int compareTo(Edge e) {
		return this.cost == e.cost ? 0 : (this.cost < e.cost ? 1 : -1);
	}
}


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

int main(){
	int n;
	int person[22], fish[22];
	int array[22];
	int fisherMan[22];
	int fisher = 0;

	cin >> n;
	for(int i=0; i < n; i++){
		cin >> person[i] >> fish[i];
		array[i] = fish[i];
	}
	sort(array, array+n, greater<int>());

	for(int i=0; i < n; i++){
		if(fish[i] == array[0]){
			fisherMan[fisher] = person[i];
			fisher++;
		}
	}

	sort(fisherMan, fisherMan+fisher);

	cout << fisherMan[0] << " "  << array[0] << endl;
}

Measured memory_bytes: 1184
/* ****revpro**** */
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define endl     '\n'
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)    
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define mii      map<ll,ll>
using namespace std;

#define TIME        cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define N  100005
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;  
#define ordered_set tree<double, null_type,less<double>, rb_tree_tag,tree_order_statistics_node_update> 
void solve()
{
  ll f=0;
  deque <char> q;
  string s;
  cin>>s;
  for(auto i:s)
  {
    q.push_back(i);
  }
  ll qu;
  cin>>qu;
  rep(i,0,qu)
  {
    ll t;
    cin>>t;
    if(t==1)
    {
      f=!f;
    }
    else{
      ll tmp;
      char c;
      cin>>tmp>>c;
      tmp--;
      if(tmp^f)
      {
        q.push_back(c);
      }
      else q.push_front(c);
    }
  }
  if(!f)
  while(!q.empty())
  {
    cout<<q.front();
    q.pop_front();
  }
  else{
   while(!q.empty())
  {
    cout<<q.back();
    q.pop_back();
  } 
  }
}
signed main()
{
  
    /***********************************/
    unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
    mt19937_64 generator (seed);

  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS=1;
//  cin>>TESTS;
  while(TESTS--)
  {
    solve();
    
  }
  TIME
  return 0;
}

Measured memory_bytes: 976
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<set>
using namespace std;
int cnt[16], val[100005], Xor[1<<15], num[1<<15], dp[1<<15];

inline int read()
{
    int x=0,f=1; char ch=getchar();
    for (; ch<'0' || ch>'9'; ch=getchar()) if (ch=='-') f=-1;
    for (; ch>='0' && ch<='9'; ch=getchar()) x=(x<<1)+(x<<3)+ch-'0';
    return x*f;
}

int main()
{
    int n=read(), ans=0, sta=0;
    for (int i=1, u, v, w; i<n; i++) 
        u=read(), v=read(), w=read(), val[u]^=w, val[v]^=w;
    for (int i=0; i<n; i++) cnt[val[i]]++;
    for (int i=1; i<=15; i++) ans+=cnt[i]/2, sta|=(cnt[i]&1)<<(i-1);
    for (int i=1; i<(1<<15); i++) num[i]=num[i>>1]+(i&1);
    for (int i=1; i<(1<<15); i++) dp[i]=num[i]-1;
    for (int i=1; i<(1<<15); i++) 
        for (int j=1; j<=15; j++) if ((i>>(j-1))&1) Xor[i]^=j;
    for (int i=1; i<(1<<15); i++)
        if (!Xor[i])
            for (int j=i; j; j=(j-1)&i)
                if (!Xor[j]) dp[i]=min(dp[i], dp[j]+dp[i^j]);
    ans+=dp[sta];
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 1024
def up(num, li):
    if num % 2 == 0:
        next_num = num // 2
    else:
        next_num = 3 * num + 1
    if num in li:
        return len(li) + 1
    li.append(num)
    return up(next_num, li)

print(up(int(input()), []))

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,c=0,d=0,e=0,f=0;
cin>>n;

while(n--)
{
         string s;
         cin>>s;
         if(s=="AC")
         c++;
         else if(s=="WA")
         d++;
         else if(s=="TLE")
         e++;
         else if(s=="RE")
         f++;
}
         cout<<"AC"<<" "<<"x"<<" "<<c<<endl;
         cout<<"WA"<<" "<<"x"<<" "<<d<<endl;
         cout<<"TLE"<<" "<<"x"<<" "<<e<<endl;
         cout<<"RE"<<" "<<"x"<<" "<<f<<endl;
}

Measured memory_bytes: 3616
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
#include <boost/multiprecision/cpp_int.hpp>
#include <complex>
#include <cstdio>
#include <list>
#include <bitset>

//< in.txt > out.txt
using namespace std;
//std::ios::sync_with_stdio(false);
//std::cin.tie(0);
const long long MOD = 998244353;
const long long INF = 1e18;
typedef long long LL;
typedef long double LD;
typedef boost::multiprecision::cpp_int bigint;
typedef pair<LL, LL> PLL;
typedef pair<LD, LL> pdl;
typedef pair<LD, LD> pdd;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned long long ULL;

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	LL N, S;
	cin >> N >> S;
	VLL A(N+1,0);
	for (LL n = 1; n <= N; n++) {
		cin >> A[n];
	}
	VLL e(S + 1, 0);
	if (A[1] <= S) {
		e[A[1]]++;
	}
	LL pad = 2;
	for (LL n = 2; n <= N; n++) {
		for (LL s = S; s >= 1; s--) {
			e[s] = (e[s] * 2) % MOD;
			if (s >= A[n]) {
				e[s] = (e[s] + e[s - A[n]]) % MOD;
			}
		}
		if (A[n] <= S) {
			e[A[n]] += pad;
			e[A[n]] %= MOD;
		}
		pad *= 2;
		pad %= MOD;
	}
	cout << e[S] << "\n";
	return 0;
}

Measured memory_bytes: 3632
M = 1000000000000
minNum = M
maxNum = -M
sumNum = 0
n = int(input())
numList = list(map(int, input().split()))
for x in numList:
    if x < minNum:
        minNum = x
    if x > maxNum:
        maxNum = x
    sumNum += x
print('%d %d %d' % (minNum, maxNum, sumNum))


Measured memory_bytes: 6588
#include<bits/stdc++.h>
    #include<vector>
    #include<algorithm>
    #define vi vector<int>
    #define all(v) v.begin(), v.end()
    #define ll long long int
    using namespace std;
    int main()
    {
        int n,c1=0,c2=0,c3=0,c4=0;
        cin>>n;
        while(n--)
        {
            string s;
            cin>>s;
            if(s[0]=='A'){
                c1++;
            }
            else if(s[0]=='W'){
                c2++;
            }
            else if(s[0]=='T'){
                c3++;
            }
            else{
                c4++;
            }
        }
        cout<<"AC x "<<c1<<endl;
        cout<<"WA x "<<c2<<endl;
        cout<<"TLE x "<<c3<<endl;
        cout<<"RE x "<<c4<<endl;
    }


Measured memory_bytes: 3604
#include<bits/stdc++.h>
#define rep(i, l, r) for(int i = (l), i##end = (r);i <= i##end;++i)
using std::cin; using std::cout;
const int maxn = 200200;
typedef long long ll;
const int mod = 1e9 + 7;
inline ll pow(ll a,int b,int ans = 1) {
	for(;b;b >>= 1,a = a * a % mod) if(b & 1)
		ans = ans * a % mod;
	return ans;
}
inline ll inverse(int x){ return pow(x, mod - 2); }
struct T {
	int a[3][3];
	inline T operator * (const T & b) const {
		T ret; memset(& ret, 0, sizeof ret);
		rep(i, 0, 2) rep(j, 0, 2) if(a[i][j]) rep(k, 0, 2)
			ret.a[i][k] = (ret.a[i][k] + (ll) a[i][j] * b.a[j][k]) % mod;
		return ret;
	}
};
const T I = {1, 0, 0, 0, 1, 0, 0, 0, 1}, a1 = {2, 2, 1, 1, 1, 1, 1, 0, 1}, a2 = {1, 2, 1, 0, 1, 1, 0, 0, 1};
inline T pow(T a,int b,T ans = I) {
	for(;b;b >>= 1,a = a * a) if(b & 1)
		ans = ans * a;
	return ans;
}
int x[maxn], n, m;
T trans = {1};
int main() {
	std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n >> m;
	rep(i, 1, m) {
		cin >> x[i];
		trans = trans * pow(a1, x[i] - x[i - 1] - 1) * a2;
	}
	trans = trans * pow(a1, n - x[m] - 1);
	cout << ((unsigned) trans.a[0][0] + trans.a[0][1] + trans.a[0][2]) % mod << '\n';
}


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

void solve() 
{
    ll a,b,n;cin>>a>>b>>n;
    if(n>=b-1){
        cout<<a*(b-1)/b - (b-1)/b*a<<endl;
    }else{
        cout<<a*n/b - n/b*a<<endl;
    }
}

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

Measured memory_bytes: 3652
#include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
#define rep(i, x, n) for(int i = x; i < n; i++)
using namespace std;
const long long INF = 1LL << 60;
bool compare_by_a(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first) {
        return a.first < b.first;
    } else {
        return a.second < b.second;
    }
}
const int ININF = 1000000;
long long longPow(int n) {
    long long res = 1;
    rep(i, 0, n) { res *= 2; }
    return res;
}

int main() {
    long long H;
    cin >> H;
    int c = 0;
    vector<long long> v;
    rep(i, 1, 100) {
        v.push_back(H);
        H /= 2;
        if(H == 0) {
            c = i;
            break;
        }
    }
    long long res = 0;
    rep(i, 0, c) { res += longPow(i); }
    cout << res << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(int i=(n);i<(k);i++)
#define ALL(a)  (a).begin(),(a).end()
ll ans=0;
void Main(){
    ll n;cin>>n;
    ll k;cin>>k;
    vector<int> snuke(n+1,0);
    For(i,0,k){
        ll d;cin>>d;
        For(j,0,d){
            ll a;cin>>a;
            snuke[a]++;
        }
    }
    For(i,1,n+1) if(snuke[i]==0) ans++;
    cout << ans << endl;
}
int main(){
    Main();
    /*
    東方風神録は神が出てくるので当然神ゲー
    */
    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

using std::string;
using std::vector;
using std::set;
using std::multiset;
using std::unordered_set;
using std::map;
using std::multimap;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

using boost::multiprecision::cpp_int;
using cpp_dec_float_1000 = boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>>;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

constexpr char CRLF  = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;
constexpr int MOD = 1000'000'007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }
template<class T> T modinv(T a, T m) { T b = m, u = 1, v = 0; while (b) { T t = a / b; a -= t * b; boost::swap(a, b); u -= t * v; boost::swap(u, v); } u %= m; if (u < 0) u += m; return u; }

struct Tmp
{
public:
  Tmp(int N);
};

Tmp::Tmp(int N){}

void solve(void)
{
  ll N; cin >> N;
  ll A, B; cin >> A >> B;

  ll cnt = N / (A+B);
  ll amari = N % (A+B);
  ll amariAo = std::min(A, amari);
  auto ans = cnt*A + amariAo;

  cout << ans << CRLF;
  return;
}

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

  solve();

  return 0;
}


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

using namespace std;

typedef long long int lli;

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

    string s;
    cin >> s;
    int n = s.size();
    lli mod = 1000000007;
    vector<vector<lli>> dp(n+1, vector<lli>(13, 0));
    dp[0][0] = 1;

    for (int dig=1; dig<=n; dig++) {
        if (s[dig-1] == '?') {
            for (int d=0; d<=9; d++) {
                for (int i=0; i<13; i++) {
                    int x = (i*10+d)%13;
                    dp[dig][x] = (dp[dig][x] + dp[dig-1][i]) % mod;
                }
            }
        }
        else {
            int d = s[dig-1] - '0';
            for (int i=0; i<13; i++) {
                int x = (i*10+d)%13;
                dp[dig][x] += (dp[dig][x] + dp[dig-1][i]) % mod;
            }
        }
    }

    cout << dp[n][5] << endl;

    return 0;
}


Measured memory_bytes: 13648
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
#include <map>
#include <cmath>
#include <math.h>
#include <cstdio>
#include <iomanip>
typedef  long long ll;
using namespace std;

int main(void) {
	double a, b, C, S, L, h;
	cin >> a >> b >> C;
	const double PI = acos(-1);
	C = C / 180 * PI;

	S = a * b * sin(C) / 2;
	L = a + b + sqrt(a * a + b * b - 2 * a * b * cos(C));
	h = 2 * S / a;

	cout << fixed << setprecision(10) << S << endl << L << endl << h << endl;

	return 0;
}


Measured memory_bytes: 3444