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

int main() {
  int N, M;
  cin >> N >> M;
  vector<bool> accepted(N, false);
  vector<int> wrong(N, 0);
  for(int i = 0; i < M; i++) {
    int p;
    string s;
    cin >> p >> s;
    if(s == "AC") {
      if (!accepted.at(p - 1)) {
        accepted.at(p - 1) = true;
      }
    }
    else {
      if(!accepted.at(p - 1)) {
        wrong.at(p - 1)++;
      }
    }
  }
  int count = 0;
  int penalty = 0;
  for(int i = 0; i < N; i++) {
    if(accepted.at(i)) {
      count++;
      penalty += wrong.at(i);
    }
  }
  cout << count << " " << penalty << endl;
}

Measured memory_bytes: 640
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
#include <list>
#include <fstream>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> PI;
typedef vector<int> vi;
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define F first
#define S second


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

main(){
  int n,w;
  while(cin>>n>>w,n|w){
    int maxa=0;
    int v[n];
    rep(i,n){
      cin>>v[i];
      maxa=max(maxa,v[i]);
    }

    vector<int> hist(maxa/w+1);

    int hei=0;

    rep(i,n){
      int t=++hist[v[i]/w];
      hei=max(t,hei);
    }


    double ans=0.01;
    int wi=maxa/w+1;

    rep(i,wi){
      ans+=(1-1.0*i/(wi-1))*hist[i]/hei;
    }
    printf("%.6f\n",ans);
  }
}

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

#define o(output) cout << output << endl

using namespace std;

string s,t,u;
int a,b,c,d;
int l[13]={0,1,3,1,2,1,2,1,1,2,1,2,1};
char A,B,C;
priority_queue<int,vector<int>,greater<int> >small;

int main(){
  cin >>a;
  o(a*800-a/15*200);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;
	scanf("%d%d",&a,&b);
	if(a!=1&&b!=1)puts("1");
	if(a!=2&&b!=2)puts("2");
	if(a!=3&&b!=3)puts("3");
}

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

int main(){
    string s;
    cin >> s;
    int k = 101;
    int l = -1;
    for(int i=0; i<s.size(); i++){
        if(s[i] == 'C' && l < k) k = i;
        else if(s[i] == 'F' && l < k) l = i;
    }
    if(k<l) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
const long long MOD = 1000000007;
const int INF = 1<<29;
const double EPS = 1e-8;
typedef vector<int> vec;
typedef pair<int,int> P;
typedef long long ll;
 
int main(){
    int N, M, Q;
    cin >> N >> M >> Q;

    vec a(Q);
    for(int i = 0; i < Q; i++){
        cin >> a[i];
        a[i]--;
    }

    vector<bool> used(M, false);
    vec que(M + 1, 0);
    vec next(M, -1);
    int prev = -1;

    que[M] = N - 1;

    for(int p = Q - 1; p >= 0; p--){
        if (que[a[p]] > 0){
            que[a[p]]--;
            if(next[a[p]] != -1){
                assert(0 <= next[a[p]] && next[a[p]] < M);
                que[next[a[p]]]++;
            }else{
                que[M]++;
            }
        }else{
            if(!used[a[p]]){
                used[a[p]] = true;
                if(prev >= 0) next[prev] = a[p];
                prev = a[p];
                que[a[p]] += que[M];
                que[M] = 0;
            }
        }
    }

    for(int i = 0; i < M; i++){
        if(!used[i]){
            used[i] = true;
            if(prev >= 0) next[prev] = i;
            prev = i;
            que[i] += que[M];
            que[M] = 0;
        }
        if(que[i] > 0){
            if(next[i] != -1){
                assert(0 <= next[i] && next[i] < M);
                que[next[i]] += que[i];
            }else{
                que[M] += que[i];
            }
        }
    }

    if(que[M] == N - 1){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 1408
#include<string>
#include<iostream>
#include <math.h>
using namespace std;

int main()
{
   int N,D;
   long x,y;
   int count=0; 
   cin>>N>>D;
   for(int i=0;i<N;i++){
    cin>>x>>y;
       if(sqrt(x*x+y*y)<=D){
         count++;
       }
    }
  cout<<count;
  return 0;
}

Measured memory_bytes: 3608
#include<iostream>

using namespace std;

#define HMAX 50
#define WMAX 50
#define INF 100000000

int main(void){

	int H,W;
	int h,w;
	int a,b,c;
	int A[HMAX][WMAX],B[HMAX][WMAX],C[HMAX][WMAX];
	bool f;
	int sco,max;

	cin>>H>>W;

	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			cin>>A[i][j];
		}
	}

	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			cin>>B[i][j];
		}
	}

	cin>>h>>w;

	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			cin>>C[i][j];
		}
	}

	max=INF*-1;
	for(int i=0;i<=H-h;i++){
		for(int j=0;j<=W-w;j++){
			f=true;
			sco=0;
			for(int k=0;k<h&&f;k++){
				for(int l=0;l<w&&f;l++){
					///cout<<A[i+k][j+l]<<","<<B[i+k][j+l]<<","<<C[k][l]<<endl;
					if(B[i+k][j+l]==C[k][l]){
						sco+=A[i+k][j+l];
					}
					else{
						f=false;
					}	
				}
			}
			if(f){
				if(max<sco) max=sco;
			}
		}
	}

	if(max!=-1*INF) cout<<max<<endl;
	else cout<<"NA"<<endl;

}


Measured memory_bytes: 1188
import java.util.*;
public class Main {
	public static void main(String[] args){
       Scanner sc = new Scanner(System.in);
      
      //文字列Sの取得
      String S = sc.nextLine();
      //文字列Tの取得
      String T = sc.nextLine();
 
      //置き換え回数
      int count = 0;
      
      for (int i = 0; i < S.length(); i++) {
            char s = S.charAt(i);
            char t = T.charAt(i);
            
            if (!(s == t)) {
               count++;
            }
      }
 
		System.out.println(count);
    }
}

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

