akhauriyash/Code-Regression huggingface dataset:
#include <vector>
#include <iostream>
#include <unordered_map>
#include <map>
#include <iomanip>
#include <functional>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <string>
#include <sstream>

using namespace std;

#define ll long long
#define d double
#define ld long double
#define pii pair<int,int>
#define wh(x) (x).begin(),(x).end()
#define ri(x) int x;cin>>x;
#define rii(x,y) int x,y;cin>>x>>y;
#define rl(x) ll x;cin>>x;
#define rv(v) for(auto&_cinv:v) cin>>_cinv;
#define wv(v) for(auto&_coutv:v) cout << _coutv << ' '; cout << endl;
#define ev(v) for(auto&_cerrv:v) cerr << _cerrv << ' '; cerr << endl;
#define MOD 1000000007

namespace std { 
template<typename T,typename U>struct hash<pair<T,U>>{hash<T>t;hash<U>u;size_t operator()(const pair<T,U>&p)const{return t(p.x)^(u(p.y)<<7);}};
}
template<typename T,typename F>T bsh(T l,T h,const F&f){T r=-1,m;while(l<=h){m=(l+h)/2;if(f(m)){l=m+1;r=m;}else{h=m-1;}}return r;}
template<typename T,typename F>T bsl(T l,T h,const F&f){T r=-1,m;while(l<=h){m=(l+h)/2;if(f(m)){h=m-1;r=m;}else{l=m+1;}}return r;}
template<typename T> T gcd(T a,T b) { if (a<b) swap(a,b); return b?gcd(b,a%b):a; }


int main(int,char**) {
    ios_base::sync_with_stdio(false);

    int N; cin >> N;
    ll T; ll A; cin >> T >> A;
    for (int i = 0; i < N-1; i++) {
        ll t; ll a; cin >> t >> a;
        ll mult = max((T-1) / t + 1, (A-1) / a + 1);
        T = mult * t;
        A = mult * a;
    }

    cout << A + T << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }

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

const int MOD = 1e9+7;
const int INF = 1e9;

ll gcd(ll a,ll b){
    if(b == 0) return a;
    return gcd(b, a%b);
}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

template<typename T> 
map<T,int> factorize(T x){
    map<T,int> mp;
    for (T i = 2; i*i <= x; i++){
        while (x%i == 0) {
            x /= i;
            mp[i]++;
        }
        if (x == 1) break;
    }
    if (x != 1) mp[x]++;
    return mp;
}


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll A,B;
    cin>>A>>B;
    ll g = gcd(A,B);
    vector<ll> cd;
    auto map = factorize(g);
    map[1]++;
    cout<<map.size()<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<set>
#include<stdio.h>
#include<ctype.h>
using namespace std;
int main()
{
	long long int n;
	cin >> n;
	vector<long long int> a(n);
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	long long int ans = 0;
	for (int i = 0; i < n; i++)
	{
		ans += a.at(i) - (i + 1);
	}
	cout << ans << endl;
}




Measured memory_bytes: 3624
# -*- coding: utf-8 -*-
S=input()

ref=["MON" ,"TUE" ,"WED" ,"THU", "FRI" ,"SAT" ,"SUN"]
x=0
for i in range(7):
    if S==ref[i]:
        x=7-i-1
if x==0:
    x=7
print(x)

Measured memory_bytes: 2940
import sys
from collections import deque

readline = sys.stdin.readline
s = deque(readline().strip())
n = int(readline())
q = sys.stdin.readlines()
reverse = False
for qi in q:
    if qi[0] == '1':
        reverse = not reverse
    else:
        c = qi[4]
        if qi[2] == '2':
            if reverse:
                s.appendleft(c)
            else:
                s.append(c)
        else:
            if reverse:
                s.append(c)
            else:
                s.appendleft(c)
if reverse:
    s = reversed(list(s))
print(''.join(s))


Measured memory_bytes: 22668
N,M = map(int, input().split())

ans = set([0])
cnt = [1] * N
for _ in range(M):
    x,y = [int(i) - 1 for i in input().split()]
    cnt[x] -= 1
    cnt[y] += 1

    if x in ans:
        if cnt[x] == 0:
            ans.remove(x)
        ans.add(y)

print(len(ans))

Measured memory_bytes: 12652
#include <stdio.h>
#include <stdlib.h>
#define MAXN 100

int cmp(const void *a, const void *b)
{
    return *(int *)a>*(int *)b? 1: -1;
}
int main(void)
{
    int i, n, min;
    int x[MAXN], sum, p;

    scanf("%d", &n);
    for(i=0; i<n; i++)
        scanf("%d", &x[i]);
    qsort(x, n, sizeof(x[0]), cmp);

    for(p=x[0]+1; p<x[n-1]-1; p++)
    {
        sum = 0;
        for(i=0; i<n; i++)
            sum += (x[i]-p)*(x[i]-p);
        if( p==x[0]+1 )
            min = sum;
        else if( sum<min )
            min = sum;
    }
    printf("%d", min);

    return 0;
}


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

int main() {

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

  int n, k;
  cin >> n >> k;

  vector<long long> h(n), dp(n, 1e15);
  dp[0] = 0;

  for (int i = 0; i < n; ++i) {
    cin >> h[i];
    for (int j = 1; j <= k && i-j >= 0; ++j)
      dp[i] = min(dp[i], dp[i-j] + abs(h[i] - h[i-j]));
  }

  cout << dp[n-1] << '\n';
}


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

