akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
using namespace std;
 
#define ff                  first
#define ss                  second
#define endl                "\n"
#define loop(i,s,e)         for(int i=s;i<e;i++)
// #define int                 long long
#define vi                  vector<int> 
#define S(v)                sort(v.begin(),v.end())
#define RS(v)               sort(v.rbegin(),v.rend())
#define R(v)                reverse(v.begin(),v.end())
#define mxpq(T)             priority_queue <T>
#define mnpq(T)             priority_queue<T,vector<T>,greater<T>>
#define prv(v)              for(auto &x : v)cout << x << " ";
#define piirv(v)            for(auto &x : v)cout << x.ff << " " << x.ss << endl;
#define prvv(v)             for(auto &x : v)for(auto &y : x.ss)cout << y << " ";
#define mp                  make_pair
#define pii                 pair<int,int>
#define mset(a,f)           memset(a , f , sizeof(a))
#define pb                  push_back
#define inf                 INT_MAX
#define INF                 LLONG_MAX
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> oset;

const int N = 2e6 + 6;
int A[N];
int n;

#define pi 3.1415926535897932

void solve()
{
	long double l;
	cin >> l;

	cout << (2*(pi)*l);
}
 
int32_t main()
{
 
cout<<fixed<<setprecision(16);

ios_base:: sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
 	

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

Measured memory_bytes: 3832
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>

using namespace std;

#define max(a,b) (a > b ? a : b)
#define min(a,b) (a < b ? a : b)
#define lim 1000000000

int main(){
	vector<int> x;
	int n,k,res = lim;
	cin >> n >> k;
	for(int i=0;i<n;++i){
		int a;
		cin >> a;
		x.push_back(a);
	}
	for(int i=0;i<=n-k;++i){
		if(x[i] < 0 && x[i+k-1] < 0){
			res = min(res,abs(x[i]));
		}else if(x[i] >=0 && x[i+k-1] >= 0){
			res = min(res,x[i+k-1]);
		}else{
			res = min(res,min(abs(x[i]),abs(x[i+k-1]))*2+max(abs(x[i]),abs(x[i+k-1])));
		}
	}
	cout << res << endl;
}

Measured memory_bytes: 892
n, m = map(int, input().split())

n_ac = [0] * n
n_wa = [0] * n
for i in range(m):
    p, s = input().split()
    p = int(p) - 1

    if s == 'AC':
        n_ac[p] += 1
    elif n_ac[p] == 0:
        n_wa[p] += 1

ans1 = ans2 = 0
for i in range(n):
    if n_ac[i] > 0:
        ans1 += 1
        ans2 += n_wa[i]

print(ans1, ans2)


Measured memory_bytes: 4596
#include <stdio.h>

int main()
{
	int N, K;
	int h[100000]={};
    int cnt = 0;

	scanf("%d %d", &N, &K);

	for(int i=0; i<N; i++){
		scanf("%d", &h[i]);
        if(K <= h[i])   cnt++;
	}

	printf("%d\n", cnt);

	return 0;
}

Measured memory_bytes: 512
s = input()
count = 0

n = len(s)
for i in s:
    count += 1
    if i == 'U' or i == 'D':
        count += 0
    elif count % 2 == 1:
        if i == 'L':
            print('No')
            break
    elif count % 2 == 0:
        if i == 'R':
            print('No')
            break
    if count == n:
        print('Yes')
        break

Measured memory_bytes: 3060
N,Q = list(map(int,input().split()))
S = (input())
lr = [list(map(int,input().split())) for _ in range(Q)]

cnt = [0]*N
tmp = 0
for i,c in enumerate(S):
    if tmp == 0 and c == "A":
        tmp =1
        cnt[i] = cnt[i-1]
    elif tmp == 1 and c == "C":
        tmp =0
        cnt[i] = cnt[i-1]+1
    else:
        tmp = int(c == "A")
        cnt[i] = cnt[i-1]

for l,r in lr:
    print(cnt[r-1]-cnt[l-1])

Measured memory_bytes: 30680
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
      int tmp;
      int dp[31];
      cin>> tmp;
      do{
            fill(dp,dp+31,0);
            dp[0] = 1;
            for (int i = 0; i<tmp;i++)
            {
                  for(int j = 1;j < 4;j++)
                        dp[i+j] += dp[i];
            }
            cout << dp[tmp]/3650 + 1<<endl;
            cin >> tmp;
      }while(tmp);

}

Measured memory_bytes: 1160
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <map>
#include <vector>
#include <string.h>
#define REP(i,n) for(int i=0;i<(int)n;i++)
#define REP1(j,n) for(int j=0;j<(int)n;j++)
#define REPD(i,n) for(int i=n;i>=0;i--)
#define REPD1(j,n) for(int j=n;j=>0;j--)
#define REPS(i,n) for(int i=1;i<=(int)n;i++)
#define REPS1(j,n) for(int j=1;j<=(int)n;j++)
#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;

int main(void) {
	int a, b, c, x;
	int count=0;
	cin >> a >> b >> c >> x;
	for (int i = 0; i <= a;i++) {
		for (int j = 0; j <=b;j++) {
			for (int k = 0; k<=c; k++) {
				if (x == i * 500 + j * 100 + k * 50) {
					count++;
				}
			}
			
		}
	}
	cout << count << endl;
	return 0;
}



Measured memory_bytes: 256
import sys
import numpy as np
from numba import njit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main(H):
    dp = np.zeros_like(H)
    dp[1] = abs(H[1] - H[0])
    for n in range(2, len(H)):
        x = dp[n - 1] + abs(H[n - 1] - H[n])
        y = dp[n - 2] + abs(H[n - 2] - H[n])
        dp[n] = min(x, y)
    return dp[-1]

signature = '(i8[:],)'
if sys.argv[-1] == 'ONLINE_JUDGE':
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main', signature)(main)
    cc.compile()

from my_module import main

H = np.array(read().split(), np.int64)[1:]

print(main(H))

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

using namespace std;

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define RREP(i,s,n) for(lli i=s;i>=n;i--)
#define MOD 1000000007
#define NUM 2520
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define INF (1LL<<50)

