akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cassert>
#include <cstring>
#include <climits>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define mp make_pair
#define fi first
#define se second
#define pb push_back

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

constexpr ll INF = 1e18;
constexpr ll MOD = 1e9 + 7;
constexpr double PI = 3.14159265358979323846;
constexpr int di[] = {0, 0, 1, -1};
constexpr int dj[] = {1, -1, 0, 0};

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

    string s;
    cin >> s;

    bool res = false;

    for (int i = 0; i <= s.size(); i++)
    {
        for (int j = i - 1 + 1; j <= s.size(); j++)
        {
            string a = "";

            int k = 0;
            while (k <= i - 1)
            {
                a = a + s[k];
                k++;
            }

            int l = j;
            while (l < s.size())
            {
                a = a + s[l];
                l++;
            }

            if (a == "keyence")
                res = true;
        }
    }

    cout << (res ? "YES" : "NO") << endl;

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int N,a1,a2,a3,i;
  scanf("%d\n",&N);  

  for(i=0;i<N;i++){
    scanf("%d %d %d",&a1,&a2,&a3);
  
    if(a1>a2 && a1>a3){
      if(a1*a1==a2*a2+a3*a3)
	printf("YES\n");
      else
	printf("NO\n");
    }

    else if(a2>a1 && a2>a3){
      if(a2*a2==a1*a1+a3*a3)
	printf("YES\n");
      else
	printf("NO\n");
    }

    else{
      if(a3*a3==a1*a1 + a2*a2 )
	printf("YES\n");
      else
	printf("NO\n"); 
    }
  }
  return 0;
}

Measured memory_bytes: 580
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define debug  freopen("in.txt","r",stdin),freopen("out.txt","w",stdout);
#define pb push_back
#define all(x) x.begin(),x.end()
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int maxn = 1e6+10;
const int maxM = 1e6+10;
const int inf = 0x3f3f3f3f;
const ll inf2 = 0x3f3f3f3f3f3f3f3f;

template<class T>void read(T &x){
    T s=0,w=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
    while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
    x = s*w;
}
template<class H, class... T> void read(H& h, T&... t) {
    read(h);
    read(t...);
}
int X,Y,A,B,C;
int a[maxn],b[maxn],c[maxn];
void solve(){
	ll ans = 0;
	sort(a+1,a+A+1,greater<int>());
	sort(b+1,b+B+1,greater<int>());
	sort(c+1,c+C+1,greater<int>());
	int taila = X,tailb = Y;
	for(int i = 1;i<=X;i++) ans += a[i];
	for(int i = 1;i<=Y;i++) ans += b[i];
	for(int i = 1;i<=min(C,X+Y);i++){
		if(taila && tailb){
			if(c[i] <= min(a[taila],b[tailb])) break;
			if(a[taila] <= b[tailb]){
				ans = ans + c[i]-a[taila];
				taila--;
			}else{
				ans = ans + c[i]-b[tailb];
				tailb--;
			}
		}else if(taila == 0){
			if(c[i] <= b[tailb]) break;
			ans = ans + c[i] - b[tailb];
			tailb--;
		}else if(tailb == 0){
			if(c[i] <= a[taila]) break;
			ans = ans + c[i] - a[taila];
			taila--;
		}
	}
	printf("%lld\n",ans);
}	
int main(){
	// debug;
	
	read(X,Y,A,B,C);
	for(int i = 1;i<=A;i++) read(a[i]);
	for(int i = 1;i<=B;i++) read(b[i]);
	for(int i = 1;i<=C;i++) read(c[i]);
	solve();
	return 0;
}


Measured memory_bytes: 4848
#                         author:  kagemeka 
#                         created: 2019-11-08 13:38:56(JST)
## internal modules
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator
## external modules
# import scipy.special   # if use comb function on AtCoder, 
# import scipy.misc      # select scipy.misc.comb (old version) 

def main():
    n, k, *a = (int(x) for x in sys.stdin.read().split())
    i = a.index(1)
    l = k - 1
    left, right = i, (n - 1) - i
    if left % l == 0:
        if right % l == 0:
            ans = left // l + right // l
        else:
            ans = left // l + right // l + 1
    else:
        if right % l  == 0:
            ans = left // l + 1 + right // l 
        else:
            if left % l + right % l > l:
                ans = left // l + right // l + 2
            else:
                ans = left // l + right // l + 1 
    
    print(ans)




if __name__ == "__main__":
    # execute only if run as a script
    main()


Measured memory_bytes: 14324
// In the name of God

#include <bits/stdc++.h>

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	for(int i=0;i<s.length()-1;i++) {
		if(s[i] == s[i+1]) {
			cout << "Bad";
			exit(0);	
		}
	}
	cout << "Good";
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
#include <random>
#include <string.h>
using namespace std;
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define int long long
#define P pair<int,int>
#define all(vec) vec.begin(),vec.end()

int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}

int a, b, n;

signed main() {
	cin >> a >> b >> n;
	cout << a * (min(b - 1, n)) / b << endl;
}

Measured memory_bytes: 3584
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
#define MAX 10000010
bool num[MAX]={1,1,0};
int main(){
  for(int i=3;i<MAX;i+=2){
    if(num[i]==1)
      continue;
    for(int j=3*i;j<MAX;j+=i*2)
      num[j]=1;
  }
  for(int i=4;i<MAX;i+=2)num[i]=1;

  vector<long long int>ans;
  loop(i,13,MAX){
    if(!(num[i]||num[i-2]||num[i-6]||num[i-8]))ans.pb(i);
  }
  ans.pb(100000000);
  sort(all(ans));
  int in;
  while(cin>>in,in){
    int k;
    rep(i,ans.size())if(ans[i]>in){k=i-1;break;}
    cout<<ans[k]<<endl;
  }
}