int main() {
  int H,W;
  cin >> H>>W;
  
  vector<string> S(H);
  for(int i =0;i<H;i++){
    cin>>S.at(i);
    S.at(i).insert(0,"#");
    S.at(i).push_back('#');
  }
  string a;
  for (int i =0;i<W+2;i++){
    a.insert(0,"#");
  }
  cout<<a<<endl;
  for(int i=0;i<H;i++){
    cout<<S.at(i)<<endl;
  }
  cout<<a<<endl;
  
}


Measured memory_bytes: 256
N,K = map(int, input().split())
MOD = 10**9+7
def count(N, K):
    min =K*(K-1)/2
    max = (N-K+1)*K+min
    count_num = max-min+1
    K = K +1
    while K <=N+1:
        min = min + K-1
        max = max + N-K+1
        count_num = count_num + max-min+1
        K=K+1
    return count_num

print(int(count(N,K)%MOD))

Measured memory_bytes: 63264
N = int(input())
ary = [int(_) for _ in input().split()]


def bubble_sort(ary, verbose=True):
    flag = True
    count = 0

    while flag:
        flag = False
        i = 0

        for j in range(N - 1, i, -1):

            if ary[j] < ary[j - 1]:
                ary[j], ary[j - 1] = ary[j - 1], ary[j]

                flag = True
                count += 1

        i += 1

    print(' '.join([str(_) for _ in ary]))

    if verbose:
        print(count)


bubble_sort(ary)



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

#define FOR(i, j, k) for (int i = j; i < k; i++)
#define REP(i, j) FOR(i, 0, j)
typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;

#define MAXP 40000
#define MOD 1000000007