signed main(){

	lli n;
	cin>>n;

	lli a,b;
	cin>>a>>b;

	REP(i,1,n){
		lli ta,tb;
		cin>>ta>>tb;

		lli k = max((a-1)/ta+1,(b-1)/tb+1);
		a = ta*k;
		b = tb*k;
		if(DEBUG)cout<<"a="<<a<<" b="<<b<<endl;
	}
	cout<<a+b<<endl;

	return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-

import sys
from bisect import bisect_right

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def bisearch_min(mn, mx, func):
    """ 条件を満たす最小値を見つける二分探索 """

    ok = mx
    ng = mn
    while ng+1 < ok:
        mid = (ok+ng) // 2
        if func(mid):
            # 下を探しに行く
            ok = mid
        else:
            # 上を探しに行く
            ng = mid
    return ok

def check(m):
    # 元々P番目以内なのでOK確定
    if m >= N - P:
        return True
    # 自分に全投票した最善の状態
    target = A[m] + M
    # 残りの票数合計
    total = M * (V-1)
    # 絶対勝てないやつがP個以上あればNG確定
    r = bisect_right(A, target)
    if r <= N - P:
        return False
    # 元々自分より下に全投票(そうしても勝てるから)
    total -= M * m
    # P番目ギリギリに入れればいいので、関係ない上位層にも全投票
    total -= M * (P-1)
    # ボーダー上のものに、自分との差分ギリギリ(同率)まで投票
    for i in range(m+1, N-P+1):
        total -= target - A[i]
    # 票数が使い切れていればOK
    return total <= 0

N, M, V, P = MAP()
A = LIST()

A.sort()
res = bisearch_min(-1, N-1, check)
ans = N - res
print(ans)


Measured memory_bytes: 15148
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define bug1( x ) {cerr << (#x) <<"="<< x << endl;}
#define bug2( x , y ) {cerr << (#x) <<"="<< (x) << "    " << (#y) << "="<< (y) << endl;}
#define bug3( x , y , z ) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << endl;}
#define bug4( x , y , z , w) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << endl;}
#define bug5( x , y , z , w ,p) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << "    " << (#p) <<"="<< p << endl;}
#define bug6( x , y , z , w ,p , q) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << "    " << (#p) <<"="<< p << "    " << (#q) <<"="<< q << endl;}
#define bugn( x , n ) {cerr << (#x) <<":";for(int i=0;i<n;i++)cerr << x[i] <<"  "; cerr << endl;}
#define bugnm( x , n , m ) {cerr << (#x)<<endl;for(int i=0;i<n;i++){cerr << "Row #" << i<< ":";for(int j=0;j<m;j++)cerr << x[i][j] << "   ";cerr << endl;}}
typedef long long ll;
typedef long double ld;
using namespace std;

typedef pair<int,int> ii;
typedef pair<ii,int> iii;




const int maxn = 51, maxm = 101;
vector<pair<int,int>>g[maxn];
int coin_w[maxm],time_w[maxm],coin_v[maxn],time_v[maxn];
int dis[51][25001],vis[51][25001];
int n,m,s;
void dijkstra(int source){
	for(int i=0;i<51;i++){
		for(int j=0;j<25001;j++){
			dis[i][j]=1e18;
			vis[i][j]=0;
		}
	}
	s = min( s , 2500ll );
	dis[source][s]=0;
	priority_queue< iii , vector< iii > , greater< iii > > pq;
	pq.push({{dis[source][s],s},source});
	
    #define t first.first
    #define c first.second
    #define u second
    
	while( pq.size() ){
		iii x = pq.top();pq.pop();
		if( vis[x.u][x.c] )continue;
	    //bug4(x.u,x.t,x.c,dis[x.u][x.c]);
		for(auto [v,i]:g[x.u]){
			int cur_time = x.t + time_w[i];
			int cur_coin = x.c - coin_w[i];
			//bug3(v,cur_time,cur_coin);
			if( cur_coin < 0 )continue;
			if( dis[v][cur_coin] > cur_time ){
				dis[v][cur_coin] = cur_time;
				pq.push({{cur_time,cur_coin},v});
			}
		}
		
		x.c += coin_v[x.u];
		x.t += time_v[x.u];
		//bug4(x.u,x.t,x.c,dis[x.u][x.c]);
		if( x.c <= 2500 && dis[x.u][x.c] > x.t ){
			//bug3(x.u,x.t,x.c);
			dis[x.u][x.c] = x.t;
			pq.push({{x.t,x.c},x.u});
		}
	}
	
}
int32_t main(){
	IOS
	cin>>n>>m>>s;
	for(int i=1;i<=m;i++){
		int a,b;cin>>a>>b>>coin_w[i]>>time_w[i];
		g[a].push_back({b,i});
		g[b].push_back({a,i});
	}
	for(int i=1;i<=n;i++){
		cin>>coin_v[i]>>time_v[i];
	}
	dijkstra(1);
	for(int i=2;i<=n;i++){
		//cout << dis[i][0] << endl;
	}
	for(int i=2;i<=n;i++){
		int ans = 1e18;
		for(int j=0;j<=2500;j++){
			ans = min( ans , dis[i][j] );
		}
		cout << ans << endl;
	}
	
	
}
/*
 * long long or int?
 * index out of bound?
 * Tested on own test case?corner?
 * Make more general solution.
 * Read Read Read Read ....
 */


Measured memory_bytes: 26292
import java.io.*;
import java.util.*;
import java.util.function.*;

final class Solver {
	void solve(Supplier<String> sc) {
		int H = Integer.parseInt(sc.get());
		int W = Integer.parseInt(sc.get());
		int K = Integer.parseInt(sc.get());
		var grid = new char[H][W];
		for (int i = 0; i < H; i++) {
			var row = sc.get().toCharArray();
			grid[i] = row;
		}

		int result = 0;
		for (int i = 0; i < 1 << H; i++) {
			for (int j = 0; j < 1 << W; j++) {
				int count = 0;
				for (int y = 0; y < H; y++) {
					if ((i & 1 << y) == 0) continue;
					for (int x = 0; x < W; x++) {
						if ((j & 1 << x) == 0) continue;
						if (grid[y][x] == '#') {
							count++;
						}
					}
				}
				if (count == K) result++;
			}
		}
		System.out.println(result);
	}
}

class Main {
	public static void main(String... args) {
		System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		var reader = new BufferedReader(new InputStreamReader(System.in));
		new Solver().solve(new Supplier<>() {
			StringTokenizer line;

			public String get() {
				while (line == null || !line.hasMoreTokens()) try {
					line = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
				return line.nextToken();
			}
		});
		System.out.flush();
	}
}

Measured memory_bytes: 32772
#include <iostream>
#include <bitset>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
using ll = long long int;
using dd = long double;
const ll MOD = 1e9 + 7;

vector<string> dfs(string s, ll depth, vector<char> symbol)
{
    vector<string> ret;
    if (depth == 0)
    {
        ret.push_back(s);
        return ret;
    }

    for (ll i = 0; i < symbol.size(); i++)
    {
        auto vec = dfs(s + symbol[i], depth - 1, symbol);
        for (auto &&e : vec)
        {
            ret.push_back(e);
        }
    }
    return ret;
}

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

int main()
{
    dd a, b, h;
    cin >> a >> b >> h;

    cout << ((a + b) / 2) * h << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pb push_back
#define mp make_pair

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

        ll n;
        cin>>n;
        ll i=1;
        queue<ll>q;
        for(;i<10;i++)
        {
            q.push(i);
            if(i==n)
            {
                cout<<i<<endl;
                return 0;
            }
        }
        for(i=1;i<=n;i++)
        {
            if(i==n)
            {
                cout<<q.front();
                return 0;
            }
            ll n=q.front();
            q.pop();
            if(n%10!=0)
            {
                q.push(n*10+(n%10)-1);

            }
            q.push(n*10+(n%10));
            if(n%10!=9)
            {
                q.push(n*10+(n%10)+1);
            }
        }


    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int N;
int a[1000];
int c[20];
int main(){
    cin>>N;
    REP(i,N){
        cin>>a[i];
        if(a[i]>3200)a[i]=3200;
    }
    REP(i,20)c[i]=0;
    REP(i,N){
        c[a[i]/400]++;
    }
    int ans=0;
    REP(i,8){
        if(c[i]>0)ans++;
    }
    cout<<max(ans,1)<<" "<<ans+c[8]<<endl;
    return(0);
}

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

typedef long long ll;
const ll mod=1e9+7;
const ll N=1e5+1;
const double PI=acos(-1.0);

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	int n,m;
	cin>>n>>m;
	vector<int> h(n),isGood(n,true);
	for(int &i:h) cin>>i;
	while(m--){
		int a,b;
		cin>>a>>b;
		a--,b--;
		if(h[a]>h[b]) isGood[b]=false;
		else if (h[a]<h[b]) isGood[a]=false;
		else isGood[a]=isGood[b]=false;
	}
	int ans=0;
	for(int i:isGood) ans+=i;
	cout<<ans;
}


Measured memory_bytes: 3976
N, Ma, Mb = map(int, input().split())
A, B, C = [], [], []
for i in range(N):
    ai, bi, ci = map(int, input().split())
    A.append(ai)
    B.append(bi)
    C.append(ci)

INF = float('inf')
dp = [[[INF]*401 for i in range(401)] for j in range(N+1)]
dp[0][0][0] = 0

for i in range(N):
    for a in range(401):
        for b in range(401):
            if dp[i][a][b] == INF:
                continue
            dp[i+1][a][b] = min(dp[i+1][a][b], dp[i][a][b])
            if a + A[i] <= 400 and b + B[i] <= 400:
                dp[i+1][a+A[i]][b+B[i]] = min(dp[i+1][a+A[i]][b+B[i]], dp[i][a][b]+C[i])

ans = INF
for i in range(1, 401):
    target_a = Ma * i
    target_b = Mb * i
    if target_a > 400 or target_b > 400:
        break
    ans = min(ans, dp[N][target_a][target_b])

print(ans if ans != INF else -1)



Measured memory_bytes: 141788
N, M = list(map(int, input().split()))
a = [int(input()) for _ in range(M)]

class comb():
  F = [1, 1]
  Fi = [1, 1]
  I = [0, 1]
  def __init__(self, num, mod):
    self.MOD = mod
    for i in range(2, num + 1):
      self.F.append((self.F[-1] * i) % mod)
      self.I.append(mod - self.I[mod % i] * (mod // i) % mod)
      self.Fi.append(self.Fi[-1] * self.I[i] % mod)
  def com(self, n, k):
    if n < k: return 0
    if n < 0 or k < 0: return 0
    return self.F[n] * (self.Fi[k] * self.Fi[n - k] % self.MOD) % self.MOD


MOD = 10 ** 9 + 7

for i in range(1, M):
  if a[i] - a[i - 1] == 1:
    print(0)
    exit()

com = comb(200000, MOD)
ans = 1
x = 0
a = a + [N + 1]

for i in a:
  t = i - 1 - x
  at = 0
  for j in range(t // 2 + 1):
    k = t - j
    at = at + com.com(k, j) % MOD
  ans = ans * at % MOD
  x = i + 1
  

print(ans)

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

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
typedef long long ll;


int main(){
  int n;
  cin >> n;
  double rate = 380000.0;
  double x;
  string u;
  double sum = 0.0;
  rep(i,n){
    cin >> x >> u;
    if(u=="JPY")sum += x;
    else sum += x*rate;
  }
  cout << sum << endl;
}


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

using namespace std;

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int h1, m1, h2, m2, k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  cout << max((h2 - h1) * 60 + (m2 - m1) - k, 0) << endl;
  return 0;
}


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

using namespace std;
typedef long long ll;

int main()
{
  ll N;
  vector<ll>x(5);
  cin >> N ;
  for( int i=0;i<5;++i)
    cin >> x[i];


  ll m = *min_element(x.begin(), x.end());
  ll ans = N%m==0?N/m:N/m+1;
  ans += 4;
  cout << ans << endl;
}


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

using namespace std;

inline char ToCap(char c){
	return ('a'<=c&&c<='z')?(c+('A'-'a')):c;
}
int main(){
	string str;

	getline(cin,str);
	for( int i=0;i<str.length();i++ )
		cout<<ToCap(str[i]);
	cout<<endl;
	return 0;	
}

Measured memory_bytes: 1164
/**
 ____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|

**/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N_MAX = 200002;

int n;

string s;

int cnt[26];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> s;
    n = s.size();
    s = " " + s;
    ll ans = 1LL * n * (n - 1) / 2 + 1;
    for(int i = 1; i <= n; i++)
        cnt[s[i] - 'a']++;
    for(int i = 0; i < 26; i++)
        ans -= 1LL * cnt[i] * (cnt[i] - 1) / 2;
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 3732
//
//  main.cpp
//  Test
//
//  Created by Nag on 2017/08/18.
//  Copyright ?? 2017??´ Nag. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <vector>
#include <sstream>
#include <string>
#include <cstdio>

using namespace std;

int main(void) {
    int n;
    int b, f, r, v;
    int i, j, k;
    
    int room[4][3][10] = {0};

    cin >> n;
    for(i=0; i<n; i++) {
        cin >> b >> f >> r >> v;
        room[b-1][f-1][r-1] += v;
    }

    for(i=0; i<4; i++) {
        for(j=0; j<3; j++) {
            for(k=0; k<10; k++) {
                cout << " " << room[i][j][k];
            }
            cout << endl;
        }
        if(i<3) cout << "####################" << endl;
    }

    return 0;
}

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

int main() {
    int a, b;
    cin >> a >> b;
    string A, B;
    for (int i=0; i<b; i++) A+=to_string(a);
    for (int i=0; i<a; i++) B+=to_string(b);
    if (A<=B) cout << A << endl;
    else cout << B << endl;
}

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

typedef long long ll;

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define tt int t; cin>>t; while(t--)
#define nl cout<<"\n";
#define sp cout<<" ";
#define rep(i, a, b) for(long long i=a; i<b; i++)

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
double PI = 4*atan(1);

int main()
{
    optimize();

    long long a, b, n;

    cin>> a>> b>> n;

    cout<< (n<b? (a* n)/ b : (a* (b-1))/ b) << '\n';

    return 0;
}




Measured memory_bytes: 3576
ABCD=list(map(int,list(input())))
#bit全探索の練習
 #0はマイナス1はプラス
for i in range(1<<3):#普通に16って書いてもいいんだけどね
    ans=ABCD[0]
    plus=["+","+","+"]
    for j in range(3):#右からj+1個目のプラス(j+2コメの数)について
        if (i>>j & 1)==1:#1なら
            ans+=ABCD[3-j]
        else:
            ans-=ABCD[3-j]
            plus[2-j]="-"
    if ans==7:
        [A,B,C,D]=[str(i) for i in ABCD]
        print(A+plus[0]+B+plus[1]+C+plus[2]+D+"=7")
        break

Measured memory_bytes: 3064
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Random;
import java.util.Scanner;
import java.util.TreeSet;

import javax.print.attribute.standard.MediaSize.Other;
import javax.xml.bind.ParseConversionEvent;

public class Main {

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

		final int n = sc.nextInt();
		
		int number = -1;
		
		ArrayList<Integer> list = new ArrayList<Integer>();
		for(int i = 0; i < n; i++){
			boolean flag = true;
			boolean all_make = true;
			
			char[] input = sc.next().toCharArray();
			
			//System.out.println(Arrays.toString(input));
			
			for(int j = 0; j < n; j++){
				if(input[j] == 'x'){
					flag = false;
				}else if(input[j] == 'o'){
					all_make = false;
				}
			}
			
			if(flag && number == -1){
				number = i;
			}
			
			if(!all_make){
				list.add(i);
			}
			
		}
		
		for(int i = 0; i < 1000; i++){
			System.out.println(number == -1 ? list.get((int) (XRandom.XorShift(0, list.size()))) + 1 : number + 1);
			System.out.flush();
			
			final int ai = sc.nextInt();
		}
	}
	
	
	public static class XRandom {
		static long y = System.currentTimeMillis();
		static long z = System.currentTimeMillis();
		static long x = System.currentTimeMillis();
		static long w = System.currentTimeMillis();

		static int XorShift(int min, int max) {
			int t;
			t = (int) (x ^ (x << 11));
			x = y;
			y = z;
			z = w;
			w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
			return (int) ((min + w) % max);
		}
	}
}

Measured memory_bytes: 23536
N = int(input())
A = list(map(int, input().split()))
A.sort()
max_A = A[-1] + 1
ans = [0]*max_A
for i in A:
  ans[i] += 1
  if ans[i] == 1:
    for j in range(i*2, max_A, i):
      ans[j] = 2
print(ans.count(1))

Measured memory_bytes: 32212
//{Headers
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<algorithm>
#include<list>
#include<queue>
#include<deque>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<bitset>

using namespace std;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > pii;
#define mp(x,y) make_pair(x,y)
typedef long long ll;
//}

int a,b;

int GCD(int a,int b){return b==0?a:GCD(b,a%b);}

void solve(){
    int gcd=GCD(a,b);
    int lcm=a/gcd*b;
    printf("%d %d\n",gcd,lcm);
}

int main(void){
//    freopen("in.txt","r",stdin);
    while(~scanf("%d%d",&a,&b))
        solve();
    return 0;
}

/*
8 6
50000000 30000000
*/



Measured memory_bytes: 3212
#include<stdio.h>
int main()
{
    int x;
    scanf("%d",&x);
    int i,j;
    int a[x],b[x],c[x];
    for(i=0;i<x;i++)
        scanf("%d",&a[i]);
    for(i=0;i<x;i++)
        scanf("%d",&b[i]);
    for(i=0;i<x;i++)
        c[i]=a[i]-b[i];
    int sum=0;
    for(i=0;i<x;i++){
        if(c[i]>=0)
            sum=sum+c[i];
    }
    printf("%d",sum);
    return 0;
}


Measured memory_bytes: 1704
import java.util.Scanner;

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

		String s = sc.next();

		int l = s.length();



		int[] a = new int[l-2];

		String[] figure = new String[l-2];

		for(int i=0; i<=l-3; i++) {
			figure[i] = s.substring(i,i+3);
			a[i] = Integer.parseInt(figure[i]);  // Integer.parseInt(String s) stringをintで返す
			//substring(int a, int b)  !!aからb-1番目!!までの文字列を返す　0始まり
		}
		int min = 999;
		for(int i=0; i<=l-3; i++) {
			min =Math.min(min, Math.abs(753-a[i]));
		}

		System.out.println(min);

	}

}


Measured memory_bytes: 22612
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int K = sc.nextInt();
    if (K % 2 == 0) {
      System.out.println(K / 2 * K / 2);
    } else {
      System.out.println((K - 1)/2 * ((K-1)/2 + 1));
    }
  }
}

Measured memory_bytes: 22868
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
template<class T> istream& operator >> (istream& s, vector<T>& v)
{ for (T& x: v) { s >> x; } return s;}
void yes(){ cout << "Yes" << endl; }
void no(){ cout << "No" << endl; }
int SIZE(string s){ return (int)s.size(); }

int main(){
    cout << setprecision(16);
    int n; cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    sort(a.rbegin(), a.rend());
    int num = -1, ans = 0;
    for(int i = 1; i < n; i++){
        if(min(a[i],a[0]-a[i]) > num){
            ans = a[i];
            num = min(a[i],a[0]-a[i]);
        }
    }
    cout << a[0] << " " << ans << endl;
    return 0;
}


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

int main() {
  int N, cnt=0;
  cin >> N;

  // ここにプログラムを追記
  for (int i = 0; i < N; i++)
  {
    int l, r;
    cin >> l >> r;
    cnt += r - l + 1 ;
  }
  cout << cnt << endl;  
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    int a,b; cin>>a>>b;
    int l=0;
    for(int i=1;i<=b-a;i++){
        l+=i;
    }
    cout<<l-b<<endl;
}


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

long int calc(long int a, long int b, long int c);

//+1+2 +2+1

int main(void)
{
	long int i, j;
	long int x, y;
	long int a, b, sum;//a:→b↑
	long int min, max;
	long int ans;
	long int warukazu = 1000000007;
	long int work;
	
	scanf("%ld%ld", &x, &y);
	
	if( (x + y) % 3 != 0) {
		printf("0\n");
		return 0;
	}
	
	if( (x > y * 2) || (y > x * 2) ) {
		printf("0\n");
		return 0;
	}
	
	a = (2 * x - y) / 3;
	b = (2 * y - x) / 3;
	sum = a + b;
	
	if(a > b) {
		min = b;
		max = a;
	} else {
		min = a;
		max = b;
	}
	
	ans = 1;
	
	for(i = 2; i <= sum; i++) {
		ans *= i;
		ans %= warukazu;
	}
	
	for(i = 2; i <= min; i++) {
		work = calc(i, warukazu - 2, warukazu);
		ans *= work;
		ans %= warukazu;
	}
	
	for(i = 2; i <= max; i++) {
		work = calc(i, warukazu - 2, warukazu);
		ans *= work;
		ans %= warukazu;
	}
	
	
	printf("%ld\n", ans % warukazu);
	
	return 0;
}

long int calc(long int a, long int b, long int c)
{
	long int x;
	
	if(b == 0) {
		return 1;
	} else if(b % 2 == 0) {
		x = calc(a, b / 2, c);
		return (x * x) % c;
	} else {
		return (a * calc(a, b - 1, c)) % c;
	}
}

Measured memory_bytes: 128
S = input()
before = 'R'
toggles = []
len_s = len(S)
for idx in range(len_s):
  if S[idx] != before:
    if S[idx] == 'L':
      toggles.append(idx-1)
      toggles.append(idx)
    before = S[idx]
len_t = len(toggles)
before_j = 0
ans = [0] * (len_s)
for idx in range(len_s):
  for j in range(before_j, len_t):
    if S[idx] == 'R' and toggles[j] >= idx and j%2 == 0:
      if (toggles[j] - idx)%2 == 0:
        ans[toggles[j]] += 1
      else:
        ans[toggles[j]+1] += 1
      before_j = j
      break
    elif S[idx] == 'L' and toggles[j] <= idx and j%2 != 0:
      if (idx - toggles[j])%2 == 0:
        ans[toggles[j]] += 1
      else:
        ans[toggles[j]-1] += 1
      before_j = j
      break
print(' '.join(map(str, ans)))


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

using namespace std;



int main()
{
    int H,W;
    while(scanf("%d%d",&H,&W)==2){
        if(H==0 && W == 0){
            break;
        }
        for(int i=0;i<H;i++){
            for(int j =0;j<W;j++){
                printf("#");
            }
            printf("\n");
        }
        printf("\n");
    }


    return 0;
}


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

typedef long long int ll;
ll MOD = 1000000007;
ll INFL = 1ll << 60;
ll INF = 1 << 28;

// ====================================================================

int main() {
  int n, k;
  cin >> n >> k;
  vector<double> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }

  double ans = 0, res = 0;
  for (int i = 0; i < k; i++) {
    res += v[i] * (v[i] + 1) / 2 / v[i];
    ans = res;
  }
  for (int i = k; i < n; i++) {
    res += v[i] * (v[i] + 1) / 2 / v[i];
    res -= v[i - k] * (v[i - k] + 1) / 2 / v[i - k];
    ans = max(ans, res);
  }

  cout << fixed << setprecision(10) << ans << endl;
}


Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

