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

using namespace std;

int n;
char c[200];
int numz,numy;

int main()
{
	scanf("%d",&n);
	int aa=0,bb=0;
	for(int i=1;i<=n;i++)
	{
		cin>>c[i];
	}
	for(int i=1;i<=n;i++)
	{
		if(c[i]==')')
		{
			if(bb==0)numz++;
			else bb--;
		}
		if(c[i]=='(')bb++;
	}
	aa=0;bb=0;
	for(int i=n;i>=1;i--)
	{
		if(c[i]=='(')
		{
			if(aa==0)numy++;
			else aa--;
		}
		if(c[i]==')')aa++;
	}
	//cout<<numy<<endl;
	for(int i=1;i<=numz;i++)cout<<'(';
	for(int i=1;i<=n;i++)cout<<c[i];
	for(int i=1;i<=numy;i++)cout<<')';
	return 0;
} 

Measured memory_bytes: 256
<?php
  list($n) = explode(" ", trim(fgets(STDIN)));

  for($i=1; $i<=9; $i++){
    for($j=1; $j<=9; $j++){
      if($n == $i*$j) {
        echo 'Yes';
        exit;
      }
    }
  }
  echo 'No';

Measured memory_bytes: 16204
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void push(int);
int pop();
int isEmpty();
int isFull();
int initialize();
int top,MAX=100,S[100];

int main(){
  char s[100];
  int i=1;
  int a,b;
  int top=0;
  int x;
  while(scanf("%s",&s)!=EOF){
    if(s[0]=='+'){
      a=pop();
      b=pop();
      push(b+a);
    }
    else if(s[0]=='-'){
      a=pop();
      b=pop();
      push(b-a);
    }
    else if(s[0]=='*'){
      a=pop();
      b=pop();
      push(b*a);
    }
    else {
    x = atoi(s);
    push(x);
    }
  }
  printf("%d\n",pop());
  return 0;
}
/*int initialize(){                                                             
  top=0;                                                                        
}                                                                               
int isEmpty(){                                                                  
  return top==0;                                                                
}                                                                               
int isFull(){                                                                   
  return top>=MAX-1;                                                            
}                                                                               
*/
void push(int x){
  //if(isFull())exit(2);                                                        
  top++;
  S[top]=x;
}
int pop(){
  //if(isEmpty())exit(2);                                                       
  top--;
  return S[top+1];
}




Measured memory_bytes: 2108
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main {

	int INF = 1 << 28;
	int MAX = 7;
	int MAXL = 50;
	int h, w, n;
	char[][] map;
	Unknown[] unknowns;

	void run() {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		for(;t>0;t--) {
			h = sc.nextInt();
			w = sc.nextInt();
			if( (h|w) == 0 ) break;
			
			map = new char[h][w];
			unknowns = new Unknown[MAX];
			n = 0;
			for(int i=0;i<h;i++) {
				String str = sc.next();
				for(int j=0;j<w;j++) {
					map[i][j] = str.charAt(j);
					if( map[i][j] != '.' ) {
						char c = map[i][j];
						for(int k=0;k<n;k++) {
							if( c == unknowns[k].c) {
								c = '#';
								unknowns[k].set(j, i);
								break;
							}
						}
						if( c != '#' ) {
							unknowns[n] = new Unknown(c);
							unknowns[n++].set(j,i);
						}
					}
				}
			}
			
			System.out.println( (isRect()? "SAFE": "SUSPICIOUS") );
		}
	}
	
	boolean isRect() {
		HashMap<Character, Integer> char2int = new HashMap<Character, Integer>();
		for(int i=0;i<n;i++) {
			char2int.put(unknowns[i].c, i);
			for(int x=unknowns[i].minx;x<=unknowns[i].maxx;x++)
			for(int y=unknowns[i].miny;y<=unknowns[i].maxy;y++) {
				if(map[y][x] == '.') {
					return false;
				}
				if(unknowns[i].c != map[y][x]) unknowns[i].on(map[y][x]);
			}		
		}
		
		for(int i=0;i<n;i++) {
			boolean[] visited = new boolean[n];
			LinkedList<Integer> que = new LinkedList<Integer>();
			for(char c: unknowns[i].on) que.add(char2int.get(c));
			while(!que.isEmpty()) {
				int now = que.removeFirst();
//				debug(i, now);
				if(now == i) return false;
				for(char c: unknowns[now].on) if(!visited[char2int.get(c)]){
					visited[char2int.get(c)] = true;
					que.add(char2int.get(c));
				}
			}
		}
		
		return true;
	}
	
	class Unknown {
		char c;
		int minx, miny, maxx, maxy;
		HashSet<Character> on;
		Unknown(char c) {
			on = new HashSet<Character>();
			minx = miny = MAXL;
			maxx = maxy = 0;
			this.c = c;
		}
		void set(int x, int y) {
			minx = min(minx, x);
			miny = min(miny, y);
			maxx = max(maxx, x);
			maxy = max(maxy, y);
		}
		void on(char c) {
			on.add(c);
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}

	void debug(Object... os) {
		System.err.println(Arrays.deepToString(os));
	}
}

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


int main(){
    vector <int>  ans(3);
    rep(i,3)cin>>ans.at(i);
    sort(ans.begin(),ans.end());
    cout<<ans.at(0)<<" "<<ans.at(1)<<" "<<ans.at(2)<<endl;
}



Measured memory_bytes: 3104
#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main()
{
    double r,area,circumference;

    cin >> r;

    area = M_PI*r*r;

    circumference = 2*M_PI*r;

    cout << fixed << setprecision(5) << area <<" " <<circumference << endl;

    return 0;
}



Measured memory_bytes: 3244
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(int i=0;i<n;i++)
#define int long long
#define ggr getchar();getchar();return 0;
#define prique priority_queue
#define mod 1000000007
#define inf 1e15
using namespace std;
typedef pair<int, int>P;
void yes() { cout << "Yay!" << endl; }
void no() { cout << ":(" << endl; }
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y)* mod_pow(kai(y, y), mod - 2, mod) % mod;
}
struct edge { int to, cost; };
signed main() {
	puts("square1001");
	ggr
}



