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

using namespace std;

#define DUMP(x) std::cerr << (#x) << " = " << (x) << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP(i, k, n) for (int i = (k); i < (int)(n); ++i)
#define ALL(r) r.begin(), r.end()
#define YES puts("YES")
#define Yes puts("Yes")
#define NO puts("NO")
#define No puts("No")
#define IMP puts("IMPOSSIBLE")
#define Imp puts("Impossible")
#define imp puts("impossible")
#define M1 puts("-1")
#define pb push_back

template <typename T>
ostream &operator<<(ostream &os, vector<T> &v)
{
    os << "{";
    rep(i, v.size()) os << v[i] << (i == (int)v.size() - 1 ? "" : ", ");
    os << "}";
    return os;
}
template <typename T>
T dup(T x, T y)
{
    return (x + y - 1) / y;
};
template <typename A, size_t N, typename T>
inline void arrayFill(A (&array)[N], const T &val) { std::fill((T *)array, (T *)(array + N), val); }
struct in
{
    const size_t n = 0;
    in() = default;
    in(size_t n) : n(n){};
    template <typename T>
    operator T()
    {
        T ret;
        cin >> ret;
        return ret;
    }
    template <typename T>
    operator vector<T>()
    {
        assert(n != 0);
        vector<T> ret(n);
        for (auto &x : ret)
            cin >> x;
        return ret;
    }
};

using ll = int64_t;
using vint = vector<int32_t>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pint = pair<int32_t, int32_t>;
using pll = pair<ll, ll>;
using setint = set<int32_t>;
using setstr = set<string>;
using qint = queue<int32_t>;
using qpint = queue<pint>;

constexpr std::int32_t INF = 1001001001;
constexpr std::int64_t LINF = 1001001001001001001;

void Main()
{
    int n = in();
    vstr s = in(n);
    vector<map<char, int>> vst;
    vint v(26, INF);
    rep(i, n)
    {
        map<char, int> mp;
        rep(j, s[i].length())
        {
            ++mp[s[i][j]];
        }
        rep(j, 26)
        {
            v[j] = min(v[j], mp[j + 'a']);
        }
    }

    string ans;
    rep(i, 26)
    {
        rep(j, v[i])
        {
            ans.pb('a' + i);
        }
    }
    cout << ans << endl;
}