using lint = long long;
using ldouble = long double;

const lint INF = 1LL << 60;
const int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};

bool solve() {
    int H, W;
    lint L;
    cin >> H >> W >> L;
    if (H == 0) return false;

    vector<string> S(H);
    for (auto& s : S) cin >> s;

    vector<vector<vector<lint>>> dist(H, vector<vector<lint>>(W, vector<lint>(4, INF)));
    int sx, sy, sd;
    for (int x = 0; x < H; ++x) {
        for (int y = 0; y < W; ++y) {
            for (int d = 0; d < 4; ++d) {
                if (S[x][y] == "NESW"[d]) {
                    sx = x;
                    sy = y;
                    sd = d;
                }
            }
        }
    }

    dist[sx][sy][sd] = 0;
    lint step = 0;
    bool skipped = false;
    while (step < L) {
        int nx = sx + dx[sd], ny = sy + dy[sd];
        if (nx < 0 || H <= nx || ny < 0 || W <= ny ||
            S[nx][ny] == '#') {
            sd = (sd + 1) % 4;
        } else {
            sx = nx, sy = ny;
            ++step;
        }

        if (!skipped && dist[sx][sy][sd] < INF) {
            lint diff = step - dist[sx][sy][sd];
            step += (L - step - 1) / diff * diff;
            skipped = true;
        }
        dist[sx][sy][sd] = step;
    }

    cout << sx + 1 << " " << sy + 1 << " "
         << "NESW"[sd] << endl;
    return true;
}

