akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<stdio.h>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
using namespace std ;

int n ;

void input ( ) {
    scanf ( "%d" , &n ) ;
}

void solve ( ) {
    double x = ( n / 2 ) + ( n % 2 ) ;
    printf ( "%.12lf\n" , x / n ) ;
}

int main ( ) {
    ios_base :: sync_with_stdio ( false ) ;
    cin.tie ( NULL ) ;
    input ( ) ;
    solve ( ) ;
    return 0 ;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
 
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define mod 1000000007

#define out1(a) cout<<#a<<" "<<a<<endl
#define out2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define out3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl

#define ft first
#define sd second
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
 
using namespace std;

signed main()
{
    fast;
    int n,m;
    cin>>n>>m;

    cout<<n*(n-1)/2 + m*(m-1)/2<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
  bool ans = false;
  int N;
  cin >> N;
  for (int a = 0; a <= 25; ++a) {
    for (int b = 0; b <= 15; ++b) {
        int total = 4*a + 7*b; // 合計金額
        if (total == N) ans = true; // 合計金額が X に一致したら答えをインクリメント
    }
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 3640
while str = STDIN.gets
  n = str.split(" ")
  a = n[0].to_i
  b = n[1].to_i
  c = n[2].to_i
  num = 0
  
  for i in a..b do
    if c % i == 0
      num += 1
    end
  end
  puts "#{num}"
end



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

int n,minj;
int A[36],B[36];
char a[36],b[36];

string judge(){
    for(int i=0;i<n;i++){
        if(a[i]==b[i]&&A[i]==B[i])continue;
        return "Not stable";
    }
    return "Stable";
}


int main(){
    cin>>n;
    
    for(int i=0;i<n;i++){
        cin>>a[i]>>A[i];
        b[i]=a[i];
        B[i]=A[i];
    }
    //bouble
    for(int i=0;i<n-1;i++)
        for(int j=n-1;j>i;j--){
            if(A[j]<A[j-1]){
                int Z=A[j];
                int z=a[j];
                A[j]=A[j-1];
                a[j]=a[j-1];
                A[j-1]=Z;
                a[j-1]=z;
            }
        }
    //select
    for(int i=0;i<n-1;i++){
        minj=i;
        for(int j=i+1;j<n;j++){
           if(B[j]<B[minj])minj=j;
    }
        int Z=B[minj];
        int z=b[minj];
        B[minj]=B[i];
        b[minj]=b[i];
        B[i]=Z;
        b[i]=z;
    }
    for(int i=0;i<n;i++)cout<<a[i]<<A[i]<<((i==n-1)?'\n':' ');
    cout<<"Stable"<<endl;
    for(int i=0;i<n;i++)cout<<b[i]<<B[i]<<((i==n-1)?'\n':' ');
    cout<<judge()<<endl;
    return 0;
}


Measured memory_bytes: 3216
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
        int m = sc.nextInt();
        long k = sc.nextLong();
		long [] in = new long [n+1];
        long [] in2 = new long [m+1];       
        for(int i=1;i<n+1;i++){                               
                               in[i]=in[i-1]+sc.nextLong();
                              }
        for(int i=1;i<m+1;i++){                            
                               in2[i]=in2[i-1]+sc.nextLong();
                              }
        int ans = 0;        
        int best = m;
        for(int i=0;i<=n;i++){if(in[i]>k){break;}
        for(int j=best;j>=0;j--){if(in[i]+in2[j]<=k){best=j;
                                                     ans=Math.max(ans,i+j);
                                                     break;
                                                    }
                                }        
        }                                                                  
		System.out.println(ans);
	}
}

Measured memory_bytes: 63372
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)

int n;
char s[101];
int main()
{
	cin >> n;
	REP(i, 0, n) cin >> s[i];

	bool flag = false;
	REP(i, 0, n) {
		if (s[i] == 'Y') {
			flag = true;
			break;
		}
	}
	if (flag) cout << "Four" << endl;
	else cout << "Three" << endl;
	return 0;
}

Measured memory_bytes: 256
N, K = map(int, input().split())
ans = 0
sunuke_list = set()

for _ in range(K):
    d = int(input())
    A_list = list((map(int, input().split())))
    sunuke_list |= set(A_list)

for i in range(1, N + 1):
    if i not in sunuke_list:
        ans += 1

print(ans)


Measured memory_bytes: 9052
//#define MYDEBUG
#include <bits/stdc++.h>
using namespace std;
static const int MAX = 200000;
int R[MAX];
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> R[i];
	}
	int maxv = -2000000000; //???????°??????????????????????????¨????
	int minv = R[0];
	for (int i = 1; i < n; ++i) { //????????§??????R[i]?????????????????°???????????????
		maxv = max(maxv, R[i] - minv); //?????§????????´??°
		minv = min(minv, R[i]); //???????????§???????°?????????????????????????
	}
	cout << maxv << endl;
	return 0;
}

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

int a[1000000],n;

int check(int m)
{
	int i;
	if(m==1)
	{
		for(i=1; i<n; ++i)
			if(a[i]>=a[i+1])
				return 0;
		return 1;
	}
	map<int,int> f;
	for(i=2; i<=n; ++i)
		if(a[i]<=a[i-1])
		{
			f.erase(f.upper_bound(a[i]),f.end());
			int k=a[i];
			++f[k];
			while(k>0&&f[k]==m)
				f.erase(k),++f[--k];
			if(!k)
				return 0;
		}
	return 1;
}

int main()
{
	cin>>n;
	int i;
	for(i=1; i<=n; ++i)
		scanf("%d",&a[i]);
	int l=1,r=n,m;
	while(l<r)
	{
		m=l+r>>1;
		if(check(m))
			r=m;
		else
			l=m+1;
	}
	cout<<l;
}


