akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace  std ;
typedef long long  ll;
typedef pair<ll, ll> Pll;
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define rad(X) cout << (X) << endl
#define ASH(X) cout << (X) << " "
#define debug(x) cout << #x << " " << x << endl;
#define debug2(x,y) cout << #x << " " << x << " " << #y << " " << y << endl;
#define FOR(I,A,B) for(ll I = (A); I <= (B); I++)
#define cir(I,B,A) for(ll I = (A); I >=(B); I--)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define SORT(c) (sort(c.begin(),c.end()))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASES int ___T; cin >> ___T; for(int cs=1;cs<=___T;cs++)
#define FAST()  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
template<typename T>T gcd(T x, T y){if(y==0)return x;else return gcd(y,x%y);}
ll fx[] = {1, 1, 0, -1, -1, -1, 0, 1};
ll fy[] = {0, 1, 1, 1, 0, -1, -1, -1};
vector<ll>a,b,c;
map<ll,ll>m1,m2,m3;
ll mod =    1e9 + 7;
char  s[1001][1001];
ll   dp[1001][1001];

/************************************************/

void Execute()
{
    ll n, nb, k, q, a, b, c, l, r, d, x, y, p, m,i,j;

      cin >> r >> c;

      FOR(i,0,r-1)FOR(j,0,c-1){
        cin >> s[i][j];
      }


            dp[0][0] = 1;
            
            FOR(i,0,r-1) FOR(j,0,c-1){
              if(s[i][j]=='#') continue;
              if(i-1>=0) dp[i][j] = (dp[i][j]+dp[i-1][j])%mod;
              if(j-1>=0) dp[i][j] = (dp[i][j]+dp[i][j-1])%mod;
            }

            std::cout << dp[r-1][c-1] << '\n';

}

int32_t main()
{
    //#ifndef ONLINE_JUDGE
    //freopen("atomm.txt", "r", stdin);
    //#endif

    FAST();
  //  CASES
    //{
        Execute();
    //}
}


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

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

  for (int i = 0; i <= x; i++) {
    int sum = 0;
    sum = 2 * i + 4 * (x - i);
    if (sum == y) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define EM 1000000
using namespace std;
using LL = long long;
using P = pair<LL, LL>;
LL LINF = 1e18;
int INF = 1e9;
LL mod = 1e9+7;
using vint = vector<int>;
using vLL = vector<LL>;
using vvint = vector<vector<int>>;
using vvLL = vector<vector<LL>>;
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(){
    string s, t;
    cin >> s >> t;
    vector<vector<int>> dp(26, vector<int>(2*s.size(), INF));
    string ss = s+s;
    for(int i = 0;i < 26;i++){
        int c = 'a'+i;
        int l = 0;
        for(int j = 0;j < ss.size();j++){
            if(ss[j] == c){
                while(l < j){
                    dp[i][l] = j-l;
                    l++;
                }
            }
            if(l >= s.size())   break;
        }
    }

    LL ans = 0;
    bool ju = false;
    for(int j = 0;j < s.size();j++){
        if(t[0] == s[j]){
            ju = true;
            ans += j+1;
            int r = j;
            for(int k = 1;k < t.size();k++){
                int d = dp[t[k]-'a'][r];
                if(d == INF){
                    ju = false;
                    break;
                }
                ans += d;
                r += d;
                r %= s.size();
            }
            break;
        }
    }
    if(ju)   cout << ans << endl;
    else    cout << -1 << endl;
}

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

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

using namespace std;

typedef long long ll;

const int L = 14, N = 1 << L, P = 998244353, R = 3;

int inv[N], fac[N], ifac[N], root[N], brev[N], f[N];
bool key[N];
char s[N];

int norm(int x) { return x >= P ? (x - P) : x; }

int mpow(int x, int k) {
  int ret = 1;
  while (k) {
    if (k & 1)
      ret = ret * (ll)x % P;
    k >>= 1;
    x = x * (ll)x % P;
  }
  return ret;
}

void prepare(int n) {
  inv[1] = 1;
  for (int i = 2; i <= n; ++i)
    inv[i] = -(P / i) * (ll)inv[P % i] % P + P;
  fac[0] = 1;
  for (int i = 1; i <= n; ++i)
    fac[i] = fac[i - 1] * (ll)i % P;
  ifac[0] = 1;
  for (int i = 1; i <= n; ++i)
    ifac[i] = ifac[i - 1] * (ll)inv[i] % P;
}

void preparefft(int lgn) {
  int n = 1 << lgn;
  for (int i = 0; i < n; ++i)
    brev[i] = (brev[i >> 1] >> 1) | ((i & 1) << (lgn - 1));
  int primitive = mpow(R, (P - 1) >> lgn);
  root[0] = 1;
  for (int i = 1; i < n; ++i)
    root[i] = root[i - 1] * (ll)primitive % P;
}

void ntt(int* a, int lgn, int sgn) {
  int n = 1 << lgn;
  for (int i = 0; i < n; ++i) {
    int rv = brev[i] >> (L - lgn);
    if (i < rv) swap(a[i], a[rv]);
  }
  for (int k = L - 1, t = 1; t < n; t <<= 1, --k) {
    for (int i = 0; i < n; i += t << 1) {
      int *p1 = a + i, *p2 = a + i + t;
      for (int j = 0; j < t; ++j) {
        int x = p2[j] * (ll)root[j << k] % P;
        p2[j] = norm(p1[j] + P - x);
        p1[j] = norm(p1[j] + x);
      }
    }
  }
  if (sgn == -1) {
    reverse(a + 1, a + n);
    int nv = mpow(n, P - 2);
    for (int i = 0; i < n; ++i)
      a[i] = a[i] * (ll)nv % P;
  }
}

void mul(int* a, int n, int* b, int m, int* c) {
  static int ta[N], tb[N], tc[N];
  int l = 0;
  while ((1 << l) <= (n + m)) ++l;
  memset(ta, 0, sizeof(int) << l);
  memset(tb, 0, sizeof(int) << l);
  memcpy(ta, a, sizeof(int) * (n + 1));
  memcpy(tb, b, sizeof(int) * (m + 1));
  ntt(ta, l, 1);
  ntt(tb, l, 1);
  for (int i = 0; i < (1 << l); ++i)
    tc[i] = ta[i] * (ll)tb[i] % P;
  ntt(tc, l, -1);
  memcpy(c, tc, sizeof(int) * (n + m + 1));
}

int dp[N], tmp[N], sv[N];

int binom(int n, int m) { return fac[n] * (ll)ifac[m] % P * ifac[n - m] % P; }

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

  int n, m;
  cin >> n >> m;
  prepare(n);
  preparefft(L);
  dp[n] = 1;
  while (m--) {
    memcpy(sv, dp, sizeof(sv));
    for (int i = 0; i <= n; ++i)
      dp[i] = dp[i] * (ll)fac[i] % P;
    reverse(dp, dp + n + 1);
    mul(dp, n, ifac, n, tmp);
    for (int i = 0; i <= n; ++i)
      dp[i] = sv[i] * (1LL + i) % P;
    reverse(tmp, tmp + n + 1);
    for (int i = 0; i <= n; ++i) {
      tmp[i] = tmp[i] * (ll) ifac[i] % P;
      for (int j = 0; j <= 1; ++j)
        tmp[i] = (tmp[i] + (P - binom(i + j, j)) * (ll)sv[i + j]) % P;
      dp[i + 2] = norm(dp[i + 2] + tmp[i]);
    }
  }
  cout << (accumulate(dp, dp + n + 1, 0LL) % P);

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



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

/* #pragma */
/*
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/

/*alias*/
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

/* func */
int GCD(int a,int b){return b?GCD(b,a%b):a;}
long long GCD(long long a, long long b){return b ? GCD(b, a%b) : a;}
int LCM(int a, int b){return a * b / GCD(a, b);}
long long LCM(long long a, long long b){return a * b / GCD(a, b);}

/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;

/* const */
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const double EPS = 1e-9;
const int dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
//Counterclockwise from the 6o'clock direction
//Take the x-axis downward and the y-axis right

//#define int long long

//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//chcp 65001

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

	vector<tuple<string, int, int>> z(n);
	for(int i = 0, i_len = (int)n; i < i_len; ++i){
		string s; cin >> s; int p; cin >> p;
		z[i] = make_tuple(s, p, i+1);
	}
	sort(z.begin(), z.end(), []( const auto &x, const auto &y )
         {
             return get<0>( x ) == get<0>( y ) ? get<1>( x ) > get<1>( y ) : get<0>( x ) < get<0>( y );
         });

	for(int i = 0, i_len = (int)n; i < i_len; ++i){
		cout << get<2>(z[i]) << endl;
	}
	return 0;
}


