akhauriyash/Code-Regression huggingface dataset:
#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>;

int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i, n) {
    cin >> v[i];
    --v[i];
  }

  vector<int> ce(100000, 0), co(100000, 0);
  rep(i, n) {
    if (i % 2 == 0) ++ce[v[i]];
    else ++co[v[i]];
  }
  int e1 = 0, e2 = 1;
  if (ce[e1] < ce[e2]) swap(e1, e2);
  for (int i = 2; i < 100000; ++i) {
    if (ce[i] > ce[e1]) {
      e2 = e1;
      e1 = i;
    } else if (ce[i] > ce[e2]) {
      e2 = i;
    }
  }
  int o1 = 0, o2 = 1;
  if (co[o1] < co[o2]) swap(o1, o2);
  for (int i = 2; i < 100000; ++i) {
    if (co[i] > co[o1]) {
      o2 = o1;
      o1 = i;
    } else if (co[i] > co[o2]) {
      o2 = i;
    }
  }
  int ans;
  if (e1 != o1) ans = n - ce[e1] - co[o1];
  else ans = min(n - ce[e2] - co[o1], n - ce[e1] - co[o2]);
  cout << ans << endl; 
  return 0;
}

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

#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back

typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<int, ll> i_ll;
typedef pair<ll, int> ll_i;
typedef pair<ll, ll> ll_ll;
typedef pair<ll_i, int> P;
const int INF = INT_MAX / 2;
const int MOD = 1e9 + 7;
struct edge { int v, a, b; };

int main() {
	int N; cin >> N;
	vector<int> a(N);
	rep(i, N) cin >> a[i];
	int i0 = 0;
	rep(i, N) if (abs(a[i]) > abs(a[i0])) i0 = i;
	if (a[i0] >= 0) {
		cout << N * 2 << endl;
		cout << i0 + 1 << ' ' << 1 << endl;
		cout << i0 + 1 << ' ' << 1 << endl;
		rep(i, N - 1) {
			cout << i + 1 << ' ' << i + 2 << endl;
			cout << i + 1 << ' ' << i + 2 << endl;
		}
	}
	else {
		cout << N * 2 << endl;
		cout << i0 + 1 << ' ' << N << endl;
		cout << i0 + 1 << ' ' << N << endl;
		rep(i, N - 1) {
			cout << N - i << ' ' << N - i - 1 << endl;
			cout << N - i << ' ' << N - i - 1 << endl;
		}
	}
}


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)
#define ALL(a)  (a).begin(),(a).end()
#define LL long long

int n;
vector<int> b,a;

int main(){
  cin>>n;
  int b_in;
  REP(i,n){
    cin>>b_in;
    b.push_back(b_in);
  }

  bool bl;
  while(b.size()>0){
    bl=false;
    REP(j,b.size()){
      if(b[b.size()-1-j]==b.size()-j){
	a.push_back(b.size()-j);
	b.erase(b.begin()+b.size()-1-j);
	bl=true;
	break;
      }
    }
    if(bl)continue;
    cout<<-1<<endl;
    return 0;
  }
  
  REP(i,a.size()){
    cout<<a[a.size()-1-i]<<endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N = 2e5 + 5;

int n;
int a[N];

int32_t main()
{
	IOS;
	int n,k;
	cin>>n>>k;
	int ans = 0;
	vector <int> arr(n);
	for(int i = 0;i<n;i++)
	cin>>arr[i];
	sort(arr.begin(),arr.end());
	for(int i=0;i<k;i++)
	{
	    ans = ans + arr[i];
	}
	cout<<ans;
	
	return 0;
}

Measured memory_bytes: 3664
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int n;
  cin>>n;
  int d[n];
  for(int i=0;i<n;i++) cin>>d[i];
  map<int,int> m;
  int s=0,ans=0;
  for(int i=0;i<n;i++){
    s+=d[i];
    if(m.count(s)) ans=max(ans,i-m[s]);
    else m[s]=i;
    if(!s) ans=max(ans,i+1);
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 16996
#include<stdio.h>
#include<algorithm>
#include<cmath>
using namespace std;

const int maxn=105;
int a[maxn];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	sort(a,a+n);
	int sum=0;
	for(int i=0;i<n-1;i++){
		int x=a[i];
		int y=a[i+1];
		sum=sum+abs(x-y);
	}
	printf("%d\n",sum);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
 
using namespace std;
 
const long long MOD=1e9+7;
const double PI=3.14159265359;
 
 
 

int main() {
    
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n,h,w;
    cin>>h>>w>>n;
    vector<int> vi(n);
    for(int &i: vi){
        cin>>i;
    }
    vector<int> vi2;
    for(int i=1; i<=n; i++){
        for(int j=0; j<vi[i-1]; j++){
            vi2.push_back(i);
        }
    }/*
    for(int i:vi2){
        cout<<i<<" ";
    }
    cout<<endl;
    */
    vector<vector<int>> grid(h,vector<int>(w,0));
    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            grid[i][j]=vi2[j+w*i];
        }
    }
    for(int i=0; i<h; i++){
        if(i%2){
            reverse(grid[i].begin(),grid[i].end());
        }
    }
    
    for(auto v: grid){
        for(int i:v){
            cout<<i<<" ";
        }
        cout<<endl;
    }
    
   
    
    return 0;
    
}

Measured memory_bytes: 512
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

typedef long long ll;

const int N = 2005;

int n, a[N], x, a2[N];

int main(){
	scanf("%d%d", &n, &x);
	for(int i = 0;i < n;i++)
		scanf("%d", a + i);
	ll sol = (ll)1e18;
	for(int k = 0;k <= n;k++){
		ll cur = (ll)x * k;
		for(int i = 0;i < n;i++)
			cur += a[i];
		sol = min(sol, cur);
		for(int i = 0;i < n;i++)
			a2[i] = min(a[i], a[(i + 1) % n]);
		for(int i = 0;i < n;i++)
			a[i] = a2[i];
	}
	printf("%lld\n", sol);
}

Measured memory_bytes: 128
/*g++ main.cpp -o main.out*/
/*./main.out*/

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

#define LL long long
#define LD long double
#define Mod 1000000007
#define L_Mod 17100000013

const double eps = 1e-9;
const int INF = 0x3f3f3f3f;
const double PI = 3.1415926535;

#define NO_TLE std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define ree(a,n) memset(a,n,sizeof(a));

#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define red(i,l,u) for(int (i)=(int)(l);(i)>=(int)(u);--(i))

int main()
{
    NO_TLE
    int a;
    string s;
    cin>>a;
    cin>>s;
    if(a>=3200)
        cout<<s<<endl;
    else 
        cout<<"red"<<endl;
    return 0;
}







































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

#define ll long long
#define MOD 1000000007
#define LLMN LONG_LONG_MIN
#define LLMX LONG_LONG_MAX
#define MAX 1000000

vector<bool>prime(MAX, true);
vector<ll>fact(MAX);
vector<ll>factinv(MAX);

ll  fastpower(ll a, ll n)
{
	ll res = 1;
	while(n > 0)
	{
		if(n % 2 != 0)
		{
			res = (res * a) % MOD;
		}
		n /= 2;
		a=(a * a) % MOD;
	}
	return res;
}

void getprime()
{
	for(ll i = 2;i < MAX; i++)
	{
		if(prime[i-1])
		{
			for(ll j = i*i; j < MAX; j += i)
				prime[j-1] = false;
		}
	}
}

void getfact()
{
	fact[0] = 1;
	factinv[0] = 1;
	
	for(ll i = 1; i < MAX; i++)
		fact[i] = (fact[i-1] * i)%MOD;
	
	for(ll i = 1; i < MAX; i++)
		factinv[i] = (factinv[i-1] * fastpower(i, MOD -2) )%MOD;

}
/*
char find(char x, vector<char>&par)
{
	if(par[x]=='$')
		return x;
	else
		return find(par[x], par);
}
void unionn(char x, char y, vector<char>par)
{
	char a=find(x,par);
	char b=find(y,pR);
	if(a!=b)
	{
		par[a]=b;
	}
}
*/
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	ll t,n,q;
	cin>>t;
	long double c;
	c=2*t*M_PI;
	cout<<setprecision(12)<<c;
	return 0;
}

