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

int p,q,r;
string s;
signed main() {
    cin >> p >> q >> r;
    int a[3];
    a[0] = p;
    a[1] = q;
    a[2] = r;
    sort(a,a+3);
    int ans = a[0] + a[1];
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <queue>
#include <string>
#include <algorithm>
#include <cstdio>
#include <stack>
#include <vector>
#include <map>
#include <ctime>
#include <cmath>
#include <string.h>
#define inf 0x7fffffff
using namespace std;
struct I
{
    int x,y;
};


int a,b,c,k,n,m,i,d,e[4010][4005],o[410200],l[212000],dx[20]={1,-1},dy[20]={0,0,1,-1},dz[20]={1,-1};
long long x,y,z[20200];
//map <string,int> m;
int j[1060][20];

stack<int> s;
char r1[5500];
//deque<int> d;
struct P
{
    int x,y;
    /*bool operator<(const P &a)const
    {

        return max(x,-x)<=max(a.x,-a.x);
    }*/
};
double u;
//P u[500000];
vector <int> v[211010];
queue<int> q;
string r;

//A==65
//Z==90

//a==97

bool sdf(P a,P b)
{
    return a.x<b.x;
}



int main()
{
    scanf("%d %d",&a,&b);
    for(int t=1;t<=b;t++)
    {
        scanf("%d %d",&c,&d);
        v[c].push_back(d);
        v[d].push_back(c);
    }
    for(int t=0;t<v[1].size();t++)
    {
        l[v[1][t]]=1;
        q.push(v[1][t]);
    }
    for(;q.size();q.pop())
    for(int t=0;t<v[q.front()].size();t++)
    {
        l[v[q.front()][t]]=1;
    }
    if(l[a]) puts("POSSIBLE");
    else puts("IMPOSSIBLE");
}


Measured memory_bytes: 13808
#include <bits/stdc++.h>
//#include<fstream>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
#define endl '\n'
#define pb push_back
#define fi first
#define se second
typedef long long ll;
#define double long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define all(con) con.begin(),con.end()
#define w(x) int x; cin>>x; while(x--)
const ll infl=0x3f3f3f3f3f3f3f3fLL;
const int infi=0x3f3f3f3f;
//const int mod=998244353;
const int mod=1000000007;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

/*ofstream fout("bcount.out");
ifstream fin("bcount.in");*/

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    cout<<fixed<<setprecision(8);
    ll a;
    cin>>a;
    ll ans = a + a*a + a*a*a;
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3664
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <iomanip>

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
template<class T>using vv = vector<vector<T>>;

#define in(v) v; cin >> v;
// #define rep(i,n) for(int i=0;i<(n);++i)
#define all(f,c,...) (([&](decltype((c)) cccc) { return (f)(begin(cccc), end(cccc), ## __VA_ARGS__); })(c))
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

#define rrep(i,n) for(int i=(n);i>=0;--i)
const int dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};
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;}

// debug
template<class T>ostream& operator<<(ostream& os,const vector<T>& vec){os<<"{";for(int i=0;i<vec.size();++i)os<<(i?", ":"")<<vec[i];os<<"}";return os;}
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>& rhs){os<<"("<<rhs.first<<", "<<rhs.second<<")";return os;}

#ifdef LOCAL
void debug() {cerr << "\n";}
template<class First> void debug(const First& first) {cerr<<first<<"\n";}
template<class First, class... Rest> void debug(const First& first, const Rest&... rest) {cerr<<first<<",";debug(rest...);}
#else
#define debug(...) 42
#endif

int main() {
  int in(N); int in(K); int in(C);
  string in(S);

  int count = 0;
  rep(i, N) {
    if (S[i] == 'o')
      ++count;
  }
  if (N == K) {
    rep(i, N)
      cout << i + 1 << endl;
    return 0;
  }
  if (count == K) {
    rep(i, N) {
      if (S[i] == 'o')
        cout << i + 1 << endl;
    }
    return 0;
  }

  vi dp(N), dp2(N, 0);
  rep(i, N) {
    if (S[i] == 'o') {
      if (i - (C + 1) >= 0)
        dp[i] = dp[i-(C+1)] + 1;
      else
        dp[i] = 1;
    } else if (i-1 >= 0)
      dp[i] = dp[i-1];
  }
  rrep(i, N-1) {
    if (S[i] == 'o') {
      if (i + C + 1 < N)
        dp2[i] = dp2[i+C+1] + 1;
      else
        dp2[i] = 1;
    } else if (i + 1 < N)
      dp2[i] = dp2[i+1];
  }
  rep(i, N) {
    int tmp = 0;
    if (i-1 >= 0)
      tmp += dp[i-1];
    if (i+1 < N)
      tmp += dp2[i+1];
    if (tmp < K) {
      cout << i+1 << endl;
    }
  }

  return 0;
}


Measured memory_bytes: 2180
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iostream>
# include <vector>
# include <queue>
# include <stack>
# include <map>
# include <bitset>
# include <sstream>
# include <set>
# include <cmath>
# include <algorithm>
# pragma  comment(linker,"/STACK:102400000,102400000")
using namespace std;
# define LL          long long
# define pr          pair
# define mkp         make_pair
# define lowbit(x)   ((x)&(-x))
# define PI          acos(-1.0)
# define INF         0x3f3f3f3f3f3f3f3f
# define eps         1e-8
# define MOD         1000000007