Measured memory_bytes: 256
N, K = map(int, input().split())
h = list(map(int, input().split()))
#dp[i] をiまでの最小コスト
INF = 10**9
# h.extend([INF for i in range(100)])
dp = [INF for i in range(N)]
dp[0] = 0
for i in range(N):
    for k in range(1,K+1):
        if i + k >= N:
            break
        dp[i + k] = min(dp[i + k], dp[i] + abs(h[i+k] - h[i])) # i => i+k でのコストの更新
print(dp[N-1])

Measured memory_bytes: 56544
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 50;
int N, answer=0, v[1+MAXN];
bool edge[1+MAXN][1+MAXN], seen[1+MAXN];

void DepthFisrtSearch(int x){
  seen[x] = true;
  for(int i = 1; i <= N; ++i){
    if(!edge[x][i]) continue;
    if(seen[i]) continue;
    DepthFisrtSearch(i);
  }
}

int main() {
  int M;
  cin >> N >> M;
  int a[M],b[M];
  answer = 0;
  for(int i = 1; i <= N; ++i){
    for(int j = i; j <= N; ++j){
      edge[i][j] = edge[j][i] = false;
    }
  }
  for(int i = 0; i < M; ++i){
    cin >> a[i] >> b[i];
    edge[a[i]][b[i]] = edge[b[i]][a[i]] = true;
  }
  for(int i = 0 ; i < M; ++i){
    edge[a[i]][b[i]] = edge[b[i]][a[i]] = false;
    for(int j = 1; j <= N; ++j) seen[j] = false;
    DepthFisrtSearch(1);
    for(int j = 1; j <= N; ++j){
      if(!seen[j]){
        ++answer;
        break;
      }
    }
    edge[a[i]][b[i]] = edge[b[i]][a[i]] = true;
  }
  cout << answer << endl;
}


Measured memory_bytes: 256
// ACM-ICPCアジア地区予選2013 C. Count the Regions

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <queue>
#include <cstring>

using namespace std;