Measured memory_bytes: 18840
#![allow(non_snake_case,unused_imports,dead_code)]
use std::str::FromStr;
use std::collections::{HashMap,HashSet,VecDeque,BinaryHeap};
use std::cmp::{max,min,Reverse,Ordering};

use proconio::input;
use proconio::marker::{Chars,Usize1,Isize1};

fn comp_f64(a: &f64, b: &f64) -> Ordering {
    if a < b {
        return Ordering::Less;
    } else if a > b {
        return Ordering::Greater;
    }
    Ordering::Equal
}

fn main() {
    input!{
        D:usize,
        C:[isize;26],
        S:[[isize;26];D],
        mut T:[Usize1;D],
        M:usize,
        DQ:[(Usize1,Usize1);M],
    }
    
    let mut Last = vec![vec![0;26];D+10];

    let mut ans = 0;
    for (d,&t) in T.iter().enumerate(){
        ans += S[d][t];
        let d = d+1;
        Last[d][t] = d as isize;
        for i in 0..26{
            Last[d][i] = max(Last[d-1][i],Last[d][i]);
            ans -= C[i]*(d as isize -Last[d][i]);
        }
    }

    for &(d,q) in &DQ{
        let p = T[d];
        ans += S[d][q] - S[d][p];
        let d = d+1;
        let lip = Last[d-1][p];
        for i in d..D+1{
            if Last[i][p] == d as isize{
                ans -= C[p]*(d as isize - lip);
                Last[i][p] = lip;
            } else { break;}
        }
        for i in d..D+1{
            if Last[i][q]<d as isize{
                ans -= C[q]*(Last[i][q]-(d as isize));
                Last[i][q] = d as isize;
            } else { break;}
        }
        T[d-1] = q;
        println!("{}",ans);
    }

}


Measured memory_bytes: 4316
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // input
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        sc.nextLine();
        int[] h = new int[n];
        h = Arrays.stream(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();

        HashMap<Integer, Integer> ngList = new HashMap<>();
        for (int i = 0; i < m; i++) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            if (h[a - 1] > h[b - 1]) ngList.put(b, 0);
            else if (h[a - 1] < h[b - 1]) ngList.put(a, 0);
            else {
                ngList.put(a, 0);
                ngList.put(b, 0);
            }
        }

        int ans = n - ngList.size();
        System.out.println(ans);
    }
}

Measured memory_bytes: 70796
import std.stdio;
import std.string;
import std.array;
import std.algorithm;
import std.conv;
import std.range;
import std.functional;
import std.bigint;
import std.typecons;


void main(string[] args) {
    readln;
    string s = readln.chomp;

    enum Transit {
        StoS,
        StoW,
        WtoS,
        WtoW,
    }

    alias Reasoner = Tuple!(Transit, "assumption", Transit, "temp");
    Reasoner[4] reasoner;
    string[4] ans_candidate;
    if (s[0] == 'o') {
        reasoner[0].assumption = Transit.StoS;
        ans_candidate[0] = "S";
        reasoner[0].temp = Transit.StoS;
        
        reasoner[1].assumption = Transit.StoW;
        ans_candidate[1] = "W";
        reasoner[1].temp = Transit.WtoW;

        reasoner[2].assumption = Transit.WtoS;
        ans_candidate[2] = "S";
        reasoner[2].temp = Transit.StoW;

        reasoner[3].assumption = Transit.WtoW;
        ans_candidate[3] = "W";
        reasoner[3].temp = Transit.WtoS;
    } else if (s[0] == 'x') {
        reasoner[0].assumption = Transit.StoS;
        ans_candidate[0] = "S";
        reasoner[0].temp = Transit.StoW;

        reasoner[1].assumption = Transit.StoW;
        ans_candidate[1] = "W";
        reasoner[1].temp = Transit.WtoS;

        reasoner[2].assumption = Transit.WtoS;
        ans_candidate[2] = "S";
        reasoner[2].temp = Transit.StoS;

        reasoner[3].assumption = Transit.WtoW;
        ans_candidate[3] = "W";
        reasoner[3].temp = Transit.WtoW;
    } else {
        throw new Exception("input error");
    }

    auto o_table = [
        Transit.StoS : Transit.StoS,
        Transit.StoW : Transit.WtoW,
        Transit.WtoS : Transit.StoW,
        Transit.WtoW : Transit.WtoS,
    ];
    auto x_table = [
        Transit.StoS : Transit.StoW,
        Transit.StoW : Transit.WtoS,
        Transit.WtoS : Transit.StoS,
        Transit.WtoW : Transit.WtoW,
    ];

    foreach (c; s[1..$])
    {
        if (c == 'o') {
            foreach(i; 0..4) 
            {
                if (reasoner[i].temp.among(Transit.StoS, Transit.WtoS)) ans_candidate[i] ~= "S";
                else ans_candidate[i] ~= "W";
                reasoner[i].temp = o_table[reasoner[i].temp];
            }
        } else if (c == 'x') {
            foreach(i; 0..4) 
            {
                if (reasoner[i].temp.among(Transit.StoS, Transit.WtoS)) ans_candidate[i] ~= "S";
                else ans_candidate[i] ~= "W";
                reasoner[i].temp = x_table[reasoner[i].temp];
            }
        } else {
            throw new Exception("input error");
        }
    }

    foreach (i; 0..5) {
        if (i == 4){
            (-1).writeln;
            break;
        }
        if (reasoner[i].temp == reasoner[i].assumption) {
            ans_candidate[i].writeln;
            break;
        }
    }

}