inline int scan() {
    int x=0,f=1; char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-') f=-1; ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
    return x*f;
}
inline void Out(int a) {
    if(a<0) {putchar('-'); a=-a;}
    if(a>=10) Out(a/10);
    putchar(a%10+'0');
}
# define MX 100005
/**************************/
LL q,h,s,d;
LL get(LL n)
{
    LL ans;
    if (n==1)
    {
        ans=min(4*q,2*h);
        ans=min(ans,s);
    }
    else if (n==2)
    {
        LL ppp = min(8*q,4*h);
        LL kkk = min(2*s,d);
        ans=min(ppp,kkk);
    }
    else
    {
        if (n%2)
        {
            LL p = n/2*2;
            LL aa=p*q*4;
            LL bb=p*h*2;
            LL cc=p*s;
            LL dd=p*d/2;
            ans = min(aa,bb);
            ans = min(cc,ans);
            ans = min(dd,ans);

            LL sb=min(4*q,2*h);
            sb=min(sb,s);

            ans+=sb;
        }
        else
        {
            LL p = n/2*2;
            LL aa=p*q*4;
            LL bb=p*h*2;
            LL cc=p*s;
            LL dd=p*d/2;
            ans = min(aa,bb);
            ans = min(cc,ans);
            ans = min(dd,ans);
        }
    }
    return ans;
}

int main()
{

    LL n;
    scanf("%lld%lld%lld%lld",&q,&h,&s,&d);
    scanf("%lld",&n);
    LL ans=get(n);
    printf("%lld\n",ans);
    return 0;
}


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

struct node {
	int key;
	node *right, *left, *parent;
	node(int key_) {
		key = key_;
		right = left = parent = NULL;
	}
	~node() {
		if (right != NULL) delete right;
		if (left != NULL) delete left;
	}
};

struct Binary_Tree {
	node *head;
	Binary_Tree() {
		head = NULL;
	}
	~Binary_Tree() {
		if (head != NULL) delete head;
	}
	void insert(int k) {
		insert(new node(k));
	}
	void insert(node* z) {
		node *y = NULL, *x = head;
		while(x != NULL){
			y = x;
			if (z->key < x->key)
				x = x->left;
			else
				x = x->right;
		}
		z->parent = y;

		if (y == NULL) {
			head = z;
		}
		else if (z->key < y->key) {
			y->left = z;
		}
		else {
			y->right = z;
		}
	}
	void Inorder(node *n) {
		if (n == NULL) return;
		Inorder(n->left);
		cout << ' ' << n->key;
		Inorder(n->right);
	}
	void Preorder(node *n) {
		if (n == NULL) return;
		cout << ' ' << n->key;
		Preorder(n->left);
		Preorder(n->right);
	}
	void print() {
		Inorder(head); cout << endl;
		Preorder(head); cout << endl;
	}
	void find(int k) {
		bool flag = false;
		node *x = head;
		while (x != NULL) {
			if (k == x->key) {
				flag = true;
				break;
			}
			else if (k < x->key)
				x = x->left;
			else
				x = x->right;
		}
		if (flag) {
			cout << "yes" << endl;
		}
		else {
			cout << "no" << endl;
		}
	}
	void Delete(int k) {
		node *x = head;
		if (x == NULL) return;
		while (x->key != k) {
			if (k < x->key)
				x = x->left;
			else
				x = x->right;
			if (x == NULL) return;
		}
		Delete(x);
	}
	void Delete(node *z) {
		if (z->left == NULL && z->right == NULL) {
			if (z->parent != NULL) {
				if (z->parent->left == z)
					z->parent->left = NULL;
				else
					z->parent->right = NULL;
			}
			delete z;
		}
		else if (z->left == NULL) {
			z->right->parent = z->parent;
			if (z->parent != NULL) {
				if (z->parent->left == z)
					z->parent->left = z->right;
				else
					z->parent->right = z->right;
			}
			z->right = NULL;
			delete z;
		}
		else if (z->right == NULL) {
			z->left->parent = z->parent;
			if (z->parent != NULL) {
				if (z->parent->left == z)
					z->parent->left = z->left;
				else
					z->parent->right = z->left;
			}
			z->left = NULL;
			delete z;
		}
		else {
			node *x = z->right, *y = z;
			while (x != NULL) {
				y = x;
				x = x->left;
			}
			z->key = y->key;
			Delete(y);
		}
	}
};

int main()
{
	int m;
	string s;
	Binary_Tree bt;
	cin >> m;
	for (int i = 0, n; i < m; i++) {
		cin >> s;
		if (s == "insert") {
			cin >> n;
			bt.insert(n);
		}
		else if (s == "delete") {
			cin >> n;
			bt.Delete(n);
		}
		else if (s == "find") {
			cin >> n;
			bt.find(n);
		}
		else {
			bt.print();
		}
	}
	return 0;
}

Measured memory_bytes: 21908
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @author Don Li
 */
public class Main {
    void solve() {
        long A = in.nextLong(), B = in.nextLong();
        out.println(f(B) ^ f(A - 1));
    }
    
    long f(long n) {
        if (n <= 0) return 0;
        if (n % 2 == 0) return f(n - 1) ^ n;
        long ones = (n + 1) / 2;
        if (ones % 2 == 0) return 0;
        return 1;
    }
    
    public static void main(String[] args) {
        in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        new Main().solve();
        out.close();
    }
    
    static FastScanner in;
    static PrintWriter out;
    
    static class FastScanner {
        BufferedReader in;
        StringTokenizer st;
        
        public FastScanner(BufferedReader in) {
            this.in = in;
        }
        
        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        public int nextInt() {
            return Integer.parseInt(nextToken());
        }
        
        public long nextLong() {
            return Long.parseLong(nextToken());
        }
        
        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}


Measured memory_bytes: 23124
#include<stdio.h>

int main(){
  int i,j,minj,n,flag,tmp,cnt=0;
  int A[100];
  
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }

  for(i=0;i<n;i++){
    minj=i;
    for(j=i;j<n;j++){
      if(A[j]<A[minj]){
	minj=j;
      }
    }
    tmp= A[i];
    A[i]=A[minj];
    A[minj]=tmp;
    if(i!=minj) cnt++;
  }
  
  for(i=0;i<n-1;i++){
    printf("%d ",A[i]);
  }
  printf("%d\n%d\n",A[n-1],cnt);
  
  return 0;
}