int main(){
	int n;
	long long region[102][102];
	while(cin >> n && n){
		memset(region, 0, sizeof(region));
		vector<int> l(n), t(n), r(n), b(n), x, y;
		for(int i=0;i<n;i++){
			cin >> l[i] >> t[i] >> r[i] >> b[i];
			x.push_back(l[i]);
			x.push_back(r[i]);
			y.push_back(t[i]);
			y.push_back(b[i]);
		}
		sort(x.begin(), x.end());
		x.erase(unique(x.begin(), x.end()), x.end());
		sort(y.begin(), y.end());
		y.erase(unique(y.begin(), y.end()), y.end());
		map<int, int> xidx, yidx;
		for(int i=0;i<x.size();i++) xidx[x[i]] = i+1;
		for(int i=0;i<y.size();i++) yidx[y[i]] = i+1;
		for(int i=0;i<n;i++){
			l[i] = xidx[l[i]];
			r[i] = xidx[r[i]];
			t[i] = yidx[t[i]];
			b[i] = yidx[b[i]];
			for(int j=l[i];j<r[i];j++){
				for(int k=b[i];k<t[i];k++){
					region[j][k] |= (1LL << i);
				}
			}
		}
		int res = 0;
		for(int i=0;i<102;i++){
			for(int j=0;j<102;j++){
				int dx[] = {-1, 0, 1, 0};
				int dy[] = {0, -1, 0, 1};
				if(region[i][j] == -1) continue;
				res++;
				queue< pair<int, int> > qu; qu.push(make_pair(i,j));
				long long r = region[i][j];
				region[i][j] = -1;
				while(!qu.empty()){
					pair<int,int> pr=qu.front(); qu.pop();
					int xpos = pr.first, ypos = pr.second;
					for(int k=0;k<4;k++){
						int nx = xpos+dx[k], ny = ypos+dy[k];
						if(nx<0||102<=nx||ny<0||102<=ny||region[nx][ny]==-1||region[nx][ny]!=r) continue;
						qu.push(make_pair(nx,ny));
						region[nx][ny] = -1;
					}
				}
			}
		}
		cout << res << endl;
	}
}

Measured memory_bytes: 1320
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]param
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));}}
function Main(input) {
  input = myconv(input,3);
  var N = myconv(input[0],1);
  var list = myconv(input[1],4);
  var count = {};
  for(var i = 0; i < N; i++){
    if(count[list[i]] == null){
       count[list[i]] = 1;
    }else{
       count[list[i]]++;
    }
  }
  var useSet = Array.from(Object.keys(count));
  useSet.sort(function(a,b){
  	return myconv(a,1) - myconv(b,1);
  });
  //優先的に食べるのは、複数回出現した数。これを小さい数値・大きい数値両端から攻めてく
  //どっちかあぶれたら不足分は他の出現数1からとって食う
  var mae = 0;
  var ato = useSet.length -1;
  while(true){
    var maeCount = count[useSet[mae]];
    if(maeCount <= 1){mae++; continue;}
    var atoCount = count[useSet[ato]];
    if(atoCount <= 1){ato--; continue;}
    if(mae >= ato){
       //処理終了
      if(maeCount >= 2){
         if(maeCount % 2 == 1){
            count[useSet[mae]] = 1;
         }else{
           count[useSet[mae]] = 0;
         }
      }
      break;
    }else{
      count[useSet[mae]]--;
      count[useSet[ato]]--;
    }
  }
  var output = 0;
  for(var i = 0; i < useSet.length; i++){
    if(count[useSet[i]] == 1){
       output++;
    }
  }
  myout(output);
}
Main(myin());

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

#define ll long long 


int main(){
	int n;
	cin>>n;
	double dp[n+1]={};
	dp[0] = 1;
	//dp[i] - represent the probability of exactly i heads 
	
	for(int i = 0; i<n; i++){
		double phead;
		cin>>phead;
		for(int j= i+1; j>=0; j--){
			dp[j] = ((j==0)?0:dp[j-1]*phead) + dp[j] * (1 - phead);
			}
		}
	double ans=  0;
	for(int i = n/2+1; i<=n; i++)
		 ans += dp[i];
	cout<<fixed <<setprecision(9) <<ans <<endl;
	
	
	
	return 0;
	}


Measured memory_bytes: 256
N = int(input())
A = [int(i) for i in input().split()]

dp = [1] * N
for i in range(N - 1, -1, -1):
	if i + 1 < N and A[i + 1] <= A[i]:
		dp[i] += dp[i + 1]
print (max(dp) - 1)

Measured memory_bytes: 63984
#include<stdio.h>
#define MAX 10000

int main(){
  int i, j, n, q, S[MAX], T[MAX], count = 0;
  
  scanf("%d", &n);
  
  for(i = 0; i < n; i++)
    scanf("%d", &S[i]);
  
  scanf("%d", &q);
  
  for(i = 0; i < q; i++)
    scanf("%d", &T[i]);
  
  for(i = 0; i < q; i++){
    for(j = 0; j < n; j++){
      if(T[i] == S[j]){
	count++;
	break;
      }
    }
  }
  
  printf("%d\n", count);
  
  return 0;
}



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


int main(){

long long A,B,C,K;
cin >> A >> B >> C >> K;

long long max = 0;

if(A >= K){
  max = K;
}else if(B >= K - A){
  max = A;
}else if(C >= K - A - B){
  max = A - (K - A - B);
}

cout << max << endl;

}

Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>

using namespace std;
#define int long long

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
//SOLVE

//-----CODE------//
void solve(void)
{ 
  int N;cin>>N;
  vector<int> vec (N,0);
  for (int i = 0; i < N; i++)
  {
     cin>>vec[i];
  }
  auto v1 = vec;
  auto v2 = vec;
  int pn = 0;
  int C1 = 0;
  for (int i = 0; i < N; i++)
  {
    static int SUM = 0;
    if(pn == 0)
    {
      SUM += v1[i];
      if(SUM <= 0)
      {
        v1[i] += -1*SUM + 1;
        C1 += abs(-1*SUM + 1);
        SUM = 1;
      }
    }
    else
    {
      SUM += v1[i];
      if(SUM >= 0)
      {
        v1[i] -= SUM +1;
        C1 += abs(SUM + 1);
        SUM = -1;
      }
    }
    pn ^=1;
  }

  pn = 1;
  int C2 = 0;
  for (int i = 0; i < N; i++)
  {
    static int SUM = 0;
    if(pn == 0)
    {
      SUM += v2[i];
      if(SUM <= 0)
      {
        v2[i] += -1*SUM + 1;
        C2 += abs(-1*SUM + 1);
        SUM = 1;
      }
    }
    else
    {
      SUM += v2[i];
      if(SUM >= 0)
      {
        v2[i] -= SUM +1;
        C2 += abs(SUM + 1);
        SUM = -1;
      }
    }
    pn ^=1;
    
  }
  // DEBUG(v1,v2);
  cout<<min(C1,C2)<<endl;
  return;
}
int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


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

