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

int main(){
    int N,K;
    string str;
    int array[4];
    int numA,numB;
 
     cin >> str;

     for(int i=0;i<4;i++){
         array[i]=(int)(str[i]-'0');
     }
     numA = array[0]*10+array[1];
     numB = array[2]*10+array[3];

     if(1<=numA&&numA<=12){
        if(1<=numB&&numB<=12)
            cout << "AMBIGUOUS" << endl;
        else
            cout << "MMYY" << endl;
     }
     else{
         if(1<=numB&&numB<=12)
            cout << "YYMM" << endl;
        else
            cout << "NA" << endl;        
     }

    return 0;
}

Measured memory_bytes: 256
import Foundation

extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
}

func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

let ab = readIntSplit(by: " ")
var (a, b, ans) = (ab[0], ab[1], 0)
if 5 < a && a <= 12 {
    ans = b/2
} else if 12 < a {
    ans = b
}
print(ans)


Measured memory_bytes: 6888
N = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(N - 1):
    if p[i] == i + 1:
        p[i], p[i + 1] = p[i + 1], p[i]
        ans += 1
if p[-1] == N:
    ans += 1
print(ans)


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

using namespace std;

#define F first
#define S second
#define modulo ll (1e9 + 7)
const long double PI = 3.141592653589793238L;

typedef long long ll;
typedef pair<int,int> pii;

void init(){
    cin.tie(0);
    cin.sync_with_stdio(0);
//    freopen("in.in", "r", stdin);
//    freopen("out.out", "w", stdout);
}

const int N = 2e5 + 9, M = 2e5 + 9, OO = 0x3f3f3f3f;
const ll llOO = 0x3f3f3f3f3f3f3f3f;

int a[N];

int main(){
    init();

    int n;  cin >> n;
    for(int i = 1;i <= n;i++){
        cin >> a[i];
    }


    map<int, int> mp;

    ll ans = 0;
    for(int i = 1;i <= n;i++){
        ans += mp[i - a[i]];
        mp[a[i] + i]++;
    }

    cout << ans;
}

Measured memory_bytes: 21356
#include <bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
char s1[maxn],s2[maxn];
string temp1,temp2;
int l,r,tim;
int flag=0;
void com(){
	temp1="";temp2="";
	l++;r++;
	while(s1[l]!='"'){
		temp1+=s1[l];
		l++;
	}
	l++;
	while(s2[r]!='"'){
		temp2+=s2[r];
		r++;
	}
	r++;
	if(temp1!=temp2){
		tim++;
	}
	return;
}

int main(){
	//freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
	while(scanf("%s%s",s1,s2)==2){
		int len1=strlen(s1),len2=strlen(s2);
		l=0,r=0;tim=0;
		while(l<len1&&r<len2){
			if(s1[l]=='"'&&s2[r]=='"'){
				com();
				if(tim>1){
					printf("DIFFERENT\n");
					l=len1+1;r=len2+1;
					break;
				}
			}else{
				if(s1[l]==s2[r]){
					l++;r++;
				}else{
					printf("DIFFERENT\n");
					l=len1+1;r=len2+1;
					break;
				}
			}
		}
		if(l<len1||r<len2){
			printf("DIFFERENT\n");
			continue;
		}
		if(l==len1&&r==len2){
			if(tim==1)
				printf("CLOSE\n");
			else
				printf("IDENTICAL\n");	
		}
	}
}


Measured memory_bytes: 3192
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>     
#include <numeric>
#include <utility>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <limits>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;++a) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define print_double(val,a) cout << fixed << setprecision(a) << val << endl;
ll mod = 1e9 + 7;
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int x;
	cin >> x;
	if (x == 1) { cout << 1 << endl; return 0; }
	int Max = -1;
	for (int i = 2; i <= x; i++) {
		for (int j = 2; (int)pow(i, j) <= x; j++) {
			int u = (int)pow(i,j);
			Max = max(Max,u);
		}
	}
	cout << Max << endl;
	return 0;
}

Measured memory_bytes: 640
#木の根を求める
def find(x):
    if par[x] == x:
        return x
    else:
        return find(par[x])

#xとyの属する集合の併合
def unite(x,y):
    x = find(x)
    y = find(y)
    
    if x != y:
        #xとyの属している集合が異なる時
        if rank[x] < rank[y]:
            par[x] = y
            size[y] += size[x]
        else:
            par[y] = x
            size[x] += size[y]
            if rank[x]==rank[y]:
                rank[x] += 1

#xとyが同じ集合に属するかの判定
def same(x,y):
    return find(x) == find(y)

########################################
n = int(input())
a = list(map(int,input().split()))

par = [0]*n #親
for i in range(n):
    par[i] = i
rank = [1]*n #深さ
size = [1]*n #size[i]:iを根とするグループのサイズ

b = [0]*(n+1) #b[i]:iがaにおいて何番目か
for i in range(n):
    b[a[i]]=i

ans = 0
for i in range(n,0,-1):
    k = b[i]
    left = 0
    right = 0
    if k-1>=0 and a[k-1]>a[k]:
        left =  size[find(k-1)]
        unite(k-1,k)
    if k+1<=n-1 and a[k+1]>a[k]:
        right = size[find(k+1)]
        unite(k+1,k)
    ans += (left+1)*(right+1)*a[k]

print(ans)
    

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

int main(){
    int n,k;
    cin >> n >> k;
    int h[n+k+1];
    for(int i=0;i<n;i++) cin >> h[i];
    int dp[n+k+1];
    for(int i=0;i<n;i++) dp[i]=1e9;
    dp[0]=0;
    for(int i=0;i<n;i++){
        for(int j=1;j<=k;j++){
            dp[i+j]=min(dp[i+j],dp[i]+abs(h[i+j]-h[i]));
        }
    }
    cout << dp[n-1] << endl;
}

Measured memory_bytes: 1024
// Created by  Ambesh kumar
#include "bits/stdc++.h"