Measured memory_bytes: 10992
import numpy as np
n,m=map(int,input().split())
p=[list(input().split()) for _ in range(m)]
a=[0]*(n+1)
w=[0]*(n+1)
for i in range(m):
    if a[int(p[i][0])]==0 and p[i][1]=='AC':
        a[int(p[i][0])]+=1
    if a[int(p[i][0])]==0 and p[i][1]=='WA':
        w[int(p[i][0])]+=1
a=np.array(a)
w=np.array(w)
aw=a*w
print(sum(a),sum(aw))

Measured memory_bytes: 37240
using System;
using System.Collections;
using System.Collections.Generic;

class Program
{
	static void Main(string[] args)
	{
		var s = Console.ReadLine();
		int N = s.Length;
		string primeS = "";
		string lastS = "";
		for (int i = 0; i < (N-1)/2; i++)
		{
			primeS += s[i];
		}
		for (int i = ((N+3)/2)-1; i < N; i++)
		{
			lastS += s[i];
		}
		if (primeS.Equals(lastS))  Console.WriteLine("Yes");
		else Console.WriteLine("No");
	}
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main()
{
    int n;
    cin >> n;
    vector<P> a(n);
    for(int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        a[i] = P(x, i);
    }
    sort(a.begin(), a.end());
    int len = 1;
    int mlen = 1;
    for(int i = 0; i < n-1; i++)
    {
        if(a[i+1].second > a[i].second)
        {
            len++;
        }
        else
        {
            len = 1;
        }
        mlen = max(mlen, len);
    }
    cout << n - mlen << endl;
}


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

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

  vector<bool> p(102, true);

  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    p[t] = false;
  }

  int a = 0;
  for (int i = x; !p[i]; i++) {
    a++;
  }
  int b = 0;
  for (int i = x; !p[i]; i--) {
    b++;
  }

  cout << (a < b ? x + a : x - b) << endl;
}


Measured memory_bytes: 3632
#include<cstdio>
#include<math.h>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<set>
#include<map>
#include<iostream>
#include<queue>
#define INF 999999
#define EPS 1.0e-6

using namespace std;

typedef pair<string,int> P;
int n;

int main()
{
    cin>>n;
    string s;
    int p;
    vector<P> v;
    for(int i=0;i<n;i++){
        cin>>s>>p;
        v.push_back(make_pair(s,-p));
    }
    vector<P> v1=v;
    sort(v1.begin(),v1.end());
    
    map<P,int> mp;
    for(int i=0;i<v.size();i++){
        mp[v[i]]=i+1;
        //cout<<v[i].first<<" "<<v1[i].second<<endl;
    }
    for(int i=0;i<v1.size();i++){
        cout<<mp[v1[i]]<<endl;
    }
    return 0;
}

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

using namespace std;

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

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

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

void solve(long long N, std::vector<long long> A) {
    multiset<int> lis;
    for (auto a : A) {
        auto it = lis.lower_bound(a);
        if( it == lis.begin()){
            lis.insert(a);
        }else{
            --it;
            lis.erase(it);
            lis.insert(a);
        }
    }
    cout << lis.size() << endl;

}

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