const int MAX = 110;
int N;
bool flag;
int A[MAX];
int cnt;

void Swap(int &a, int &b)
{
	int tmp = a;
	a = b;
	b = tmp;
}
int main()
{
	cin >> N;
	for (int i = 0; i < N; ++i) cin >> A[i];
	flag = true;
	int isSorted = 0;
	while (flag)
	{
		flag = false;
		for (int i = N - 1; i > isSorted; --i)
		{
			if (A[i] < A[i - 1])
			{
				Swap(A[i], A[i - 1]);
				cnt++;
				flag = true;
			}
		}
		isSorted++;
	}
	for (int i = 0; i < N; ++i)
	{
		if (i) cout << ' ';
		cout << A[i];
	}
	cout << endl;
	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 3096
//    _____                   _                       _
//   / ____|                 | |                     (_)
//  | (___   ___  _ __     __| | ___ _ __    ______ _ _
//   \___ \ / _ \| '_ \   / _` |/ _ \ '_ \  |_  / _` | |
//   ____) | (_) | | | | | (_| |  __/ |_) |  / / (_| | |
//  |_____/ \___/|_| |_|  \__,_|\___| .__/  /___\__,_|_|
//                                  | |
//                                  |_|

#include <bits/stdc++.h>
#define nmax 100005
#define oo 10000000007
#define mod 1000000007
#define reset(x) memset(x, 0, sizeof x)
#define F first
#define S second
#define sonin cin
#define sonout cout
#define debug(x) cout << "Loli -> " << #x << " : " << x << "\n"
#define debugAry(x, a, b, y) for(int y = a; y<=b; y++) cout << #x << "[" << y << "]" << " -> " << x[y] << "\n"
#define filename ""
#define fileNX freopen(filename".inp", "r", stdin); freopen(filename".out", "w", stdout);
#define fileN freopen(filename".inp", "r", stdin);
#define fileX freopen(filename".out", "w", stdout);
#define toiuuhoa ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define SZ(a) (int) a.size()
#define FOU(x,a,b) for (lli x=a;x<=b;x++)
#define FOD(x,a,b) for (lli x=a;x>=b;x--)
#define FOA(a,b) for(auto &a:b)
#define ALLvec(a) a.begin(),a.end()
#define REU(x,a,b) for (lli x=a;x<b;x++)
#define RED(x,a,b) for (lli x=a;x>b;x--)
#define AutoCinAry(a,b,x) for(int a = 1; a<=b; a++) cin >> x[i];
#define dembit1(x) __builtin_popcount(x)
#define bit(x,i) ((x>>(i-1))&1ll)
#define on(x,i) (x|(1ll<<(i-1)))
#define off(x,i) (x&~(1ll<<(i-1)))
#define EL cout << "\n";
#define EX exit(0);
#define Ary(x, i, j, a) x[(i - 1) * a + j]
#define epsinon 1e-8
#define Son_onii_chan main
#define times double stime = clock();
#define gettime cerr << "Time executed: " << (clock() - stime) / CLOCKS_PER_SEC * 1000 << "ms.\n";
using namespace std;
typedef long long lli;
typedef long double ldo;
typedef double dou;
typedef vector<lli> vi;
typedef vector<vi> vvi;
typedef pair<lli, lli> pii;
typedef vector<pii> vpi;
typedef deque<lli> dqll;

lli a,b,c,d;
int Son_onii_chan(){
    //fileNX
    toiuuhoa
    sonin >> a >> b >> c >> d;
  	lli res = max({a*c, b*d, a*d, b*c});
  	sonout << res;
	return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
struct Combination{
private:
    ll N;
    vector<ll> fac, facinv;

public:
    Combination(ll n){
        N = n;
        fac.push_back(1); fac.push_back(1);
        rep(i,2,N+1) fac.push_back(fac[i-1] * i % MOD);
        rep(i,0,N+1) facinv.push_back(power(fac[i], MOD-2));
    }
    ll power(ll x, ll n){
        if(n == 0) return 1LL;
        ll res = power(x * x % MOD, n/2);
        if(n % 2 == 1) res = res * x % MOD;
        return res;
    }
    ll nck(ll n, ll k){
        if(k == 0 || n == k) return 1LL;
        return fac[n] * facinv[k] % MOD * facinv[n-k] % MOD;
    }
    ll npk(ll n, ll k){
        if(k == 0 || n == k) return 1LL;
        return fac[n] * facinv[n-k] % MOD;
    }
    ll get(ll x){return fac[x];};
    ll getinv(ll x){return facinv[x];};
};
char c(ll x){
    if(x == 0) return 'T';
    if(x == 1) return 'A';
    if(x == 2) return 'G';
    return 'C';
}

bool check(ll t, ll j, ll k, ll l){
    if(c(k) == 'A' && c(j) == 'G' && c(t) == 'C'){
        return false;
    }else if(c(k) == 'G' && c(j) == 'A' && c(t) == 'C'){
        return false;
    }else if(c(k) == 'A' && c(j) == 'C' && c(t) == 'G'){
        return false;
    }else if(c(l) == 'A' && c(j) == 'G' && c(t) == 'C'){
        return false;
    }else if(c(l) == 'A' && c(k) == 'G' && c(t) == 'C'){
        return false;
    }
    return true;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    Combination comb(110);
    ll dp[110][4][4][4] = {}; //i番目までみて,そこまでの文字列がj,k,l
    dp[0][0][0][0] = 1;
    rep(i,0,N){
        rep(j,0,4){
            rep(k,0,4){
                rep(l,0,4){
                    rep(t,0,4){
                        if(check(t,j,k,l)){
                            dp[i+1][t][j][k] += dp[i][j][k][l] % MOD;
                            dp[i+1][t][j][k] %= MOD;
                        }
                    }
                }
            }
        }
    }
    ll ans = 0;
    rep(i,0,4){
        rep(j,0,4){
            rep(k,0,4){
                ans += dp[N][i][j][k] % MOD;
                ans %= MOD;
            }
        }
    }
    print(ans);

    // ll dp[110][4] = {};
    // dp[0][0] = 1;
    // rep(i,0,N){
    //     rep(j,0,4){
    //         if(j == 0){
    //             rep(k,0,4){
    //                 dp[i+1][j] += dp[i][k];
    //             }
    //         }
    //     }
    // }




}

Measured memory_bytes: 384
class Card():
  def __init__(self, suit, value):
    self.suit = suit
    self.value = int(value)
  
  def __str__(self):
    return " ".join([self.suit, str(self.value)])
  


MAXINT = 1000000000 + 1
def mergesort(X, l, r):
  if l + 1 < r:
    m = (l + r)//2
    mergesort(X,l,m)
    mergesort(X,m ,r)
    merge(X,l, m, r)

def merge(X, l, m, r):
  nl = m - l
  nr = r - m
  L = [X[i] for i in range(l, l + nl)]
  R = [X[i] for i in range(m, m + nr)]
  L.append(Card('', MAXINT))
  R.append(Card('', MAXINT))
  i = 0
  j = 0
  for k in range(l,r):
    if L[i].value <= R[j].value:
      X[k] = L[i]
      i += 1
    else:
      X[k] = R[j]
      j += 1

def swap(A, i, j):
  tmp = A[i]
  A[i] = A[j]
  A[j] = tmp

def partition(S, p, r):
  x = S[r]
  i = p -1
  for j in range(p,r):
    if S[j].value <= x.value:
      i += 1
      swap(S, i, j)
  swap(S, i+1, r)
  return i+1

def quicksort(S, p, r):
  if p < r:
    q = partition(S, p, r)
    quicksort(S, p, q-1)
    quicksort(S, q+1, r)

n = int(input())
A = list()
B = list()
for _ in range(n):
  s, v = input().split()
  A.append(Card(s, v))
  B.append(Card(s, v))

mergesort(A, 0, len(A))
quicksort(B, 0, len(B) - 1)

flag = True
for a,b in zip(A,B):
  if a.suit != b.suit:
    flag = False
    break

if flag:
  print("Stable")
else:
  print("Not stable")

for x in B:
  print(x)



Measured memory_bytes: 47712
#include<iostream>
#include<string>
#include<vector>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define Rep(i,n) for(int (i)=n;(i)>(0);(i)--)
using namespace std;

int main() {
	string S;
	int h = 0;
	int b = 0;
	cin >> S;
	rep(i, S.length()) {
		if (S[i] == 'A') {
			h=i;
			break;
		}
	}
	Rep(i, S.length()) {
		if (S[i] == 'Z') {
			b = i;
			break;
		}
	}
	cout << b - h + 1 << endl;
	return 0;
}

Measured memory_bytes: 640
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>

#include <algorithm>
#include <random>
#include <bitset>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <vector>
#include <chrono>
#include <iostream>
#include <limits>
#include <numeric>

#define LOG(FMT...) fprintf(stderr, FMT)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

template <class T>
istream& operator>>(istream& is, vector<T>& v) {
  for (T& x : v)
    is >> x;
  return is;
}

template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  if (!v.empty()) {
    os << v.front();
    for (int i = 1; i < v.size(); ++i)
      os << ' ' << v[i];
  }
  return os;
}

int main() {
#ifdef ELEGIA
  freopen("test.in", "r", stdin);
  int nol_cl = clock();
#endif
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int n;
  cin >> n;
  vector<int> a(n + 1);
  cin >> a;
  int x = 0;
  for (int i = n; i >= 0; --i) {
    x = (x + 1) / 2 + a[i];
  }
  if (x > 1)
    cout << "-1\n";
  else {
    vector<ll> l(n + 1), r(n + 1);
    l[n] = r[n] = a[n];
    for (int i = n - 1; i >= 0; --i) {
      l[i] = (l[i + 1] + 1) / 2 + a[i];
      r[i] = r[i + 1] + a[i];
    }
    ll tot = 1;
    r[0] = 1;
    ll cur = 1;
    for (int i = 0; i < n; ++i) {
      cur = min(cur * 2, r[i + 1]);
      tot += cur;
      cur -= a[i + 1];
    }
    cout << tot;
  }

#ifdef ELEGIA
  LOG("Time: %dms\n", int ((clock()
          -nol_cl) / (double)CLOCKS_PER_SEC * 1000));
#endif
  return 0;
}


Measured memory_bytes: 5280
/**
       **********    ************
	  Author : Avi J Patel
	  University : DAIICT
       **********    ************
**/
#include<bits/stdc++.h>
#include<fstream>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define pf push_front
#define mp make_pair 
#define mt make_tuple
#define ff first
#define ss second
#define si size()
#define MOD 1000000007
#define Mod 998244353
#define N 200001
#define large 1844674407370955161
#define For(i,m,n) for(long long i=m;i<n;i++)
#define st(x) sort(x.begin(),x.end())
#define re(x,i) reverse(x.begin()+i,x.end())
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);srand(time(NULL));
#define min_heap priority_queue<int, vector<int>, greater<int>>
#define max_heap priority_queue<int>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> 

