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

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

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

    int r;
    cin >> r;

    if(n>=10)
        cout << r << endl;
    else{
        cout << r+100 * (10 - n) << endl;
    }

    return 0;
}


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

// int/long:		-2,147,483,648 - 2,147,483,647 (-2^31 <= int < 2^31)
// long/long long:	-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

#define	INF (1<<30)
//1,073,741,824
//= 536,870,912 *2

#define	MOD 1000000007

#define	Rep0(i, n)	for (auto i=0; i<n; i++)
#define	Rep1(i, n)	for (auto i=1; i<=n; i++)
#define Sort(P)	sort(P.begin(), P.end())
#define Rev(P)	reverse(P.begin(), P.end())

int	main() {
	int H, W, M;
	cin >>H >>W >>M;
	vector<int> h(H+1, 0);
	vector<int> w(W+1, 0);
	vector<vector<int>> Hw(H+1);
	Rep0(i, M) {
		int hh, ww;
		cin >>hh >>ww;
		h.at(hh)++;
		w.at(ww)++;
		Hw.at(hh).push_back(ww);
	}
	int hmax=-1;
	Rep1(i, H)
		hmax=max(hmax, h.at(i));
	vector<int> HN;
	Rep1(i, H)
		if (hmax==h.at(i))
			HN.push_back(i);
	int wmax=-1;
	Rep1(i, W)
		wmax=max(wmax, w.at(i));
	vector<int> WN;
	Rep1(i, W)
		if (wmax==w.at(i))
			WN.push_back(i);
	vector<int> Wh(W+1, HN.size());
	for (auto HHH: HN)
		for (auto WWW: Hw.at(HHH))
			Wh.at(WWW)--;
	int ANS=0;
	for (auto Y: WN) {
		if (Wh.at(Y)>0)
			ANS=1;
	}
	ANS +=hmax+wmax-1;
	cout <<ANS <<endl;
	return 0;
}



Measured memory_bytes: 26056
import java.util.Scanner;

public class Main {

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

		int[] L = new int[N];
		for(int i=0; i<N; i++) {
			L[i] = sc.nextInt();
		}


		int n=0;
		for(int i=0; i<N; i++) {
			for(int j=i+1; j<N; j++) {
				if(L[j]==L[i]) {
					continue;
				}
				for(int k=j+1; k<N; k++) {
					if(L[k]==L[i] || L[k]==L[j]) {
						continue;
					}
					// 3角形ができるはmaxの長さ＜他の２つの和
					if(L[i]>L[j]) {
						if(L[j]>L[k]) {
							// L[i] がmax
							if(L[i] < L[k]+L[j]) {
								n++;
							}
						}else {
							// L[i]>L[j], L[k]>L[j]
							if(L[i]>L[k]) {
								// L[i] がmax
								if(L[i] < L[j]+L[k]) {
									n++;
								}
							}else {
								// L[k] がmax
								if(L[k] < L[i]+L[j]) {
									n++;
								}
							}
						}
					}else {
						// L[j] > L[i]
						if(L[j]>L[k]) {
							// L[j]>L[i], L[j]>L[k]
							// L[j] がmax
							if(L[j] < L[i]+L[k]) {
								n++;
							}
						}else {
							// L[k] がmax
							if(L[k] < L[i]+L[j]) {
								n++;
							}
						}
					}
				}
			}
		}

		System.out.println(n);

	}

}


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

int main(){
    string s;cin>>s;
    int res=10000000;
    for(int i=0;i<s.size()-2;i++){
        res = min(res,abs(753-stoi(s.substr(i,3))));
    }
    cout<<res<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define inrange(a, x, b) (a <= x && x <= b)
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using vc = vector<char>;
using pll = pair<ll, ll>;
template<class T> void print(T x,bool cl=1){cout<<(cl?"\x1b[36m":"")<<x<<(cl?"\x1b[39m":"")<<'\n';}
template<class T> void print1d(T x,ll n=-1,bool cl=true){if(n==-1)n=x.size();rep(i,0,n){cout<<(cl?"\x1b[36m":"")<<x[i]<<(i==n-1?'\n':' ');}cout<<(cl?"\x1b[39m":"");}
template<class T> void print2d(T x,ll r=-1,ll c=-1,bool cl=1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c,cl);}
template<class T, class U> bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U> bool isin(T el, U container) { return find(all(container), el) != container.end(); }
template<class T> bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<class T> bool even(T n) { return ! (n & 1); }
template<class T> bool odd(T n) { return n & 1; }
template<class T> ll rup(T a, T b) { return a % b ? a / b + 1 : a / b; }
template<class T> ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T> ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;
ll intpow(ll a, ll n, ll _mod=numeric_limits<ll>::max()) { ll p=1; while (n) { if (n&1) p=p*a%_mod; a=a*a%_mod; n>>=1; } return p; } 
ll modc(ll a, char op, ll b, ll _mod=mod)
{
        a %= _mod; b %= _mod; ll res = 1;
        switch (op) {
        case '+': res = (a + b) % _mod; break;
        case '-': res = (a - b) % _mod; break;
        case '*': res = a * b % _mod; break;
        case '/': res = modc(a, '*', modc(b, '^', _mod-2, _mod), _mod); break;
        case '^': res = intpow(a, b, _mod); break;
        case 'P': rep(i, a-b+1, a+1) res = modc(res, '*', i, _mod); break;
        case 'C': res = modc(modc(a, 'P', b, _mod), '/', modc(b, 'P', b, _mod)); break;
        } 
        if (res < 0) { res += _mod; } return res;
}



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

        vector<string> ss = {"KIH", "B", "R"};

        rep(bit, 0, 1<<4) {
                string s;
                rep(i, 0, 4) {
                        if (1<<i & bit) {
                                s += 'A';
                        }
                        if (i < 3) s += ss[i];
                }
                if (S == s) {
                        cout << "YES" << endl;
                        return 0;
                }
        }
        cout << "NO" << endl;
}