int main() {
  int N, K;
  cin >> N >> K;
  int x = 1;
  for (int i = 0; i < N; i++) {
    if (x + K <= x * 2){
      x += K;
    }
    else {
      x *= 2;
    }
  }
  cout << x << endl;
}


Measured memory_bytes: 256
//include
//------------------------------------------
#include <bits/stdc++.h>
using namespace std;
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef long long ll;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
// chmax chmin
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 main(void){

    int A1,A2,A3;
    cin >> A1 >> A2 >> A3;
    if(A1+A2+A3>=22){
        cout << "bust" << endl;
    }
    else cout << "win" << endl;

    return 0;
}

Measured memory_bytes: 764
s = input()
l = len(s)

arr = [1]*l

for i in range(l-2):
    if s[i] == "R":
        if s[i+1] == "R":
            arr[i+2] += arr[i]
            arr[i] = 0
        
for i in range(l-1,1,-1):
    if s[i] == "L":
        if s[i-1] == "L":
            arr[i-2] += arr[i]
            arr[i] = 0
        
print(*arr)

Measured memory_bytes: 6400
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

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

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))


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

    int n;
    cin >> n;
    int a;
    int sum = 0;
    rep (i, n)
    {
        cin >> a;
        sum += a;
    }

    cout << sum - n << "\n";
    return 0;
}



Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <cmath>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>

typedef  long long ll;
#define mop 1000000007
using namespace std;

int main() {
   
    ll n,h,w;
    cin >> n >> h >> w;
    cout << (n-h+1) * (n-w+1) << endl;
}




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