bool sortbysec(const pair<int,int> &a, const pair<int,int> &b) 
{ 
    if(a.ss < b.ss) return true; 
    else if(a.ss==b.ss) return a.ff<b.ff;
	else return false;
}
bool sortbyboth(const pair<int,int> &a, const pair<int,int> &b)
{
	if(a.ff<b.ff) return true;
	else if(a.ff==b.ff) return a.ss<b.ss;
	else return false;
} 
bool sortff_resortss(const pair<int,int> &a, const pair<int,int> &b)
{
	if(a.ff<b.ff) return true;
	else if(a.ff==b.ff) return a.ss>b.ss;
	else return false;
}
bool sortbystring(const string &a, const string &b)
{
	string c=a+b;
	string d=b+a;
	if(c>=d) return true;
	else return false;
}

ll modi(ll a, ll m) 
{ 
    ll m0 = m; 
    ll y = 0, x = 1; 
    if (m == 1) 
      return 0; 
    while (a > 1) 
    { 
        ll q = a / m; 
        ll t = m; 
        m = a % m, a = t; 
        t = y; 
        y = x - q * y; 
        x = t; 
    } 
    if (x < 0) 
       x += m0; 
    return x; 
} 
ll Logn(ll  n, ll r) 
{ 
    return (n > r - 1) ? 1 + Logn(n / r, r) : 0; 
} 

ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;      // Initialize result 
    x = x % p;  // Update x if it is more than or 
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1; // y = y/2 
        x = (x*x) % p; 
    } 
    return res; 
} 

  
int main()
{
	FAST
	int t=1;
//	cin>>t;
	while(t--)
	{	
		double l;
		cin>>l;
		double l1=l/3;
		cout << fixed << setprecision(12);
		cout<<l1*l1*l1;
	}
	return 0;
}
















Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm> 
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
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; 
 }
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll k,n;
  cin>>k>>n;
  vll a(n);
  rep(i,n) cin>>a[i];
  ll l=0;
  a.pb(k+a[0]);
  rep(i,n){
    l=max(l,a[i+1]-a[i]);
  }
  COUT(k-l);
}