Measured memory_bytes: 2108
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define rep(i,x) for(ll i = 0; i < (ll)(x); i++)
#define rrep(i,x) for(ll i = (ll)(x)-1;0 <= i; i--)
#define reps(i,x) for(ll i = 1; i < (ll)(x)+1; i++)
#define rreps(i,x) for(ll i = (ll)(x); 1 <= i; i--)
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
const ll INF = numeric_limits<ll>::max()/4;
const int n_max = 330;
#define int ll

ll n;
vector<vector<vector<ld>>> memo(n_max, vector<vector<ld>>(n_max, vector<ld>(n_max)));
ld dfs(ll c1, ll c2, ll c3){
    ld i = n - c1 - c2 - c3;
    if(memo[c1][c2][c3])return memo[c1][c2][c3];
    if(i == n)return 0.0;
    ld ans = ld(n);
    if(c1 > 0)ans += dfs(c1-1, c2, c3) * c1;
    if(c2 > 0)ans += dfs(c1+1, c2-1, c3) * c2;
    if(c3 > 0)ans += dfs(c1, c2+1, c3-1) * c3;
    // debug(c1);debug(c2);debug(c3); debug(ans);debug(i);debug(n);
    return memo[c1][c2][c3] =  ans / ld(n - i);
}

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    cin >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];
    vector<ll> cnt(4);
    rep(i,n){
        cnt[a[i]]++;
    }

    // debug(dfs(2,0,0));

    cout << fixed << setprecision(15);
    cout << dfs(cnt[1], cnt[2], cnt[3]) << endl;
}

Measured memory_bytes: 573312
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <ctype.h>
#include <stdlib.h>


using namespace std;


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

int ans = c  - (a-b) ;
if(ans <= 0){
    cout << 0 << endl;
}else{
cout << ans << endl;
}

}


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

using namespace std;

using VI = vector<int>;
using VVI = vector<VI>;
using VB = vector<bool>;
using VVB = vector<VB>;
using VD = vector<double>;
using VVD = vector<VD>;
using VS = vector<string>;
using PII = pair<int, int>;
using VPII = vector<PII>;
using VL = vector<long long>;
using VVL = vector<VL>;

#define sz(var) (int)var.size()
#define REP(var, start, end) for(int var = start; var < (int)end; ++var)
#define CLEAR(var, with) memset(var, with, sizeof(var))
#define ALL(x) x.begin(), x.end()
#define LL long long
#define ULL unsigned long long
#define TIME cout << "Time elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms" << endl;

LL n, m;
LL maxgroups()
{
	LL ans = 0;
	if(n * 2ll <= m) // n을 모두 쓸 수 있으면
		ans += n, m -= n * 2ll;
	else
		ans += m / 2, m %= 2;
	return ans + m / 4;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
#ifndef ONLINE_JUDGE
	//freopen("tmp.in", "r", stdin);
//	freopen("tmp.out", "w", stderr);
#endif
	cin >> n >> m;

	cout << maxgroups() << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const int INF = 1000000000;
const ll MOD = 1000000007;

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

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

  queue<ll> q;
  for(ll i = 1; i <= 9; ++i){
    q.push(i);
  }

  ll i = 0;
  while(1){
    i++;
    ll tmp = q.front();
    q.pop();

    if(i == k){
      cout << tmp << endl;
      return 0;
    }

    if(tmp % 10 == 0){
      ll tmp2 = tmp * 10 + (tmp % 10 - 0);
      q.push(tmp2);
      tmp2 = tmp * 10 + (tmp % 10 + 1);
      q.push(tmp2);
    }
    else if (tmp % 10 == 9){
      ll tmp2 = tmp * 10 + (tmp % 10 - 1);
      q.push(tmp2);
      tmp2 = tmp * 10 + (tmp % 10 - 0);
      q.push(tmp2);
    }
    else{
      ll tmp2 = tmp * 10 + (tmp % 10 - 1);
      q.push(tmp2);
      tmp2 = tmp * 10 + (tmp % 10 - 0);
      q.push(tmp2);
      tmp2 = tmp * 10 + (tmp % 10 + 1);
      q.push(tmp2);
    }
  }

  return 0;
}


Measured memory_bytes: 1792
#include<iostream>
using namespace std;
int main(){
  double W,H,x,y; cin>>W>>H>>x>>y;
  if((x==W/2)&&(y==H/2)){
    cout<<double(W*H/2.0)<<" 1"<<endl;
  }else{
    cout<<double(W*H/2.0)<<" 0"<<endl;
  }

}


Measured memory_bytes: 256
a, b, c, k = map(int, input().split())
if a == 0:
    if b >= k:
        print(0)
    else:
        k1 = k-b
        print(-k1)
elif b == 0:
    if a >= k:
        print(k)
    else:
        k1 = k-a
        print(a-k1)
elif c == 0:
    if a >= k:
        print(k)
    else:
        print(a)
else:
    if a >= k:
        print(k)
    else:
        k1 = k-a
        if b >= k1:
            print(a)
        else:
            k2 = k1-b
            print(a-k2)

Measured memory_bytes: 9164
#include <stdio.h>
#include <math.h>

#define EPS 1e-5

int main (void) {
    int q;
    double px, x;
    while (scanf("%d", &q) != EOF && q != -1) {
        px = (double)q / 2;
        do {
            x = px - (px*px*px - q) / (3*px*px);
            px = x;
        } while (fabs(x*x*x - q) >= EPS * q);
        printf("%.6lf\n", x);
    }
    return 0;
}

Measured memory_bytes: 636
n = int(input())
c = [[0]*10 for i in range(10)]
for i in range(1,n+1):
    s = str(i)
    l = int(s[0])
    r = int(s[-1])
    c[l][r] += 1
ans = 0
for i in range(10):
    for j in range(10):
        ans += c[i][j]*c[j][i]
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include<math.h>
#include<queue>
#include<cstdio>
#include<set>
#include<map>
using namespace std;
using ll = long long;