int main(){
  int n;
    cin >> n;
    vector<string> blue(n);
    for (int i = 0; i < n; i++) {
        cin >> blue[i];
    }
    int m;
    cin >> m;
    vector<string> red(m);
    for (int i = 0; i < m; i++) {
        cin >> red[i];
    }
 
    int ans = 0;
    auto calc = [&](string s) {
        int buf = 0;
        for (string t: blue) {
            if (t == s) buf++;
        }
        for (string t: red) {
            if (t == s) buf--;
        }
        return buf;
    };
 
    for (string t: blue) {
        ans = max(ans, calc(t));
    }
 
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define for_(i,n) for(int i=0;i<n;++i)
#define for_1(i,n) for(int i=1;i<=n;++i)
const int mod= 1e9 +7;
const int inf=1e7;
int n;
string s;

/*
dp[i][j]:- i th character of permutation is j
we need find sigma over j (dp[n][j])
i range from 0 to n-1

dp[i][j] = dp[i-1][1] + ... +dp[i-1][j-1] if(s[i-1] = '<')
         = dp[i-1][j+1] + ... +dp[i-1][n] if(s[i-1] = '>')
*/
void add_self(int &a, int b)
{
    a+=b;
    if(a>=mod)
    a-= mod;
}


/********************** Recursive Approach ***************************
int dp[3001][3001]; int pre[3001][3001];
int solve(int i, int j){

if(i==1 && j==1){ dp[i][j]=1; return 1;}
//else if(i==1) return 0;
else if(j>i) return 0;
else if(dp[i][j]!=-1) return dp[i][j];
else{
    dp[i][j]=0;
    if(s[i-2]=='<')
    {
        for_1(k,j-1)
        add_self(dp[i][j],solve(i-1,k));
    }
    else if(s[i-2]=='>')
    {
        for(int k=j;k<=n;++k)
        add_self(dp[i][j],solve(i-1,k));
    }
    
   return dp[i][j]; 
}
}

// --------------O(n^3)
*************************************** Recursive Approach ***************/
main()
{
   cin>>n>>s;
   
 /* memset(dp,-1,sizeof(dp));
    int ans=0;
    for_1(i,n)
        add_self(ans,solve(n,i));
    cout<<ans;
 */ 
 
 
 /*********** iterative ***********/
 vector<vector<int>> dpi(n+1,vector<int>(n+1));
 vector<vector<int>> pref(n+1,vector<int>(n+1));
dpi[1][1]=1;pref[1][1]=1;

 for(int len =2; len<=n;++len)
 {   
     for(int b =1;b<=len;++b)
     { 
         int l,r;
         if(s[len-2]=='<') l=1,r=b-1;
         else l=b,r=len-1;
         if(l<=r) 
         {
             int tmp = (pref[len-1][r]+mod-pref[len-1][l-1])%mod;
             add_self(dpi[len][b],tmp);
         
     
         }
         pref[len][b] = (pref[len][b-1] + dpi[len][b]) % mod;
        
         }
 }

 int answer = 0;
    for(int b = 1; b <= n; ++b) {
        add_self(answer, dpi[n][b]);
    }
 cout<<answer<<endl;
}





/*
typedef struct structure{
    int x,y;
} pt;
pt p0;
bool cmp(pt a, pt b)
{
    return cw(p0,a,b);
}
bool cw(pt a, pt b, pt c){
    return ((c.y-a.y)*(b.x-a.x)-(b.y-a.y)*(c.x-a.x))>=0
}



convex_hull(vector<pt>& points)
{
   // sort(points.begin(),points.end, cmp);// sorted according to y cordinate
    p0=points[0];
    sort(points.begin(),points.end, cmp);
    vector<pt> convexHull;
    stack<pt> temp;
    convexHull.push_back(points[0]);
    
    temp.push(points[0]);temp.push(points[1]);//temp.push(points[2]);
    pt top,top0;
    for(int it=2;it<points.size();++it)
    {   
        top=temp.top(); temp.pop(); top0=temp.top();
        pt next=points[it];
        if(cw(top0,top,next))
        {
            convexHull.push_back(top);
            temp.push(top);
            top0=top;
            top=next;
        }
        else
        {
          temp.push(next);  
        }
        
    }
    
}*/












Measured memory_bytes: 70784
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n, m, q = map(int, input().split())
abcd = [0] * q
for i in range(q):
    abcd[i] = list(map(int, input().split()))

def dfs(seq):
    if len(seq) == n:
        yield seq
        return
    if len(seq) == 0:
        _max = 1
    else:
        _max = seq[-1]
    for i in range(_max, m+1):
        new_seq = seq.copy()
        new_seq.append(i)
        yield from dfs(new_seq)

ans = 0
for s in dfs([]):
    tmp_ans = 0
    for a, b, c, d in abcd:
        if (s[b-1] - s[a-1]) == c:
            tmp_ans += d
    ans = max(ans, tmp_ans)
print(ans)


Measured memory_bytes: 78708
#include <stdio.h>
int main(void)
{
    char s[100001],t[50001];
    int m=0,n=0;
    
    scanf("%s",s);
    while((s[m]>='a')&&(s[m]<='z')){
        t[n]=s[m];
        m=m+2; n++;
    }
    printf ("%s\n",t);
    return 0;
}

Measured memory_bytes: 384
import sys
import math
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

n ,k = I2()
print(k*(k-1)**(n-1))

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

int main() {
  int h, w;
  cin >> h >> w;
  
  string a[h];
  for(int i = 0; i < h; i++) {
    cin >> a[i];
  }
  
  for(int i = 0; i < w + 2; i++) {
    cout << "#";
  }
  cout << endl;
  
  for(int i = 0; i < h; i++) {
    cout << "#" << a[i] << "#" << endl;
  }
  
  for(int i = 0; i < w + 2; i++) {
    cout << "#";
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 3076
#include <iostream>
#include <cstdio>
#include <queue>
#define N 100005
using namespace std;

int n, m, M = 1e9, d[N], ans[N];
struct st {
	int c1, c2;
};

bool operator < (st p, st q) {
	if (p.c1 != q.c1) return p.c1 > q.c1;
	else return p.c2 > q.c2;
}
priority_queue<st> qu;
string a;
int main()
{
	int i, j;
	bool z;
	st t;
	cin >> n >> m;
	cin >> a;
	qu.push({0, n});
	for (i = n - 1; i >= 0; i--) {
		if (a[i] - '0' == 1) continue;
		d[i] = M;
		z = 0;
		while (!qu.empty()) {
			t = qu.top();
			if (t.c2 - i <= m) {z = 1; break;}
			qu.pop();
		}
		if (z) {
			d[i] = min(d[i], t.c1 + 1);
			ans[i] = t.c2;
			qu.push({d[i], i});
		}
	}
	if(d[0] == M) {
		cout << -1 << endl;
		return 0;
	}
	for (i = 0; i < n; i = ans[i]) {
		printf("%d ", ans[i] - i);
	}
    return 0;
}


Measured memory_bytes: 2296
#include<stdio.h>
int main(){
  int i,j,k,n;
  int a[10000],b[10000];
  //printf("a\n");
  a[0]=2;
  a[1]=3;
  for(i=2;i<10000;i++){
    for(j=a[i-1]+2;;j+=2){
      for(k=i-1;k>=0;k--){
	//printf("k%d",);
	if(j%a[k]==0)break;
      }
      if(k==-1)break;
    }
    a[i]=j;
    //printf("\n%d\n",a[i]);  
  }
  b[0]=2;
  for(i=1;i<10000;i++){
    b[i]=b[i-1]+a[i];
  }
  //printf("a\n");
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    printf("%d\n",b[n-1]);
  }
  return 0;
}



Measured memory_bytes: 1980
#include <stdio.h>
#include <math.h>

struct Point { double x, y; };

void koch(int n, Point a, Point b) {
	if (n == 0) return;

	Point s, t, u;
	double th = M_PI * 60.0 / 180.0;
	s.x = (2.0 * a.x + 1.0 * b.x) / 3.0;
	s.y = (2.0 * a.y + 1.0 * b.y) / 3.0;
	t.x = (1.0 * a.x + 2.0 * b.x) / 3.0;
	t.y = (1.0 * a.y + 2.0 * b.y) / 3.0;
	u.x = (t.x - s.x) * cos(th) - (t.y - s.y) * sin(th) + s.x;
	u.y = (t.x - s.x) * sin(th) + (t.y - s.y) * cos(th) + s.y;

	koch(n - 1, a, s);
	printf("%.8f %.8f\n", s.x, s.y);
	koch(n - 1, s, u);
	printf("%.8f %.8f\n", u.x, u.y);
	koch(n - 1, u, t);
	printf("%.8f %.8f\n", t.x, t.y);
	koch(n - 1, t, b);
}

int main() {
	Point a, b;
	int n;

	scanf("%d", &n);

	a.x = 0;
	a.y = 0;
	b.x = 100;
	b.y = 0;

	printf("%.8f %.8f\n", a.x, a.y);
	koch(n, a, b);
	printf("%.8f %.8f\n", b.x, b.y);

	return 0;
}

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

int main() {
  string S; cin >> S;
  int Q; cin >> Q;

  int T, F;
  string C;
  bool rev = false;
  for (int i = 0; i < Q; i++) {
    cin >> T;
    if (T == 1) {
      if (rev) rev = false;
      else rev = true;

    } else {
      cin >> F >> C;
      if (F == 1) {
        if (rev) S.insert(S.length(), C);
        else S.insert(0, C);
      } else {
        if (rev) S.insert(0, C);
        else S.insert(S.length(), C);
      }
    }
  }
  if (rev) {
    for (int i = S.length()-1; i >= 0; --i) {
      cout << S[i];
    }
    cout << endl;

  } else {
    cout << S << endl;

  }

  return 0;
}


Measured memory_bytes: 900
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    static int abs(int a) {
        return Math.abs(a);
    }
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(bf.readLine());
        int ar [] =  new int[n];
        String line[] = bf.readLine().split("\\s");
        for(int i=0;i<n;++i) {
            ar[i] = Integer.parseInt(line[i]);
        }
        int[]dp = new int[n];
        dp[0] = 0;
        dp[1] = dp[0] + abs(ar[1] - ar[0]);
        for(int i=2;i<n;i++) {
            int ab1 = abs(ar[i] - ar[i-1]);
            int ab2 = abs(ar[i] - ar[i-2]);
            dp[i] = Math.min(ab1+dp[i-1] , ab2 + dp[i-2]);
        }
        System.out.println(dp[n-1]);
    }
}