Measured memory_bytes: 4480
#include<stdio.h>

int main(){
		int i;
		char s[51],t[51];
		scanf("%s%s",s,t);
		for(i=0;s[i]!=0;i++){
				printf("%c",s[i]);
				if(t[i]!=0)printf("%c",t[i]);
		}
		puts("");
		return 0;
}


Measured memory_bytes: 128
n=int(input())
a=list(map(int,input().split()))
i,c=0,0
while True:
    if a[i]%2==0:
        a[i]=a[i]/2
        i=i+1
    else:
        print(c)
        break
    if i==n-1:
        i=0
        c+=1

Measured memory_bytes: 9184
import java.util.*;

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		int x = sc.nextInt();
		for(int i = x-k+1 ; i < x+k-1 ; i++){
			System.out.printf(""+i+" ");
		}
		System.out.println(x+k-1);
	}

}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

mint dp[101][4][4][4];//[ここまで見て][最後から1文字目][2文字目][3文字目]

int main(){
  int n;
  cin >> n;
  dp[0][3][3][3] = 1;
  rep(i, n){
    rep(j, 4){
      rep(k, 4){
        rep(l, 4){//dp[i][j][k][l]について
          if(dp[i][j][k][l].x == 0) continue;
          rep(m, 4){
            if(m == 2 && j == 1 && k == 0) continue;
            if(m == 2 && j == 0 && k == 1) continue;
            if(m == 1 && j == 2 && k == 0) continue;
            if(m == 2 && j == 1 && l == 0) continue;
            if(m == 2 && k == 1 && l == 0) continue;
            dp[i+1][m][j][k] += dp[i][j][k][l];
          }
        }
      }
    }
  }
  // rep(i, n+1){
  //   mint out = 0;
  //   rep(j, 4)rep(k, 4)rep(l, 4){
  //     out += dp[i][j][k][l];
  //   }
  //   cout << out.x << endl;
  // }
  mint ans = 0;
  rep(j, 4)rep(k, 4)rep(l, 4){
    ans += dp[n][j][k][l];
  }
  cout << ans.x << endl;
  return 0;
}

Measured memory_bytes: 3668
import numpy as np
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, k = map(int, readline().split())
dp = np.zeros(k + 1)

for i in range(n):
    w, c = map(int, readline().split())
    dp[w:] = np.maximum(dp[w:], dp[:-w] + c)

print(int(dp[-1]))


Measured memory_bytes: 21872
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
using namespace std;

void Candies() {
	int N;
	cin >> N;
	int a[2][101];
	for (size_t i = 0; i < 2; i++)
	{
		cin >> a[i][0];
		for (size_t j = 1; j < N; j++)
		{
			int v;
			cin >> v;
			a[i][j] = a[i][j - 1] + v;
		}
	}
	int best = 0;
	for (size_t i = 0; i < N; i++)
	{
		int ad = a[0][i] + a[1][N - 1] - (i == 0 ? 0 : a[1][i - 1]);
		best = max(best, ad);
	}
	cout << best << endl;
}
int main() {
	Candies();
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>  
#include <iostream>  
#include <sstream>  
#include <string>  
#include <cstring>
#include <vector>  
#include <queue>  
#include <set>  
#include <map>  
#include <cstdio>  
#include <cstdlib>  
#include <cctype>  
#include <cmath>  
#include <list>  
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;  

#define PB push_back  
#define MP make_pair  
#define SZ(v) ((int)(v).size())  
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define REP(i,n) FOR(i,0,n)  
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)  
#define REPE(i,n) FORE(i,0,n)  
#define FORSZ(i,a,v) FOR(i,a,SZ(v))  
#define REPSZ(i,v) REP(i,SZ(v))  
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }

const int MAXN=200000;
const int MAXS=4*(MAXN+1);

int n;
int h[MAXN],a[MAXN];