Measured memory_bytes: 3616
N, Y = (int(x) for x in input().split())
t = Y // 1000
z = t % 5 - 5

while z <= N:
    z += 5
    x = (t-z-5*(N-z))//5
    if x < 0:
        continue
    y = N-z-x
    if y < 0:
        continue
    if 10*x + 5*y + z == t:
        print('{} {} {}'.format(x, y, z))
        exit()

print('-1 -1 -1')


Measured memory_bytes: 3060
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const double PI = acos(-1);
const ll MOD = 1000000007;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
 
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
///////////////////////////////////////////////////////////////

bool A[100000];
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr); //入出力高速化
	int a,b,c; cin >> a >> b >> c;
	rep(i,100000) {
		if (i % (a+b) <= a) A[i] = true;
		else A[i] = false; 
	}
	int k = 0;
	int ans = -1;
	while (c + 60*k < 100000) {
		if (A[c + 60*k]) {
			ans = c + 60*k;
			break;
		} else k++;  
	}

	cout << ans << endl;
}


Measured memory_bytes: 3308
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int a = sc.nextInt();
    
    int num = 0;
    while(h > 0){
      num += 1;
      h -= a;
    }
    
    System.out.println(num);
  }
}

Measured memory_bytes: 21844
n = int(input())
ts, hs = 0, 0
for i in range(n):
    t, h = input().split()
    if t > h:
        ts += 3
    elif t < h:
        hs += 3
    elif t == h:
        ts += 1; hs += 1
print(str(ts) + ' ' + str(hs))


Measured memory_bytes: 5600
// E - Coprime
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;

int gcd_all(vi &A){int g = 0; for(int a:A) g = gcd(g, a);return g;}

bool is_pairwise(vi &A){
	#define MAX_A 1'000'001
	vi C(MAX_A, 0);
	for(int a:A) C[a]++;
	int c = 0;
	for(int j=2; j<MAX_A; j+=2) c += C[j];
	if(c > 1) return false;
	for(int i=3; i<MAX_A; i+=2){
		int c = 0;
		for(int j=i; j<MAX_A; j+=i) c += C[j];
		if(c > 1) return false;
	}
	return true;
}

int solve(vi &A){
	if(is_pairwise(A)) return 0;
	if(gcd_all(A) == 1) return 1;
	return 2;
}

int main(){
	int N; cin>>N;
	vi A(N); for(int i=0; i<N; ++i) cin>>A[i];
	cout<< vector<string>{"pairwise","setwise","not"}[solve(A)] <<" coprime\n";
}


Measured memory_bytes: 11112
#include <bits/stdc++.h>
using namespace std;
#define LL long long int
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    string s; cin>>s;
    int n = (int) s.size();--n;
    if(s[n]=='3') cout<<"bon\n";
    else if(s[n]=='0' || s[n]=='1' || s[n]=='6' || s[n]=='8') cout<<"pon\n";
    else cout<<"hon\n";
    return 0;
}

Measured memory_bytes: 3656
#include <iostream>
#include <vector>
#include <queue>
using namespace  std;

int main(){
    int N, M;
    vector<vector<int>> E;
    N = M = 0;
    cin >> N >> M;
    E.resize(N);
    for (int i = 0; i < M; ++i)
    {
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        E[a].push_back(b);
        E[b].push_back(a);
    }

    vector<int> p(N, -1);
    p[0] = 0;
    queue<int> bfq;
    bfq.push(0);
    while (!bfq.empty())
    {
        auto v = bfq.front();
        bfq.pop();
        for (auto &&u : E[v])
        {
            if (p[u] == -1)
            {
                p[u] = v;
                bfq.push(u);
            }
        } // end u
    }
    cout << "Yes\n";
    for (int i = 1; i < N; ++i)
    {
        cout << p[i] + 1 << '\n';
    } // end i
}

Measured memory_bytes: 10140
import heapq

N,M=map(int,input().split())
A=list(map(int,input().split()))
for i in range (0,len(A)):
    A[i]*=-1

heapq.heapify(A)

ans=0
def cheap(x,y):
    x=int(x/(2**y))
    return x

i=0
while(i<M):
    tmp=heapq.heappop(A)
    tmp=cheap(tmp,1)
    heapq.heappush(A,tmp)
    i+=1

for i in range(0,N):
    ans+=A[i]

print(ans*(-1))



Measured memory_bytes: 72556
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = Integer.parseInt(String.valueOf(a) + String.valueOf(b));
		boolean flag = false;
		for (int i = (int) (Math.sqrt(c) - 2); i <= Math.sqrt(c); i++) {
			if (i * i == c) {
				flag = true;
			}
		}
		if (flag) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 23892
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <utility>
#include <climits>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;

#define ll long long
const int MOD = 1000000007;//10^9+7
const string SPACE = " ";

ll powsur(ll a, ll b, ll p) {

	if (b == 0) {

		return 1;

	}
	else if (b % 2 == 0) {

		ll d = powsur(a, b / 2, p);
		return ((d%p)*(d%p)) % p;

	}
	else {

		return ((a%p)*powsur(a, b - 1, p) % p) % p;

	}

}
//pは素数,aのb乗をpで割った余り

ll CMOD(ll n, ll r, ll p) {

	ll a = 1, b = 1, c = 1, re;
	for (int i = 1; i <= n; i++) {

		a *= i;
		a = a%p;

	}
	for (int i = 1; i <= r; i++) {

		b *= i;
		b = b%p;

	}
	for (int i = 1; i <= n - r; i++) {

		c *= i;
		c = c%p;

	}
	b = powsur(b, p - 2, p);
	c = powsur(c, p - 2, p);
	re = ((a%p)*(b%p)) % p;
	re = ((re%p)*c%p) % p;

	return re;

}
//pは素数,(nCr)%p

