akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cctype>
#include <set>
#include <iostream>
using namespace std;
typedef string::const_iterator State;

set<int> number(State &begin);
set<int> factor(State &begin);
set<int> expression(State &begin);

set<int> number(State &begin){
	int ret=0;
	while(isdigit(*begin)){
		ret*=10;
		ret+=*begin-'0';
		begin++;
	}
	set<int> s;
	s.insert(ret);
	return s;
}

set<int> factor(State &begin){
	if(*begin=='('){
		begin++;
		set<int> ret=expression(begin);
		begin++;
		return ret;
	}else{
		return number(begin);
	}
}

set<int> dp[11][11];

set<int> expression(State &begin){
	set<int> ret;
	vector<string> ex;
	vector<set<int> >  s;
	s.push_back(factor(begin));
	while(1){
		if(*begin=='+'){
			begin++;
			ex.push_back("+");
			s.push_back(factor(begin));
		}else if(*begin=='-'){
			begin++;
			ex.push_back("-");
			s.push_back(factor(begin));
		}else if(*begin=='*'){
			begin++;
			ex.push_back("*");
			s.push_back(factor(begin));
		}else if(*begin=='/'){
			begin++;
			ex.push_back("/");
			s.push_back(factor(begin));
		}else{
			break;
		}
	}
	int n=s.size();
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			dp[i][j].clear();
		}
		dp[i][i]=s[i];
	}
	for(int l=1;l<n;l++){
		for(int i=0;i<n-l;i++){
			for(int j=i;j<i+l;j++){
				for(set<int>::iterator a=dp[i][j].begin();a!=dp[i][j].end();a++){
					for(set<int>::iterator b=dp[j+1][i+l].begin();b!=dp[j+1][i+l].end();b++){
						if(ex[j]=="+"){
							dp[i][i+l].insert(*a+*b);
						}
						if(ex[j]=="-"){
							dp[i][i+l].insert(*a-*b);
						}
						if(ex[j]=="*"){
							dp[i][i+l].insert((*a)*(*b));
						}
						if(ex[j]=="/"){
							if(*b==0)continue;
							dp[i][i+l].insert((*a)/(*b));
						}
					}
				}
			}
		}
	}
	return dp[0][n-1];
 }

int main(void){
	string str;
	while(1){
		cin >> str;
		if(str=="#")break;
		State begin=str.begin();
		printf("%d\n",expression(begin).size());
	}
	return 0;
}

Measured memory_bytes: 1332
sx, sy, tx, ty = list(map(int, input().split()))
x = tx-sx
y = ty-sy
print('D', 'R'*(x+1), 'U'*(y+1), 'L', sep='', end='')
print('D'*y, 'L'*x, sep='', end='')
print('L', 'U'*(y+1), 'R'*(x+1), 'D', sep='', end='')
print('L'*x, 'D'*y, sep='')

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

int main() {
  queue<ll> que;
  for(int i=1;i<10;i++){
    que.push(i);
  }
  int k;
  cin>>k;
  ll p,q;
  for(int i=0;i<k-1;i++){
    p=que.front();
    que.pop();
    if(p%10!=0){
      que.push(p*10+p%10-1);
    }
    que.push(p*10+p%10);
    if(p%10!=9){
      que.push(p*10+p%10+1);
    }
  }
  cout<<que.front()<<endl;
}

Measured memory_bytes: 5112
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <limits>
#include <numeric>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <stack>

using namespace std;

#define INFint (1<<30)
#define BOUND 27182818284
#define MAT 2

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

ll MOD = 1000000007;
const ll INF = (1ll << 60);
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for(int i=int(a);i<int(b);++i)

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

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