Measured memory_bytes: 5760
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
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(a > b){ a = b; return 1; } return 0; }
typedef long long ll;
const ll MOD=998244353;
struct mint{
  ll x;
  mint(ll x=0):x(x%MOD){}
  mint& operator+=(const mint a){
    if((x+=a.x)>=MOD) x-=MOD;
    return *this;
  }
  mint& operator-=(const mint a){
    if((x += MOD-a.x)>=MOD) x-=MOD;
    return *this;
  }
  mint& operator*=(const mint a){
    (x*=a.x)%=MOD;
    return *this;
  }
  mint operator+(const mint a) const{
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const{
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const{
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const{
    if(!t) return 1;
    mint a = pow(t>>1);
    a*=a;
    if(t&1) a*=*this;
    return a;
  }
  
  //for prime mod
  mint inv() const{
    return pow(MOD-2);
  }
  mint& operator/=(const mint a){
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const{
    mint res(*this);
    return res/=a;
  }
};
const int NMAX=200010; // we can calculate nCk until n is equal to NMAX
mint fact[NMAX],infac[NMAX];
void Make_Fact(){
  fact[0]=fact[1]=1;
  for(int i=2;i<=NMAX-1;++i){
    fact[i]=fact[i-1]*(mint)i;
  }
}
void Make_InvFact(){
  infac[0]=infac[1]=1;
  for(int i=2;i<=NMAX-1;++i){
    infac[i]=infac[i-1]/(mint)i;
  }
}
mint Comb(int n,int k){
  if(n<0||k<0||n-k<0) return 0;
  return fact[n]*infac[k]*infac[n-k];
}
mint pow2[200010];

int main()
{
  int n,m;cin >> n >> m;
  int k; cin >> k;

  Make_Fact();
  Make_InvFact();

  pow2[0].x = 1;
  rep(i,n) pow2[i+1] = pow2[i]*(mint)(m-1);

  mint res;

  rep(i,k+1) {
    res += (mint)m * pow2[n-1-i] * Comb(n-1, i);
  }
  
  cout << res.x << "\n";
  return 0;
}


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

int main(){

	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	int q;
	cin >> q;
	for (int i = 0; i < q; i++) {
		int b, e, k;
		cin >> b >> e >> k;
		cout << count(a.begin()+b, a.begin() + e, k) << endl;
	}
	return 0;
}


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

#define pb(n) push_back(n)
#define fi first
#define se second
#define X real()
#define Y imag()
#define value(x,y,w,h) (x >= 0 && x < w && y >= 0 && y < h)
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using comd = complex<double>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

double CalcDist(comd p1, comd p2){
  return sqrt(pow(p1.X - p2.X,2.0) + pow(p1.Y -p2.Y,2.0));
}

template <typename T>
void out(deque < T > d)
{
  for(size_t i = 0; i < d.size(); i++)
  {
    debug(d[i]);
  }
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  while(cin >> n){
    if(n == 0) break;
    string ans = "";
    int c;
    int a = 0,len = 0;
    rep(i,n){
      cin >> c;
      if(a == 0){
        ans += to_string(c);
        a = c ;
      }
      else{
        if(c - 1 == a){
          if(i == n-1){
            if(a == c-1){
              ans += '-';
              ans += to_string(c);
            }
          }
          a = c ;
          ++len;
        }
        else{
          if(len >= 1){
            ans += '-';
            ans += to_string(a);
          }
          ans += ' ';
          ans += to_string(c);
          a = c ;
          len = 0;
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}

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

int main() {
	ll x; cin >> x;
	cout << min(2 * (ll)ceil(1.0 * x / 11), 2 * (ll)ceil(1.0 * (x - 6) / 11) + 1) << endl;
}


Measured memory_bytes: 256
"use strict"
// inputに入力データ全体が入る
function Main(input){
    input = parseInt(input);
    if(input < 1200){
        console.log("ABC");
    }else if(input < 2800){
        console.log("ARC");
    }else{
        console.log("AGC");
    }
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i < n+1; i++)
#define all(A) A.begin(),A.end()
typedef long long ll;

int main(){
  int a;
  cin >> a;
  cout << a + a*a + a*a*a << endl;
}

Measured memory_bytes: 3616
#include<iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
#include<functional>
#include<iomanip>
#include<queue>
#include<cassert>
#include<tuple>
#include<set>
#include<map>
#include<list>
#include<bitset>
#include<utility>
#include<numeric>

#define PB push_back
#define all(a)  (a).begin(),(a).end()
#define ALL(v) begin(v), end(v)
#define DWN(a)  (a).begin(),(a).end(), greater<int>()
#define rep(i, m) for (int i = 0; i < m; i++)
#define REP(i, n, m) for (int i = n; i < m; i++)
#define V vector<int>
#define VV vector<V>
#define VVV vector<VV>

using namespace std;

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

const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
const int inf = (int)1e9;
const ll INF = (ll)1e18;
const ll MOD{ (ll)1e9 + 7 };
const long double EPS = 1e-10;

int h, w;
int a[510][510];
int cnt = 0;

int main() {
	cin >> h >> w;
	int ans[250000][4];

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			cin >> a[i][j];
		}
	}
	for (int i = 0; i < h - 1; i++) {
		for (int j = 0; j < w; j++) {
			if (a[i][j] % 2 != 0) {
				a[i + 1][j]++;
				ans[cnt][0] = i + 1;
				ans[cnt][1] = j + 1;
				ans[cnt][2] = i + 2;
				ans[cnt][3] = j + 1;
				cnt++;
			}
		}
	}
	for (int j = 0; j<w - 1; j++) {
		if (a[h - 1][j] % 2 != 0) {
			a[h - 1][j + 1]++;
			ans[cnt][0] = h;
			ans[cnt][1] = j + 1;
			ans[cnt][2] = h;
			ans[cnt][3] = j + 2;
			cnt++;
		}
	}
	cout << cnt << endl;
	for (int i = 0; i < cnt; i++) {
		cout << ans[i][0] << " " << ans[i][1] << " " << ans[i][2] << " " << ans[i][3] << endl;
	}
	return 0;
}

Measured memory_bytes: 6912
/* http://rose.u-aizu.ac.jp/onlinejudge/ProblemSet/description.jsp?id=2186&lang=jp */

#include <cstdio>
#include <cstdlib>
#include <cstring>

#define PADDR(xx,yy) ( (dest_x+1)*(yy) + (xx) ) 
#define min(a, b) ((a) < (b) ? (a) : (b))

#define SET_MTTB_TATE(ptr) ptr = ptr ^ 0x1;
#define SET_MTTB_YOKO(ptr) ptr = ptr ^ 0x2;

#define IS_MTTB_TATE(ptr) (ptr & 0x1)
#define IS_MTTB_YOKO(ptr) (ptr & 0x2)

// #define dprintf(arg1, ... ) printf( arg1, __VA_ARGS__)
#define dprintf(arg1, ... ) 

long get_path ( int dest_x, char* is_mttb, long* cache, int x, int y )
{
	
	if ( x == 0 && y == 0 ) { return 1; }
	
	long c = cache[ PADDR(x,y) ];
	if ( c>=0 ) { dprintf("Cache x = %d, y = %d Ret=%d\n",x,y,c); return c; }
	
	long retval = 0;
	
	//ツ可コツつゥツづァ
	if ( y == 0 ) { }
	else if ( !IS_MTTB_TATE( is_mttb[ PADDR(x, y-1) ] ) ) {
		 retval += get_path( dest_x, is_mttb, cache, x, y-1 );
	}
	
	//ツ債カツつゥツづァ
	if ( x == 0 ) { }
	else if ( !IS_MTTB_YOKO( is_mttb[ PADDR(x-1, y) ] ) ) {
		retval += get_path( dest_x, is_mttb, cache, x-1, y );
	}
	
	cache[ PADDR(x,y) ] = retval;
	dprintf("Called x = %d, y = %d Ret=%d\n",x,y,retval);
	return retval;
}

int main(void)
{
	int count_ds;
	scanf( "%d", &count_ds );
	
	for ( int ds = 0; ds<count_ds; ds++ ) {
		int dest_x, dest_y;
		scanf( "%d %d", &dest_x, &dest_y );
		int bufsize = (dest_x+1)*(dest_y+1);
		
		char* is_mttb;
		is_mttb = (char*)malloc( sizeof(char)*bufsize );
		memset( is_mttb, 0, sizeof(char)*bufsize );
		
		int count_mttb;
		scanf( "%d", &count_mttb );
		
		int tempx1, tempy1, tempx2, tempy2;
		for ( int mttb = 0; mttb<count_mttb; mttb++ ) {
			scanf( "%d %d %d %d", &tempx1, &tempy1, &tempx2, &tempy2 );
			
			if ( tempx1 == tempx2 ) {
				dprintf("TATE %d\n",PADDR( tempx1, min(tempy1, tempy2)) );
				SET_MTTB_TATE( is_mttb[ PADDR( tempx1, min(tempy1, tempy2) ) ] );
			} else if ( tempy1 == tempy2 ) {
				dprintf("YOKO %d\n",PADDR( min(tempx1, tempx2),  tempy1) );
				SET_MTTB_YOKO( is_mttb[ PADDR( min(tempx1, tempx2),  tempy1) ] );
			}
		}
		dprintf("%d\n",is_mttb[0]);
		
		long* cache;
		cache = (long*)malloc( sizeof(long)*bufsize );
		memset( cache, -1, sizeof(long)*bufsize );
		
		int ret = get_path( dest_x, is_mttb, cache, dest_x, dest_y );
		if ( ret == 0 ) { puts("Miserable Hokusai!"); }
		else { printf( "%d\n", ret ); }
		
		free( cache );
		free( is_mttb );
	}
	
	return 0;
}

Measured memory_bytes: 0
#include <stdio.h>

int main(void){
  int N, i, sum=0;
  scanf("%d", &N);
  int a[N];
  for(i=0; i<N; i++){
    scanf("%d", &a[i]);
    sum += a[i];
  }
  sum -= N;
  printf("%d\n", sum);
  return 0;
}


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

#define FOR(i, j, n) for (int i(j); i < n; ++i)
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define dbg(x) std::cerr<<#x<<" = " << (x) << std::endl
#define pnl(x) std::cout << x << "\n"

typedef	std::vector<int>	vi;
typedef std::pair<int,int>	ii;
typedef std::vector<std::string>	vs;
typedef std::vector<ii>	vii;
typedef std::vector<long long>	vl;
typedef	long long ll;

const int	MAX_N = 100;

bool		open[MAX_N][10] = {};
int			profit[MAX_N][11] = {};
bool		taken[10];

int			N;

int		compute(int index)
{
	if (index == 10)
	{
		bool	a = false;
		FOR(i,0,10)
			a = a or taken[i];
		if (!a)
			return -1e9;
		int		total = 0;
		FOR(i,0,N)
		{
			int	cnt(0);
			for (int j(0); j < 10; ++j)
				cnt += (taken[j] and open[i][j]);
			total += profit[i][cnt];
		}
		return total;
	}

	taken[index] = true;
	int	ret = compute(index + 1);
	taken[index] = false;
	ret = std::max(ret, compute(index + 1));
	return ret;
}

int		main(void)
{
	std::ios_base::sync_with_stdio(false);
	std::cin >> N;

	for (int i(0); i < N; ++i)
		FOR(j,0,10)
			std::cin >> open[i][j];
	for (int i(0); i < N; ++i)
		FOR(j,0,11)
			std::cin >> profit[i][j];

	pnl(compute(0));
}



Measured memory_bytes: 764
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list=new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//int[] array = new int[2000000];
		String s = sc.next();
		List<String> list=new ArrayList<String>(Arrays.asList(s.split("")));
		if(list.get(2).equals(list.get(3))){
			if(list.get(4).equals(list.get(5)))
				System.out.println("Yes");
			else
				System.out.println("No");
		}
		else
			System.out.println("No");

	}
}

Measured memory_bytes: 22100
S = str(input())
idx1 = 0
count = 0
idxmax = len(S)
#elems = []
while idx1 < idxmax:
    if idx1 == idxmax - 1:
        count += 1
#        print("d1")
#        elems.append(S[idx1])
        break
    
    if S[idx1] == S[idx1 + 1]:
        if idx1 == idxmax - 2:
            count += 1
#            elems.append(S[idx1:idx1+2])
#            print("d2")
            break
        else:
            count += 2
#             elems.append(S[idx1:idx1+1])
#             elems.append(S[idx1+1:idx1+3])
#             print("d3")
            idx1 += 3
    else:
#         elems.append(S[idx1:idx1+1])
#         print("d4")
        idx1 += 1
        count += 1

print(count)
#print(elems)


Measured memory_bytes: 3500
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Stack;


class Main{
	public static void main(String[] args){
		Solve s = new Solve();
		s.solve();
	}	
}

class Solve{
	Solve(){}
	

	void solve(){
		Scanner in = new Scanner(System.in);

		while(in.hasNext()) {
			int n = in.nextInt() / 4;
			if (n == 0) return;
			int sum = 0;
			for(int i = 0; i < n; i++){
				int t = in.nextInt();
				sum += t;
			}
			System.out.println(sum);
		}
		
	}
}

Measured memory_bytes: 26216
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(v) (v).begin(),(v).end()
#define chmin(x,y) x = min(x,y)
typedef pair<int, int> P;
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const ll MOD = 1e9+7;

int main() {
	int N;
    ll K;
	cin >> N >> K;
    vector<int> A(N), F(N);
    rep(i, N) cin >> A[i];
    rep(i, N) cin >> F[i];
    sort(all(A));
    sort(F.rbegin(), F.rend());
    ll start = -1, end = 1e12;
    while (start + 1 < end) {
        ll now = (start + end) / 2;
        bool ok = [&] {
            ll s = 0;
            rep(i, N) {
                s += max(0ll, A[i]-now/F[i]);
            }
            return s <= K;
        } ();
        if (ok) end = now; else start = now;
    }
    cout << end << endl;
    return 0;
}


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

int main(){
    ll a, b, x;
    cin >> a >> b >> x;
    if(a > 0) cout << b/x + 1 - ((a - 1)/x + 1) << endl;
    else cout << b/x + 1 << endl;
}

Measured memory_bytes: 3612
#include<iostream>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<cmath>
#include<map>

using namespace std;

#define rep(i,N) for(int i=0;i<N;i++) //0から


typedef long long ll;




ll binary_search(vector<ll> a, ll n, ll key){
    ll right = n, left = -1;
    ll md = (right + left) / 2;

    while(right - left > 1){
        if(a[md] <= key){
            right = md;
        }else{
            left = md;
        }
        md = (right + left) / 2;
    }
    if(left == -1) return -1; //無い場合
    return right;
}

vector<ll> prime;
void Prime(ll n){ //線形篩,素数列挙
    vector<ll> p(n,0);
    p[0]=1;
    p[1]=1;
    for(ll i=2;i<n;i++){
        if(p[i]==0){
            prime.push_back(i);
            p[i]=i;
        }
        ll k=prime.size();
        for(ll j=0;j<k && i*prime[j]<n && prime[j]<=p[i];j++){
            p[i*prime[j]]=prime[j];
        }
    }
}

#define MOD ((ll)1e+9 + 7)




//cout<<fixed<<setprecision(10);
int main(){
    ll w,h,x,y;
    cin>>w>>h>>x>>y;
    bool type=(2*x==w && 2*y==h);
    double ans=(double)(w*h)/2;
    cout<<fixed<<setprecision(10);
    cout<<ans<<' '<<type<<endl;



    return 0;
}



Measured memory_bytes: 3792
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	A := nextInt()
	B := nextInt()
	C := nextInt()
	fmt.Printf("%d", Max(0, C-A+B))
}

func nextInt() int {
	v, _ := strconv.Atoi(nextReader())
	return v
}

func nextInt64() int64 {
	v, _ := strconv.ParseInt(nextReader(), 10, 64)
	return v
}

func nextString() string {
	return nextReader()
}

func nextInts(n int) []int {
	r := make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}

func nextInt64s(n int) []int64 {
	r := make([]int64, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt64()
	}
	return r
}

var nextReader func() string

func init() {
	nextReader = NewScanner()
}

func NewScanner() func() string {
	r := bufio.NewScanner(os.Stdin)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)
	return func() string {
		r.Scan()
		return r.Text()
	}
}

func Min(a int, b int) int {
	if a > b {
		return b
	}
	return a
}

func Max(a int, b int) int {
	if a > b {
		return a
	}
	return b
}

func MinA(arg ...int) int {
	var s = arg[0]
	for _, v := range arg {
		s = Min(s, v)
	}
	return s
}

func MaxA(arg ...int) int {
	var s = arg[0]
	for _, v := range arg {
		s = Max(s, v)
	}
	return s
}

func Abs(a int) int {
	if a < 0 {
		return a * -1
	}
	return a
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
#define FAST ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
 
#define MAXX 100005
 
#define PI 3.14159265358979323846264338327950
 
#define F first
#define S second
 
#define ll 	 long long int
 
#define mod  1000000007

map<string, int> m;




int main()
{
	FAST;
	ll a, b, c;
	cin >> a >> b >> c;
	if(a > b){
		swap(a, b);
	}
	if(c > a && b > c){
		cout << "Yes";
		return 0;
	}
	cout << "No";
	return 0;
}

Measured memory_bytes: 3620
s = list(input())
K = int(input())
AB = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m"\
    , "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
L = len(s)
Ans = ""
for i in range(L-1):
    if s[i] == "a": Ans += "a"
    else:
        move = 26 - AB.index(s[i])
        if move <= K:
            Ans += "a"
            K -= move
        else: Ans += s[i]

if s[L-1] == "a": Ans += AB[K%26]
else:
    move = 26 - AB.index(s[L-1])
    if move <= K:
        K -= move
        Ans += AB[K%26]
    else:
        Ans += AB[AB.index(s[L-1]) + K]
print(Ans)

Measured memory_bytes: 4152
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

S = sys.stdin.readline().rstrip()

ok = True
ok &= S[0] == 'A'
ok &= S[2:-1].count('C') == 1

if ok:
    orig = S
    cs = list(S.lower())
    cs[0] = 'A'
    cs[S.index('C')] = 'C'

    ok &= S == ''.join(cs)
    if ok:
        print('AC')
    else:
        print('WA')
else:
    print('WA')


Measured memory_bytes: 15192
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }


        static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            var N = Sarray()[0];
            var s = ReadLine();
            var t = ReadLine();
            for (var i = 0; i <= s.Length; ++i)
            {
                var cmp = s.Substring(0, i) + t;
                if(cmp.StartsWith(s) && cmp.EndsWith(t))
                {
                    WriteLine(cmp.Length);
                    return;
                }
            }
            //Out.Flush();
        }
    }
}