#define  ll  long long  
# define  loop(x,n)  for(int x = 0; x < n; ++x)  
#define   constloop(x,a,n) for(int x = a; x < n; ++x)  
#define  revloop(x,a,n)  for(int x = a; x > n; x--) 

using namespace std;

int main()
{

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif


    ios::sync_with_stdio(0);
    cin.tie(0);

   string s;
cin>>s;

   if(s=="ABC")
   	cout<<"ARC"<<"\n";
else
	cout<<"ABC"<<"\n";
    


    return 0;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define int ll
#define endl "\n"
#define all( x ) x.begin(), x.end()
#define fast ios::sync_with_stdio(0);cin.tie(0);

typedef unsigned long long ull;

const int inf = 1e18;
const long double PI = 3.141592653589793;

void solve(){
  int n, ans = 0;
  cin >> n;
  vector<int> a(n);
  for(int i = 0;i<n;i++){
    cin >> a[i];
    a[i]-=(i+1);
  }
  nth_element(a.begin(), a.begin() + a.size() / 2, a.end());
  int x = a[a.size() / 2];
  for(int i:a){
    ans += abs(i - x);
  }
  cout << ans <<endl;
  return;
}  
signed main(){
  fast;
  int t;
  t = 1;
  //cin>>t;
  while(t--){
    solve();
  }
}



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

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


#define rep(i,n) for(ll (i)=0; (i)<(ll)(n); (i)++)
#define frep(i,m,n) for(ll (i)=(m); (i)<=(ll)(n); (i)++)
#define rrep(i,n) for(ll (i)=(n)-1; (i)>-1; (i)--)
#define frrep(i,m,n) for(ll (i)=(n); (i)>(ll)(m); (i)--)
#define ALL(x) (x).begin(), (x).end()

const ll INF = 100100100100100100;
const ll MOD = 1000000007;

// get abs
ll my_abs(ll a);
// a^n
ll a_n(ll a, ll n);
// get gcd
ll my_gcd(ll a, ll b);
// a^(-1) % MOD 
ll inv(ll a);

int main() {
    ll a, b;
    cin >> a >> b;
    if((b%a)==0) cout << a+b << endl;
    else cout << b-a << endl;
    return 0;
}

ll my_abs(ll a) {
    if(a >= 0) return a;
    else return -1 *a;
}

ll a_n(ll a, ll n) { 
    if(n == 0) return 1;
    
    ll ret = a, count = 1;
    while(count * 2 < n) {
        ret *= ret;
        count *= 2;
    }
    if(count == n) return ret;
    else return (ret * a_n(a, n-count));
}

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

ll inv(ll a) {
    return a_n(a, MOD-2);
}



Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(void)
{
    while (true) {
        u_int n, x;
        cin >> n >> x;
        if (!n && !x)
            break;

        u_int count = 0;
        for (u_int a = 1; a <= n; a++)
            for (u_int b = a + 1; b <= n && a + b <= x; b++)
                for (u_int c = b + 1; c <= n && a + b + c <= x; c++)
                    if (a + b + c == x)
                        count++;

        cout << count << endl;
    }

    return 0;
}

Measured memory_bytes: 1152
_ = gets.to_i
a = gets.chomp.split(' ').map(&:to_i).map{ |i| i - 1 }
b = gets.chomp.split(' ').map(&:to_i)
c = gets.chomp.split(' ').map(&:to_i)
prev = -2
result = 0
a.each do |i|
  result += b[i]
  result += c[prev] if prev + 1 == i
  prev = i
end
puts result

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

int main() {
  int n, m;
  long b, c, temp = 9999999999, ans = 0;
  vector<pair<long, long>> p;

  cin >> n >> m;

  vector<long> a(n);

  for (int i = 0; i < n; i++) {
    cin >> a[i];
    temp = min(temp, a[i]);
  }

  for (int i = 0; i < m; i++) {
    cin >> b >> c;
    p.push_back(make_pair(c, b));
  }

  sort(p.begin(), p.end());
  sort(a.begin(), a.end());

  long soe = 0;
  m--;

  while (p[m].first >= a[soe] && m >= 0) {
    while (p[m].first > a[soe] && p[m].second > 0) {
      a[soe] = p[m].first;
      p[m].second--;
      soe++;
    }
    m--;
  }

  for (int i = 0; i < a.size(); i++) {
    ans += a[i];
  }

  cout << ans;

  return 0;
}

Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i = 0; i < (ll)(n); i++)
#define repi(i,a,b) for(ll i = (ll)(a); i < (ll)(b); i++)
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; }
const ll INF = 1LL << 60;
int main(){
    int N; cin >> N;
    vector<int> a(N);
    rep(i,N){cin >> a[i];}

    rep(i,N){
        if(a[i] % 2 != 0) continue;
        if(a[i] % 3 != 0 && a[i] % 5 != 0){
            cout << "DENIED" << endl;
            return 0;
        }
    }
    cout << "APPROVED" << endl;
    return 0;
}

Measured memory_bytes: 256
#include "stdio.h"

int main(){
	int n, b, f, r, v, a[4][3][10]={}, i;
	scanf("%d", &n);
	for(i=0;i<n;i++){
		scanf("%d %d %d %d", &b, &f, &r, &v);
		a[b-1][f-1][r-1] += v;
	}
	for(b=0;b<4;b++){
		for(f=0;f<3;f++){
			for(r=0;r<10;r++){
				printf(" %d", a[b][f][r]);
			}
			printf("\n");
		}
		if(b<3){printf("####################\n");}
	}
	return 0;
}

Measured memory_bytes: 612
object Main extends App {
  val str = io.StdIn.readLine()
  val index = io.StdIn.readLong

  val mrInfinity = new MrInfinity
  println(mrInfinity.superBrain(str, index))
}