Measured memory_bytes: 3032
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	string S;
	scan(S);
	int now=0,maxu=0;
	rep(i,S.size()){
		if(S[i]=='A'||S[i]=='G'||S[i]=='C'||S[i]=='T') now++;
		else now=0;
		maxu=max(now,maxu);
	}
	prin(maxu);
	return 0;
}


Measured memory_bytes: 256
#テストファイルで実行する時
import sys
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')


w,h,n = map(int,input().split())

l = [list(map(int,input().split())) for i in range(n)]

minx = 0
maxx = w
miny = 0
maxy = h


for i in range(n):
	if   l[i][2] == 1:
		if minx < l[i][0]:
			minx = l[i][0]

	elif l[i][2] == 2:
		if maxx > l[i][0]:
			maxx = l[i][0]
	
	elif l[i][2] == 3:
		if miny < l[i][1]:
			miny = l[i][1]	
	
	elif l[i][2] == 4:
		if maxy > l[i][1]:
			maxy = l[i][1]
			
ans = (maxx-minx)*(maxy-miny)		

if (maxx-minx)<0:
	ans = 0
elif (maxy-miny)<0:
	ans = 0
			
print(ans)


Measured memory_bytes: 3064
#pragma warning(disable:4786)
#pragma warning(disable:4996)
#include<list>
#include<bitset>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<functional>
#include<string>
#include<cstring>
#include<cstdlib>
#include<queue>
#include<utility>
#include<fstream>
#include<sstream>
#include<cmath>
#include<stack>
#include<assert.h>
using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))
#define CLR(a) memset(a, 0, sizeof(a))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ABS(X) ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X) ( (X) * (X) )
#define SZ(V) (int )V.size()
#define FORN(i, n) for(i = 0; i < n; i++)
#define FORAB(i, a, b) for(i = a; i <= b; i++)
#define ALL(V) V.begin(), V.end()
#define IN(A, B, C)  ((B) <= (A) && (A) <= (C))

typedef pair<int,int> PII;
typedef pair<double, double> PDD;
typedef vector<int> VI;
typedef vector<PII > VP;

#define AIN(A, B, C) assert(IN(A, B, C))

//typedef int LL;
typedef long long int LL;
//typedef __int64 LL;

char S[2][100005];
int seg[2][4 * 100005];
int len[3];

int q;

int process(int a, int b) {
	if (a == -1) return b;
	if (b == -1) return a;
	if (a == b) return a ^ 1;
	return -1;
}

int build(int id, int at, int l, int r) {
	if (l == r) {
		seg[id][at] = S[id][l] - 'A';
		return seg[id][at];
	}

	int m = (l + r) / 2;
	int a = build(id, at * 2, l, m);
	int b = build(id, at * 2 + 1, m + 1, r);
	return seg[id][at] = process(a, b);
}

int query(int id, int at, int l, int r, int L, int R) {
	if (R < l || r < L) return -1;
	if (L <= l && r <= R) {
		return seg[id][at];
	}
	int m = (l + r) / 2;
	int a = query(id, at * 2, l, m, L, R);
	int b = query(id, at * 2 + 1, m + 1, r, L, R);
	return process(a, b);

}