Measured memory_bytes: 13536
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";var r=n(1),i=new(n(2))(r.readFileSync("/dev/stdin","utf8").trim().split(/\s+/g));n(4)(i)},function(t,e){t.exports=require("fs")},function(t,e,n){"use strict";var r=n(3);t.exports=class{constructor(t){this.inp=new r(t)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(t,e,n){"use strict";t.exports=class{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=t.length,this.items=t,this.ind=0}enq(t){this.size+=1,this.items.push(t)}deq(){var t=this.items[this.ind];return this.size-=1,this.ind+=1,t}clear(){this.items=[],this.size=0,this.ind=0}}},function(t,e,n){"use strict";t.exports=function(t){for(var e=t.in(),n=new Array(e),r=new Map,i=0;i<e;i++)n[i]=t.in(),r[n[i]]=i%2;n.sort(function(t,e){return t-e});for(var o=0,s=0;s<e;s++)s%2!=r[n[s]]&&o++;o/=2,console.log(o)}}]);

Measured memory_bytes: 38736
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define cs ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;
using namespace std;
int main(){
    cs;
    map<int,int> p;
    ll c,t=0,a,k;
    cin>>c;
    vector<int> v(c);
    rep(i,c) {cin>>v[i];p[v[i]]++;}
    for(auto i:p) {
        a=i.second;
        if(a>=2) t+=a*(a-1)/2;
    }
    rep(i,c){
        if(i) cout<<"\n";
        a=p[v[i]];
        if(a>=2) k=t-(a*(a-1)/2);
        if(a>=3) k+=(a-1)*(a-2)/2;
        if(a<2) cout<<t;
        else cout<<k;
    }
}