class MrInfinity {
  /**
    * 500兆回処理を繰り返してできた文字列の、左からindex番目の値を返却する。
    * @str 捜査対象の文字列(1~9の数値で構成されている)
    * @index 検査位置
    * @return 左からindex番目にある値（0からでなく、1から開始）
    */
  def superBrain(str: String, index: Long): Char = {
    // 与えられた条件から、実際に5000兆回処理する必要はない。
    // indexより左に1しかない場合には何回処理をしても1になることが明確なので1を返却する。
    // 1以外の数値の場合、2の5000兆乗が優にindexの条件である10^18を越えるため、
    // 一番最初に出てきた数字でindexまでが埋め尽くされることになる。
    // ex) "21"の場合、2が2の5000兆乗個/1が1個となり、indexの最大値である10^18番目は2となる。
    //
    // 従って、以下の条件で返却値を決める。
    //   indexまでに1しかない場合 -> 1を返却
    //   1以外の値がある場合 -> 一番左にある1以外の値
    
    if (index == 1 || str.length == 1) str.head
    else {
      str.head match {
        case '1' => superBrain(str.tail, index - 1)
        case _   => str.head
      }
    }
  }
  
}


Measured memory_bytes: 27328
#include <climits>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;

template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; }

typedef pair<int, int> edge;
#define to first
#define cost second

typedef vector<vector<edge>> graph;

constexpr long double EPS = 1e-10;

typedef vector<double> vec;
typedef vector<vec> mat;

vec gauss_jordan(const mat& A, const vec& b) {
	const int n = A.size();
	mat B(n, vec(n + 1));

	for(int i = 0; i < n; ++i) {
		for(int j = 0; j < n; ++j) {
			B[i][j] = A[i][j];
		}
		B[i][n] = b[i];
	}

	vector<int> idx(n);

	for(int i = 0; i < n; ++i) {
		int pivot = i;
		for(int j = i + 1; j < n; ++j) {
			if(abs(B[j][i]) > abs(B[pivot][i])) pivot = j;
		}
		B[i].swap(B[pivot]);

		if(abs(B[i][i]) < EPS) return vec();

		for(int j = i + 1; j <= n; ++j) {
			B[i][j] /= B[i][i];
		}

		for(int j = 0; j < n; ++j) {
			if(i != j) {
				for(int k = i + 1; k <= n; ++k) {
					B[j][k] -= B[j][i] * B[i][k];
				}
			}
		}
	}

	vec x(n);
	for(int i = 0; i < n; ++i) {
		x[i] = B[i][n];
	}

	return x;
}

vector<int> dijkstra(int s, const graph &G) {
	typedef pair<int, int> P;
	const int n = G.size();

	vector<int> dist(n, INT_MAX);
	priority_queue<P, vector<P>, greater<P>> que;

	dist[s] = 0;
	que.push({0, s});

	while(!que.empty()) {
		const int d = que.top().first;
		const int v = que.top().second;
		que.pop();

		if(dist[v] < d) continue;

		for(const auto &e : G[v]) {
			const int next_dist = d + e.cost;
			if(dist[e.to] > next_dist) {
				dist[e.to] = next_dist;
				que.push({next_dist, e.to});
			}
		}
	}


	return dist;
}

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout.setf(ios::fixed);
	cout.precision(14);

	for(int n, s, t; cin >> n >> s >> t && n;) {
		--s; --t;

		vector<int> q(n);
		for(auto &e : q) cin >> e;

		graph G(n);
		for(int v = 0; v < n; ++v) {
			for(int u = 0; u < n; ++u) {
				int a;
				cin >> a;
				if(a) G[v].emplace_back(u, a);
			}
		}

		const auto dist = dijkstra(t, G);
		if(dist[s] == INT_MAX) {
			cout << "impossible" << endl;
			continue;
		}

		mat A(n, vec(n, 0.0));
		vec b(n, 0.0);

		for(int v = 0; v < n; ++v) {
			if(v == t) {
				A[t][t] = 1.0;
				continue;
			}

			if(dist[v] == INT_MAX) continue;

			for(const auto &e : G[v]) {
				if(q[v] && dist[v] != dist[e.to] + e.cost) continue;

				A[v][v] += 1.0;
				A[v][e.to] = -1.0;
				b[v] += e.cost;
			}
		}

		const auto ans = gauss_jordan(A, b);
		cout << ans[s] << endl;
	}

	return EXIT_SUCCESS;
}

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

int main(){
    int n;
    cin >> n;
    set<string> memo;
    rep(i,n){
        string S;
        cin >> S;
        memo.insert(S);
    }
    cout << memo.size() << endl;
}


Measured memory_bytes: 19056
#include<stdio.h>