int main(){
    ll N,K;
    cin >> N >> K;
    vector<ll> L(K+1),R(K+1);
    for(ll i=1; i<=K; i++){
        cin >> L.at(i) >> R.at(i);
    }
  	vector<ll> sum(K+1,0);
  	ll kiri=998244353;
    vector<ll> ans(N+1,0),rans(N+1,0);
    ans.at(1)=1;
  	rans.at(1)=1;
    for(ll i=2; i<=N; i++){
      	for(ll j=1; j<=K; j++){
			if(L.at(j)<=i && i<=R.at(j)+1){
				sum.at(j)+=rans.at(i-L.at(j));
            }
          	if(i>R.at(j)+1){
				sum.at(j)+=rans.at(i-L.at(j));
              	sum.at(j)-=rans.at(i-R.at(j)-1);
            }
        }
        for(ll j=1; j<=K; j++){
            ans.at(i)+=sum.at(j);
        }
     	rans.at(i)=ans.at(i)%kiri;
      	
    }
    cout << rans.at(N) << endl;
    return 0;
}

Measured memory_bytes: 6424
#include <bits/stdc++.h>
#define SZ(x) ((int)(x).size())
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cout.setf(ios::fixed); cout.precision(20);
    string s, t; cin >> s >> t;
    int res = 0;
    for (int i = 0; i < 3; i++) {
        res += (s[i] == t[i]);
    }
    cout << res << "\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define f first
#define s second
#define MOD 1000000007
#define PMOD 998244353
#define pb(x) push_back(x)
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> plii;
typedef pair<int, pii> piii;
const int INF = 1e9+10;
const ll LINF = 1LL*INF*INF;
const int MAXN = 2e5+10;
const int MAXM = 5e3+10;

priority_queue<int> pq;
vector<vector<int> > graph;
queue<int> que;

int A[MAXN];
bool visit[MAXN];
char S[MAXN];

int main()
{
    int n,m,k,a,b,x,y,q;
    ll sum = 0;
    int cnt = 0;
    int mn = INF;
    int cur = 0, idx = -1;
    int tc;

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin>>n;

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

    ll mx = 0;

    for(int i=1;i<n;i++){
        sum = 0;
        for(int j=0;;j++){
            if(n-1<=i*(j+1))break;
            visit[i*j] = true;
            if(visit[n-1-i*j])break;
            sum+=A[i*j];
            sum+=A[n-1-i*j];
            mx = max(mx,sum);
        }
        for(int j=0;j*i<n;j++)
            visit[i*j] = false;
    }

    cout<<mx<<"\n";

    return 0;
}


Measured memory_bytes: 768
#include<stdio.h>
#include<string.h>
#define N 100000000 
   
char c[14];
int x[N];
int n;
    
int a(void);
int b(char);
void insert(void);
int find(void);
    
int main(){
char str[7];
int i;
    
 scanf("%d",&n);
 for(i=0;i<n;i++){
   scanf("%s%s",str,c);
   if(str[0]=='i'){
     insert();
   }
   else if(str[0]=='f'){
     if(find())printf("yes\n");
     else printf("no\n");
   }
 } 
 return 0;
}
   
int a(void){
  int x=0,i,p=1;
  for(i=0;i<strlen(c);i++){
    x+=p*(b(c[i]));
    p*=5;
  }
  return x;
}
    
int b(char c){
    
  if(c=='A'){
    return 1;
  }
  else if(c=='C'){
    return 2;
  }
  else if(c=='G'){
    return 3;
  }
  else return 4;
    
}
   
void insert(){
  x[a()]=1;
}
int find(){
    int key =a();
        
    if(x[key]){
   return 1;
    }
    else return 0;
} 

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

int main(){
    int A, B;
    int ans;

    //input
    cin >> A >> B;

    ans = A + B;
    if(ans < A - B){
        ans = A - B;
    }
    if(ans < A * B){
        ans = A * B;
    }

    //output
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys
from collections import deque


inf = float('inf')

def solve(N: int, a: "List[int]", b: "List[int]"):
    adj = [set() for _ in range(N)]
    for u, v in zip(a, b):
        adj[u].add(v)
        adj[v].add(u)
    
    dist_F = [inf for _ in range(N)]
    dist_F[0] = 0
    dist_S = [inf for _ in range(N)]
    dist_S[N-1] = 0

    Q = deque([(0, 0)], N)
    while len(Q) > 0:
        du, u = Q.pop()
        for v in adj[u]:
            if dist_F[v] < inf:
                continue
            dist_F[v] = du + 1
            Q.append((du+1, v))
    

    Q = deque([(0, N-1)], N)
    while len(Q) > 0:
        du, u = Q.pop()
        for v in adj[u]:
            if dist_S[v] < inf:
                continue
            dist_S[v] = du + 1
            Q.append((du+1, v))

    c_S = 0
    c_F = 0

    for df, ds in zip(dist_F, dist_S):
        if df <= ds:
            c_F += 1
        else:
            c_S += 1

    if c_F <= c_S:
        print('Snuke')
    else:
        print('Fennec')    

    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int()] * (N-1)  # type: "List[int]" 
    b = [int()] * (N-1)  # type: "List[int]" 
    for i in range(N-1):
        a[i] = int(next(tokens)) - 1
        b[i] = int(next(tokens)) - 1
    solve(N, a, b)

if __name__ == '__main__':
    main()


Measured memory_bytes: 81628
S = input()
K = int(input())
Ans = []
for s in S[:-1]:
    if s == 'a':
        Ans.append('a')
        continue
    if (123 - ord(s)) <= K:
        Ans.append('a')
        K -= 123 - ord(s)
    else:
        Ans.append(s)

K %= 26
if ord(S[-1]) + K >= 123:
    Ans.append(chr(ord(S[-1]) + K - 26))
else:
    Ans.append(chr(ord(S[-1]) + K))


print(''.join(Ans))