Measured memory_bytes: 33616
#include <bits/stdc++.h>
using namespace std;
int main(void) {
    std::deque<int> deq{1,0,0};
    int tmp;
    char x,c,y;
    while (cin>>x>>c>>y) {
        if (x=='A' && y=='B') {
            tmp=deq[0];
            deq[0]=deq[1];
            deq[1]=tmp;
        } else if (x=='A' && y=='C') {
            tmp=deq[0];
            deq[0]=deq[2];
            deq[2]=tmp;
        } else if (x=='B' && y=='A') {
            tmp=deq[1];
            deq[1]=deq[0];
            deq[0]=tmp;
        } else if (x=='B' && y=='C') {
            tmp=deq[1];
            deq[1]=deq[2];
            deq[2]=tmp;
        } else if (x=='C' && y=='A') {
            tmp=deq[2];
            deq[2]=deq[0];
            deq[0]=tmp;
        } else if (x=='C' && y=='B') {
            tmp=deq[2];
            deq[2]=deq[1];
            deq[1]=tmp;
        }
    }
    if (deq[0]==1) {
        cout<<"A"<<endl;
    } else if (deq[1]==1) {
        cout<<"B"<<endl;
    } else if (deq[2]==1) {
        cout<<"C"<<endl;
    }
    deq.clear();
    deq.emplace_back(1);
    deq.emplace_back(0);
    deq.emplace_back(0);
}


Measured memory_bytes: 3092
def main():
    N = input()
    A = list(map(int, input().split()))
    cnt = 0
    for i in range(len(A)):
        if (i+1) % 2 != 0:
            if A[i] % 2 != 0:
                cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()

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

int main() {
    int N; cin >> N;
    double D; cin >> D;
    int ans = 0;
    rep(i, N){
        double x, y; cin >> x >> y;
        double d = sqrt(x*x + y*y);
        if(d <= D)ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3776
import java.util.Scanner;

public class Main {

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

		int N = in.nextInt();
		int[] abc = new int[3];
		abc[0] = in.nextInt();
		abc[1] = in.nextInt();
		abc[2] = in.nextInt();
		int[] ls = new int[N];
		for (int i = 0; i < N; i++) {
			ls[i] = in.nextInt();
		}

		int[] sums = new int[1 << N];
		for (int i = 0; i < sums.length; i++) {
			for (int j = 0; j < N; j++) {
				if ((i & (1 << j)) > 0) {
					sums[i] += ls[j];
				}
			}
		}

		int used = 0;
		int col = 0;
		int mp = solv(abc, sums, used, col);
		System.out.println(mp);
	}

	private static int solv(int[] abc, int[] sums, int used, int col) {
		if (abc.length == col) {
			return 0;
		}
		int minMp = 10000;
		for (int i = 1; i < sums.length; i++) {
			if ((i & used) != 0) {
				continue;
			}
			int bc = Integer.bitCount(i);
			int mp = 10 * (bc - 1) + Math.abs(abc[col] - sums[i]) + solv(abc, sums, used | i, col + 1);
			if (mp < minMp) {
				minMp = mp;
			}
		}
		return minMp;
	}
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
#include <iostream>
#include <ctime>
using namespace std;
#define _LL long long
#define rep(i, n) for (_LL i = 0; i < (_LL)(n); i++)
#define vecrep(itr, v) for (auto itr = (v).begin(); itr != (v).end(); itr++)

int main()
{
    int a, b; cin >> a >> b;
    int t = 0;
    int num = 1;
    while( num < b )
    {
        num += a - 1;
        t++;
    }
    cout << t << endl;
    return 0;    
}

Measured memory_bytes: 3612
import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int[] tx = new int[n];
		for(int i = 0; i < n; i++){
			tx[i] = sc.nextInt();
		}
		if(n == 1){
			System.out.print((int)(Math.abs(tx[0]-x)));
		}else{
			class Main2{
				public int ab(int a,int b){
					return a%b==0?b:ab(b,a%b);
				}
			}
			Main2 main2 = new Main2();
			int num = (int)(Math.abs(tx[0]-x));
			for(int i = 1; i < n; i++){
				 num = main2.ab(num,(int)(Math.abs(tx[i]-x)));
			}
			System.out.print(num);
		}
	}
}


Measured memory_bytes: 50572
#include<stdio.h>
int i,j,l;
char a[50][51];
int x[125000],min=150000;
int n,m,k,cntW,cntB,cntR,cnt=0;
#define I for(i=0;i<n;i++)
#define Wp cntW++
#define Bp cntB++
#define Rp cntR++
int main(void){
	scanf("%d %d",&n,&m);
	I{
		x[i]=0;
	}
	I{
		 scanf("%s",a[i]);
	}
	for(i=0;i<n-2;i++){
		for(j=i+1;j<n-1;j++){
			for(k=0;k<=i;k++){
				cntW=0;
					for(l=0;l<m;l++){
					if(a[k][l]=='W')Wp;
				}
				x[cnt]+=m-cntW;
			}
			for(k=i+1;k<=j;k++){
			cntB=0;
			for(l=0;l<m;l++){
				if(a[k][l]=='B')Bp;
			}
			x[cnt]+=m-cntB;
		}
		for(k=j+1;k<n;k++){
			cntR=0;
			for(l=0;l<m;l++){
					if(a[k][l]=='R')Rp;
				}
 				x[cnt]+=m-cntR;
			}
 			cnt++;
		}
	}
	for(i=0;i<cnt;i++){
		if(min>x[i]){
			min=x[i];
		}
	}
	printf("%d\n",min);
	return 0;
}


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