int main()
{
	scanf("%s %s", S[0], S[1]);
	len[0] = strlen(S[0]);
	len[1] = strlen(S[1]);
	build(0, 1, 0, strlen(S[0]) - 1);
	build(1, 1, 0, strlen(S[1]) - 1);
	scanf("%d", &q);

	while (q--) {
		int a, b;
		scanf("%d %d", &a, &b);
		a--, b--;
		int q = query(0, 1, 0, len[0] - 1, a, b);
		scanf("%d %d", &a, &b);
		a--, b--;
		int q2 = query(1, 1, 0, len[1] - 1, a, b);

		if (q == q2) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}


Measured memory_bytes: 2816
#include <bits/stdc++.h>
#define REP(i,n) for (long long i=0;i<(n);i++)
#define FOR(i,a,b) for (long long i=(a);i<(b);i++)
#define RREP(i,n) for(long long i=n;i>=0;i--)
#define RFOR(i,a,b) for(long long i=(a);i>(b);i--)
#define dump1d_arr(array) REP(i,array.size()) cerr << #array << "[" << (i) << "] ==> " << (array[i]) << endl
#define dump2d_arr(array) REP(i,array.size()) REP(j,array[i].size()) cerr << #array << "[" << (i) << "]" << "[" << (j) << "] ==> " << (array[i][j]) << endl
#define dump(x)  cerr << #x << " => " << (x) << endl
#define dumpP(p) cerr << "( " << p.first << " , " << p.second << " )" << ends
#define SORT(c) sort((c).begin(),(c).end())
#define MIN(vec) *min_element(vec.begin(), vec.end())
#define MAX(vec) *max_element(vec.begin(), vec.end())
#define UNIQ(vec) vec.erase(unique(vec.begin(), vec.end()),vec.end()) //ソートの必要あり
#define IN(n,m)  (!(m.find(n) == m.end()))
#define ENUM(m) for (auto itr = m.begin(); itr != m.end(); ++itr)
#define dump_MAP(m) for(auto itr = m.begin(); itr != m.end(); ++itr) { cerr << itr->first << " --> "  << itr->second << endl; }
#define FINDL(vec,x) (lower_bound(vec.begin(),vec.end(),x) - vec.begin())
#define FINDU(vec,x) (upper_bound(vec.begin(),vec.end(),x) - vec.begin())
#define ROUND(N) setprecision(N)
#define ROUND_PRINT(N,val) cout << fixed;cout << setprecision(N) << val << endl
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()

using namespace std;
constexpr long double pi = M_PI;
constexpr double eps = 1e-10;
constexpr long mod = 1000000007;
constexpr short shINF = 32767;
constexpr long loINF = 2147483647;
constexpr long long llINF = 9223372036854775807;
typedef long long LL;
typedef vector<LL> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<LL,LL> pr;
typedef vector<pr> VP;
struct Order {
	bool operator() (pr const& a,pr const& b) const {
		return a.first > b.first || ((a.first == b.first) && (a.second > b.second));
	}
};

int main(void) {
	long N,C;
	cin >> N >> C;
	VVI D(C,VI(C));
	VVI c(N,VI(N));
	REP(i,C) REP(j,C) cin >> D[i][j];
	REP(i,N) REP(j,N) cin >> c[i][j];

	VVI cnt(3,VI(C,0));
	FOR(i,1,C+1) {
		REP(x,N) {
			REP(y,N) {
				if (c[x][y] != i) cnt[(x+y)%3][i-1] += D[c[x][y]-1][i-1];
			}
		}
	}
	LL ans = llINF;
	REP(i,C) {
		REP(j,C) {
			if (i == j) continue;
			REP(k,C) {
				if (i == k || j == k) continue;
				ans = min((cnt[0][i] + cnt[1][j] + cnt[2][k]),ans);
			}
		}
	}
	cout << ans << endl;
}





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

int main()
{

	int n,m,a,b;
	cin>>n>>m;
	cin>>a>>b;
	cout<<n*m-min(a,b)*min(a,b)-a*(m-min(a,b))-b*(n-min(a,b))<<endl;
	return 0;
}

Measured memory_bytes: 256
use std::io::*;
 use std::str::FromStr;
 use std::collections::HashMap;
     
 #[allow(dead_code)]
 fn read<T: FromStr>() -> T {
 	let stdin = stdin();
 	let stdin = stdin.lock();
	let token: String = stdin
 		.bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
     token.parse().ok().expect("failed to parse token")
}
     
 fn main() {
	let n = read();
    let k = read();
    let mut a = vec![0; n];
    let mut cnts = HashMap::<usize, usize>::new();
    for i in 0..n {
 		a[i] = read();
		let mut counter = cnts.entry(a[i]).or_insert(0);
        *counter += 1;
     }
     let mut cnts = cnts.values().cloned().collect::<Vec<usize>>();
     cnts.sort();
     cnts.reverse();
     let ans: usize = cnts.iter().skip(k).sum();
     println!("{}", ans);
}

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

int main()
{
    int n,i,j;
    cin>>n;
    vector<int>v(n);
    for(i=0;i<n;i++)
    {
        cin>>v[i];
    }
    int q;
    cin>>q;
    while(q--)
    {
        int k;
        cin>>k;
    pair<vector<int>::iterator,vector<int>::iterator> p=equal_range(v.begin(),v.end(),k);
    cout<<p.first-v.begin()<<" "<<p.second-v.begin()<<endl;
    }
    return 0;
}



Measured memory_bytes: 3104
import sys
read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs= sys.stdin.buffer.readlines
#rstrip().decode('utf-8')

#import math
import numpy as np
#import operator
#import bisect
#from heapq import heapify,heappop,heappush
#from math import gcd
#from fractions import gcd
#from collections import deque
#from collections import defaultdict
#from collections import Counter
#from itertools import accumulate
#from itertools import groupby
#from itertools import permutations
#from itertools import combinations
#from scipy.sparse import csr_matrix
#from scipy.sparse.csgraph import floyd_warshall
#from scipy.sparse.csgraph import csgraph_from_dense
#from scipy.sparse.csgraph import dijkstra
#sys.setrecursionlimit(10**7)

#map(int,input().split())

def main():
	x,y,z,k=map(int,input().split())
	ABC=np.array(read().split(),np.int64)
	A=ABC[:x]
	B=ABC[x:-z]
	C=ABC[-z:]
	AB=np.add.outer(A,B)
	AB=AB.ravel()
	AB.sort()
	AB=AB[-k:]
	
	ans=np.add.outer(AB,C)
	ans=ans.ravel()
	ans.sort()
	
	for i in range(k):
		print(ans[-i-1])
	
if __name__ == '__main__':
	main()

Measured memory_bytes: 44112
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=5e5+10;

int gi() {
	int x=0,o=1;char ch=getchar();
	while(!isdigit(ch)&&ch!='-') ch=getchar();
	if(ch=='-') o=-1,ch=getchar();
	while(isdigit(ch)) x=x*10+ch-'0',ch=getchar();
	return x*o;
}

int n,a[N],nxt[N];
set<int> pos[N];
bool vis[N];
ll k;

void work(int s,int len) {
	//cerr<<s<<' '<<len<<endl;
	//exit(0);
	vector<int> v,ans;
	while(len--) v.push_back(a[s]),s=(s+1)%n;
	memset(vis,0,sizeof(vis));
	for(auto x:v) {
		if(!vis[x]) vis[x]=1,ans.push_back(x);
		else {
			while(ans.back()!=x) vis[ans.back()]=0,ans.pop_back();
			vis[ans.back()]=0,ans.pop_back();
		}
	}
	for(auto x:ans) cout<<x<<' ';
	exit(0);
}

int main() {
	cin>>n>>k;k*=n;
	for(int i=0;i<n;i++) a[i]=gi(),pos[a[i]].insert(i);
	for(int i=0;i<n;i++) {
		auto it=pos[a[i]].upper_bound(i);
		if(it==pos[a[i]].end()) nxt[i]=*pos[a[i]].begin()+1;
		else nxt[i]=*it+1;
	}
	int u=0;
	while(1) {
		if(vis[u]) {
			ll pre=0;
			for(int i=nxt[0],j=0;;j=i,i=nxt[i]) {
				ll tmp=pre;
				if(i<=j+1) pre+=i-j+n;
				else pre+=i-j;
				//cerr<<i<<' '<<pre<<endl;
				if(pre>=k) {
					//cerr<<i<<' '<<j<<endl;
					//cerr<<k<<' '<<tmp<<endl;
					work(j,k-tmp);
				}
				if(i==u) break;
			}
			k-=pre;
			//cerr<<k;
			ll len=0;
			for(int i=nxt[u],j=u;;j=i,i=nxt[i]) {
				if(i<=j+1) len+=i-j+n;
				else len+=i-j;
				if(i==u) break;
			}
			k%=len;pre=0;
			for(int i=nxt[u],j=0;;j=i,i=nxt[i]) {
				ll tmp=pre;
				if(i<=j+1) pre+=i-j+n;
				else pre+=i-j;
				if(pre>=k) {
					work(j,k-tmp);
				}
			}
		}
		vis[u]=1,u=nxt[u];
	}
	return 0;
}


Measured memory_bytes: 39288
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/indexed.hpp>

using namespace std;
using namespace boost::adaptors;
using namespace std::string_literals;
using ll = int64_t;
using vecint = vector<int>;
using vecll = vector<ll>;
using boost::irange;

int main()
{
  ll k;
  cin>>k;
  vecll a(k);
  for(auto&& e:a)cin>>e;
  ll mn = 2, mx = 2 + a.back() - 1;
  bool ok = a.back() == 2;
  a.pop_back();
  boost::reverse(a);
  for(auto&& e:a) {
    ll nxn = (mn + e - 1) / e * e;
    if (nxn > mx) ok = false;
    ll nxx = mx - mx % e + e - 1;
    mn = nxn;
    mx = nxx;
  }
  if (ok) {
    cout<<mn<<' '<<mx<<endl;
  } else {
    cout<<-1<<endl;
  }
  return 0;
}


Measured memory_bytes: 1024
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 205
#define inf 1e9
#define eps 1e-10
using namespace std;

inline int read()
{
	int x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}

char mp[maxn][maxn];
int vis[maxn],dep[maxn],ans,n;

inline void dfs(int x)
{
	vis[x]=1; queue <int> q; q.push(x);
	while(!q.empty())
	{
		int u=q.front(); q.pop();
		for(int i=1;i<=n;i++)
		{
			if(mp[u][i]=='1'&&vis[i]==0)
				dep[i]=dep[u]+1,q.push(i),vis[i]=1;
		}
	}
}

int main()
{
	n=read(); ans=-1;
	for(int i=1;i<=n;i++) scanf("%s",mp[i]+1);
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++) vis[j]=0,dep[j]=0;
		dep[i]=1; dfs(i); int f=0;
		for(int x=1;x<=n;x++)
		{
			for(int y=1;y<=n;y++)
			{
				if(mp[x][y]=='1'&&abs(dep[x]-dep[y])!=1)
				{
					f=1; break;
				}
			}
		}
		//cout<<i<<endl;
		//for(int j=1;j<=n;j++) cout<<dep[j]<<" "; cout<<endl;
		if(f==0)
		{
			int cnt=0;
			for(int j=1;j<=n;j++) cnt=max(cnt,dep[j]);
			ans=max(ans,cnt);
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<vector<int> > vvi;
typedef vector<int> vi;
typedef vector<string> vs;
int main() {
	ll x;
	cin >> x;
	cout << (x / 11) * 2  +(ll)ceil((double)(x%11)/6.0)<< endl;

};

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,1};
const int dy[6] = {0, 1, 0, -1,1,-1};
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; }
// ---------------------------------------------------------------------------