ll gcd(ll a, ll b) {

	if (a > b) {

		ll tmp = a;
		a = b;
		b = tmp;

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

}
//最大公約数

ll lcm(ll a, ll b) {

	return (a / gcd(a, b))*b;

}
//最小公倍数

ll MAX(ll a, ll b) {

	if (a > b)return a;
	else return b;

}
//MAX

ll MIN(ll a, ll b) {

	if (a < b)return a;
	else return b;

}
//MIN

bool p_judge(ll p) {

	if (p == 1)return false;
	else if (p == 2)return true;
	else {

		bool flag = true;
		for (int i = 2; i <= sqrt(p); i++) {

			if (p%i == 0) {

				flag = false;
				break;

			}

		}
		return flag;

	}

}
//素数判定,素数=true,合成数=false

bool bin_search(int x, vector<int> V) {

	int l = 0, r = V.size();

	while (r - l >= 1) {

		int i = (l + r) / 2;
		if (V[i] == x)return true;
		else if (V[i] < x)l = i + 1;
		else r = i;

	}

	return false;

}
//二分探索,Vの中からx探してあったらtrue,なかったらfalse

int main() {
	
	string S;
	bool flag = true;
	cin >> S;
	
	for (int i = 1; i < S.size(); i++) {

		if (S[i] != '9')flag = false;

	}
	if (flag)cout << 9 * (S.size() - 1) + stoi(S.substr(0, 1)) << endl;
	else cout << 9 * (S.size() - 1) + stoi(S.substr(0, 1)) - 1 << endl;
	//cout << 9 * (S.size() - 1) + stoi(S.substr(0, 1)) - 1 << endl;

	return 0;
}

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

const int N = 1e5+10;
int a[N];
int main(){
    int n,r;
    cin >> n >> r;
    if(n<10){
        r = r+ 100*(10-n);
    }
    cout << r << '\n';




    return 0;
}

Measured memory_bytes: 256
import sys,io
from functools import lru_cache
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
def read():
  return int(readline())
def reads():
  return map(int, readline().split())
def mp(arg):
  return map(int,arg.split())
N,W=reads()
weight,value=[0]*N,[0]*N
for i in range(N):
    weight[i],value[i]=reads()
dp=[[ 0 for _ in  range(W+1) ] for _ in range(N+1)]
for i in range(N):
  for k in range(W+1):
    if (k >= weight[i]) :dp[i+1][k] = max(dp[i][k-weight[i]] + value[i], dp[i][k])
    else :dp[i+1][k] = dp[i][k]
print("{}".format(dp[N][W]))

Measured memory_bytes: 171528
#include<stdio.h>

int main()
{
  int n,i,j,v,vv,m;
  int map[101][101];

  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      map[i][j]=0;
    }
  }
  for(i=0;i<n;i++){
    scanf("%d%d",&v,&m);
    for(j=0;j<m;j++){
      scanf("%d",&vv);
      map[v-1][vv-1]=1;
    }
  }
  for(i=0;i<n;i++){
    for(j=0;j<n-1;j++){
      printf("%d ",map[i][j]);
    }
    printf("%d\n",map[i][j]);
  }
  return 0;
}



Measured memory_bytes: 2060
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int n,m,q[N],size;
vector<int> e[N];
bool vis[N];
void dfs(int x){
	q[++size]=x;vis[x]=1;
	int cnt=0;
	for (int i=0;i<e[x].size();i++)
	if (!vis[e[x][i]]&&!cnt) dfs(e[x][i]),cnt++;
}
int main()
{
	scanf("%d%d",&n,&m);
	for (int i=1;i<=m;i++){
		int u,v;
		scanf("%d%d",&u,&v);
		e[u].push_back(v);
		e[v].push_back(u);
	}
	dfs(1);
	reverse(q+1,q+size+1);
	size--;
	dfs(1);
	printf("%d\n",size);
	for (int i=1;i<=size;i++) printf("%d ",q[i]);
	return 0;
}

Measured memory_bytes: 11008
#include <bits/stdc++.h>
using namespace std;
int main(){
  string S;
    int N;
  cin>>N>>S;
  
  for(int i=0;i<S.size();i++){
    
    S.at(i) = (S.at(i) - 'A' + N)%26 + 'A';
    
  }
  
  cout<<S<<endl;
  
  return 0;
  
}

Measured memory_bytes: 256
/*
 * The Balance of the World
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1173&lang=jp
 */

#include <bits/stdc++.h>

using namespace std;

#define LOG(...) fprintf(stderr, __VA_ARGS__)
//#define LOG(...)
#define FOR(i, a, b) for(int i = (int)(a); i < (int)(b); ++i)
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SQ(n) (n) * (n)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;

int main() {
  string s;
  while(getline(cin, s), s != ".") {
    stack<char> balance;
    REP(i, s.length()){
      switch (s[i]) {
      case '[':
        balance.push('[');
        break;
      case '(':
        balance.push(')');
        break;
      case ']':
        if(balance.empty() || balance.top() != '[') {
          cout << "no" << endl;
          goto END;
        }
        balance.pop();
        break;
      case ')':
        if(balance.empty() || balance.top() != ')') {
          cout << "no" << endl;
          goto END;
        }
        balance.pop();
        break;
      }
    }
    if(!balance.empty()) {
      cout << "no" << endl;
      goto END;
    }
    cout << "yes" << endl;
END:;
  }
}