int main(void){
  int a,b,c,min,x,y,z;
  
  scanf("%d %d %d",&a,&b,&c);
  
  x=a+b;
  y=a+c;
  z=b+c;
  
  if(x>=y&&z>=y){
    min=y;
  }
  else if(x>=z&&y>=z){
    min=z;
  }
  else if(y>=x&&z>=x){
    min=x;
  }
  
  printf("%d",min);
  
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define  INF 1ll<<60
signed main(){
  int a,b,k=1,e;
  cin>>a>>b;
  e=a;
  while(a<b && b!=1){
    k++;
    a+=e;
    a--;
  }
  if(b==1){
    cout<<0<<endl;
  }else{
    cout<<k<<endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main()
{
	int a,b;
	int res=0;
	cin>>a>>b;
	if(a>=b)
	{
		res+=a;
		a--;
	}
	else
	{
		res+=b;
		b--;
	}
	
	if(a>=b)
	{
		res+=a;
		a--;
	}
	else
	{
		res+=b;
		b--;
	}
	cout<<res<<endl;
	return 0;
}

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

int main(){
    ll k, n;    cin >> n >> k;
    vector<double> v(n);
    for(int i=0; i<n; i++) cin >> v.at(i);
    double ans=0;
    ll maxi = 0, tmp=0;

    for(int i=0; i<k; i++)   tmp += v.at(i);
        
    for(int i=0; i<n-(k-1); i++){
        if(maxi<tmp){
            maxi = tmp;
            ans = 0;
            for(int p=0; p<k; p++)
                ans += (1+v.at(i+p))/2;
        }
        if(i<n-k){
            tmp -= v.at(i);
            tmp += v.at(i+k);
        }
    }
    cout << fixed << setprecision(15) << ans <<endl;
}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int n, v;
const int N = 600000;
int ai[N];
int L[20][N], R[20][N], cnt[N];
int Ld[N], Rd[N];
int main()
{
    scanf("%d%d", &n, &v);
    for (int i = 1; i <= n; ++ i) scanf("%d", &ai[i]);
    int c = 0;
    for (int i = 0, vv = v; vv != -1; ++ i, vv == 0? vv = -1: vv /= 2)
    {
        c ++;
        R[i][n] = n;
        for (int j = n - 1; j >= 1; -- j)
            if (ai[j + 1] - ai[j] <= vv)
                R[i][j] = R[i][j + 1];
            else
                R[i][j] = j;
        L[i][1] = 1;
        for (int j = 2; j <= n; ++ j)
            if (ai[j] - ai[j - 1] <= vv)
                L[i][j] = L[i][j - 1];
            else
                L[i][j] = j;
    }
    for (int i = 0; i < (1 << c); ++ i)
        Ld[i] = n + 1;
    for (int i = 0; i < (1 << c); ++ i)
        for (int j = 0; j <= c; ++ j)
            if (!(i & (1 << j)))
                Rd[i | (1 << j)] = max(Rd[i | (1 << j)], R[j][Rd[i] + 1]),
                Ld[i | (1 << j)] = min(Ld[i | (1 << j)], L[j][Ld[i] - 1]);
    for (int i = 0; i < (1 << c); ++ i) if (!(i & 1))
        if (R[0][Rd[i] + 1] + 1 >= Ld[((1 << c) - 2) ^ i])
        {
            cnt[L[0][Rd[i] + 1]] ++;
            cnt[R[0][Rd[i] + 1] + 1] --;
        }
    for (int i = 1; i <= n; ++ i) cnt[i] += cnt[i - 1];
    for (int i = 1; i <= n; ++ i) if (cnt[i]) puts("Possible"); else puts("Impossible");
}


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

int main(void){
    int n, k;
    cin >> n >> k;
    vector<int> p(n);
    rep(i,n) cin >> p[i];
    sort(all(p));
    cout << accumulate(p.begin(), p.begin() + k, 0) << endl;
    return 0;
}


Measured memory_bytes: 3584
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Runtime.InteropServices;

class Program
{
    const string Yes = "Yes";
    const string No = "No";
    const long Mod = 1000000007;
    const char White = '.';
    const char Black = '#';

    static void Main(string[] args) {
#if DEBUG
        MyDebugger.Test(process, "../TextFile1.txt");
#else
        object ret = process(new StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static object process(TextReader input) {
        var n = int.Parse(input.ReadLine());
        var ary = ToIntArray(input.ReadLine(), n);

        var nums = new Dictionary<int, int>();
        Action<int> add = (x) => {
            if (nums.ContainsKey(x)) nums[x]++;
            else nums[x] = 1;
        };

        foreach(var x in ary) {
            add(x - 1);
            add(x);
            add(x + 1);
        }

        return nums.Values.Max();
    }

    static int[] ToIntArray(string strs, int n) {
        var ret = new int[n];
        var spl = strs.Split(' ');
        for (int i = 0; i < n; i++)
            ret[i] = int.Parse(spl[i]);
        return ret;
    }
}


Measured memory_bytes: 23008
#include<stdio.h>
int main(void)
{
	int a,b;
	int x,y,z;
	scanf("%d %d",&a,&b);
	x=a+b;
	y=a-b;
	z=a*b;
	if(x>=y&&x>=z){
		printf("%d\n",x);
	}
	else if(y>x&&y>z){
		printf("%d\n",y);
	}
	else{
		printf("%d\n",z);
	}
	return 0;
}


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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define repr(i,a,b) for(int i=(int)(a-1);i>=b;i--)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout << #x" = " << x << endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define INF INT_MAX/3

int main() {
  cin.sync_with_stdio(false);
  int a, b;
  cin >> a >> b;
  cout << (a - 1) + (int)(a <= b) << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}

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

  string str = "aeiou";
  char a; cin >> a ;

  rep(i,str.size()){
    if (a == str[i]) {cout << "vowel" << endl; return 0;}
  }

  cout << "consonant" << endl;
  //cout << fixed << setprecision(16) << ans << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int A = scanner.nextInt();
		int B = scanner.nextInt();
		int K = scanner.nextInt();

		int cnt = 0;
		int i = Math.max(A, B);

		while(true) {
			if(A%i==0 && B%i==0) {
				cnt ++;
			}
			if(K == cnt)
				break;

			i--;
		}

		System.out.println(i);

	}

}

Measured memory_bytes: 22740
#include <bits/stdc++.h>
 
#define PB push_back
#define MP make_pair
#define DEBUG printf("%s\n","debug")
#define fst first
#define snd second
#define SIN(x, S) (S.count(x) != 0)
#define M0(x) memset(x,0,sizeof(x))
#define FILL(x, y) memset(x,y,sizeof(x))
#define MM(x) memset(x,-1,sizeof(x))
#define ALL(x) (x).begin(),(x).end()
using namespace std;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
///////////////////////////////////////////////
/* (๑╹◡╹) */
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll MOD = 1000000007;
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;
}
/* (๑╹◡╹)(๑╹◡╹)(๑╹◡╹)(๑╹◡╹)(๑╹◡╹)(๑╹◡╹) */
///////////////////////////////////////////////
const int MAX = 510000;
 
long long fac[MAX], finv[MAX], inv[MAX];
 



int main() {
	int ans = 0;
	int N,L;	cin >> N >> L;
	for (int i = 0; i < N; i++)
	{
		ans += L+i;
	}
	if(L>0){ans -= L;}
	else if(L+N-1<0){ans -= (L+N-1);}
	
	cout << ans << endl;
}


Measured memory_bytes: 256
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicInteger;

public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    long n = Long.parseLong(sc.next());
    SortedMap<Long, AtomicInteger> soinus = new TreeMap<>();
    if (n == 1) {
      pw.println(0);
      return;
    }
    long root = (long) Math.sqrt(n) + 10;
    for (long i = 2; i <= root && i <= n; i++) {
      while (n % i == 0) {
        soinus.computeIfAbsent(
          i,
          k -> new AtomicInteger(0)
        ).incrementAndGet();
        n /= i;
      }
    }
    if (n != 1) {
      soinus.put(n, new AtomicInteger(1));
    }
    SortedMap<Integer, AtomicInteger> eCountMap = new TreeMap<>();
    for (AtomicInteger v : soinus.values()) {
      eCountMap
        .computeIfAbsent(v.intValue(), k -> new AtomicInteger(0))
        .incrementAndGet();
    }
    long ans = 0;
    int totalE = 0;
    for (int i = 1; totalE <= eCountMap.lastKey(); i++) {
      totalE += i;
      long nextTotalE = totalE + i + 1;
      for (int j = totalE; j < nextTotalE; j++) {
        if (eCountMap.containsKey(j)) {
          ans += eCountMap.get(j).intValue() * i;
        }
      }
    }
    pw.println(ans);
  }
}


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