int main() {
    while (solve()) {}
    return 0;
}



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

const int maxn = 100, mod = 1e9 + 7;
int n, a[maxn + 3];

int qpow(int a, int b) {
	int c = 1;
	for (; b; b >>= 1, a = 1ll * a * a % mod) {
		if (b & 1) c = 1ll * a * c % mod;
	}
	return c;
}

pair<int, int> solve(int l, int r, int h) {
	if (l == r) {
		int x = qpow(2, a[l] - h);
		return make_pair(x, x);
	}
	int mn = a[l];
	for (int i = l; i <= r; i++) {
		mn = min(mn, a[i]);
	}
	int c = 1, t = qpow(2, mn - h);
	for (int i = l; i <= r; i++) {
		if (a[i] == mn) c = 2ll * c % mod;
	}
	int x = 1, y = 1;
	for (int i = l, j = l; i <= r; i = j + 1, j = i) {
		if (a[i] == mn) continue;
		while (j < r && a[j + 1] != mn) j++;
		pair<int, int> t = solve(i, j, mn);
		x = 1ll * x * (t.first + t.second) % mod;
		y = 1ll * y * t.first % mod;
	}
	int p = 1ll * t * y % mod;
	int q = (1ll * c * x + 1ll * (t + mod - 2) * y) % mod;
	return make_pair(p, q);
}

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
	}
	printf("%d\n", solve(1, n, 0).second);
	return 0;
}