int exp_mod(long long a, long long b, int m) {
  long long res = 1;
  while (b > 0) {
    if (b & 1)
      res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return (int)res;
}

int fact_mod(int n, int m) {
  long long res = 1;
  for (int i = n; i > 0; --i)
    res = (res * i) % m;
  return (int)res;
}

int comb_mod(int n, int r) {
  long long res = 1;
  for (int i = 0; i < r; ++i)
    res = (res * (n - i)) % MOD;
  return (res * exp_mod(fact_mod(r, MOD), MOD - 2, MOD)) % MOD;
}

int main() {

  int N, M;
  cin >> N >> M;

  vi ps;
  ps.push_back(2);

  for (int i = 3; i < MAXP; i += 2) {

    bool b = true;
    for (auto p : ps) {
      if (i % p == 0) {
        b = false;
        break;
      }
    }

    if (b)
      ps.push_back(i);
  }

  map<int, int> m;
  for (auto p : ps) {

    while (M % p == 0) {
      m[p]++;
      M /= p;
    }
  }

  if (M > 1)
    m[M]++;

  ll ans = 1;
  for (auto p : m) {
    ans *= (ll)comb_mod(p.second + N - 1, p.second);
    ans %= MOD;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    string S;
    cin>>S;
    
    int maxv=0;
    int ans=0;
    int N=S.size();
    for(int i=0;i<N;++i){ 
        if(S[i]=='A'||S[i]=='G'||S[i]=='C'||S[i]=='T'){
                ans++;
        }
        else{
            maxv=max(maxv,ans);
            ans=0;
        }

    }

    maxv=max(ans,maxv); 
    cout<<maxv<<endl;

}

Measured memory_bytes: 256
a, b, c, d = map(int, input().split())

import fractions
def lcm(x, y):
  return x * y // fractions.gcd(x, y)

def yakusuu(c, d, n):
  return (n // c) + (n // d) - (n // lcm(c, d))

def yakusuu_igai(c, d, n):
  return n - yakusuu(c, d, n)

print(yakusuu_igai(c, d, b) - yakusuu_igai(c, d, a-1))

Measured memory_bytes: 63980
#include<stdio.h>
int main(void)
{
	int a,b,c,s;
	scanf("%d %d %d",&a,&b,&c);
	if(a>b){
			s=a;
			a=b;
			b=s;
	}
	if(b>c){
			s=b;
			b=c;
			c=s;
	}
	if(a>b){
			s=a;
			a=b;
			b=s;
	}
	printf("%d %d %d\n",a,b,c);
	return 0; 
}

Measured memory_bytes: 2728
#include <iostream>
#include <iomanip>
using namespace std;
#define rep(n) for(int i=0;i<n;i++)

double abs(double x){
	if(x>0) return x;
	else return -x;
}

int main(void){
	int q; cin >> q;
	rep(q){
		double xp0, yp0, xp1, yp1; cin>>xp0>>yp0>>xp1>>yp1;
		double xp2, yp2, xp3, yp3; cin>>xp2>>yp2>>xp3>>yp3;
		double a = yp0-yp1; double b = xp1-xp0; double k01 = xp0*yp1 - yp0*xp1;
		double c = yp2-yp3; double d = xp3-xp2; double k23 = xp2*yp3 - yp2*xp3;
		double adbc = a*d-b*c;
		double v[2] = {(k23*b - k01*d)/adbc, (k01*c - k23*a)/adbc};
		cout << fixed << setprecision(10) << v[0] << " " << fixed << setprecision(10) << v[1] << endl;
	}
}

Measured memory_bytes: 1292
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String ans="";
		for(int i=0; i<3;i++) {
			ans+=sc.next().substring(i,i+1);
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 23764
/* おまじない　*/
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
typedef long long ll;
typedef long double ld;
using namespace std;
const int MOD=pow(10,9)+7;
const ll INF=(1LL<<62);
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
void init(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout<<fixed;
}
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(a%b==0)return b;
    return gcd(a%b,b);
}
ll lcm(ll a,ll b){
    return a/gcd(a,b)*b;
}

int main(){
    init();
	ll ans=INF;
	ll A,B,C,X,Y;cin>>A>>B>>C>>X>>Y;
	for(ll i=0;i<pow(10,7);i++){
		ll num=0;
		//ABピザをiまい
		num+=2*i*C;
		if(X>=i)num+=A*(X-i);
		if(Y>=i)num+=B*(Y-i);
		ans=min(ans,num);
	}
	cout<<ans<<endl;
}

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

Measured memory_bytes: 1764
#include<iostream>
#include<string>
using namespace std;
void plusplus(string& s) {
	for (int i = 0; i < s.size(); i++) 
		if (s[i] != ' '&&s[i] != '.') {
			if (s[i] == 'z')s[i] = 'a';
			else s[i]++;
		}
	return;
}
int main() {
	string s;
	while(getline(cin, s)){
	for (int i = 0; i < 26; i++) {
		plusplus(s);
		if ((int)s.find("the") >= 0 || (int)s.find("this") >= 0 || (int)s.find("that") >= 0) break;
	}
	cout << s << endl;
}
	return 0;
}

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

int main() {
	string s;
	cin>>s;
	long long int ans=0;
	for(int i=0;i<s.length();i++){
		ans+=s[i]-'0';
	}
	if(ans%9==0){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
}

Measured memory_bytes: 3700
using System;

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var d = int.Parse(line[1]);
        var b = 2 * d + 1;
        Console.WriteLine((n + b - 1) / b);
    }
}


Measured memory_bytes: 11092
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<map>
#include<cstring>
#include<algorithm>
#define ll long long
#define Max(x,y) ((x) > (y) ? (x) : (y))
#define Min(x,y) ((x) < (y) ? (x) : (y))
#define Abs(x) ((x) > 0 ? (x) : -(x))
#define mod 1000000007
#define N 300010
using namespace std;
inline ll read(){
	ll x = 0,f = 1;char ch = getchar();
	while(ch < '0' || ch > '9'){if(ch == '-')f = -1;ch = getchar();}
	while(ch >= '0' && ch <= '9'){x = x*10+ch-'0';ch = getchar();}
	return x*f;
}

int n;
int q[N],head1,head2;

int main(){
	int n = read();
	q[100010] = read();
	head1 = 100010;
	head2 = 100010;
	for(int i = 1;i < n;i++){
		if(i&1) q[++head1] = read();
		else q[--head2] = read();
	}
	if(!(n&1)){
		for(;head1 >= head2;head1--)
			printf("%d ",q[head1]);
	}
	else{
		for(;head2 <= head1;head2++)
			printf("%d ",q[head2]);
	}
	puts("");
	return 0;
}

Measured memory_bytes: 2816
// AOJ 1367: Rearranging a Sequence
// 2017.10.9 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

typedef struct { int id, a; } T;
T tbl[200002];

int cmp(T *a, T *b) { return b->id - a->id; }

int main()
{
	int n, m, i, j;
	register T *p;

	scanf("%d%d", &n, &m);
	for (p = tbl+1, j = n, i = 1; i <= n; i++, p++) p->id = j--, p->a = i;
	while (m-- > 0) {
		scanf("%d", &j);
		tbl[j].id = i++;
	}
	qsort(tbl+1, n, sizeof(T), cmp);
	for (p = tbl+1, i = 1; i <= n; i++, p++) printf("%d\n", p->a);
	return 0;
}

Measured memory_bytes: 4436
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
 
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; }
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

vector< int > divisor(int64_t n) {
  vector< int > ret;
  for(int64_t i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

int main(){
    int n,m;cin>>n>>m;
    int ans=0;
    auto mdiv=divisor(m);
    for(auto au:mdiv){
        if((m/au)<n)continue;
        chmax(ans,au);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")

#include "bits/stdc++.h"

using namespace std;

#define pb push_back
#define F first
#define S second
#define f(i,a,b)  for(int i = a; i < b; i++)
#define endl '\n'
using ll = long long;
#define int ll
using db = long double;
using ii = pair<int, int>;

const int N = 1e5 + 5, LG = 19, MOD = 1e9+7;
const int SQ =320;
const long double EPS = 1e-7;
int n;
ll a[N], A, B;
int prv[2][N];
int dp1[N], dp2[N];
int sum1[N], sum2[N];
int32_t main(){
#ifdef ONLINE_JUDGE
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#endif

  cin >> n >> A >> B;

  f(i,1,n+1){
    cin >> a[i];
  }
  prv[0][1] = prv[1][1] = 1;
  f(i,2,n+1){
    if(a[i]-a[i-1]>=A)prv[0][i] = prv[0][i-1];
    else prv[0][i] = i;
    if(a[i]-a[i-1]>=B)prv[1][i] = prv[1][i-1];
    else prv[1][i] = i;
  }

  dp1[1] = dp2[1] = sum1[1] = sum2[1] = 1;
  int ans = 0;
  if(prv[0][n]==1)ans++;
  if(prv[1][n]==1)ans++;
  int r1 = 1, r2 = 1;
  f(i,2,n+1){
    while(a[r1]<=a[i]-A&&r1<i-1)r1++;
    while(a[r2]<=a[i]-B&&r2<i-1)r2++;
    int l1 = prv[1][i-1], l2 = prv[0][i-1];
    ///the tail has to be more than <= r and >= l
    if(l1<=r1){
      dp1[i] = sum2[r1] - sum2[l1-1];
      if(dp1[i]<0)dp1[i]+=MOD;
    }
    if(l2<=r2){
      dp2[i] = sum1[r2] - sum1[l2-1];
      if(dp2[i]<0)dp2[i]+=MOD;
    }
    sum1[i] = sum1[i-1] + dp1[i]; if(sum1[i]>=MOD)sum1[i]-=MOD;
    sum2[i] = sum2[i-1] + dp2[i]; if(sum2[i]>=MOD)sum2[i]-=MOD;

    if(prv[0][n] <= i){
      ans+=dp1[i];  if(ans>=MOD)ans-=MOD;
    }
    if(prv[1][n] <= i){
      ans+=dp2[i];  if(ans>=MOD)ans-=MOD;
    }
  }

  cout<<ans<<'\n';

  return 0;
}


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

void Main(){
    int n , k;
    cin >> n;
    cin >> k;
    int h[n];
    rep(i,n){
        cin >> h[i];
    }
    int ans = 0;
    rep(i, n){
        if(h[i] >= k) ans ++;
    }
    
    cout << ans << endl;
}
    
int main(){
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    
    Main();
    return 0;
}


Measured memory_bytes: 640
import java.util.*;

public class Main {
    public static void main(String[] args) {
      Scanner s = new Scanner(System.in);
        List<String> xList = new ArrayList<String>();
        for (int i = 0 ; i < 5 ;i++) {
            xList.add(s.next());
        }
        System.out.println(xList.indexOf("0") + 1);
    }
}

Measured memory_bytes: 26832
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#define SORT(c) sort((c).begin(),(c).end())
#define ANS(ans) cout<<(ans)<<endl;
typedef vector<int> VI;


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


int main() {

	string s;
	int k;
	cin >> s >> k;

	vector<char> t(s.size());

	REP(i, s.size()) {
		t[i] = s[i];
	}

	SORT(t);

	int i = 1;
	while (i < t.size()) {
		if (t[i] == t[i - 1]) {
			t.erase(t.begin() + i);
		}
		else {
			i++;
		}
	}



	vector<string> temp(0);


	REP(i, s.size()) {
		if (s[i] == t[0]) {
			string str = "";
			int n = s.size() - i;
			REP(j, min(5, n)) {
				str += s[i + j];
				temp.push_back(str);
			}

		}
		else if (s[i] == t[1]) {
			string str = "";
			int n = s.size() - i;
			REP(j, min(5, n)) {
				str += s[i + j];
				temp.push_back(str);
			}

		}
	}



	SORT(temp);

	i = 1;
	while (i < temp.size()) {
		if (temp[i] == temp[i - 1]) {
			temp.erase(temp.begin() + i);
		}
		else {
			i++;
		}
	}


	cout << temp[k - 1] << endl;




	return 0;
}



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

class Atcoder
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());

        var s = Console.ReadLine().ToArray();

        if (s.Length == 1)
            Console.WriteLine(1);
        else
        {
            int count = 0;
            for (int i = 1; i < s.Length; i++)
            {
                if (s[i - 1] != s[i]) count++;
            }

            Console.WriteLine(count+1);
        }
    }
}

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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

typedef long long ll;

/* --- INFやMODの値が適切か確認する --- */
// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
// const ll MOD = 1000000007;

int main() {
  int n, m;
  cin >> n >> m;
  priority_queue<int> pq;
  rep(i, n) {
    int a;
    cin >> a;
    pq.push(a);
  }
  rep(i, m) {
    int v = pq.top();
    pq.pop();
    pq.push(v / 2);
  }

  ll ans = 0;
  while (!pq.empty()) {
    ans += pq.top();
    pq.pop();
  }

  cout << ans << endl;
}


Measured memory_bytes: 892
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<vector>
#include<set>
#include<map>
#include<string>
 
using namespace std;
 
	long long dp[1<<16];
	int nr[1<<16];
	long long a[17][17];
	long long sum[1<<16];
	
	//long long pot16[16];
	
	string binarnizapis(int a){
		string s = "";
		for(int i = 0; i < 16; i++){
			if(a&(1<<i)) s+="1";
			else s+="0";
		}
		
		return s;
		
	}
	vector < int > veki;
 
int main(){
	
	for(int i = 0; i < (1<<16); i++)
		for(int j = 0; j < 16; j++)
			if(i&(1<<j)) nr[i]++;
 
	int n; cin >> n;
	for(int i = 0; i < n; i++)
		for(int j = 0; j < n; j++){
			cin >> a[i][j];
		}
		
	for(int i = 0; i < (1<<16); i++){
		for(int j = 0; j < 16; j++){
			for(int k = 0; k < j; k++){
				if(i&(1<<j) && i&(1<<k)) sum[i] += a[j][k];
			}
		}
		dp[i] = sum[i]; // sve za jednu grupu
	}	
	
	
//	cout << "pass" << endl;
		
		
	for(int j = 1; j < (1<<n); j++){
		
		
			
	//	cout << "-----------------------------" << endl;	
			
		veki.clear();
		for(int k = 0; k < n; k++)	if((j&(1<<k)) == 0) veki.push_back(k);
		
			
		for(int k = 1; k < (1<<(n - nr[j])); k++){
			
			int c_j = j;
			int idx = 0;
				
			for(int i = 0; i < veki.size(); i++){
				
				if(k&(1<<i)) c_j +=(1<<veki[i]);					
						
			}
			
	//		cout << k << endl;
	//		cout << binarnizapis(c_j) << " " << binarnizapis(j) << " " << binarnizapis(c_j^j) << endl;
	//		cout << dp[j] + dp[c_j^j] << " " << dp[c_j] << endl;
	//		system("pause");	
			
			dp[c_j] = max(dp[c_j],dp[j] + sum[c_j^j]);
					
		}
			
	}
	
	cout << dp[(1<<n)-1];
		
		
		
			
 
//	long long sum = 0;
//	for(int i = 0; i < (1<<16); i++){
//		sum += (1<<(16-nr[i]));
//	}
//
//	pot16[1] = 16;
//	for(int i = 2; i < 16; i++){
//		pot16[i] = 16*pot16[i-1]/i;
//	}
//
//	for(int i = 16; i >= 0; i--){
//		sum += (1<<i)*pot16[16-i];
//	}
//	
//	cout << sum << endl; 
 
 
 
 
 
	return 0;
}

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

public class Main {
  private static long solve(long a, long b, long c) {
    return Math.min(a + b + 1, c) + b;
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    long a = reader.nextLong();
    long b = reader.nextLong();
    long c = reader.nextLong();
    out.println(solve(a, b, c));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public int[] nextIntArray(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLongArray(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
}

class Algorithm {
  private static void swap(Object[] list, int a, int b) {
    Object tmp = list[a];
    list[a] = list[b];
    list[b] = tmp;
  }
  
  public static <T extends Comparable<? super T>> boolean nextPermutation(T[] ts) {
    int rightMostAscendingOrderIndex = ts.length - 2;
    while (rightMostAscendingOrderIndex >= 0 &&
        ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostAscendingOrderIndex + 1]) >= 0) {
      rightMostAscendingOrderIndex--;
    }
    if (rightMostAscendingOrderIndex < 0) {
      return false;
    }
    
    int rightMostGreatorIndex = ts.length - 1;
    while (ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostGreatorIndex]) >= 0) {
      rightMostGreatorIndex--;
    }
    
    swap(ts, rightMostAscendingOrderIndex, rightMostGreatorIndex);
    for (int i = 0; i < (ts.length - rightMostAscendingOrderIndex - 1) / 2; i++) {
      swap(ts, rightMostAscendingOrderIndex + 1 + i, ts.length - 1 - i);
    }
    return true;
  }
}



Measured memory_bytes: 21332
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;
 
int main() {
  int N, x, y, b, p; cin >>N;
  while(N--){
    cin >>x >>y >>b >>p;
    int sum = 0;
    if(b >= 5 && p >= 2) sum = (x * b + y * p) * 0.8;
    else{
      if(x * b + y * p <= (x * max(5, b) + y * max(2, p)) * 0.8) sum = x * b + y * p;
      else sum = (x * max(5, b) + y * max(2, p)) * 0.8;
    }
    cout <<sum <<endl;
  }
  return 0;
}

Measured memory_bytes: 1164
#include<iostream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define ll2(x, y) ll x, y; cin >> x >> y;
#define scn(n, a) rep(i, n)cin >> a[i]
#define sc2n(n, a, b) rep(i, n)cin >> a[i] >> b[i]
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << (x) << "\n"
#define debug2(x, y) cout << " --- " << (x) << " " << (y) << "\n"
#define debug3(x, y, z) cout << " --- " << (x) << " " << (y) << " " << (z) << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)

int a[10000];
int res[1000000];

signed main(void){
  int i, j;
  for(int testcase = 0;testcase >= 0;testcase++){
    int(n);
    scn(n, a);
    sort(a, a + n);

    int h = 0;
    rep(i, min(n, 10)){
      int tmp = a[i], d = 1;
      for(;;d *= 10)if(a[i] < d)break;
      rep(j, n)if(i != j)res[h++] = a[j] * d + a[i];
    }
    sort(res, res + h);
    pri(res[2]);

/*/

//*/ break;
  }
  return 0;
}

Measured memory_bytes: 3540
package main

import "fmt"

func main() {
	var n string
	fmt.Scan(&n)

	var ans string
	for i := 0; i < len(n); i++ {
		tmp := n[i : i+1]
		if tmp == "1" {
			ans += "9"
		} else {
			ans += "1"
		}
	}
	fmt.Println(ans)
}


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

#define pb push_back
#define mp make_pair
#define pf push_front
#define ff first
#define ss second
#define vll vector < ll >
#define vvll vector < vll >
#define vld vector < ld >
#define pll pair < ll,ll >
#define ppll pair < ll, pll > 
#define pld pair < ld,ld > 
#define vpll vector < pll >
#define vpld vector < pld >
#define all(X) X.begin(),X.end()
#define rall(X) X.rbegin(),X.rend()
#define endl "\n"
#define sz(x) ((ll)((x).size()))
vll emptyVector;
const ll MAX = 1e6 + 5;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const ld pi = 3.141592653589793238462643383279502884197169399375105;

ll binaryExpo(ll x, ll n)
{
	if(n == 0)
		return 1;
	if(n % 2 == 0)
		return binaryExpo((x*x) % MOD, n/2);
	return (x*binaryExpo((x*x) % MOD, n/2)) % MOD;
}

ll gcd(ll a, ll b)
{
	if(b == 0)
		return a;
	return gcd(b, a % b);
}
/*-------------------------------------------		CODE STARTS FROM HERE		------------------------------------------*/


void solve(void)
{
	ll a, b;
	cin >> a >> b;
	cout << a*b << endl;
	


}

int main(void)
{
	// ios_base::sync_with_stdio(false);
	// cin.tie(NULL);


	// int t;
	// cin >> t;
	// while(t--)
	{
		solve();
	}


	return 0;
}

Measured memory_bytes: 3632
/* Author - thiolhub */

#include <bits/stdc++.h>

using namespace std;

#define ll              long long int
#define ld              long double
#define db              double
#define pi              3.1415926535897932384626
#define PI              acos(-1.0)
#define endl            "\n"
#define mod             1000000007
#define mk              make_pair
#define pb              push_back
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(t)            ll t; cin>>t; while(t--)
#define sc(a)	        scanf("%lld",&a);
#define pr(a)	        printf("%lld\n",a)
#define f(i,a,n)		for(ll i=a;i<n;i++)
#define m(a)		    memset(a,0,sizeof(a))
#define FastIO          ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)

ll gcd(ll a,ll b)
{
	if(b==0) return a;
	return gcd(b,a%b);
}


int main(){ FastIO;

ll i,k,j,n,s=0;cin>>n;
for(i=1;i<=n;i++)
{
	for(j=1;j<=n;j++)
	{
		for(k=1;k<=n;k++)
		{
			int g=gcd(i,j);
			g=gcd(g,k);
			s+=g;
		}
	}
}
cout<<s;
return 0;
}


Measured memory_bytes: 3656
#include <stdio.h>
int main(void){
    // Your code here!
    int n,i,k=1,cnt=0;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++) scanf("%d",&a[i]);
    for(i=0;i<n;i++){
        if(k==a[i]) k++;
        else cnt++;
    }
    if(n==cnt) printf("-1");
    else printf("%d",cnt);
    return 0;
}


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