Measured memory_bytes: 3124
/**
       ������������    ������������
		Author : Avi J Patel
		University : DA-IICT
       ������������    ������������
**/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define mp make_pair 
#define mt make_tuple
#define ff first
#define ss second
#define si size()
#define MOD 1000000007
#define Mod 998244353
#define N 200001
#define large 10000000000000001
#define For(i,m,n) for(long long i=m;i<n;i++)
#define st(x) sort(x.begin(),x.end())
#define re(x,i) reverse(x.begin()+i,x.end())
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);srand(time(NULL));
bool sortbysec(const pair<int,int> &a, 
              const pair<int,int> &b) 
{ 
    if(a.second < b.second) return true; 
    else if(a.ss==b.ss) return a.ff<b.ff;
	else return false;
}
bool sortbyboth(const pair<int,int> &a, const pair<int,int> &b)
{
	if(a.first<b.first) return true;
	else if(a.first==b.first) return a.second<b.second;
	else return false;
}
int main()
{
	ll a,b;
	cin>>a>>b;
	ll g=__gcd(a,b);
	//cout<<g<<endl;
	vector<ll> f;
	for(ll i=1;i<=sqrt(g);i++)
	{
		if(g%i==0)
		{
			f.pb(i);
			if(g/i!=i)
			{
				f.pb(g/i);
			}
		}
	}
	sort(f.begin(),f.end());
	/*for(int i=0;i<f.size();i++)
	{
		cout<<f[i]<<" ";
	}*/
	cout<<endl;
	int t[f.size()]={0};
	int cnt=0;
	for(int i=1;i<f.size();i++)
	{
		if(t[i]==0)
		{
			cnt++;
			for(int j=i+1;j<f.size();j++)
			{
				if(f[j]%f[i]==0)
				{
					t[j]=1;
				}
			}
		}
	}
	cout<<cnt+1;
	return 0;
}












Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[200005];
long long s[200005];
long long cal(long long s[], int nn) {
    if (nn == 1) return 0;
    long long s1[nn/2+2], s2[nn/2+2];
    for(int i = 1; i <= nn/2; ++i) s1[i] = s[i];
    for(int i = nn/2+1; i <= nn; ++i) s2[i-nn/2] = s[i];
    long long ans1 = cal(s1, nn/2);
    long long ans2 = cal(s2, nn-nn/2);
    sort(s1+1, s1+1+nn/2);
    long long ans3 = 0;
    for(int i = 1; i <= nn-nn/2; ++i) {
        int inf = 1, sup = nn/2, mid, tt = 0;
        while (inf <= sup) {
            mid = inf + sup >> 1;
            if (s1[mid] <= s2[i]) {
                tt = mid;
                inf = mid + 1;
            } else sup = mid - 1;
        }
        ans3 += tt;
    }
    return ans1 + ans2 + ans3;
}
int main() {
    cin >> n >> k;
    long long sum =0;
    long long ans = 0;
    s[1] = 0;
    for(int i = 1; i <= n; ++i) {
        cin >> a[i];
        sum = sum + a[i];
        long long t = sum - 1LL*k*i;
        s[i+1] = t;
    }
    ans = cal(s, n+1);
    cout << ans << endl;
}

Measured memory_bytes: 5760
#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int main(){
	int a,b;
	cin >> a;
	cin >> b;
	
	ostringstream osa;
	osa << a;
	string as = "";
	string bs = "";
	for(int i = 0; i<b; i++){
		as += osa.str();
	}
	ostringstream osb;
	osb << b;
	for(int i = 0; i<a; i++){
		bs += osb.str();
	}
	
	if(a < b){
		cout << as << endl;
	}else{
		cout << bs << endl;
	}
			
	
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            input_iter = LazyLoadAllLines();
            //------------------------------------------------//
            var n = Read<long>();
            //var m = Read<long>();
            //var a = Read<long>();
            //var b = Read<long>();
            //var c = Read<long>();
            //var x = Read<long>();
            var s = Read();
            //var dls = Read<long>(n);
            //List<long> als = new List<long>(), bls = new List<long>();
            //List<List<long>> cls = new List<List<long>>();
            /*for (int i = 0; i < m; ++i)
            {
                als.Add(Read<long>());
                bls.Add(Read<long>());
                cls.Add(Read<long>(bls[i]));
            }*/

            //als.Sort((l, r) => (int)(r - l));

            char curc = '@';
            long cnt = 0;
            foreach (var c in s){
                if(c != curc)
                {
                    ++cnt;
                    curc = c;
                }
            }

            Console.WriteLine(cnt);

        }

        static IEnumerator<string> input_iter;

        static _T Read<_T>() where _T : struct
        {
            input_iter.MoveNext();
            return (_T)Convert.ChangeType(input_iter.Current, typeof(_T));
        }
        static string Read()
        {
            input_iter.MoveNext();
            return input_iter.Current;
        }
        static List<_T> Read<_T>(long num) where _T : struct { return new List<_T>(Enumerate<_T>(num)); }


        static IEnumerable<_T> Enumerate<_T>(long num)
        {
            for (long i = 0; i < num; ++i)
            {
                input_iter.MoveNext();
                yield return (_T)Convert.ChangeType(input_iter.Current, typeof(_T));
            }
        }
        static IEnumerator<string> LazyLoadAllLines()
        {
            string line;
            do
            {
                line = Console.ReadLine();
                foreach (var s in line.Split(' '))
                    yield return s;
            } while (line != null);
        }
    }
}


Measured memory_bytes: 11988
#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <sstream>
#include <string>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <limits>
#include <unordered_map>
#include <unordered_set>
#include <math.h>
#include <fstream>
#include <iterator>
#include <random>
#include <chrono>


#define forr(i,start,count) for (int i = (start); i < (start)+(count); ++i)
#define set_map_includes(set, elt) (set.find((elt)) != set.end())
#define readint(i) int i; cin >> i
#define readll(i) ll i; cin >> i
#define readdouble(i) double i; cin >> i
#define readstring(s) string s; cin >> s

typedef long long ll;

using namespace std;

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