Measured memory_bytes: 256
n = int(input())
A = []
B = []
ans = 0
import math

for _ in range(n):
  a,b = map(int,input().split())
  A.append(a)
  B.append(b)
  
for _ in range(n):
  a = A.pop(-1)
  b = B.pop(-1)
  a += ans
  ans += math.ceil(a/b)*b - a

print(ans)



Measured memory_bytes: 16892
#include<bits/stdc++.h>
#include <cstring>
using namespace std;
#define ll  long long
#define endl '\n'
const ll mod = 1000000007;
const double PI = 3.141592653589793238463;
using namespace std;
ll a[100001],dp[100001];
int n;
ll f(int i){
    if (i>=n)
        return 1e9;
    if (i==n-1)
        return 0;
    if (dp[i]!=-1)
        return dp[i];
    int road1=abs(a[i]-a[i+1])+f(i+1);
    int road2=abs(a[i]-a[i+2])+f(i+2);
    return dp[i]=min(road1,road2);
}
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    cin>>n;
    for (int i=0;i<n;i++)
        cin>>a[i];
    memset(dp,-1,sizeof dp);
    cout<<f(0);

    return 0;
}


Measured memory_bytes: 6528
package main

import "fmt"

func getInput() (int, int, int) {
	a, b, c := 0, 0, 0
	fmt.Scan(&a, &b, &c)
	return a, b, c
}