Measured memory_bytes: 3708
#include <iostream>
#include <algorithm>
#include <functional>

int N;
int L[210];

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

    N *= 2;

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

    std::sort(L, L + N, std::greater<int>());

    int ans = 0;
    for(int i = 0; i < N; i += 2) {
        ans += L[i + 1];
    }

    std::cout << ans << std::endl;
}

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

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

    int ai, aj;
    vector<int> a(n);
    for(int i=0; i<n; i++){
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    ai = a[n-1];

    vector<pair<double, int>> a_abs(n);
    for(int i=0; i<n; i++){
        a_abs[i] = make_pair(abs(a[i] - ai / 2.0), a[i]);
    }
    sort(a_abs.begin(), a_abs.end());
    aj = a_abs[0].second;

    cout << ai << " " << aj << endl;
    return 0;
}

Measured memory_bytes: 2176
#include <stdio.h>
int main(){
  int fuyu,a,b,amax,bmax;
  int aday,bday,day;
  scanf("%d",&fuyu);
  scanf("%d",&a);
  scanf("%d",&b);
  scanf("%d",&amax);
  scanf("%d",&bmax);
  aday=a/amax;
  if(a%amax!=0){
    aday+=1;
  }
  bday=b/bmax;
  if(b%bmax!=0){
    bday+=1;
  }
  day=aday;
  if(bday>day){
    day=bday;
  }
  
  printf("%d\n",fuyu-day);
  return 0;
}

Measured memory_bytes: 1780
#include <stdio.h>
#include <stdlib.h>
struct node{
  struct node *left;
  struct node *right;
  struct node *parent;
  int key;
};

typedef struct node *Node;
void insert(int);
void inorder(Node);
void preorder(Node);

Node root;
int main(){
  int n,i,x;
  char c[20];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",c);
    if(c[0]=='i'){
      scanf("%d",&x);
      insert(x);
    }
    else if(c[0]=='p'){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }
  return 0;
}
void insert(int k){
  Node y=NULL;
  Node x=root;
  Node z;
  z=malloc(sizeof(struct node));
  z->key=k;
  z->left=NULL;
  z->right=NULL;
  while(x!=NULL){
    y=x;
    if(z->key<x->key) x=x->left;
    else x=x->right;
  }
  z->parent=y;
  if(y==NULL) root=z;
  else if(z->key<y->key) y->left=z;
  else y->right=z;
}
void inorder(Node x){
  if(x!=NULL){
    inorder(x->left);
    printf(" %d",x->key);
    inorder(x->right);
  }
}
void preorder(Node x){
  if(x!=NULL){
    printf(" %d",x->key);
    preorder(x->left);
    preorder(x->right);
  }
}


Measured memory_bytes: 25168
/**
 *    author:  otera    
**/
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
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; }

void solve() {
	int n; cin >> n;
    map<string, int> mp;
    int mx = 0;
    rep(i, n) {
        string s; cin >> s;
        mp[s] ++;
        chmax(mx, mp[s]);
    }
    for(auto p: mp) {
        if(p.sc == mx) {
            cout << p.fr << endl;
        }
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

Measured memory_bytes: 23808
//by yjz
#include<bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define PB push_back
#define MP make_pair
#ifndef LOCAL
#define cerr if(0)cout
#endif
typedef long long ll;
const int mod = 998244353;
//My i/o stream
struct fastio
{
	char s[100000];
	int it, len;
	fastio() {it=len=0;}
	inline char get()
	{
		if (it<len) return s[it++]; it=0;
		len=fread(s, 1, 100000, stdin);
		if (len==0) return EOF; else return s[it++];
	}
	bool notend()
	{
		char c=get();
		while (c==' '||c=='\n') c=get();
		if (it>0) it--;
		return c!=EOF;
	}
}_buff;
#define geti(x) x=getnum()
#define getii(x,y) geti(x),geti(y)
#define getiii(x,y,z) getii(x,y),geti(z)
#define puti(x) putnum(x),putchar(' ')
#define putii(x,y) puti(x),puti(y)
#define putiii(x,y,z) putii(x,y),puti(z)
#define putsi(x) putnum(x),putchar('\n')
#define putsii(x,y) puti(x),putsi(y)
#define putsiii(x,y,z) putii(x,y),putsi(z)
inline ll getnum()
{
	ll r=0; bool ng=0; char c; c=_buff.get();
	while (c!='-'&&(c<'0'||c>'9')) c=_buff.get();
	if (c=='-') ng=1, c=_buff.get();
	while (c>='0'&&c<='9') r=r*10+c-'0', c=_buff.get();
	return ng?-r:r;
}
template <class T> inline void putnum(T x)
{
	if (x<0) putchar('-'), x=-x;
	register short a[20]={}, sz=0;
	while (x) a[sz++]=x%10, x/=10;
	if(sz==0) putchar('0');
	for (int i=sz-1; i>=0; i--) putchar('0'+a[i]);
}
inline char getreal() {char c=_buff.get(); while (c<=32) c=_buff.get(); return c;}
ll qpow(ll x, ll k) {return k==0? 1: 1ll*qpow(1ll*x*x%mod,k>>1)*(k&1?x:1)%mod;}
int n;
int a[100111];
ll b[233][233];
int main()
{
	geti(n);
	for (int i=1; i<=n; i++) geti(a[i]);
	sort(a+1, a+n+1);
	ll ans = 1;
	for (int i=1; i<=n; i++)
	{
		ll t = __gcd(i-1, a[i]);
		ans = 1ll*ans*t%mod;
	}
	cout<<ans<<endl;
	/*
	b[0][0] = 1;
	for (int i=1; i<=n; i++)
	{
		for (int j=1; j<=i; j++)
		{
			b[i][j] = a[i]*b[i-1][j-1]+b[i-1][j]*(i-1);
		}
	}
	for (int i=1; i<=n; i++) cerr<<b[n][i]<<" "; cerr<<endl;
	ll g = 0;
	for (int i=1; i<=n; i++) g = __gcd(g, b[n][i]);
	cerr<<"gcd="<<g<<endl;
	*/
	return 0;
}


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

constexpr int kMod = 1000000007;
constexpr int kMax = 1000000;
long long fac[kMax], finv[kMax], inv[kMax];                                                            


void InitCom() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < kMax; i++){
        fac[i] = fac[i - 1] * i % kMod;
        inv[i] = kMod - inv[kMod%i] * (kMod / i) % kMod;
        finv[i] = finv[i - 1] * inv[i] % kMod;
    }
}

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] % kMod) % kMod;
}