int main()
{
	long q;
	unsigned long long t = 0;

	cin >> q;

	for (long i = 0; i < q; i++) {
		int k, m, s = 0;
		cin >> k;
		switch (k) {
		case 0:
			cin >> m;
			cout << (t >> m) % 2 << endl;
			break;
		case 1:
			cin >> m;
			t = t | (1ull << m);
			break;
		case 2:
			cin >> m;
			t = (t | (1ull << m)) - (1ull << m);
			break;
		case 3:
			cin >> m;
			t = (t | (1ull << m)) - (t & (1ull << m));
			break;
		case 4:
			if (t == 0xffffffffffffffff)
				cout << 1 << endl;
			else
				cout << 0 << endl;
			break;
		case 5:
			if (t > 0)
				cout << 1 << endl;
			else
				cout << 0 << endl;
			break;
		case 6:
			if (t == 0)
				cout << 1 << endl;
			else
				cout << 0 << endl;
			break;

		case 7:
			for (int i = 0; i < 64; i++) {
				if (t & (1ull << i))
					s++;
			}

			cout << s << endl;
			break;

		case 8:
			cout << t << endl;
			break;
		}
	}

	return 0;
}


Measured memory_bytes: 3136
#include<bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
#define w1 first
#define w2 second
#define ls (x<<1)
#define rs (x<<1|1)
#define pb push_back
#define mid ((l+r)>>1)
#define SZ(x) ((x).size())
#define All(x) (x).begin(),(x).end()
#define rep(i,a,b) for(int (i)=(a);(i)<=(b);(i)++)
#define rep2(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define per(i,a,b) for(int (i)=(a);(i)>=(b);(i)--)
#define Rep(p,x) for(int (p)=head[(x)];(p);(p)=nxt[(p)])
template<class T>void read(T&num){
	num=0;T f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9')num=num*10+ch-'0',ch=getchar();
	num*=f;
}
int power(int x,int k,int p){int res=1;for(;k;k>>=1,x=1ll*x*x%p)if(k&1)res=1ll*res*x%p;return res;}
//ai+bj>aj+bi->ai-aj>bi-bj
//maxi_X{ai-ci}
const int maxn=1e5+5,inf=2e9;
int n,X,Y,Z;
struct node{
	int a,b,c;
}val[maxn];
bool cmp(node A,node B){return A.a-A.b>B.a-B.b;}
priority_queue<int,vector<int>,greater<int> >heap;
ll ans,dlt1[maxn],dlt2[maxn],tmp;
int main(){
	read(X);read(Y);read(Z);
	n=X+Y+Z;
	rep(i,1,n)read(val[i].a),read(val[i].b),read(val[i].c),ans+=val[i].c;
	sort(val+1,val+n+1,cmp);
	rep(i,1,X-1)heap.push(val[i].a-val[i].c),tmp+=val[i].a-val[i].c;
	heap.push(-inf);tmp+=-inf;
	rep(i,X,n){
		if(val[i].a-val[i].c>heap.top()){
			tmp-=heap.top();
			heap.pop();
			heap.push(val[i].a-val[i].c);
			tmp+=val[i].a-val[i].c;
		}
		dlt1[i]=tmp;
	}
	while(!heap.empty())heap.pop();
	tmp=0;
	per(i,n,n-Y+2)heap.push(val[i].b-val[i].c),tmp+=val[i].b-val[i].c;
	heap.push(-inf);tmp+=-inf;
	per(i,n-Y+1,1){
		if(val[i].b-val[i].c>heap.top()){
			tmp-=heap.top();
			heap.pop();
			heap.push(val[i].b-val[i].c);
			tmp+=val[i].b-val[i].c;
		}
		dlt2[i]=tmp;
	}
	ll maxi=-1e18;
	rep(i,X,n-Y)maxi=max(maxi,dlt1[i]+dlt2[i+1]);
	printf("%lld\n",ans+maxi);
	return 0;
}

Measured memory_bytes: 2944
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;
        Solver s = new Solver();
        for (int i = 1; i <= t; i++) {
            s.solve(i, in, out);
        }
        out.close();
    }

}

class Solver {

    void solve(int test, InputReader in, PrintWriter out) throws IOException {
        int a = in.nextInt();
        int b = in.nextInt();
        out.println((int) (Math.round((a + b) / (double) 2)));
    }
}

class InputReader {
    BufferedReader br;
    StringTokenizer st;

    public InputReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
        st = null;
    }

    public String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return st.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public String nextLine() throws IOException {
        return br.readLine();
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}

Measured memory_bytes: 21460
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long long ll;

template<class T> inline void read(T &x){
	int f=0;x=0;char ch=getchar();
	for(;!isdigit(ch);ch=getchar())f|=(ch=='-');
	for(;isdigit(ch);ch=getchar())x=x*10+ch-'0';
	if(f)x=-x;
}