func sort(c []int) []int {
	if c[0] > c[1] {
		c[0], c[1] = c[1], c[0]
	}
	if c[1] > c[2] {
		c[1], c[2] = c[2], c[1]
	}
	if c[0] > c[1] {
		c[0], c[1] = c[1], c[0]
	}
	return c
}

func C() {
	c := []int{0, 0, 0}
	c[0], c[1], c[2] = getInput()
	c = sort(c)

	diff1 := c[2] - c[1]
	diff2 := c[1] - c[0]

	if diff1%2 == 0 && diff2%2 == 0 {
		count := (diff1*2 + diff2) / 2
		fmt.Println(count)
		return
	}

	if diff1%2 == 1 && diff2%2 == 0 {
		count := diff1 + diff2/2
		fmt.Println(count)
		return
	}

	if diff1%2 == 0 && diff2%2 == 1 {
		count := diff1/2 + (c[2]-c[0]+1)/2 + 1
		fmt.Println(count)
		return
	}

	if diff1%2 == 1 && diff2%2 == 1 {
		count := (diff1+1)/2 + (diff1+diff2)/2 + 1
		fmt.Println(count)
		return
	}
}

func main() {
  C()
}


Measured memory_bytes: 512
#if defined(LOCAL)
#include "C:\includes.hpp"
#include "C:\debug.hpp"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#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 uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

int main() {
    ios::sync_with_stdio(false);
  	cin.tie(0);                                      
  	string s;
  	cin >> s;
  	if(s == "Sunny")puts("Cloudy");
  	else if(s == "Cloudy")puts("Rainy");
  	else puts("Sunny");
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static int[] exchange(int a,int b) {

		int swap = 0;

		if(a % 2 != 0) {
			a--;
		}

		swap = a/2;
		a /= 2;
		b += swap;
		return new int[] {a,b};
	}

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] n = s.split(" ");

		int a = Integer.parseInt(n[0]);
		int b = Integer.parseInt(n[1]);
		int k = Integer.parseInt(n[2]);


		int count = 0;
		int[] swap;
		while(count < k) {

			if(count % 2 == 0) {
				swap = exchange(a,b);
				a = swap[0];
				b = swap[1];
			}else {
				swap = exchange(b,a);
				b = swap[0];
				a = swap[1];
			}

			count++;
		}

		System.out.println(a + " " + b);
	}
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
	int n, mx = 0, a[111111], res = 0;
	vector<int> v;
	cin>>n;
	for(int i = 0; i < n; i++){
		cin>>a[i];
		mx = max(mx, a[i]);
	}
	for(int i = 1; i <= mx; i++){
		if(mx % i == 0) v.push_back(i);
	}
	for(int i = 0; i < n; i++){
		for(int j = 0; j < v.size(); j++){
			if(v[j] >= a[i]){
				res += v[j] - a[i];
				break;
			}
		}
	}
	cout<<res<<endl;
}