int main(){
  int n,k,q;
  cin>>n>>k>>q;
  map<int,int> mp;
  vector<int> pos(n+1);
  
  for(int i = 1; i <= q; i++){
    int t;cin>>t;
    mp[t]+=(i-(pos[t]+1));
    pos[t]=i;
  }
  q++;
  for(int i = 1; i <= n; i++){
    mp[i]+=(q-(pos[i]+1));
  }
  for(int i = 1; i <= n; i++){
    if(k>=q) cout<<"Yes"<<endl;
    else if(mp[i]>=k) cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
  }
  
}


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


int main(){
  int a,b;
  cin>>a>>b;
  int num=0;
  int coun=0;
  for(int i=a;i<=b;i++){
    if(i<0){
      coun++;
    }
  }
  if(a<=0&&b>=0){
    cout<<"Zero"<<endl;
  }
  else if(coun%2==0){
    cout<<"Positive"<<endl;
  }
  else {
    cout<<"Negative"<<endl;
  }
}
    
    
  
      

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

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  if(a == b && b == c) puts("Yes");
  else puts("No");
  return 0;
}


Measured memory_bytes: 256
num = int(input())

a = [int(x) for x in input().split()]

def plist(a):
    for i in range(len(a)):
        print(a[i],end="")
        if i < len(a)-1:
            print(" ",end="")
    print()
    