int main()   {
    cout.precision(17);
    ll modd = 1000 * 1000 * 1000 + 7;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    uniform_int_distribution<int> rand_gen(0, modd);   // rand_gen(rng) gets the rand no
    ll infinit = 10000000000000000;


//    readint(test_cases);
    int test_cases = 1;
    forr(t, 1, test_cases) {
        readll(k);

        ll ret = 0;
        forr(i,1,k) {
            forr(j,1,k) {
                forr(r,1,k) {
                    ll val = gcd(i,j);
                    val = gcd(val,r);
                    ret += val;
                }
            }
        }


        cout << ret << endl;
    }
    return 0;
}


Measured memory_bytes: 3576
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;

int l, n, s;
vector<int> a1, a2, a3;
int main()
{
	int i, j;
	cin >> l;
	for (i = 1, j = 1; i * 2 <= l; i *= 2, j++) {
		a1.push_back(j), a2.push_back(j + 1), a3.push_back(0);
		a1.push_back(j), a2.push_back(j + 1), a3.push_back(i);
	}
	n = j;
	s = i;
	cout << n << ' ';
	l -= i;
	for (j--; j >= 0; j--) {
		if (l & (1 << j)) {
			a1.push_back(j + 1), a2.push_back(n), a3.push_back(s);
			s += 1 << j;
		}
	}
    cout << a1.size() << endl;
    for (i = 0; i < a1.size(); i++) {
		printf("%d %d %d\n", a1[i], a2[i], a3[i]);
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

int main(){
	int n,h,m,s;
	std::cin >> n;
	h = n / 3600;
	m = (n - h * 3600) / 60;
	s = n - h * 3600 - m * 60;
	std::cout << h << ":" << m << ":" << s <<std::endl;
}

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

int N, Y;
int a = -1, b = -1, c = -1;

int main() {
  cin >> N >> Y;
  for(int i = 0; i <= N; ++i) {
    for(int j = 0; j <= N - i; ++j) {
      int amn = 10000 * i + 5000 * j + 1000 * (N - i - j);
      if(amn == Y) {
        a = i; b = j; c = N - i - j;
      }
    }
  }

  cout << a << ' ' << b << ' ' << c << "\n";
}

Measured memory_bytes: 256
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;


int main()
{
	vector<pair<int, int>>data;
	for (size_t i = 1; i < 150; i++)
	{
		for (size_t j = i+1; j <= 150; j++)
		{
			data.push_back(pair<int, int > {i, j});
		}
	}
	sort(data.begin(), data.end(), []
		(const pair<int, int>a, const pair<int, int>b) {
		if (a.first*a.first + a.second*a.second == b.first*b.first + b.second*b.second)
		{
			return a.first < b.first;
		} else
		{
			return a.first*a.first + a.second*a.second < b.first*b.first + b.second*b.second;
		}
	});
	pair<int, int>in;
	while (cin >> in.first >> in.second, in.first&&in.second)
	{
		auto i = data.begin();
		for (; *i != in; i++);
		i++;
		cout << (*i).first << " " << (*i).second << endl;

	}
}

Measured memory_bytes: 1328
import sys
from operator import itemgetter

def input(): return sys.stdin.buffer.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 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** -10

class BIT:
    """ Binary Indexed Tree """

    def __init__(self, n):
        # 0-indexed
        n += 1
        nv = 1
        while nv < n:
            nv *= 2
        self.size = nv
        self.tree = [0] * nv

    def sum(self, i):
        """ [0, i]を合計する """
        s = 0
        i += 1
        while i > 0:
            s += self.tree[i-1]
            i -= i & -i
        return s

    def add(self, i, x):
        """ 値の追加：添字i, 値x """
        i += 1
        while i <= self.size:
            self.tree[i-1] += x
            i += i & -i

    def get(self, l, r=None):
        """ 区間和の取得 [l, r) """
        # 引数が1つなら一点の値を取得
        if r is None: r = l + 1
        res = 0
        if r: res += self.sum(r-1)
        if l: res -= self.sum(l-1)
        return res

    def update(self, i, x):
        """ 値の更新：添字i, 値x """
        self.add(i, x - self.get(i))

N, Q = MAP()
A = [a-1 for a in LIST()]

prev = [-1] * N
events = []
bit = BIT(N)
for t, a in enumerate(A):
    s = prev[a]
    if s != -1:
        events.append((t, 0, s))
    prev[a] = t

for i in range(Q):
    l, r = MAP()
    l -= 1; r -= 1
    events.append((r, 1, l, i))

events.sort(key=itemgetter(0))
ans = [0] * Q
for event in events:
    # 色の区間が来たら、点を追加
    if event[1] == 0:
        t, _, s = event
        bit.add(s, 1)
    # クエリが来たら、点の数を数える
    else:
        r, _, l, i = event
        total = r - l + 1
        # 区間全体 - この時の領域内の点の数
        ans[i] = total - bit.get(l, N)

for a in ans:
    print(a)


Measured memory_bytes: 260568
#include<set>
#include<map>
#include<deque>
#include<queue>
#include<stack>
#include<cmath>
#include<ctime>
#include<bitset>
#include<string>
#include<vector>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<complex>
#include<iostream>
#include<algorithm>
#define ll long long
using namespace std;

const int maxn = 5100;
const int maxk = 5100;

int n,k;
int a[maxn];
bitset<maxk>f[maxn],g[maxn];

int main()
{
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	
	for(int i=1;i<=n;i++) if(a[i]>=k) { n=i-1; break; }
	
	f[0][0]=1;
	for(int i=1;i<=n;i++) f[i]=f[i-1]|(f[i-1]<<a[i]);
	g[n+1][0]=1;
	for(int i=n;i>=1;i--) g[i]=g[i+1]|(g[i+1]<<a[i]);
	
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		int d=k-a[i],u=k-1;
		int x=0,y=u;
		bool flag=false;
		for(x;x<=u;x++) if(f[i-1][x])
		{
			while(x+y>u) y--;
			for(;x+y>=d;y--) if(g[i+1][y]) { flag=true; break; }
			if(flag) break;
		}
		if(!flag) ans++;
	}
	printf("%d\n",ans);
	
	return 0;
}


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

void solve();

string x;
int a, b, c, d;

int main() {
  cin >> x;

  a = (x[0]-'0');
  b = (x[1]-'0');
  c = (x[2]-'0');
  d = (x[3]-'0');

  solve();

  return 0;
}

void solve() {
  char op1, op2, op3;
  string op("+-");
  int sum = a;

  for(int i=0; i<2; ++i) {
    for(int j=0; j<2; ++j) {
      for(int k=0; k<2; ++k) {
        op1=op[i]; op2=op[j]; op3=op[k];
        if(op1=='+') sum += b;
        else sum -= b;
        if(op2=='+') sum += c;
        else sum -= c;
        if(op3=='+') sum += d;
        else sum -= d;

        if(sum == 7) {
          cout << a << op1 << b << op2 << c << op3 << d << "=7" << endl;
          return;
        }else   {
          sum = a;
        }
      }
    }
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define maxn 200005
const ll inf=1e9+7;
#define pb push_back
#define PI 3.14159265
#define watch(x) cerr << (#x) << " is " << (x) << endl;
void solve();
void sieve();
int main()
{
	//sieve();
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout<<fixed;
	cout<<setprecision(10);
	
	ll t=1;
	//cin>>t;
	while(t--)
	solve();
	
	return 0;
}

ll pr[1001];
vector<ll> prime;
void sieve()
{
	pr[0]=-1;
	pr[1]=-1;
	ll i,j;
	for(i=2;i<1001;i++)
	{
		if(pr[i]!=-1)
		{
			pr[i]=1;
			for(j=2;j<1001/i+1;j++)
			{
				if(i*j<1001)
				pr[i*j]=-1;
			}
		}
	}
	for(i=2;i<1001;i++)
	{
		if(pr[i]==1)
		prime.pb(i);
	}
}
		
bool pal(string s)
{
	string t=s;
	reverse(s.begin(),s.end());
	return (t==s);
}
ll countdig(ll x)
{
	ll c=0;
	if(x==0)
	return 1;
	
	while(x!=0)
	{
		c++;
		x/=10;
	}
	return c;
}
bool isprime(ll x)
{
	bool flag=true;
	for(ll i=2;i<=sqrt(x)+1;i++)
	{
		if(x%i==0)
		{
			flag=false;
			break;
		}
	}
	if(x==1)
	flag=false;
	
	return flag;
}
void swap(ll& a,ll& b)
{
	ll t=a;
	a=b;
	b=t;
}
class matrix 
{
	public:
	vector<vector<ll>> v;
	ll row;
	ll col;
	matrix(vector<vector<ll>> mat)
	{
		v.assign(mat.begin(),mat.end());
		row=mat.size();
		col=mat[0].size();
	}
	vector<vector<ll>> I(ll n)
	{
		vector<vector<ll>> mat(n,vector<ll>(n,0));
		for(ll i=0;i<n;i++)
		mat[i][i]=1;
		return mat;
	}
	matrix operator * (matrix& u)
	{
		ll r=this->row;
		ll c=u.col;
		assert(this->col==u.row);
		vector<vector<ll>> res(r,vector<ll>(c,0));
		for(ll i=0;i<r;i++)
		{
			for(ll j=0;j<c;j++)
			{
				for(ll k=0;k<this->col;k++)
				res[i][j]+=v[i][k]*u.v[k][j];
			}
		}
		return matrix(res);
	}
	matrix fastexpo(matrix m,ll p)
	{
		assert(m.row==m.col);
		matrix res(I(m.row));
		
		while(p)
		{
			if(p&1)
			res=res*m;
			m=m*m;
			p=p>>1;
		}
		return res;
	}
};
bool comp(ll a,ll b)
{
	return a>b;
}
void gensparse()
{
	ll n=5,i,j;
	ll st[n][27];
	ll arr[]={1,2,3,4,5};
	for(i=0;i<n;i++)
	st[i][0]=(arr[i]);
	
	for(j=1;j<27;j++)
	{
		for(i=0;i+(1<<j)-1<n;i++)
		{
			st[i][j]=(st[i][j-1]+st[i+(1<<(j-1))][j-1]);
		}
	}
	//now query 
	ll l,r;
	cin>>l>>r;
	ll ans=0;
	for(j=26;j>=0;j--)
	{
		if((1<<j)<=r-l+1)
		{
			ans+=st[l][j];
			l+=(1<<j);
		}
	}
	cout<<ans;
}
ll solve(ll l,ll r,ll n)
{
	if(l>r)
	return 0;
	ll g=(l+r)/2;
	if(g==0)
	return solve(g+1,r,n);
	
	if(n>=(ll)pow(26,g-1)+1&&n<=(ll)pow(26,g))
	return g;
	else if(n>(ll)pow(26,g))
	return solve(g+1,r,n);
	else
	return solve(l,g-1,n);
}
void solve()
{
	ll n,m,k,i,j;
	cin>>n>>m>>k;
	ll a[n],b[m],pra[n],prb[m];
	for(i=0;i<n;i++)
	cin>>a[i];
	pra[0]=a[0];
	for(i=1;i<n;i++)
	pra[i]=pra[i-1]+a[i];
	for(i=0;i<m;i++)
	cin>>b[i];
	prb[0]=b[0];
	for(i=1;i<m;i++)
	prb[i]=prb[i-1]+b[i];
	
	
	ll l=0,r=0;
	for(r=0;r<m;r++)
	{
		if(prb[r]>k)
		break;
	}
	r--;
	
	ll maxm=r; //at the end do r+=2
	for(l=0;l<n;l++)
	{
		ll lim=k-pra[l];
		if(lim<0)
		break;
		for(j=r;j>=0;j--)
		{
			if(prb[j]<=lim)
			break;
		}
		maxm=max(l+j+1,maxm);
		
		r=j;
	}
	cout<<maxm+1;

}
			
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	


Measured memory_bytes: 9952
#include<bits/stdc++.h>
using namespace std;
int n;
vector<pair<int,int>> v[16];
bool check_for_honest(int k,int x)
{
  for(auto i:v[k])
  {
    int c = (1<<(i.first-1))&x;
    if(i.second)
      {
        if(c) continue;
        else return false;
      }
    else
      {
        if(!c) continue;
        else return false;
      }
  }
  return true;
}
bool check(int x)
{
  //cout<<"Checking for x :"<<x<<"\n";
  for(int i=0;i<n;i++)
  {
    if((1<<i)&x)
      {
        if(!check_for_honest(i,x))
          return false;
      }
    else
    {
      if(check_for_honest(i,x))
        return false;
    }
  }
  return true;
}
int count_set_bits(int x)
{
  int ans=0;
  for(int i=0;i<n;i++)
  {
    if((1<<i)&x)
      ans++;
  }
  return ans;
}
int main()
{
  cin>>n;
  for(int i=0;i<n;i++)
  {
    int k;
    cin>>k;
    v[i].resize(k);
    for(auto &j:v[i])
      cin>>j.first>>j.second;
  }
  int k = (1<<(n)) - 1;
  //cout<<k;
  int ans=0;
  while(k>=0)
  {
    if(check(k)) ans=max(ans,count_set_bits(k));
    --k;
  }
  //k = ~k;
  //cout<<k<<"\n";
  cout<<ans<<"\n";
  return 0;
}


Measured memory_bytes: 256
// フェルマーの小定理
package main

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

const (
	m = 1000000007
)

func mpow(x, y int) int {
	result := 1
	for y != 0 {
		if y&1 == 1 {
			result *= x
			result %= m
		}
		x *= x
		x %= m
		y >>= 1
	}
	return result
}

func mcomb(n, k int) int {
	a := 1
	b := 1
	for i := 0; i < k; i++ {
		a *= n - i
		a %= m
		b *= i + 1
		b %= m
	}
	return a * mpow(b, m-2) % m
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func main() {
	X := readInt()
	Y := readInt()

	if (X+Y)%3 != 0 {
		fmt.Println(0)
		return
	}

	a := (2*Y - X) / 3
	b := (2*X - Y) / 3

	if a < 0 || b < 0 {
		fmt.Println(0)
		return
	}

	n := a + b
	k := min(a, b)
	fmt.Println(mcomb(n, k))
}

const (
	ioBufferSize = 1 * 1024 * 1024 // 1 MB
)

var stdinScanner = func() *bufio.Scanner {
	result := bufio.NewScanner(os.Stdin)
	result.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	result.Split(bufio.ScanWords)
	return result
}()

func readString() string {
	stdinScanner.Scan()
	return stdinScanner.Text()
}

func readInt() int {
	result, err := strconv.Atoi(readString())
	if err != nil {
		panic(err)
	}
	return result
}


Measured memory_bytes: 1808
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define vi vector<ll>
#define pb push_back
#define ff first
#define ss second
#define inf 2e18
#define ull unsigned long long
#define pi acos(-1.0)
#define mod 1000000007
#define lop0(n) for(ll i=0;i<n;i++)
#define lopj(n) for(ll j=0;j<n;j++)
#define lop1(n) for(ll i=1;i<=n;i++)
#define all(v) v.begin(),v.end()
ll Set(ll N,ll pos){ return N=N | (1LL<<pos); }
ll reset(ll N,ll pos){ return N= N & ~(1LL<<pos); }
bool check(ll N,ll pos){ return (bool)(N & (1LL<<pos)); }
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

main()
{
    ll d,t,s;
    cin>>d>>t>>s;
    if(t*s>=d) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}



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

string calc(int n){
	string ans="";
	while(n!=0){
		if(n%-2!=0){
			ans="1"+ans;
			n--;
		}
		else ans="0"+ans;
		n/=-2;
	}
	return ans;
}

int main(){
	int n;cin >> n;
	string ans=calc(n);
	if(n==0) ans="0";
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;
using ll = long long;

#define REP(i, a) for (int i = 0; i < (a); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (a)-1; i >= (b); --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define YESNO(cond, yes, no) \
    { cout << ((cond) ? (yes) : (no)) << endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(), (list).rend())
#define ASSERT(cond, mes) assert(cond&& mes)

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template <typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())
    is >> v[i];
    return is;
}

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a) n = a;
    if (n > b) n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u / GCD(u, v) * v;
}

template <class T>
std::vector<T> enum_div(T n) {
    std::vector<T> ret;
    for (T i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) { ret.push_back(n / i); }
        }
    }
    return ret;
}

