akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
  int n,A[200000]={},a[200000]={};
  cin >> n;
  for(int i=0; i<n; i++) {
    cin >> A[i];
    a[i]=A[i];
  }
  sort(a,a+n,greater<int>());
  for(int i=0; i<n; i++) {
    if(A[i]!=a[0]) {
      cout << a[0] << endl;
    }
    else {
      cout << a[1] << endl;
    }
  }
}

Measured memory_bytes: 3200
#abc159 a

import itertools
from math import factorial
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce

sys.setrecursionlimit(4100000)
INF = 1 << 60
MOD = 10 ** 9 + 7

#ここから書き始める
n, m = map(int, input().split())
ans1 = n * (n - 1) // 2
ans2 = m * (m - 1) // 2
print(ans1 + ans2)


Measured memory_bytes: 5884
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
  ll n,sum=0;
  cin >> n;
  for(int i=1;i<=n;i++)
  {
    if(i%3==0 || i%5==0)continue;
    else sum+=i;}
  cout << sum;
}

Measured memory_bytes: 3624
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)


def main():
    a,b = LI()

    return max(a - b + 1, 0)


print(main())




Measured memory_bytes: 6224
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        InputStreamScanner in = new InputStreamScanner(System.in);
        new Main().solve(in, out);
        out.flush();
    }

    private void solve(InputStreamScanner in, PrintWriter out) {
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int c = 0;
        for (int i = 1; i <= n ; i++) {
            String s = String.valueOf(i);
            int t = 0;
            for (int j = 0; j < s.length(); j++) {
                t += Integer.parseInt(s.substring(j, j + 1));
            }
            if (a <= t && t <= b) {
                c += i;
            }
        }
        out.println(c);
    }

    static class InputStreamScanner {

        private InputStream in;

        private byte[] buf = new byte[1024];
        private int len = 0;
        private int off = 0;

        InputStreamScanner(InputStream in)	{
            this.in = in;
        }

        String next() {
            StringBuilder sb = new StringBuilder();
            for (int b = skip(); !isSpace(b);){
                sb.appendCodePoint(b);
                b = read();
            }
            return sb.toString();
        }

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

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

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

        char nextChar() {
            return (char)skip();
        }

        int skip() {
            for (int b; (b = read()) != -1;) {
                if (!isSpace(b)) {
                    return b;
                }
            }
            return -1;
        }

        private boolean isSpace(int c) {
            return c < 33 || c > 126;
        }

        private int read() {
            if (len == -1) {
                throw new InputMismatchException("End of Input");
            }
            if (off >= len){
                off = 0;
                try {
                    len = in.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException(e.getMessage());
                }
                if (len <= 0) {
                    return -1;
                }
            }
            return buf[off++];
        }
    }
}

Measured memory_bytes: 23380
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define dump(x) cerr << #x << " = " << (x) << endl;
using LL=long long;
using VI=vector<int>;
using VL=vector<long long>;
using VS=vector<string>;
using VVI=vector<vector<int>>;
using PII=pair<int, int>;
const int inf = (int)1e9;
const LL mod = (long long)1e9 + 7;
const double pi = acos(-1.0);

template <class T>void Sort(T & a) { sort(a.begin(), a.end()); }
template <class T>void ReSort(T& a) { sort(a.rbegin(), a.rend()); }
template <class T>void Reverse(T& a) { reverse(a.begin(), a.end()); }
template <class T>void Unique(T& a) { a.erase(unique(a.begin(), a.end()), a.end()); }
template <class T>auto Max(T a) { return *max_element(a.begin(), a.end()); }
template <class T>auto Min(T a) { return *min_element(a.begin(), a.end()); }
template <class T, class U>int Count(T a, U c) { return count(a.begin(), a.end(), c); }
template<class T, class U>U Sum(T a, U init = 0) { return accumulate(a.begin(), a.end(), init); }

//INPUT//
void CINPUT() {}
template<class H, class ...T> void CINPUT(H&& h, T&& ...t) { cin >> h; CINPUT(forward<T>(t)...); }
#define in(...) int __VA_ARGS__; CINPUT(__VA_ARGS__);
#define IN(T,...) T __VA_ARGS__; CINPUT(__VA_ARGS__);

#define vin(name,n) int n; cin>>n; vector<T> name(n); for(auto &i : name)cin>>i;
#define vIn(name,n) vector<int> name(n); for(auto &i : name)cin>>i;
#define Vin(T,name,n) T n; cin>>n; vector<T> name(n); for(auto &i : name)cin>>i;
#define VIn(T,name,n) vector<T> name(n); for(auto &i : name)cin>>i;

#define vIn2(name,name2,n) vector<int> name(n),name2(n); rep(i,n)cin>>name[i]>>name2[i];
#define VIn2(T,name,name2,n) vector<T> name(n),name2(n); rep(i,n)cin>>name[i]>>name2[i];
#define VIN2(T,name,T2,name2,n) vector<T> name(n); vector<T2> name2(n); rep(i,n)cin>>name[i]>>name2[i];

//OUTPUT//
void print() { cout << endl; }
template <class H> void print(H&& h) { cout << h << endl; }
template <class H, class... T> void print(H&& h, T&& ... t) { cout << h << " "; print(forward<T>(t)...); }
template<class T>void out(T n) { cout << n << endl; }
template<class T>void out(vector<T> a, string sep = " ", string end = "\n") { for (int i = 0; i < (int)a.size(); ++i)cout << a[i] << (i == (int)a.size() - 1 ? end : sep); }
template<> void out(double a) { printf("%.20f\n", a); }
void yes(bool f) { puts(f ? "yes" : "no"); }
void Yes(bool f) { puts(f ? "Yes" : "No"); }
void YES(bool f) { puts(f ? "YES" : "NO"); }
void Yay(bool f) { puts(f ? "Yay!" : ":("); }
void poss(bool f) { puts(f ? "possible" : "impossible"); }
void Poss(bool f) { puts(f ? "Possible" : "Impossible"); }
void POSS(bool f) { puts(f ? "POSSIBLE" : "IMPOSSIBLE"); }