plist(a)
for i in range(1,num):
    tmp = a[i]
    j = i - 1
    while (j >= 0 and a[j] > tmp):
        a[j+1] = a[j]
        j -= 1
    a[j+1] = tmp
    plist(a)




Measured memory_bytes: 6316
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<utility>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#include<queue>
#include<set>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) std::cout<<arg<<"\n"
#define prin2(arg1,arg2) std::cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) std::memset(arg,n,sizeof(arg))
#define mp(a,b) std::make_pair(a,b)
#define pb push_back
using std::cin;
using std::abs;
typedef long long ll;
typedef std::pair<int,int> pi;
typedef std::vector<int> vi;
typedef std::set<int> si;
typedef std::string str;
const int INF=1e+9;
const ll INFLL=1e+17;
const ll MOD=1e+9+7;
int x,y;
int main(){
  cin>>x>>y;
  if(x>=0&&y>=0){
    if(x<y) prin(y-x);
    else if(x==y) prin(0);
    else{
      if(y==0) prin(x+1);
      else prin(x-y+2);
    }
  }
  else if(x>=0&&y<0) prin(abs(x+y)+1);
  else if(x<=0&&y>0) prin(abs(x+y)+1);
  else{
    if(x<y) prin(y-x);
    else if(x==y) prin(0);
    else prin(x-y+2);
  }
  return 0;
}


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