// Input: destination coordinate (X, Y)
int main () {
  //int X, Y;
  int X = 0;
  int Y = 0;

  cin >> X;
  cin >> Y;

  if ((X + Y) % 3 != 0) {
    cout << 0 << endl;
    return 0;
  }

  int k1 = (2*Y - X)/3;
  int k2 = (2*X - Y)/3;
  if (k1 < 0 || k2 < 0) {
    cout << 0 << endl;
    return 0;
  } else {
  // Now we
    InitCom();
    cout << Com(k1 + k2, k1) << endl;
  }
  return 0;
}

Measured memory_bytes: 23808
import java.util.*;

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		int h = sc.nextInt();
		int w = sc.nextInt();
		int n = sc.nextInt();

		int large = h> w ? h :w;

		System.out.println((n-1)/large + 1);
	}

}

Measured memory_bytes: 21844
#include<iostream>
#include<vector>
using namespace std;
struct PARK{
  int up_t,up_n;
  bool up_f;
  int down_t,down_n;
  bool down_f;
  PARK(){
    up_t = up_n = down_t = down_t = 0;
    up_f = down_f = false;
  }
};
int main(){
  int n,m;
  while(cin >>m>>n,m||n){
    int lot[100] = {0};
    PARK p[20];
    vector<int> ans;
    for(int i=0; i<n; i++){cin >>lot[i];}
    for(int t=0,c=0;c<n;t++){
      for(int i=0; i<m; i++){
	if(p[i].down_f && p[i].down_t<=t){
	  ans.push_back(p[i].down_n);
	  p[i].down_n = 0;
	  p[i].down_t = 0;
	  p[i].down_f = false;
	  c++;
	}
	if(!p[i].down_f && p[i].up_f && p[i].up_t<=t){
	  ans.push_back(p[i].up_n);
	  p[i].up_n = 0;
	  p[i].up_t = 0;
	  p[i].up_f = false;
	  c++;
	}
      }
      for(int i=0; i<=t/10&&i<n; i++){
	if(lot[i] != 0){
	  for(int j=0; j<m; j++){
	    if(!p[j].up_f){
	      p[j].up_f = true;
	      p[j].up_t = lot[i]+t;
	      p[j].up_n = i+1;
	      lot[i] = 0;
	      break;
	    }
	  }
	  if(lot[i] != 0){
	    int dis = 0,x = -1;
	    for(int j=0; j<m; j++){
	      if(!p[j].down_f){
		if(p[j].up_t >= lot[i]+t){
		  if(p[j].up_t < dis || x == -1){dis = p[j].up_t;x = j;}
		}
	      }
	    }
	    if(x != -1){
	      p[x].down_f = true;
	      p[x].down_t = lot[i]+t;
	      p[x].down_n = i+1;
	      lot[i] = 0;
	    }
	    else{
	      for(int j=0; j<m; j++){
		if(!p[j].down_f){
		  if(p[j].up_t>dis){dis = p[j].up_t;x = j;}
		}
	      }
	      if(x != -1){
		p[x].down_f = true;
		p[x].down_t = lot[i]+t;
		p[x].down_n = i+1;
		lot[i] = 0;
	      }
	    }
	  }
	}
      }
    }
    for(int i=0; i<ans.size(); i++){
      if(i != 0){cout <<" ";}
      cout <<ans[i];
    }
    cout <<endl;
  }
  return 0;
}

Measured memory_bytes: 1216
#include <bits/stdc++.h>
using namespace std;
int main(){
 int A ,B;
  cin >> A >> B ;
  if(A == 1&&B == 1)cout << "Draw" << endl;
  else if(A == 1) cout << "Alice" << endl;
  else if(B==1) cout << "Bob" << endl;
  else if(A == B)cout << "Draw" << endl;
  else if(A>B)cout << "Alice" << endl;
  else if(B>A)cout << "Bob" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<vector>
#include<string>
using namespace std;
#define l long long
#define pb push_back
#define mem(a,n) memset(a,n,sizeof(a))
#define find(v,n) find(v.begin(),v.end(),n)
#define sort1(v) sort(v.begin(),v.end())
#define lb(v,n) lower_bound(v.begin(),v.end(),n)
#define ub(v,n) upper_bound(v.begin(),v.end(),n)
#define mod 998244353
#define reverse(s) reverse(s.begin(),s.end())
//#define pi pair<l,l> 
const double pi=3.141592653589793;
bool isprime(l n)
{
	for(l i=2;i<=n;i++)
	{
		if(n%i==0)
			return false;
	}
	return true;
}
/*bool fact(l n)
{
	vector<l> v;
	for(l i=2;i*i<=n;i++)
	{
		if(n%i==0)
		{
			if(i%2==1||(n/i)%2==1)
			{
				return true;
			}
		}
	}
	return false;
}*/
l power(l a,l b)
{
	l ans=1;
	while(b>0)
	{
		if(b&1)
		{
			ans=(ans*a)%mod;
		}
		b>>=1;
		a=(a%mod*a%mod)%mod;
	}
	return ans;
}//prefixsums
void frooty()
{
	l n;
	cin>>n;
	string s;
	while(n>0)
	{
		n-=1;
		l d=n%26;
		s+='a'+d;
		n/=26;
	}
	reverse(s);
	cout<<s<<"\n";
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int q=1;
//	cin>>q;
	while(q--)
	{
		frooty();
	}
}

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

using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 9223372036854775807
#define all(x) (x).begin(), (x).end()

ll ts = 1000000007;

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

  ll x, t;
  cin >> x >> t;

  cout << (x > t ? x - t : 0) << "\n";
}