int main() {
	IN(string, s);
	out(Count(s, '+') - Count(s, '-'));
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
using P = pair<int,int>;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int main(){
    int n, k, s;
    cin >> n >> k >> s;
    rep(i,n){
        int x;
        if (i < k) x = s;
        else {
            if (s == 1e9) x = s - 1;
            else x = s + 1;
        }
        printf("%d%c", x, i == n-1 ? '\n': ' ');
    }
    return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define FOR(i,n,j) for(int i=(j);i<(n);++i)
#define rrep(i,n) for(int i=(n);i>=0;--i)
using namespace std;
using ll=long long;
using ld=long double;
#define ssort(n) sort((n).begin(),(n).end())
typedef pair<int,int> P;

int main()
{
    string s;
    cin >> s;
    vector<char> ans;
    ans.resize(11);
    int j=0;
    rep(i,s.length()){
        if(s[i]!='B'){
            ans[j++]=s[i];
        }else if(s[i]=='B'&&j>0){
            j--;
        }else;
    }
    rep(i,j){
        cout << ans[i];
    }cout << endl;
}

Measured memory_bytes: 256
#include <iostream>
#define llint long long
#define mod 998244353

using namespace std;

llint h, w;
int a[305][305];

void swapRows(int mat[305][305], int i, int j, int w)
{
	for(int k = 0; k < w; k++) swap(mat[i][k], mat[j][k]);
}

void GaussianElimination(int mat[305][305], int w, int h)
{
	int r = 0;
	for(int i = 0; i < w && r < h; i++){
		if(mat[i][r] == 0){
			int max_val = 0, max_j;
			for(int j = r+1; j < h; j++){
				if(mat[j][i] > max_val){
					max_val = mat[j][i];
					max_j = j;
				}
			}
			if(max_val == 0) goto end;
			swapRows(mat, r, max_j, w);
		}
		
		for(int j = 0; j < h; j++){
			if(j == r) continue;
			if(mat[j][i] == 0) continue;
			for(int k = 0; k <= w; k++){
				mat[j][k] ^= mat[r][k];
			}
		}
		r++;
		end:;
	}
}

int main(void)
{
	cin >> h >> w;
	for(int i = 0; i < h; i++){
		for(int j = 0; j < w; j++){
			cin >> a[i][j];
		}
	}
	
	GaussianElimination(a, w, h);
	
	llint rank = 0;
	for(int i = 0; i < h; i++){
		bool flag = false;
		for(int j = 0; j < w; j++) if(a[i][j]) flag = true;
		if(flag) rank++;
	}
	
	llint nsize = 1, dsize = 1;
	for(int i = 0; i < h-rank; i++) nsize *= 2, nsize %= mod;
	for(int i = 0; i < h; i++) dsize *= 2, dsize %= mod;
	llint ans = (dsize - nsize + mod) % mod;
	for(int i = 0; i < w-1; i++) ans *= 2, ans %= mod;
	
	cout << ans << endl;
	return 0;
}

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

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, Q, l, r;
    string S;
    cin >> N >> Q >> S;
    vector<int> v(N+1);
    for (int i = 1; i < N; ++i) {
        if (S[i-1] == 'A' && S[i] == 'C') v[i+1] = true;
    }
    for (int i = 1; i <= N; ++i) v[i] += v[i-1];
    // for (auto x: v) cerr << x << ' ';
    while (Q--) {
        cin >> l >> r;
        bool off = l && S[l-2] == 'A' && S[l-1] == 'C';
        cout << v[r] - v[l-1] - off << endl;
    }
    return 0;
}


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

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

    int a = 0,b = 0,c = 3;
    if(s[0] == 'A') a++;
    for(int i = 2; i < s.length() - 1; i++) if(s[i] == 'C') b++;
    for(int i = 0; i < s.length(); i++) if(s[i] >= 'A' && s[i] <= 'Z') c--;

    cout << (a == 1 && b == 1 && c == 1 ? "AC" : "WA") << endl;

    return 0;
}

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

int ceil(int x)
{
	float f=(float)x/2;
	int e=x/2;
	if (e==f)
	 return e;
	return e+1;
}

int main()
{
	int i,j,k,n,dua,empat;
	cin>>n;
	dua=0;
	empat=0;
	for (i=1;i<=n;i++)
	{
		cin>>k;
		if (k%4==0)
		 empat++;
		else
		 if (k%2==0)
		  dua++;
	}
	//cout<<dua<<" "<<empat<<"\n";
	if (dua>0){
	n-=dua;
	//cout<<n<<" n\n";
	if (empat>=ceil(n))
	{
		cout<<"Yes\n";
		return 0;
	}
	else
	 cout<<"No\n";
	}
	else
	{
		if (empat>=n/2)
	{
		cout<<"Yes\n";
		return 0;
	}
	else
	 cout<<"No\n";
	}
}

Measured memory_bytes: 256
import java.io.*;

public class Main
{
    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] input = br.readLine().split(" ");
        int A = Integer.parseInt(input[0]);
        int B = Integer.parseInt(input[1]);
        A = (A == 1) ? 14 : A;
        B = (B == 1) ? 14 : B;
        if(A > B)
        {
            System.out.println("Alice");
        }
        else if(A < B)
        {
            System.out.println("Bob");
        }
        else
        {
            System.out.println("Draw");
        }
    }
}

Measured memory_bytes: 23252
#include<bits/stdc++.h>
#define pb push_back
#define INF (ll)1e9
#define deb(x) cerr<<#x<<" "<<x<<"\n"
#define fixed setprecision(9)
using namespace std;
using ll = long long;

int main(){
	int n;
	cin>>n;
	vector<int> v;
	set<int> s;
	int temp;
	for(int i=0;i<n;i++){
		cin>>temp;
		v.pb(temp);
		s.insert(temp);
	}
	if(s.size()==v.size()){
		cout<<"YES";
	}
	else{
		cout<<"NO";
	}
	
	return 0;
}




Measured memory_bytes: 10484
#ABC096C
H, W=map(int, input().split())
S=[]
for i in range(H):
    S.append(list(str(input())))