Measured memory_bytes: 46832
#include <bits/stdc++.h>
using namespace std;
int main(){
	int N, M; cin >> N >> M; 
	int A[200010] = {}; 
	int cnt[200010] = {}; 
	int dif[400010] = {}; 
	int sum[400010] = {}; 
	for(int i = 1; i <= N; i++){
		cin >> A[i]; cnt[A[i]] ++; 
	}
	for(int i = 1; i <= N; i++){
		dif[i-cnt[i]+1+200005] ++; 
		dif[i+1+200005] --; 
	}
	int ans = 0; 
	for(int i = 1; i <= 400007; i++){
		sum[i] = sum[i-1] + dif[i]; 
		if(i >= 200006 && i <= 200005+N && sum[i] == 0) ans ++; 
	}
	while(M--){
		int x, y; cin >> x >> y; 
		cnt[A[x]] --; 
		int z = A[x] - cnt[A[x]] + 200005; 
		sum[z] --; 
		if(sum[z] == 0 && z >= 200006 && z <= 200005+N) ans++; 
		int w = y - cnt[y] + 200005; 
		if(sum[w] == 0 && w >= 200006 && w <= 200005+N) ans--;
		sum[w] ++; 
		A[x] = y; cnt[y] ++; 
		cout << ans << endl; 
	}
}

Measured memory_bytes: 6144
from collections import deque
n = int(input())
d = deque()
for i in range(n):
    cmd = input().split()
    if cmd[0] == 'insert':
        d.appendleft(cmd[1])
    elif cmd[0] == 'delete':
        try:
            d.remove(cmd[1])
        except:
            pass
    elif cmd[0] == 'deleteFirst':
        d.popleft()
    elif cmd[0] == 'deleteLast':
        d.pop()
print(' '.join(d))


Measured memory_bytes: 69736
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 100050;
int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    if(a<=8 &&b<=8)
        cout<<"Yay!"<<endl;
    else cout<<":("<<endl;


    return 0;
}


Measured memory_bytes: 256
A, B, M = map(int, input().split())
a =  [int(p) for p in input().split()]
b =  [int(p) for p in input().split()]

mincomb = min(a) + min(b)

for i in range(M):
    x, y, c = map(int, input().split())
    mincomb = min(mincomb, a[x-1]+b[y-1]-c)

print(mincomb)

Measured memory_bytes: 18488
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    String s = sc.next();
    int cnt = 0;

    for (int i = 0; i < s.length(); i++) {
      if (s.charAt(i) == 'x') {
        cnt++;
      }
    }

    if (cnt > 7) {
      System.out.println("NO");
    } else {
      System.out.println("YES");
    }

  }
}

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