Measured memory_bytes: 8320
L, R = map(int, input().split())
mod = 2019
ans = float('inf')

for i in range(L,R):
    for j in range(i+1, R+1):
        tmp = i*j%mod
        ans = min(ans, tmp)
        if tmp == 0:
            print(ans)
            exit()
print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll MOD = 1e9+7;

#define vec vector<int>
#define vecll vector<ll>
#define vpair vector<pair<int, int>>
#define vpairll vector<pair<ll, ll>>

#define rep(i,n)         for(int i=(int)0; i<(int)n; i++)
#define REP(i,m,n)       for(int i=(int)m; i<(int)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define prt(var)         cout << var << endl
#define prtd(n, var)     cout << fixed << setprecision(n) << var << endl
#define prt2(v1, v2)     cout << v1 << " " << v2 << endl
#define prt3(v1, v2, v3) cout << v1 << " " << v2 << " " << v3 << endl
#define prtall(var)      rep(i,var.size()){cout << var[i] << " ";} cout << endl

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

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

  double a_min, a_max, b_min, b_max;
  a_min = a/0.08;
  a_max = (a+1)/0.08;
  b_min = b/0.1;
  b_max = (b+1)/0.1;

  rep(i,1300){
    if(i>=a_min && i<a_max && i>=b_min && i<b_max){
      prt(i); return 0;
    }
  }

  prt(-1);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