ll dp[MAXN];

ll sval[MAXS];
void sinit(int x,int l,int r) {
	if(l==r) {
		sval[x]=0;
	} else {
		int m=l+(r-l)/2;
		sinit(2*x+1,l,m); sinit(2*x+2,m+1,r);
		sval[x]=max(sval[2*x+1],sval[2*x+2]);
	}
}
void supd(int x,int l,int r,int IDX,ll VAL) {
	if(l==r) {
		sval[x]=VAL;
	} else {
		int m=l+(r-l)/2;
		if(IDX<=m) supd(2*x+1,l,m,IDX,VAL); else supd(2*x+2,m+1,r,IDX,VAL);
		sval[x]=max(sval[2*x+1],sval[2*x+2]);
	}
}
ll sget(int x,int l,int r,int L,int R) {
	if(L<=l&&r<=R) {
		return sval[x];
	} else {
		ll ret=LLONG_MIN; int m=l+(r-l)/2;
		if(L<=m) ret=max(ret,sget(2*x+1,l,m,L,R));
		if(m+1<=R) ret=max(ret,sget(2*x+2,m+1,r,L,R));
		return ret;
	}
}

ll solve() {
	sinit(0,0,n);
	REP(i,n) {
		dp[i]=a[i]+sget(0,0,n,0,h[i]-1);
		supd(0,0,n,h[i],dp[i]);
	}
	ll ret=0; REP(i,n) ret=max(ret,dp[i]); return ret;
}

void run() {
	scanf("%d",&n);
	REP(i,n) scanf("%d",&h[i]);
	REP(i,n) scanf("%d",&a[i]);
	printf("%lld\n",solve());
}

int main() {
	run();
	return 0;
}


Measured memory_bytes: 9600
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<vector>
#define inf 2147483647
#define rep(i,a,b) for(int i=a;i<b;i++)
#define  rr read()
#define ll long long
#define repb(i,a,b) for(int i=a;i<=b;i++)
#define CloseIo   ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
int read()
{
    char ch = getchar();
	int x = 0, f = 1;
    while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
    while('0' <= ch && ch <= '9') {x = x * 10 + ch - '0'; ch = getchar();}
    return x * f;
}
const int MOD=1e9+7;
ll a[26]={0};
int main()
{
	ll sum=1;
 int n;
 string s;
 cin>>n>>s;
  for(int i=0;i<n;i++)
  a[s[i]-'a']++;
  for(int i=0;i<26;i++)
   sum=sum*(a[i]+1)%MOD;
   printf("%lld\n",sum-1);
}



Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
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; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	string s,t; cin>>s>>t;
	cout<<t<<s<<endl;
	
	return 0;
}

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