int main()
{
    int H, N;
    std::cin >> H >> N;
    std::vector<int> A(N);

    for (int i = 0; i < N; i++)
    {
        std::cin >> A[i];
    }

    bool ko = false;
    if (std::accumulate(A.begin(), A.end(), 0) >= H)
    {
        ko = true;
    }

    std::cout << (ko ? "Yes" : "No") << std::endl;

    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#include<cctype>
using namespace std;
int main(){
	int n, k;
  string s;
  cin>>n>>k>>s;
  if(s[k-1]==65||s[k-1]==66||s[k-1]==67){
  	s[k-1]=tolower(s[k-1]);
  }
  cout<<s;
  return 0;
}

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

public class Main {
    static long mod = (int)Math.pow(10,9)+7;
	public static void main(String[] args) throws IOException {
		FastScanner sc = new FastScanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int h1 = sc.nextInt()*60;
		int m1 = sc.nextInt();
		int h2 = sc.nextInt()*60;
		int m2 = sc.nextInt();
		int k = sc.nextInt();
		pw.println(Math.max(0,(h2+m2)-(h1+m1)-k));
		pw.close();
	}
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

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

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

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

    public double nextDouble() {
         return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}



Measured memory_bytes: 25364
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <functional>
#include <cstdlib>
int l;
struct edge{
    int x,y,z;
};
std::vector<edge> v;
void create_edge(int pos, int left)
{
    if(pos == 20) return;
    if(left == 0)
    {
        v.push_back({pos, pos+1, 0});
        create_edge(pos+1, left);
    }
    else if(left % 2)
    {
        v.push_back({pos, pos+1, 0});
        v.push_back({pos, pos+1, left/2+1});
        create_edge(pos+1, left/2);
    }
    else
    {
        v.push_back({pos, pos+1, 0});
        v.push_back({pos, pos+1, left/2});
        v.push_back({pos, 20, left});
        create_edge(pos+1, left/2-1);
    }
}
int main()
{
    scanf("%d", &l);
    create_edge(1, l-1);
    printf("20 %d\n", v.size());
    for(edge& e : v)
    {
        printf("%d %d %d\n", e.x, e.y, e.z);
    }
}

Measured memory_bytes: 256
N, M = map(int, input().split())
LR = [tuple(map(int, input().split())) for _ in range(M)]

max_l, min_r = 0, N

for l, r in LR:
    max_l = max(l, max_l)
    min_r = min(r, min_r)
    if min_r < max_l:
        print(0)
        exit()

print(min_r - max_l + 1)


Measured memory_bytes: 22412
#include <bits/stdc++.h>
#include <bitset>
#include <chrono>
#include <iomanip>
using namespace std;
 
/////------------------------TYPEDEF--------------------------/////
typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<char> vc;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef long double ld;
#define prq priority_queue<ll>;
 
/////------------------------CONSTANTS--------------------------/////
ll MOD=1000000007;
#define PI 3.1415926535897932384626433832795
 
/////------------------------GENERAL--------------------------/////
#define forx(i,j,n) for(int i=j;i<n;i++)
#define fory(i,j,n) for(int i=j;i>=n;i--)
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define fastio ios_base::sync_with_stdio(false)
#define testcase int t; cin>>t
#define MEM(xx,yy) memset(xx,yy,sizeof(xx))
#define vbs(xx,x) binary_search(all(xx),x)
#define vlb(xx,x) lower_bound(all(xx),x)
#define vub(xx,x) upper_bound(all(xx),x)
 
/////------------------------IO--------------------------/////
#define inpi(xx) scanf("%d",&xx)
#define inpl(xx) scanf("%lld",&xx)
#define inpc(xx) scanf("%c",&xx)
#define inps(xx) scanf("%s",&xx)
#define pri(xx) printf("%d",xx)
#define prl(xx) printf("%lld",xx)
#define prls(xx) printf("%lld ",xx)
#define prle(xx) printf("%lld\n",xx)
#define prc(xx) printf("%c",xx)
#define prs printf(" ");
#define pre printf("\n")
long int idx[100001];
long long int power(long long int x,long long int y,long long int z)
{
    long long int res=1;
    x%=z;
    while(y>0)
    {
        if(y&1)
        res=(res*x)%z;
        x=(x*x)%z;
        y/=2;
    }
    return res;
}

long long int power1(long long int x,long long int y)
{
    long long int res=1;
    while(y>0)
    {
        if(y&1)
        res=(res*x);
        x=(x*x);
        y/=2;
    }
    return res;
}

long int root(long int x)
{
    while(idx[x]!=x)
    x=idx[x];
    return x;
}

void union1(long int x,long int y)
{
    idx[root(x)]=root(y);
}
int n;
long long int a[5000];
long long int dp[3001][3001][2];
long long int fun(int i,int l,int r)
{
    if(l>r)
    return 0;
    if(dp[l][r][i]!=pow(10,15))
    return dp[l][r][i];
    if(i==0)
    dp[l][r][i]=max(fun(1-i,l+1,r)+a[l],fun(1-i,l,r-1)+a[r]);
    else
    dp[l][r][i]=min(fun(1-i,l+1,r)-a[l],fun(1-i,l,r-1)-a[r]);
    return dp[l][r][i];
}
int main() {
       cin>>n;
           for(long int i=0;i<n;i++)
           cin>>a[i];
           for(long int i=0;i<n;i++)
           {
               for(long int j=0;j<n;j++)
               {
                   for(int s=0;s<2;s++)
                   dp[i][j][s]=pow(10,15);
               }
           }
          long long int ans= fun(0,0,n-1);
          cout<<ans;
	return 0;
}

Measured memory_bytes: 141696
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define show(x) {for(auto i: x){cout << i << " ";} cout<<endl;}
#define showm(m) {for(auto i: m){cout << m.x << " ";} cout<<endl;}
typedef long long ll;
typedef pair<int, int> P;
ll gcd(int x, int y){ return y?gcd(y, x%y):x;}
ll lcm(ll x, ll y){ return (x*y)/gcd(x,y);}


int main()
{
    int n, x;
    cin >> n >> x;
    vector<int> a;
    a.push_back(x);
    rep(i, n){ int tmp; cin >> tmp; a.push_back(tmp);}

    sort(a.begin(), a.end());
    vector<int> da;
    rep1(i, n) {
        da.push_back(a[i] - a[i-1]);
    }


    int ans = da[0];
    for (int i = 1; i < da.size(); i++)
    {
        ans = gcd(ans, da[i]);        
    }
    
    cout << ans << endl;
}



Measured memory_bytes: 1400
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto ab = readln.split.to!(int[]);
    auto A = ab[0];
    auto B = ab[1];

    writeln(B % A == 0 ? A + B : B - A);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define fi first
#define se second

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<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i];if(i<len-1) s<<" ";
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i]<<endl;
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){
	s<<"{ ";
	for(auto itr=v.begin();itr!=v.end();++itr) {
		if (itr!=v.begin()) {s<< ", ";}
		s<<(*itr);
	}
	s<<" }";
	return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){
	s<<"{"<<endl;
	for(auto itr=m.begin();itr!=m.end();++itr){
		s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;
	}
	s<<"}"<<endl;
	return s;
}

const ll mod=1e9+7;
const ll inf=1e15;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	vector<int> a(4);
	rep(i,4){
		cin>>a[i];
	}
	sort(begin(a),end(a));
	if(a[0]==1 && a[1]==4 && a[2]==7 && a[3]==9){
		cout<<"YES"<<endl;
	}else{
		cout<<"NO"<<endl;
	}
}

Measured memory_bytes: 256
### constant

INF = 1 << 30

### main

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

bs = gets.split.map(&:to_i)
st = bs.join.to_i(2)
#puts st

rls = gets.split.map(&:to_i)

b = 0
bits = 0
k = n - 1
for i in (0...m)
  for j in (0...rls[i])
    bits |= 1 << k if b == 1
    k -= 1
  end
  b ^= 1
end

gl0 = bits
gl1 = ((1 << n) - 1) ^ bits
#p [gl0, gl1]

swaps = []
mask = 3
for i in (1...n)
  swaps << mask
  mask <<= 1
end
#p swaps.map{|b| b.to_s(2)}

dists = Array.new(1 << n){INF}
dists[st] = 0

q = [st]

while ! q.empty?
  u = q.shift
  break if u == gl0 || u == gl1

  for mask in swaps
    um = u & mask
    next if um == 0 || um == mask
    v = u ^ mask
    if dists[v] >= INF
      dists[v] = dists[u] + 1
      q << v
    end
  end
end

puts [dists[gl0], dists[gl1]].min

Measured memory_bytes: 6396
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef std::vector<ll> lls;
constexpr ll INF = 1LL << 60;
constexpr ll MOD = 998244353L;
template<class T> inline void chmin(T& a, T b) { if (a > b) a = b; }
template<class T> inline void chmax(T& a, T b) { if (a < b) a = b; }
template<class T> inline T MaxE(vector<T>& v,ll S,ll E){T m=v[S];for(ll i=S;i<=E;i++)chmax(m,v[i]);return m;}//v[S]～v[E]の最大値
template<class T> inline T MinE(vector<T>& v,ll S,ll E){T m=v[S];for(ll i=S;i<=E;i++)chmin(m,v[i]);return m;}
template<class T> inline T MaxE(vector<T>& v, ll N) { return MaxE(v, 0, N-1); } //先頭N個中の最大値
template<class T> inline T MinE(vector<T>& v, ll N) { return MinE(v, 0, N-1); } //先頭N個中の最小値
template<class T> inline T MaxE(vector<T>& v) { T m = v[0]; for (T e : v)chmax(m, e); return m; }
template<class T> inline T MinE(vector<T>& v) { T m = v[0]; for (T e : v)chmin(m, e); return m; }