for i in range(H):
    for j in range(W):
        if S[i][j]=="#":
            if i-1>=0:
                if S[i-1][j]=="#":
                    continue
            if j-1>=0:
                if S[i][j-1]=="#":
                    continue
            if j+1<=W-1:
                if S[i][j+1]=="#":
                    continue
            if i+1<=H-1:
                if S[i+1][j]=="#":
                    continue
            print("No")
            exit()
print("Yes")


Measured memory_bytes: 3064
N, H = map(int, input().split())
slash = 0
Throw = []
for _ in range(N):
    a, b = map(int, input().split())
    slash = max(slash, a)
    if b > a: Throw.append(b)    
#slash=斬撃最大ダメージ、投げてslash超のダメージが出るならばその剣をダメージが大きい順に投げる
import heapq as hq
Throw = [-th for th in Throw if th > slash]
hq.heapify(Throw)

dmg, cnt = 0, 0
while len(Throw) != 0:
    if dmg >= H: break
    dmg += -hq.heappop(Throw)
    cnt += 1
if dmg < H:
    from math import ceil
    cnt += ceil((H-dmg)/slash)
print(cnt)

Measured memory_bytes: 16620
#include<iostream>
#include<cstdio>
using namespace std;
#define int long long
signed main(){
        int a;
        while( scanf("%lld", &a) != EOF ){
                int b=1;
                for(int i=2; i<=a; i++){
                        b*=i;
                }
                printf("%lld\n", b);
        }
        return 0;
}

Measured memory_bytes: 3140
#include<bits/stdc++.h>
using namespace std;
#define BeatMeScanf ios_base::sync_with_stdio(false)
#define ll long long
#define sz 1000005

int main(){
    BeatMeScanf;
    ll a,b,k;
    while(cin>>a>>b>>k){
        ll x,y;
        if(a<=k){
            x=min(0LL,k-a);
            k=k-a;
        }
        else if(a>k){
            x=a-k;
            k=0;
        }
        if(b<=k) y=min(0LL,k-b);
        else if(b>k) y=b-k;

        cout<<x<<" "<<y<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<string>

using namespace std;

int main(){

	int n;
	cin >> n;
	for(int i=0;i<n;i++){
		string str;
		char last;
		char key[10][13]={
			{' '},
			{' ','.',',','!','?',' '},
			{' ','a','b','c','a','b','c','a','b','c','a','b','c'},
			{' ','d','e','f','d','e','f','d','e','f','d','e','f'},
			{' ','g','h','i','g','h','i','g','h','i','g','h','i'},
			{' ','j','k','l','j','k','l','j','k','l','j','k','l'},				
			{' ','m','n','o','m','n','o','m','n','o','m','n','o'},
			{' ','p','q','r','s','p','q','r','s','p','q','r','s'},
			{' ','t','u','v','t','u','v','t','u','v','t','u','v'},
			{' ','w','x','y','z','w','x','y','z','w','x','y','z'},								
		};
		cin >> str;
		int array[10],i;
		for(i=0;i<10;i++){
			array[i]=0;
		}
		last = str[0];
		for(i=0;i<str.size();i++){
			array[str[i]-0x30]++;
			if(array[str[i]-0x30] > 12 && last!=1) array[str[i]-0x30]=1;
			if(array[1] > 5) array[1]=1;
			if(str[i]=='0' && last!='0'){
				// cout << last << ':' << array[last-0x30] << endl;
				cout <<  key[(last-0x30)][array[last-0x30]];
				for(int l=0;l<10;l++){
					array[l]=0;
				}
			}
			last = str[i];
		}
		cout << endl;
	}
	return 0;
}

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

int gcd(int a, int b)
{
    if(b>0)
        return gcd(b,a%b);
    else
        return a;
} 
int main(void) 
{
    int N,X;
    cin >> N >> X;

    vector<int> x(N);

    for(int i=0;i<N;++i)
    {
        int xx;
        cin >> xx;
        x[i] = abs(X-xx);
    }

    int ans = x[0];

    for(int i=1;i<N;++i)
    {
        ans = gcd(ans, x[i]);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
    private static Scanner sc=new Scanner(System.in);
    public static void main(String[] args){
        int n=sc.nextInt();
        int[] a=new int[n];
        for(int i=0;i<n;i++) a[i]=sc.nextInt();
        print(a);
        for(int i=1;i<n;i++){
            int t=a[i];
            int j=i-1;
            while(j>=0&&a[j]>t){
                a[j+1]=a[j];
                j--;
            }
            a[j+1]=t;
            print(a);
        }
    }
    private static void print(int[] a){
        for(int i=0;i<=a.length-2;i++) System.out.print(a[i]+" ");
        System.out.println(a[a.length-1]);
    }
}

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

using namespace std;
int main(){
  long long n,x=0;
  cin>>n;
  vector<int> a(n);
  
  for(int i=0;i<n;i++){
    cin>>a.at(i);
    //cout<<a[i]<<endl;
    if(i>0){
      if(a.at(i)<=a.at(i-1)){
        x+=a.at(i-1)-a.at(i);
        a[i]=a[i-1];
      }
    }
  }
  cout<<x<<endl;
}

Measured memory_bytes: 4048
n,m=map(int,input().split())
diffs=set()
idxs=set()
i=1
diff=n-1
cnt=0
while 1:
    if i>m:
      break
    while (diff in diffs and n-diff in diffs) or (i+diff in idxs) or (diff==n-diff):
        diff-=1
    diffs.add(n-diff)
    diffs.add(diff)
    idxs.add(i+diff)
    print(i,i+diff)
    i+=1

Measured memory_bytes: 30644
local mfl, mma, mmi = math.floor, math.max, math.min
local function lower_bound(ary, x, min, max)
  if(x <= ary[min]) then return min end
  if(ary[max] < x) then return max + 1 end
  while(1 < max - min) do
    local mid = mfl((min + max) / 2)
    if(ary[mid] < x) then
      min = mid
    else
      max = mid
    end
  end
  return max
end

local ret = nil
local n = io.read("*n")
local tot = {}
local cur = 0
for i = 1, n do
  cur = cur + io.read("*n")
  tot[i] = cur
end
for i = 3, n - 1 do
  local leftsum = tot[i - 1]
  local rightsum = tot[n] - leftsum
  local leftlb = lower_bound(tot, leftsum / 2, 1, i - 1)
  leftlb = mmi(leftlb, i - 2)
  local rightlb = lower_bound(tot, leftsum + rightsum / 2, i, n)
  rightlb = mmi(rightlb, n - 1)
  for k = 1, 4 do
    local v1 = tot[leftlb]
    local v3 = tot[rightlb] - leftsum
    if k <= 2 then
      if(1 < leftlb) then
        v1 = tot[leftlb - 1]
      end
    end
    if k % 2 == 0 then
      if(i < rightlb) then
        v3 = tot[rightlb - 1] - leftsum
      end
    end
    local v2 = leftsum - v1
    local v4 = rightsum - v3
    local mi = mmi(v1, mmi(v2, mmi(v3, v4)))
    local ma = mma(v1, mma(v2, mma(v3, v4)))
    if(ret == nil) then
      ret = ma - mi
    else
      ret = mmi(ret, ma - mi)
    end
  end
end
print(ret)


Measured memory_bytes: 4600
#include <iostream>
#include <vector>
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <vector>
#include <iomanip>
#include <functional>
#include <bits/stdc++.h>

using namespace std;

int x[10],y[10];
double dist(int i, int j) {
    double dx = x[i] - x[j];
    double dy = y[i] - y[j];
    return pow(dx * dx + dy * dy, 0.5);
}

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

    int a[n];
    vector<vector<int>> x(n, vector<int>(n));
    bool y[n][n];

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

    int ans=0;

    for (long long int bit = 0; bit < (1<<n); ++bit) {
        vector<int> S;
        bool tmp=true;
        int cnt=0;
        for (int i = 0; i < n; ++i) {
          if(bit & (1<<i)){
            cnt++;
            for (int j = 0; j < a[i]; ++j) {
              if (bit & (1<<x[i][j]-1)){
                if(!y[i][j]) tmp=false;
              }
              else{
                if(y[i][j]) tmp=false;
              }
            }
          }
        }
        if(tmp && ans<cnt) ans=cnt;
      }

        cout << ans << endl;


    return 0;
}


Measured memory_bytes: 256
import java.util.*;
class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String W[] = {"SUN","MON","TUE","WED","THU","FRI","SAT"};
		
		for(int i=0;i<7;i++) {
			if(S.equals(W[i])) {
				System.out.println(7-i);
			}
		}
	}
}


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