using namespace std;
int N, Z, W, a[4000], dp[2][2000][2002];

int dfs(bool isx, int i, int xi)
{
    if (dp[isx][i][xi] >= 0) {
        return dp[isx][i][xi];
    }
    int ret;
    if (i == N - 1)
        ret = abs(a[xi] - a[N - 1]);
    else {
        if (isx) {
            ret = max(dfs(false, i + 1, i), dfs(true, i + 1, xi));
        }
        else {
            ret = min(dfs(true, i + 1, i), dfs(false, i + 1, xi));
        }
    }
    return dp[isx][i][xi] = ret;
}

int main()
{
    //
    memset(dp, -1, sizeof(dp));
    scanf("%d %d %d", &N, &Z, &W);
    for (int i = 0; i < N; i++) {
        scanf("%d", &a[i]);
    }
    a[2000] = Z;
    a[2001] = W;
    printf("%d\n", dfs(true, 0, 2001));
}


Measured memory_bytes: 31744
#include<iostream>

int main() {
	int N;
	std::cin >> N;
	N %= 10;
	if (N == 2 || N == 4 || N == 5 || N == 7 || N == 9) std::cout << "hon" << std::endl;
	else if (N == 0 || N == 1 || N == 6 || N == 8) std::cout << "pon" << std::endl;
	else std::cout << "bon" << std::endl;
	return 0;
}

Measured memory_bytes: 3580
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
int main() {
    int l, r, d;
    cin >> l >> r >> d;
    int ans = 0;
    for(int i = l; i <= r; i++) {
        if(i % d == 0) {
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3648
#include <iostream>
#include <string>
#include <algorithm>

int main(){
  int n, k;
  std::string s;
  std::cin >> n >> k >> s;
  std::transform(s.begin()+k-1, s.begin()+k, s.begin()+k-1, tolower);
  std::cout << s << std::endl;
  return 0;
}

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

#define int long long
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,n) for(int i=1;i<=(int)(n);++i)
#define rep11(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end())
#define vdelete(v) (v).erase(unique(all(v)), (v).end())
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1000000007
#define INF LONG_LONG_MAX

string s;
map<char,int> m;

signed main() {
    cin >> s;
    rep(i,4) m[s[i]]++;
    int cnt=0;
    for(auto i : m) {
        if (i.se == 2) cnt++;
    }
    if (cnt==2) cout << "Yes" << endl;
    else cout << "No" << endl;
}



Measured memory_bytes: 256
//AtCoder 085
#include<bits/stdc++.h>
using namespace std;
typedef long long lld;

int main(){
	std::ios::sync_with_stdio(false);
	lld t=1;	//cin>>t;
	while(t--){
		lld n,y;
		cin>>n>>y;
		y=y/1000;
		int f=0;
		for(lld i=0;i<=n;i++){
			for(lld j=0;j<=n;j++){
				lld z1=n-(i+j);
				lld z2=y-(10*i+5*j);
				if(z1>=0 && z1==z2){
					cout<<i<<" "<<j<<" "<<z2<<"\n";
					f=1;
					i=n+2;
					j=n+2;	
				}
			}
		}
		if(f==0){
			cout<<"-1 -1 -1 \n";
		}
	}
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int main(){
 
 int k;
 char s[102];
 
 scanf ("%d", &k);
 scanf ("%s", &s);
 int l = strlen(s);
 
 if (k < l){
 
 for (int i = 0; i < k; i++){
  printf ("%c", s[i]);
 }printf ("...");
}
 else {
  for (int j = 0; s[j] != '\0'; j++){
   printf ("%c", s[j]);
  }
 }
 
 return 0;
}

Measured memory_bytes: 1712
#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define fi first
#define se second
#define debug(x) cout << #x << ": " << x << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> void Print(vector<T> v) {
  F0R(i, v.size()) {
    cout << v[i] << ' ';
  }
  cout << newl;
}

#if 1


// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  i64 n;
  vector<i64> as(5);
  cin >> n;
  F0R(i, 5) {
    cin >> as[i];
  }
  i64 r = 0;
  F0R(i, 5) {
    chmax(r, (n + as[i] - 1) / as[i]);
  }
  r += 4;
  cout << r;
}
#endif


Measured memory_bytes: 3620
N,L=map(int,input().split())
flag=0
judge=0
ans=[0]*N

for i in range(N):
    flag+=L+i

for i in range(N):
    ans[i]=abs(0-(L+i))

if (N+L)<=0:
    print(flag-(N+L)+1)
else :
    print(flag-min(ans))

Measured memory_bytes: 3064
#include<iostream>
#include<sstream>
#include<iomanip>
#include<bitset>
#include<cmath>
#include<string>
#include<string.h>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<limits.h>
using namespace std;

typedef long long LL;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int MAXN=1e5+10;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    LL h,n,tmp,ans=0;
    cin>>h>>n;
    for(int i=0;i<n;++i){
        cin>>tmp;
        ans+=tmp;
    }
    if(ans>=h)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<queue>
#include<cstdio>
#include<cctype>
#include<vector>
const int N=200007;
int read(){int x=0,c=getchar();while(!isdigit(c))c=getchar();while(isdigit(c))x=x*10+c-48,c=getchar();return x;}
std::vector<int>e[N];std::queue<int>q;
int n,m,ans,vis[N],deg[N][2];char col[N];
int main()
{
    n=read(),m=read(),scanf("%s",col+1);
    for(int i=1,u,v;i<=m;++i) u=read(),v=read(),e[u].push_back(v),e[v].push_back(u),++deg[u][col[v]=='B'],++deg[v][col[u]=='B'];
    for(int i=1;i<=n;++i) if(!deg[i][0]||!deg[i][1]) ++ans,q.push(i),vis[i]=1;
    for(int u;!q.empty();)
    {
	u=q.front(),q.pop();
	for(int v:e[u]) if(!vis[v]&&!--deg[v][col[u]=='B']) ++ans,q.push(v),vis[v]=1;
    }
    puts(ans==n? "No":"Yes");
}


Measured memory_bytes: 13184
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
#include <bitset>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define rep2(i, a)for(auto i : a)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x, std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
#define vec_unique(_a) _a.erase(std::unique(all(_a)), _a.end());
#define vvec vector<vector<ll>>
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
const int mod = 1000000007;
ll power(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x *= x; p /= 2; } else { a *= x; p--; } }return a; }
ll mpower(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x = x * x % mod; p /= 2; } else { a = a * x % mod; p--; } }return a; }
ll co(ll n, ll k) { ll a = 1; rep(i, 1ll, k) { a *= n - i + 1; a /= i; }return a; }
ll mc(ll n, ll m) { ll k = 1, l = 1; rep(i, n - m + 1, n + 1) k = k * i % mod; rep(i, 1, m + 1) l = l * i % mod; l = mpower(l, mod - 2); return k * l % mod; }