int main(){
    int ans = 0;
    int n; cin >> n;
    vector<int> a(n), b(n);
    rep(i,n) cin >> a.at(i);
    rep(i,n) cin >> b.at(i);

    for(int i = 0; i < n; i++){
        int sum = 0;
        for(int j = 0; j <= i; j++){
            sum += a.at(j);
        }
        for(int k = i; k < n; k++){
            sum += b.at(k);
        }
        ans = max(ans, sum);
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
from collections import Counter
n = int(input())
v = list(map(int, input().split()))

evenv, oddv = Counter(v[0::2]).most_common(), Counter(v[1::2]).most_common()
ans = 0
if evenv == oddv and len(evenv) == 1:
    ans = n // 2
elif evenv[0][0] == oddv[0][0]:
    ans = n - max(evenv[0][1] + oddv[1][1], evenv[1][1] + oddv[0][1])
else:
    ans = n - evenv[0][1] - oddv[0][1]
print(ans)

Measured memory_bytes: 64620
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
#define endl "\n"
//#define int long long
#define ALL(x) begin(x),end(x)
#define resort(v) sort((v).rbegin(), (v).rend())
#define _CRT_SECURE_NO_WARNINGS
#define rep(i, n) for (int i = 0; i < n; i++)
#define _GLIBCXX_DEBUG
const int MOD = 1e9 + 7;
//const int INF = 1e18 + 9;
constexpr long double pi = 3.141592653589793238462643383279;
int dx[] = { 1,0,-1,0 };
int dy[] = { 0,1,0,-1 };
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int fact(int i) {
    if (i == 0) return 1;
    return ((fact(i - 1)) * i) % MOD;
}
int gcd(int a, int b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int keta(int n) {
    if (n == 0) return 1;
    int count = 0;
    while (n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
int ketasum(int n) {
    int sum = 0;
    while (n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
ll modpow(ll a, ll n, ll mod) {
    ll hi = 1;
    while (n > 0) {
        if (n & 1) hi = hi * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return hi;
}
char toSmall(char c) { // 大文字を小文字へ
    return (c + 0x20);
}
char toLarge(char c) { // 小文字を大文字へ
    return (c - 0x20);
}
float myPower(int a, int n) { // aのn乗の計算
    float x = 1;
    while (n > 0) { // 全てのbitが捨てられるまで
        if (n & 1) { // 一番右のbitが１のとき
            x *= a;
        }
        a *= a;
        n >>= 1; // bit全体を右に1つシフトして一番右を捨てる
    }
    return x;
}

bool is_prime(const unsigned n) {
    switch (n) {
    case 0: // fall-through
    case 1: return false;
    case 2: // fall-through
    case 3: return true;
    } // n > 3 が保証された
    if (n % 2 == 0 || n % 3 == 0) return false;
    // n は 2 と 3 のいずれの倍数でもないことが保証された
    // これより n は (6の倍数)-1 か (6の倍数)+1 である
    // 6の倍数前後の数を使って試し割りをする
    for (unsigned i = 5; i * i <= n; i += 6) {
        if (n % i == 0) return false; // (6の倍数)-1
        if (n % (i + 2) == 0) return false; // (6の倍数)+1
    }
    return true;
}
int sum;
/*signed*/int main(void) {
    string s;
  cin>>s;
  for(int i=0;i<(int)s.size();++i){
    sum+=s[i]-'0';
  }
  //sum=stoi(s);
  if(sum%9==0){
    puts("Yes");
  }
else puts("No");
    return 0;
}


Measured memory_bytes: 3724
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()

using namespace std;

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

class UNION_FIND{
public:
	vector<int> par;
	vector<int> rank;
	UNION_FIND(int n){
		par.clear();
		par.resize(n, 0);
		rep (i, n) par[i] = i;
		rank.clear();
		rank.resize(n, 0);
	}

	~UNION_FIND(){
		par.clear();
		rank.clear();
	}

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

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

		if (rank[x] < rank[y]){
			par[x] = y;
		}else{
			par[y] = x;
			if (rank[x] == rank[y]){
				++rank[x];
			} // end if
		} // end if
	}

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

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	
	int N, K, L; cin >> N >> K >> L;
	UNION_FIND ar(N), br(N);
	rep (i, K){
		int p,q; cin >> p >> q;
		--p, --q;
		ar.unite(p,q);
	} // end rep
	rep (i, L){
		int r,s; cin >> r >> s;
		--r,--s;
		br.unite(r,s);
	} // end rep

	map<P,int> cnt; cnt.clear();
	rep (i, N){
//		cerr << "ar.find(i): " << ar.find(i) << " br.find(i): " << br.find(i) << endl;
		++cnt[P(ar.find(i),br.find(i))];
	} // end rep

	vector<int> res(N, 0);
	rep (i, N){
		res[i] = cnt[P(ar.find(i),br.find(i))];
	} // end rep
	rep (i, N){
		cout << res[i] << (i != N - 1 ? ' ' : '\n');
	} // end rep

	return 0;
}

Measured memory_bytes: 15872
x,y = map(int,input().split())

if x < y:
    if x*y < 0:
        print(1 + abs(abs(x) - y))
    else:
        print(y - x)
else:
    if x*y <= 0:
        print(1 + abs(x - abs(y)))
    else:
        print(2 + abs(x - y))

Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#define PB push_back
#define MP make_pair
#define sz(v) (in((v).size()))
#define forn(i,n) for(in i=0;i<(n);++i)
#define forv(i,v) forn(i,sz(v))
#define fors(i,s) for(auto i=(s).begin();i!=(s).end();++i)
#define all(v) (v).begin(),(v).end()
using namespace std;
typedef long long in;
typedef vector<in> VI;
typedef vector<VI> VVI;
void fl(){
  cout<<"Impossible"<<endl;
  exit(0);
}
multiset<in,greater<in> > a;
void er(in x){
  if(a.find(x)==a.end())
    fl();
  a.erase(a.find(x));
}
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  in n;
  cin>>n;
  in t;
  forn(z,n){
    cin>>t;
    a.insert(t);
  }
  in cb=*(a.begin());
  er(cb);
  in ct=*(a.begin());
  er(ct);
  if(cb!=ct)
    fl();
  for(in i=1;i<cb;++i)
    er(max(i,cb-i));
  while(!a.empty()){
    ct=*(a.begin());
    er(ct);
    if((ct-1)*2<cb)
      fl();
    if(cb==1)
      fl();
  }
  cout<<"Possible"<<endl;
  return 0;
}


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

int main(){
    int n;
    cin >> n;
    if(n == 1){
        cout << "Hello World" << endl;
        return 0;
    }
    int a,b;
    cin >> a >> b;
    cout << a+b << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<pair<int,int>> vpi;
typedef vector<pair<long long, long long>> vpl;
typedef pair<int,int> pii;
typedef pair<long long, long long> pll;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
#define EPS (1e-7)
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define REP(i,n) for(int i=1;i<=(int)(n);i++)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define ALL(a)  a.begin(),a.end()
#define RALL(a) a.begin(),a.end(),greater<int>()
#define ROT(a) a.begin(),a.begin()+1,a.end()
#define RROT(a) a.begin(),a.end()-1,a.end()
#define PB push_back
#define MP make_pair
#define PI acos(-1.0)
#define sz(a) a.size()
const ll MOD = 1e9+7;
const int MAX = 10000000;
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
//cout << 'H' << endl;
/*--------------------------------------------*/
ll N;

vector<vector<int>> G;

vector<int> block;


struct UnionFind {
  vector< int > data;
 
  UnionFind(int sz) {
    data.assign(sz, -1);
  }
 
  bool unite(int x, int y) {
    x = find(x), y = find(y);
    if(x == y) return (false);
    if(data[x] > data[y]) swap(x, y);
    data[x] += data[y];
    data[y] = x;
    return (true);
  }
 
  int find(int k) {
    if(data[k] < 0) return (k);
    return (data[k] = find(data[k]));
  }
 
  int size(int k) {
    return (-data[find(k)]);
  }
};

int main(){
    //cout << fixed << setprecision(10)
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll M,K;cin >> N >> M >> K;

    G.resize(N);
    block.assign(N,0);

    map<pii,int> mp;

    UnionFind uf(N);

    rep(i,M){
        int a,b;
        cin >> a >> b;
        --a;--b;
        G[a].PB(b);
        G[b].PB(a);

        uf.unite(a,b);
    }

    rep(i,K){
        int a,b;
        cin >> a >> b;
        --a;--b;

        if(uf.find(a) == uf.find(b)){
            block[a]++;
            block[b]++;
        }
    }        
           
    map<int,int> island;

    rep(i,N){
        island[i]++;
        // cout << uf.size(i) << endl;

        cout << max((unsigned long)0,uf.size(i) - sz(G[i]) - 1 - block[i]) << ' ';
    }





    

}

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

using namespace std;

struct pp {
	int val;
	int ind;
	bool operator < (const pp&el) const {
		return (val < el.val);
	}
};

int main() {
	ios::sync_with_stdio(false);
	int n;	
	pp a[100005];
	cin>>n;
	for (int i = 0; i < n; i++) {
		cin>>a[i].val;
		a[i].ind = i + 1;
	}
	sort(a, a + n);
	for (int i = 0; i < n; i++)
		cout<<a[i].ind<<" ";
}


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

int n;
pair <pair <int, int>, int> p[200010];
pair <int, int> ans[200010];

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; ++i)
		p[i].second = i;
	for (int i = 0; i < n; ++i) {
		int a; scanf("%d", &a);
		++p[a].first.first, ++p[a].first.second;
	}
	for (int i = 0; i < n; ++i) {
		int b; scanf("%d", &b);
		if(++p[b].first.first > n) {
			puts("No");
			return 0;
		}
	}
	
	sort(p + 1, p + n + 1, greater <pair <pair <int, int>, int> > ());
	puts("Yes");
	for (int i = 1, j = 0, s1 = 0, s2 = 0; i <= n; ++i) {
		int na = p[i].first.second, nb = p[i].first.first - na;
		if (j + na + nb <= n) {
			s1 += na, s2 += nb;
			while (na--)
				ans[j++].first = p[i].second;
			while (nb--)
				ans[j++].second = p[i].second;
		}
		else {
			p[i].first.first -= n - j;
			if (s1 >= nb) {
				while (na > 0 && j < n)
					ans[j++].first = p[i].second, --na;
				while (j < n)
					ans[j++].second = p[i].second, --nb;
				p[i].first.second = na;
			}
			else if (s2 >= na) {
				while (nb > 0 && j < n)
					ans[j++].second = p[i].second, --nb;
				while (j < n)
					ans[j++].first = p[i].second, --na;
				p[i].first.second = na;
			}
			for (int j1 = 0, j2 = 0; i <= n; ++i) {
				int na = p[i].first.second, nb = p[i].first.first - p[i].first.second;
				while (na--) {
					while (ans[j1].first)
						++j1;
					ans[j1].first = p[i].second;
				}
				while (nb--) {
					while (ans[j2].second)
						++j2;
					ans[j2].second = p[i].second;
				}
			}
			break;
		}
	}
	sort(ans, ans + n);
	for (int i = 0; i < n; ++i)
		printf("%d%c", ans[i].second, i == n - 1 ? '\n' : ' ');
	return 0;
}


Measured memory_bytes: 7672
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define repdi(i,a,b) for(ll i=(a)-1;i>=(b);--i)
#define repd(i,a) repdi(i,a,0)
#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

using ll = long long;
using P = std::pair<ll, ll>;

constexpr ll INF = 1ll<<60;

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

template<class S, class T>
std::ostream& operator<< ( std::ostream& out, const std::pair<S,T>& a )
{ std::cout << '(' << a.first << ", " << a.second << ')'; return out; }

template<class T>
std::ostream &operator<< ( std::ostream& out, const std::vector<T>& a )
{ std::cout << '['; rep( i, a.size() ){ std::cout << a[i]; if( i != a.size()-1 ) std::cout << ", "; } std::cout << ']'; return out; }

ll A[3];

int main()
{
  rep( i, 3 )
    std::cin >> A[i];

  puts( A[0]+A[1]+A[2] >= 22 ? "bust" : "win" );

  return 0;
}

Measured memory_bytes: 256
import * as fs from 'fs';

export class Reader {
    lines: string[];
    currentLine: number;

    constructor() {
        this.lines = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        this.currentLine = 0;
    }

    readLine(): string {
        return this.lines[this.currentLine++];
    }

    readInt(): number {
        return Number(this.readLine());
    }

    readInts(): number[] {
        return this.readLine().split(" ").map(Number);
    }
}


let reader = new Reader();
let N = reader.readInt();
let isPrime: boolean[] = new Array(N+1).fill(true);
let over74 = 0, over24 = 0, over14 = 0, over4 = 0, over2 = 0;
for(let i=2; i<N+1; i++) {
	if (isPrime[i]) {
		for(let j=2*i; j<N+1; j+=i) {
			isPrime[j] = false;
		}
		let p = i;
		let primeCount = 0;
		while (p <= N) {
			primeCount += Math.floor(N/p);
			p *= i;
		}
		if (primeCount >= 74) {
			over74 += 1;
		}
		if (primeCount >= 24) {
			over24 += 1;
		}
		if (primeCount >= 14) {
			over14 += 1;
		} 
		if (primeCount >= 4) {
			over4 += 1;
		}
		if (primeCount >= 2) {
			over2 += 1;
		}
	}
}
// a, b, c are primes
// a^2 b^4 c^4   3 5 5
// a^2 b^24      3 25
// a^4 b^14      5 15
// a^74          75

console.log(
	(over2-2)*over4*(over4-1)/2
	+(over2-1)*over24
	+(over4-1)*over14
	+over74
);


Measured memory_bytes: 29616
#include <iostream>

using namespace std;

int main()
{
    string str;

    while (getline(cin, str)) {
        int ord[10];

        for (int i = 0; i < 10; i++) 
            ord[i] = str[i] - '0';
        
        for (int i = 9; i >= 0; i--) 
            for (int j = 0; j < i; j++) 
                ord[j] = (ord[j] + ord[j + 1]) % 10;
        
        cout << ord[0] << endl;
    }

    return 0;
}

Measured memory_bytes: 1172
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);++i)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
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; }
  
const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};
 
const int MAX=510000;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
   
  ll x;
  cin >> x;
  ll ans = 0;
  ans += (x/11)*2;
  x%=11;
  if(0 < x  && x<=6)ans++;
  else if(7<=x)ans += 2;
    
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3616
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
	bool A = false, B = false, C=false;
	int a, b, c,x,y,z;
	cin >> a >> b >> c;
	if (a == b == c)
	{
		cout << a <<" "<< b <<" "<< a << endl;
	}
	else if (a==b && a!=c)
	{
		if (a < c)cout << a <<" "<< b <<" "<< c << endl;
		else cout << c << " " << a << " " << b << endl;
	}
	else if (b == c && a!=b)
	{
		if (a < b)cout << a << " " << c << " " << b << endl;
		else cout << c << " " << b << " " << a << endl;
	}
	else if (a == c && a!=b)
	{
		if (a < b)cout << a << " " << c << " " << b << endl;
		else cout << b << " " << c << " " << a << endl;
	}
	else 
	{
		x = min(a, min(b, c));
		z = max(a, max(b, c));
		if (a != x && a != z)y = a;
		if (b != x && b != z)y = b;
		if (c != x && c != z)y = c;

		cout << x << " " << y << " " << z << endl;
	}
	return 0;
}