using namespace std;

typedef long long ll;

ll md = 1000000007;

int main(int, char**)
{
	ll ans = 0;
	int n;
	cin >> n;

	double x = ((double)n)/ 1.08;
	ll y = ceil(x);

//	cerr << "x=" << x << ", y=" << y << endl;
	if (floor(y * 1.08)== n)
		cout << y << endl;
	else
		cout << ":(" << endl;
	return 0;
}


Measured memory_bytes: 384
N = input()
n = []
for i in N:
    n.append(i)
if n[0] == n[1] and n[1] == n[2]:
    print(int(N))
else:
    if n[0] >= n[1] and n[0] >= n[2]:
        print(int(n[0]*3))
    else:
        tmp = int(n[0])
        tmp += 1
        n[0] = str(tmp)
        print(int(n[0]*3))

Measured memory_bytes: 3064
# include <bits/stdc++.h>
using namespace std;
int main() {
   // freopen("input.txt","r",stdin);
    int n;
    cin >> n;
    vector<int> a(n, 0);
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        a[--x]++;
    }
    vector<int> b(n + 1, 0);
    for (int i = 0; i < n; i++) {
        b[a[i]]++;
    }
    vector<int> c(n + 1, 0);
    c[n] = b[n];
    for (int i = n - 1; i > 0; i--) {
        c[i] = c[i + 1] + b[i];
    }
    multiset<int> myset;
    for (int i = 1; i <= n; i++) {
        if(c[i]>0) myset.insert(c[i]);
    }
    for (int k = 1; k <= n; k++) {
        vector<pair<int,bool>> last;
        int tim=0;
        while (1) {
            auto it = myset.lower_bound(k);
            if (it == myset.end()) {
                break;
            }
            tim++;
            int x = *it;
            int y=0;
            if (it != myset.begin()) {
                it--;
                y = *it;
                myset.erase(myset.lower_bound(y));
                last.emplace_back(y,0);
            }
            if(y+x-k>0) {
                myset.insert(y + x - k);
                last.emplace_back(y + x - k, 1);
            }
            myset.erase(myset.lower_bound(x));
            last.emplace_back(x,0);

        }
        for(int i=int (last.size())-1;i>-1;i--) {
            if (last[i].second) {
                myset.erase(myset.lower_bound(last[i].first));
            }
            else{
                myset.insert(last[i].first);
            }
        }
        cout<<tim<<'\n';
//        return 0;
    }
    return 0;
}



Measured memory_bytes: 22400
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
using Pair = System.Tuple<int, int>;
using Edge = System.Tuple<int, int, long>;
//using Debug;
//using static System.Globalization.CultureInfo;

class Program
{
    static void Main(string[] args)
    {
        var k = ReadLine();
        var d = Input.num;
        var dp = new long[k.Length+1, d, 2];
        dp[0, 0, 0] = 1;
        for (var i = 1; i <= k.Length; i++)
            for (var w = 0; w < d; w++)
                for (var j = 0; j < 2; j++)
                {
                    var val = j == 0 ? k[i - 1] - '0' + 1 : 10;
                    for (var h = 0; h < val; h++)
                        dp[i, (w + h) % d, ToInt32(j == 1 || h != val - 1)] = (dp[i, (w + h) % d, ToInt32(j == 1 || h != val - 1)] + dp[i - 1, w, j]) % Input.MOD;
                }
        WriteLine((dp[k.Length, 0, 0] + dp[k.Length, 0, 1]+Input.MOD-1) % Input.MOD);
    }
}