// snukeさんのmodint
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

// mint N;
//cout << N.x << endl;



int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i,N) cin >> A[i];
    sort(A.begin(),A.end());
    vector<mint> two(N+1);
    two[0] = 1;
    rep(i,N) two[i+1] = two[i] * 2;
    mint ans = 0;
    rep(i,N){
        int l = i;
        int r = N-l-1;
        mint now = two[r];
        if(r != 0) now += two[r-1] * r;
        now *= two[l];
        now *= A[i];
        ans += now;
    }
    ans *= two[N];
    cout << ans.x << enld;
    return 0;
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x)    scanf("%d",&x)
#define sl(x)    scanf("%lld",&x)
#define ss(s)    scanf("%s",s)
#define pi(x)    printf("%d\n",x)
#define pl(x)    printf("%lld\n",x)
#define ps(s)    printf("%s\n",s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define in insert
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
typedef pair<int, int>    pii;
typedef pair<ll, ll>      pl;
typedef vector<int>       vi;
typedef vector<ll>        vl;
typedef vector<pii>       vpii;
typedef vector<pl>        vpl;
typedef vector<vi>        vvi;
typedef vector<vl>        vvl;
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
#define MAXN   20000001 
int rng(int lim) {
    uniform_int_distribution<int> uid(0,lim-1);
    return uid(rang);
}

int mpow(int base, int exp); 
void ipgraph(int n, int m);
void dfs(int u, int par);

const int mod = 1'000'000'007;
const int N = 3e5, M = N;



void solve(){
    ll n;
    cin>>n;
    string ans;
    while(n>=1){
    ll rem=(n-1)/26;
    ans.pb(((n-1)%26)+'a');
    n=rem;
    }
    for(ll i=ans.size()-1;i>=0;--i)
    {
        cout<<ans[i];
    }
    cout<<endl;
}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int t = 1;
   // cin >> t;
    while(t--) {
      solve();
    }

    return 0;
}

vl g[N];


int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}

void ipgraph(int n, int m){
    int i, u, v;
    while(m--){
        cin>>u>>v;
    u--, v--;
        g[u].pb(v);
        g[v].pb(u);
    }
}

void dfs(int u, int par){
    for(int v:g[u]){
        if (v == par) continue;
        dfs(v, u);
    }
}