const int N=300005;
int a[N],n,b,w;

int chk(int owo){
	int val=a[1];
	for(int i=3;i<=n;i+=2)
		if(val>=owo)val=max(val+a[i]-a[i-1],a[i]);
		else val+=a[i]-a[i-1];
	return val>=owo;
}

int main(){
	read(n);
	rep(i,1,n){
		read(a[i]);
		if(i&1)b+=a[i];
		else w+=a[i];
	}
	if(n%2==0){
		printf("%d %d\n",max(b,w),min(b,w));
		return 0;
	}
	int l=0,r=b,mid;
	while(l<r){
		mid=(l+r+1)>>1;
		if(chk(mid))l=mid;
		else r=mid-1;
	}
	printf("%d %d\n",w+l,b-l);
	return 0;
}

Measured memory_bytes: 1408
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

template <class T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
	for (const auto& e : vec) os << e << (&e == &vec.back() ? "\n" : " ");
	return os;
}
template <class T>
ostream& operator<<(ostream& os, const set<T>& st) {
	for (const auto& e : st) os << e << " ";
	return os;
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
	os << "(" << p.first << "," << p.second << ")";
	return os;
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const map<T1, T2>& mp) {
	for (const auto& e : mp) os << e << " ";
	return os;
}

#ifdef _DEBUG
template <class T>
void dump(const char* str, T&& h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head&& h, Tail&&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	string s;
	cin >> s;

	Int x, y;
	cin >> x >> y;

	Int len = s.size();
	
	//最初の→のFF
	Int cnt = 0;
	while (cnt<len && s[cnt] != 'T') {
		cnt++;
	}
	//x -= cnt;

	cnt++;

	vector<Int> tate;
	vector<Int> yoko;
	Int temp;
	Int flag = 1;//0: 横　1: 縦
	for (Int i = cnt; i < len; i++) {
		temp = 0;
		if (flag) {
			while (i<len && s[i] != 'T') {
				temp++;
				i++;
			}
			tate.push_back(temp);
			flag = 0;
		}
		else {
			while (i<len && s[i] != 'T') {
				temp++;
				i++;
			}
			yoko.push_back(temp);
			flag = 1;
		}
	}

	Int len_tate = tate.size();
	Int len_yoko = yoko.size();

	vector<vector<bool>> dp_tate(len_tate+1, vector<bool>(16001, false));
	vector<vector<bool>> dp_yoko(len_yoko+1, vector<bool>(16001, false));
	dp_yoko[0][8000 + cnt - 1] = true;
	dp_tate[0][8000] = true;

	//横方向から
	for (Int i = 0; i < len_yoko; i++) {
		for (Int j = 0; j < 16001; j++) {
			if (dp_yoko[i][j] == false)continue;
			dp_yoko[i + 1][j + yoko[i]] = true;
			dp_yoko[i + 1][j - yoko[i]] = true;
		}
	}

	//縦
	for (Int i = 0; i < len_tate; i++) {
		for (Int j = 0; j < 16001; j++) {
			if (dp_tate[i][j] == false)continue;
			dp_tate[i + 1][j + tate[i]] = true;
			dp_tate[i + 1][j - tate[i]] = true;
		}
	}

	if (dp_tate[len_tate][8000 + y] && dp_yoko[len_yoko][8000 + x]) {
		cout << "Yes" << "\n";
	}
	else {
		cout << "No" << "\n";
	}
}


Measured memory_bytes: 16256
#include <iostream>

using namespace std;

int main(){
    int A,B,res;
    cin >> A >> B ;

    if(A > B)res = 2 * A - 1;
    else if(A == B)res = 2 * A;
    else if(A < B)res = 2 * B - 1;

    cout << res << endl;

}



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

int main(){
    int w,a,b;cin >> w >> a >> b;
    int ans;

    // 右側にあって、重なっていない
    if (b > a && b > a + w){
        ans = abs(b - (a+w));
    } else if (b > a) {
        ans = 0;
    } else if (b < a && b + w < a){
        //左側にあって、重なっていない
        ans = abs(a - (b + w));
    } else {
        ans = 0;
    }

    cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
# D - .. (Double Dots)
from collections import deque

N,M = map(int,input().split())
route = [deque([]) for _ in range(N+1)]
for _ in range(M):
    A,B = map(int,input().split())
    route[A].append(B)
    route[B].append(A)
    
ans = [0]*2+[-1]*(N-1)
que = deque([1])

while len(que)>0:
    k = que.popleft()
    for x in route[k]:
        if ans[x]<0:
            ans[x] = k
            que.append(x)

print('Yes')
for i in range(2,N+1):
    print(ans[i])

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

int used[2019];

signed main(){
  
  int L, R;
  cin>>L>>R;
  
  int cnt = 2020;

  for(int i=L;i<=R;i++){
    
    used[i%2019] = 1;
    
    cnt--;
    if(cnt==0) break;
    
  }
  
  int ans = 1e9;
  
  for(int i=0;i<2019;i++){
    for(int j=i+1;j<2019;j++){
      if( used[i] && used[j] ) ans = min(ans, (i*j)%2019);
    }
  }
  
  cout<<ans<<endl;
  
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int t_case=sc.nextInt();
		int c1900=sc.nextInt();
		int time=c1900*1900+100*(t_case-c1900);

		for(int i=0; i<c1900; i++) {
			time=time<<1;
		}
		System.out.println(time);
	}
}

Measured memory_bytes: 21844
N,K = list(map(int, input().split()))
d = [0 for i in range(K)] 
A = [[] for i in range(K)]
for i in range(K):
    d[i] = int(input())
    A[i] = list(map(int, input().split()))

sunukes = [0 for i in range(N)] 
for i in range(K):
    for j in range(d[i]):
        sunukes[A[i][j]-1] += 1

count = 0
for i in range(N):
    if sunukes[i] == 0:
        count += 1
print(count)