int main() {
  int n; cin >> n;
  vector<char> s(n);
  rep(i, n) cin >> s.at(i);
  int cnt=0;
  rep(i, n-2){
    if(s.at(i)=='A'&&s.at(i+1)=='B'&&s.at(i+2)=='C') cnt++;
  }
  cout << cnt;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <cstring>
#include <set>
#include <utility>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#include <map>
#include <cmath>
#include <deque>
#include <bitset>
#define ll long long
#define PI 3.1415926535897932384626433832795
#define read(x) scanf("%d",&x);
#define readll(x) cin>>x;
#define FOR(x,a,b) for(int x=a;x<b;x++)
#define MP make_pair
#define PB push_back
#define pii pair<int,int>
#define readN(N,X) for(int i=0;i<N;i++) cin>>X[i];
#define pff pair<double,double>
using namespace std;

int N,M;
int a[200005];
priority_queue< pii, vector<pii>, greater<pii> > laginaik, naik, turun, kagi;

ll coba(int pos) {
	ll res=0;
	for (int i=1;i<N;i++){
		ll pas = res;
		if (a[i-1] < a[i]) { //naik
			if (pos > a[i])
   				res += (a[i] - a[i-1]);
   			else res+= min(a[i] - a[i-1], 1 + a[i] - pos);
   		} else{
   			if (pos <= a[i-1] && pos > a[i])
   				res += (M - a[i-1] + a[i]);
   			else if (pos <= a[i])
   				res += (1 + a[i] - pos);
   			else
   				res += min(M - a[i-1] + a[i] , M - pos + 1 + a[i]);		
   		}
   		//cout<<"  --> "<<res-pas<<endl;
	}
	return res;
}

int main(){
   std::ios::sync_with_stdio(false); 
   cin>>N>>M;
   readN(N,a);
   FOR(i,0,N) a[i]--;
   ll res = 0;
   
   for(int i=1;i<N;i++){
   		if (a[i-1] < a[i]) { //naik
   			naik.push({a[i-1], a[i]});
   			res += (a[i] - a[i-1]);
   		} else{
   			turun.push({a[i], a[i-1]});
   			res += (1 + a[i]);
   		}
   }
   //BF
   /*for (int i=0;i<M;i++){
   	cout<<i+1<<" : \n"<<coba(i)<<endl;
   }*/
  // cout<<res<<" : "<<coba(0)<<endl;
   int perma = 0;
   ll ans = res;
   for (int i=0;i<M;i++){

		while (naik.size() > 0 && naik.top().first < i) {
			//res += (naik.top().second - naik.top().first - 1);
			laginaik.push({naik.top().second, naik.top().first} );
			naik.pop();
		}
		while (laginaik.size() > 0 && laginaik.top().first <= i) {
			res += (laginaik.top().first - laginaik.top().second - 1);
			laginaik.pop();
		}
		while (turun.size() > 0 && turun.top().first <= i) {
			res += (M - turun.top().second + turun.top().first - 1);
			kagi.push({turun.top().second, 999999} );
			turun.pop();
		}
		while (kagi.size() > 0 && kagi.top().first < i) {
			kagi.pop();
			perma++;
		}

		//set to i
   		res -= turun.size();
   		res -= laginaik.size();
   		res -= perma;
   		ans = min(ans,res);
		//cout<<res<<" : "<<coba(i+1)<<endl;

   }
   cout<<ans<<endl;
}

//5 2



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

#define int long long

#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint,int> P1;
typedef pair<int,pint> P2;
typedef pair<pint,pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD=1000000007;
const ll INF=1e18;

int N,M;

long long extGCD(long long a, long long b, long long &x, long long &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    long long d = extGCD(b, a%b, y, x);
    y -= a/b * x;
    return d;
}

signed main() {
    std::cin >> N>>M;
    int x,y;
    extGCD(N,M,x,y);
    cout<<x<<" "<<y<<endl;



    return 0;
}



Measured memory_bytes: 3120
#include<iostream>
using namespace std;
int main(){
  int gold,change,count;
  while(cin>>gold){
    if(gold==0) break;
    change = 1000 - gold;
    count = 0;
    while(change!=0){
      if(change>=500){
	count++;
	change -= 500;
      }
      else if(change<500&&change>=100){
	count++;
	change -= 100;
      }
      else if(change<100&&change>=50){
	count++;
	change -= 50;
      }
      else if(change<50&&change>=10){
	count++;
	change -= 10;
      }
      else if(change<10&&change>=5){
	count++;
	change -= 5;
      }
      else if(change<5&&change>=1){
	count++;
	change -= 1;
      }
    }
    cout << count << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
time_of_A = [A[0]]
for i in range(1, N):
  time_of_A.append(time_of_A[i-1]+A[i])
B = list(map(int, input().split()))
time_of_B = [B[0]]
for i in range(1, M):
  time_of_B.append(time_of_B[i-1]+B[i])

book = [0]
for i in range(N):
  if time_of_A[i] <= K:
    book.append(i+1)
for i in range(M):
  if time_of_B[i] <= K:
    book.append(i+1)


start = M-1
for i in range(N):
  j = start
  time = 10 ** 9 + 1
  while time > K and j >= 0:
    time = time_of_A[i] + time_of_B[j]
    j -= 1
  if time <= K:
    book.append(i+j+3)
    j +=1
    start = j
  else:
    break
print(max(book))

Measured memory_bytes: 66632
import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

class Cake{
	BigInt x, y, z;
	BigInt v000, v001, v010, v011, v100, v101, v110, v111;
	this(string sx, string sy, string sz){
		x = BigInt(sx);
		y = BigInt(sy);
		z = BigInt(sz);
		v000 = x + y + z;
		v001 = x + y - z;
		v010 = x - y + z;
		v011 = x - y - z;
		v100 = -x + y + z;
		v101 = -x + y - z;
		v110 = -x - y + z;
		v111 = -x - y - z;
		}
	debug string toString(){
		return "x:" ~ x.to!string ~ " y:" ~ y.to!string ~ " z:" ~ z.to!string;
		}
	}

void main(){
	int n = read.to!int;
	int m = read.to!int;
	
	Cake[] cakes;
	foreach(i; 0 .. n){
		string[] s = readln.chomp.split;
		cakes ~= new Cake(s[0], s[1], s[2]);
		}
	
	debug cakes.writeln;
	
	BigInt ans = -1;
	BigInt sum;
	
	cakes.sort!"a.v000 > b.v000"();
	debug cakes.writeln;
	sum = 0;
	foreach(cake; cakes[0 .. m]) sum += cake.v000;
	if(ans < sum) ans = sum;
	debug writeln("sum:", sum, " ans:", ans);
	
	cakes.sort!"a.v001 > b.v001"();
	debug cakes.writeln;
	sum = 0;
	foreach(cake; cakes[0 .. m]) sum += cake.v001;
	if(ans < sum) ans = sum;
	debug writeln("sum:", sum, " ans:", ans);
	
	cakes.sort!"a.v010 > b.v010"();
	debug cakes.writeln;
	sum = 0;
	foreach(cake; cakes[0 .. m]) sum += cake.v010;
	if(ans < sum) ans = sum;
	debug writeln("sum:", sum, " ans:", ans);
	
	cakes.sort!"a.v011 > b.v011"();
	debug cakes.writeln;
	sum = 0;
	foreach(cake; cakes[0 .. m]) sum += cake.v011;
	if(ans < sum) ans = sum;
	debug writeln("sum:", sum, " ans:", ans);
	
	cakes.sort!"a.v100 > b.v100"();
	debug cakes.writeln;
	sum = 0;
	foreach(cake; cakes[0 .. m]) sum += cake.v100;
	if(ans < sum) ans = sum;
	debug writeln("sum:", sum, " ans:", ans);
	
	cakes.sort!"a.v101 > b.v101"();
	debug cakes.writeln;
	sum = 0;
	foreach(cake; cakes[0 .. m]) sum += cake.v101;
	if(ans < sum) ans = sum;
	debug writeln("sum:", sum, " ans:", ans);
	
	cakes.sort!"a.v110 > b.v110"();
	debug cakes.writeln;
	sum = 0;
	foreach(cake; cakes[0 .. m]) sum += cake.v110;
	if(ans < sum) ans = sum;
	debug writeln("sum:", sum, " ans:", ans);
	
	cakes.sort!"a.v111 > b.v111"();
	debug cakes.writeln;
	sum = 0;
	foreach(cake; cakes[0 .. m]) sum += cake.v111;
	if(ans < sum) ans = sum;
	debug writeln("sum:", sum, " ans:", ans);
	
	ans.writeln;
	}

Measured memory_bytes: 1276
#include <iostream>

using namespace std;

int main() {
	int n, v;
	long long dp[100][21] = { 0 };
	cin >> n >> v;
	dp[0][v] = 1;
	for (int i = 1; i < n - 1; i++) {
		cin >> v;
		for (int j = 0; j <= 20; j++) {
			if (j + v <= 20) {
				dp[i][j + v] += dp[i - 1][j];
			}
			if (j - v >= 0) {
				dp[i][j - v] += dp[i - 1][j];
			}
		}
	}
	cin >> v;
	cout << dp[n - 2][v] << endl;

	return 0;
}

Measured memory_bytes: 1180
#include <bits/stdc++.h>
using namespace std; 
#define int int64_t
#define itn int
#define fi first
#define se second 
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,k,b,ans=0,sum=0;
  vector<int> a;
  cin>>n>>k;
  for(int i=0;i<n;i++){
    cin>>b;
    a.push_back(b);
  }
  for(int i=0;i<k;i++){
    sum+=a[i];
  }
  for(int i=k;i<n;i++){
    if(sum<sum+a[i]-a[i-k]) cout<<"Yes\n";
    else cout<<"No\n";
  }
}
  


Measured memory_bytes: 5324
// D.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include<string>
#include<vector>


using namespace std;
int main()
{
    int x;

    cin >> x;

    if (x >= 30) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }

    return 0;
}


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

int partition(int A[], int p, int r) {
    int x, i, j;
    x = A[r];
    i = p-1;
    for (j = p; j < r; j++) {
	if (A[j] <= x) {
	    i++;
	    swap(A[i], A[j]);
	}
    }
    swap(A[i+1], A[r]);
    return i+1;
}

int main() {

    int n, i, res;
    cin >> n;
    int A[n];
    for (i = 0; i < n; i++) {
	cin >> A[i];
    }
    
    res = partition(A, 0, n-1);
    
    for (i = 0; i < res; i++) {
	cout << A[i] << " ";
    }
    cout << "[" << A[res] << "]";
    
    for (i = res+1; i < n; i++) {
	cout << " " << A[i];
    }
    cout << endl;

    return 0;
}

Measured memory_bytes: 1552
#include<iostream>
#include<string.h>
#include<ctype.h>
#include<string>
#include<math.h>
#define pi 3.141592653589
#include<iomanip>
using namespace std;
#include<algorithm>



int main(){
     
    string s1,s2,s3;
    char a,b,c;
    
    cin>>s1>>s2>>s3;
    a=s1[0];b=s2[0];c=s3[0];
    a=toupper(a);b=toupper(b);c=toupper(c);      
    cout<<a<<b<<c<<endl;
    
    return 0;
}
 

Measured memory_bytes: 256
/* 
Rohit645
Rohit Kumar 
*/

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

using ll = long long;
using db = double;
using pll = pair < ll, ll >;

#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template < typename Arg1 >
void __f(const char* name, Arg1&& arg1) {
	cerr << name << " : " << arg1 << std :: endl;
}
template < typename Arg1, typename... Args >
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << " | ";
	__f(comma + 1, args...);
}
#else
#define trace(...)
#endif