Measured memory_bytes: 10684
#include <bits/stdc++.h>
using namespace std;
int A,B,C,x,y;
int main(){
	scanf("%d%d%d%d%d",&A,&B,&C,&x,&y);
	int ans=1e9;
	for (int i=0;i<=max(x,y);i++)
		ans=min(ans,i*C*2+max(x-i,0)*A+max(y-i,0)*B);
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 256
// Charan Sriramula

#include<bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long int ll;

const ll logx=30;
const ll N=2e5+5;
const ll M=1e3+5;
const ll mod=1e9+7;
const ll INF=1e18+5;
const double PI = 3.14159265358979323846;

#define ints(n) scanf("%d",&n)
#define intp(n) printf("%d\n",n)
#define longs(n) scanf("%intd",&n)
#define longp(n) printf("%intd\n",n)

inline ll mul(ll a, ll b,ll p){ return (a * 1ll * b) % p; }
inline ll sub(ll a, ll b,ll p){ ll c = a - b; if(c < 0) c += p; return c; }
inline ll add(ll a, ll b,ll p){ ll c = a + b; if(c > p) c -= p; return c; }

#define f first
#define s second
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define mp(x,y) make_pair(x,y)
#define GCD(a,b) __gcd((a),(b))
#define all(v) v.begin(),v.end()
#define bits(x) __builtin_popcountll(x)
#define LCM(a,b) ((a)*(b))/GCD((a),(b))
#define ms(dp,val) memset(dp,val,sizeof(dp))
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
template<typename T> T power(T x,T y,ll m){T ans=1;while(y>0){if(y&1LL) ans=(ans*x)%m;y>>=1ll;x=(x*x)%m;}return ans%m;}

#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl

ll n,m,a[N];

int main()
{
  ll sum=0;
  cin>>n>>m;
  vector<pair<ll,ll> > v;
  for(ll i=0;i<n;i++){cin>>a[i];}
  sort(a,a+n);
  for(ll i=0;i<m;i++)
  {
    ll b,c;
    cin>>b>>c;
    v.pb(mp(c,b));
  }
  ll idx=0;
  sort(all(v));
  reverse(all(v));
  for(ll i=0;i<n;i++)
  {
    if(idx>=m){sum+=a[i];}
    else
    {
      ll maxi=max(a[i],v[idx].f);
      sum+=maxi;
      v[idx].s--;
      if(v[idx].s==0){idx++;}
    }
  }
  cout<<sum<<endl;
}


Measured memory_bytes: 3188
#include<iostream>
#include<iomanip>
#include<math.h>

using namespace std;

typedef struct{
    double x,y;
}Point;

int main()
{

    Point p1,p2;

    cin>>p1.x>>p1.y>>p2.x>>p2.y;

    cout<<fixed<<setprecision(5)<<sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y))<<endl;

    return 0;
}



Measured memory_bytes: 3292
n = int(input())
l = list(map(int,input().split()))
ans = 0
for i in range(len(l)-2):
    for j in range(i+1,len(l)-1):
        for k in range(j+1,len(l)):
            if l[i] != l[j] and l[j] != l[k] and l[k] != l[i] and 2 * max(l[i],l[j],l[k]) < l[i]+l[j]+l[k]:
                ans += 1
print(ans)

Measured memory_bytes: 9144
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define mrep(i,j,n) for(int i = j; i < n; i++)
#define reps(i,n) for(int i = 1; i <= n; i++)
#define rrep(i,n) for(int i = n-1; i >= 0; i--)
#define mreps(i,j,n) for(int i = j; i <= n; i++)
#define rreps(i,n) for(int i = n; i >= 1; i--)
#define co(x) cout << x <<endl
#define cs(x) cout << x <<" "
#define el cout << endl
#define sp(x) cout << setprecision(x);
#define cer(x) cerr << x <<endl
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define ERASE(x,val) x.erase(remove(ALL(x), val), x.end())
#define vi vector<int> 
#define vvi vector<vector<int>> 
#define pii pair<int,int>
#define vpii vector<pair<int,int>> 
#define vl vector<ll> 
#define vvl vector<vector<ll>> 
#define vd vector<double> 
#define vvd vector<vector<double>> 
#define vb vector<bool> 
#define vvb vector<vector<bool>>
#define vs vector<string>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
ll mod = 1e9 + 7;
int inf_i = 1001001000;
ll inf_l = 1001001001001000;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a * b / g; }
bool is_prime(ll x) { for (ll i = 2; i * i <= x; i++) { if (x % i == 0)return false; } return true; }

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n; cin >> n;
	map<int, int> pf;
	reps(i, n)
	{
		int k = i;
		for (int j = 2; j*j <= k; j++)
		{
			int num = 0;
			while (k%j==0)
			{
				k /= j;
				num++;
			}
			pf[j] += num;
		}
		if (k > 1)pf[k]++;
	}
	int n_i[80] = {};
	for (auto e : pf)
	{
		reps(i, 79)if (e.second >= i)n_i[i]++;
	}
	int ans = n_i[74] + n_i[24] * (n_i[2] - 1) + n_i[14] * (n_i[4] - 1)
		+ n_i[4] * (n_i[4] - 1) * (n_i[2] - 2) / 2;
	co(ans);
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#include<cstdio>
#define el "\n"
#define sp " "
typedef long long ll;



main()
{
	ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s,r;
cin>>s;
r=s;
reverse(r.begin(),r.end());
deque<char> dq,rdq;
for(ll i=0;i<s.length();i++)
{
	dq.push_back(s[i]);
	rdq.push_back(r[i]);
}
ll q;
cin>>q;
ll a,b;
char c;
ll y=0;

while(q--)
{
	cin>>a;
	if(a==1)
	{
		if(y==0)
		y=1;
		else
		y=0;
	}
	else
	{
		cin>>b>>c;
		
		
		if((y==0 && b==1 )|| (y==1 && b==2))
		{
			dq.push_front(c);	//s=c+s;
			rdq.push_back(c);					//r=r+c;
		}
		else
		{
			rdq.push_front(c);	//s=c+s;
			dq.push_back(c);
		}
	}
		
		
	}
	
//cout<<el;
if(y==0)
{
	for(auto i: dq)
	cout<<i;
}
else
for(auto i: rdq)
	cout<<i;
}

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