bool isPrime(ll num) {
    if (num < 2)
        return false;
    else if (num == 2)
        return true;
    else if (num % 2 == 0)
        return false;

    for (ll i = 3; i * i <= num; i += 2) {
        if (num % i == 0) { return false; }
    }

    return true;
};

template <typename T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

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

template <class T>
bool is_integer(T x) {
    return std::floor(x) == x;
}

struct ToUpper {
    char operator()(char c) {
        return toupper(c);
    }
};

struct ToLower {
    char operator()(char c) {
        return tolower(c);
    }
};

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

    string S, T;
    cin >> S >> T;
    int A, B;
    cin >> A >> B;
    string U;
    cin >> U;

    if (S == U)A--;
    else B--;
    cout << A << " " << B << endl;
    return 0;
}


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

#define ll long long
#define Fi first
#define Se second
#define Pb push_back
#define vi vector<int>
#define vp vector<pair<int,int>>
#define vvi vector<vector<int>>
#define vvp vector<vector<pair<int,int>>>

const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vector<int>>; //Caution!! Segmentation Fault!! Don't forget to add +1!

#define all(v) v.begin(),v.end()
#define output_s(a) printf("%s\n",(a).c_str())

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,n,m) for(int i=(int)(n);i<(int)(m);i++)
#define RepS(i,n,m) for(int i=(int)(n);i<=(int)(m);i++)
#define RRepS(i,n,m) for(int i=(int)(n);i>=(int)(m);i--)
#define RepA(x) for(auto &item:(x))

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}    
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