Measured memory_bytes: 9240
# Here your code !
h, w = gets.chomp.split.map &:to_i
n = gets.chomp.to_i
a = gets.chomp.split.map &:to_i
ans = Array.new(h){Array.new(w,0)}
f = 0
y = x = 0
table = []
a.each.with_index(1) do |d, i|
  d.times{table.push(i)} 
end
i = 0
(h * w * 2).times do
  if(x >= w)
    x = w - 1
    f = 1
  elsif(y >= h)
    y = h - 1
    f = 2
  elsif(x < 0)
    x = 0
    f = 3
  elsif(y < 0)
    y = 0
    f = 0
  elsif(ans[y][x] != 0)
    case f
    when 0 then
      x -= 1
    when 1 then
      y -= 1
    when 2 then
      x += 1
    when 3 then
      y += 1
    end
    f += 1
    f %= 4
  else
    if(ans[y][x] == 0)
      ans[y][x] = table[i] 
      i += 1
    end
  end
  case f
  when 0 then
    x += 1
  when 1 then
    y += 1
  when 2 then
    x -= 1
  when 3 then
    y -= 1
  end
end
ans.each{|aa|puts aa.join(" ")}

Measured memory_bytes: 2556
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <fstream>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <time.h>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) (min(a,b) <= (x) && (x) <= max(a,b)) //hei
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MODU 1000000007LL
#define bitcheck(a,b)   ((a >> b) & 1)
#define bitset(a,b)      ( a |= (1 << b))
#define bitunset(a,b)    (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#define PI 3.141592653589


#define izryt bool
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T & val) {
	std::fill((T*)array, (T*)(array + N), val);
}
pll Dir[4] = {
	{ -1 ,0 },{ 0 , 1 },{ 1 ,0 },{ 0 ,-1 }
};

//[a, b)
#define Getsum(ar, a,b) (ar[b] - ar[a])
#define chmax(a,b) a = max(a,b)
#define chmin(a,b) a = min(a,b)

struct Edge {
	int from, to;
	ll w;
	bool operator<(const Edge& rhs) const {
		return MP(w, MP(from, to)) < MP(rhs.w, MP(rhs.from, rhs.to));
	}

};
typedef vector<vector<Edge>> Graph;

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

ll factorial(ll n) {//階乗
	ll ret = 1;
	rep(i, 1, n + 1)
		ret = (ret *i) % MODU;

	return ret;
}

ll mod_pow(ll x, ll n, ll mod) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x %mod;
		x = x * x%mod;
		n >>= 1;
	}
	return res;
}
ll divmod(ll a, ll b, ll m) { // a/b(mod m)
								  // a/b (mod m)
								  // a*b^-1
								  // b^-1 * b = 1
								  // b^(m-1) = 1 
								  // b^(m-2) * b = 1
								  // b^-1 = b^(m-2)

								  // a/b = a * b^(m-2)

	return (a * 1LL * mod_pow(b, m - 2, m)) % m;
}
ll ncr(ll n, ll r) {
	return divmod(factorial(n), (factorial(r) * (factorial(n - r))) % MODU, MODU);
}

int n;
string base;
bool quest(int from) { //True:base
	printf("?");
	REP(i, n) {
		printf(" %d", (from+ i) % (2*n) + 1);
	}
	cout << endl;
	string str;
	cin >> str;
	return str == base;
}

bool quest(int from, int ad) { //True:base
	printf("?");
	REP(i, n - 1) {
		printf(" %d", (from + i) % (2 * n) + 1);
	}
	printf(" %d", ad + 1);
	
	cout << endl;
	string str;
	cin >> str;
	return str == base;
}


array<int, 3> c[100001] = {};
int cc[100001] = {};
signed main() {
	int n;
	cin >> n;
	REP(i, n + 1) {
		if ((int)(i * 1.08) == n) {
			cout << i << endl;
			return 0;
		}
	}
	cout << ":(" << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <utility>
#include <string>
#include <math.h>
#include <algorithm>
#include <cstring>
#include <cctype>

typedef long long int ll;
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

using namespace std;

int main() {

  ll N;
  cin >> N;
  vector <long long int> A;
  ll x; 
  REP(i,N){
    cin >> x;
    A.push_back(x);
  }
  sort(ALL(A),greater<int>());

  queue<int> bque;
  ll point = 0;
  bque.push(A[0]);
  for(int i=1;i<A.size();i++){
    point += bque.front();
    bque.pop();
    //cout << A[i] << endl;
    bque.push(A[i]);
    bque.push(A[i]);
  }
  cout << point << endl;



}

Measured memory_bytes: 5468
#include <iostream>
using namespace std;
int main(){
  string s; cin >> s;
  const int n=4;
  bool flag=true;
  for(int i=0; i<n-1; i++){
    if(s[i+1]==s[i]) flag=false;
  }
  cout << (flag ? "Good\n" : "Bad\n");
}

Measured memory_bytes: 256
from collections import defaultdict
cnt=defaultdict(int)
H,W=map(int,input().split())
for i in range(H):
    for a in input():
        cnt[a]+=1
one=0
two=0
for x in cnt.values():
    if x%2==1:
        one+=1
        x-=1
    x//=2
    if x%2==1:
        two+=2
canone=0
cantwo=0
if H%2==1 and W%2==1:
    canone=1
    cantwo=H+W-2
if H%2==0 and W%2==1:
    H,W=W,H
if H%2==1 and W%2==0:
    canone=0
    cantwo=W
if one<=canone and two<=cantwo:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3316
#include<bits//stdc++.h>
#include<algorithm>
using namespace std;
int main(){
	int a, b, c;
	cin >> a >> b >> c;
	for (int i = 0; i < c; i++) {
		if (i % 2 == 1) {
			b /= 2;
			a +=b;
		}
		if(i%2==0){
			a /= 2;
			b+=a;
		}
	}
	cout << a <<" "<< b << endl;
}



Measured memory_bytes: 256
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {

		Scanner sc=new Scanner(System.in);
		
		long a=sc.nextLong();
		long b=sc.nextLong();
		long x=sc.nextLong();
		
		long result=func(b,x)-func(a-1,x);
		
		System.out.println(result);
		
		
		sc.close();


	}

	public static long func(long n,long x) {
		
		if(n>=0) {
			return n/x+1;
		}else {
			return 0;
		}
		
	}

}