public class Input
{
    public static string read => ReadLine();
    public  static int[] ar => Array.ConvertAll(read.Split(' '), int.Parse);
    public  static int num => ToInt32(read);
    public static long[] arL => Array.ConvertAll(read.Split(' '), long.Parse);
    public  static long numL => ToInt64(read);
    public static char[][] gred(int h) 
        => Enumerable.Repeat(0, h).Select(v => read.ToCharArray()).ToArray();
    public static int[][] twodim(int num)
        => Enumerable.Repeat(0, num).Select(v => ar).ToArray();
    public static long[][] twodimL(int num)
        => Enumerable.Repeat(0, num).Select(v => arL).ToArray();
    public const long Inf = (long)1e18;
    public const double eps = 1e-6;
    public  const string Alfa = "abcdefghijklmnopqrstuvwxyz";
    public  const int MOD = 1000000007;
}


Measured memory_bytes: 26336
package main

import "fmt"

func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	if a%b == 0 {
		return b
	}
	return gcd(b, a%b)
}

func main() {
	var a, b, c, d int
	fmt.Scan(&a, &b, &c, &d)
	a -= 1
	e := c * d / gcd(c, d)
	fmt.Println((b - ((b / c) + (b / d) - (b / e))) - (a - ((a / c) + (a / d) - (a / e))))
}


Measured memory_bytes: 512
#include<cstdio>

int r, g, b;

int main(){
	scanf("%d %d %d", &r, &g, &b);
	int num = 100 * r + 10 * g + b;
	if(num % 4 == 0) printf("YES\n");
	else printf("NO\n");
	return 0;
}


Measured memory_bytes: 128
#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int

from itertools import accumulate

def mod_factorial(n):
    value = 1
    for i in range(n,0,-1):
        value*=i
        value%=MOD
    return value

def solve(N: int, K: int, A: "List[int]"):
    A.sort()
    n = N-1
    r = K-1
    # nCkTable[i] = iCr
    nCkTable = [0]*(n+1)

    start = 1
    for _ in range(r):
        start *= n
        start %= MOD
        n -= 1

    bunbo = mod_factorial(r)
    bunbo_gyakugen = pow(bunbo,MOD-2,MOD)

    n = N-1
    for i in range(n, r-1, -1):
        nCkTable[i] = start*bunbo_gyakugen%MOD
        start*=pow(i,MOD-2,MOD)
        start*=i-r
        start%=MOD

    answer = 0
    for i in range(N):
        answer += A[i]*(nCkTable[i]-nCkTable[N-1-i])
        answer%=MOD
    print(answer%MOD)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, A)

if __name__ == '__main__':
    main()


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

#define pb push_back
#define mp make_pair

typedef long long ll;

const int inf = 1e9;
const ll linf = 1e18;
const ll mod = 1e9 + 7;

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

  string march = "MARCH";
  ll cnt[5] = {};
  for(int i = 0; i < n; i++){
    string s;
    cin >> s;

    for(int i = 0; i < march.size(); i++){
      if(s[0] == march[i]){
        cnt[i]++;
      }
    }
  }

  ll ans = 0;
  for(int i = 0; i < 3; i++){
    for(int j = 0; j < 4; j++){
      for(int k = 0; k < 5; k++){
        if(i < j and j < k){
          ans += cnt[i]*cnt[j]*cnt[k];
        }
      }
    }
  }
    
  cout << ans << endl;

  return 0;
}


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

#ifdef LOCAL
	#define de(x) cout<<#x<<"="<<x<<endl
	#define rff freopen("input.txt","r",stdin)
#else
	#define de(x)
	#define rff
#endif

#define PQ priority_queue
#define setp setprecision
#define pii pair<int,int>
#define sqr(a) ((a)*(a))
#define el cout<<endl
#define ll long long
#define pb push_back
#define re return
#define se second
#define fi first
const int INF=(int)INFINITY;

ll n,c,x[100003],dr[100003],dl[100003],mxl[100003],mxr[100003];
ll ans;
ll now,tmp;
ll vr,vl;
int v[100003];

int main(){
	ios::sync_with_stdio(false);
//	rff;
	int p;
	cin>>n>>c;
	for (int i=1;i<=n;i++){
		cin>>x[i]>>v[i];
	}
	for (int i=1;i<=n;i++){
		p=n-i+1;
		vr+=v[i];
		vl+=v[p];
		dr[i]=vr-x[i];
		dl[p]=vl-(c-x[p]);
		ans=max(max(dr[i],dl[p]),ans);
		mxr[i]=max(dr[i],mxr[i-1]);
		mxl[i]=max(dl[p],mxl[i-1]);
	}
	for (int i=1;i<=n;i++){
		p=n-i+1;
		ans=max(max(dr[i]-x[i]+mxl[n-i],dl[p]-(c-x[p])+mxr[n-i]),ans);
	}
	cout<<ans;
	re 0;
}

Measured memory_bytes: 4608
primes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]

N = int(input())

prime_sep = []

bigger_than4 = []
bigger_than2 = []
bigger_than74 = []
bigger_than14 = []
bigger_than24 = []

for i in primes:
    tmp = N
    if tmp//i > 0:
        count = 0
        while tmp//i > 0:
            tmp = tmp//i
            count+=tmp
        prime_sep.append([count,i])
        if count >= 4:
            bigger_than4.append([count,i])
        if count >= 2:
            bigger_than2.append([count,i])
        if count >=74:
            bigger_than74.append([count,i])
        if count >= 14:
            bigger_than14.append([count,i])
        if count >= 24:
            bigger_than24.append([count,i])

def nCr(n,r):
    if r > n:
        return 0
    ans = 1
    for i in range(n,n-r,-1):
        ans = ans*i
    for i in range(1,r+1,1):
        ans = ans//i
    return ans

