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

using LL = long long;

int main(){
  LL N;
  cin>> N;
  
  for(LL i=sqrt(N);i>0;i--){
    if(N%i==0){
      i=N/i;
      int count=0;
      while(i>0){
        i/=10;
        count++;
      }
      cout << count << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 3676
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define FOR(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstr vector<string>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
const long long dx[4]={1,0,-1,0};
const long long dy[4]={0,1,0,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(15);

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

    int res=0;
    while(!pq.empty()){
        res+=pq.top();
        pq.pop();
    }
    cout<<res<<endl;

    
}

Measured memory_bytes: 5004
#include <stdio.h>

int a[4][13];//0である1でない//S,H,C,D
int cnt=0;
int i,j;
int main(void){
	for(i=0;i<4;i++){
		for(j=0;j<13;j++){
			a[i][j]=0;//持っていない
		}
	}
	scanf("%d",&cnt);
	
	for(i=0;i<cnt; i++){
		char c;
		int k;
		scanf(" %c %d",&c,&k);
		switch(c){
			case 'S':
				a[0][k-1]=1;
				break;
			case 'H':
				a[1][k-1]=1;
				break;
			case 'C':
				a[2][k-1]=1;
				break;
			case 'D':
				a[3][k-1]=1;
				break;
		}
	}
	
	for(i=0;i<4;i++){
		for(j=0;j<13;j++){
			if(a[i][j]==0){
				int jj=j+1;
				switch(i){
					case 0:
						printf("S %d",jj);
						break;
					case 1:
						printf("H %d",jj);
						break;
					case 2:
						printf("C %d",jj);
						break;
					case 3:
						printf("D %d",jj);
						break;
				}
				printf("\n");
			}
		}
	}
	return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename Q_temp>
using smaller_queue = priority_queue <Q_temp, vector<Q_temp>, greater<Q_temp> >;

const int INF = (int) 1e9;
const ll LINF = (ll) 4e18;
const ll MOD = (ll) (1e9 + 7);
const double PI = acos(-1.0);
const int limit = 100010;

#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbg2(x_) for(auto a_ : x_) cerr << a_ << " "; cerr << endl;
#define dbg3(x_ , sx_) rep(i, sx_) cerr << x_[i] << " "; cerr << endl;
vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

inline ll CEIL(ll a, ll b) {
    return (a + b - 1) / b;
}

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

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

    ld a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        ld x = round((c * e - b * f) / (a * e - b * d) * 1000.0) / 1000.0;
        ld y = round((c * d - a * f) / (b * d - a * e) * 1000.0) / 1000.0;
        if (x == -0.000) x = 0.000;
        if (y == -0.000) y = 0.000;
        cout << fixed << setprecision(3) << x << " " << y << endl;
    }

    return 0;
}




Measured memory_bytes: 3376
#include <iostream>
#include <cstring>
#include <cstdio>
#define maxn 200005

using namespace std;

int n,pre[maxn],S,T,cnt,dis[maxn],maxdis[maxn],fa[maxn],lp,lpdis;

struct edge
{
    int u,v,nex;
}e[maxn<<1];

void addedge(int u,int v)
{
    e[cnt].u=u; e[cnt].v=v; e[cnt].nex=pre[u];
    pre[u]=cnt++;
}

void dfs(int u,int father,int dep)
{
    dis[u]=dep; maxdis[u]=dep;
    fa[u]=father;
    if (lpdis<dis[u])
    {
        lp=u;
        lpdis=dep;
    }
    for (int i=pre[u];~i;i=e[i].nex)
    {
        int v=e[i].v;
        if (v==father) continue;
        dfs(v,u,dep+1);
        maxdis[u]=max(maxdis[u],maxdis[v]);
    }
}

int lca(int u,int v)
{
    while (u!=v)
    {
        if (dis[u]>dis[v]) u=fa[u];
        else v=fa[v];
    }
    return u;
}

int main()
{
    memset(pre,-1,sizeof(pre));
    scanf("%d%d%d",&n,&S,&T);
    for (int i=1;i<n;i++)
    {
        int u,v;
        scanf("%d%d",&u,&v);
        addedge(u,v);
        addedge(v,u);
    }
    dfs(T,-1,0);
    int ans=dis[S]-1+maxdis[S]-dis[S];
    int LCA=lca(S,lp);
    if (lpdis!=dis[S])
    {
        if (dis[LCA] > dis[S]-dis[LCA])
        {
            int rem=dis[LCA]-(dis[S]-dis[LCA]);

            ans=max(ans,dis[S]-dis[LCA]+rem-1+maxdis[LCA]-dis[LCA]);
        }
    }

    int cur=dis[S],tmp=0;
    while (cur>=1)
    {
        ans=max(ans,tmp+cur-1+maxdis[S]-dis[S]);
        cur-=2; tmp++; S=fa[S];
    }
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 12672
n = gets.chomp.to_i

university = []
4.times do |b|
  university[b] = []
  3.times do |f|
    university[b][f] = []
    10.times do |r|
      university[b][f][r] = 0
    end
  end
end


n.times do
  b, f, r, v = gets.chomp.split.map(&:to_i)
  university[b-1][f-1][r-1] += v
end


i = 4
university.each do |building|
  building.each do |floor|
    puts ' ' + floor.join(' ')
  end
  puts '#' * 20 unless (i -= 1).zero?
end

Measured memory_bytes: 6900
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<n; i++)
#define pb push_back
#define int long long
const int MOD = 1000000007;

signed main() {
    int N, C; cin >> N >> C;
    int A[N], B[N];
    rep(i, N) cin >> A[i];
    rep(i, N) cin >> B[i];
    
    int X[N][C+1];
    rep(i, N) rep(j, C+1) X[i][j] = 0;
    rep(i, N) {
        for (int j=A[i]; j<=B[i]; j++) {
            int v = 1;
            rep(k, C+1) {
                X[i][k] += v;
                X[i][k] %= MOD;
                v *= j;
                v %= MOD;
            }
        }
    }
    
    int dp[N+1][C+1];
    rep(i, N+1) rep(j, C+1) dp[i][j] = 0;
    dp[0][0] = 1;
    rep(i, N) rep(j, C+1) rep(k, j+1) {
        dp[i+1][j] += dp[i][j-k]*X[i][k];
        dp[i+1][j] %= MOD;
    }
    
    cout << dp[N][C] << endl;
}

Measured memory_bytes: 2816
#include <bits/stdc++.h>
#define rep3(i, s, n, a) for (int i = (s); i < (int)(n); i += a)
#define rep2(i, s, n) rep3(i, s, n, 1)
#define rep(i, n) rep2(i, 0, n)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;

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

    // sort(a.begin(), a.end());

    int gcd = a[0];
    vector<int> gcd1, gcd2;
    gcd1.push_back(gcd);
    rep2(i, 1, n-1){
        int A = a[i];
        while(A % gcd != 0){
            int tmp = A;
            A = gcd;
            gcd = tmp % gcd;
        }
        gcd1.push_back(gcd);
    }

    gcd = a[n-1];
    gcd2.push_back(gcd);
    rep2(i, 2, n) {
        int A = a[n-i];
        if(A < gcd){
            int tmp = A;
            A = gcd;
            gcd = tmp;
        }
        while (A % gcd != 0) {
            int tmp = A;
            A = gcd;
            gcd = tmp % gcd;
        }
        gcd2.push_back(gcd);
    }

    int res = gcd2[n-2];

    rep(i, n-2){
        int A = gcd1[i];
        int B = gcd2[n-3-i];
        if(A < B){
            int tmp = A;
            A = B;
            B = tmp;
        }
        while(A % B != 0){
            int tmp = A;
            A = B;
            B = tmp % B;
        }
        res = max(B, res);
    }

    res = max(gcd1[n-2], res);

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 4716
#include<stdio.h>
int main(void){
	int i,j;
	int n;
	int a[11][11]={{0}};
	while(scanf("%d",&n)){
		if(n==0){
			break;
		}
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				scanf("%d",&a[i][j]);
			}
		}
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				a[i][n]+=a[i][j];
				a[n][i]+=a[j][i];
			}
		}
		for(i=0;i<n;i++){
			a[n][n]+=a[n][i];
		}
		for(i=0;i<=n;i++){
			for(j=0;j<=n;j++){
				printf("%5d",a[i][j]);
				if(j==n){
					printf("\n");
				}
			}
		}
		for(i=0;i<=n;i++){
			for(j=0;j<=n;j++){
				a[i][j]=0;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 616
#include<stdio.h>
int main()
{
    int A,B,C,D;
    scanf("%d %d %d",&A,&B,&C);
    D=A+B;
    if(D>C)
    {
        printf("Yes");
    }
    else if(D==C)
    {
        printf("Yes");
    }
    else
    {
        printf("No");
    }
    return 0;
}


Measured memory_bytes: 128
using System;
using System.Linq; 

namespace Sample
{
  class Sample
  {
    static void Main(string[] args)
    {
	string[] str=Console.ReadLine().Split(' ');
      int L=int.Parse(str[0]);
      int R=int.Parse(str[1]);
      int d=int.Parse(str[2]);
      int ans=0;
      for(int i=L;i<=R;i++){
        if(i%d==0){
          ans++;
        }
      }
      Console.WriteLine(ans);
    }
    
  }

}

Measured memory_bytes: 27320
import math

N, D = map(int, input().split())
X = [None] * N
Y = [None] * N
count = 0

for i in range(N):
  X[i], Y[i] = map(int, input().split())

for i in range(N):
  if math.sqrt((abs(X[i]**2) + abs(Y[i]**2))) <= D:
    count += 1

print(count)

Measured memory_bytes: 24696
S = input()

if S == 'SUN':
    print(7)
    
if S == 'MON':
    print(6)
    
if S == 'TUE':
    print(5)
    
if S == 'WED':
    print(4)
    
if S == 'THU':
    print(3)
    
if S == 'FRI':
    print(2)
    
if S == 'SAT':
    print(1)

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i=0;i < (int)(n);i++)

int main(){
   string s,t;
   cin >> s >> t;
   if (s.size() < t.size()){
      cout << "UNRESTORABLE" << endl;
      return 0;
   }
   bool can = false;
   reverse(s.begin(),s.end());
   reverse(t.begin(),t.end());

   for (int i = 0;i < s.size()-t.size()+1;i++){
      bool f = true;
      for (int j = 0;j < t.size();j++){
         if (s[i+j] != t[j] && s[i+j] != '?') {
            f = false;
            break;
         }
      }
      if (f){
         for (int j = 0;j < t.size();j++){
            s[i+j] = t[j];
         }
         break;
      }
      if (i == s.size()-t.size() && !f){
         cout << "UNRESTORABLE" << endl;
         return 0;
      }
   }
   reverse(s.begin(),s.end());
   //reverse(t.begin(),t.end());
   for (int i= 0;i < s.size();i++){
      if (s[i] == '?') s[i] = 'a';
   }
   cout << s << endl;

   return 0;
   
}



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

int main() {
    int x, y;
    scanf("%d %d", &x, &y);
    int ans = INT_MAX;
    if (x <= y) ans = min(ans, y - x);
    if (-x <= y) ans = min(ans, y + x + 1);
    if (x <= -y) ans = min(ans, -y - x + 1);
    if (-x <= -y) ans = min(ans, -y + x + 2);
    printf("%d\n", ans);
    return 0;
}

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

int main() {
	int d, n;
	cin >> d >> n;
	int cok = 0;
	for(int i = 1; i < INF; i++){
		int num = i;
		int count = 0;
		while(num % 100 == 0){
			num /= 100;
			count++;
		}
		if(count == d) cok++;
		if(cok == n){
			cout << i << endl;
			return 0;
		}
	}
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

//long longのシフト演算には気をつけよう

ll a[100], p[100];

ll f(ll n, ll x){
    if(n == 0) return 1;

    if(x == 1) return 0;
    else if(x <= 1+a[n-1]) return f(n-1, x-1);
    else if(x == 2+a[n-1]) return p[n-1]+1;
    else if(x <= 2+2*a[n-1]) return p[n-1]+1 + f(n-1, x-2-a[n-1]);
    else return 2*p[n-1]+1;
}

int main(){
    ll n, x; cin >> n >> x;
    a[0] = 1, p[0] = 1;

    for(int i=1; i<=n; i++) a[i] = 2*a[i-1] + 3, p[i] = 2*p[i-1] + 1;

    cout << f(n, x) << endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using P   = pair<ll, ll>;
using mat = vector<vector<ll>>;

void IOS() { ios::sync_with_stdio(false), cin.tie(0); }

const ll INF = 1e16;
const ll MOD = 1e9 + 7;
const ld EPS = 1e-12;

template <typename T> void dump(T x) { cout << x << endl; }
void dumpf(ld x, int t) { cout << setprecision(t) << fixed << x << endl; }
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
	fill((T *)array, (T *)(array + N), val);
}

inline ll mod(ll a, ll b) {
	if (a > 0) return a % b;
	if (a % b == 0) return 0;
	ll x = -a / b + 1;
	a += x * b;
	return a % b;
}

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

int main() {
	IOS();
	ll k;
	cin >> k;
	vector<ll> a(50);
	for (int i = 0; i < 50; i++) {
		a[i] = i;
	}
	ll t = k % 50;
	for (int i = 0; i < t; i++) {
		for (int j = 0; j < 50; j++) {
			if (i == j)
				a[j] += 50;
			else
				a[j]--;
		}
	}
	for (int i = 0; i < 50; i++) {
		a[i] += k / 50;
	}
	dump(50);
	for (int i = 0; i < 50; i++) {
		if (i) cout << " ";
		cout << a[i];
	}
	cout << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <tuple>
#include <algorithm>

std::tuple<int, int, int> p[100000];

int main()
{
	int n, m;
	scanf("%d %d", &n, &m);

	for (int i = 0; i < m; ++i)
	{
		int a, b;
		std::get<0>(p[i]) = i;
		scanf("%d %d", &std::get<1>(p[i]), &std::get<2>(p[i]));
	}

	auto sort_py = [](auto a, auto b) -> bool
	{
		if (std::get<1>(a) == std::get<1>(b))
		{
			return std::get<2>(a) < std::get<2>(b);
		}
		else
		{
			return std::get<1>(a) < std::get<1>(b);
		}
	};
	std::sort(p, p + m, sort_py);

	long long id[100000];
	long long last = 0, nth = 1;
	for (int i = 0; i < m; ++i)
	{
		if (std::get<1>(p[i]) != last)
		{
			last = std::get<1>(p[i]);
			nth = 1;
		}
		id[std::get<0>(p[i])] = last * 1000000 + nth;
		nth++;
	}

	for (int i = 0; i < m; ++i)
	{
		printf("%012lld\n", id[i]);
	}

	return 0;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i < (ll)(n); i++)
const ll mo = 1000000007;
const ll INF = 1LL << 60; //MAX 9223372036854775807
ll ans = 0;

int main()
{
ll n,m;
cin >> n>>m;
vector<pair<ll,ll> > G[n+1];

rep(i, m)
{
    ll a,b,c;
    cin >> a>>b>>c;
    G[a].push_back(pair<ll,ll>(b, c));
}
ll cost[n+1];
rep(i,n+1){
    cost[i]=INF;
}

queue<ll> qq;
qq.push(1);
cost[1]=0;
ll cou=0,cou1=0;
while(!qq.empty()){
    ll p = qq.front();
    qq.pop();
    rep(i,G[p].size()){
        if(cost[G[p][i].first]==INF){
            cost[G[p][i].first]=G[p][i].second+cost[p];
            qq.push(G[p][i].first);
        }
        else{
            if(G[p][i].second+cost[p]>cost[G[p][i].first]){
            cost[G[p][i].first]=G[p][i].second+cost[p];
            if(cou1<10000000){qq.push(G[p][i].first);cou1++;}
            if(G[p][i].first==n)cou++;
            }
            if(n<cou){
                cout << "inf" << endl;
                return 0;
            }
        }
    }
}
cout << cost[n] << endl;
return 0;
}

Measured memory_bytes: 1408
package main

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

const (
	initialBufSize = 1e4
	maxBufSize     = 1e6 + 7
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

func main() {
	A, V, B, W, T := nextInt(), nextInt(), nextInt(), nextInt(), nextInt()
	if V <= W {
		fmt.Println("NO")
		return
	}
	d := abs(A - B)
	sd := V - W
	if d <= sd*T {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func abs(a int) int {
	if a > 0 {
		return a
	} else {
		return -a
	}
}

func pow(p, q int) int {
	res := p
	if q == 0 {
		return 1
	}
	for i := 0; i < q-1; i++ {
		res *= p
	}
	return res
}

func MinOf(vars ...int) int {
	min := vars[0]
	for _, i := range vars {
		if min > i {
			min = i
		}
	}
	return min
}

func MaxOf(vars ...int) int {
	max := vars[0]
	for _, i := range vars {
		if max < i {
			max = i
		}
	}
	return max
}

func gcdof2numbers(a int, b int) int {
	if b == 0 {
		return a
	}
	return gcdof2numbers(b, a%b)
}

func lcmof2numbers(a int, b int) int {
	return a / gcdof2numbers(a, b) * b
}

// マイナスの場合は考慮していない
func fuctorial(a int) int {
	if a == 1 || a == 0 {
		return 1
	} else {
		return fuctorial(a-1) * a
	}
}

func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}

// 素因数分解したmapを返す
func primeFuctorize(n int) map[int]int {
	pf := map[int]int{}
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			pf[i]++
			n /= i
		}
	}
	if n != 1 {
		pf[n]++
	}
	return pf
}


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

using namespace std;
char str1[110],str2[110];
int main() {
    int n;
    scanf("%d",&n);
    scanf("%s",str1);
    scanf("%s",str2);
    int ans = n+n;
    for(int i = 0;i<n;i++) {
        bool flag = false;
        for(int j = i,k = 0;j<n;j++,k++) {
            if(str1[j] != str2[k]) {
                flag = true;
                break;
            }
        }
        if(!flag) {
            ans -= (n-i);
            break;
        }
    }
    printf("%d\n",ans);
    return 0;

}


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

int main(){
  int n;
  string s;
  cin >> n >> s;
  
  int ans = 0;
  for(int i = 1; i < n; i++){
    int cnt = 0;
    string front = s.substr(0, i);
    string back = s.substr(i, n-i);
    set<char> k;
    for(auto n : front) k.insert(n);
    for(auto n : back){
      if(k.count(n)){
        cnt++;
        k.erase(n);
      }
    }
    ans = max(ans, cnt);
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    d = {"Sunny":1 , "Cloudy":2, "Rainy":0}
    a = ["Sunny", "Cloudy", "Rainy"]
    print(a[d[input().rstrip()]])
    return

#B
def B():
    s = S()
    for i, si in enumerate(s):
        if i % 2:
            if si == "R":
                print("No")
                return
        else:
            if si == "L":
                print("No")
                return
    print("Yes")
    return

#C
def C():
    n, k, q = LI()
    d = [0] * n
    for _ in range(q):
        a = II() - 1
        d[a] += 1
    for a in d:
        if k - (q - a) > 0:
            print("Yes")
        else:
            print("No")
    return

#D
def D():
    n,m = LI()
    a = LI()
    q = []
    for ai in a:
        heappush(q, -ai)
    for _ in range(m):
        heappush(q, heappop(q) / 2)
    ans = 0
    while q:
        ans += int(-heappop(q))
    print(ans)
    return

#E
def E():
    return

#F
def F():
    return

#Solve
if __name__ == '__main__':
    D()


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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()

void solve() {
  string s;
  cin >> s;
  string t = "keyence";
  if (s == t) {
    cout << "YES" << '\n';
    return;
  }
  for (int i = 0; i < s.size(); i++)
  for (int j = i; j < s.size(); j++) {
    string l = s;
    l.erase(i, j - i + 1);
    if (l == t) {
      cout << "YES" << '\n';
      return;
    }
  }
  cout << "NO" << '\n';
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) solve();
}


Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int N;
int A[200001];
int B[200001];
int ans[200001];
int main(){
	cin>>N;
	REP(i,N){
		cin>>A[i];
	}
	REP(i,N){
		cin>>B[i];
		ans[N-1-i]=B[i];
	}
	int b=20000000;
	int e=-1;
	REP(i,N){
		if(A[i]==ans[i]){
			b=min(i,b);
			e=max(i,e);
		}
	}
	if(e==-1){
		cout<<"Yes"<<endl;
		REP(i,N){
			cout<<ans[i];
			if(i==N-1){
				cout<<endl;
			}else{
				cout<<" ";
			}
		}
		return 0;
	}
	/*int now=ans[b];
	REP(i,N){
		if(now==ans[i]){
			b=min(i,b);
			e=max(i,e);
		}
	}*/
	int cc=0;
	int now=ans[b];
	REP(i,N){
		if((now!=ans[i])&&(A[i]!=now)){
			cc++;
		}
	}
	//cout<<e<<" "<<b<<endl;
	if(e-b+1>cc){
		cout<<"No"<<endl;
	}else{
		int bb=b;
		REP(i,b){
			if(bb>e)break;
			if((now!=ans[i])&&(A[i]!=now)){
				int temp=ans[bb];
				ans[bb]=ans[i];
				ans[i]=temp;
				bb++;
			}
		}
		for(int i=e+1;i<N;i++){
			if(bb>e)break;
			if((now!=ans[i])&&(A[i]!=now)){
				int temp=ans[bb];
				ans[bb]=ans[i];
				ans[i]=temp;
				bb++;
			}
		}
		/*
		int c=0;
		int bb=b;
		while(bb<=e){
			if(c==b){
				break;
			}
			int temp=ans[c];
			ans[c]=ans[bb];
			ans[bb]=temp;
			c++;
			bb++;
		}
		c=e+1;
		while(bb<=e){
			int temp=ans[c];
			ans[c]=ans[bb];
			ans[bb]=temp;
			c++;
			bb++;
		}
		*/
		cout<<"Yes"<<endl;
		REP(i,N){
			cout<<ans[i];
			if(i==N-1){
				cout<<endl;
			}else{
				cout<<" ";
			}
		}
	}
	return 0;
}

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

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif

int main()
{

    lint p, q, r;
    cin >> p >> q >> r;

    lint ans, tmp;
    ans = p + q + r - max(p, max(q, r));

    cout << ans <<"\n";

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
 
int main(){
    int n,x;
    while(1){
        cin >> n >> x;
        if(n == 0 && x == 0){
            break;
        }
        int p = 0;
        for(int i = 1;i < n-1;i++){
            for(int j = i + 1;j < n;j++){
                for(int k = j + 1;k <= n;k++){
                    if(i+j+k == x){
                        p += 1;
                    }
                }
            }
        }
        cout << p << endl;
    }
    return 0;
}

Measured memory_bytes: 1160
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
from fractions import gcd
from copy import deepcopy
import math
import queue
#import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys
sys.setrecursionlimit(100000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

def main(): #startline--------------------------------------------
    a,b,m = map(int,input().split())
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))
    xyc = [list(map(int,input().split())) for i in range(m)]
    cost = float("inf")
    for i in range(m):
        cost = min(cost,a[xyc[i][0]-1]+b[xyc[i][1]-1]-xyc[i][2])
    print(min(cost,min(a)+min(b)))
#endline===============================================
if __name__ == "__main__":
    main()

Measured memory_bytes: 108352
import fractions
from functools import reduce
def lcm_base(x,y):
    return (x*y) // fractions.gcd(x,y)

n = int(input())
li = []
for i in range(n):
    t = int(input())
    li.append(t)

g = reduce(lcm_base,li,1)
print(g)


Measured memory_bytes: 5052
N=int(input())
from collections import defaultdict
import math
d = defaultdict(int)
MOD=10**9+7
for i in range(N):
  a,b=map(int,input().split())
  x=math.gcd(abs(a),abs(b))
  if a==0:
    if b==0:
      k=(0,0)
    else:
      k=(0,1)
  elif b==0:
    k=(1,0)
  else:
    if a<0:
      a,b=-a,-b
    if b<0:
      a,b=a//x,-((-b)//x)
    else:
      a,b=a//x,b//x
    k=(a,b)
  d[k]+=1

ind=defaultdict(int)
index=1
_ans=[1]
for a,b in list(d.keys()):
  if a==b==0:
    continue
  if b<=0:
    _k=(-b,a)
  else:
    _k=(b,-a)
  if d[_k]==0:
    _ans[0]*=pow(2,d[(a,b)])
  else:
    if ind[_k]==0:
      _ans.append(pow(2,d[(a,b)],MOD))
      ind[(a,b)]=index
      index+=1
    else:
      _ans[ind[_k]]+=pow(2,d[(a,b)],MOD)-1
ans=1
for a in _ans:
  ans=ans*a%MOD
print((d[(0,0)]+ans-1+MOD)%MOD)

Measured memory_bytes: 81112
let () =
    let extgcd x y =
        let rec eg r0 r1 a0 a1 b0 b1 =
            if r1 = 0 then a0 else
                let q1 = r0 / r1 in
                eg r1 (r0 mod r1) a1 (a0 - q1 * a1) b1 (b0 - q1 * b1)
        in
        eg x y 1 0 0 1
    in
    let inv x y = (* 1/x in mod y *)
        let c = extgcd x y in
        if c < 0 then c + y else c
    in
    let z = 1_000_000_000 + 7 in
    let ( *@) a b = ((a mod z) * (b mod z)) mod z in
    let binomial a b =
        let rec loop i j acc =
            if j > b then acc else
                let acc = acc *@ i *@ inv j z in
                loop (i - 1) (j + 1) acc
        in
        loop a 1 1
    in
    Scanf.scanf "%d %d" (fun x y ->
        let r =
            if (2*x - y) mod 3 == 0 && (2*y - x) mod 3 == 0 then (
                let a = (2 * x - y) / 3 in
                let b = (2 * y - x) / 3 in
                if a >= 0 && b >= 0 then (
                    binomial (a + b) a
                ) else 0
            ) else 0
        in
        Printf.printf "%d\n" r
    )

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

const int m = 2019;

int main() {
    string s;
    cin >> s;
    int n = s.size();
    reverse(s.begin(), s.end());
    int x = 1;
    int total = 0;
    vector<int> cnt(m);
    ll ans = 0;
    for (int i = 0; i < n; i++) {
        cnt[total]++;
        total += (s[i] - '0')*x;
        total %= m;
        ans += cnt[total];
        x = 10*x%m;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3712
Imports System

Module Program
    Sub Main(args As String())

        Dim NXT() As Integer = Console.ReadLine().Split(" ").Select(Function(x) Integer.Parse(x)).ToArray()

        Dim kaisu As Integer = NXT(0) \ NXT(1)
        If NXT(0) Mod NXT(1) <> 0 Then
            kaisu += 1
        End If

        Dim ans As Integer = kaisu * NXT(2)

        Console.WriteLine(ans)

    End Sub
End Module


Measured memory_bytes: 28076
/* Coached by rainboy */
#include <stdio.h>

int main() {
	int n, i, k;

	scanf("%d", &n);
	k = 0;
	for (i = 0; i < n; i++) {
		int a;

		scanf("%d", &a);
		if (a == k + 1)
			k++;
	}
	printf("%d\n", k > 0 ? n - k : -1);
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define N 105
#define LL long long
#define end1 "\n"
#define sp " "
using namespace std;
int n,ar[N],tutmac[N],mn=INT_MAX;
char s[N],k;
int main()
{
	cin.tie(0);
	cout.tie(0);
	ios_base::sync_with_stdio(false);
	cin>>s+1;
	n=strlen(s+1);
	memset(tutmac,-1,sizeof(tutmac));
	for(int i=1;i<=n;i++)
	{
		if(ar[s[i]-'a']!=0)
			continue;
		int q=0;
		for(int j=1;j<=n;j++)
		{
			if(s[j]==s[i])
			{
				ar[s[i]-'a']=max(q,ar[s[i]-'a']);
				q=0;
				continue;
			}	
			q++;
		}	
		tutmac[s[i]-'a']=max(q,ar[s[i]-'a']);
		//~ cout<<ar[s[i]-'a']<<endl;
		//~ int tut=q;
		//~ tutmac=ar[]
		//~ if(tut>ar[s[i]-'a'])
		//~ ar[s[i]-'a']+=q;
		//~ else
			//~ tutmac[s[i]-'a']=tut+(ar[s[i]-'a']-tut)/2+((ar[s[i]-'a']-tut)%2);
		//~ cout<<i<<sp<<s[i]-'a'<<sp<<q<<sp<<ar[s[i]-'a']<<sp<<tutmac[s[i]-'a']<<endl;
	}
	for(int i=0;i<=26;i++)
	{
		//~ cout<<tutmac[i]<<sp;
		if(tutmac[i]!=-1)
		{
			mn=min(tutmac[i],mn);
			if(mn==tutmac[i])
				k=i+'a';
		}	
	}
	cout<<endl<<mn;
}	


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define F first
#define S second
const ll mod = 1e9 + 7;
const ll INF = 922337203685477;
#define pb push_back
#define deb(x) cout << '>' << #x << ':' << x << endl;
#define fastio ios_base::sync_with_stdio(0); cin.tie(0);
#define maxN 503
using namespace std;
int main(){
  fastio;
  ll x=0,n=0;
  cin>>x>>n;
  set<ll>s;
  for(ll i=0;i<n;++i){
    ll a=0;
    cin>>a;
    s.insert(a);
  }
  ll diff=INT_MAX;
  ll ans=0;
  for(ll i=1000;i>=(-1000);--i){
    if(s.find(i)==s.end() and abs(i-x)<=diff){
        diff=abs(i-x);
        ans=i;
    }
  }
  cout<<ans;
  return 0;
}


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

int main(){
    char a[4];cin>>a;
    sort(a,a+4);
    if(a[0]==a[1]&&a[2]==a[3]&&a[1]!=a[2])cout<<"Yes\n";
    else cout<<"No\n";
}


Measured memory_bytes: 256
H, W = map(int, input().split())
N = int(input())
an = list(map(int, input().split()))

line = []
ass = True
for i, a in enumerate(an, start=1):
    for j in range(a):
        line.append(i)
        if len(line) == W:
            if ass is False:
                ass = True
                line = reversed(line)
            else:
                ass = False
            print(' '.join(map(str, line)))
            line = []

Measured memory_bytes: 3188
#include <algorithm>
#include <cmath>
#include <vector>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <ctype.h>
#include <climits>
#include <queue>
#include <cassert>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i = 0; i < (ll)(n); ++i)
#define FOR(i, a, b) for(ll i=(a); i < (ll)(b); ++i)
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;}

int main(){
	int n;
	string s;
	cin >> n >> s;
	
	vector<int> B(n+1),W(n+1);
	// B[i]  [0,i)
	B[0] = 0;
	for(int i=0; i<n; i++){
		if(s[i]=='#'){
			B[i+1] = B[i] + 1;
		}else{
			B[i+1] = B[i];
		}
	}
	// W[i] [i, n-1]
	W[n] = 0;
	for(int i=n-1; i>=0; i--){
		if(s[i]=='.'){
			W[i] = W[i+1] + 1;
		}else{
			W[i] = W[i+1];
		}
	}
	
	int ans=n;
	REP(i,n+1){
		chmin(ans, B[i]+W[i]);
	}
	
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 5236
#include<iostream>

using namespace std;

int main()
{
	int n;
	cin >> n;
	int d[51];
	for (int i = 0; i < n; i++)
	{
		cin >> d[i];
	}
	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			if (i != j)
			{
				ans = ans + d[i] * d[j];
			}
		}
	}
	cout << ans/2 << endl;
}



Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define MAX 100000

int A[MAX], n;

int partition(int p,int r){
  int x = A[r];
  int i = p - 1;
  for(int 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 i, q;

  cin >> n;
  for(i = 0; i < n; i++)
    cin >> A[i];
  q = partition(0, n - 1);

  for(i = 0; i < n; i++){
    if(i)
      cout << " ";
    if(i == q)
      cout << "[";
    cout << A[i];
    if(i == q)
      cout << "]";
  }
  cout << endl;

  return 0;
}

Measured memory_bytes: 1548
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy

# 入力 =stdin.readline().rstrip()
# 分割 = stdin.readline().rstrip().split()

'''
条件に合うものを絞り込む
data = [1, 2, 3]
s = [x for x in data if x % 3 == 0]
'''

'''
文字配列を数値に
l_si = ['-10', '0', '100']

l_si_i = [int(s) for s in l_si]
'''

'''
a = [2, 4, 6, 8]
b = [3, 6, 9]

print(list(set(a) | set(b)))  # 和集合
print(list(set(a) & set(b)))  # 積集合
'''

'''
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
while len([x for x in A if x % 2 == 0]) == N:
    A = list(map(lambda y: y / 2, A))
    count += 1
print(count)
'''

'''
.append(要素)
.extend(要素)
.insert(場所,要素)
del 配列名[場所]
-1で末尾で末尾から一つ前
'''
'''
間に空白追加
' '.join(lis)
'''
'''
copy.copy(配列名)
'''
'''
sort()50
sorted(reverse=true)
'''
'''
2分探索
bisect.bisect_left(リスト, 要素)
'''


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors


num = int(stdin.readline().rstrip())
yaku = make_divisors(num)
yaku.sort()

res = []
if (int(len(yaku)) % 2 == 0):
    res.append(yaku[int(len(yaku) / 2 - 1)])
    res.append(yaku[int((len(yaku)) / 2)])
    print(int(res[0]-1)+int(res[1]-1))
else:
    res.append(yaku[int((len(yaku)) / 2)])
    print(int(res[0]-1)+int(res[0]-1))


Measured memory_bytes: 3756
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define MOD 1000000007
#define MAX(a,b) (a>b?a:b)
#define MAX3(a,b,c) MAX(a,MAX(b,c))
#define MIN(a,b) (a<b?a:b)
#define MIN3(a,b,c) MIN(a, MIN(b,c))
typedef long long lli;
int cmp(const void *a, const void *b) {
    return *(int*)a - *(int*)b;
}

int main()
{
    int i, n, q;
    char s[100000];
    int a[100001]={0};
    scanf("%d %d",&n, &q);
    scanf("%s",s);
    for(i=0; i<n-1; i++) {
        if(strncmp(s+i, "AC", 2)==0) {
            a[i+1] = a[i] + 1;
        } else {
            a[i+1] = a[i];
        }
        // printf("a[%d]=%d\n",i+1,a[i+1]);
    }
    for(i=0; i<q; i++) {
        int l, r;
        scanf("%d%d",&l, &r);
        int ans = a[r-1] - a[l];
        if(a[l]-a[l-1] == 1) ans++;
        printf("%d\n", ans);
    }
    return 0;
}


Measured memory_bytes: 1280
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
import bisect
import numpy as np

N = int(input())

if N % 10 in [2, 4, 5, 7, 9]:
    print("hon")
elif N % 10 in [0, 1, 6, 8]:
    print("pon")
elif N % 10 in [3]:
    print("bon")

Measured memory_bytes: 27128
#include <cstdio>
#include <algorithm>
 
int n,a,b;
long long v[55];
 
long long C(int n,int m)
{
    int count[55] = {0};
    long long z = 1;
    int i,j;
    if(m > n)
        return 0;
    for(i = n;i >= n - m + 1;--i)
        ++count[i];
    for(i = 1;i <= m;++i)
        --count[i];
    for(i = n;i >= 2;--i)
    {
        if(!count[i])
            continue;
        for(j = 2;j < i;++j)
        {
            if(i % j)
                continue;
            count[j] += count[i];
            count[i / j] += count[i];
            count[i] = 0;
            break;
        }
        while(count[i]--)
            z *= i;
        count[i] = 0;
    }
 
    return z;
}
 
int main(void)
{
    int i,j,k;
    long long q;
 
    //printf("%lld\n",C(50,25));
 
    scanf("%d %d %d",&n,&a,&b);
    for(i = 0;i < n;++i)
        scanf("%lld",&v[i]);
    std::sort(v,v + n);
 
    q = 0;
    for(i = n - 1;i >= n - a;--i)
    {
        if(i == n - 1 || v[i] != v[i + 1])
            j = 0;
        q += v[i];
        ++j;
    }
 
    k = j;
    for(i = i;i >= 0;--i,++j)
        if(v[i] != v[i + 1])
            break;
 
    printf("%lf\n",1.0 * q / a);
    q = 0;
    if(v[n - a] == v[n - 1]){
        for(a = a;a <= b;++a)
        {
            if(k > j)
                break;
            q += C(j,k);
            ++k;
        }
    }else{
        q = C(j,k);
    }
    printf("%lld\n",q);
}

Measured memory_bytes: 128
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#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 <ctime>
#include <unordered_map>
using namespace std;
typedef long long ll;
int main() {
	int a, b, c;
	cin >> a >> b >> c;
	printf("%s\n", (a + b + c) >= 22 ? "bust" : "win");
}

Measured memory_bytes: 256
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>
#include <iomanip>

using namespace std;

#define FOR(i, a, b) for(int (i)=(a);(i)<(b);(i)++)
#define IFOR(i, a, b) for(int (i)=(a);(i)<=(b);(i)++)
#define RFOR(i, a, b) for(int (i)=(a);(i)>=(b);(i)--)
#define REP(i, n) FOR((i), 0, (n))

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template<class T>
void print_container(T &container, string delim=" ") {
    bool first = true;
    for(auto &t: container){
        if(!first){
            cout << delim;
        }
        first = false;
        cout << t;
    }
    cout << endl;
}

int main() {
    int k, s;
    cin >> k >> s;
    
    int cnt = 0;
    IFOR(x, 0, k){
        int r = s - x;
        if(r < 0 || r > 2 * k)
            continue;
        // (0, r) ~ (r, 0)
        // or (r-k, k) - (k, r-k)
        if(r > k){
            cnt += 2*k-r+1;
        }
        else{
            cnt += r+1;
        }
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
//#include "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <queue>
#include <algorithm>
#include <functional>
#include <string>
#include <bitset>

#define ll long long
#define fri(n) for(i=0;i<(n);i++)
#define frj(n) for(j=0;j<(n);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
#define INF 1000000000000000000//10^18
#define INFINT 2000000001//2*10^9+1
#define MOD 1000000007
#define MODANOTHER 998244353
#define PI acos(-1)

using namespace std;

ll int mod_inverse(int a,int M){
	int x=M-2;
	ll int temp=a;
	ll int ret=1;
	//a^(MOD-1)==1(mod MOD)を利用
	//a^-1==a^(MOD-2) (mod MOD)を繰り返し二乗法で求める

	while(x!=0){
		if(x%2==1){
			ret=(ret*temp)%M;
		}
		temp=(temp*temp)%M;
		x=x/2;
	}
	return ret;
}

int main(void)
{
	//変数の宣言
	int n,a,b,c;
	char s[20];

	//よく使う変数
	int i,j,k,l;
	int flag=0;
	ll int ans=0;
	int count=0;
	ll int temp=0;
	ll int temp1=0;
	ll int temp2=0;
	int temp3=0;
	int max=0;
	int min=INFINT;
	int len=0;
	ll int sum=0;
	int ok=0;
	int ng=0;
	char dummy;
	char stemp[11];
	ll antisum;

	//データの読み込み


	scanf("%s",&s);
//	scanf_s("%s",&s,20);

//	scanf("%s",&s);
//	scanf_s("%s",&s,5);


/*	for(i=0;i<n;i++){
//		scanf("%d",&s[i]);
		scanf_s("%d",&s[i]);
	}*/


/*	for(i=0;i<m;i++){
//		scanf("%d",&p[i]);
		scanf_s("%d",&p[i]);
	}*/

	//	printf("nは%dです\n", n);
	//	printf("データの読み込み終了\n");
	//実際の処理

	len=strlen(s);
	for(i=0;i<len;i++){
		if(s[i]=='x'){
			count++;
		}
	}

	//	printf("計算部分終了\n");

	//出力
	if(count<=7){
		printf("YES");
	}else{
		printf("NO");
	}

//	printf("\n mod_inverse(93/16)=%lld",5*mod_inverse(8,MOD)%MOD);
	//	printf("結果の出力終了\n");

	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <bitset>
#include<iomanip>//小数点以下を精度良く表示

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define INF 2000000000
#define INF2 1000000000000000000
#define rep(i,n) for(int i=0;i<(n);i++)
typedef pair<int, int> P;
const ll MOD=1000000007;
using Graph = vector<vector<int>>;


template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
int up(int a, int b) {
    return (a + a % b) / b;
}

void swap(string s) {
    int low = 0;
    int high = s.length()-1;
    while (low < high) {
        char tmp = s[low];
        s[low] = s[high];
        s[high] = tmp;
        low++;
        high--;
    }
}

template<class T>  T gcd(T a, T b) {
    while (a % b != 0) {
        T tmp = b;
        b = a % b;
        a = tmp;
    }
    return b;
}

template<class T> T lcm(T a, T b) {
    if (a == b) return b;
    T g = gcd(a, b);
    return (a / g) * b;
}


int main(){
    int k;
    cin >> k;
    ll ans = 0;
    for (int a = 1; a <= k; a++) {
        for (int b = 1; b <= k; b++) {
            int p = gcd(a, b);
            for (int c = 1; c <= k; c++) {
                ans += gcd(p, c);
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3636
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	private int[][] paper = new int[10][10];

	public static void main(String[] args) {
		new Main().run();
	}
	
	private void run() {
		Scanner scan = new Scanner(System.in);
		
		for (int i = 0; i < 10; i++) Arrays.fill(paper[i], 0);
		
		while (scan.hasNext()) {
			String str = scan.nextLine();
			int x = Integer.parseInt(str.substring(0, 1));
			int y = Integer.parseInt(str.substring(2, 3));
			int s = Integer.parseInt(str.substring(4, 5));
			
			if(!out(x, y)) paper[x][y]++;
			if (s == 3) {
				large(x,y);
			}else if (s == 2) {
				medium(x, y);
			}else {
				small(x, y);
			}
		}
		int count = 0, max = -1;
		for (int i = 0; i < 10; i++) {
			for (int j = 0; j < 10; j++) {
				if (paper[i][j] == 0) count++;
				max = Math.max(max, paper[i][j]);
			}
		}
		System.out.println(count);
		System.out.println(max);
		
	}
	
	private void large(int x, int y) {
		medium(x, y);
		if(!out(x, y - 2)) paper[x][y - 2]++;
		if(!out(x, y + 2)) paper[x][y + 2]++;
		if(!out(x - 2, y)) paper[x - 2][y]++;
		if(!out(x + 2, y)) paper[x + 2][y]++;
	}
	
	private void medium(int x, int y) {
		small(x, y);
		if(!out(x - 1, y - 1)) paper[x - 1][y - 1]++;
		if(!out(x - 1, y + 1)) paper[x - 1][y + 1]++;
		if(!out(x + 1, y - 1)) paper[x + 1][y - 1]++;
		if(!out(x + 1, y + 1)) paper[x + 1][y + 1]++;
	}
	
	private void small(int x, int y) {
		if(!out(x, y - 1)) paper[x][y - 1]++;
		if(!out(x, y + 1)) paper[x][y + 1]++;
		if(!out(x - 1, y)) paper[x - 1][y]++;
		if(!out(x + 1, y)) paper[x + 1][y]++;
	}
	
	private boolean out(int x, int y) {
		if (x >= 0 && y >= 0 && x < 10 && y < 10) {
			return false;
		}else {
			return true;
		}
	}
	
	private void debug() {
		System.out.println();
	}

}

Measured memory_bytes: 17320
#include<stdio.h>

int main(void)
{
	int N = 0;
	int loop_count = 0;
	int min_num = 0;
	int temp = 0;

	scanf("%d",&N);

	int slime_color[N];
	int flag = 0;

	for(loop_count = 0;loop_count < N;loop_count++)
	{
		scanf("%d",&slime_color[loop_count]);
	}

	//最低個数判定フラグ
	for(loop_count = 0;loop_count+1 < N;loop_count++)
	{
		if(slime_color[loop_count] == slime_color[loop_count+1])
		{
			if(flag == 0)
			{
				flag = 1;
			}
			temp += 1;
		}else{
			if(flag == 1)
			{
				flag = 0;
				if((temp % 2) == 1)
					{
						min_num += (temp / 2)+1;
					}else
					{
						min_num += (temp / 2);
					}
				temp = 0;
			}
		}
	}
	if((temp % 2) == 1)
	{
		min_num += (temp / 2)+1;
	}else
	{
		min_num += (temp / 2);
	}

	printf("%d",min_num);
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <array>
using namespace std;
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;
#define rep(i, n) for(UL i = 0; i < (n); i++)

struct Problem {

	void Solve() {
		UL N; cin >> N;
		vector<UL> A(N); rep(i, N) cin >> A[i];
		rep(i, N) A[i]--;
		UL ans = 0;
		rep(i, N) if (A[A[i]] == i) ans++;
		cout << (ans / 2) << endl;
	}


	Problem();
};
int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}
Problem::Problem() {
	cout << fixed << setprecision(10);
}


Measured memory_bytes: 640
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <cstring>
#include <iostream>
#include <algorithm>

#define fi first
#define se second
#define pb push_back
#define MP std::make_pair
#define PII std::pair<int, int>
#define all(x) (x).begin(), (x).end()
#define CL(a, b) memset(a, b, sizeof a)
#define rep(i, l, r) for (int i = (l); i <= (r); ++ i)
#define per(i, r, l) for (int i = (r); i >= (l); -- i)
#define PE(x, a) for (int x = head[a]; x;x = edge[x].next)

typedef long long ll;

int main() {
	int a, b;
	scanf("%d %d", &a, &b);
	int ans = 6;
	printf("%d\n", ans - a - b);
	return 0;
}

Measured memory_bytes: 256
def main():
    c = []
    rev_c = []
    N = 2
    for i in range(N):
        s = input()
        c.append(s)
    
    #print(c)
    #print(c[0][::-1])
    #print(c[1][::-1])
    
    for str_ in c:
        rev_c.append(str_[::-1])
    rev_c= rev_c[::-1]
    #print(rev_c)
    
    if(c == rev_c):
        print("YES")
    else:
        print("NO")
    
if __name__=="__main__":
    main()

Measured memory_bytes: 3064