#define REP(i,init, n) for(lli i=init;i<n;i++)
#define REPE(i,init, n) for(lli i=init;i<=n;i++)
#define REPIT(it,container) for(auto it = container.begin(); it != container.end(); it++)
#define REPIT_R(it,container) for(auto it = container.rbegin(); it != container.rend(); it++)

#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

typedef long long int lli;
typedef pair<string, lli> P;

int main() {
    lli n;
    cin >> n;
    string s[n];
    lli p[n];
    vector <P> pr;
    REP(i, 0, n) {
        cin >> s[i] >> p[i];
        ostringstream sout;
        sout << std::setfill('0') << std::setw(3) << 999-p[i];
        string x = sout.str();
        s[i] += x;
        pr.push_back(P(s[i], i+1));
    }
    sort(pr.begin(), pr.end());
    REPIT(it,pr) {
        //cout << (*it).first << endl;
        cout << (*it).second << endl;
    }


}


Measured memory_bytes: 256
import java.io.PrintWriter

val br = System.`in`.bufferedReader()
val out = PrintWriter(System.out)

fun main() {
    br.use {
        out.use {
            solve()
            out.flush()
        }
    }
}


fun solve() {
    val n = readInteger()
    val aList = readLongList()

    var ans = ModInt(0)
    var e = ModInt(1)
    val two = ModInt(2)
    for (i in 0 until 60) {
        val countOne = aList.count { ((it shr i) and 1) == 1L }
        val countZero = aList.size - countOne
        ans += ModInt(countOne.toLong()) * ModInt(countZero.toLong()) * e
        e *= two
    }
    out.println(ans)
}