// gcd
template<typename T>
T gcd(T a, T b) {
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

int findGCD(vector<int> arr) {
    int result = arr[0];
    for (auto a: arr) {
        result = gcd(a, result);
    }
    return result;
}

template<typename T>
T lcm(T m, T n) {
    // 引数に0がある場合は0を返す
    if ((0 == m) || (0 == n))
        return 0;
    return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    fill((T *) array, (T *) (array + N), val);
}


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

// v.front() = -BOUND;
// v.back() = BOUND;

//struct edge{
//    int cost, to;
//
//    edge(int in_cost, int in_to){
//        cost=in_cost;
//        to=in_to;
//    }
//    bool operator<(const edge &a) const
//    {
//        return cost > a.cost;
//    }
//};




vector<ll>sum(200010,0);
vector<ll>pre(200010,0);
int main() {
    int N; cin >> N;
    vector<int> C(N+1);

    rep(i,N){
        cin >> C[i+1];
    }

    sum[0]=1LL;
    for(int i=1; i<=N; i++){
        if(C[i]==C[i-1]){
            sum[i]=sum[i-1];
        }else if(pre[C[i]]==0){
            sum[i]=sum[i-1];
        }else{
            sum[i]=sum[i-1]+sum[pre[C[i]]];
        }
        sum[i]%=MOD;
        pre[C[i]]=i;
    }

    cout << sum[N] << endl;
    return 0;
}

Measured memory_bytes: 4468
#include "bits/stdc++.h"

using namespace std;

void Main() {
    int A, B;
    cin >> A >> B;
    bool possible = false;
    if (A % 3 == 0 || B % 3 == 0 || (A + B) % 3 == 0) {
        possible = true;
    }
    cout << (possible ? "Possible" : "Impossible") << endl;
}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


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

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using ll = long long;
using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;

long int M = 1e+9+7;
int inf = 1e+9;
int main(void){
    int n;
    map<char, int> abc;
    vector<char> ans;
    cin >> n >> abc['A'] >> abc['B'] >> abc['C'];
    vector<string> s(n);
    rep(i,n){
        cin >> s[i];
    }
    ll sum=abc['A']+abc['B']+abc['C'];
    if(sum == 0){
        cout << "No" << endl;
        return 0;
    }
    rep(i,n){
        if(abc[s[i][0]] == 0 && abc[s[i][1]] == 0){
            cout << "No" << endl;
            return 0;
        }
        if(i+1 < n && abc[s[i][0]] == 1 && abc[s[i][1]] == 1){
            if(s[i][0] == s[i+1][0] || s[i][0] == s[i+1][1]){
                ans.push_back(s[i][0]);
                abc[s[i][0]]++;
                abc[s[i][1]]--;
            }else{
                ans.push_back(s[i][1]);
                abc[s[i][0]]--;
                abc[s[i][1]]++;
            }
        }else if(abc[s[i][0]] < abc[s[i][1]]){
            ans.push_back(s[i][0]);
            abc[s[i][0]]++;
            abc[s[i][1]]--;
        }else{
            ans.push_back(s[i][1]);
            abc[s[i][0]]--;
            abc[s[i][1]]++;                
        }
    }

    cout << "Yes" << endl;
    rep(i,n){
        cout << ans[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 6740
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long LL;

int main() {
  vector<int> A(3); cin >> A[0] >> A[1] >> A[2];
  sort(A.begin(),A.end());
  cout << A[2] - A[0] << endl;
}


Measured memory_bytes: 3608
#include <cstdio>
#include <cmath>
#include <set>
using namespace std;
int a, b, n;
long long cnt = 0;
set<long long> s;
void re(long long sum, int size) {
    if (size == 0) {
        if (s.find(sum) == s.end()) {
            cnt++;
            s.insert(sum);
        }
        return ;
    }
    for (int i = a;i <= b;i++) {
        re(sum + i, size - 1);
    }
}
int main() {
    scanf("%d%d%d", &n, &a, &b);
    if (n == 1) {
        if (a == b) printf("1");
        else printf("0");
    } else {
        if (a > b) {
            printf("0");
        } else {
            // re((long long)a + b, n - 2);
            printf("%lld", (long long)(b - a) * (n - 2) + 1);
        }
    }
    return 0;
}

Measured memory_bytes: 256
# coding: utf-8
 
N = int(input())
 
if N < 105:
    print(0)
elif N < 135:
    print(1)
elif N < 165:
    print(2)
elif N < 189:
    print(3)
elif N < 195:
    print(4)
else:
    print(5)

Measured memory_bytes: 2940
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int N, color[100001], order[100001];
vector<vector<int>> graph(100001);
int main() {
  scanf("%d", &N);
  for(int i = 1, a, b; i < N; ++i) {
    scanf("%d %d", &a, &b);
    graph[a].push_back(b);
    order[i] = b;
  }
  for(int p = 1; p < N; ++p) {
    for(int d = 0, c = 1; d < (int)graph[p].size(); ++d, ++c) {
      if(color[p] == c) ++c;
      color[graph[p][d]] = c;
    }
  }
  printf("%d\n", *max_element(color, color+N+1));
  for(int i = 1; i < N; ++i) {
    printf("%d\n", color[order[i]]);
  }  
}

Measured memory_bytes: 5120
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
//map<key,value>

int main(){
  char s;
  cin >> s;
  if(s=='A')cout << 'T';
  if(s=='T')cout << 'A';
  if(s=='G')cout << 'C';
  if(s=='C')cout << 'G';
}


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

using namespace std;

const int maxn=610;

int n,m;

vector<int> e[maxn];

double dp[maxn];

int main(){
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		e[x].push_back(y);
	}
	
	double ans=1e15;
	for(int i=0;i<n;++i){
		dp[n]=0;
		for(int j=n-1;j>=1;j--){
			double mx=0;
			double sum=0;
			int num=e[j].size();
			for(auto it:e[j]){
				sum+=dp[it];
				mx=max(mx,dp[it]);
			}
			if(num>=2&&j==i){
				sum-=mx;
				num--;
			} 
			dp[j]=sum/num+1;
		}
		ans=min(dp[1],ans);
	}
	printf("%.6lf",ans);
	return 0;
} 

Measured memory_bytes: 1408
// Compiled with: g++ -Wall -std=c++14 -pthread

#include <bits/stdc++.h>

using namespace std;
const int N = 1e5+5;

int n;
int d[N];
int main(){
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> d[i];
    }
    sort(d, d+n);
    int ans = d[n/2]-d[n/2-1];
    cout << ans << endl;
    return 0;
}


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

using namespace std;

const int N = 123;

int n, a[N], number[N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  int dir = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    ++number[a[i]];
    dir = max(dir, a[i]);
  }
  auto no_solution = [&] () {
    cout << "Impossible" << '\n';
    exit(0);
  };
  if (!(dir & 1) && number[dir >> 1] != 1) {
    no_solution();
  } else if ((dir & 1) && number[dir + 1 >> 1] != 2) {
    no_solution();
  }
  for (int i = dir; i; --i) {
    if (i + i > dir && number[i] < 2) {
      no_solution();
    } else if (i + i < dir && number[i]) {
      no_solution();
    }
  }
  cout << "Possible" << '\n';
  return 0;
}

Measured memory_bytes: 256
if __name__ == "__main__":
    n = int(input())
    """studentNumbers = [(x, str(i)) for x, i in
        zip(input().split(), range(1, 1000000))]
    studentNumbers.sort(key=lambda tup: tup[0])
    print(' '.join([x[1] for x in studentNumbers]))"""
    studentNumbers = [int(x) for x in input().split()]
    times = [0 for i in range(n)]
    for i in range(n):
        times[studentNumbers[i] - 1] = str(i+1)
    print(' '.join(times))


Measured memory_bytes: 15016
def simple_knapsack(N: int, W: int, items: list) -> int:
    w0 = items[0][0]
    d = {w0+i: [] for i in range(4)}
    for w, v in items:
        d[w].append(v)

    s = {}
    for k, values in d.items():
        s[k] = [0] * (len(values)+1)
        for i, v in enumerate(sorted(values, key=lambda x: -x)):
            s[k][i + 1] = s[k][i] + v

    w0, w1, w2, w3 = w0, w0 + 1, w0 + 2, w0 + 3

    max_value = 0
    for i1 in range(len(s[w0])):
        if W < w0 * i1:
            break
        for i2 in range(len(s[w1])):
            if W < w0 * i1 + w1 * i2:
                break
            for i3 in range(len(s[w2])):
                if W < w0 * i1 + w1 * i2 + w2 * i3:
                    break
                for i4 in range(len(s[w3])):
                    if W < w0 * i1 + w1 * i2 + w2 * i3 + w3 * i4:
                        break
                    max_value = max(
                        max_value, s[w0][i1] + s[w1][i2] + s[w2][i3] + s[w3][i4])

    return max_value


if __name__ == "__main__":
    N = 0
    N, W = map(int, input().split())
    items = [tuple(map(int, input().split())) for _ in range(N)]
    ans = simple_knapsack(N, W, items)
    print(ans)


Measured memory_bytes: 3064
#include <iostream>


using namespace std;


int main(void)
{
        unsigned int x;

        cin >> x;

        unsigned int d1 = x / 100;
        unsigned int d2 = x % 100;

        if (
                105*d1 < x ||
                 x < 100
                ) {
                cout << '0' << endl;
                return 0;
        }


        cout << '1' << endl;
}

Measured memory_bytes: 256
#include <iostream>

bool include3(int x) {
	for (;x != 0; x /= 10) {
		if ( x % 10 == 3 ){
			return true;
		}
	}
	return false;
}

void call(int n){
	for (int i = 1; i <= n; ++i) {
		if ( i % 3 == 0 || include3(i) ){
			std::cout << " " << i;
		}
	}

	std::cout << std::endl;
}

int main(void) {
	int n;
	std::cin >> n;
	call(n);
	return 0;
}

Measured memory_bytes: 3104
{-# LANGUAGE BangPatterns #-}
import Control.Monad
import Data.Maybe
import Debug.Trace
import Data.List
import Data.Functor
-- import Data.Array
import Data.Array.Unboxed
import Control.Monad.ST
import Data.Array.ST

import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)
readInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine :: IO [Int]

main :: IO ()
main = do
  n <- readLn :: IO Int
  as <- readInts
  putStrLn . unwords . map show $ solve as

solve = countingSort (0, 10000)

countingSort :: (Int, Int) -> [Int] -> [Int]
countingSort (s,e) as = concatMap (\i -> replicate (carr ! i) i) [s..e]
  where
    carr :: UArray Int Int
    carr = runSTUArray $ do
      arr <- newArray (s,e) 0
      forM_ as (\a -> do
        val <- readArray arr a
        writeArray arr a (val + 1) 
        )
      return arr



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

int main(){
    long long N, T;
    vector<long long> t;
    long long temp = 0;
    cin >> N >> T;
    for(int i = 0; i < N; i++){
        cin >> temp;
        t.push_back(temp);
    }

    unsigned long long ans = 0;
    for(int i = 1; i < N; i++){
        if(t[i] - t[i - 1] <= T) ans += t[i] - t[i - 1];
        else ans += T;
    }
    cout << ans + T << endl;

    return 0;
}


Measured memory_bytes: 2420
#include <iostream>
#include <vector>
using namespace std;
#define endl '\n'

using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int input1,input2,i,temp;
    vector<int> x,y;
    vector<int>::iterator iter,iter2;
    cin >> input1 >> input2;
    for (i = 0; i < input2;i++){
        cin >> temp;
        x.push_back(temp);
    }

    for (iter = x.begin(); iter != x.end()-1;iter++){
        iter2 = iter + 1;
        y.push_back(*iter2 - *iter);
    }
    iter=x.end()-1;
    y.push_back(input1 - *iter + x[0]);

    int max = -1;
    for (auto k = y.begin(); k != y.end();k++){
        if((*k) > max){
            max = *k;
        }
    }
    cout << input1 - max;
    return 0;
}