#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end() 
#define fastIo() ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0)

const int MOD = 1e9 + 7, INF = INT_MAX, N = 1e5 + 10;

int main() {
	fastIo();
	ll n; cin >> n;
	ll ans = 0;
	cout << (n*(n-1))/2 << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>
#include <assert.h>
#include <unordered_set>
#include <random>



using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)









int main(){
    ll a, b;
    cin >> a >> b;
    if((a == 1 && b == 2) || (a == 2 && b == 1)){
        cout << 3 << endl;
    }
    else if((a == 1 && b == 3) || (a == 3 && b == 1)){
        cout << 2 << endl;
    }
    else{
        cout << 1 << endl;
    }
}

Measured memory_bytes: 256
#pragma comment(linker, "/stack:247474112")
#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < n; ++i)
#define RANGE(i, x, n) for(ll i = x; i < n; ++i)
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;

void accelerate()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
}

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


Measured memory_bytes: 256
S = input()
N = len(S)

N_2 = (N+1) // 2 -1

if (N+1) % 4 == 0:
  N1 = N2 = (N+1) // 4 -1
  N3 = N4 = (N1+1) * 3 -1
else:
  N1 = (N-1) // 4 -1 
  N2 = N1 + 1
  N3 = N_2 + N1 +1
  N4 = N3 + 1
  