/** always positive number (Use for minus)
 * MODは素数（フェルマーの小定理を利用するため）
 */
class ModInt(x: Long, val MOD: Long = 1000000007L) {
    val x = ((x % MOD) + MOD) % MOD

    operator fun unaryMinus() = ModInt(-x, MOD)

    operator fun plus(other: ModInt): ModInt {
        var value = x + other.x
        if (value >= MOD) { value -= MOD }
        return ModInt(value, MOD)
    }

    operator fun minus(other: ModInt): ModInt {
        var value = x + MOD - other.x
        if (value >= MOD) { value -= MOD }
        return ModInt(value, MOD)
    }

    operator fun times(other: ModInt): ModInt {
        val value = (x * other.x) % MOD
        return ModInt(value, MOD)
    }

    operator fun div(other: ModInt) = this * other.inverse()

    override fun toString() = x.toString()


    /** O(log(n)) */
    private fun pow(n: Long): ModInt {
        var ret = ModInt(1L, MOD)
        var x = this
        var k = n
        while (k > 0) {
            if ((k and 1L) == 1L) { ret *= x }
            x *= x
            k = k shr 1
        }
        return ret
    }

    /**  O(log(MOD)) */
    private fun inverse() = pow(MOD - 2)
}

fun readInteger() = Integer.parseInt(br.readLine())
fun readLong() = java.lang.Long.parseLong(br.readLine())
fun readStringList() = br.readLine()!!.split(' ')
fun readIntegerList() = readStringList().map(Integer::parseInt)
fun readLongList() = readStringList().map(java.lang.Long::parseLong)
fun readDoubleList() = readStringList().map(java.lang.Double::parseDouble)


Measured memory_bytes: 82456
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

S = input()
N = len(S)
q = deque(S)

mod10 = [1]
for i in range(1, 200001):
    mod10.append(mod10[i - 1] * 10 % 2019)

S = S[::-1]
m = [0]
for i in range(N):
    c = int(S[i])
    n = (c * mod10[i] + m[i]) % 2019
    m.append(n)


modCnt = [0] * 2020

for num in m:
    modCnt[num] += 1

ans = 0
for i in modCnt:
    ans += i * (i-1) // 2

print(ans)


Measured memory_bytes: 103524
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <valarray>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <iomanip>
#include <map>
#include <set>
#include <list>
#include <limits>
#include <numeric>
#include <utility>
#include <deque>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#include <array>
#include <bitset>
#include <complex>
#include <string>
#include <tuple>
#include <random>

using namespace std;
using ll = long long;
const int INF = 1e9;
const ll MOD = 1e9 + 7;