Measured memory_bytes: 1024
#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
#include <sstream>
#include <iomanip>
#include <set>
#include <stack>
#include <cassert>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef vector<P> vp;
typedef vector<PL> vpl;
typedef vector<vector<P>> vvp;
typedef vector<vector<PL>> vvpl;
const int INF = 1001001001;
const ll LINF = 1e16;
const double pi = 3.1415926535897932;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define REP(i, n) for(ll i = 0; i < n; i++)
#define FORMAP(it, m) for(auto it = m.begin(); it != m.end(); it++)
#define ff first
#define ss second
#define pb push_back

template <typename T>
T gcd(T a, T b) {
    return (a == 0) ? b : gcd(b%a, a);
}
template <typename T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}

bool p_comp_fs(const PL p1, const PL p2){ return p1.first < p2.first;};
bool p_comp_fg(const PL p1, const PL p2){ return p1.first > p2.first;};
bool p_comp_ss(const PL p1, const PL p2){ return p1.second < p2.second;};
bool p_comp_sg(const PL p1, const PL p2){ return p1.second > p2.second;};
template <typename T>
vector<T> uniquen(vector<T> vec){
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
    return vec;
}


int main(){
    ll N, M; cin >> N >> M;
    vl a(M), b(M), c(M);
    REP(i, M){
        cin >> a[i] >> b[i] >> c[i];
        a[i]--;b[i]--; c[i] = -c[i];
    }
    vl dist(N, LINF); dist[0] = 0;
    REP(i, N-1){
        REP(j, M){
            if(dist[a[j]] == LINF) continue;
            if(dist[b[j]] > dist[a[j]] + c[j]){
                dist[b[j]] = dist[a[j]] + c[j];
            }
        }
    }
    vb neg(N, false);
    REP(i, N){
        REP(j, M){
            if(dist[a[j]] == LINF) continue;
            if(dist[b[j]] > dist[a[j]] + c[j]){
                neg[b[j]] = true;
                dist[b[j]] = dist[a[j]] + c[j];
            }
            if(neg[a[j]]){
                neg[b[j]] = true;
            }
        }
    }
    if(neg[N-1]){
        cout << "inf" << endl;
    }
    else{
        cout << -dist[N-1] << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long in;
typedef pair<in,in> ii;
#define F first
#define S second
#define sqr(x) (x)*(x)
#define pb(x) push_back(x)
#define sz(x) (in)x.size()
#define MAX(a,b) a = max(a,b)
#define MIN(a,b) a = min(a,b)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rep(i,x,y) for(in i=x;i<(y);++i)
#define per(i,x,y) for(in i=y;i>=(x);--i)
#define IOS ios_base::sync_with_stdio(0);cin.tie(0)
/* start */

int main()
{
      IOS;
      in n,k,r,s,p,ans=0;
      string v;
      map<char,char> win;
      map<char,in> point;
      win['r'] = 'p';
      win['s'] = 'r';
      win['p'] = 's';
     
      cin >> n >> k >> r >> s >> p >> v;
      point['r'] = r;
      point['s'] = s;
      point['p'] = p;
      string t="";
      rep(i,0,v.size())
      {
            char c = win[v[i]];
            if(i-k >= 0)
            {
                  if(t[i-k] != c)
                  {
                        ans+=point[c];
                        t+=c;
                  }
                  else
                  {
                        t+='a';
                  }
            }
            else
            {
                  ans+=point[c];
                  t+=c;
            }
      }
      cout << ans << "\n";
}

Measured memory_bytes: 640
;; -*- coding: utf-8 -*-
(eval-when (:compile-toplevel :load-toplevel :execute)
  (defparameter OPT
    #+swank '(optimize (speed 3) (safety 2))
    #-swank '(optimize (speed 3) (safety 0) (debug 0)))
  #+swank (progn (ql:quickload '(:cl-debug-print :fiveam))
                 (shadow :run)
                 (use-package :fiveam)))
#+swank (cl-syntax:use-syntax cl-debug-print:debug-print-syntax)

;; BEGIN_INSERTED_CONTENTS
(defmacro dbg (&rest forms)
  #+swank
  (if (= (length forms) 1)
      `(format *error-output* "~A => ~A~%" ',(car forms) ,(car forms))
      `(format *error-output* "~A => ~A~%" ',forms `(,,@forms)))
  #-swank (declare (ignore forms)))

(defmacro define-int-types (&rest bits)
  `(progn
     ,@(mapcar (lambda (b) `(deftype ,(intern (format nil "UINT~A" b)) () '(unsigned-byte ,b))) bits)
     ,@(mapcar (lambda (b) `(deftype ,(intern (format nil "INT~A" b)) () '(signed-byte ,b))) bits)))
(define-int-types 2 4 7 8 15 16 31 32 62 63 64)

(declaim (inline println))
(defun println (obj &optional (stream *standard-output*))
  (let ((*read-default-float-format* 'double-float))
    (prog1 (princ obj stream) (terpri stream))))

(defconstant +mod+ 1000000007)

;; Body

(defun main ()
  (let* ((a (read))
         (b (read)))
    (cond ((>= a 13) (println b))
          ((>= 12 a 6) (println (floor b 2)))
          (t (println 0)))))

#-swank(main)


;; For Test
#+swank
(defun io-equal (in-string out-string &optional (func #'main))
  (labels ((ensure-last-lf (s)
             (if (and (> (length s) 0)
                      (eql (char s (- (length s) 1)) #\Linefeed))
                 s
                 (uiop:strcat s uiop:+lf+))))
    (equal (ensure-last-lf out-string)
           (with-output-to-string (out)
             (let ((*standard-output* out))
               (with-input-from-string (*standard-input* (ensure-last-lf in-string))
                 (funcall func)))))))

#+swank
(defun get-clipbrd ()
  (with-output-to-string (out)
    (run-program "C:/msys64/usr/bin/cat.exe" '("/dev/clipboard") :output out)))

#+swank (defparameter *this-pathname* (uiop:current-lisp-file-pathname))
#+swank (defparameter *dat-pathname* (uiop:merge-pathnames* "test.dat" *this-pathname*))

#+swank
(defun run (&optional thing (out *standard-output*))
  (let ((*standard-output* out))
    (etypecase thing
      (null ; Runs #'MAIN with the string on clipboard
       (with-input-from-string (*standard-input* (delete #\Return (get-clipbrd)))
         (main)))
      (string
       (with-input-from-string (*standard-input* (delete #\Return thing))
         (main)))
      (symbol (5am:run! thing))
      (pathname ; Runs #'MAIN with the string in a text file
       (with-open-file (*standard-input* thing)
         (main))))))

#+swank
(defun gen-dat ()
  (uiop:with-output-file (out *dat-pathname* :if-exists :supersede)
    (format out "")))

#+swank
(defun bench (&optional (out (make-broadcast-stream)))
  (time (run *dat-pathname* out)))


Measured memory_bytes: 16356
import java.util.Scanner;
import java.util.InputMismatchException;
class Main{
public static void main(String args[]){

    Scanner scan = new Scanner(System.in);
    try{
int S = scan.nextInt();
int h=0;
int m=0;
int s=0;



h=S / 3600;
m= (S % 3600) / 60;
s=(S % 3600) % 60;

System.out.println(h +":"+ m +":"+ s);

}catch (InputMismatchException e) {
        	System.out.println("try again!!");
        }





}
}



Measured memory_bytes: 26144
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np
# from numpy import cumsum  # accumulate
from fractions import gcd

def solve():
    N = II()
    A = LI()

    ans = A[0]
    for a in A:
        ans = gcd(ans, a)
    print(ans)

if __name__ == '__main__':
    solve()


Measured memory_bytes: 16292
#c
x, n = map(int, input().split())
p = list(map(int, input().split()))

import bisect as bis
p.sort()
now = x
k = 1

for i in range(150):
    pm = k * (-1)**k
    index = bis.bisect_left(p, now)
    if index < len(p) and p[index] == now:
        now += pm
        k += 1
    else:
        print(now)
        break

Measured memory_bytes: 9204
B = [[[0]*10 for i in range(3)] for j in range(4)]
n = int(input())

for i in range(n):
    b, f, r, v = map(int,input().split())
    B[b-1][f-1][r-1] += v

B_str = [[[str(x) for x in y] for y in z] for z in B]

for b in range(4):
    for f in range(3):
        l = B_str[b][f]
        print(" " + " ".join(l))
    if b != 3:
        print("####################")


Measured memory_bytes: 5604
#include <cstdio>
#include <cmath>

#define MAX_ROOT_P 1000000

bool primes[MAX_ROOT_P+1];

bool IsPrime(long num, long powp)
{
    if (primes[num]) {
        for (long i=2*num; i <= powp; i+=num) primes[i] = false;
    }
    return primes[num];
}

int main() {
    long N, P, gcd = 1, i;
    scanf("%ld %ld",&N,&P);
    if (N == 1) {
        printf("%ld\n", P);
        return 0;
    }
    long powp = (long)pow(P,(double)1/N);
    for (i = 2; i <= powp; i++) primes[i] = true;
    for (i = 2; i <= powp; i++) {
        if (!IsPrime(i,powp)) continue;
        long j = 0;
        for (; P % i == 0; P /= i)
            j++;
        if (j >= N)
            for (int k = 0; k < j / N; k++)
                gcd *= i;
    }
    printf("%ld\n", gcd);
    return 0;
}

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

int points[200][30];

int b_to_d(string s) {
  int res=0;
  int i=0;
  while (s.size()) {
    int k = (s[s.size()-1] - '0');
    s = s.substr(0, s.size()-1);
    res += k * pow(2, i++);
  }
  return res;
}


int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

  int n;cin>>n;
  vector<int> bits(n);
  for(int i=0;i<n;i++){
    string s="";
    for(int j=0;j<10;j++){
      char c;cin>>c;s+=c;
    }
    bits[i] = b_to_d(s);
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<11;j++){
      cin>>points[i][j];
    }
  }
  int res=-(1<<30);
  for(int i=1;i<(1<<10);i++){
    int t = 0;
    for(int j=0;j<n;j++){
      int p = __builtin_popcount( i & bits[j]);
      t += points[j][p];
    }
    res = max(t, res);
  }
  cout<<res<<endl;

  return 0;
}


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

using namespace std;

int main()
{
  string s;
  cin >> s;
  const string days[] =
  {"sun", "SAT", "FRI", "THU", "WED", "TUE", "MON", "SUN"};
  int ans = 0;
  for(int i = 0; i < 8 ; ++i)
  {
    if(days[i] == s) 
    {
      ans = i;
      break;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#if defined(DAIJOBU)
#include "/home/ichigo/includes.hpp"
#include "PP.hpp"
#define deb(x...) cerr << "[" << #x << "] = " << x << "\n";
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long lint;
typedef vector<lint> vlint;
typedef vector<vlint> vvlint;
typedef pair<lint, lint> plint;
typedef double ld;

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

int main() {
    ios::sync_with_stdio(false);
	cin.tie(0);
  	
	int a, b;
	cin >> a >> b;
	cout << (a < b? 0:10);
	return 0;
}



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

int main()
{
    int n;cin>>n;
    int k;cin>>k;
    vector<int>a(k),b(k);for(int i=0;i<k;i++)cin>>a[i]>>b[i];
    
    for(int i=0;i<k;i++){
        int m=n/2+n%2;
        if(n%2){
            a[i]=min(a[i],m*2-a[i]);
            b[i]=min(b[i],m*2-b[i]);
        }
        else{
            a[i]=min(a[i],m*2-a[i]+1);
            b[i]=min(b[i],m*2-b[i]+1);
        }
        int c;
        if(a[i]*2+1==n && b[i]*2+1==n)c=(n+1)%3;
        else if(a[i]*2+1==n)c=b[i];
        else if(b[i]*2+1==n)c=a[i];
        else c=min(a[i],b[i]);
        
        switch(c%3){
            case 1:cout<<1<<endl;break;case 2:cout<<2<<endl;break;case 0:cout<<3<<endl;break;
        }
    }
    
    return 0;
}




Measured memory_bytes: 3108
import sys
X=int(input())
X5=X**0.2
#print('X5=',X5,int(X5))
if X5-int(X5)==0:
    a=int(X5)
    b=0
    print(a,b)
    #print(1)
    sys.exit()
for a in range(1,int(X5)+1):
    for mb in range(a):
        if a**5+mb**5==X:
            print(a,-mb)
            #print(2)
            sys.exit()
for a in range(1,2*int(X5)):
    for b in range(a):
        if a**5-b**5==X:
            print(a,b)
            #print(3)
            sys.exit()
#print(4)


Measured memory_bytes: 9424
import math
A, V = map(int, input().split())  
B, W = map(int, input().split())  
T=int(input())
if  B>A:
    kyo=B-A
if A>B:
    kyo=A-B

sub=V-W
wari=0
if sub!=0 and sub>0:
    wari=math.ceil(kyo/sub)
if wari<=T and wari!=0:
    print("YES")
else:
    print("NO")

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


namespace _2_D
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int x = a[2];
            int y = a[3];
            int r = a[4];
            int w = a[0];
            int h = a[1];
            int ue = h - r;
            int sita = r;
            int migi = w - r;
            int hidari = r;
            if (x >= hidari && x <= migi && y >= sita && y <= ue) { Console.WriteLine("Yes"); }
            else
            {
                Console.WriteLine("No");

            }
        }
    }
}

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

int solve(int k)
{
	int total=0;
	for(int i=1;i<1000000;i++)
	{
		total=(total*10+7)%k;
		if(total==0)
		{
			return i;
		}
	}
	return -1;
}

int main()
{
	int k;
	cin>>k;
	cout<<solve(k);
	return 0;
}

Measured memory_bytes: 3636
n = int(input())
data = input().split(' ')
data[0], data[1] = int(data[0]), int(data[1])

H = input().split(' ')

m = 1000
j = 0
for i in range(len(H)):
  t = data[0] - (int(H[i]) * 0.006)
  if m > abs(data[1] - t):
    m = abs(data[1] - t)
    j = i
    
print(j + 1)


Measured memory_bytes: 3064
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int num = 1;
		for(int i=0; i<n; i++){
			if(num>k)num+=k;
			else num*=2;
		}
		System.out.println(num);
	}
}

Measured memory_bytes: 21588
package main
import "fmt"
func main(){
    // Your code here!
    
    var s string
    flag := false
    fmt.Scan(&s)
    for i:=0;i<3;i++{
        if s[i]==s[i+1]{
            fmt.Println("Bad")
            flag = true
            break
        }
    }
    if flag == false{
        fmt.Println("Good")
    }
}

Measured memory_bytes: 512
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.bigint, std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static File _f;
void file_io(string fn) { _f = File(fn, "r"); }
static string[] s_rd;
T _RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
T _RD(T = long)(File f) { while(!s_rd.length) s_rd = f.readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
T[] _RDA(T = long)(T fix = 0) { auto r = readln.chomp.split.to!(T[]); r[] += fix; return r; }
T[] _RDA(T = long)(File f, T fix = 0) { auto r = f.readln.chomp.split.to!(T[]); r[] += fix; return r; }
T RD(T = long)() { if (_f.isOpen) return _RD!T(_f); else return _RD!T; }
T[] RDA(T = long)(T fix = 0) { if (_f.isOpen)  return _RDA!T(_f, fix); else return _RDA!T(fix); }

size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

void chmin(T)(ref T x, T y) { x = min(x, y); } void chmax(T)(ref T x, T y) { x = max(x, y); }
bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
T lcm(T)(T x, T y) { return x * (y / gcd(x, y)); }

long mod = 10^^9 + 7;
//long mod = 998_244_353;
//long mod = 1_000_003;
void moda(T)(ref T x, T y) { x = (x + y) % mod; }
void mods(T)(ref T x, T y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(T)(ref T x, T y) { x = (x * y) % mod; }
void modpow(T)(ref T x, T y) { if (!y) { x = 1; return; } auto t = x; x.modpow(y>>1); x.modm(x); if (y&1) x.modm(t); }
void modd(T)(ref T x, T y) { y.modpow(mod - 2); x.modm(y); }

void main()
{
	auto D = RD;
	auto c = RDA;
	auto s = new long[][](D);
	foreach (i; 0..D)
		s[i] = RDA;

	foreach (i; 0..D)
	{
		writeln(s[i].MIN_POS!"a > b" + 1);
	}

	/*auto last = new int[](26);
	long ans;
	foreach (i; 0..D)
	{
		long dec;
		foreach (j; 0..26)
		{
			dec += c[j] * (i - last[j]);
		}
	}*/

	stdout.flush;
	debug readln;
}


Measured memory_bytes: 3264
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cout << #x << ": " << x << endl
#define repn(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, a) for(int i = 0; i < (a); i++)
#define all(v) v.begin(), v.end() 
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define endl '\n'
const int MAXN = 100005;
const int MOD = 1e9 + 7;

vi g[MAXN];
ll dp[MAXN][2];

void dfs(int c, int p){
	dp[c][0] = dp[c][1] = 1;
	for(int u : g[c]) if(u != p){
		dfs(u, c);
		dp[c][0] = (dp[c][0] * (dp[u][1] + dp[u][0])) % MOD;
		dp[c][1] = (dp[c][1] * dp[u][0]) % MOD;;
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	int n;
	cin >> n;
	rep(i, n - 1){
		int a, b;
		cin >> a >> b;
		g[a].pb(b);
		g[b].pb(a);
	}
	dfs(1, 0);
	cout << (dp[1][1] + dp[1][0]) % MOD << endl;
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/


Measured memory_bytes: 14208
#!/usr/bin/env python

def main():
    s = list(input())
    n = len(s)

    chk = 1
    if n % 2 == 0:
        for i in range(n):
            if i % 2 == 0:
                if s[i] != 'h':
                    chk = 0
                    break
            else:
                if s[i] != 'i':
                    chk = 0
                    break
    else:
        chk = 0

    if chk == 1:
        print('Yes')
    elif chk == 0:
        print('No')

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include <iostream>
using std::cout;
using std::cin;
using std::endl;

int main(void) {
    int a;
    int b;
    int c;
    cin >> a >> b >> c;
    if (a < b && b < c) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }   
    return 0;
}

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

int main(){
  int N, K;
  cin >> N >> K;
  int ct = 0;
  for(int i=0; i<N; i++){
    int h;
    cin >> h;
    if(h>=K) {
      ct ++;
    }
  }
  cout << ct << endl;
  return 0;
}


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

int main()
{
  int64_t N, K;
  int64_t now_a, move_count = 0, start_a;
  vector<int> a(200001);
  vector<bool> a_flag(200001, false);
  vector<bool> b_flag(200001, false);


  cin >> N >> K;
  for (int i = 1; i <= N; i++)
    cin >> a[i];
  now_a = 1;
  while (!a_flag[now_a])
  {
    a_flag[now_a] = true;
    now_a = a[now_a];
  }
  while (!b_flag[now_a])
  {
    b_flag[now_a] = true;
    now_a = a[now_a];
    move_count++;
  }
  start_a = now_a;
  now_a = 1;
  while (now_a != start_a)
  {
    now_a = a[now_a];
    K--;
    if (K == 0)
      break;
  }
  K = K % move_count;
  for (int i = 0; i < K; i++)
  {
    now_a = a[now_a];
  }
  cout << now_a << endl;
}


Measured memory_bytes: 3880
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int H, N, A, sum = 0;
  	cin >> H >> N;
  	for (int i = 0; i < N; i++) {
    	cin >> A;
      	sum += A;
    }
  	if (H <= sum) {
    	cout << "Yes" << endl;
    } else {
      	cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define pb push_back
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MOD 1000000007
int power(int n,int p)
{
  int ans=1,temp=n;
  n%=MOD;
  while(p!=0)
  {
    if(p%2==0)
    {
    	temp*=temp;
      	temp%=MOD;
      	p/=2;
    }
    else
    {	
      	ans*=temp;
      	ans%=MOD;
      	p--;
    }
  }
    return ans;
 }     
signed main()
{
    SPEED;
  	int n,k;
  	cin>>n>>k;
  	int dp[k+1],i,j,ans=0;
  	for(i=k;i>=1;--i)
    {
    	dp[i]=power(k/i,n);
      	for(j=2*i;j<=k;j+=i)
        {
          dp[i]=(dp[i]+MOD)-dp[j];
          dp[i]%=MOD;
        }
      	ans=(ans+i*dp[i])%MOD;
    }
  	cout<<ans;
}

Measured memory_bytes: 4420
def main():
    N = int(input())
    A = [0] + list(map(int, input().split())) + [0]
    total = 0
    for i in range(1, N+2):
        total += abs(A[i] - A[i-1])
    for i in range(1, N+1):
        ans = total + abs(A[i+1] - A[i-1]) - \
            abs(A[i] - A[i-1]) - abs(A[i+1] - A[i])
        print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 65132
#include <bits/stdc++.h>
using namespace std;
#define dhoom ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);  
typedef long long ll;
#define fi first
#define se second
#define sc scanf
#define pr printf
#define pb push_back
const ll inf = 1e18;
const int nax = 2e6 + 7;
ll mod;
int n , q;
using namespace std;
ll exp(ll a , ll b){
	if(b == 0)	return 1;
	int x = b % 2 == 0 ?   ((exp(a , b/2)%mod)*(exp(a , b / 2)%mod))%mod :  (a%mod*exp(a , b - 1) % mod)%mod;
	return x;
}
ll tree[nax];
ll arr[nax];
void update(int l , int r , int val , int tl , int tr , int pos){
	if(l > r)
		return ;
	if(tl == l && tr == r){
		tree[pos] += val;
		return ;
	}
	int mid = tl + (tr - tl)/2;
	update(l , min(r , mid),val ,  tl , mid , 2 * pos );
	update(max(l , mid + 1), r , val , mid + 1 , tr , 2 * pos + 1);
	//tree[pos] = tree[2*pos] + tree[ 2* pos + 1];
}
ll query(int ind, int tl , int tr , int pos){
	if(tl == tr)
		return tree[pos];
	int mid = tl + (tr - tl)/2;
	if(ind <= mid)
		return tree[pos] + query(ind , tl , mid , 2*pos);
	else 
		return tree[pos] + query(ind , mid + 1 , tr , 2*pos + 1);	
}
int main(int argc,char ** argv){
	dhoom;

	cin >> n >> q;
	for(int i = 0 ; i < q ; i++){
		int a , b , c , d;
		cin >> a;
		if(a == 0){
				cin >> b >> c >> d;
				update(b , c , d , 1 , n , 1);
		}
		else
		{
				cin >> b;
				cout << query(b , 1 , n , 1) << endl;
		}
	}
	return 0;
		
}



Measured memory_bytes: 5240
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define LL long long
#define st first
#define nd second
#define endl '\n'
using namespace std;

int main() {

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n, lasta = 0, firstb = 0, both = 0, ans = 0;
	string s;
	cin >> n;
	while(n--) {
		cin >> s;
		if(s[0] == 'B' && s[s.size() - 1] == 'A')
			++both;
		else if(s[0] == 'B')
			++firstb;
		else if(s[s.size() - 1] == 'A')
			++lasta;
		for(int i = 0; i < s.size() - 2; ++i)
			if(s[i] == 'A' && s[i + 1] == 'B')
				++ans;
	}
	if(lasta && firstb) {
		--lasta; --firstb;
		ans += both + 1 + min(lasta, firstb);
	}
	else if(firstb || lasta)
		ans += both;
	else ans += max(both - 1, 0);
	cout << ans << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> T;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define LLINF 1000000000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
int N,M;
int a[100100],b[100100];
vector<int> g[100100];
map<P,int> m;
bool used[100100];
int c[100100];
int par[100100];
int depth[100100];
bool isroot[100100];
void add_edge(int a,int b){
	g[a].pb(b);
	g[b].pb(a);
}
void dfs(int v,int p,int d){
	//printf("%d %d %d\n",v,p,d);
	used[v] = true;
	par[v] = p;
	depth[v] = d;
 	for(int i=0;i<g[v].size();i++){
		int u = g[v][i];
		if(u==p)continue;
		if(used[u]){
			if(depth[u]<depth[v]){
				c[u]--;
				c[v]++;
			}
		}else{
			dfs(u,v,d+1);
		}
	}
}
void dfs2(int v){
	for(int i=0;i<g[v].size();i++){
		int u = g[v][i];
		if(depth[u]!=depth[v]+1)continue;
		dfs2(u);
		c[v] += c[u];
	}
}
void debug(){
	for(int i=0;i<N;i++){
		printf("c[%d]=%d\n",i,c[i]);
	}
}
int main(){
	scanf("%d %d",&N,&M);
	for(int i=0;i<M;i++){
		scanf("%d %d",&a[i],&b[i]);
		a[i]--;b[i]--;
		if(a[i]>b[i])swap(a[i],b[i]);
		m[P(a[i],b[i])]++;
	}
	for(map<P,int>::iterator it=m.begin();it!=m.end();it++){
		if((it->sec)%2==1){
			add_edge((it->fi).fi,(it->fi).sec);
		}
	}
	for(int i=0;i<N;i++){
		if(!used[i]){
			isroot[i]=true;
			dfs(i,-1,0);
		}
	}
	for(int i=0;i<N;i++){
		if(isroot[i])dfs2(i);
	}
	//for(int i=0;i<N;i++)cout << par[i] << endl;
	for(int i=0;i<N;i++){
		//cout << c[i] << endl;
		if(isroot[i])continue;
		if(c[i]%2==0){
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
	return 0;
}

Measured memory_bytes: 15872
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long int;
#define INF             1e14
#define dd              double
#define MOD             1000000007
#define my_sizeof(type) ((char *)(&type+1)-(char*)(&type)) 
#define nl              cout<<endl
#define fill(a,val)     memset(a,val,sizeof(a))
#define mp              make_pair
#define endl            "\n"
#define pb              push_back
#define ff              first    
#define ss              second
#define SIZE            200005
#define all(v)          v.begin(),v.end()
#define s(ar,n)         sort(ar,ar+n)
#define rs(ar,n)        sort(ar, ar+n, greater<ll>()) 
#define oa(a,n)         for(ll i=0;i<n;i++)cout<<a[i]<<" ";nl
#define cn(a,n)         for(ll i=0;i<n;i++)cin>>a[i];
#define maxa(ar,N)      *max_element(ar,ar+N)
#define mina(ar,N)      *min_element(ar,ar+N)
#define fastio()        ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define printclock      cerr<<"Time : "<<1000*(long double)clock()/(long double)CLOCKS_PER_SEC<<"ms\n";
typedef tree<pair<ll,ll>, null_type, less<pair<ll,ll>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
ll power(ll x, ll y){
    ll res=1;x=x;
    while(y>0){
        if(y&1)
            res = (res*x);
        y = y>>1;
        x = (x*x);
    }
    return res;
}  
ll logtwo(ll n){
    if(n==1)
        return 0;
    return logtwo(n/2)+1;
}
signed main()
{
	fastio();   
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
	int t=1;
	//cin>>t;
	while(t--)
	{
		string s;
		cin>>s;
		for(ll i=0;i<s.size();i++)
		{
			if(s[i]=='?')
				cout<<"D";
			else
				cout<<s[i];
		}
	}
}

Measured memory_bytes: 3744
#include <bits/stdc++.h>
#define N      200010
#define int    long long
using namespace std;
int n;
int a[N] = {};
int read()
{
    int  s = 0, w = 1;
    char c = getchar();
    while ((c < '0' || c > '9') && c != '-')
        c = getchar();
    if (c == '-')
        w = -1, c = getchar();
    while (c <= '9' && c >= '0')
        s = (s << 3) + (s << 1) + c - '0', c = getchar();
    return s * w;
}
int pre[N] = {}, suf[N] = {};
int q[N << 1] = {}, h = 1, t = 0;
void push1(int x)
{
    while (h <= t && a[q[t]] >= a[x])
        suf[q[t]] = x - 1, --t;
    q[++t] = x;
}
void push2(int x)
{
    while (h <= t && a[q[t]] >= a[x])
        pre[q[t]] = x + 1, --t;
    q[++t] = x;
}
signed main()
{
    n = read();
    for (int i = 1; i <= n; ++i)
        a[i] = read(), pre[i] = 1, suf[i] = n;
    for (int i = 1; i <= n; ++i)
        push1(i);
    h = 1; t = 0;
    for (int i = n; i >= 1; --i)
        push2(i);
    int sum = 0;
    for (int i = 1; i <= n; ++i)
    {
        sum += (i - pre[i] + 1) * (suf[i] - i + 1) * a[i];
    }
    printf("%lld\n", sum);
    return 0;
}


Measured memory_bytes: 7552
//Author: Fuadul Hasan(fuadul202@gmail.com)
//BSMRSTU,Gopalganj
#include<bits/stdc++.h>
using namespace std;int tc = 1;
#define happy ios::sync_with_stdio(false);
#define coding  cin.tie(0);
#define F first
#define S second
#define mp make_pair
#define ll long long
#define Pi atan(1)*4
#define pb  push_back
#define vpr vector<pr> 
#define pr pair<int, int> 
#define vi std::vector<int>
#define vll std::vector<ll>
#define YES printf("YES\n");
#define NO printf("NO\n");
#define Yes printf("Yes\n");
#define No printf("No\n");
#define all(n) n.begin(),n.end()
#define point(x) setprecision(x)
#define Test printf("Case %d: ",tc++);
#define Unique(c) (c).resize(unique(all(c))-(c).begin())
#define vout(v) for (auto z: v) cout << z << " "; cout << endl;

#define error(args...) {vector<string>_v=split(#args,',');err(_v.begin(),args);cout<<endl;}
vector<string> split(const string &s, char c) {vector<string>v; stringstream ss(s); string x;
while (getline(ss, x, c))v.emplace_back(x); return move(v);} void err(vector<string>::iterator it) {}
template<typename T, typename... Args>void err(vector<string>::iterator it, T a, Args...args) {
cout << it->substr((*it)[0] == ' ', it->length()) << " = " << a << " "; err(++it, args...);}

const int M = 1e9 + 7;
const ll  Inf = (ll)2e18 + 5;
const int N   = 2e5 + 5;
ll vis[N],res[N];

int solve() 
{
  //happy coding

  string s;
  string t;
  cin>>s>>t;
	vector<int>m[26];
  for(int i=0;s[i];i++){
  	m[s[i]-'a'].pb(i);
  }

  for(int i=0;t[i];i++){
  	if(m[t[i]-'a'].size()==0){
  		cout<<-1<<endl;
  		return 0;
  	}
  }
  int n = s.size();
  int idx = -2;
  int sum = 0;
  for(int i=0;t[i];i++){
  	auto x = lower_bound(all(m[t[i]-'a']),idx+1);
  	if(x != m[t[i]-'a'].end()){
  		idx = *x;
  	}else{
  		sum ++;
  		idx = m[t[i]-'a'][0];
  	}
  }

  cout<<sum*s.length()+idx+1<<endl;

  
  return 0;
}
int main(){
  int test = 1;
  //scanf("%d", &test);
  while (test--)solve();return 0;
} 


Measured memory_bytes: 1216
import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int n = scan.nextInt();
		int maxv = Integer.MIN_VALUE;
		int minv = Integer.MAX_VALUE;
		
		for(int i = 0; i < n; i++){
			int r = scan.nextInt();
			if(i == 0){
				minv = r;
				continue;
			}
			maxv = Math.max(maxv, r - minv);
			minv = Math.min(minv, r);
		}
		System.out.printf("%d\n", maxv);
	}
}

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

int main(){
  string S;

  cin>>S;
  int A=0,B=0;

  for(int i=0;i<S.size();i++){
  	if(i%2==0){
  		if(S.at(i)=='0')
  			A++;
  	}
  	else
  		if(S.at(i)=='1')
  			A++;
  }

  for(int i=0;i<S.size();i++){
  	if((i+1)%2==0){
  		if(S.at(i)=='0')
  			B++;
  	}
  	else
  		if(S.at(i)=='1')
  			B++;
  }
  

  cout<< min(A,B) <<endl;
  
}


Measured memory_bytes: 512
use std::io::stdin;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().ok().unwrap()
}

fn read_vec<T: FromStr>() -> Vec<T> {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim()
        .split_whitespace()
        .map(|x| x.parse().ok().unwrap())
        .collect()
}

fn main() {
    let n: u32 = read();
    let a: Vec<u32> = read_vec();
    println!("{}", a.iter().max().unwrap() - a.iter().min().unwrap());
}


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

int main() {
  int a, b, c, d, e, k;
  cin >> a >> b >> c >> d >> e >> k;
  if (e - a <= k) {
    cout << "Yay!" << endl;
  } else {
    cout << ":(" << endl;
  }
}


Measured memory_bytes: 256
#include <stdio.h>

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <cmath>

using namespace std;

void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }

template <typename T, typename V>
void __print(const pair<T, V> &x) {
    cerr << '{';
    __print(x.first);
    cerr << ',';
    __print(x.second);
    cerr << '}';
}
template <typename T>
void __print(const T &x) {
    int f = 0;
    cerr << '{';
    for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
    cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
    __print(t);
    if (sizeof...(v)) cerr << ", ";
    _print(v...);
}
#ifdef LOCAL
#define debug(x...)               \
    cerr << "[" << #x << "] = ["; \
    _print(x)
#else
#define debug(x...)
#endif

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

    int A, B, C;
    cin >> A >> B >> C;
    if(A+B+C >=22){
        cout << "bust" << endl;
    }else{
        cout << "win" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, e) for (int i = (int)(s); i <= (int)(e); i++)
#define printYesNo(is_ok) puts(is_ok ? "Yes" : "No");
#define SORT(v) sort(v.begin(), v.end());
#define RSORT(v) sort(v.rbegin(), v.rend());
#define REVERSE(v) reverse(v.begin(), v.end());

template <typename T>
void printlnVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << endl;
  }
}

template <typename T>
void printVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << " ";
  }
  cout << endl;
}

int main()
{
  int n, m;
  cin >> n >> m;
  vector<int> dp(n + 1, 1e9);
  dp[0] = 0;
  vector<int> c(m);
  rep(i, m)
  {
    cin >> c[i];
  }
  
  RSORT(c);
  rep(i, n + 1) rep(j, m)
  {
    if(dp[i] != 1e9)
    {
      int price = i + c[j];
      if(price > n)
        continue;
      dp[price] = min(dp[price], dp[i] + 1);
    }
  }

  int ans = dp[n];
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3196
from sys import stdin
D, G = [int(x) for x in stdin.readline().rstrip().split()]
P = []
C = []
for _ in range(D):
    p, c = [int(x) for x in stdin.readline().rstrip().split()]
    P.append(p)
    C.append(c)
ans = 10**9

for i in range(1 << D):
    score = 0
    cnt = 0

    # 全部解く
    for j in range(D):
        if i >> j & 1:
            score += C[j]
            score += P[j]*(j+1)*100
            cnt += P[j]

    # 一部解く(全て解く場合もある)
    for k in range(D-1, -1, -1):
        if i >> k & 1:
            continue
        if score >= G:
            break
        S = (k+1)*100
        for l in range(P[k]+1):
            score += S
            cnt += 1
            if score >= G:
                break
    ans = min(ans, cnt)
print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define rep(i, l, r) for(int i = (l), i##end = (r);i <= i##end;++i)
using std::cin; using std::cout;
const int maxn = 200200;
typedef long long ll;
const int mod = 998244353;
typedef char AC[20][maxn];
int q;
char s[maxn], t[maxn];
AC bz0, bz1;
inline int get(char x,char y){ 
	if(!x || !y) return x | y;
	return x == y ? x == 'A' ? 'B' : 'A' : 0;
}
inline std::string get(int l,int r, const AC & bz) {
	std::string ret = {bz[0][l]};
	++ l; int R = 0;
	for(int i = 19;i >= 0;--i) {
		if(l + (1 << i) - 1 <= r) {
			R = get(R, bz[i][l]), l += 1 << i;
		}
	}
	if(R) ret += char(R);
	if(ret.size() == 2 && ret[0] == ret[1]) ret = get(ret[0], ret[1]);
	return ret;
}
inline bool chk(std::string s0, std::string s1) {
	if(s0.size() == 1 || s1.size() == 1) return s0 == s1;
	return s0.size() == s1.size();
}
int main() {
	std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> s + 1 >> t + 1;
	int n = strlen(s + 1), m = strlen(t + 1);
	rep(i, 1, n) bz0[0][i] = s[i];
	rep(i, 1, 20) for(int j = 1;j + (1 << i) - 1 <= n;++j) bz0[i][j] = get(bz0[i - 1][j], bz0[i - 1][j + (1 << i - 1)]);
	rep(i, 1, m) bz1[0][i] = t[i];
	rep(i, 1, 20) for(int j = 1;j + (1 << i) - 1 <= m;++j) bz1[i][j] = get(bz1[i - 1][j], bz1[i - 1][j + (1 << i - 1)]);
	cin >> q;
	rep(i, 1, q) {
		int l0, r0, l1, r1;
		cin >> l0 >> r0 >> l1 >> r1;
		cout << (chk(get(l0, r0, bz0), get(l1, r1, bz1)) ? "YES" : "NO") << '\n';
	}
}


Measured memory_bytes: 7808
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
#include <cstring>
using namespace std;

using ll = long long;
using P = pair<int, int>;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

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

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

    int N, Z, W;
    cin >> N >> Z >> W;
    vector<int> a(N);
    for(int i = 0; i < N; ++i)  cin >> a[i];
    int ans = abs(a[N - 1] - W);
    if(N > 1)   chmax(ans, abs(a[N - 1] - a[N - 2]));
    cout << ans << endl;
}

Measured memory_bytes: 3636
import java.util.*;


public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int H = sc.nextInt();
        int W = sc.nextInt();
        int N = sc.nextInt();

        int paint = Math.max(H,W);

        int ans = (N +paint-1) / paint;

        System.out.println(ans);

    }
}






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

#define PI 3.14159265359
#define rep(i,a,n) for(int i=a;i<(int)n;++i)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define descSort(a) sort(a.begin(),a.end(),std::greater<int>())
using namespace std;
typedef long long ll;
const ll INF = 1e9 + 7;
ll gcd(ll x,ll y){
    if(x%y==0)return y;
    return gcd(y,x%y);
}
ll LCM(int a, int b){
    return a*b/gcd(a,b);
}
int counterBit(int x){
    if(x==0)return 0;
    return counterBit(x>>1)+(x&1);
}
int main(void)
{
    int n;
    cin>>n;
    vector<int> a(n);
    int g[20][20];
    rep(i,0,20){rep(j,0,20)g[i][j]=-1;}

    rep(i,0,n){
        cin>>a[i];
        rep(j,0,a[i]){
            int x,y;
            cin>>x>>y;
            x--;
            g[i][x]=y;
        }
    }

    int ans=0;
    for(int bit=0;bit<(1<<n);bit++){
        vector<int> honest(n);
        // 正直者を仮定する
        rep(i,0,n){          
            if((1<<i)&bit){ // iの人の証言が正しい時
                honest[i]=1;
            }
        }
        // 仮定と矛盾がないか検証する
        bool ok=true;
        rep(j,0,n){
            if(honest[j]){
                rep(k,0,n){
                    if(g[j][k]==-1)continue; // 証言していない場合
                    // 証言と矛盾があった場合,この組の正直者はあり得ない
                    if(g[j][k] !=honest[k]) ok=false;
                }
            }
        }
        if(ok)ans=max(ans,counterBit(bit));
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
let un = Array.init 100010 (fun a -> a)

let depth = Array.make 100010 0

let rec find elt =
if un.(elt) = elt then elt else (
    let root = find (un.(elt)) in
    un.(elt) <- root;
    root
  )

let rec unite x y =
  let x = find x in
  let y = find y in
  if x == y then ()
  else if depth.(x) < depth.(y) then un.(x) <- y
  else (
    un.(y) <- x;
    if depth.(x) = depth.(y) then depth.(x) <- depth.(x) + 1
  )

let main () =
  let n, m = Scanf.scanf "%d %d\n" (fun a b -> a, b) in
  let p = Array.init n (fun _ -> Scanf.scanf "%d " (fun a -> a)) in
  let xy = Array.init m (fun _ -> Scanf.scanf "%d %d\n" (fun a b -> a, b)) in
  Array.iter (fun (x, y) -> unite x y) xy;
  let ans = ref 0 in
  for i = 1 to n do (
    if find i = find p.(i-1) then ans := succ !ans;
  ) done;
  print_int !ans;;

let _ = main ()


Measured memory_bytes: 8704
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> x(n),y(n);
  for(int i=0;i<n;i++){
    cin >> x[i] >> y[i];
  }
  map<pair<int,int>,int> mp;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      if(i==j){
        continue;
      }
      mp[make_pair(x[i]-x[j],y[i]-y[j])]++;
    }
  }
  int t=0;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      if(i==j){
        continue;
      }
      t=max(t,mp[make_pair(x[i]-x[j],y[i]-y[j])]);
    }
  }
  cout << n-t << endl;
}

Measured memory_bytes: 384