res = nCr(len(bigger_than2)-len(bigger_than4),1)*nCr(len(bigger_than4),2) + 3*nCr(len(bigger_than4),3)
res+= nCr(len(bigger_than4)-len(bigger_than14),1)*nCr(len(bigger_than14),1) + 2*nCr(len(bigger_than14),2)
res+= nCr(len(bigger_than2)-len(bigger_than24),1)*nCr(len(bigger_than24),1) + 2*nCr(len(bigger_than24),2)
res+= len(bigger_than74)
print(res)

Measured memory_bytes: 61604
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
	string s[1234];
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=n;i++)
		cin>>s[i];
	sort(s+1,s+n+1);
	for(int i=1;i<=n;i++)
		cout<<s[i];
	return 0;
}

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

using namespace std;

int main()
{

        int a,b;
        cin>>a>>b;
        if(a>=6 && a<=12) b=b/2;
        else if(a<=5) b=0;
        cout<<b<<endl;
        return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
int A, B, C, X, Y;
int main() {
	cin >> A >> B >> C >> X >> Y;
	cout << min({ A * X + B * Y, 2 * C * (X < Y ? X : Y) + (X > Y ? A * (X - Y) : B * (Y - X)), 2 * C * (X > Y ? X : Y) }) << "\n";
	return 0;
}

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

int main ()
{
	int n;
	cin >> n;
	int l;
	cin >> l;
	int arr[n+10];
	int sum=0,min=999999999,jawab=0;
	int sum2[n+10];
	for(int i=1;i<=n;i++)
	{
		arr[i]= l + i -1;
		sum += arr[i];
	}
	for(int i=1;i<=n;i++)
	{
		sum2[i]=sum - arr[i];
		if(abs(sum2[i]-sum) <= min)
		{
			min = sum2[i]-sum; 	
			jawab = sum2[i];
		}	
	}
	cout << jawab << endl;
	
}

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

int main(){
  int a,b,x;
  cin>>x;
  for(int i=-120;i<120;i++){
    for(int j=-120;j<120;j++){
      if(pow(i,5)-pow(j,5)==x){
        a=i;
        b=j;
        break;
      }
  	}
  }
  cout<<a<<' '<<b<<endl;
}

Measured memory_bytes: 3976
#解説コードコピペです

import numpy as np
 
def solve():
    H, W = list(map(int, input().split()))
    grid = []
    for i in range(H):
        grid.append(list(input()))
    #print((np.array(grid) == ".") * 1) #行列演算 "." ならTrue そうでなければFalseの行列をつくる *1で1と0に変換
    grid = (np.array(grid) == ".") * 1  # ランプをおける:1, 障害物:0
 
    L = np.zeros((H,W), dtype=int) #0でうめつくした行列をつくる
    R = np.zeros((H,W), dtype=int)
    U = np.zeros((H,W), dtype=int)
    D = np.zeros((H,W), dtype=int)
    
    for j in range(W): #列単位で処理
        if j == 0:
            L[:, j] = grid[:, j]
        else:
            L[:, j] = (L[:, j-1] + 1) * grid[:, j] #gridでかけることで 障害物があったときにそのマスを0にする
    
    for j in range(W-1, -1, -1):
        if j == W-1:
            R[:, j] = grid[:, j]
        else:
            R[:, j] = (R[:, j+1] + 1) * grid[:, j]
 
    for i in range(H):
        if i == 0:
            U[i] = grid[i] * 1
        else:
            U[i] = (U[i-1] + 1) * grid[i]
    
    for i in range(H-1, -1, -1):
        if i == H-1:
            D[i] = grid[i]
        else:
            D[i] = (D[i+1] + 1) * grid[i]
 
    ans = np.max(L+R+U+D-3)
    print(ans)
 
 
if __name__ == "__main__": #ここはしらん
    solve()

Measured memory_bytes: 266516
#include <iostream>
#include <iomanip>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX_N 100
using namespace std;

int main(void) {
  int N;
  cin >> N;
  double SUM = 0;
  rep(i, N) {
    double A;
    cin >> A;
    SUM += 1 / A;
  }
  SUM = 1 / SUM;
  cout << setprecision(10) << SUM << endl;
  return 0;
}


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

#define pb push_back
#define mp make_pair
#define F(i, a, n, b) for(int i=a;i<n;i+=b)
#define REVF(i, a, b, c) for(int i=a;i>=b;i-=c)
#define REP(i, n) F(i, 0, n, 1)
#define REP1(i, n) F(i, 1, n+1, 1)
#define REV(i, n) REVF(i, n, 0, 1)
#define PTR(it, x) for(auto it=x.begin();it!=x.end();++it)
#define MOD 1000000007

typedef unsigned long long ll;

const int MAX = 2e6 + 5;

int a,b,c;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	cin>>a>>b>>c;
	if((a == b && a == c) || (a != b && a != c && b != c))
		cout<<"No";
	else
		cout<<"Yes";
	return 0;
}

Measured memory_bytes: 256
from itertools import combinations

import sys
sdin = sys.stdin.readline

n = int(sdin())
s = [sdin() for _ in range(n)]

# marchで始まっている人をカウント
m = len([si for si in s if si.startswith("M")])
a = len([si for si in s if si.startswith("A")])
r = len([si for si in s if si.startswith("R")])
c = len([si for si in s if si.startswith("C")])
h = len([si for si in s if si.startswith("H")])

cmb = []
for char in [m,a,r,c,h]:
    if char > 0:
        cmb.append(char)

res = 0
cands = list(combinations(cmb,3))
for x,y,z in cands:
    res += x*y*z
    
print(res)
    

Measured memory_bytes: 10676
/*
title:

url:
*/

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <queue>
#include <limits>
#include <string>
#include <utility>
#include <cstring>
#include <map>
#include <cmath>
#include <iterator>

using namespace std;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define INF 1000000007

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

int main()
{
    int A, B;
    cin >> A >> B;
    int ans = 0;
    for (int i = 0; i < 2; i++)
    {
        if (A >= B)
        {
            ans += A;
            A--;
        }
        else
        {
            ans += B;
            B--;
        }
    }
    cout << ans << endl;
}


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