Measured memory_bytes: 2548
#include<bits/stdc++.h>
using namespace std;
int main(){
  vector<int> a(3);
  for(int i = 0; i < 3; i++)
    cin >> a[i];
  sort(a.begin(),a.end());
  int cnt = 0;
  cnt += abs(a[1] - a[0]);
  cnt += abs(a[2] - a[1]);
  cout << cnt << endl;
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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 (a>b) { a=b; return 1; } return 0; }

#define ld long double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

//-------------------------------------------------

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x; cin>>x;
    int ans = 1;
    for(int i=2; i*i<=x; i++){
        int m=i*i;
        while(m<=x) m*=i;
        m/=i;
        chmax(ans,m);
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int q[3][101], n;
int f(int i, int j)
{
	if(i>2 || j>n) return 0;
	return max(f(i,j+1)+q[i][j], f(i+1,j)+q[i][j]);
}
int main()
{
	scanf("%d", &n);
	for(int i=1; i<=2; i++)
	for(int j=1; j<=n; j++)
	{
		scanf("%d", &q[i][j]);
	}
	printf("%d", f(1,1));
}

Measured memory_bytes: 256
Imports System.Collections.Generic

Module Module1

    Sub Main()

        Dim t As String = Console.ReadLine()
        Dim tmp As String() = Split(t, " ")
        Dim V As Integer = CInt(tmp(0))
        Dim E As Integer = CInt(tmp(1))
        Dim Map As New List(Of Grph)

        For i As Integer = 0 To E - 1
            Map.Add(New Grph(Console.ReadLine()))
        Next

        Dim Tmax As Integer = CInt(Console.ReadLine())
        Dim Odr As New List(Of Haccyu)

        For i As Integer = 0 To Tmax - 1

            Dim j As Integer = CInt(Console.ReadLine())
            For k As Integer = j To 1 Step -1
              Odr.Add(New Haccyu(i, j, k, Console.ReadLine()))
            Next
        Next

        For i As Integer = 0 To Tmax - 1
            Console.WriteLine(-1)
        Next

    End Sub

    Class Grph

        Private _StartPoint As Integer
        Private _EndPoint As Integer
        Private _Distance As Integer

        Sub New(inText As String)

            Dim tmp As String()

            tmp = Split(inText, " ")
            _StartPoint = CInt(tmp(0))
            _EndPoint = CInt(tmp(1))
            _Distance = CInt(tmp(2))

        End Sub

    End Class

    Class Haccyu
        Private _Timing As Integer
        Private _Hacyusu As Integer
        Private _Banme As Integer
        Private _OrderID As Integer
        Private _Cyoten As Integer

        Sub New(Timing As Integer, Hacyusu As Integer, Banme As Integer, Odr As String)

            Dim tmp As String()

            tmp = Split(Odr, " ")
            _Timing = Timing
            _Hacyusu = Hacyusu
            _OrderID = CInt(tmp(0))
            _Cyoten = CInt(tmp(1))

        End Sub
    End Class

End Module


Measured memory_bytes: 15712
#include<iostream>
#include<vector>
#include<stack>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;

int n;
vector<int> G[MAX];
int color[MAX];

void dfs(int r, int c){
  stack<int> S;
  S.push(r);
  color[r] = c;
  while( !S.empty()) {
   int u = S.top(); S.pop();
   for(int i = 0; i < G[u].size(); i++){
    int v = G[u][i];
   if(color[v] == NIL){
    color[v] = c;
    S.push(v);
    }
   }
  }
 }
  
void assignColor(){
  int id = 1;
  for ( int i = 0; i < n; i++) color[i] = NIL;
  for ( int u = 0; u < n; u++) {
    if ( color[u] == NIL) dfs(u,id++);
  }
 }
int main (){
  int s,t,q,m;

  cin >> n >> m;

  for(int i = 0;i < m;i++){
  cin >> s >> t;
  G[s].push_back(t);
  G[t].push_back(s);
  }

 assignColor();

 cin >> q;

  for(int i = 0; i < q; i++){
   cin >> s >> t;
    if(color[s] == color[t]){
   cout << "yes" << endl;
  }else{
   cout << "no" << endl;
  }
 }
  return 0;
}

  

Measured memory_bytes: 8928
package main

import "fmt"

func max(a ...int) int {
	m := a[0]
	for i, v := range a {
		if i == 0 {
			continue
		}
		if m < v {
			m = v
		}
	}
	return m
}
func main() {
	// Code for B - Product Max
	var a, b, c, d int
	fmt.Scan(&a, &b, &c, &d)

	fmt.Println(max(a*c, a*d, b*c, b*d))
}


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

using namespace std;

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_A&lang=jp
// 挿入ソート
void printArray(vector<int> vector, bool isLast) {
    int size = vector.size();
    for (int i = 0; i < size; ++i) {
        if (i == size - 1) {
            cout << vector[i] << endl;
        } else {
            cout << vector[i] << " ";
        }
    }

//    cout << endl;
}

int main() {
    int N;
    cin >> N;
    vector<int> A(N);

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

    printArray(A, false);

    for (int i = 1; i < N; ++i) {
        int v = A[i];
        int j = i - 1;

        while (j >= 0 && A[j] > v) {
            A[j+1] = A[j];
            j--;
        }
        A[j+1] = v;

        bool islast = (i == N - 1);
        printArray(A, islast);
    }

//    cout << "5 2 4 6 1 3" << endl;
//    cout << "2 5 4 6 1 3" << endl;
//    cout << "2 4 5 6 1 3" << endl;
//    cout << "2 4 5 6 1 3" << endl;
//    cout << "1 2 4 5 6 3" << endl;
//    cout << "1 2 3 4 5 6" << endl;



    return 0;
}




Measured memory_bytes: 3164
import math


def isprime(x):
    if x == 2:
        return True

    elif x % 2 == 0:
        return False

    i = 3
    while i <= math.sqrt(x):
        if x % i == 0:
            return False
        i += 2
    return True

    # 3から始まる
    # 偶数は2以外は判定に用いないので一つずつ飛ばすために3,5,7と
    # i += 2となる。


n, cnt = int(input()), 0
num = [int(input()) for i in range(n)]
for i in num:
    if isprime(i) == True:
        cnt += 1
print(cnt)



Measured memory_bytes: 6008
a,b,c,d,e,f = (int(i) for i in input().split())
sa = sab = sabc = sabcd = sc = scd = sugar = dens = 0
water = a*100
for i in range(31):
  sa = a*i*100
  if sa > f:
    break
  for j in range(16):
    sab = b*j*100 + sa
    if sab > f or sab == 0:
      break
    for k in range(1501):
      sc = c*k
      sabc = sc + sab
      if sabc > f or sc > e * sab / 100:
        break
      for l in range(1501):
        scd = sc + d*l
        sabcd = d*l + sabc
        if sabcd > f or scd > e * sab / 100:
          break
        if dens < scd / sabcd:
          dens = scd / sabcd
          water = sabcd
          sugar = scd
print(str(water) + ' ' + str(sugar))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;

int main() {
  int n, m;
  cin >> n >> m;
  int mini = 1;
  int maxi = n;
  rep(i, n) {
    int l, r;
    cin >> l >> r;
    mini = max(mini, l);
    maxi = min(maxi, r);
  }
  if (maxi - mini < 0) {
    cout << 0 << endl;
    return 0;
  }
  cout << maxi - mini + 1 << endl;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define range(i, l, r) for(long long int (i) = (l); (i) < (r); (i)++)
#define reversed_range(i, l, r) for (long long int (i) = (r) - 1; (i) >= l; (i)--)
using namespace std;
template <typename T>
using vec = vector<T>;
using lint = long long;
using ulint = unsigned long long;
using pint = pair<int, int>;
using plint = pair<lint, lint>;

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

template <typename T>
ostream& operator <<(ostream& os, vec<T> v) {
    os << "[";
    if (v.size() == 0) return os << "]";
    for (int i = 0; i < v.size() - 1; i++) {
        os << v.at(i) << ", ";
    }
    return os << v.at(v.size() - 1) << "]";
}

template <typename T>
ostream& operator <<(ostream& os, set<T>& s) {
    os << "{";
    if (s.begin() == s.end()) return os << "}";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename T>
ostream& operator <<(ostream& os, unordered_set<T>& s) {
    os << "{";
    if (s.begin() == s.end()) return os << "}";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, map<K, V> m) {
    os << "{";
    if (m.begin() == m.end()) return os << "}";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, unordered_map<K, V> m) {
    os << "{";
    if (m.begin() == m.end()) return os << "}";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

lint pow(lint num, lint e, lint MOD) {
    lint res = 1;
    lint cur_num = num;
    while (e) {
        if (e & 1) {
            res *= cur_num;
            res %= MOD;
        }
        cur_num *= cur_num;
        cur_num %= MOD;
        e >>= 1;
    }
    return res;
}

int main() {
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    lint N; cin >> N;
    unordered_map<lint, lint> count;
    range(i, 0, N) {
        lint num; cin >> num;
        count[num] += 1;
    }
    lint ans = 0;
    for (const auto& p : count) {
        lint num, c;
        tie(num, c) = p;
        ans += (c < num ? c : c - num);
    }
    cout << ans << "\n";
}

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

int main() {
  long long x, sum;
  int cnt = 0;
  cin >> x;
  sum = 100;
  while(sum < x){
    sum += (sum / 100);
    cnt++;
  }
  cout << cnt << endl;
}
  
  

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

typedef long long int ll;
#define rep(i,n) for (int i = 0; i < (n); i++)

const ll mod = 1000000007;

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

ll lcm(ll a, ll b) {
    return (a / gcd(a, b)) * b;
}

ll solve(ll x, ll c, ll d) {
    return x - (x/c + x/d - x/lcm(c,d));
}


int main() {
    ll a,b,c,d;
    cin >> a >> b >> c >> d;
    cout << solve(b,c,d) - solve(a-1,c,d) << endl;
    return 0;
}




Measured memory_bytes: 3632
/*
atcoder regular contest 100
解答

配列から最大値と最小値を抜き出す
*/

import java.util.*;
public class Main{

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

        int n = sc.nextInt();
        int max = sc.nextInt();
        int min = max;

        for(int i = 0;i < n-1;i++){//ループを回して最大値最小値を取得してしまう
          int temp = sc.nextInt();
          max = Math.max(max,temp);
          min = Math.min(min,temp);
        }


        System.out.println(max-min);
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int mod = 1e9 + 7;
struct mint
{
    ll x; // typedef long long ll;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint &operator+=(const mint a)
    {
        if ((x += a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint &operator-=(const mint a)
    {
        if ((x += mod - a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint &operator*=(const mint a)
    {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= a; }
    mint pow(ll t) const
    {
        if (!t)
            return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1)
            a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod - 2); }
    mint &operator/=(const mint a) { return *this *= a.inv(); }
    mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream &operator>>(istream &is, mint &a) { return is >> a.x; }
ostream &operator<<(ostream &os, const mint &a) { return os << a.x; }

int main()
{
    int n;
    cin >> n;
    mint ans = 0, sum = 0;
    vector<int> A(n);
    rep(i, n) {
        cin >> A[i];
        sum += A[i];
    }
    rep(i, n) {
        sum -= A[i];
        ans += sum * A[i];
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4036
#include <iostream>
#include<sstream>
#include<vector>
#include<iterator>
using namespace std;

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

	string str = to_string(N);
	int n = 0;
	for(auto it=str.begin(); it!=str.end(); it++)
		n += *it - '0';

	string ret = "No";
	if(N%n == 0)
		ret = "Yes";

	cout << ret << endl;

	return 0;
}


Measured memory_bytes: 256
s = input()
t = input()

s_dict = {}
from bisect import insort_right, bisect_right
for i, c in enumerate(s):
    if c in s_dict:
        insort_right(s_dict[c], i)
    else:
        s_dict[c] = [i]
#print(s_dict)

def find_gt(a, x):
    'Find leftmost value greater than x'
    i = bisect_right(a, x)
    if i != len(a):
        return a[i]
    raise ValueError

idx = -1
cnt = 1
bad = False
for c in t:
    if not c in s_dict:
        bad = True
        break
    try:
        idx = find_gt(s_dict[c], idx)
    except:
        idx = -1
        idx = find_gt(s_dict[c], idx)
        cnt += 1

#print(idx)
#print(cnt)
if bad:
    print(-1)
else:
    ans = len(s) * (cnt-1) + (idx+1)
    print(ans)

Measured memory_bytes: 49116
def A(n,m,k):
    if k >= abs(n - m):
        return True
    else:
        return False

lst = list(map(int,list([input() for i in range(6)])))
k = lst[-1]
r = [A(i,j,k) for j in lst[:5] for i in lst[:5]]
if False not in r:
    print("Yay!")
else:
    print(":(")

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

int boxes[3];
int a, b;

int main() {
	std::cin >> boxes[0] >> boxes[1] >> boxes[2];
	if (boxes[0] >= 1 && boxes[0] <= 100 && boxes[1] >= 1 && boxes[1] <= 100 && boxes[2] >= 1 && boxes[2] <= 100) {
		a = boxes[0];
		b = boxes[1];
		boxes[0] = b;
		boxes[1] = a;
		a = boxes[0];
		b = boxes[2];
		boxes[0] = b;
		boxes[2] = a;

		std::cout << boxes[0] << " " << boxes[1] << " " << boxes[2] << std::endl;
	}
}

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

int main()
{
    int N, M;
    cin >> N >> M;

    vector<int> A(M);
    rep(i,M) cin >> A[i];

    ll sum = accumulate(A.begin(), A.end(), 0);
    cout << ((N >= sum) ? N - sum : -1) << endl;
}


Measured memory_bytes: 3660
#include <cassert>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
typedef long long ll;


int main(void) {
  string a, b, c;
  int x, y;
  cin >> a >> b >> x >> y >> c;
  if(a == c) {
    cout << x-1 << " " << y << endl;
  } else {
    cout << x << " " << y-1 << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>
#include <stack>

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> void printvec(const vector<T>& v) {
  for (auto x : v) { cout << x << " "; }
  cout << endl;
}
template<class T> void printtree(const vector< vector<T> >& tree) {
  for (long long i = 0; i < tree.size(); ++i) {
    cout << i + 1 << ": "; printvec(tree[i]);
  }
}
template<class T, class U> void printmap(const map<T, U>& mp) {
  for (auto x : mp) { cout << x.first << "=>" << x.second << endl; }
}

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

#define rep(i, n) for(ll i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()
#define sz(x) (ll)(x).size()
#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;
typedef vector<ll> vl;
typedef vector<P> vp;

const ll INF = 1e9;
const ll MOD = 1000000007;  // 1e9 + 7

vector<ll> c;
vector<ll> d;
vector<vector<ll>> g;
int k;

void dfs(int v, int p=-1) {
  d[v] = c[k++];
  for (ll u : g[v]) {
    if (u == p) { continue; }
    dfs(u,v);
  }
}

int main(int argc, char** argv) {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  //cout << setprecision(10) << fixed;

  ll n;
  cin >> n;
  c.resize(n);
  d.resize(n);
  g.resize(n);

  rep(i,n-1) {
    ll a,b;
    cin >> a >> b;
    --a; --b;
    g[a].push_back(b);
    g[b].push_back(a);
  }

  rep(i,n) {
    cin >> c[i];
  }
  sort(all(c));
  reverse(all(c));

  // printvec(c);

  dfs(0);

  ll m = 0;
  for (int i = 1; i < n; ++i) {
    m += c[i];
  }
  cout << m << endl;
  rep(i,n) {
    cout << d[i];
    if (i < n-1) {
      cout << " ";
    }
  }
  cout << endl;
}


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


using namespace std;
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define reps(i,n) for (int i = 1; i <= (int)(n); ++i)
#define repd(i,n) for (int i = (int)(n - 1); i >= 0; --i)
#define repds(i,n) for (int i = (int)(n); i > 0; --i)
#define loop(i,x,n) for (int i = (int)(x); i < (n); ++i)
#define loops(i,x,n) for (int i = (int)(x); i <= (n); ++i)
#define loopd(i,x,n) for (int i = (int)(x); i > (n); --i)
#define loopds(i,x,n) for (int i = (int)(x); i >= (n); --i)
#define itrep(i,s) for (auto i = begin(s); i != end(s); ++i)
#define itrepd(i,s) for (auto i = --end(s); i != begin(s); --i)
#define all(f,x,...) [&](decltype(x)& whole) { return (f)(begin(whole), end(whole), ##__VA_ARGS__); }(x)
#define rall(f,x,...) [&](decltype(x)& whole) { return (f)(rbegin(whole), rend(whole), ##__VA_ARGS__); }(x)
using ll = long long;
using ld = long double;
constexpr ll inf = static_cast<ll>(1e17);
constexpr int iinf = static_cast<int>(1e9);
constexpr double dinf = 1e10;
constexpr ld ldinf = 1e17;
ll mod = static_cast<ll>(1e9 + 7);
std::ostream& endn(std::ostream& os) { return os.put(os.widen('\n')); }
template<class T> constexpr int sz(const T& a) { return (int)a.size(); }
template<class T> constexpr T pow2(const T a) { return a * a; }
template<class T, class ... Args> constexpr T mins(T& a, Args... args) { return a = min<T>({ a, args... }); }
template<class T, class... Args> constexpr T maxs(T& a, Args... args) { return a = max<T>({ a,args... }); }

ll t1, t2, a1, a2, b1, b2;
void solve() {
    cin >> t1 >> t2 >> a1 >> b1 >> a2 >> b2;
    a1 *= t1; a2 *= t1; b1 *= t2; b2 *= t2;
    if (a1 + b1 == a2 + b2) { cout << "infinity" << endn; return; }
    if (a1 + b1 < a2 + b2) { swap(a1, a2); swap(b1, b2); }
    if (a1 > a2) { cout << 0 << endn; return; }

    ll dist2 = a2 - a1;
    ll dist = a1 + b1 - (a2 + b2);
    ll ans = dist2 / dist * 2;
    if (dist2 % dist != 0) ++ans;
    cout << ans << endn;

}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    cout << flush;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//#define cerr if (false) cerr
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define dbv(v) cerr << #v << "="; for (auto _x : v) cerr << _x << ", "; cerr << endl
#define dba(a, n) cerr << #a << "="; for (int _i = 0; _i < (n); ++_i) cerr << a[_i] << ", "; cerr << endl
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& x) {
	return os << "(" << x.first << "," << x.second << ")";
}
typedef long long ll;
typedef long double ld;
const int MOD = 1000000007;
struct Mint {
	int val;
	Mint() { val = 0; }
	Mint(const ll& x) {
		val = (-MOD <= x && x < MOD) ? x : x % MOD;
		if (val < 0) val += MOD;
	}
	friend bool operator==(const Mint& a, const Mint& b) { return a.val == b.val; }
	friend bool operator!=(const Mint& a, const Mint& b) { return !(a == b); }
	friend bool operator<(const Mint& a, const Mint& b) { return a.val < b.val; }
	Mint& operator+=(const Mint& m) { if ((val += m.val) >= MOD) val -= MOD; return *this; }
	Mint& operator-=(const Mint& m) { if ((val -= m.val) < 0) val += MOD; return *this; }
	Mint& operator*=(const Mint& m) { val = (ll)val * m.val % MOD; return *this; }
	friend Mint modex(Mint a, ll p) {
		assert(p >= 0);
		Mint ans = 1;
		for (; p; p >>= 1, a *= a) if (p & 1) ans *= a;
		return ans;
	}
	Mint& operator/=(const Mint& m) { return *this *= modex(m, MOD - 2); }
	Mint& operator++() { return *this += 1; }
	Mint& operator--() { return *this -= 1; }
	Mint operator++(int) { Mint result(*this); *this += 1; return result; }
	Mint operator--(int) { Mint result(*this); *this -= 1; return result; }
	Mint operator-() const { return Mint(-val); }
	friend Mint operator+(Mint a, const Mint& b) { return a += b; }
	friend Mint operator-(Mint a, const Mint& b) { return a -= b; }
	friend Mint operator*(Mint a, const Mint& b) { return a *= b; }
	friend Mint operator/(Mint a, const Mint& b) { return a /= b; }
	friend ostream& operator<<(ostream& os, const Mint& x) { return os << x.val; }
};
Mint dp[2005][2005];
const int MAXN = 4000005;
Mint fac[MAXN], invfac[MAXN];
Mint binom(ll a, ll b) {
	if (b < 0) return 0;
	if (b > a) return 0;
	return fac[a] * invfac[b] * invfac[a - b];
}
int main() {
	fac[0] = 1;
	for (int i = 1; i < MAXN; ++i)
		fac[i] = fac[i - 1] * i;
	invfac[MAXN - 1] = 1 / fac[MAXN - 1];
	for (int i = MAXN - 2; i >= 0; --i)
		invfac[i] = invfac[i + 1] * (i + 1);
	int n, k;
	scanf("%d%d", &n, &k);
	if (k == 1) {
		printf("1\n");
		return 0;
	}
	dp[0][0] = 1;
	for (int i = 0; i <= n; ++i)
		for (int j = i; j <= n; ++j) {
			if (!i && !j) continue;
			if (i) dp[i][j] = dp[i - 1][j];
			if (j > i) {
				dp[i][j] += dp[i][j - 1] * binom(i + j * (k - 1) - 1, k - 2);
			}
		}
	printf("%d\n", (dp[n][n] * fac[n]).val);
}


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

int main(){
    int n;
    long double ans = 0;
    cin >> n;
    vector<pair<string, long double>> data(n);
    for (int i = 0; i < n; i++){
        cin >> data.at(i).second >> data.at(i).first;
    }
    for (int i = 0; i < n; i++){
        if(data.at(i).first == "JPY"){
            ans += data.at(i).second;
        }else{
            ans += data.at(i).second * 380000.0;
        }
    }
    cout << fixed << setprecision(100) << ans << endl;
}

Measured memory_bytes: 3752
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    String[] s = new String[n];
    for(int i = 0; i < n; i++) {
      s[i] = sc.next();
    }
    Arrays.sort(s);
    String ans = "";
    for(int i = 0; i < n; i++) {
      ans += s[i];
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 24404
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;

int main(void) {
	int num, i, j, k, ok;
	ll ans = 0, sum = 0;
	cin >> num;
	vector<vector<int>> d(num, vector<int>(num, 0));
	for (i = 0; i < num; i++) {
		for (j = 0; j < num; j++) {
			scanf("%d", &d[i][j]);
			ans += d[i][j];
		}
	}
	for (k = 0; k < num; k++) {
		for (i = 0; i < num; i++) {
			ok = false;
			for (j = 0; j < num; j++) {
				if (d[i][j] > d[i][k] + d[k][j]) {
					printf("-1\n");
					return 0;
				}
				if (d[k][i] == d[k][j] + d[j][i] && i != j && j != k) {
					ok = true;
				}
			}
			if (ok)
				sum += d[k][i];
		}
	}
	ans -= sum;
	ans >>= 1;
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 768
#include <stdio.h>

int main(void){
  int r, D, x[10];
  int a;
  int i;
  
  scanf("%d %d %d\n",&r, &D, &a);
  x[0]=a;
 
  for(i=0;i<10; i++){
    x[i+1]=r*x[i]-D;
    printf("%d\n", x[i+1]);
  }
  
  return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

class Main
{
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();
    if(a<b) System.out.println("a < b");
    else if(a>b) System.out.println("a > b");
    else System.out.println("a == b");
  }
}

Measured memory_bytes: 26360
#include <iostream>
using namespace std;
using ull = unsigned long long;

int main(){
    ull N;
    cin >> N;

    ull T[N], A[N];
    for(int i = 0; i < N; ++i){
        cin >> T[i] >> A[i];
    }

    ull t = 1, a = 1;
    for(int i = 0; i < N; ++i){
        ull temp = max(t / T[i] + (t % T[i] != 0) , a / A[i] + (a % A[i] != 0));
        t = T[i] * temp;
        a = A[i] * temp;
    }

    cout << t + a << endl;

    return 0;
}


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

#define rep(i, n) for(int i=0; i < n; i++)
#define reps(i, n) for(int i=1; i <= n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define rALL(x) x.rbegin(),x.rend()

using namespace std;
using ll=long long;



int main(){
  int n;cin>>n;
  vector<int> a(n);
  map<int,int> mp;
  rep(i,n){
    cin>>a[i];
    mp[a[i]]++;
  }
  ll sum=0;
  for(auto x:a)sum+=x;
  int q;cin>>q;
  rep(i,q){
    int b,c;cin>>b>>c;
    sum=sum+(c-b)*mp[b];
    cout<<sum<<endl;
    mp[c]+=mp[b];
    mp[b]=0;
  }
}

Measured memory_bytes: 8032
#include <bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <cstdlib>
#include <string>
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define f first
#define s second
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define eb emplace_back
#define in insert
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define FOR(i, n, x) for(int i = x; i < n; i++)
#define OUT(a, e) FOR(i, e, 0) cout << a[i] << ' '
#define OUTV(a) for(auto e : a) cout << e << ' ';
#define maxim(a, n, mx) FOR(i, n, x)mx = max(mx, a[i]);
using namespace std;
int INF = 1e9 + 7;

int main()
{
    int n; cin >> n;
    int a[n];
    int cnt = 1;
    FOR(i, n, 0)cin >> a[i];
    FOR(i, n, 0)
    {
        if(a[i] == cnt)cnt++;
    }
    if(cnt == 1)cout << -1;
    else cout << n - cnt + 1;
    return 0;
}


Measured memory_bytes: 1024
using System;


namespace FibonacciSample
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str0 = Console.ReadLine().Split(' ');
            long n = int.Parse(str0[0]);
            long m = int.Parse(str0[1]);
            long[] s = new long[m + 1];
             long[] f = new long[n + 1];
            if (n == 1)
            {
                Console.WriteLine(1);
            }
            else if (m != 0)
            {
                for (int i = 0; i < m; i++)
                {
                    s[i] = long.Parse(Console.ReadLine());
                }
                s[m] = 0;

                int j = 0;
                if (s[0] == 1 && s[1] != 2)
                {
                    f[1] = 0;
                    f[2] = 1;
                    j++;
                }
                else if (s[0] == 2)
                {
                    f[1] = 1;
                    f[2] = 0;
                    j++;
                }
                else if (s[0] == 1 && s[1] == 2)
                {
                    f[n] = 0;
                    j += 2;
                }
                else
                {
                    f[2] = 2;
                    f[1] = 1;
                }

                for (int i = 3; i <= n; i++)
                {
                    if (i != s[j])
                    {
                        f[i] = (f[i - 1] + f[i - 2]) % 1000000007;
                    }
                    else
                    {
                        f[i] = 0;
                        j++;
                    }
                }
                Console.WriteLine(f[n]);
            }
            else
            {
                f[2] = 2;
                f[1] = 1;
                for (int i = 3; i <= n; i++)
                {
                    f[i] = (f[i - 1] + f[i - 2]) % 1000000007;
                }
                Console.WriteLine(f[n]);

            }
        }
    }
}

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

#define ff first
#define ss second
#define mp make_pair

using namespace std;

typedef long long ll;

int main(){
	ll n;

	scanf("%lld", &n);

	if(n&1) {
		printf("0\n");
		return 0;
	}

	ll ans = 0;
	ll cur = 2;

	while(cur <= n/5) {
		cur *= 5;
		ans += n/cur;
	}

	printf("%lld\n", ans);

	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include<cstdio>
#include <vector>
#include<queue>
#include<limits.h>
#include<string.h>
#include<functional>
using namespace std;

signed main() {
	int a, b, c; cin >> a >> b >> c;
	int d = 0;
	for (; a <= b; a++) {
		if (c%a == 0)d++;
	}
	cout << d << endl;
}

Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using llpair=pair<ll,ll>;
using llvec=vector<ll>;
using llmat=vector<vector<ll>>;
#define llmattp(name,a,b,num) name(a,vector<ll>(b,num))
#define LLINF 1LL<<60
#define ABS(x) ( (x)>0 ? (x) : -(x) )

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

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

ll gcd(ll a, ll b) {
	if(a==0||b==0) return 0;
	if(a<b) swap(a,b);
	ll tmp = a%b;
	while(tmp!=0) {
		a = b;
		b = tmp;
		tmp = a%b;
	}
	return b;
}

ll factorial(ll x) {
	ll f=1;
	for(ll i=2; i<x; i++) {
		f*=i;
	}
	return f;
}

ll nPr(ll n, ll r) {
	ll result=1;
	for(ll i=r+1; i<=n; i++) result*=i;
	return result;
}

ll nCr(ll n, ll r) {

	if (n == 0) { return 0; }
	if (r == 0) { return 1; }
	if (r == 1) { return n; }
	if (n == r) { return 1; }

	if (r > n / 2) { r = n / 2; }

	double result = 1;
	for (double i = 1; i <= r; i++) {
		result *= (n - i + 1) / i;
	}

	return (ll)result;
}

bool IsPrime(ll num) {
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

	double sqrtNum = sqrt(num);
	for (ll i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			// 素数ではない
			return false;
		}
	}

	// 素数である
	return true;
}

ll GreaterBinarySearch(ll *array, ll key, ll max, ll min) {
	if(array[max]<array[min]) {
		return NULL;
	} else {
		ll mid = max + (min-max)/2;
		if(array[mid]<key) {
			return GreaterBinarySearch(array,key,max,mid-1);
		} if(array[mid]>key) {
			return GreaterBinarySearch(array,key,mid+1,min);
		} else {
			return mid;
		}
	}
}

string n;
int K;
bool flag;

ll dp[101][2][101]; // digit kakutei-flag !0num

int main() {
	for(int i=0; i<101; i++)
		for(int j=0; j<2; j++)
			for(int k=0; k<101; k++)
				dp[i][j][k]=0LL;
	dp[0][0][0]=1LL;
	cin>>n>>K;

	for(int i=0; i<n.length(); i++) {
		int D=n.at(i)-'0';
		for(int j=0; j<2; j++)
			for(int k=0; k<=i; k++) {
				for(int d=0; d<=(j?9:D); d++) {
					if(d!=0) dp[i+1][j||(d!=D)][k+1] += dp[i][j][k];
					else     dp[i+1][j||(d!=D)][k] += dp[i][j][k];
				}
			}
	}
	cout<<dp[n.length()][0][K]+dp[n.length()][1][K]<<endl;
}


Measured memory_bytes: 384