Measured memory_bytes: 3904
#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define FT first
#define SC second
#define MP make_pair
#define PB push_back

using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pint;
const int INF = 1e9;
const double EPS = 1e-9;


int main()
{
  int n ;
  cin >> n ;
  cout << n*n*n <<endl ;

  return 0 ;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
/*
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds; 
//order_of_key(k)= # of items strictly smaller than 'k'  //find_by_order(x)= iterator to x'th largest element (counting from ZERO) //erase("iterator") [log(n)] //end(<name>)
//os.find_by_order(os.order_of_key(x)=iterator to 'x' in the rb tree
template<class T> using ordered_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/
//#pragma GCC optimization ("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC target ("avx2")
//#pragma GCC optimize ("O3")
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);

typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef pair<ll,ll> pi;
typedef priority_queue<ll> pq;                                        //min-heap-> multiply the values by '-1'
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define forr(i,a,b) for (ll i = a; i < b; i++)
#define test ll t;cin>>t;while(t--)
#define summ(a,n) accumulate(a,a+n,0)
#define bsrch(v,n) lower_bound(v.begin(), v.end(), n)
#define minindex(v) distance(v.begin(),min_element(v.begin(),v.end()))         //returns index of minimum(/max) element in the vector
#define bp(x) _builtin_popcount(x)
#define inf 1000000000000
#define PI = 3.1415926535897932384626
#define mod 1000000007

//better approach:- merge any number grater then both his neightbors (nbrlft+nbrrt-maxval) and then do the greedy approach
//ref:-https://www.youtube.com/watch?v=pOv4LRNt0jo

ll dp[3005][3005], a[3005];
ll n;

ll solve(ll i, ll j)
{
    if(dp[i][j]) return dp[i][j];
    return dp[i][j]=max(a[i]-solve(i+1,j), a[j]-solve(i,j-1));
}

int main()
{
    cin>>n;
    forr(i,1,n+1) 
    {
        cin>>a[i];
        dp[i][i]=a[i];
    }
    cout<<solve(1,n);
}

Measured memory_bytes: 49820
#!/usr/bin/env python3
import sys




# 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)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)] 

    flg = True
    for _a in A:
        if _a%2==1 or _a%6==0 or _a%10==0:
            pass
        else:
            flg = False
            break

    if flg:
        print("APPROVED")
    else:
        print("DENIED")
    

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>


int main(void){
  std::set<long> sum;

  int n, k;
  std::cin >> n >> k;

  std::vector<long> a;
  for(int i=0; i<n; i++){
    long temp;
    std::cin >> temp;
    a.push_back(temp);
  }

  for(int i=0; i<n; i++){
    for(int j=i+1; j<=n; j++){
      sum.insert(std::accumulate(a.begin()+i, a.begin()+j, 0.0));
    }
  }


  long result = 0;
  while(true){
    std::vector<int> count_bits(64, 0);
    for(long elem: sum){
      int loops = 0;
      while(elem){
        if(elem%2) count_bits[loops]++;
        loops++;
        elem /= 2;
      }
    }

    int top = -1;
    for(int i=0; i<count_bits.size(); i++){
      if(count_bits[i] >= k) top = i;
    }
    if(top == -1) break;

    result += (0b1L<<top);

    std::set<long> temp;
    for(long elem: sum){
      if(elem & (0b1L<<top)){
        temp.insert(elem-(0b1L<<top));
      }
    }
    sum = temp;
  }
  std::cout << result << std::endl;

  return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define collect(arr, size) rep(i,size) cin >> arr[i];

void print_arr(vector<int> &a){
    rep(i,a.size()-1){
        printf("%d ",a[i]);
    }
    printf("%d\n",a[a.size()-1]);
}

void insertion_sort(vector<int> &a){
    for(int i=1; i<a.size(); i++){
        print_arr(a);
        int v = a[i];
        int j = i - 1;
        while(j >= 0 && a[j] > v){
            a[j+1] = a[j];
            j--;
        }
        a[j+1] = v;
    }
    print_arr(a);
}

int main(){
    int n; cin >> n;
    vector<int> a(n); collect(a, n);
    insertion_sort(a);
    return 0;
}


Measured memory_bytes: 3228
#include <iostream>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

int main()
{
    int N;
    cin >> N;
    ll c[5] = {};
    for(int i=0;i<N;i++){
        string name;
        cin >> name;
        char first_c = name[0];
        switch (first_c){
            case 'M': c[0]++; break;
            case 'A': c[1]++; break;
            case 'R': c[2]++; break;
            case 'C': c[3]++; break;
            case 'H': c[4]++; break;
        }
    }
    ll combination = 0;
    for(int i=0;i<3;i++){
        for(int j=i+1;j<4;j++){
            for(int k=j+1;k<5;k++){
                combination += c[i]*c[j]*c[k];
            }
        }
    }
    cout << combination << endl;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	int a,b,c;
	
	scanf("%d %d %d",&a,&b,&c);
	
	if(a<b&&b<c){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	return(0);
}

Measured memory_bytes: 580
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;

int main() {
	string S;
	int K;
	cin >> S >> K;
	vector<string> A;
	for (size_t i = 0; i < S.size(); i++)
	{
		for (size_t j = 1; j <= K; j++)
		{
			if (i + j >= S.size()+1)break;
			A.push_back(S.substr(i, j));
		}
	}
	sort(A.begin(), A.end());
	int now = 1;

	for (size_t i = 0; i < A.size()-1; i++)
	{
		if (A.at(i) != A.at(i + 1))now++;
		if (now == K) { 
			cout << A.at(i + 1); 
			return 0;
		}
	}
	cout << A.at(S.size() - 1);
}

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

int main() {
  string S;
  cin >> S;
  if(S == "SSS"){
  cout << 0 <<endl;
   }  
  if(S == "SSR" || S == "SRS" || S == "RSS" || S == "RSR"){
  cout << 1 <<endl;
   }
  if(S == "SRR" || S == "RRS"){
  cout << 2 <<endl;
   }
  if(S == "RRR"){
  cout << 3 <<endl;}
}


Measured memory_bytes: 3624
($N,$T,$A)=glob<>;
map{push@$_,$_[--$|]for@_=glob}<>;
sub f{$a[$_]=$d++;$a[$_]//&f for@$_;$d--}
f$_=${*a=T};f$_=${*a=A};
$T[$_]<$A[$_]&&\$_[$A[$_]]for 1..$N;
print@_-2

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

using namespace std;
typedef long long ll;
int main()
{
    map<string , int>mp;
    int n;
    cin >> n ;
    string s;
    for(int i = 0 ; i < n ; i++)
    {
        cin >> s;
        mp[s]++;
    }
    vector<string>v={"AC" , "WA" , "TLE" , "RE" };
    for(int i = 0 ; i < 4 ;i++)
    {
        cout << v[i] << " x " << mp[v[i]]<<"\n";
    }
    return 0;
}


Measured memory_bytes: 3636
#include<stdio.h>
int main(){
  int i;
  char s[5];
  scanf("%s",s);
  for(i=0;i<=2;i++){
    if(s[i]=='1')s[i]='9';
    else if(s[i]=='9')s[i]='1';
  }
  puts(s);
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,-1,sizeof(x))
const int INF = 1e9 + 1;
const ll MOD = 1e9 + 7;
const double PI = 3.141592653589793;

int main(){
  int n;
  cin >> n;
  ll ans = 0;
  map<int, ll> mp;
  rep(i, n){
    int a;
    cin >> a;
    mp[a]++;
    ans += a;
  }
  int q;
  cin >> q;
  while(q){
    ll b, c;
    cin >> b >> c;
    if(!mp.count(b)){
      cout << ans <<endl;
      q--;
      continue;
    }
    else{
      if(!mp.count(c)){
        mp[c] = mp[b];
        ans = ans + (c - b) * mp[b];
        mp.erase(b);
        
      }else{
        ans = ans + (c-b) * mp[b];
        mp[c] += mp[b];
        mp.erase(b);
      }
      cout << ans <<endl;
    }
    q--;
  }
}

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

int mod = 1000000007;

int main()
{
    string k;
    cin >> k;
    int d;
    cin >> d;
    int len = k.size();
    vector<vector<int>> dp(d, vector<int>(2));
    dp[0][0] = 1;
    for(int index = 0; index < len; index++)
    {
        vector<vector<int>> dp2(d, vector<int>(2));
        for(int sum = 0; sum < d; sum++)
        {
            for(int j = 0; j < 2; j++)
            {
                for(int digit = 0; digit < 10; digit++)
                {
                    if(digit > k[index] - '0' && j == 0)
                    {
                        continue;
                    }
                    dp2[(sum + digit) % d][j || (digit < k[index] - '0')] = (dp2[(sum + digit) % d][j || (digit < k[index] - '0')] + dp[sum][j]) % mod;
                }
            }
        }
        dp = dp2;
    }
    int ans = (dp[0][0] + dp[0][1]) % mod;
    ans = (ans - 1 + mod) % mod;
    cout << ans;
    return 0;
}

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

int main()
{
	int N;
	cin >> N;
	vector<int> A( N );
	for( int i = 0; i < N; i++ ) {
		cin >> A[i];
	}

	vector<vector<int>> v( N );
	int cent = N / 2;
	int p = N % 2;
	for( int i = 0; i < N; i++ ) {
		if( A[i] % 2 == p ) {
			cout << 0 << endl;
			return 0;
		}
		if( p ) {
			if( A[i] == 0 ) v[cent].push_back( i );
			else {
				int a = A[i] / 2;
				if( cent + a < N ) v[cent + a].push_back( i );
				if( cent - a >= 0 ) v[cent - a].push_back( i );
			}
		}
		else {
			int a = A[i] / 2;
			if( cent + a < N ) v[cent + a].push_back( i );
			if( cent - 1 - a >= 0 ) v[cent - 1 - a].push_back( i );
		}
	}
	set<int> st;
	set<int> st1;
	const long long MOD = 1000000000 + 7;
	long long ans = 1;
	for( int i = 0; i < N; i++ ) {
		if( v[i].size() == 0 ) {
			cout << 0 << endl;
			return 0;
		}
		if( v[i].size() == 1 ) {
			if( st1.count( v[i][0] ) ) {
				cout << 0 << endl;
				return 0;
			}
			st1.insert( v[i][0] );
		}
		else {
			int num = 0;
			for( int j = 0; j < v[i].size(); j++ ) {
				if( st.count( v[i][j] ) ) continue;
				num++;
				st.insert( v[i][j] );
			}
			if( num ) ans = ans * num % MOD;
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 13816
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		String a = stdIn.next();
		String b = stdIn.next();
		String c = stdIn.next();
		
		System.out.print(a.charAt(0));
		System.out.print(b.charAt(1));
		System.out.print(c.charAt(2));
	}
}

Measured memory_bytes: 21332
a = list(map(int,input().split()))
if(a[0]-a[2]<0):
    b = 0
    d = a[2]-a[0]
    if(a[1]-d>=0):
        c = a[1]-d
    else:
        c = 0
else:
    b = a[0]-a[2]
    c = a[1]   
print(b,c)

Measured memory_bytes: 3060
function main(input){
  let [A, B] = input.split(' ').map(Number);
  A = BigInt(A);
  B = BigInt(parseInt(B*100 + 0.5));
  console.log(String(A*B/100n));
  //.replace('n', '')
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim());


Measured memory_bytes: 29556
# Aizu Problem ITP_1_4_D: Min, Max and Sum
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")

N = int(input())
A = [int(_) for _ in input().split()]
print(min(A), max(A), sum(A))

Measured memory_bytes: 8700