template<typename TypeInt> //最大公約数
TypeInt GCD(TypeInt a,TypeInt b){
    if(a%b==0) return b;
    else return GCD(b,a%b);
}
template<typename TypeInt> //最小公倍数
TypeInt LCM(TypeInt a,TypeInt b){
    return a*b/GCD(a,b);
}

int IN_int(){
    int x;
    scanf("%d",&x);
    return x;
}

//library----------------------------------------------

//const int dx[4]={1,0,-1,0};
//const int dy[4]={0,1,0,-1};
const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};

const int NMAX = 100;
bool flag;

bool comp(int x,int y){
    return abs(0-x)<abs(0-y);
}

signed main(){
    CIN(s);
    int a=s/100;
    int b=s%100;
    string ans;
    if(1<=a&&a<=12){
        if(1<=b&&b<=12){
            ans="AMBIGUOUS";
        }else{
            ans="MMYY";
        }
    }else{
        if(1<=b&&b<=12){
            ans="YYMM";
        }else{
            ans="NA";
        }
    }
    output_s(ans);

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double r =sc.nextDouble();
        double pi = Math.PI;
        double length = 2*pi*r;
        double area = r*r*pi;
        System.out.printf("%.6f %.6f",area,length);
        sc.close();
    }
}


Measured memory_bytes: 28160
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            var A = cin.ReadLong;
            var B = cin.ReadLong;
            var K = cin.ReadLong;

            A = A - K;
            if (A < 0)
            {
                B = A + B;
                A = 0;

                if (B < 0)
                {
                    B = 0;
                }
            }

            WriteLine(A + " " + B);

        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}