Measured memory_bytes: 256
a, b = map(int, input().split())
if a == 1:
    if b == 1:
        print('Draw')
    else:
        print('Alice')
elif b == 1:
    if a == 1:
        print('Draw')
    else:
        print('Bob')
else:
    if a > b:
        print('Alice')
    elif a < b:
        print('Bob')
    else:
        print('Draw')

Measured memory_bytes: 3064
#include<deque>
#include<iostream>
using namespace std;
int main(){
    deque<int>A;
    int q;
    cin>>q;
    while(q--){
        int que;
        cin>>que;
        if(que==0){
            int d,x;
            cin>>d>>x;
            if(d==0)    A.push_front(x);
            else    A.push_back(x);
        }
        else if(que==1){
            int p;
            cin>>p;
            cout<<A[p]<<endl;
        }
        else{
            int d;
            cin>>d;
            if(d==0)    A.pop_front();
            else    A.pop_back();
        }
    }
    return 0;
}


Measured memory_bytes: 4568
'use strict'

function Main(input) {
  const inputList = input.split(' ');
  const n = Number(inputList[0])
  const a = Number(inputList[1])
  const b = Number(inputList[2])
  let sum = 0

  for (let i=1; i<=n; i++) {
    let digitTotal = 0
    let tmpN = i
    while (tmpN>0) {
      digitTotal = digitTotal + (tmpN % 10)
      tmpN = Math.floor(tmpN/10)
    }

    if (digitTotal >= a && digitTotal <= b) {
      sum += i
    }
  }

  console.log(sum)
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7500
# coding: utf-8
# Your code here!
def gcd(a, b) :
    while True :
        if a < b :
            a, b = b, a
        amari = a % b
        if amari == 0 :
            break
        else :
            a, b = b, amari
    return(b)

n = int(input())
c = list(map(int, input().split()))
for i in range(n-1, 0, -1) :
    c[i-1] = int(c[i] * c[i-1] / gcd(c[i], c[i-1]))
print(c[0])


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

int main() {
  int A,B,C,X;
  cin>>A>>B>>C>>X;
  int ans=0;
  for (int a=0; a<=A; a++) {
    for (int b=0; b<=B; b++) {
      for (int c=0; c<=C; c++) {
        if (500*a+100*b+50*c==X) {
          ans++;
        }
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;
typedef long long ll;

const int MAXN = 100010;

int n;
struct location {
  ll x, y;
  int pos;
};
struct edge {
  int from, to;
  ll cost;
};
location loc[MAXN];

bool xcompare(location a, location b) {
  return a.x < b.x;
}

bool ycompare(location a, location b) {
  return a.y < b.y;
}

bool edgecompare(edge a, edge b) {
  return a.cost < b.cost;
}

int par[MAXN];
int rank_[MAXN];
int size[MAXN];

void init() {
    for (int i=0;i<n;i++) {
      par[i] = i;
      rank_[i] = 0;
      size[i] = 1;
    }
}

int find(int x) {
  if (par[x] == x) {
    return x;
  } else {
    return par[x] = find(par[x]);
  }
}

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

void unite(int x, int y) {
  x = find(x);
  y = find(y);
  if (x == y) {
    return;
  }

  if (rank_[x] < rank_[y]) {
    par[x] = y;
    size[y] += size[x];
  } else {
    par[y] = x;
    if (rank_[x] == rank_[y]) {
      rank_[x]++;
    }
    size[x] += size[y];
  }
}


void solve() {
  vector<edge> edges;
  init();
  sort(loc, loc + n, xcompare);
  for (int i=0;i<n-1;i++) {
    edges.push_back((edge){loc[i].pos, loc[i+1].pos, min(abs(loc[i].x - loc[i+1].x), abs(loc[i].y - loc[i+1].y))});
  }
  sort(loc, loc + n, ycompare);
  for (int i=0;i<n-1;i++) {
    edges.push_back((edge){loc[i].pos, loc[i+1].pos, min(abs(loc[i].x - loc[i+1].x), abs(loc[i].y - loc[i+1].y))});
  }

  sort(edges.begin(), edges.end(), edgecompare);

  int remain = n;
  ll cost = 0;
  for (int i=0;i<edges.size();i++) {
    if (!same(edges[i].from, edges[i].to)) {
      cost += edges[i].cost;
      unite(edges[i].from, edges[i].to);
    }
  }
  cout << cost << endl;
}

int main() {
  cin >> n;
  ll x, y;
  for (int i=0;i<n;i++) {
    cin >> x >> y;
    loc[i].x = x;
    loc[i].y = y;
    loc[i].pos = i;
  }
  solve();
}


Measured memory_bytes: 9840
n = int(input())
x = list(map(int, input().split()))
sum= 1000000000000000
for p in range(1,101):

    tmp=0
    # print("p",p)
    for i in range(len(x)):
        tmp += (x[i] - p)**2
        # print("tmp",tmp)
    sum = min(sum,tmp)
    # print("su",sum)
print(sum)

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

using namespace std;

const int INF = 1e9 + 7;

//Union-Find木
#include <vector>

struct Union_Find {
  vector<int> par;
  vector<int> rank;

  //初期化
  void init(int n)
  {
    par.resize(n);
    rank.resize(n);
    for (int i = 0; i < n; ++i) {
      par[i] = i;
      rank[i] = 0;
    }
  }

  //木の根を探す
  int find(int s)
  {
    if (par[s] == s) {
      return s;
    }
    return par[s] = find(par[s]);
  }

  //結合
  void unite(int x, int y)
  {
    int a = find(x), b = find(y);
    if (a == b) {
      return;
    }
    if (rank[a] < rank[b]) {
      par[a] = b;
    }
    else {
      par[a] = b;
      if (rank[a] == rank[b]) {
        ++rank[b];
      }
    }
  }

  //二つの数の根が同じかどうか
  bool same(int x, int y)
  {
    return find(x) == find(y);
  }

  //サイズを返す
  unsigned int size()
  {
    return par.size();
  }
};

void solve()
{
  Union_Find uf;
  uf.init(13);
  uf.unite(1, 3);
  uf.unite(1, 5);
  uf.unite(1, 7);
  uf.unite(1, 8);
  uf.unite(1, 10);
  uf.unite(1, 12);

  uf.unite(4, 6);
  uf.unite(4, 9);
  uf.unite(4, 11);

  if(uf.same(0, 1) || uf.same(0, 2) || uf.same(0, 4)) {
    cout << "error\n";
  }
  else {
    int x, y;
    cin >> x >> y;
    if(uf.same(x, y) && x < y) {
      cout << "Yes\n";
    }
    else {
      cout << "No\n";
    }
  }
}

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for(int (i)=0 ;i <(n); ++(i))
#define REP(i,m,n) for(int (i) = (m); (i) <= (n); ++(i))
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)? "YES":"NO")
typedef long long ll;
using namespace std;

int main() {
  string s, t, r;
  cin >> s >> t >> r;
  char d =  -('a' - 'A');
  cout << (char)(s[0] + d) << (char)(t[0] + d) << (char)(r[0] + d) << endl; 
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define itn int
#define REP(i, n) for (int i = 0; i < (n); i++)
#define IREP(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, k, n) for (int i = (k); i < (n); i++)
#define REPEACH(itr, k) for (auto &&itr : k)
#define MOD 1000000007

using namespace std;
typedef long long ll;

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

int main()
{
    int n;
    cin >> n;
    string s1,s2;
    cin >> s1 >> s2;
    ll ans=1;
    vector<bool> s1_b(n,false);
    vector<bool> s2_b(n,false);
    REP(i,n){
        if(s1[i]==s2[i]){
            if(i==0){
                ans*=3;
            }
            else if(s1[i-1]==s2[i-1]){
                ans*=2;
            }
            else{
                ans*=1;
            }
            s1_b[i]=true;
            s2_b[i]=true;
        }
        else{
            if (i == 0)
            {
                ans *= 6;
            }
            else if (s1[i - 1] == s2[i - 1])
            {
                ans *= 2;
            }
            else
            {
                ans *= 3;
            }
            s1_b[i] = true;
            s2_b[i] = true;
            i++;
            s1_b[i]=true;
            s2_b[i]=true;
        }
        ans%=MOD;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include<cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<bitset>
#include<unordered_map>

using namespace std;

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define rep(i,j,n) for(ll (i)=(j);(i)<(n);(i)++)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define ll long long
#define ull unsigned long long
#define all(hoge) (hoge).begin(),(hoge).end()
typedef pair<ll, ll> P;
const long long INF = 1LL << 60;
const long long MOD = 1e9 + 7;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


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

//グラフ関連
struct Edge {//グラフ
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
		to = _to; cap = _cap; rev = _rev;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}


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

	ll n, W;
	cin >> n >> W;

	Array v(n, 0), w(n, 0);
	REP(i, n) cin >> v[i] >> w[i];

	Matrix dp(n + 1, Array(W + 1, 0));
	//dp[i+1][j]:i番目までの品物を重さjまで買ったときの最大値

	REP(i, n) {
		REP(j, W + 1) {
			if (j < w[i]) chmax(dp[i + 1][j],dp[i][j]);
			else {
				chmax(dp[i + 1][j], dp[i][j]);
				chmax(dp[i + 1][j], dp[i+1][j - w[i]] + v[i]);
			}
		}
	}

	/*
	REP(i, n + 1) {
		REP(j, W + 1) {
			cout << dp[i][j] << " ";
		}
		cout << endl;
	}
	*/

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

	return 0;
}



Measured memory_bytes: 10712
import numpy as np

def Squar(x,k):
    if k > 10**(int(Ten(a,1)/2)+1):
        return (False)
    else:
        if x%k == 0 and int(x/k) == k:
            return (k)
        else:
            return Squar(x,k+1)

def Ten(x,count):
    if x/10 < 10:
        return (count)
    else:
        return Ten(x/10,count+1)

x = input().split(" ")
a = int(x[0]+x[1])

n = Squar(a,10**int(Ten(a,1)/2))

if n == 0:
    print("No")
else:
    print("Yes")

Measured memory_bytes: 20512
#include <iostream>
#include <vector>
#include <bitset>
using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> A(N);
    for(int i=0; i<N; i++) cin >> A[i];
    int sm = 0;
    for(int i=0; i<N; i++) sm += A[i];
    bitset<4000004> b;
    b[0] = 1;
    for(int i=0; i<N; i++) b |= b << A[i];
    for(int i=(sm+1)/2; ; i++){
        if(b[i]){
            cout << i << endl;
            return 0;
        }
    }
    return 0;
}


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

string s;
int w;

int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	cin >> s >> w;
	for(int i=0; i<(int)s.size(); i+=w)
		cout << s[i];
	cout << "\n";
}

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

#define F first 
#define S second
#define PB push_back

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;
typedef priority_queue<int> HEAP;
typedef priority_queue<int, vector<int>, greater<int> > RHEAP;

const int N = 100010, M = 1010, INF = 0x3f3f3f3f;

int n, m;
int a[N];
set<int> S;

int main()
{
	scanf("%d %d", &n, &m);
	
	int mina = INF, maxd = -INF;
	for (int i = 0; i < n; i ++ )
	{
		scanf("%d", &a[i]);
		mina = min(mina, a[i]);
		maxd = max(maxd, a[i] - mina);
	}
	
	int res = 0;
	for (int i = 0; i < n; i ++ )
	{
		if (S.count(a[i] - maxd)) res ++ ;
		S.insert(a[i]);
	}
	printf("%d\n", res);
    return 0;
}

Measured memory_bytes: 8808
#include <iostream>
#include <cmath>
#include <numeric>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <algorithm>
using namespace std;

int main() {
    char C;
    cin >> C;
    cout << (char)(C + 1) << endl;
    return 0;
}


Measured memory_bytes: 256
////////////////////////////////////
//          ,.                    //
//         (_|,.                  //
//        ,' /, )_______   _      //
//     __j o``-'        `.'-)'    //
//    (")                 \'      //
//     `-j                |       //
//        `-._(           /       //
//           |_\  |--^.  /        //
//          /_]'|_| /_)_/         //
//             /_]'  /_]'         //
//                                //
//           PIGMEISTER™          //
//                                //
////////////////////////////////////

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

#define ll long long
#define ull unsigned long long
#define mod (ll)1000000007
#define sidha(i, x, n) for(ll i=(ll)(x);i<(ll)(n);i++)
#define ulta(i, x, n) for(ll i=(ll)(x);i>=(ll)(n);i--)
#define mii map<ll, ll>
#define vi vector<ll>
#define pii pair<ll, ll>
#define pb push_back
#define mp make_pair
#define modInv(x) powah(x, mod-2)
#define test ll t;cin>>t;while(t--)
#define jaldi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl '\n'
ll powah(ll, ll);

int main()
{
    jaldi;
    
    ll a, b, c;
    cin >> a >> b >> c;
    if ((a==b && b!=c)||(a==c && b!=c)||(b==c && a!=c))
        cout << "Yes";
    else cout << "No";

    return 0;
}

ll powah(ll x, ll y) { 
    ll res = 1;
    x = x % mod;
    while (y > 0) { 
        if (y & 1) 
            res = (res*x) % mod; 
        y = y>>1;
        x = (x*x) % mod;   
    } 
    return res; 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <map>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
 
const ll MOD=1e9+7;
const ll INF=1e18;
 
int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};


int ans[35][35];
int wall[70][70];
int w,h;

bool check(int y1,int x1,int y2,int x2){
    if(min(min(x1,y1),min(x2,y2)) < 0 || max(x1,x2) >= w || max(y1,y2) >= h) return false;
    if(y1 == y2){
        if(wall[y1*2][min(x1,x2)] == 1){
            return false;
        }else{
            return true;
        }
    }else{
        if(wall[min(y1,y2)*2+1][x1] == 1){
            return false;
        }else{
            return true;
        }
    }
}

int main(){
    
    while(true){
        cin >> w >> h;
        if(w + h == 0) break;
        for(int i = 0;i < h;i++){
            for(int j = 0;j < w;j++){
                ans[i][j] = -1;
            }
        }
        for(int i = 0;i < 2*h-1;i++){
            for(int j = 0;j < w - 1 + i%2;j++){
                cin >> wall[i][j];
            }
        }
        ans[0][0] = 1;
        queue<P> que;
        que.push(P(0,0));
        int flag = 0;
        while(!que.empty()){
            P q = que.front(); que.pop();
            if(q.fs == h-1 && q.sc == w-1){
                flag = 1;
                cout << ans[q.fs][q.sc] << endl;
                break;
            }
            for(int i = 0;i < 4;i++){
                if( check(q.fs,q.sc,q.fs+dy[i],q.sc+dx[i]) == true && ans[q.fs+dy[i]][q.sc+dx[i]]==-1){
                    ans[q.fs+dy[i]][q.sc+dx[i]] = ans[q.fs][q.sc] + 1;
                    que.push(P(q.fs+dy[i],q.sc+dx[i]));
                }
            }
            
        }
        if(flag == 0){
            cout << 0 << endl;
        }
    }
}


Measured memory_bytes: 3112
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
#include <cmath>
#include <map>
using namespace std;

typedef long long ll;

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

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

  bool res = false;
  for (int i = n; i > 0; i -= 11) {
    if (i % 4 == 0 || i % 7 == 0 || i % 11 == 0) res = true;
  }

  if (res) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <ctype.h>
#include <math.h>
#include <stack>
#include <string>
#include <string.h>
using namespace std;
const double PI = acos(-1.0);
const long mod = 1000000007;
const long INF = 1e9 + 1;

int main() { 
  int d,g;
  cin >> d >> g;
  int p[d],c[d];
  for(int i = 0; i < d; i++)
    cin >> p[i] >> c[i];

  int mi = INF;
  for(int bit = 0; bit < (1 << d); bit++) {
    int cnt = 0,sum = 0, ma = 0;
    for(int i = 0; i < d; i++) {
      if(bit & (1 << i)) {
        sum += 100*(i+1)*p[i] + c[i];
        cnt += p[i];
      }
      else ma = max(ma, i); //選ばれないもののうちの最大
    }
    if(sum >= g) mi = min(mi, cnt);
    else {
      for(int i = 1; i < p[ma]; i++) {
        sum += 100*(ma+1);
        cnt++;
        if(sum >= g) {
          mi = min(mi,cnt);
          break;
        }
      }
    }
  }
  
  cout << mi << endl;
}

Measured memory_bytes: 3576
using System;
using System.Collections.Generic;
using System.Linq;

namespace atcoder_csharp
{
    class Program
    {
        static void Main()
        {
            var n = Util.ReadInt();
            var values = Util.ReadInts().OrderBy(v => v).ToList();
            if(n == 1) {
                Console.WriteLine(values[0]);
                return;
            }

            var avg = (double)values[0];
            for(var i = 1; i < n; i++) {
                avg = (double)(values[i] + avg)/2;
            }
            Console.WriteLine(avg);
        }
  
    }

    class Util {
        private const bool debug = false;

        public static string ReadStr() {
            return debug ? ReadDebugLine() : Console.ReadLine();
        }

        public static List<string> ReadStrs() {
            return ReadStr().Split(' ').ToList();
        }

        public static int ReadInt() {
            return int.Parse(ReadStr());
        }     

        public static List<int> ReadInts() {
            return ReadStrs().Select(s => int.Parse(s)).ToList();
        } 

        private static List<string> _lines;
        private static int _lineIndex = 0;
        private static string ReadDebugLine() {
            if(_lines == null) {
                _lines = System.IO.File.ReadAllLines("debug.txt").ToList();
            }
            return _lines[_lineIndex++];
        }

    }
}


Measured memory_bytes: 13396
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;
int a, b, x;
int main()
{
	while(scanf("%d%d",&a,&b)!=EOF)
	{
		if((a + b) % 2 != 0)
		{
			x = (a + b) / 2 + 1;
		}
		else x = (a + b) / 2;
		printf("%d\n",x);
	}
}


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

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

    int max;
    int count = 1;

    for(int i = 0; i < k; i++) {
        count *= 2;
    }

    if(a >= b) {
        if(a >= c) {
            max = a * count + b + c; 
        }
        else {
            max = c * count + a + b;
        }
    }
    else {
        if(b >= c) {
            max = b * count + a + c;
        }
        else {
            max = c * count + a + b; 
        }
    }

    cout << max << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const int MAX = 1000000;
const int INF = 1e9;
const double pi=acos(-1);
int n,p;
string s;
ll solve(){
  if(p==2 || p==5){
    ll ans=0;
    rep(i,n){
      if((s[n-1-i]-'0')%p==0)ans+=n-i;
    }
    return ans;
  }
  else{
    ll ten=1,ans=0;
    vector<ll>sum(p,0);
    ll now=0;
    sum[0]++;
    rep(i,n){
      now=(now+(s[n-1-i]-'0')*ten)%p;
      sum[now]++;
      ten=(ten*10)%p;
    }
    rep(i,p){
      ans+=sum[i]*(sum[i]-1)/2;
    }
    return ans;
  }   
}

int main(){
  cin >> n >> p >> s;
  cout << solve() << endl;
  return 0;
}


Measured memory_bytes: 640
#include<stdio.h>
#include<bits/stdc++.h>
#define maxn 200005 
using namespace std;
namespace NF
{
    int N=0,S=1,T=2;
    int las[maxn],to[maxn],pre[maxn],len[maxn],dis[maxn],cnt[maxn],inc=1;
    void ins(int a,int b,int c){pre[++inc]=las[a],las[a]=inc,to[inc]=b,len[inc]=c;}
    int dfs(int u,int flow)
    {
        int v,temp,delta;
        if(u==T) return flow;
        delta=0;
        for(v=las[u];v;v=pre[v]) 
        {
            if(len[v]>0&&dis[u]==dis[to[v]]+1) 
            {
                temp=dfs(to[v],min(flow-delta,len[v]));
                len[v]-=temp,len[v^1]+=temp,delta+=temp;
                if(delta==flow||dis[S]>=N) return delta;
            }
        }
        if(dis[S]>=N) return delta;
        if(!--cnt[dis[u]]) dis[S]=N;
        cnt[++dis[u]]++;
        return delta;
    }
    int Solve()
    {
        int ret=0;
        while(dis[S]<N) ret+=dfs(1,1e9);
        return ret;
    }
    void Init()
    {
    	for(int i=1;i<=N;i++) las[i]=cnt[i]=dis[i]=0;
    	inc=1,N=0;
	}
}
int g[505][505],ans[505][505],vis[505][505],val[505][505],ed[505][505],nw[505],n,m;
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++) scanf("%d",&g[i][j]);
	for(int cc=1;cc<=m;cc++)
	{
		NF::Init(); NF::N=2*n+2;
		memset(ed,0,sizeof(ed));
		for(int i=1;i<=n;i++)
		{
			fill(nw+1,nw+n+1,0);
			NF::ins(1,i+2,1),NF::ins(i+2,1,0);
			NF::ins(i+n+2,2,1),NF::ins(2,i+n+2,0);
			for(int j=1;j<=m;j++)
			{
				int id=(g[i][j]-1)/m+1;
				if(!vis[i][j]&&!nw[id])
				{
					NF::ins(i+2,id+n+2,1);
					ed[i][id]=NF::inc,val[i][id]=j;
					NF::ins(id+n+2,i+2,0);
				}
			}
		}
		NF::Solve();
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				if(ed[i][j]&&!NF::len[ed[i][j]])
				{
					ans[cc][i]=g[i][val[i][j]];
					vis[i][val[i][j]]=1;
					break;
				}
	}
	for(int i=1;i<=n;i++,puts("")) for(int j=1;j<=m;j++) printf("%d ",ans[j][i]);
	for(int i=1;i<=m;i++) sort(ans[i]+1,ans[i]+n+1);
	for(int i=1;i<=n;i++,puts("")) for(int j=1;j<=m;j++) printf("%d ",ans[j][i]);
	return 0;
}


Measured memory_bytes: 7808
#pragma GCC optimize(2)
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

const ll mod = 1e9 + 7;
const int N = 1e5 + 10, M = 1e6 + 10;
const ll INF = 1e18;
const int inf = 0x3f3f3f3f;
const double eps = 1e-8;

#define pi acos(-1)

int fa[N];
void init(int n)
{
    for (int i = 0; i <= n; i++)
        fa[i] = i;
}
int get(int x) { return fa[x] == x ? x : fa[x] = get(fa[x]); }
void merge(int x, int y)
{
    x = get(x);
    y = get(y);
    fa[x] = y;
}

int main()
{
    int n;
    scanf("%d", &n);
    init(n);
    int m;
    cin >> m;
    int num = 0;
    while (m--)
    {
        int x, y;
        scanf("%d%d", &x, &y);
        if (get(x) != get(y))
        {
            num++;
            merge(x, y);
        }
    }
    cout << n - num - 1 << endl;
    return 0;
}

/*

*/

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

int i = 0;
string str[110];

int main() {
	int N, L; scanf("%d %d\n", &N, &L);
	while (getline(cin, str[i++]));
	sort(str, str + N);
	for (i = 0; i < N; ++i) printf("%s", str[i].c_str());
	puts("");
}

Measured memory_bytes: 256
#pragma region macro
#include <bits/stdc++.h>
using i64 = int_fast64_t;
#define repeat(i, a, b) for(int i = (a); (i) < (b); ++(i))
#define rep(i, n) repeat(i, 0, n)

namespace std {
template <typename A, typename B>
string to_string(pair<A, B> p);

string to_string(const string &s) {
    return '"' + s + '"';
}

string to_string(const char *s) {
    return to_string((string)s);
}

string to_string(bool b) {
    return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
    bool first = true;
    string res = "{";
    for(int i = 0; i < static_cast<int>(v.size()); i++) {
        if(!first) {
            res += ", ";
        }
        first = false;
        res += to_string(v[i]);
    }
    res += "}";
    return res;
}

template <size_t N>
string to_string(bitset<N> v) {
    string res = "";
    for(size_t i = 0; i < N; i++) {
        res += static_cast<char>('0' + v[i]);
    }
    return res;
}

template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for(const auto &x : v) {
        if(!first) {
            res += ", ";
        }
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
};  // namespace std
#pragma endregion

void solve() {
    int a, b, x;
    std::cin >> a >> b >> x;
    std::cout << std::setprecision(12);
    if(a * a * b / 2 < x) {
        double h = a * a * b - x;
        h *= 2;
        h /= (a * a);
        std::cout << std::atan(h / a) * 180 / 3.141592653589793238 << std::endl;
    } else {
        double h = 2 * x;
        h /= (a * b);
        std::cout << 90 - std::atan(h / b) * 180 / 3.141592653589793238 << std::endl;
    }
}

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

Measured memory_bytes: 384