Measured memory_bytes: 3116
/*#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<int,int>
#define ll __int64
int n;
int t[110000];

int main(){
cin>>n;
int sum=0;
rep(i,n)cin>>t[i];
if(n==0)cout<<t[0]<<endl;

else{

sort(t,t+n);
for(int i=0;i<(n+1)/2;i++)sum+=t[i];

}
cout<<sum<<endl;
	return 0;
}*/

#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<int,int>
#define ll long long 
int n;
ll t[110000];

const ll MA=1000000000000000;
ll ansma,ansmi;
ll mid,l,r;

ll simyu(ll num){
rep(i,n){
	if(num/t[i]==0)return 0;
	num=num-num%t[i];
}
return num;
}

int main(){
cin>>n;
rep(i,n){cin>>t[i];}

l=0;
r=MA;
mid=(l+r)/2;

for(int i=0;i<100;i++){
	ll now=simyu(mid);
	if(now<=2){
		l=mid;
		mid=(l+r)/2;
	}
	else{
		r=mid;
		mid=(l+r)/2;
	}
	//cout<<l<<" "<<r<<" "<<mid<<" "<<now<<endl;
	ansma=mid;
}

l=0;
r=MA;
mid=(l+r)/2;

for(int i=0;i<100;i++){
	ll now=simyu(mid);

	if(now<2){
		l=mid;
		mid=(l+r)/2;
	}
	else{
		r=mid;
		mid=(l+r)/2;
	}
	ansmi=mid+1;
}
if(ansmi>ansma)cout<<-1<<endl;
else cout<<ansmi<<" "<<ansma<<endl;
	return 0;
}