void cinv(lls& llVec, ll n, bool to_0_origin = false) {
	ll val;
	llVec.reserve((size_t)(n));
	for (ll i = 0; i < n; i++) {
		cin >> val;
		if (to_0_origin) val--;
		llVec.push_back(val);
	}
}

int main()
{
	ll N, W;
	cin >> N >> W;
	lls w(N), v(N);
	for (ll i = 0; i < N; i++) {
		ll ww, vv;
		cin >> ww >> vv;
		w[i] = ww;
		v[i] = vv;
	}

	//テーブル初期化
	std::vector<lls> tblAll(N, lls(W+1 +W+10, -INF));
	tblAll[0][0] = 0;
	tblAll[0][w[0]] = v[0];

	//配るDPで計算
	for (ll i = 0; i < N - 1; i++) {
		for (ll ww = 0; ww <= W; ww++) {
			chmax(tblAll[i + 1][ww           ], tblAll[i][ww]);  //追加しない
			chmax(tblAll[i + 1][ww + w[i + 1]], tblAll[i][ww] + v[i + 1]); //追加する
		}
	}

	cout << MaxE(tblAll[N - 1], 0, W) << '\n';

	return 0;
}


Measured memory_bytes: 158208
#include<iostream>
#include<queue>
#include<bitset>
#include<algorithm>
#include<climits>
#include<vector>
#include<deque>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define fill(x,y) memset(x,y,sizeof(x))
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define dump(a) rep(i,a.size()){ cout<<a[i]<<" "; } cout<<endl;
#define arraydump(a,n) rep(i,n){ cout<<a[i]<<" "; } cout<<endl;
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define INF INT_MAX/3
#define EPS 1e-7

/*
 * i=0,1のS,Wが決まれば、全体が決まる
 * 4通りについて、それぞれO(N)で検証できるから、O(4N)
 */

bool check(int s, int x, int xp, int xn) {
  if((s=='o'&&x==1) || (s=='x'&&x==0)){
    return xp == xn;
  } else {
    return xp != xn;
  }
}

int main(){
  ll n;
  cin>>n;
  string s;
  cin>>s;
  int t[100001]; // t[i] i番目が正直者なら1、嘘つきなら0
  bool ok;

  rep(x,4) {
    // i0=0, i1=0を仮定する
    // t[0-n-1]は確定する
    t[0]=!(x&1); t[1]=!(x&2);
    /* cout<<t[0]<<t[1]<<endl; */
    repl(i,1,n-1){
      // t[i-1] t[i] t[i+1]
      if((s[i]=='o' && t[i]==1) || (s[i]=='x' && t[i]==0)) // 左右は同じだよ
        t[i+1] = t[i-1];
      else 
        t[i+1] = !t[i-1];
    }

    // s[0],s[n-1]と矛盾しないか確認
    ok = false;
    if(check(s[n-1], t[n-1], t[n-2], t[0]) && check(s[0], t[0], t[n-1], t[1])) ok = true;
    /* arraydump(t,n); dbg(ok); */
    if(ok) break;
  }

  if(ok){
    rep(i,n){
      if(t[i]) cout<<'S';
      else cout<<'W';
    }
    cout<<endl;
  }else{
    cout<<"-1"<<endl;
  }
  return 0;
}


Measured memory_bytes: 1024
import sys


# N, M = map(int, input().split())
# nums = list(map(int, input().split()))
# nums_2d = [list(map(int, input().split())) for _ in range(N)]


def main():
    N, M = map(int, input().split())
    if M >= N:
        ans = 'Yes'
    else:
        ans = 'No'

    print(ans)


if __name__ == '__main__':
    main()


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

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

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

//! 水を100k g入れられるか？
bool W[50];
//! 砂糖をk g入れられるか？
bool S[1005];

int main()
{
    ll A, B, C, D, E, F;
    cin >> A >> B >> C >> D >> E >> F;
    memset(W, 0, sizeof(W));
    W[0] = true;
    REP(i, 31)
    {
        if (i - A >= 0 && W[i - A])
            W[i] = true;
        if (i - B >= 0 && W[i - B])
            W[i] = true;
    }
    memset(S, 0, sizeof(S));
    S[0] = true;
    REP(i, 1001)
    {
        if (i - C >= 0 && S[i - C])
            S[i] = true;
        if (i - D >= 0 && S[i - D])
            S[i] = true;
    }

    pll m = pll(100 * A, 0LL);
    for (int i = 0; i * 100 <= F; ++i)
    {
        if (!W[i])
            continue;
        for (int j = 0; j <= E * i; ++j)
        {
            if (!S[j])
                continue;
            if (100 * i + j > F)
                break;
            if (m.first * j > (i * 100 + j) * m.second)
            {
                m = pll(i * 100 + j, j);
            }
        }
    }
    cout << m.first << " " << m.second << endl;
    return 0;
}

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

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y, p;
    cin >> x >> y;
    bool ver[x + 1][y + 1];
    bool hol[x + 1][y + 1];
    for (int i = 0; i <= x; i++) {
      for (int l = 0; l <= y; l++) {
        ver[i][l] = true;
        hol[i][l] = true;
        if (i == 0) {
          hol[i][l] = false;
        }
        if (l == 0) {
          ver[i][l] = false;
        }
      }
    }
    cin >> p;
    for (int i = 0; i < p && p; i++) {
      int x1, y1, x2, y2;
      cin >> x1 >> y1 >> x2 >> y2;
      if (x1 == x2) {
        ver[x1][max(y1, y2)] = false;
      }
      if (y1 == y2) {
        hol[max(x1, x2)][y1] = false;
      }
    }
    int T[x + 1][y + 1];
    T[0][0] = 1;
    for (int i = 0; i <= x; i++) {
      for (int l = 0; l <= y; l++) {
        if (l != 0 || i != 0) T[i][l] = 0;
        if (ver[i][l] == true)
        {
          T[i][l] += T[i][l - 1];
        }
        if (hol[i][l] == true) {
          T[i][l] += T[i - 1][l];
        }
      }
    }
    if (T[x][y] == 0) {
      cout << "Miserable Hokusai!" << endl;
    } else {
      cout << T[x][y] << endl;
    }
  }
}