int main(){


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

Measured memory_bytes: 1024
#include <algorithm>
#include <iostream>

using namespace std;

using ll = long long;

int main() {
    ll N, C, K;
    cin >> N >> C >> K;

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

    ll ans = 0;
    ll limit = -1, cap = 0;

    for (int i = 0; i < N; ++i) {
        if (cap == C || T[i] > limit) {
            ++ans;
            limit = T[i] + K;
            cap = 0;
        }
        ++cap;
    }

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


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
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; }
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

int main() {

    int n;
    cin >> n;
    
    cout << (n+1) / 2 << endl;
    

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

Measured memory_bytes: 256
import scala.annotation.tailrec;
import scala.io.StdIn.{readInt, readLine};
object Main {
    def main(args: Array[String]): Unit = {
        val size = readInt;
        val g = new Graph(size);
        (0 until size).foreach { i => 
            readLine.trim.split(" ").map(_.toInt).toList match {
                case parent :: childs :: xs => {
                    (0 until childs).foldLeft(xs) { (list, i) => 
                        list match {
                            case child :: weight :: xxs =>
                                g.add(parent, child, weight);
                                xxs;
                            case _ => 
                                list;
                        }
                    }
                }
                case _ => ();
            }
        }
        g.dijkstra(0)._2.zipWithIndex.foreach { e => println("%d %d".format(e._2, e._1))}
    }
}
case class Graph(size: Int) {
    class COLOR;
    case object WHITE extends COLOR;
    case object GRAY extends COLOR;
    case object BLACK extends COLOR;
    val matrix = Array.ofDim[Int](size, size).map( y => y.map(x => -1));
    def add(node: Int, child: Int, weight: Int): Unit = matrix(node)(child) = weight;
    def dijkstra(start: Int): (Array[Int], Array[Int]) = {
        val colors: Array[COLOR] = new Array[COLOR](size).map(e => WHITE);
        val distances = new Array[Int](size).map( e => Int.MaxValue);
        val parents = new Array[Int](size);
        @tailrec
        def _dijkstra(curr: Int): Unit = {
            // 追加済みノード郡の隣接ノードから距離が最小となるノードの index を取得する。
            val minIdx = (0 until size).filter( i => colors(i) != BLACK).foldLeft(-1) { (idx, i) =>
                // curr の隣接ノードの場合
                if (matrix(curr)(i) != -1) {
                    colors(i) = GRAY;
                    // 新しく計算した距離の方が既存の距離よりも小さい場合、親ノードと距離を更新する
                    val newWeight = matrix(curr)(i) + distances(curr);
                    if (newWeight < distances(i)) {
                        distances(i) = newWeight;
                        parents(i) = curr;
                    }
                }
                colors(i) match {
                    case WHITE => idx;
                    case GRAY => if (idx == -1 || distances(i) < distances(idx)) i else idx;
                }
            }
            // 追加済みノード郡から遷移可能なノードがなくなったら処理終了。
            if (minIdx != -1) {
                colors(minIdx) = BLACK;
                _dijkstra(minIdx);
            }
        }
        
        distances(start) = 0;
        parents(start) = -1;
        colors(start) = BLACK;
        _dijkstra(start);
        (parents, distances);
    }
}



Measured memory_bytes: 48376
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll exp(ll a,ll b,ll m){
  int r=1;
  while(b>0){
    if(b&1) r=(r*1ll*a)%m;
    a=(a*1ll*a)%m;
    b>>=1;
  }
  return r;
}
ll comb(ll n, ll k) {
    ll x = 1;
    for(int i=n-k+1; i<=n; i++) {
        x = x*i%1000000007;
    }
 
    ll y = 1;
    for(int i=1; i<=k; i++) {
        y = y*i%1000000007;
    }
    y = exp(y, 1000000007-2,1000000007);
 
    return x*y%1000000007;
}
int main(){
    
  ll n,a,b;cin>>n>>a>>b;
  cout<<((exp(2,n,1000000007)-(comb(n,a)+comb(n,b))%1000000007)+1000000007)%1000000007-1<<endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2e5 + 5, mod = 1e9 + 7;



int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n;
    cin >> n;
    vector<int> b(n - 1);
    int ans = 0;
    for(int i = 0; i + 1 < n; i++) cin >> b[i];
    ans = b[0] + b[n - 2];
    for(int i = 1; i + 1 < n; i++) ans += min(b[i], b[i - 1]);
    cout << ans;

    return 0;
}



Measured memory_bytes: 3648
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


#define	ll_int	long long int
#define	BUCKET_SIZE	100000


typedef struct data_t{
	char key[21];
	ll_int x;
	struct data_t *next;
} DATA_T;

DATA_T *S[BUCKET_SIZE];


// ハッシュテーブルの初期化
void Init()
{
	int i;

	for(i = 0; i < BUCKET_SIZE; i++)
		S[i] = NULL;
}


ll_int Hash(char *key)
{
	int i;
	int sum = 0;

	for(i = 0; i < strlen(key); i++)
		sum += key[i];

	return sum % BUCKET_SIZE;
}


DATA_T *Get(char *key)
{
	ll_int h;
	DATA_T *p;

	h = Hash(key);

	for(p = S[h]; p != NULL; p = p->next)
		if(!strcmp(key, p->key))
			return p;

	return NULL;
}


void Insert(char *key, ll_int x)
{
	ll_int h;
	DATA_T *p;

	if(( p = Get(key) )){
		p->x = x;
		return;
	}


	if( ( p = (DATA_T *)malloc(sizeof(DATA_T)) ) == NULL){
		printf("malloc error\n");
		exit(1);
	}

	h = Hash(key);
	strcpy(p->key, key);
	p->x = x;
	p->next = S[h];
	S[h] = p;
}


void Delete(char *key)
{
	DATA_T *p, *q;
	ll_int h;

	if(Get(key) == NULL)
		return;


	h = Hash(key);
	p = S[h];

	// 先頭にある場合の処理
	if(!strcmp(key, p->key)){
		S[h] = p->next;
		free(p);
		return;
	}

	// 先頭以降の処理
	for(q = p->next;; p = q, q = q->next){
		if(!strcmp(key, q->key)){
			p->next = q->next;
			free(q);
			break;
		}
	}
}


int main()
{
	int q;
	int query;
	char key[21];
	ll_int x;
	DATA_T *p;
	int i;

	scanf("%d", &q);

	for(i = 0; i < q; i++){
		scanf("%d", &query);

		if(query == 0){
		// insert
			scanf("%s %lld", key, &x);
			Insert(key, x);

		}else if(query == 1){
		// get
			scanf("%s", key);
			if( (p = Get(key)) )
				printf("%lld\n", p->x);
			else
				printf("0\n");
		}else if(query == 2){
			scanf("%s", key);
			Delete(key);
		}
	}

	return 0;
}


Measured memory_bytes: 11096
#include <vector>
#include <iostream>
#include <cassert>
using namespace std;

vector<vector<int>> build_even(int n) {
    assert(n % 2 == 0);
    vector<vector<int>> a(n, vector<int>(n, 1));
    for (int r = 0; r < n; ++r) {
        a[r][r] = 0;
        a[r][n - 1 - r] = 0;
    }
    return a;
}

int main() {
    int n;
    cin >> n;
    auto a = build_even(n - (n & 1));
    if (n & 1) {
        for (auto& row : a) row.push_back(1);
        a.push_back(vector<int>(n, 1));
        a[n - 1][n - 1] = 0;
    }
    vector<pair<int, int>> edges;
    for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j < n; ++j) {
            if (a[i][j]) {
                edges.emplace_back(i + 1, j + 1);
            }
        }
    }
    cout << edges.size() << "\n";
    for (auto e : edges) {
        cout << e.first << " " << e.second << "\n";
    }
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define ll int64_t
#define _GLIBCXX_DEBUG
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
//約数列挙(√N)
vector< int64_t > divisor(int64_t n) {
  vector< int64_t > ret;
  for(int64_t i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}
//素因数分解(√N)
map< int64_t, int > prime_factor(int64_t n) {
  map< int64_t, int > ret;
  for(int64_t i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}
//素数テーブル(NloglogN)
vector< bool > prime_table(int n) {
  vector< bool > prime(n + 1, true);
  if(n >= 0) prime[0] = false;
  if(n >= 1) prime[1] = false;
  for(int i = 2; i * i <= n; i++) {
    if(!prime[i]) continue;
    for(int j = i + i; j <= n; j += i) {
      prime[j] = false;
    }
  }
  return prime;
}
//二項係数(K)
template< typename T >
T binomial(int64_t N, int64_t K) {
  if(K < 0 || N < K) return 0;
  T ret = 1;
  for(T i = 1; i <= K; ++i) {
    ret *= N--;
    ret /= i;
  }
  return ret;
}
//二項係数テーブル(N^2)
template< typename T >
vector< vector< T > > binomial_table(int N) {
  vector< vector< T > > mat(N + 1, vector< T >(N + 1));
  for(int i = 0; i <= N; i++) {
    for(int j = 0; j <= i; j++) {
      if(j == 0 || j == i) mat[i][j] = 1;
      else mat[i][j] = mat[i - 1][j - 1] + mat[i - 1][j];
    }
  }
  return mat;
}
int main(){
  string s;
  cin >> s;
  cout << "ABC"+s << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <functional>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define SQ(x) ((x)*(x))
#define Mod(x, mod) (((x)+(mod)%(mod))
#define MP make_pair
#define PB push_back
#define Fi first
#define Se second
#define INF (1<<29)
#define EPS 1e-10
#define MOD 1000000007

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

int N,K,T,U,V,L;

void solve(int D, double &nd, double &nt, double &restt, int &have){
  double ddis = (restt+have*T)*V;
  if(D-nd < ddis){
    if(D-nd < restt*V){
      restt = (restt*V-(D-nd))/V;
    }else{
      double diff = D-nd; diff -= restt*V;
      double overdis = (have*T*V-diff)/V;
      have = overdis/T;
      restt = overdis-have*T;
    }
    nt += (double)(D-nd)/V;
  }else{
    double uset = restt+have*T;
    double diff = (D-nd)-ddis;
    nt += uset + diff/U;
    restt = 0;
    have = 0;
  }
  nd = D;
  have++;
  if(have > K){
    restt = T;
    have--;
  }
}

int main(){
  scanf("%d%d%d%d%d%d",&N,&K,&T,&U,&V,&L);
  double nd = 0, nt = 0, restt = 0;int  have = 0;
  rep(i,N){
    int D;
    scanf("%d",&D);
    solve(D, nd, nt, restt, have);
    //    printf("%.12lf\n", nt);
  }
  solve(L, nd, nt, restt, have);
  printf("%.12lf\n", nt);
  return 0;
}

Measured memory_bytes: 1224
#include <iostream>
//#include <iomanip>
#include <string>
//#include <vector>
//#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
//#include <queue>
//#include <deque>
//#include <bitset>
//#include <math.h>
using namespace std ;
using ll = long long ;
//using ld = long double ;
//using vll = vector<ll> ;
//using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
//using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;
//#define all(v) v.begin(),v.end()
//ll mod = 1000000007 ;
//long double pie = acos(-1) ;
//ll INF = 1000000000000 ;

//void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
//void fix_cout(){cout << fixed << setprecision(20) ;}

int main(){
	string s,t,u ;
	cin >> s >> t ;
	ll a,b ;
	cin >> a >> b ;
	cin >> u ;
	cout << a-(s==u) << " " << b-(t==u) << endl ;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
	int n,m;
	scanf("%d%d",&n,&m);	
	
	//arrayA
	int a[n][m];
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			scanf("%d",&a[i][j]);
		}
	}

	//arrayB
	int b[m];
	for(int i=0;i<m;i++){
		scanf("%d",b + i);
	}
	
	//calc
	int c[n];
	for(int i=0;i<n;i++){
		c[i] = 0;
		for(int j=0;j<m;j++){
			c[i] += a[i][j] * b[j];
		}
	}
	for(int i=0;i<n;i++){
		printf("%d\n",c[i]);
	}
	return 0;
}





Measured memory_bytes: 2720