int main()
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 256
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {

		new Main().run();
	}

	private void run() throws IOException {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			int n = scanner.nextInt();
			int k = scanner.nextInt();
			if ((n | k) == 0)
				break;
			boolean[] b = new boolean[n + 1];
			int[][] a = new int[n + 1][2];
			for (int i = 0; i < k; i++)
				b[scanner.nextInt()] = true;
			int ans = 0;
			for (int i = 1; i <= n; i++) {
				a[i][0] = b[i] ? a[i - 1][0] + 1 : 0;
				ans = Math.max(ans, a[i][0]);
			}
			if (b[0]) {
				for (int i = 1; i <= n; i++) {
					a[i][1] = b[i] ? a[i - 1][1] + 1 : a[i - 1][0] + 1;
					ans = Math.max(ans, a[i][1]);
				}
			}
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 64624
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 15 20:38:23 2019

@author: Yamazaki Kenichi
"""
import heapq

N, M = map(int,input().split())
A = list(map(int,input().split()))

q = []
for a in A:
    heapq.heappush(q,-a)

for i in range(M):
    tmp = heapq.heappop(q)
    tmp /= 2
    heapq.heappush(q,tmp)

ans = 0
for c in q:
    ans += int(-c)
print(ans)
    



Measured memory_bytes: 14180
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using Graph=vector<vector<int>>;
#define MOD 1000000007
#define MAX 1000000

int main(){
  string S;
  cin>>S;
  int N=S.size();
  int left=0;
  vector<pair<int,int>> lr;
  for(int i=0;i<N-1;i++){
    if(S.at(i)=='L'&&S.at(i+1)=='R'){
      lr.push_back(make_pair(left,i));
      left=i+1;
    }
  }
  lr.push_back(make_pair(left,N-1));
  vector<int> RL;
  for(int i=0;i<N-1;i++){
    if(S.at(i)=='R'&&S.at(i+1)=='L'){
      RL.push_back(i);
    }
  }

  int n=RL.size();
  for(int i=0;i<n;i++){
    int w=lr.at(i).second-lr.at(i).first+1;
    if(w%2==0){
      for(int j=lr.at(i).first;j<RL.at(i);j++){
        cout<<0<<" ";
      }
      cout<<w/2<<" "<<w/2<<" ";
      for(int j=0;j<lr.at(i).second-(RL.at(i)+1);j++){
        cout<<0<<" ";
      }
    }else{
      for(int j=lr.at(i).first;j<RL.at(i);j++){
        cout<<0<<" ";
      }
      if((RL.at(i)-lr.at(i).first)%2==0){
        cout<<(w-1)/2+1<<" "<<w/2<<" ";
      }else{
        cout<<w/2<<" "<<(w-1)/2+1<<" ";
      }
      for(int j=0;j<lr.at(i).second-(RL.at(i)+1);j++){
        cout<<0<<" ";
      }
    }
  }
  cout<<endl;
}


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

int main() {
  while (1) {
    string s;
    cin >> s;
    if (s == "-") { break; }

    int m;
    cin >> m;

    for (int i = 0; i < m; i++) {
      int h;
      cin >> h;

      string a = s.substr(0, h);
      string b = s.substr(h);

      s = b + a;
    }

    cout << s << endl;
  }

  return 0;
}


Measured memory_bytes: 3192
#![allow(unused_imports)]
use std::io::{ self, Write };
use std::str::FromStr;
use std::cmp::{ min, max };
use std::collections::{ BinaryHeap, VecDeque };

#[allow(unused_macros)]
macro_rules! trace {
    ($var:expr) => {
        let _ = writeln!(&mut std::io::stderr(), ">>> {} = {:?}", stringify!($var), $var);
    };
    ($($args:expr),*) => { trace!(($($args),*)) }
}

#[allow(unused_macros)]
macro_rules! put {
    ($var:expr) => {
        let _ = writeln!(&mut std::io::stdout(), "{}", $var);
    };
    ($var:expr, $($args:expr),*) => {
        let _ = write!(&mut std::io::stdout(), "{} ", $var);
        put!($($args),*);
    };
}

fn f(x: u64) -> u64 {
    let x0 = (x / 4) * 4;
    let mut a = x0;
    for i in (x0 + 1) .. (x + 1) {
        a ^= i;
    }
    a
}

fn main() {
    let mut sc = Scanner::new();
    let a: u64 = sc.cin();
    let b: u64 = sc.cin();
    if b == 0 {
        put!(0);
    } else if a == 0 {
        put!(f(b));
    } else {
        put!(f(b) ^ f(a - 1));
    }
}

#[allow(dead_code)]
struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
#[allow(dead_code)]
impl Scanner {
    fn new() -> Scanner { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn reserve(&mut self) {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
    }
    fn cin<T: FromStr>(&mut self) -> T {
        self.reserve();
        match self.buffer.pop_front().unwrap().parse::<T>() {
            Ok(a) => a,
            Err(_) => panic!("parse err")
        }
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h> 
using namespace std; 
#define for_(i, s, e) for (int i = s; i < (int) e; i++)
#define for__(i, s, e) for (ll i = s; i < e; i++)
#define SSTR(x) static_cast<std::ostringstream&>((std::ostringstream() << std::dec << x)).str()
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
#define endl '\n'


int main() {
	#ifndef ONLINE_JUDGE
	#endif
	
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int h, w, xs, ys, xe, ye; cin >> h >> w >> xs >> ys >> xe >> ye;
	vector<vi> mat(h, vi(w));
	for_(i, 0, h) for_(j, 0, w) {
		char c; cin >> c;
		mat[i][j] = c == '.';
	}
	
	xs -= 1; ys -= 1; xe -= 1; ye -= 1;
	vector<ii> moves = {{0, 1}, {0, -1}, {-1, 0}, {1, 0}};
	int INF = 1e9;
	vector<vector<int>> dist(h, vi(w, INF));
	deque<ii> q;
	q.push_front({xs, ys});
	dist[xs][ys] = 0;
	
	while (q.size()) {
		int x = q.front().first, y = q.front().second; q.pop_front();
		for (auto mv: moves) {
			int xx = x+mv.first, yy = y+mv.second;
			if (xx >= 0 and xx < h and yy >= 0 and yy < w and mat[xx][yy] and dist[xx][yy] > dist[x][y]) {
				dist[xx][yy] = dist[x][y];
				q.push_front({xx, yy});
			}
		}
		for_(i, -2, 3) for_(j, -2, 3) {
			int xx = x + i, yy = y + j;
			if (xx >= 0 and xx < h and yy >= 0 and yy < w and mat[xx][yy] and dist[xx][yy] > dist[x][y]+1) {
				dist[xx][yy] = dist[x][y]+1;
				q.push_back({xx, yy});
			}
		}
	}
	
	cout << (dist[xe][ye] == INF ? -1 : dist[xe][ye]) << endl;
	
	return 0;
}


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

#define N 100

int n;
int a[N];

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

	for( int i = 0; i < n; i++ ) {
		int key = a[i];
		int j = i - 1;
		while( j >= 0 and a[j] > key ) {
			a[j+1] = a[j];
			j--;
		}
		a[j+1] = key;
		for( int k = 0; k < n; k++ ) {
			cout << a[k];
			if( k < n-1 ) {
				cout << " ";
			}
			else {
				cout << endl;
			}
		}
	}

	return 0;
}



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

int main() {
	// your code goes here
	int h, m, s;
	cin>>s;
	h = s / 3600;
	s=s%3600;
	m = s /60;
	s=s%60;
	cout << h << ":" << m << ":" << s <<endl;
	return 0;
}

Measured memory_bytes: 3076
A, B, C, X, Y = map(int, input().split())

if A < B:
    A, B = B, A
    X, Y = Y, X    
    
if A > C*2 and B > C*2:
    print(C*2*max(X,Y))

elif A > C*2 and B < C*2:
    print(2*C*X + B*max(0,(Y-X)))

elif A + B > C*2 :
    print(2*C*min(X,Y) + A*max(0,(X-Y)) + B*max(0,(Y-X)))

else:
    print(A*X+B*Y)

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

int main (){
  int x1,x2;
  
  cin>>x1>>x2;
  if (x1>=x2)
    cout<<x1-x2<<endl;
  
  else if (x1<x2)
    cout<<x2-x1<<endl;
  return 0;
}



Measured memory_bytes: 3116
#include <bits/stdc++.h>
#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

main() {
    int64_t n, k;
    cin >> n >> k;

    vector<int64_t> a(n);
    for (auto&& aa : a) {
        cin >> aa;
    }

    unordered_map<int64_t, int64_t> m;
    int64_t ans = 0;
    vector<int64_t> s(n + 1);
    ++m[0];
    for (auto i : irange(0L, n)) {
        if (i - k + 1 >= 0) {
            --m[(s[i - k + 1] + (i - k + 1) * (k - 1)) % k];
        }

        s[i + 1] = s[i] + a[i];
        ans += m[(s[i + 1] + (i + 1) * (k - 1)) % k];
        ++m[(s[i + 1] + (i + 1) * (k - 1)) % k];
    }

    cout << ans << endl;
}

Measured memory_bytes: 11592
#include <bits/stdc++.h>
using namespace std;
 
 
 
#define int long long int
#define rep(i,n) \
    for(int i = 0; i < n; i++)
#define rep2(i, a, b) \
    for(int i = a; i < b; i++)
#define all(c) \
    c.begin(), c.end()
#define init(arr, num) \
    memset(arr, num, sizeof(arr))
#define fast\
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define inputFile \
    freopen("input.txt", "r", stdin); 
#define outputFile \
    freopen("output.txt", "w", stdout);
#define modM 1000000007
#define PI 3.1415926535897932

#ifdef Voneone
#define TRACE
#endif
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;

}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); 
    cout.write(names, comma - names) << " : " << arg1 << " | "; 
    __f(comma + 1, args...);
}
#else
#define trace(...)
#endif

 
typedef long long ll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef pair< int, int > ii;
typedef unordered_set<int> usi;

usi graph[100000*2+10];


void solve() 
{ 

    int n;
    cin >> n;

    vi a(n+10);
    rep2(i, 2, n+1){
        int x; 
        cin >> x;
        graph[x].insert(i);
    }

    rep2(i, 1, n+1)
        cout << graph[i].size() << '\n';



} 
 
 
 
 
signed main()
{
 
    
    #ifdef Voneone
    inputFile;
    #endif
    #ifndef Voneone
    fast;
    #endif


    int T = 1;
    // cin >> T;
    while(T--){
        solve();
        cout << endl;
        
        

    }
    
    
    return 0;
 
}






Measured memory_bytes: 28276
#include<cstdio>
#include<algorithm>
#define ls p<<1,l,m
#define rs p<<1|1,m+1,r
using namespace std;
const int N=3e5+5,P=4*N;
int nn,mm,n,i,x,y,k;
struct arr{int x,y;}a[N];
bool operator < (arr A,arr B){return A.x<B.x;}
int read(){
	char c=getchar();int k=0;for (;c<48||c>57;c=getchar());
	for (;c>47&&c<58;c=getchar()) k=(k<<3)+(k<<1)+c-48;return k;
}
int tl,tr;
struct stack{int x,k;}ql[N],qr[N];
int mx[P],ad[P];
void change(int p,int l,int r){
	if (x<=l&&r<=y){ad[p]+=k;mx[p]+=k;return;}
	int m=l+r>>1;
	if (x<=m) change(ls);if (y>m) change(rs);
	mx[p]=ad[p]+max(mx[p<<1],mx[p<<1|1]);
}
void build(int p,int l,int r){
	if (l==r){mx[p]=mm-a[l].x;return;}
	int m=l+r>>1;build(ls);build(rs);
	ad[p]=0;mx[p]=ad[p]+max(mx[p<<1],mx[p<<1|1]);
}
int work(){
	sort(a+1,a+n+1);int res=0;
	tl=1;ql[0].x=-1;ql[1]=(stack){0,0};
	tr=1;qr[0].x=-1;qr[1]=(stack){0,mm};
	build(1,0,n);int mid=mm>>1;
	for (i=1;i<=n;i++){
		res=max(res,(mx[1]+a[i].x)*2);
		if (a[i].y<=mid){
			for (;tl&&a[i].y>ql[tl].k;tl--)
				x=ql[tl-1].x+1,y=ql[tl].x,
				k=ql[tl].k-a[i].y,change(1,0,n);
			ql[++tl]=(stack){i-1,a[i].y};
		}
		else{
			for (;tr&&a[i].y<qr[tr].k;tr--)
				x=qr[tr-1].x+1,y=qr[tr].x,
				k=a[i].y-qr[tr].k,change(1,0,n);
			qr[++tr]=(stack){i-1,a[i].y};
		}
		ql[++tl]=(stack){i,0};qr[++tr]=(stack){i,mm};
	}
	return max(res,(mx[1]+nn)*2);
}
int main(){
	nn=read();mm=read();
	for (n=read(),i=1;i<=n;i++)
		a[i]=(arr){read(),read()};
	int ans=work();swap(nn,mm);
	for (i=1;i<=n;i++) swap(a[i].x,a[i].y);
	ans=max(ans,work());
	printf("%d",ans);
}

Measured memory_bytes: 16512
#include<stdio.h>
int main(void)
{
	int c[3][3];
	int flag = 0;
	for (int i = 0; i < 3; i++) {
		scanf("%d %d %d\n", &c[i][0], &c[i][1], &c[i][2]);
	}

	for (int k = 0; k < 2; k++) {
		for (int l = 0; l < 2; l++) {
			if (c[k][l] - c[k + 1][l] != c[k][l + 1] - c[k + 1][l + 1]) {
				flag++;
			}
		}
	}

	if (flag != 0) {
		printf("No\n");
	}
	else if (flag == 0) {
		printf("Yes\n");
	}

	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define REP(i,x,n) for(int i = (x); i < (n); ++i)
#define ll long long
#define P pair<ll,ll>
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1);

int main(void)
{
    ll n,cnt=0; cin>>n;
    REP(i,1,10) if(i<=n) cnt++;
    REP(i,100,1000) if(i<=n) cnt++;
    REP(i,10000,1e5) if(i<=n) cnt++;
    cout<<cnt<<endl;
    return 0;
}

Measured memory_bytes: 3636
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def main():
    N = int(input())
    A = list(map(int, input().split()))

    ans = [0] * 8
    ex = 0
    for a in A:
        if a <= 399:
            ans[0] += 1
        elif a <= 799:
            ans[1] += 1
        elif a <= 1199:
            ans[2] += 1
        elif a <= 1599:
            ans[3] += 1
        elif a <= 1999:
            ans[4] += 1
        elif a <= 2399:
            ans[5] += 1
        elif a <= 2799:
            ans[6] += 1
        elif a <= 3199:
            ans[7] += 1
        else:
            ex += 1

    n = 8 - ans.count(0)
    print(max(1, n), n + ex)


if __name__ == '__main__':
    main()


Measured memory_bytes: 4208
#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
typedef long long ll;
const int N=1e5+5;
const int p=1e9+7;
#define PI acos(-1)
ll qpow(ll a,ll n){ll res=1;while(n){if(n&1)res=res*a%p;a=a*a%p;n>>=1;}return res;}
void work()
{
    int n;
    scanf("%d",&n);
    printf("%.5f\n",n*2*PI);
}
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int T=1;
    //scanf("%d",&T);
    //cin>>T;
    while(T--){
        work();
    }
}

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

#define REP(i,num) for(ll i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=ll>
T in(){T x; cin >> x; return (x);}
template<typename T=ll,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

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

ll powermod(ll a,ll b,ll m){
	if(b==0){
		return 1LL;
	}
	if(b%2){
		return (a*powermod(a,b-1LL,m))%m;
	}
	return powermod((a*a)%m,b/2LL,m);
}

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

	string S=in<string>();
	int N=S.size();
	vector<int> M(N+1,0);
	reverse(ALL(S));
	REP(i,N){
		int V=M[i];
		int X=(S[i]-'0')*powermod(10,i,2019);
		M[i+1] = (X+V)%2019;
	}
	map<int,ll> C;
	REP(i,N+1){
		C[M[i]]++;
	}
	ll A=0;
	for(auto& x:C){
		A += x.second*(x.second-1LL)/2LL;
	}
	out(A);
	return 0;
}


Measured memory_bytes: 4428
#include<bits/stdc++.h>
#define ll long long
#define inf 1000000000
using namespace std;
int k,n,a[200009],ans=inf;
int f(int x)
{
    return x>0?x:-x;
}
int main()
{
    scanf("%d%d",&k,&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)
    {
        if(i+1==n+1)
            ans=min(ans,k-f(a[1]+k-a[n]));
        else
            ans=min(ans,k-f(a[i]-a[i+1]));
        if(i-1==0)
            ans=min(ans,k-f(a[1]+k-a[n]));
        else
            ans=min(ans,k-f(a[i]-a[i-1]));
    }
    printf("%d",ans);
    return 0;
}


Measured memory_bytes: 1152
#include<bits/stdc++.h>
 
#define ll                    long long int
#define ll_MAX                LLONG_MAX
#define ll_MIN                LLONG_MIN
#define pi                    3.14159265358979323846
#define count_1(n)            __builtin_popcountll(n)
#define MOD                   1000000007
#define MAX                   1e9
#define MIN                   -1e9
#define itoc(c)               ((char)(((int)'0')+c))
#define mid(s,e)              (s+(e-s)/2)
const int MX=10010896;
const int lmt=3164;
const int N=10000001;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
ll extgcd(ll a,ll b,ll& x,ll& y){if(b==0){x=1;y=0;return a;}else{int g=extgcd(b,a%b,y,x);y-=a/b*x;return g;}}
ll modpow(ll a,ll b) {ll res=1;a%=MOD;for(;b;b>>=1){if(b&1)res=res*a%MOD;a=a*a%MOD;}return res;}
#define print_upto(a,n)        for(int i=0;i<n;i++)    cout<<a[i]<<" "; cout<<endl
#define print(a)        for (auto x : a) cout << x << " "; cout << endl

inline void solve(){
    int n;cin>>n;
    for(int i=0;i<n;i++)cout<<"ACL";
    cout<<"\n";
}

int main()
{
	cout<<fixed<<setprecision(12);
	fastio;ll  t=1,tc=1;
	#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout);
	#endif
	//cin>>t;
	while(t--){solve();}return 0;
}

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

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef pair<int, int> pii;
typedef pair<char, char> pcc;

#define ALL(a) (a).begin(),(a).end()
#define ZP(a, len) setfill('0') << setw(len) << right << a
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
const ll LINF = 1e11;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

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


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

    int r, g, b, n;
    cin >> r >> g >> b >> n;

    int ans = 0;
    for (int i = 0; i <= n / r; ++i) {
        for (int j = 0; j <= n / g; ++j) {
            int zan = n - r * i - g * j;
            if (zan >= 0 && zan % b == 0) {
                ans++;
            }
        }
    }

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


Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(void)
{
    int x,y;
    cin>>x>>y;
    while((x+y)!=0)
    {
        if(x>y)
        {
            cout<<y<<" "<<x<<endl;
        }
        else
        {
            cout<<x<<" "<<y<<endl;
        }
        cin>>x>>y;
    }
    return 0;
}


Measured memory_bytes: 3092
#include <cstdio>
#include <algorithm>
using namespace std;
int L, R, m = 2019;
int main() {
  scanf("%d %d", &L, &R);
  for(int i = L; i < R && m > 0; i++) {
    for(int j = i+1; j <= R && m > 0; j++) {
      m = min(m, (i%2019)*(j%2019)%2019);
    }
  }
  printf("%d", m);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
    REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

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 dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};

const int dx8[8] = {1,1,0,-1,-1,-1,0,1};
const int dy8[8] = {0,1,1,1,0,-1,-1,-1};

vector< vector<int> > Graph;
vector< int > value;





int main(int argc, const char * argv[]) {
    
    // remove the bottom 3 lines when you submit this code.
    std::ifstream in("sample.txt");
    std::cin.rdbuf(in.rdbuf());

    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string s; cin >> s;
    cout << "ABC" << s << endl;
    
    
    
    
    
}



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

#define rep(i,z) for(int i = 0; i<(int)(z); i++)
#define rep1(i,z) for(int i = 1; i<=(int)(z); i++)
 
using namespace std;

typedef long long ll;
const ll MOD=1e9+7;
using pear = pair<int,int>; 

int main(){
   char s[101];
   cin>>s;
   int len = strlen(s);
   int ans = 0;
   rep(i,len/2){
       if(s[i] != s[len-1-i]) ans++;
   }
   cout<< ans <<endl;
}

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

def f(n):
    if n%2 == 0:
        return n // 2
    else:
        return 3*n + 1

a = []
for i in range(1, 1000001):
    if i == 1:
        a.append(s)
    else:
        n = a[i-2]
        a.append(f(n))

b = []
for i, num in enumerate(a):
    if num in b:
        print(i+1)
        break
    b.append(num)

Measured memory_bytes: 17016
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


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

	int a,b,c,d;
  cin >> a >> b >> c >> d;
  cout << min(a,b) + min(c,d) << endl;


  
  
  return 0;
    

}


Measured memory_bytes: 256
// package app;

import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {

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

        // final String N = sc.next();
        // final int M = sc.nextInt();
        // final int N = sc.nextInt();
        // final int D = sc.nextInt();

        String[] str = new String[2];
        for (int i = 0; i < 2; i++) {
            str[i] = sc.next();
        }
        StringBuffer firstStr = new StringBuffer(str[0]);
        firstStr.reverse();

        // System.out.println();
        System.out.println(str[1].equals(firstStr.toString()) ? "YES": "NO");

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
}

Measured memory_bytes: 21588
#include <iostream>
#include <vector>

void vector_output(std::vector<int> src)
{
  size_t N = src.size();
  for(size_t i = 0; i < N-1; ++i)
  {
    std::cout << src[i] << " ";
  }
  std::cout << src[N-1] << std::endl;
}

int main()
{
  // 要素数の取得
  int N;
  std::cin >> N;

  // 要素の取得
  std::vector<int> A(N);
  for(int idx = 0; idx < N; ++idx)
  {
    std::cin >> A[idx];
  }

  //挿入ソート
  for(int i = 1; i < N; ++i)
  {
    // 出力
    vector_output(A);
    // ソーティング
    int v = A[i];
    int j = i - 1;
    while((j>=0)&&(A[j]>v))
    {
      A[j+1] = A[j];
      j--;
    }
    A[j+1] = v;
  }

  // 出力
  vector_output(A);
  return 0;
}



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

using namespace std;

int main()
{
    int a, b;
    double c;
    int d;
    cin >> a >> b;
    c = (a + b) / 2.0;
    d = int(c);
    if (c == d)
    {
        cout << d << endl;
    }
    else
    {
        cout << d + 1 << endl;
    }
}

Measured memory_bytes: 3636
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <cctype>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
    int N[3][3] ;
    bool d[3][3];
    
    bool flag = false ;
    for(int i = 0; i <  3 ; i++ ){
        for(int j = 0; j <  3 ; j++ ){
            cin >> N[i][j] ;
            d[i][j] = false ;
      }
    }

    int a ;
    cin >> a ;
    
    int b ;
    for(int k = 0 ; k < a ; k++){
        cin >> b ;
        for(int i = 0; i <  3 ; i++ ){
        for(int j = 0; j <  3 ; j++ ){
           if(b == N[i][j]){
               d[i][j] = true ;
           }

      }
    }

    }

    for(int l = 0; l < 3 ; l++){
        if(d[l][0] == true &&d[l][1]==true&&d[l][2]==true){
            flag = true ;
        }else if(d[0][l] == true &&d[1][l]==true&&d[2][l]==true){
            flag = true ;
        }

    }

    if(d[0][0] == true &&d[1][1]==true&&d[2][2]==true){
        flag = true ;
    }else if(d[0][2] == true &&d[1][1]==true&&d[2][0]==true){
        flag = true ;
    }

    if(flag == true){
        cout <<"Yes" << endl;
    }else{
        cout << "No"<< endl;
    }
    return 0;
}

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    int N;
    cin >> N;
    vector<int> H(N);
    rep(i, N) cin >> H[i];
    vector<int> dp(N, MOD);
    dp[0] = 0;
    rep(i, N) {
        if (i + 1 < N) {
            dp[i + 1] = min(dp[i + 1], dp[i] + abs(H[i + 1] - H[i]));
        }
        if (i + 2 < N) {
            dp[i + 2] = min(dp[i + 2], dp[i] + abs(H[i + 2] - H[i]));
        }
    }
    cout << dp[N - 1] << '\n';
}

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


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

int main(){
  string str;

  while(cin >> str){
    for(int i = 0 ; i < str.length() ; ++i){ 
      if(str[i] == '@'){
	int len = str[i+1] - '0';
	for(int j = 0 ; j < len ; ++j){
	  cout << str[i+2];
	}
	++i;i++;
      }
      else cout << str[i];
    }
    cout << '\n';
  }

  return 0;
}

Measured memory_bytes: 1156
#include<cstdio>
#include<vector>
using namespace std;
const int N=100002;
int n,L,q,x[N],i,j,k,a,b,l,r;
int h[N],t[N],v[N],Ans[N];
int dep[N],p[N];
struct Uzi{
	int d,id;
};
vector<Uzi>g[N];
void add(int a,int b){
	t[++k]=h[a];
	h[a]=k;
	v[k]=b;
}
void init(){
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		scanf("%d",x+i);
	scanf("%d",&L);
	for(l=r=1;l<n;l++){
		while(r<n&&x[r+1]-x[l]<=L)
			r++;
		add(r,l);
	}
}
void dfs1(int i){
	for(int j=h[i];j;j=t[j]){
		dep[v[j]]=dep[i]+1;
		dfs1(v[j]);
	}
}
void dfs(int i){
	p[dep[i]]=i;
	for(int j=0;j<g[i].size();j++){
		if(dep[g[i][j].d]==dep[i])
			Ans[g[i][j].id]=1;
		else{
		if(p[dep[g[i][j].d]]>=g[i][j].d)
			Ans[g[i][j].id]=dep[i]-dep[g[i][j].d];
		else
			Ans[g[i][j].id]=dep[i]-dep[g[i][j].d]+1;
		}
	}
	for(int j=h[i];j;j=t[j])
		dfs(v[j]);
}
void work(){
	scanf("%d",&q);
	for(i=1;i<=q;i++){
		scanf("%d%d",&a,&b);
		if(a>b)
			a^=b^=a^=b;
		g[a].push_back((Uzi){b,i});
	}
	dfs1(n);
	dfs(n);
	for(i=1;i<=q;i++)
		printf("%d\n",Ans[i]);
	//while(1);
}
int main(){
	init();
	work();
	return 0;
}

Measured memory_bytes: 11008
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <deque>
using namespace std;
using P = pair<int,int>;
typedef long long int ll;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define PI 3.14159265359
ll gcd(ll a, ll b) {//最大公約数
    if(a<b){
        ll tmp = a;
        a = b;
        b = tmp; 
    }
    if (b==0) return a;
    else return gcd(b, a%b);
}
ll lcm(ll a, ll b) {//最小公倍数
    return a * b / gcd(a, b);
}

int main() {
    int n; cin >> n;
    vector<int>a(n);
    vector<int>num(n,0);
    for(int i=1; i<n; i++){
        cin >> a[i];
        num[a[i]-1]++;
    }
    rep(i,n){
        cout << num[i] << endl;
    }
    return 0;
}




Measured memory_bytes: 4844
def resolve():
    import sys
    input = sys.stdin.readline
    n, k = list(map(int, input().split()))

    has = set()

    for i in range(k):
        d = input().rstrip()
        x = list(map(int, input().split()))
        for a in x:
            has.add(a)

    count = 0
    for i in range(n):
        if i +1 not in has:
            count += 1
    print(count)

# x = list(map(int, input().split()))

if __name__ == "__main__":
    resolve()


Measured memory_bytes: 67740
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using u32 = uint32_t;
using vb = vector<bool>;   using vvb = vector<vb>;
using vl = vector<ll>;     using vvl = vector<vl>;

#define REP(i,n) for(auto i = 0 * (n), i##_len = (n); i < i##_len; ++i)
#define ALL(c) (c).begin(), (c).end()
#define FOR(i,s,n) for(ll i=s, i##_len=(ll)(n); i<i##_len; ++i)


int main() {
	#ifdef INPUT_FROM_FILE
	ifstream cin("sample.in");
	ofstream cout("sample.out");
	#endif
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(50);

	ll n;
	cin >> n;

	vvl path(n);
	REP(i, n - 1) {
		ll x, y; cin >> x >> y;
		path[x - 1].push_back(y - 1);
		path[y - 1].push_back(x - 1);
	}

	function<ll(ll, ll)> recur = [&](ll cur, ll prev) {
		ll num = 0;
		for (ll next : path[cur]) if (next != prev) {
			num ^= recur(next, cur) + 1;
		}
		return num;
	};
	cout << (recur(0, -1) != 0 ? "Alice" : "Bob") << endl;

	return 0;
}

Measured memory_bytes: 13568
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int h=sc.nextInt();
		int w=sc.nextInt();
		while (h!=0||w!=0){
			StringBuilder sb1=new StringBuilder("");
			StringBuilder sb2=new StringBuilder("");
			for(int m=1;m<w;m+=2)sb1.append("#.");
			for(int m=1;m<w;m+=2)sb2.append(".#");
			if(w%2==1){sb1.append("#");sb2.append(".");
			}
			for(int n=1;n<h;n+=2){
				System.out.println(sb1);
				System.out.println(sb2);
			}
			if(h%2==1)System.out.println(sb1);
			System.out.println("");
			h=sc.nextInt();
			w=sc.nextInt();
		}
	}
}

Measured memory_bytes: 21032
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    int c=1;
    int ans=0;
    while(c<b)
    {
        c--;
        c=c+a;
        //cout<<c<<endl;
        ans++;
        //cout<<ans<<endl;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;

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


Measured memory_bytes: 256
import sys
n, k = [int(i) for i in sys.stdin.readline().split()]
v_ls = [int(i) for i in sys.stdin.readline().split()]
inv_v_ls = v_ls[::-1]
sum_a_b = min(n, k) + 1
best = 0
for a in range(sum_a_b):
    for b in range(sum_a_b - a):
        ls = v_ls[:a] + inv_v_ls[:b]
        ls.sort()
        for c in range(k + 1 - a - b):
            if c >= len(ls):
                break
            score = sum(ls[c:])
            if score > best:
                best = score
            if ls[c] > 0:
                break
print(best)

Measured memory_bytes: 3064
""" A
    https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_a
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return reduce(lambda acc, _: acc + [readIntegerSet(m)], range(0, n), [])

def main(X):
    if X <= 599:
        return 8
    if X <= 799:
        return 7
    if X <= 999:
        return 6
    if X <= 1199:
        return 5
    if X <= 1399:
        return 4
    if X <= 1599:
        return 3
    if X <= 1799:
        return 2
    if X <= 1999:
        return 1

if __name__ == "__main__":
    _X = readInteger()

    print(main(_X))

Measured memory_bytes: 9576
import sys
  
N = 1000000
primes = [1] * (N//2)
primes[0] = 0
  
for i in range(3,int(N**0.5),2):
    if primes[i//2]:
        primes[(i*i)//2::i] = [0] * len(primes[(i*i)//2::i])
  
for i in sys.stdin:
    n = int(i)
    if n < 4:
        print(n-1)
    else:
        print(sum(primes[:(n+1)//2])+1)

Measured memory_bytes: 16972
/**
 *    authur: Bao Trung <3
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define all(x) (x).begin(), (x).end()
#define set_vect(a,n); vector<int>a(n); for(auto &z : a)cin>>z;
const int mod = 1e9+7;
int n,m;
void solve(){
	cin >> n >> m;
	if(n > m) cout << "safe";
	else cout << "unsafe";
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int t = 1; //cin >> t;
	while(t--){solve();}
	return 0;
}

// Code By CodeWar :3

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
int main(){
    long long n,c=0;
    cin>>n;
    long long a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
        c=0;
        while(a[i]%2!=1){
            a[i]/=2;
            c++;
        }
        a[i]=c;
    }
    sort(a,a+n);
    cout<<a[0]<<endl;
    return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    string a,b;
    cin >> a >> b;
    if(a.size() > b.size()){
        cout << "GREATER" << endl;
    }else if(a.size() < b.size()){
        cout << "LESS" << endl;
    }else{
        if(a.compare(b) > 0){
            cout << "GREATER" << endl;
        }else if(a.compare(b) < 0){
            cout << "LESS" << endl;
        }else{
            cout << "EQUAL" << endl;
        }
    }
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int N,A,B;
  char S[200000];
  scanf("%d %d %d\n",&N,&A,&B);
  scanf("%s",S);
  for(int i=0;i<N;i++){
    if(S[i]=='a'){
      if(A+B>0){
        printf("Yes\n");
        if(A>0) A--;
        else B--;
      }else{
        printf("No\n");
      }
    }else if(S[i]=='b'){
      if(B>0){
        printf("Yes\n");
        B--;
      }else{
        printf("No\n");
      }
    }else{
      printf("No\n");
    }
  }
  return 0;
}

Measured memory_bytes: 1732
#include<bits/stdc++.h>
#define mem(a,x) memset(a,x,sizeof(a))
#define lp(k,a) for(int k=1;k<=a;k++)
#define lp0(k,a) for(int k=0;k<a;k++)
#define lpn(k,n,a) for(int k=n;k<=a;k++)
#define lpd(k,n,a) for(int k=n;k>=a;k--)
#define sc(a) scanf("%d",&a)
#define sc2(a,b) scanf("%d %d",&a,&b)
#define ll long long
#define MAX 100000

using namespace std;

char str[200010];
ll a[200010];
int n,m;
ll ji[28];
string s;

int main()
{
   // freopen("in.txt","r",stdin);
    while(cin>>s)
    {
        mem(ji,0);
       int len=s.length();
        ll re=0;
        ll sum=(ll)len*((ll)len-1)/2;

       lp0(i,len)
       {
           ji[s[i]-'a']++;
       }
       lp0(i,26)
       {
           sum-=ji[i]*(ji[i]-1)/2;
       }
        cout<<sum+1<<endl;
    }
    return 0;
}





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

int main(void){
    int n;
    cin >> n;
    int x = ceil(n/1.08);
    if(floor(x*1.08) == n) cout << x << endl;
    else cout << ":(";
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	
	 private static int gcdHelper(int x, int y) {
	        if(y == 0) {
	        	return x;
	        } else {}
	        return gcdHelper(y, x % y);
	    }
	 
    public static void main(String[] args) throws IOException {
        BufferedReader scan = 
        		new BufferedReader(new InputStreamReader(System.in));
        String line = "";
        String[] numArr;
        
        while((line = scan.readLine()) != null) {
        	
        	numArr = line.split(" ");
            int out = gcdHelper(Integer.parseInt(numArr[0]), 
     			   Integer.parseInt(numArr[1]));
        	System.out.println(out);
        	
        }
        }

   
}


Measured memory_bytes: 24108
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;

int gcd(int a, int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a, int b){
    return a/gcd(a,b)*b;
}

string f(string a, string b){
    if(a == "T" && b == "F")return "F";
    return "T";
}

signed main(void) {
    int n;
    cin >> n;
    string ans;
    cin >> ans;
    rep(i,n-1){
        string t;
        cin >> t;
        ans = f(ans, t);
    }
    cout << ans << endl;
}



Measured memory_bytes: 3160
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;//for StringBuilder
class c
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        var s = Console.ReadLine();
        var abc = "ABC";
        int ans = 0;
        for (int i = 0; i < n - 2; i++)
        {
            if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') ans++;
        }
        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 27544
#alds13a
A = input().split(" ")
stack=[]
operator = ["+","-","*"]
for a in A:
    if a not in operator:
        stack.append(int(a))
    else:
        tmp=""
        if a=="+":
            tmp = stack[-2]+stack[-1]
        elif a=="-":
            tmp = stack[-2]-stack[-1]
        else:
            tmp = stack[-2]*stack[-1]
        stack = stack[:-2] + [tmp]
print(stack[0])
    


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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;

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



void func(long long K, std::string S){
    if(S.size() <= K){
        cout<<S<<endl;
    }
    else{
        cout<<S.substr(0,K)<<"..."<<endl;
    }

}

int main(){
    // cout << fixed << setprecision(5);

    long long K;
    scanf("%lld",&K);
    std::string S;
    std::cin >> S;
    func(K, S);
    return 0;
}


Measured memory_bytes: 3680
#include<stdio.h>
#include<stdlib.h>

int main() {
    int h, w;
    char **grid;
    int *exist_black_row, *exist_black_col;
    int i, j;

    scanf("%d%d", &h, &w);

    grid = (char**)malloc(sizeof(char*) * h);
    for(i = 0; i < h; i++) {
        grid[i] = (char*)malloc(sizeof(char) * (w + 1));
        for(j = 0; j < w + 1; j++) {
            grid[i][j] = '\0';
        }
    }

    exist_black_row = (int*)malloc(sizeof(int) * h);
    exist_black_col = (int*)malloc(sizeof(int) * w);
    for(i = 0; i < h; i++) exist_black_row[i] = 0;
    for(j = 0; j < w; j++) exist_black_col[j] = 0;

    for(i = 0; i < h; i++) {
        scanf("%s", grid[i]);
    }

    for(i = 0; i < h; i++) {
        for(j = 0; j < w; j++) {
            if(grid[i][j] == '#') {
                exist_black_row[i] = 1;
                exist_black_col[j] = 1;
            }
        } 
    }

    for(i = 0; i < h; i++) {
        for(j = 0; j < w; j++) {
            if(exist_black_row[i] && exist_black_col[j]) {
                printf("%c", grid[i][j]);
            }
        }
        if(exist_black_row[i]) printf("\n");
    }

    for(i = 0; i < h; i++) free(grid[i]);
    free(grid);

    free(exist_black_row);
    free(exist_black_col);

    return 0;
}


Measured memory_bytes: 1676
/*
 * a.cpp
 *
 *  Created on: 2019/06/08
 *      Author: MEIP-users
 */




#include <bits/stdc++.h>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#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 REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1e9+10)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))


int main() {
	int s, k;
	cin >> s >> k;

	if (k>=s){
		cout << "unsafe" << endl;
	}else{
		cout << "safe" << endl;
	}


	return 0;
}


Measured memory_bytes: 3628
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define int ll
#define double long double
#define nn '\n'
#define YES {cout<<"YES"<<'\n';}
#define NO {cout<<"NO"<<'\n';}
#define Yes {cout<<"Yes"<<'\n';}
#define No {cout<<"No"<<'\n';}
#define yes {cout<<"yes"<<'\n';}
#define no {cout<<"no"<<'\n';}
void YN(bool flg){cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg){cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg){cout<<(flg?"yes":"no")<<'\n';}
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
#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 out(n) {cout << n << '\n';}
typedef vector<int> VI;
typedef vector<VI> VVI;
const int MOD = 1000000007;
const long long INF = 10e10;
const double PI = acos(-1.0);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n /= 2; }return r; }
int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*素因数分解*/map< int, int >prime_factor(int n){map< int, int > ret;for(int i = 2; i * i <= n; i++) {while(n % i == 0) {ret[i]++;n /= i;}}if(n != 1) ret[n] = 1;return ret;}
/*約数列挙*/vector<int> divisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------ライブラリとか----------------

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(15);

    int a,b,c,d,e; cin >> a >> b >> c >> d >> e;
    int ans = ( (a+9)/10 + (b+9)/10 + (c+9)/10 + (d+9)/10 +(e+9)/10 ) * 10;
    int m;
    if(a%10!=0)chmax(m,10-a%10);
    if(b%10!=0)chmax(m,10-b%10);
    if(c%10!=0)chmax(m,10-c%10);
    if(d%10!=0)chmax(m,10-d%10);
    if(e%10!=0)chmax(m,10-e%10);
    out(ans-m);

    return 0;
}

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

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}

// 素因数の列挙 
// 計算量O(√n)
vector<ll> primes(ll n) {
    vector<ll> res;
    for(ll i = 2; i * i <= n; ++i) {
      if(n % i == 0) res.push_back(i);
      while( n % i == 0) {
          n /= i;
      }
    }
    if (n != 1) res.push_back(n);
    return res;
}

int main() {
    ll a, b, div;
    cin >> a >> b;
    div = gcd(a, b);

    vector<ll> res = primes(div);

    cout << res.size() + 1 << endl;
    return 0;
}

Measured memory_bytes: 256