Measured memory_bytes: 1024
#include <algorithm>
#include <array>
#include <bitset>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <queue>

using namespace std;

struct BoolName : numpunct<char> {
  string t, f;
  BoolName (string t = "Yes", string f = "No") : t(t), f(f) {}
  string do_truename() const {return t;}
  string do_falsename() const {return f;}
};

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15) << boolalpha;
    cout.imbue(locale(cout.getloc(), new BoolName));
  }
} initializer;

template<typename T> istream& operator>>(istream &s, vector<T> &v) {
  for (T &t : v) s >> t;
  return s;
}

template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
  for (const T &t : v) s << t << endl;
  return s;
}

void set_bool_name(string t, string f) {
  cout.imbue(locale(cout.getloc(), new BoolName(t, f)));
}

int main() {
  int64_t a, b, c, k;
  cin >> a >> b >> c >> k;
  map<tuple<int, int, int>, int> mem;
  for (int i = 0; i < k; ++i) {
    auto m = min({a, b, c});
    a -= m;
    b -= m;
    c -= m;
    auto aa = b + c;
    auto bb = a + c;
    auto cc = a + b;
    a = aa;
    b = bb;
    c = cc;
    if (a == b && b == c) {
      cout << 0 << endl;
      return 0;
    }
    if (mem.count(make_tuple(a, b, c))) k -= (k - i - 1) / (i - mem[make_tuple(a, b, c)]) * (i - mem[make_tuple(a, b, c)]);
    else mem[make_tuple(a, b, c)] = i;
  }
  cout << a - b << endl;
}



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

int main()
{
    ll i,s=0,h,k,n;
    cin>>n>>k;
    ll a[n];

    for(i = 0; i < n; i++)
    {
        cin>>a[i];
    }
    if(k>=n)
        cout<<0<<endl;
    else
    {
        sort(a,a+n);
        for(i = 0; i < n-k;i++)
            s+=a[i];
        cout<<s<<endl;
    }
}


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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    data_type s,t,u;
    unordered_set<data_type> xx;
    cin>>t;
    for(data_type i=0;i<t;i++)
    {
       cin>>s;
       xx.insert(s);
    }
    cout<<(xx.size()==t?"YES":"NO")<<endl;


    return 0;
}


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

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
#define PI 3.14159265359 //πの値
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

 
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
  ll N,D;
  long double A,B,C;
  ll cnt = 0;
  cin >> N >> D;
  REP(i,N){
    cin>>A>>B;
    C = (A*A)+(B*B);
    if(sqrt(C)<=D) cnt++;
  }
  cout<<cnt;
}

Measured memory_bytes: 3864
def main():
    N = int(input())
    X = list(map(int, input().split(' ')))

    ans = []
    for p in range(100):
        dis = 0
        for x in X:
            dis += pow((x-p), 2)
        ans.append(dis)

    print(min(ans))

if __name__ == '__main__':
    main()

Measured memory_bytes: 3060