Measured memory_bytes: 27864
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
			int n = scan.nextInt();
			if(n == 0){
				break;
			}
			int[] list = new int[n];
			for(int i = 0;i < n;i++){
				list[i] = scan.nextInt();
			}
			int count = 0;
			while(n > 1){
				for(int i = 0;i < n-1;i++){
					if(list[i] > list[i + 1]){
						int t = list[i];
						list[i] = list[i + 1];
						list[i + 1] = t;
						count++;
					}
				}
				n--;
			}
			System.out.println(count);
		}
	}
}

Measured memory_bytes: 20892
#include<iostream>
using namespace std;
#define max 2010
int mark[max];
int n, q;
//穷举法递归验证是否满足解
bool solve(int i,int m) 
{
	if (!m)return true;
	if ((m - mark[i]) < 0)return false;
	if (i == n-1 &&!(m - mark[i]))return true;
	for (int k = i+1; k < n; ++k) 
	{
		if (solve(k, m - mark[i]))
			return true;
	}
	return false;
}

void result() 
{
	int tmp;
	cin >> n;
	//++n;
	for (int i = 0; i < n; ++i)
		cin >> mark[i];
	//mark[0] = 0;
	cin >> q;
	for (int i = 0; i < q; ++i) 
	{
		cin >> tmp;
		for(int p=0;p<n;++p)
			if (solve(p, tmp)) 
			{
				cout << "yes" << endl;
				goto loop;
			}

	     cout << "no" << endl;
	 loop:;;;
	}
}

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


Measured memory_bytes: 3120
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
using ll = long long;
int main()
{
    ll h,w;
    cin >> h >> w;
    if(h == 1 || w == 1)
    {
        cout << "1\n";
    }
    else
    {
        cout << h * w - h * w / 2 << "\n";
    }
    
    return 0;
}

Measured memory_bytes: 256
let input = require('fs').readFileSync( '/dev/stdin', 'utf8' );
let arr = input.split('\n');
for (let i = 0; i< arr.length; i ++) {
    let Arr = arr[i].split(' ').map(Number);
    let H = Arr[0];
    let W = Arr[1];
    if (H === 0 && W === 0) break;
    let str = '';
    for (let k = 0; k < H; k ++) {
        for (let j = 0; j < W; j ++) {
            if (k === 0 || k === H - 1) {
                str += '#';
            } else {
                if (j === 0 || j === W - 1) str += '#';
                else str += '.';
            }
        }
        str += '\n';
    }
    console.log(str);
}


Measured memory_bytes: 18660
import math
import sys
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
print(math.ceil(N/2))

Measured memory_bytes: 38512
#include <algorithm>
#include <iostream>
#include <string>
#include <utility>
#include <vector>

using namespace std;
typedef pair<string, int> f_pair;

bool pairCompare(const f_pair& a1, const f_pair& a2)
{
	return a1.second > a2.second;
}

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

	vector<f_pair> a;
	string s, lMax;
	while (cin >> s)
	{
		int n;
		bool exist = false;

		if (s.size() > lMax.size()) lMax = s;
		for (int i = 0; i < a.size(); ++i)
			if (s == a[i].first)
			{
				exist = true, n = i;
				break;
			}

		if (exist)
			a[n].second++;
		else
			a.push_back(f_pair(s, 1));
	}

	sort(a.begin(), a.end(), pairCompare);
	cout << a[0].first << " " << lMax << endl;

	return 0;
}

Measured memory_bytes: 1204