int main() {
    int r, D, x2000;
    cin >> r >> D >> x2000;
    int x[10];

    x[0] = r * x2000 - D;
    for (int i = 1; i < 10; i++) {
        x[i] = r * x[i-1] - D;
    }

    rep(i,10) {
        cout << x[i] << endl;
    }

    return 0;
}

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

vector<int> d(100), f(100), color(100);
vector<vector<int> > adj(100);
int n, m, t;
bool has_loop;

#define WHITE 0
#define GRAY 1
#define BLACK 2

void dfs(int i)
{
	color[i] = GRAY;
	d[i] = ++t;
	for(int j = 0; j < adj[i].size(); j++){
		if(color[adj[i][j]] == GRAY) has_loop = true;
		if(color[adj[i][j]] == WHITE){
			dfs(adj[i][j]);
		}
	}
	color[i] = BLACK;
	f[i] = ++t;
}

int main()
{
	scanf("%d %d", &n, &m);
	int i, s, t;
	for(i = 0; i < m; i++){
		scanf("%d %d", &s, &t);
		adj[s].push_back(t);
	}
	for(i = 0; i < n; i++){ color[i] = WHITE; }

	t = 0;
	has_loop = false;
	for(i = 0; i < n; i++){ if(color[i] == WHITE){ dfs(i); } }

	(has_loop ? printf("1\n") : printf("0\n"));

	return 0;
}

Measured memory_bytes: 1200
import sys

H, W, D = map(int, sys.stdin.readline().split())
num = {}
for j in range(H):
    tmp = map(int, sys.stdin.readline().split())
    for i, n in enumerate(tmp):
        num[n] = (i, j)

# Dで分類した累積和
# S[initial % D][j], n = r + D*j
S = [0 for _ in range(H*W+D)]
for i in range(D+1, H*W+1):
    x, y = num[i]
    a, b = num[i-D]
    S[i] = S[i-D] + abs(x - a) + abs(y - b)
# print(S)
Q = int(sys.stdin.readline())
for _ in range(Q):
    L, R = map(int, sys.stdin.readline().split())
    r = L % D
    print(S[R] - S[L])

Measured memory_bytes: 97888
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.io.PrintWriter
import java.util.*

fun PrintWriter.solve(sc: FastScanner) {
    val h = sc.nextInt()
    val w = sc.nextInt()
    val ch = sc.nextInt() - 1
    val cw = sc.nextInt() - 1
    val dh = sc.nextInt() - 1
    val dw = sc.nextInt() - 1
    val s = Array(h) { Array(w) { '.' } }
    for (i in 0 until h) {
        val _s = sc.nextLine()
        for (j in 0 until w) {
            s[i][j] = _s[j]
        }
    }
    val dist = Array(h) { Array(w) { Int.MAX_VALUE } }
    val que = PriorityQueue<Triple<Int, Int, Int>>() { x, y -> return@PriorityQueue x.third - y.third }
    que.add(Triple(ch, cw, 0))
    val visited = Array(h) { Array(w) { false } }
    while (que.count() > 0) {
        val (i, j, d) = que.poll()
        if (visited[i][j]) continue
        dist[i][j] = d
        visited[i][j] = true
        val ai = arrayOf(i - 1, i, i + 1, i)
        val aj = arrayOf(j, j - 1, j, j + 1)
        for (k in 0 until 4) {
            val ni = ai[k]
            val nj = aj[k]
            if (ni in 0 until h && nj in 0 until w && !visited[ni][nj] && s[ni][nj] == '.') {
                que.add(Triple(ni, nj, d))
            }
        }
        val bi = arrayOf(i - 2, i - 1, i, i + 1, i + 2)
        val bj = arrayOf(j - 2, j - 1, j, j + 1, j + 2)
        for (k in 0 until 5) {
            for (l in 0 until 5) {
                val ni = bi[k]
                val nj = bj[l]
                if (ni in 0 until h && nj in 0 until w && !visited[ni][nj] && s[ni][nj] == '.') {
                    que.add(Triple(ni, nj, d + 1))
                }
            }
        }
    }
    println(if (dist[dh][dw] == Int.MAX_VALUE) -1 else dist[dh][dw])
}

fun main() {
    val writer = PrintWriter(System.out, false)
    writer.solve(FastScanner(System.`in`))
    writer.flush()
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}


Measured memory_bytes: 113976
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cout << #x << ": " << x << endl
#define repn(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) for(int i = 0; i < (int)(a); i++)
#define all(v) v.begin(), v.end() 
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define endl '\n'

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

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	int d;
	cin >> d;
	cout << "Christmas";
	rep(i, 25 - d) cout << " Eve";
	cout << endl;
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/


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

int main(){
    int a,b;
    cin >>a>>b;
    int i=0;
    int s;
    while (i<2){
        
        if (a<=b){
            s+=b;
            b--;
        }
        else{
            s+=a;
            a--;
        }
      i++;
        
    }
    cout <<s;
    


}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;


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

template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> p) {
    return os << "{" << p.first << ", " << p.second << "}";
}


int main() {
    int n, k;
    cin >> n >> k;
    vector<int> v(n);
    for (auto &&i : v) scanf("%d", &i), i--;
    vector<int> c(n);
    for (auto &&i : c) scanf("%d", &i);
    ll ans = -INF<int>;
    vector<int> visited(n);
    for (int i = 0; i < n; ++i) {
        if(visited[i]) continue;
        vector<int> a;
        a.emplace_back(i);
        a.emplace_back(v[i]);

        visited[i] = 1;
        visited[v[i]] = 1;
        while(a.back() != i){
            a.emplace_back(v[a.back()]);
            visited[a.back()] = 1;
        }
        a.pop_back();
        vector<ll> aa{0};
        ll S = 0;
        for (auto &&j : a) aa.emplace_back(aa.back()+c[j]), S += c[j];
        for (auto &&j : a) aa.emplace_back(aa.back()+c[j]);
        for (int j = 0; j < a.size(); ++j) {
            for (int l = 1; l <= min<int>(a.size(),k); ++l) {
                ans = max(ans, aa[j+l]-aa[j]);
            }
        }
        if(k/a.size()){
            for (int j = 0; j < a.size(); ++j) {
                for (int l = 0; l <= a.size(); ++l) {
                    ans = max(ans, aa[j+l]-aa[j]+(k-l)/(int)a.size()*S);
                }
            }
        }

    }
    cout << ans << "\n";
    return 0;
}

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

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