Measured memory_bytes: 3100
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#define PI 3.141592653589793
#define MOD 1000000007

//qsort用、昇順
int compare_int(const void *a, const void *b)
{
	return *(int*)a-*(int*)b;
}
//qsort(data, 10, sizeof(int), compare_int)


int main(){
	double r;
	scanf("%lf", &r);
	
	printf("%lf\n", 2*r*3.1415);
	
	return 0;
}

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

int main(void){
 int x[5]={0},i;
  for(i=0;i<5;i++){
  	scanf("%d",&x[i]);
  }
  if(x[0]==0){
    printf("1");
  }else if(x[1]==0){
    printf("2");
  }else if(x[2]==0){
    printf("3");
  }else if(x[3]==0){
    printf("4");
  }else{
    printf("5");
  }
  
  return 0;
}

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

struct state
{
	long long int first;
	long long int second;
	long long int move;
};

int main(void)
{
	int n;
	cin >> n;

	int arr[n];

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

	vector<vector<struct state>> dp;

	for(int i = 0;i < n;i++)
	{
		vector<struct state> temp;
		for(int j = 0;j < n;j++)
		{
			struct state t;
			t.first = 0;
			t.second = 0;
			t.move = 0;
			temp.push_back(t);
		}
		dp.push_back(temp);
	}

	for(int i = 0;i < n;i++)
	{
		dp[i][i].first = arr[i];
		dp[i][i].second = 0;
		dp[i][i].move = i;
	}

	for(int l = 2;l <= n;l++)
	{
		for(int i = 0;i <= n-l;i++)
		{
			int j = i + l - 1;
			if(arr[i] + dp[i+1][j].second > arr[j] + dp[i][j-1].second)
			{
				dp[i][j].first = arr[i] + dp[i+1][j].second;
				dp[i][j].second = dp[i+1][j].first;
				dp[i][j].move = i;
			}
			else
			{
				dp[i][j].first = arr[j] + dp[i][j-1].second;
				dp[i][j].second = dp[i][j-1].first;
				dp[i][j].move = j;
			}
		}
	}

	cout << dp[0][n-1].first - dp[0][n-1].second;


	return 0;
}

Measured memory_bytes: 211584
// Author: HarshKumar

#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
const ll N = 1e6 + 6, M = 1e9 + 7;
int main()
{
    ios::sync_with_stdio(false), cin.tie(nullptr);
    ll x, y, a, b, c;
    cin >> x >> y >> a >> b >> c;
    vector<ll> p(a), q(b), r(c), f(3);
    vector<pair<ll, ll>> v;
    for (ll &e : p)
        cin >> e;
    for (ll &e : q)
        cin >> e;
    for (ll &e : r)
        cin >> e;
    sort(p.begin(), p.end(), greater<ll>());
    sort(q.begin(), q.end(), greater<ll>());
    for (ll i = 0; i < x; i++)
        v.push_back({p[i], 1});
    for (ll i = 0; i < y; i++)
        v.push_back({q[i], 2});
    for (ll e : r)
        v.push_back({e, 0});
    sort(v.begin(), v.end());
    ll s = 0, cc = 0;
    f[1] = x;
    f[2] = y;
    for (ll i = v.size() - 1; ~i; i--)
    {
        ll ss = v[i].second, ff = v[i].first;
        if (ss && f[ss])
            s += ff, f[ss]--, cc++;
        else if (!ss)
            s += ff, cc++;
        if (cc == x + y)
            return cout << s, 0;
    }
}

Measured memory_bytes: 12652
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        String t = sc.next();
        for (int i = 0; i < n; i++) {
            String v = s.substring(i);
            if (t.startsWith(v)) {
                System.out.println(2 * n - v.length());
                return;
            }
        }
        System.out.println(2 * n);
    }
}

Measured memory_bytes: 21972
#include <bits/stdc++.h>
using namespace std;
int main()
{
  	int n,k,x,y;
 	cin>>n>>k>>x>>y;
  	if(n < k)
    {
      cout<<n*x;
	  return 0;
    }
  	cout<<(k*x)+(n-k)*y;
	return 0;  	
  
}

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

int main() {
  long long n;
  cin >> n;
  vector<int> s(n+1);
  int a[n];
  rep(i,n){
      cin >> a[i];
      --a[i];
      s[a[i]]=i+1;
  }
  
  rep(i,n){
      cout << s[i] << endl;
  }


}



Measured memory_bytes: 1536
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <tuple>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <numeric>
#include <string.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long INFL = 1e18;
const int MOD = 1000000007;
const int MAX = 210000;
int n;

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

void solve() {
    int ans;
    cin >> n;
    ans = n;
    for (int i = 0; i <= n; ++i) {
        int t = i;          //0 -> n
        int cc = 0;         //剰余カウント
        while (t > 0) {
            cc += t % 6;
            t /= 6;
        }
        t = n - i;          //n -> 0
        while (t > 0) {
            cc += t % 9;
            t /= 9;
        }
        if (ans > cc) {
            ans = cc;
        }
    }
    cout << ans << endl;
    return;
}
//逆元を求める関数
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
      fac[i] = fac[i-1] * i % MOD;
      inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
      finv[i] = finv[i-1] * inv[i] % MOD;
    }
}
//組み合わせ
long long COM (int n, int k) {
    if(n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}
int main(int args, char* argv[]) {
    solve();
}



Measured memory_bytes: 256