Measured memory_bytes: 21716
#include <iostream>
using namespace std;
int main() {
    int a, b;
    char op;
    cin >> a >> op >> b;
    while (op != '?') {
        if (op == '+') 
            cout << a + b << "\n";
        else if (op == '-') 
            cout << a - b << "\n";
        else if (op == '*') 
            cout << a * b << "\n";
        else if (op == '/')
            cout << a / b << "\n";
        cin >> a >> op >> b;
    }
}


Measured memory_bytes: 3096
#!/bin/ruby

n, m = gets.chomp.split(" ").map(&:to_i)

data = {}
n.times do |i|
  k, *foods = gets.chomp.split(" ").map(&:to_i)
  k.times do |j|
    data[foods[j]] ||= 0
    data[foods[j]] += 1
  end
end
puts data.select {|k,v| v == n }.length


Measured memory_bytes: 1788
s = list(map(int, input()))

c1 = 0
c2 = 0
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] != 0:
            c1 += 1
        if s[i] != 1:
            c2 += 1
    else:
        if s[i] != 1:
            c1 += 1
        if s[i] != 0:
            c2 += 1

print(min(c1, c2))

Measured memory_bytes: 3956
#include <stdio.h>
#include <vector>
#include <queue>
#include <algorithm>

typedef long long ll;

const ll three[8][3] = {{1,1,1},{1,1,-1},{1,-1,1},{1,-1,-1},{-1,1,1},{-1,1,-1},{-1,-1,1},{-1,-1,-1}};


int main() {


	int n, m;

	scanf("%d %d", &n, &m);

	std::vector<ll> a(n), b(n), c(n);

	ll ans = -(1ll << 60);

	for(int i=0;i<n;i++) {
		scanf("%lld", &a[i]);
		scanf("%lld", &b[i]);
		scanf("%lld", &c[i]);
	}

	for(int i=0;i<8;i++) {
		std::vector<ll> tmp(n);
		for(int t=0;t<n;t++) {
			tmp[t] = a[t] * three[i][0] + b[t] * three[i][1] + c[t] * three[i][2];
		}

		std::sort(tmp.begin(), tmp.end(), std::greater<ll>());
		
		ll sum = 0;
		for(int i=0;i<m;i++) {
			sum += tmp[i];
		}

		ans = std::max(ans, sum);
	}

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

	return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
 
int main(void){
    int i,j,x,a[8];
    scanf("%*d");
    while(scanf("%1d%1d%1d%1d%1d%1d%1d%1d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7])!=EOF){
        for(i=0;i<8;i++){
            for(j=i;j>0;j--){
                if(a[j]>a[j-1]){x=a[j];a[j]=a[j-1];a[j-1]=x;}
                else break;
            }
        }
        printf("%d\n",(a[7]-a[0])+(a[6]-a[1])*10+(a[5]-a[2])*100+(a[4]-a[3])*1000+(a[3]-a[4])*10000+(a[2]-a[5])*100000+(a[1]-a[6])*1000000+(a[0]-a[7])*10000000);
    }
    return 0;
}

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

int GetFirstDigitNumber(int N) {
	return N % 10;
}

int main()
{
	int n = 5;
	
	vector<int> c(n), firstDigit(n);

	int index = 0;
	int tmp = 100000;

	for (int i = 0; i < n; i++) {

		cin >> c[i];

		firstDigit[i] = GetFirstDigitNumber(c[i]);

		if (firstDigit[i] != 0 && firstDigit[i] < tmp) {
			tmp = firstDigit[i];
			index = i;
		}
	}

	int ans = 0;
	
	for (int i = 0; i < n; i++) {

		if (i != index) {

			if (firstDigit[i] == 0) {
				ans += c[i];
			}
			else {
				ans += (c[i] / 10 + 1) * 10;
			}

		}
		else { // i == index

			ans += c[index];

		}

	}
		
	cout << ans << endl;
	
	return 0;
}

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

int main(){
    string s;
    cin >> s;
    vector<int> ans(s.length(), 0);
    for(int i = 0, count = 0; i < s.length(); i++){
        if(s[i] == 'R'){
            count++;
        }else{
            ans[i] += count/2;
            ans[i-1] += (count+1)/2;
            count = 0;
        }
    }

    for(int i = s.length()-1, count = 0; i >= 0; i--){
        if(s[i] == 'L'){
            count++;
        }else{
            ans[i] += count/2;
            ans[i+1] += (count+1)/2;
            count = 0;
        }
    }

    for(int i = 0; i < s.length(); i++){
        cout << ans[i];
        if(i == s.length()-1) cout << endl;
        else cout << " ";
    }
    return 0;
}

Measured memory_bytes: 3812
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
  int n,a[1000]={};
  cin >> n;
  for(int i=0; i<n; i++) {
      cin >> a[i];
  }
  int q,b,e;
  cin >> q;
  for(int i=0; i<q; i++) {
      cin >> b >> e;
      reverse(a+b,a+e);
  }
  for(int i=0; i<n-1; i++) {
      cout << a[i] << " ";
  }
  cout << a[n-1] << endl;
}


Measured memory_bytes: 3100
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <iomanip>

using namespace std;
using ll = long long;

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

ll GCD(ll x, ll y) {
    if (y == 0) return x;
    else return GCD(y, x % y);
}


#include <iostream>

int main()
{
    double a, b;
    cin >> a >> b;

    cout << ceil((a + b) / 2) << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    for(int i=0;i<s.size();i++)
        if(s[i]=='C')
            for(int j=i+1;j<s.size();j++)
                if(s[j]=='F')
                {
                    cout<<"Yes";
                    return 0;
                }
    cout<<"No";
    return 0;
}

Measured memory_bytes: 256