Measured memory_bytes: 256
s = gets.chomp.split("")
t = gets.chomp.split("")

S = []
T = []

s.uniq.each do |i|
	S << s.count(i)
end

t.uniq.each do |i|
	T << t.count(i)
end

S.sort!
T.sort!

if S == T
	puts "Yes"
else
	puts "No"
end

Measured memory_bytes: 22780
# import numpy as np
# import collections

n,m = map(int,input().split())
h = list(map(int,input().split()))

ab = []
#not_f = []
for i in range(m):
    a,b = map(int,input().split())
    ab.append(sorted([a,b]))
    #not_f = not_f + [a,b]

# c = collections.Counter(not_f)   #m*2要素
# c = sorted(c.items(), key=lambda x:x[1])

# count = 0
# for j in c:
#     if j[1] == 0:
#         count += 1
#     else:
#         break

ans = 0

# height_rank = np.zeros(n)

make = []

for i in ab:
    if h[i[0]-1] < h[i[1]-1]:
        #height_rank[i[1]-1] +=  1
        #height_rank.pop(i[0]-1)
        #np.delete(height_rank,i[0]-1,axis = 1)
        make.append(i[0])
    elif h[i[0]-1] > h[i[1]-1]:
        make.append(i[1])
        #height_rank[i[0]-1] +=  1
        #height_rank.pop(i[1]-1)
        #np.delete(height_rank,i[1]-1,axis = 1)

    elif h[i[0]-1] == h[i[1]-1]:
        make.append(i[0])
        make.append(i[1])
        # height_rank.pop(i[0]-1)
        # height_rank.pop(i[1]-1)
        #np.delete(height_rank,i[0]-1,axis = 1)
        #np.delete(height_rank,i[1]-1,axis = 1)

ans = n - len(set(make))
print(ans)

Measured memory_bytes: 34488
#include <bits/stdc++.h>
#include <numeric>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001
typedef pair<int,int> P;
#define mod 1000000007

int main(){
    int n,d,x;
    int sum=0;
    cin>>n>>d>>x;
    vector<int>cho(d,0);
    rep(i,n){
        int a;
        cin>>a;
        int count=1;
        while(count<=d){
            cho[count-1]++;
            count+=a;
        }
    }
    rep(i,d){
        sum+=cho[i];
    }
    cout <<sum+x<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
#define int long long

signed main(){
// Your code here!
int i,p;
int ans = 0;
cin >> i;
p=100;

for(int o=1;;o++){
    p += (p/100);
    if(p>=i){
        cout << o;
        return 0;
    }
}
/*
while(p < i)
{
    ans ++;
    p *= 1.01;
}
cout << ans;
*/


}


Measured memory_bytes: 3596
//84104971101048411497 - Can you guess what does this mean?
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef complex<double> point;
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i,  r, l) for(int i = (r); i >= (l); --i)
#define fto(i, l, r) for(int i = (l); i <= (r); ++i)
#define forit(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define forrit(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define X real()
#define Y imag()
#define maxN 100005
#define oo 2000000007

const double PI = acos(-1.0);

double fRand(double fMin, double fMax)
{
    double f = (double)rand() / RAND_MAX;
    return fMin + f * (fMax - fMin);
}

template <class T>
T min(T a, T b, T c) {
    return min(a, min(b, c));
}

template <class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}

int n, a[3*maxN];

int main () {
    scanf("%d", &n);
    fto(i, 1, 3*n) scanf("%d", &a[i]);
    sort(a+1, a+3*n+1);

    ll ans = 0;
    for(int i = 3*n-1; i >= n; i -= 2) ans += a[i];
    cout << ans;

    return 0;
}


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

int main() {
  int N;
  cin >> N ;
  
  vector<int> d(N);
  for (int i = 0; i < N; i++) {
    cin >> d.at(i);
  }
  
  sort(d.begin(), d.end());
  
  if (d.at(N/2) == d.at(N/2 - 1)){
    cout << 0 << endl;
  }
  else {
    cout << d.at(N/2) - d.at(N/2 - 1) << endl;
  }
}



Measured memory_bytes: 640
#include<iostream>
#include<vector>
using namespace std;
int main() {
  int N,M;
  cin >> N >> M;
  vector<int> H(N);
  int i,j;
  for(i=0;i<N;i++)cin >> H[i];
  vector<vector<int>> E(N);
  int a,b;
  for(i=0;i<M;i++) {
    cin >> a >> b;
    E[a-1].push_back(b-1);
    E[b-1].push_back(a-1);
  }
  int ans = 0;
  bool f;
  for(i=0;i<N;i++) {
    f = true;
    for(j=0;j<E[i].size()&&f;j++) {
      if(H[i] <= H[E[i][j]])f = false;
    }
    if(f)ans++;
  }
  cout << ans << endl;
}

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

using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

inline int toInt(string s) {int v; istringstream sin(s);sin>>v; return v;}

typedef long long ll;

const int maxi = 1e5;
 
int main(){
    int A, B, C, X, Y;
    cin >> A >> B >> C >> X >> Y;

    int ans = 1e9;
    for(int i = 0; i <= maxi; i++){
        ans = min(ans, i*2*C + max(0, X-i)*A + max(0, Y-i) * B);
    }

    cout << ans << endl;


    return 0;
}

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

#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

const ll INF = 1000000000000000000 + 7;