#print(N1, N2, N3, N4)
#print(S[0:N1+1], S[N2:N_2], S[N_2+1:N3+1], S[N4:N], S[0:N_2], S[N_2+1:N])

if S[0:N_2] == S[N_2+1:N][::-1] and S[0:N1+1] == S[N2:N_2][::-1] and S[N_2+1:N3+1] == S[N4:N][::-1]:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 3064
n = int(input())
l = [chr(h) for h in range(97,97+26)]
i = 1
j1 = 0
j2 = 0
s = ""
while 1:
  j1 = j2 + 1
  j2 += 26 ** i
  if j1 <= n <= j2:
    break
  i += 1
n -= j1
for k in range(i):
  n1 = int(n%26)
  s = l[n1] + s
  n = (n-n1) / 26
print(s)

Measured memory_bytes: 9184
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
    char a[105];
    char b[105];
    scanf("%s%s",a,b);
    if(strlen(a)<strlen(b))
       printf("LESS\n");
       else if(strlen(a)>strlen(b))
        printf("GREATER\n");
    else
    {
        if(strcmp(a,b)<0)
            printf("LESS\n");
        else if(strcmp(a,b)==0)
            printf("EQUAL\n");
        else
            printf("GREATER\n");
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int n,a=0,i;
	char s[100000];
	scanf("%d %s",&n,&s);
	for(i=0;i<n;i++){
		if(s[i]!=s[i+1]) a++;
	}
	printf("%d\n",a);
	return 0;
}


Measured memory_bytes: 1820