int main(void) {
	int n;
	cin >> n;
	vector<ll> a(n);
	ll sum = 0, t = 0;
	rep(i, 0, n) {
		cin >> a[i], sum += a[i];
		t += a[i] * a[i];
		t %= mod;
		sum %= mod;
	}
	ll ans = 0;
	ans = sum * sum - t;
	while (ans < 0)ans += mod;
	ans %= mod;
	printf("%lld\n", ans * mpower(2, mod - 2) % mod);
	return 0;
}


Measured memory_bytes: 4840
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    n = I()
    print((n-(n>>1))/n)
    return

#B
def B():
    n,k = LI()
    h = LI()
    ans = 0
    for i in h:
        if i >= k:
            ans += 1
    print(ans)
    return

#C
def C():
    n = I()
    a = LI()
    b = [(a[i],i+1) for i in range(n)]
    b.sort()
    ans = [b[i][1] for i in range(n)]
    print(*ans)
    return

#D
def D():

    return

#E
def E():

    return

#F
def F():

    return

#Solve
if __name__ == "__main__":
    C()


Measured memory_bytes: 66320
//============================================================================
// Name        : Fibonacci.cpp
// Author      : Ken
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <vector>
using namespace std;

int calcFibonacci(int n){
	vector<int> fib(n+1);
	if(n == 0){
		return 1;
	}else if(n == 1){
		return 1;
	}else{
		fib.at(0) = 1;
		fib.at(1) = 1;
		for(int i=2; i<n+1; i++){
			fib.at(i) = fib.at(i-1) + fib.at(i-2);
		}
		return fib.at(n);
	}
}

int main() {
	int n;
	cin >> n;
	cout << calcFibonacci(n) << "\n";

	return 0;
}



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

int main() {

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

    int MIN = p[0] ;
    int cnt = 1 ;
    for(int i=1;i<n;++i)
    {
        if(p[i]<MIN) cnt++ ;
        if(p[i]<MIN) MIN=p[i] ;
    } 

cout << cnt << endl ;

return 0 ;
}  

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

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

  ll cnt = 0;
  for (ll i = 0; i < n; ++i) {
    ll h = 0;
    cin >> h;
    cnt += (h >= k);
  }

  cout << cnt << endl;
  return 0;
}




Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <cmath>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>

typedef  long long ll;
#define mop 1000000007
using namespace std;

static const ll MAX = 1000001;
int exist[MAX] = {};

int main() {
   

    ll s;
    cin >> s;
    ll ans = 1;
    while(true){
//        cout << ans << " " << s << endl;
        exist[s] = 1;
        if(s%2==0){
            s /= 2;
        }else{
            s = s*3 + 1;
        }
        ans++;
        if(exist[s] == 1){
            break;
        }
    }
    cout << ans << endl;

}




Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;

int N;
int p[11];

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


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


void solve(long long K){
    ll ans = 0;
    for(int i=1;i<=K;i++)
        for(int j=1;j<=K;j++)
            for (int k=1;k<=K;k++)
                ans += __gcd(__gcd(i,j), k);
    cout << ans <<endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long K;
    scanf("%lld",&K);
    solve(K);
    return 0;
}


Measured memory_bytes: 3752
n,m=map(int,input().split())
C=[]
for i in range(m):
    p,y=map(int,input().split())
    C.append([p,y,i])
C.sort()
A=[""]*m
nowP=0
nowX=0
for c in C:
    p=c[0]
    y=c[1]
    i=c[2]
    if p==nowP:
        nowX+=1
        lenX=len(str(nowX))
        A[i]="0"*(6-lenP)+str(nowP)+"0"*(6-lenX)+str(nowX)
    else:
        nowP=p
        lenP=len(str(nowP))
        nowX=1
        lenX=1
        A[i]="0"*(6-lenP)+str(nowP)+"0"*(6-lenX)+str(nowX)
print(*A,sep="\n")

Measured memory_bytes: 32888
(* Vicfred
 * https://atcoder.jp/contests/abc170/tasks/abc170_b
 * brute force *)
let solve x y =
    let a, b = 4*x - y, y - 2*x in
    if a mod 2 = 0 && b mod 2 = 0 && a >= 0 && b >= 0 then "Yes" else "No"

let main =
    Scanf.scanf "%d %d" solve |> Printf.printf "%s\n"



Measured memory_bytes: 3660