ll cost(ll i, ll j, vector<ll> &h) { return abs(h.at(i) - h.at(j)); }

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

  vector<ll> h(n);
  for (long long i = 0; i < n; i++) {
    cin >> h.at(i);
  }

  vector<ll> dp(n, INF);

  dp.at(0) = 0;
  dp.at(1) = cost(0, 1, h);

  for (long long i = 2; i < n; i++) {
    dp.at(i) =
        min(dp.at(i - 1) + cost(i, i - 1, h), dp.at(i - 2) + cost(i, i - 2, h));
  }

  cout << dp.at(n - 1) << endl;
}


Measured memory_bytes: 4784
#include <bits/stdc++.h>
using namespace std;
#define Hello ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define endl '\n'
int main()
{
    Hello
    int n, q;
    string s;
    vector<set<int>> v;
    v.resize(27);
    cin >> n >> s >> q;
    for(int i = 0; i < s.size(); i++)
        v[s[i] - 'a'].insert(i);
    while(q--)
    {
        int test, ans = 0;
        cin >> test;
        if(test == 1)
        {
            int pos;
            char t;
            cin >> pos >> t;
            pos--;
            if(s[pos] != t)
            {
                v[s[pos] - 'a'].erase(pos);
                v[t - 'a'].insert(pos);
                s[pos] = t;
            }
        }
        else if(test == 2)
        {
            int l, r, cntr = 0;
            cin >> l >> r;
            l--; r--;
            for(int i = 0; i < 26; i++)
            {
                auto it = v[i].lower_bound(l);
                if(it != v[i].end() && *it <= r)
                    cntr++;
            }
            ans += cntr;
            cout << ans << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 24220
#include <stdio.h>

int main(void)
{
	int i,j,k,n[101],x[101],s,count,l;
	
	i=1;
	
	scanf("%d %d",&n[i],&x[i]);
	
	while(x[i]!=0 || n[i]!=0){
		i++;
		scanf("%d %d",&n[i],&x[i]);
	}
	
	s=i-1;
	count=0;
	
	for(i=1;i<=s;i++){
		for(l=1;l<=n[i];l++){
			for(j=l+1;j<=n[i];j++){
				for(k=j+1;k<=n[i];k++){
					if(l+j+k==x[i]){
						count++;
					}
				}
			}
		}
		printf("%d\n",count);
		count=0;
	}
	
	return 0;
}

Measured memory_bytes: 600
#include<stdio.h>

int main() {
	int h, w, n,i;
	scanf("%d%d%d", &h, &w, &n);
	if (h > w) {
		for (i = 1; i <= w; i++) {
			if (i * h >= n) { printf("%d", i); break; }
		}
	}
	else
	{
		for (i = 1; i <= h; i++) {
			if (i * w >= n) { printf("%d", i); break; }

		}
	}
	return 0;
}

Measured memory_bytes: 128
import std.stdio, std.range, std.random, std.conv, std.string, std.math;
import std.algorithm.comparison, std.algorithm.iteration, std.algorithm.mutation, std.algorithm.searching, std.algorithm.sorting;

void main()
{
    int[5] l;
    foreach(i; 0..3) {
        int[] input = readln().strip.split().to!(int[]);
        l[input[0]]++;
        l[input[1]]++;
    }
    writeln(
        (
        l[1]<3 &&
        l[2]<3 &&
        l[3]<3 &&
        l[4]<3) ? "YES" : "NO");
}

Measured memory_bytes: 256
import collections

s = collections.deque(list(input()))
q = int(input())
rev = 0 #反転するなら1そうでないなら0
for i in range(q):
    tfc = list(input().split())
    if tfc[0]=='1':
        rev = abs(rev-1) #revが入力されるたびに1か0に変更される
    else:
        t,f,c = tfc
        if rev:
            if f=='1':
                s.append(c)
            else:
                s.appendleft(c)
        else:
            if f=='1':
                s.appendleft(c)
            else:
                s.append(c)
if rev: #反転される場合逆向きに出力されなければいけない 
    t = []
    for i in range(len(s)):
        t.append(s.pop())
    print(''.join(t))
else:
    print(''.join(s))


Measured memory_bytes: 9180
### constant

INF = 1 << 30

### subroutines

def sec2hms(sec)
  sprintf("%02d:%02d:%02d", sec / 3600, (sec / 60) % 60, sec % 60)
end

### main

loop do
  n = gets.to_i
  break if n == 0

  clks = []
  for k in (0...n)
    si, ti, ui = gets.split.map(&:to_i)
    ci = []
    for i in (0...60)
      [si, ti, ui].permutation do |pi|
        if pi[0] % 5 == pi[1] / 12
          ci << (pi[0] / 5) * 3600 + pi[1] * 60 + pi[2]
        end
      end

      si = (si + 1) % 60
      ti = (ti + 1) % 60
      ui = (ui + 1) % 60
    end
    clks += ci.uniq.sort.map{|c| [c, k]}
  end
  clks.sort!
  #p clks.length

  allbits = (1 << n) - 1
  bits = 0
  subclks = []

  min_sec = INF
  sec0 = sec1 = nil
  
  clks.each do |ci, k|
    b = (1 << k)

    if (bits & b) != 0
      subclks.delete_if{|sci| sci[1] == k}
    else
      bits |= b
    end
    subclks << [ci, k]
    
    if bits == allbits
      sec = ci - subclks.first[0]
      if min_sec > sec
        min_sec = sec
        sec0 = subclks.first[0]
        sec1 = ci
      end
    end
  end

  puts [sec2hms(sec0), sec2hms(sec1)].join(' ')
end

Measured memory_bytes: 6144
import java.util.*;
 
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int l = sc.nextInt();

        int index = 0;
        int abs = Math.abs(l);

        for (int i = 1; i < n; i++) {
            if (Math.abs(l + i) < abs) {
                abs = Math.abs(l + i);
                index = i;
            }
        }

        int result = 0;

        for (int i = 0; i < n; i++) {
            if (i != index) {
                result += l+i;
            }
        }

        System.out.println(result);
	}
}


Measured memory_bytes: 21844