int main()
{
  string s;
  cin >> s;
  ll ans = 0, tmp = 0;
  for (int i = 0; i < s.size() - 1; ++i)
  {
    if (s[i] == 'A')
      tmp++;
    else if (s[i] == 'B')
    {
      if (s[i + 1] == 'C')
      {
        ans += tmp;
        i++;
      }
      else
        tmp = 0;
    }
    else
      tmp = 0;
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 640
N = int(input())
S = input()

b = [0]*(N+1)
w = [0]*(N+1)

for i,s in enumerate(S):
    b[i+1] = b[i]
    if s == "#":
        b[i+1] += 1

for i,s in enumerate(S[::-1]):
    w[i+1] = w[i]
    if s == ".":
        w[i+1] += 1

w.reverse()

ans = float('inf')

for B,W in zip(b,w):
    if ans > B+W:
        ans = B+W
print(ans)

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

int main() {
  int n,x;
  cin >> n >> x;
  vector<int>a(n);
  rep(i,n) cin >> a[i];
  sort(a.begin(),a.end());
  int cnt = 0;
  rep(i,n-1){
    if(a[i] <= x){
      x -= a[i];
      cnt++;
    }
    else{
      cout << cnt << endl;
      return 0;
    }
  }
  if(a[n-1] == x) cnt++;
  cout << cnt << endl;
}

Measured memory_bytes: 256
s = input()
ls = len(s)
if s[0] == s[-1]:
    if ls % 2 == 0:
        ans = 'First'
    else:
        ans = 'Second'
else:
    if ls % 2 == 0:
        ans = 'Second'
    else:
        ans = 'First'
print(ans)

Measured memory_bytes: 3316
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cmath>
#include<vector>
#define FOR(i,a,b) for(int i=a;i<b;i++)
typedef long long ll;
using namespace std;
const int MOD = 1e9 + 7;

int N,L;
string a[100];
int main(void)
{
	cin >> N>>L;
	FOR(i, 0, N) {
			cin >> a[i];
	}
	sort(a, a + N);
	string ans;
	FOR(i, 0, N) {
		ans += a[i];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    if int(input()) < 1200:
        print("ABC")
    else:
        print("ARC")


main()


Measured memory_bytes: 5076
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,m,i,j=0,k,sum=0,a;
    cin>>m;
    cin>>n;
    cin>>k;
    for(i=1; i<=m; i++)
    {
        if(n!=0)
        {
            cout<<k<<" ";
            n--;
        }
        else
        {
            if(k==2)
            {
                cout<<3<<" ";
            }
            else if(k==1)
            {
                cout<<k+1<<" ";
            }
            else
            {
            cout<<k-1<<" ";
            }
        }
    }
}



Measured memory_bytes: 1280
#include <iostream>
#include <string>

int main() {
    int n;
    int ba = 0, _a = 0, b_ = 0, ans = 0;
    std::string s;
    std::cin >> n;
    for (int i=0; i<n; ++i) {
        std::cin >> s;
        for (int j=0; j<s.size()-1; ++j) {
            if (s[j] == 'A' && s[j+1] == 'B') ++ans;
        }
        if (s.front() == 'B' && s.back() == 'A') ++ba;
        else if (s.front() == 'B') ++b_;
        else if (s.back() == 'A') ++_a;
    }
    if (ba == 0) {
        ans += std::min(_a, b_);
    } else {
        if (b_ + _a > 0) {
            ans += ba + std::min(b_, _a);
        } else {
            ans += ba - 1;
        }
    }
    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 256
main=readLn>>=print.(\x->f x ([1,1,1,1,1,1]++(take 99 (repeat 0))))
 where f x l |x<100  =0
             |x<105  =1
             |x==105 =head l
             |otherwise = f (x-1) ((maximum(drop 99 (take 105 l))):l)

Measured memory_bytes: 8828
from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
ts=time.time()
sys.setrecursionlimit(10**6)
#input=sys.stdin.readline
show_flg=False
#show_flg=True

an=0
k=0
s=list(input())
n=len(s)
d=[['R','U','D'],['L','U','D']]
show(d[0],d[1])
for i in range(n):
    if s[i] in d[k]:
        show('OK')
    else:
        show('NG')
        an=1
    k=1-k
    
print(YN[an])


Measured memory_bytes: 39276
#include <algorithm>
#include <boost/optional.hpp>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <numeric>
#include <queue>
#include <sstream>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0, i##_MACRO = (n); i < i##_MACRO; i++)
#define RANGE(i, a, b) for(int i = (a), i##_MACRO = (b); i < i##_MACRO; i++)
#define EACH(e, a) for(auto&& e : a)
#define ALL(a) (a).begin(), (a).end()
#define AALL(a, n) (a), ((a) + (n))
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)
#define MODNUM (static_cast<int>(1e9 + 7))
#define MOD(x) ((x) % MODNUM)

using namespace std;

using ll = long long;
using VI = vector<int>;
using VI2D = vector<vector<int>>;

const int INF = 2e9;
const double EPS = 1e-10;
const double PI = acos(-1.0);

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

template <typename T>
int sign(T x) {
	return x < 0 ? -1 : x > 0 ? 1 : 0;
}

template <>
int sign(double x) {
	return x < -EPS ? -1 : x > EPS ? 1 : 0;
}

template <typename T>
T square(T x) {
	return x * x;
}

inline int toInt(string s) {
	int v;
	istringstream sin(s);
	sin >> v;
	return v;
}

int main() {
	ll n;
	scanf("%lld", &n);
	if(n & 1) {
		puts("0");
		return 0;
	}

	ll result = 0;
	ll div = 10;
	while(div <= n) {
		result += n / div;
		div *= 5;
	}
	printf("%lld\n", result);

	return 0;
}

Measured memory_bytes: 256
/* BISMILLAHIR RAHMANIR RAHIM */
#include<bits/stdc++.h>
using namespace std;
#define ll        long long
#define ull       unsigned long long
#define si(x)     scanf("%d", &x)
#define sll(x)    scanf("%lld", &x)
#define ssll(x,y)    scanf("%lld %lld", &x ,&y)
#define sd(x)     scanf("%lf", &x)
#define l0(i,n)   for(ll i=0; i<n; i++)
#define MAX       100005
#define maxn 	  200002
#define pb 		  push_back
#define mk 		  make_pair
#define endl	  "\n"
#define INF 	  1000000000
#define MOD		  1000000007
#define imie(...) "[" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

int main ()
{
		ios::sync_with_stdio(0);
		cin.tie(0);
		//CODE TONOY
		int n;
		cin >> n;
		int a[n];
		ll s = 0;
		for (int i=0 ; i<n ; i++)
		{
			cin >> a[i];
			s+=a[i];
		}
		ll check=s,sum=0;
		for (int i=0 ; i<n ; i++)
		{
			sum+=a[i];
			check=min(check,abs(sum-(s-sum)));
		}
		cout << check << endl;
		return 0;  
}  


Measured memory_bytes: 4404