akhauriyash/Code-Regression huggingface dataset:
import java.io.*;
class Main{
	public static void main (String[] args) throws IOException{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			String line = br.readLine();
			String[] in = line.split(" ");
			if(in[1].equals("+"))
				System.out.println(Integer.parseInt(in[0]) + Integer.parseInt(in[2]));
			else if (in[1].equals("-"))
				System.out.println(Integer.parseInt(in[0]) - Integer.parseInt(in[2]));
			else if (in[1].equals("*"))
				System.out.println(Integer.parseInt(in[0]) * Integer.parseInt(in[2]));
			else if (in[1].equals("/"))
				System.out.println(Integer.parseInt(in[0]) / Integer.parseInt(in[2]));
			else break;
		}
	}
}

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

signed main(void)
{
	int n, m;
	cin >> n >> m;
	vector<int> g[n];
	rep(i, m)
	{
		int a, b;
		cin >> a >> b;
		--a; --b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	rep(i, n)
	{
		cout << g[i].size() << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 1000000000
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int W,H,N;
  cin >> W >> H >> N;
  int xy[W+1][H+1];
  for(int i=0;i<W+1;i++){
    for(int j=0;j<H+1;j++){
      xy[i][j] = 0;
    }
  }
  for(int k=0;k<N;k++){
    int x,y,a;
    cin >> x >> y >> a;
    if(a==1){
      for(int i=0;i<x;i++){
        for(int j=0;j<H+1;j++){
          xy[i][j] = 1;
        }
      }
    }
    else if(a==2){
      for(int i=x+1;i<W+1;i++){
        for(int j=0;j<H+1;j++){
          xy[i][j] = 1;
        }
      }
    }
    else if(a==3){
      for(int i=0;i<W+1;i++){
        for(int j=0;j<y;j++){
          xy[i][j] = 1;
        }
      }
    }
    else if(a==4){
      for(int i=0;i<W+1;i++){
        for(int j=y+1;j<H+1;j++){
          xy[i][j] = 1;
        }
      }
    }
  }
  int XMin=101,YMin=101,XMax=0,YMax=0;
  for(int i=0;i<W+1;i++){
    for(int j=0;j<H+1;j++){
      if(xy[i][j]==0){
        XMin = min(XMin,i);
        XMax = max(XMax,i);
        YMin = min(YMin,j);
        YMax = max(YMax,j);
      }
    }
  }
  if(XMin==101 && YMin == 101) cout << 0 << endl;
  else cout << (XMax - XMin) * (YMax - YMin) << endl;
}



Measured memory_bytes: 256
# -*- coding: utf-8 -*-

X, Y, Z, K = map(int, input().split())
A = sorted(map(int, input().split()), reverse=True)
B = sorted(map(int, input().split()), reverse=True)
C = sorted(map(int, input().split()), reverse=True)

ABC = []

for x in range(X):
    for y in range(Y):
        if (x + 1) * (y + 1) > K:
            break
        for z in range(Z):
            if (x + 1) * (y + 1) * (z + 1) > K:
                break
            ABC.append(A[x] + B[y] + C[z])

ABC = sorted(ABC, reverse=True)
ABC = ABC[:K]

print("\n".join(map(str, ABC)))


Measured memory_bytes: 9544
#include <stdio.h>
int main()
{
    int a,b,n,i,j,k;
    scanf("%d %d %d",&a,&b,&n);
    if(b-a+1>=2*n)
    {
        for(i=a;i<=a+n-1;i++)
            printf("%d\n",i);
        for(j=b-n+1;j<=b;j++)
            printf("%d\n",j);
    }
    else
    {
        for(k=a;k<=b;k++)
            printf("%d\n",k);
    }
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <climits>
#include <set>
#include <string>
#include <algorithm>
#include <vector>
#define MAX 1000000007


using namespace std;
#define ll long long
#define dbg if(0)
#define ISRANGE(val,lo,hi) ((lo<=val)&&(val<hi))



int main(){
    ll ans,a,b,c;
    cin >>a>>b>>c;
    ans=min(min(a+b,b+c),c+a);

    cout <<ans<<endl;

    return 0;

}

Measured memory_bytes: 256
import java.util.*;
 
public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
 
        int h = stdIn.nextInt();
        int w = stdIn.nextInt();
        int n = stdIn.nextInt();
        //int x = stdIn.nextInt();
        //int num[] = new int[];
        //String s = stdIn.next();
        //String t = stdIn.next();
        //char c[] = s.toCharArray();
        
        //c[0] += 1;
        //int sum = 0;
        //boolean flag = true;
        //for(int i = 0; i < s.length(); i++){
        //}
        
        if(n % Math.max(h, w) == 0){
            System.out.println(n / Math.max(h, w) );
        }else{
            System.out.println(n / Math.max(h, w) + 1);
        }
 
        //System.out.println();
        //System.out.print();
 
        stdIn.close();
    }
}

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

const ll INF = 1001001001;

const double PI=3.141592653;

const ll sosu = 1000000007;//大きい素数

//提出のときに言語がc＋＋似合っていることを確認する

//絶対値の関数
int z(int a,int b){
  if(a>b) return a-b;
  else return b-a;
}

int main(){
  int k;
  string s;
  cin>>k>>s;
  int len = s.size();
  if(len<=k){
    cout<<s<<endl;
  }else{
    for(int i=0;i<k;i++){
      cout<<s.at(i);
    }
    cout<<"..."<<endl;
  }
}


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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

bool flag[1000005];

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

	int s; cin >> s;

	int an = s;
	int ans = 1;

	while(!flag[an]){
		flag[an] = true;
		if(an%2 == 0) an /= 2;
		else an = an*3+1;
		ans++;
	}

	cout << ans << endl;
	
	return 0;

}


Measured memory_bytes: 256
// https://atcoder.jp/contests/abc151/tasks/abc151_f

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n)   for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); i++)
#define DUMP(a, n) REP(_i, n) printf("%d%c", a[_i], _i + 1 == n ? '\n' : ' ')
#define DUMP2D(a, n, m) REP(_i, n) REP(_j, m) printf("%d%c", a[_i][_j], _j + 1 == m ? '\n' : ' '); puts("")

const int N_MAX = 50;
const double EPS = 1e-10;

double add(double a, double b) {
  if (abs(a + b) < EPS * (abs(a) + abs(b))) return 0;
  return a + b;
}

struct P {
  double x;
  double y;
  P() {}
  P(double x, double y) : x(x), y(y) {}
  P operator + (P p) {
    return P(add(x, p.x), add(y, p.y));
  }
  P operator - (P p) {
    return P(add(x, -p.x), add(y, -p.y));
  }
  P operator * (double d) {
    return P(x * d, y * d);
  }
  double dot(P p) {
    return add(x * p.x, y * p.y);
  }
  double det(P p) {
    return add(x * p.y, -y * p.x);
  }
  double norm2() {
    return this->dot(*this);
  }
};

int N;
// double x[N_MAX];
// double y[N_MAX];
P ps[N_MAX];


vector<P> intersection(int i, int j, double r) {
  vector<P> ret;
  P p = ps[j] - ps[i];
  if (p.y == 0) {
    double x = p.x / 2;
    double y2 = r * r - x * x;
    if (y2 < 0) return ret;
    for (int s = -1; s <= 1; s += 2) {
      double y = s * sqrt(y2);
      ret.push_back(ps[i] + P(x, y));
    }
  } else {
    double pn2 = p.norm2();
    double a = 4 * pn2;
    double b = -4 * p.x * pn2;
    double c = pn2 * pn2 - 4 * p.y * p.y * r * r;
    double d = b * b - 4 * a * c;
    if (d < 0) return ret;
    for (int s = -1; s <= 1; s += 2) {
      double x = (-b + s * sqrt(d)) / (2 * a);
      double y = (pn2 / 2 - p.x * x) / p.y;
      ret.push_back(ps[i] + P(x, y));
    }
  }
  return ret;
}

bool check(P c, double r) {
  REP(i, N) if (hypot(ps[i].x - c.x, ps[i].y - c.y) > r + EPS) return false;
  return true;
}

bool C(double r) {
  bool found = false;
  REP(j, N) REP(i, j) {
    auto xs = intersection(i, j, r);
    if (xs.empty()) return false;
    for(auto x : xs) if (check(x, r)) found = true;
  }
  return found;
}

void solve() {
  double hi = 2000;
  double lo = 0;
  REP(i, 100) {
    // printf("hi: %f, lo :%f\n", hi, lo);
    double mi = (hi + lo) / 2;
    if (C(mi)) hi = mi;
    else lo = mi;
  }
  printf("%.18f\n", hi);
}

void input() {
  scanf("%d", &N);
  REP(i, N) scanf("%lf%lf", &ps[i].x, &ps[i].y);
}

int main() {
  input();
  solve();
  return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args){
      Scanner scan = new Scanner(System.in);   
      String s = scan.next();
      System.out.println(s.matches("[A][a-z][a-z]*[C][a-z]*[a-z]") ? "AC" : "WA");
    }
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
long long zuo[2005][2005],you[2005][2005],shang[2005][2005],xia[2005][2005];
long long H,W;
char a[2005][2005];
int main()
{
	char t;
	scanf("%lld%lld",&H,&W);
	for(int i=1;i<=H;++i)
		for(int j=1;j<=W;++j)
		    scanf(" %c",&a[i][j]);
	for(int i=1;i<=H;++i)
		for(int j=1;j<=W;++j)
			if(a[i][j-1]=='.') zuo[i][j]=zuo[i][j-1]+1; 
	for(int i=1;i<=W;++i)
		for(int j=1;j<=H;++j)
			if(a[j-1][i]=='.') shang[j][i]=shang[j-1][i]+1; 
	for(int i=H;i>=1;--i)
	    for(int j=W;j>=1;--j)
	        if(a[i][j+1]=='.') you[i][j]=you[i][j+1]+1;
	for(int i=W;i>=1;--i)
	    for(int j=H;j>=1;--j)
	        if(a[j+1][i]=='.') xia[j][i]=xia[j+1][i]+1;
	long long ans=0;
	for(int i=1;i<=H;++i)
	{
		for(int j=1;j<=W;++j)
		{
			if(a[i][j]!='.') continue;
			ans=max(ans,zuo[i][j]+you[i][j]+shang[i][j]+xia[i][j]+1);
	    }
	}
	 cout<<ans<<endl;
	return 0;
 } 

Measured memory_bytes: 132972
#include<iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	int a[n],sum=0;
	for(int i=0;i<n;i++)cin>>a[i];
	for(int i=1;i<n-1;i++){
		if((a[i]>a[i-1]&&a[i]<a[i+1])||(a[i]<a[i-1]&&a[i]>a[i+1]))sum++;
	}
	cout<<sum<<'\n';
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
using ll=long long;
using namespace std;


int main()
{
    int n,x;
    cin>>n>>x;
    vector<int> A(n);

    for(int i=0; i<n;++i)
    {
        scanf("%d",&A[i]);
    }
    sort(A.begin(),A.end());

    int count=0;
    if(x<A[0]) ;
    else
    {
    
        for(;count<n;)
        {
            x-=A[count];
            count++;
            if(count==n)
            {
                if(x==0)count=n;
                else count=n-1;
                break;
            }
            if(x<A[count]) break;
        }

    }

    cout<<count<<"\n";
    
    return 0;

}

Measured memory_bytes: 256
import math
import fractions

def makeDivisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

def bitlist(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res

def makeNeighbor(es,n):
    nlist = [[] for i in range(n+1)]
    for i in es:
        nlist[i[0]].append(i[1])
        nlist[i[1]].append(i[0])
    return nlist
    
#a = list(map(int, input().split()))
# --------------------------------------------

n = int(input())
es = []
for i in range(n-1):
    es.append(list(map(int, input().split())))
nb = [[] for i in range(n+1)]
ct = 0

for i in es:
    nb[i[0]].append([i[1],ct])
    nb[i[1]].append([i[0],ct])
    ct+=1
#print(nb)
ans = [-1 for i in range(n-1)]
mx = 0
for i in nb:
    if mx<len(i) : mx = len(i)

que = [[1,0]]
end = [0 for i in range(n+1)]
done = 0
end[1]=1
while(len(que) > done):
    nowpos = que[done][0]
    nowcol = que[done][1]
    end[nowpos]=1
    for k in nb[nowpos]:
        if(end[k[0]]==0):
            nowcol += 1
            nowcol %= mx
            que.append([k[0],nowcol])
            ans[k[1]] = nowcol+1
    done+=1
print(mx)
for i in range(n-1): print(ans[i])

Measured memory_bytes: 120788
import math
import sys
import os

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

def divisor_count(n):
    divisors = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors += 1
            if i != n // i:
                divisors += 1  
    return divisors    

N = I()
ans = 0

# for i in range(1,N):
#     ans += divisor_count(i)

for i in range(1,N):
    ans += (N-1)//i

print(ans)

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

int main(){
    ll a,b;
    cin>>a>>b;
    string ans="Negative";
    if(a>0){
        ans="Positive";
    }else if(a<=0 and b>=0){
        ans="Zero";
    }else if((b-a)%2==1){
        ans="Positive";
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

    int lmax = 1;
    int rmin = N;
    for(int i=0; i<M; i++){
        int l, r;
        cin >> l >> r;
        if(l > lmax) lmax = l;
        if(r < rmin) rmin = r;
    }

    if(lmax > rmin) cout << 0;
    else cout << rmin - lmax + 1;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=(ll)1e9+7;
//const ll MOD=(ll)998244353;
const ll INF=(ll)1e18+10;
const double PI = 2.0*acos(0);
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int dy[]={-1,1,0,0};
int dx[]={0,0,-1,1};


void solve(int ca){
    int N,K; cin>>N>>K;
    vector<int> a(N);

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

    for (int i = 0; i < K; ++i) {
        bool is_all=true;
        vector<int> cnt(N+1,0);
        for (int j = 0; j < N; ++j) {
            if(a[j]!=N) is_all= false;
            cnt[max(0,j-a[j])]++;
            cnt[min(N,j+a[j]+1)]--;
        }
        if(is_all){
            for (int j = 0; j < N; ++j) {
                cout<<a[j]<<" ";
            }
            cout<<endl;
            return;
        }

        int r=0;
        for (int j = 0; j < N; ++j) {
            r+=cnt[j];
            a[j]=r;
        }
    }

    for (int i = 0; i < N; ++i) {
        cout<<a[i]<<" ";
    }
    cout<<endl;

}

//#define MULTI
int main() {
#ifdef MULTI
    int N; cin>>N;
    for (int i = 0; i < N; ++i) {
        solve(i+1);
    }
#else
    solve(0);
#endif
    return 0;
}


Measured memory_bytes: 4924
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int MAXN=1e5+5;
const ll inf=(1ll<<63-1);
ll a[MAXN];
ll dp[MAXN];
int main()
{
 
    ll n,e,t;
    cin>>n>>e>>t;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    memset(dp,(ll)0x3f3f3f3f,sizeof(dp));
    dp[0]=0;
    ll mn=inf;
    for(int i=1,now=0;i<=n;i++){
        while(t<=2*(a[i]-a[now+1]))
        {
            mn=min(mn,dp[now]-2*a[now+1]);
            now++;
        }
        dp[i]=dp[now]+t;
        dp[i]=min(dp[i],mn+2*a[i]);
 
    }
    cout<<e+dp[n]<<endl;
    return 0;
}

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

using namespace std;

#define int long long


int t,i,b;
string a;
map<string, set < pair<int ,int> > >m;

signed main(){

   cin>>t;
 i=1;
  while(t--){

       cin>>a>>b;
       m[a].insert({b*-1,i});

            i++;         
   }
  for(auto it=m.begin();it!=m.end();it++){
     for( auto it1=it->second.begin();it1!=it->second.end();it1++)
       cout<< it1->second<<endl;}
}
    
    

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int n,k,ans,v[50],sum;
vector<int> vec;
int main(){
    cin>>n>>k;
    for(int i=0;i<n;i++)cin>>v[i];
    int x=min(n,k);
    for(int i=0;i<=x;i++){
        for(int a=0;a<=i;a++){
            int b=i-a;
            sum=0;
            vec.erase(vec.begin(),vec.end());
            for(int j=0;j<a;j++){
                vec.push_back(v[j]);
                sum+=v[j];
            }for(int j=0;j<b;j++){
                vec.push_back(v[n-1-j]);
                sum+=v[n-1-j];
            }
            sort(vec.begin(),vec.end());
            int y=k-i;
            for(int j=0;j<i&&vec[j]<0&&y;j++){
                sum-=vec[j];
                y--;
            }
            ans=max(ans,sum);
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>
using namespace std;
typedef long long unsigned int ll;

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

#define INF (1e9)
#define PI  (acos(-1))




int main()
{
	int lines[3];
	int a = 0, b=0 , c=0, d=0;
	while(true){
		cin >> lines[0] >> lines[1] >> lines[2];
		sort(lines, lines + 3);

		int left = lines[0] * lines[0] + lines[1] *lines[1];
		if (lines[2] >= lines[0]+lines[1] ) {
			//三角形不成立
			cout << a << " " << b << " " << c << " " << d << endl;
			return(0);
		}else if (left == lines[2] *lines[2]) {
			//直角三角形
			a++;
			b++;
		}
		else if (left> lines[2] * lines[2]) {
			//鋭角三角形
			a++;
			c++;
		}
		else if (left < lines[2] * lines[2]) {
			//鈍角三角形
			a++;
			d++;
		}
	}

	return 0;


}




Measured memory_bytes: 3148
defmodule Main do
  def main do
    IO.read(:line)
    |> String.trim()
    |> String.to_integer()
    |> solve()
    |> IO.puts()
  end

  @doc ~S"""
  https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_a

  ## Examples

      iex> MSolutions2020A.solve(725)
      7
      iex> MSolutions2020A.solve(1600)
      2

  """
  def solve(x) when x <= 599, do: 8
  def solve(x) when x <= 799, do: 7
  def solve(x) when x <= 999, do: 6
  def solve(x) when x <= 1199, do: 5
  def solve(x) when x <= 1399, do: 4
  def solve(x) when x <= 1599, do: 3
  def solve(x) when x <= 1799, do: 2
  def solve(_x), do: 1
end


Measured memory_bytes: 30572
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,k = inpm()

ans = (n//k)**3
if k % 2 == 0:
    cnt = 0
    for i in range(1,n+1):
        if i % k == k//2:
           cnt += 1
    ans += cnt**3

print(ans)

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

int main() {
    string s, t;
    cin >> s >> t;
    int ans = 0;
    for (int i = 0; i < (int)s.size(); i++) {
        if (s[i] == t[i]) {
            continue;
        }
        ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3580
// Code by Nguyen Huu Lam
#include<bits/stdc++.h>
using namespace std;

typedef long long LL;
const LL MaxN = 1 + 2e5;

LL n, a[MaxN], b[MaxN], m;

void InOut(){
    #define TASK "ABC"
    freopen(TASK".inp","r",stdin);
    freopen(TASK".out","w",stdout);
}

LL Check(LL k){
    LL kq = 0;
    for(int i = 0 ; i < n ; ++i){
        if(a[i] * b[i] <= k) continue;
        kq += a[i] - k / b[i];
    }
    return kq <= m;
}

int main(){
    // InOut();
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> m;
    for(int i = 0 ; i < n ; ++i) cin >> a[i];
    for(int i = 0 ; i < n ; ++i) cin >> b[i];
    sort(a, a + n);
    sort(b, b + n);
    reverse(b, b + n);
    LL l = 0, r = 1e12;
    while(l < r){
        LL tg = (l + r) / 2;
        if(Check(tg)) r = tg;
        else l = tg + 1;
    }
    cout << l << endl;

    return 0;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int INF=1e9;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};

int main() {
  string s;
  cin>>s;
  int ans=0;
  rep(i,s.length()){
    if(s[i]=='A'){
      int cnt=i;
      for(;i<s.length();i++){
        if(s[i]=='Z'){
          ans=i-cnt+1;
        }
      }
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3764
//
// Created by chuan on 2020-04-11.
//

//
// Created by chuan on 2020-04-11.
//


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <queue>
#include <numeric>

using ll = long long;

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);

    int X, Y, A, B, C;
    cin >> X >> Y >> A >> B >> C;

    vector<ll> p(A), q(B), r(C);
    for (auto &e : p) cin >> e;
    for (auto &e : q) cin >> e;
    for (auto &e : r) cin >> e;
    sort(p.begin(), p.end(), greater<ll>());
    sort(q.begin(), q.end(), greater<ll>());
    sort(r.begin(), r.end(), greater<ll>());

    int Z = 0;

    for (auto& e : r) {
        if (  (X>0 && e > p[X - 1]) || (Y> 0 && e > q[Y - 1] ) ) {
            Z++;
            if (X == 0) Y--;   
            else if (Y == 0) X--;
            else if (p[X - 1] < q[Y - 1]) 
                X--;
            else
                Y--;
        }
    }

    ll ans{};
    if (X > 0)
        ans = accumulate(p.begin(), p.begin() + X, ans);
    if (Y > 0)
        ans = accumulate(q.begin(), q.begin() + Y, ans);
    if (Z > 0)
        ans = accumulate(r.begin(), r.begin() + Z, ans);

    cout << ans << endl;
    // for a colorless apple, want to make it

    return 0;
}


Measured memory_bytes: 2560
/*************************************************************************
>>> Author: WindCry1
>>> Mail: lanceyu120@gmail.com
>>> Website: https://windcry1.com
>>> Date: 12/30/2019 11:03:37 PM
*************************************************************************/
//#pragma GCC optimize(3)
//#pragma GCC diagnostic error "-std=c++11"
#include <cstring>
#include <cmath>
#include <cstdio>
#include <cctype>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <iostream>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <stack>
#include <bitset>
#include <iomanip>
#include <list>
#include <sstream>
#include <fstream>
#if __cplusplus >= 201103L
#include <unordered_map>
#include <unordered_set>
#endif
#define endl '\n'
#define ALL(x) x.begin(),x.end()
#define ll long long
#define ull unsigned long long
#ifdef WindCry1
#define DEBUG(x) cout<<#x<<" : "<<x<<endl;
#endif
#define lowbit(x) x&(-x)
#define ls u<<1
#define rs u<<1|1
using namespace std;
template<typename T> inline T MIN(const T &a,const T &b) {return a<b?a:b;}
template<typename T> inline T MAX(const T &a,const T &b) {return a>b?a:b;}
template<typename T,typename ...Args> inline T MIN(const T &a,const T &b,Args ...args) {return MIN(MIN(a,b),args...);}
template<typename T,typename ...Args> inline T MAX(const T &a,const T &b,Args ...args) {return MAX(MAX(a,b),args...);}
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
const double eps = 1e-8;
const int INF = 0x3f3f3f3f;
const int mod = 1e9+7;
const int dir[4][2]={-1,0,1,0,0,-1,0,1};
int a[200010];
int main(){
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#ifdef WindCry1
	freopen("C:\\Users\\LENOVO\\Desktop\\in.txt","r",stdin);
#endif
	int n,k;cin>>n>>k;
	for(int i=1;i<=n;i++) cin>>a[i];
	sort(a+1,a+1+n);
	ll sum=0;
	for(int i=1;i<=n-k;i++) sum+=a[i];
	cout<<sum<<endl;
	return 0;
}



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

using namespace std;

typedef long long llong;
typedef unsigned long long ullong;
typedef pair<int, int> P;
#define inf 1ll<<60
#define pqueue priority_queue
#define mp make_pair
#define pb push_back
#define fn fill_n
#define int llong


signed main(){
	int ab, bc, ca;
	cin >> ab >> bc >> ca;
	cout << bc * ab /2 << endl;

	return 0;
}

Measured memory_bytes: 256
N=input()
a=input().split()
a=[int(x) for x in a]

t=0
for i in range(len(a)-1):
    for j in range(i+1, len(a)):
        if abs(a[i]-a[j])>t:
            t=abs(a[i]-a[j])
        
print(t)






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

using namespace std;

/*helpfull*/
using vl  = vector<long long>;
using vpl = vector<pair<long long, long long>>;
using vs = vector<string>;
using pl  = pair<long long, long long>;
using ll  = long long int;
using vb  = vector<bool>;


struct hash_pair {
	template <class T1, class T2>
	size_t operator()(const pair<T1, T2>& p) const
	{
		auto hash1 = hash<T1> {}(p.first);
		auto hash2 = hash<T2> {}(p.second);
		return hash1 ^ hash2;
	}
};
// #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif

// shortcut macros
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mp              make_pair
#define fi              first
#define se              second
// #define mt              make_tuple
#define pb              push_back
#define all(x)          (x).begin(), (x).end()
#define ini(a, v)       memset(a, v, sizeof(a))
#define rep(i, a, n)    for(ll i=a ; i<n ; ++i)
#define For(i, n)       rep(i, 0, n)
#define sz(x)           (int((x).size()))
#define ump(x,y)        unordered_map<x,y>
#define umpr(x,y,z)     unordered_map<x,y,z>
void printcase(ll &x) {
	cout << "Case #" << x << ": ";
}
void read(vector<ll>&v, ll &n) {
	For(i, n)
	cin >> v[i];
}
void read(ll &x) {
	cin >> x;
}
void read(string &s) {
	cin >> s;
}
void read(int &x) {
	cin >> x;
}
void read(ll a[], ll &n) {
	For(i, n)
	cin >> a[i];
}
void print() {
	cout << endl;
}
void write(vector<ll>&v, ll &n) {
	For(i, n)
	cout << v[i] << " ";
	cout << endl;
}
void write(vector<ll>&v) {
	ll n = v.size();
	For(i, n)
	cout << v[i] << " ";
	cout << endl;
}
void write(ll x) {
	cout << x << endl;
}
void write(string &s) {
	cout << s << endl;
}
void write(int &x) {
	cout << x << endl;
}
void write(ll a[], ll &n) {
	For(i, n)
	cout << a[i] << " ";
	cout << endl;
}


int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	IOS;
	ll x;
	cin >> x;
	if (x < 30)
		cout << "No" << endl;
	else
		cout << "Yes" << endl;
	return 0;
}




Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
using namespace std;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
const array<pair<int,int>,4> fd{make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 

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



Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main ()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	string s;
	cin>>n>>s;
	for(char &x:s)
		x='A'+(x-'A'+n)%26;
	cout<<s<<'\n';
}


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

using namespace std;

int a[15];

int main()
{
    int n , s = 0 , x;
    cin >> n;
    for(int i = 1 ; i <= n ; i++)
        cin >> x , a[i] = x , s += x;
    sort(a + 1 , a + n + 1);
    s -= a[n];
    if(a[n] < s)
        cout << "Yes\n";
    else cout << "No\n";
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
  int n, r, x;
  scanf("%d%d", &n, &r);
  if(n >= 10){
    printf("%d", r);
  }
  else{
    x = r - 100*n + 1000;
    printf("%d", x);
  }
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <string>
#include <set>
#include <bitset>
#include <unordered_map>
#include <cmath>

using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
template <class T>
using Vvec = vector<vector<T> >;

template <class T>
void debug(T& v)
{
    for(auto& x: v) cout << x << " ";
    cout << endl;
}

int main()
{
    ll N, A, B;
    cin >> N >> A >> B;

    ll ans = N / (A+B) * A;
    N = N % (A+B);
    ans += min(A, N);
    cout << ans << endl;
}

Measured memory_bytes: 256
/**
 *      purpose : 
 *      author  : kyomukyomupurin
 *      created : 
**/

// input/output
#include <fstream>
#include <iostream>
#include <sstream>
// container class
#include <array>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
// math, algorithm
#include <algorithm>
#include <cmath>
#include <complex>
#include <numeric>
// etc
#include <bitset>
#include <cassert>
#include <cctype>
#include <cstring>
#include <chrono>
#include <ext/random>
#include <ext/rope>
#include <functional>
#include <iomanip>
#include <random>
#include <utility>
// using-directive
using namespace std;
// alias template
using int64 = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vl = std::vector<int64>;
using pii = std::pair<int, int>;
using pll = std::pair<int64, int64>;
// text macro replacement
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(_) (_).begin(), (_).end()
#define rall(_) (_).rbegin(), (_).rend()
#define print(_) std::cout << (_) << '\n'
#define debug(_) std::cerr << #_ << ": " << (_) << '\n'
// variadic template
template<typename T> inline void chmin(T &a, T b) {if (a > b) a = b; return;}
template<typename T> inline void chmax(T &a, T b) {if (a < b) a = b; return;}
template<typename T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  os << '{';
  for (size_t i = 0; i < vec.size(); ++i) {
    os << vec[i];
    if (i != vec.size() - 1) os << ',';
  }
  os << '}';
  return os;
}
template<typename T, typename U> std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << '{' << p.first << " " << p.second << '}';
}
// constant
constexpr int INF = (1<<30) - 1;  // 1.073741823e9
constexpr int64 INF64 = (1LL<<62) - 1;  // 4.611686018427387903e18
constexpr int MOD = 1'000'000'007;

double calc_triangle(double X1, double Y1, double X2, double Y2, double X3, double Y3) {
  return abs((X2 - X1) * (Y3 - Y1) - (Y2 - Y1) * (X3 - X1)) *  0.5;
}

int main(){
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);

  double X1, X2, X3, Y1, Y2, Y3;
  cin >> X1 >> Y1 >> X2 >> Y2 >> X3 >> Y3;
  double s = calc_triangle(X1, Y1, X2, Y2, X3, Y3);
  double h = 2 * s / max({hypot(X1 - X2, Y1 - Y2), hypot(X2 - X3, Y2 - Y3), hypot(X3 - X1, Y3 - Y1)}); 
  cout << setprecision(15)  << s / (0.5 * (hypot(X1 - X2, Y1 - Y2) + hypot(X2 - X3, Y2 - Y3) + hypot(X3 - X1, Y3 - Y1)) + h);

  return 0;
}

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

int main() {
  string S,T;
  cin>>S>>T;
  long s=S.size(),t=T.size();
  long ans=1234567890;
  for(int i=0;i<s-t+1;i++){
    string tmp=S.substr(i,t);
    long tmpans=0;
    //cout<<tmp<<endl;
    for(int j=0;j<t;j++){
      if(tmp[j]!=T[j]) tmpans++;
    }
    ans=min(tmpans,ans);
    }

cout<<ans<<endl;
}


Measured memory_bytes: 3624
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

class Program
{
    static void Main(string[] args)
    {
        var NMXY = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int N = NMXY[0], M = NMXY[1], X = NMXY[2], Y = NMXY[3];
        var x = Console.ReadLine().Split().Select(int.Parse).Max();
        var y = Console.ReadLine().Split().Select(int.Parse).Min();
        for (int Z = -100; Z <= 100; Z++)
        {
            if (X < Z && Z <= Y && x < Z && Z <= y)
            {
                Console.WriteLine("No War");
                return;
            }
        }
        Console.WriteLine("War");
    }
}

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

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, x, res=0;
	cin >> n;
	for(int i=0; i<n; i++){
		cin >> x;
		res+=x-1;
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
using ll = long long;

long double PI = acos(-1);
const int MOD = 1e9 + 7;

/*
long double root(long double x)
{
        
        long double left{}, right{ x }, mid{};
        
        if( x < 1 ) right = 1;
    
        while( right - left > 0.00001 )
        {
            mid = ( left + right ) / 2.0;
            if( mid * mid > x )
            {
                right = mid;
            }
            else
            {
                left = mid;
            }
        }
        // cout << fixed << setprecision( 8 ) << mid << "  " << sqrt( x ) << endl;
    
    return mid;
}
 */

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

    
    long double angle_l, angle_s, angle;
    angle_s = h * PI / 6.0 + m * PI / 360.0;
    angle_l = m * PI / 30.0;
    angle = angle_l - angle_s;
    

    /*
    long double angle;
    angle = (5.0 * h - m) * PI / 30.0;
     */

    long double ans;

    // cout << angle_l << ' ' << angle_s << endl;

    // cout << angle << endl;
    ans = - 2.0*a*b*cos(angle) + a*a + b*b ;
    ans = sqrt(ans);
    cout << setprecision(15) << ans << endl;

    return 0;
}

Measured memory_bytes: 4128
package main

import (
	"fmt"
)

func digit(n int)int {
	sum := 0
	for n > 0 {
		sum += n % 10
		n /= 10
	}
	return sum
}

func main() {
	var n int
	fmt.Scan(&n)
  	if n % digit(n) == 0 {
      fmt.Println("Yes")
      return
  	}
  	fmt.Println("No")
}

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

int main(void) {
    int n;
    string Tcard, Hcard;
    int Tpoint, Hpoint;
    
    cin >> n;
    Tpoint = 0;
    Hpoint = 0;
    for(int i = 0; i < n; ++i) {
        cin >> Tcard >> Hcard;
        
        if(Tcard > Hcard) {
            Tpoint += 3;
        } else if(Tcard < Hcard) {
            Hpoint += 3;
        } else {
            ++Tpoint;
            ++Hpoint;
        }
    }
    
    cout << Tpoint << ' ' << Hpoint << endl;
    
    return 0;
}



Measured memory_bytes: 3148
#include<bits/stdc++.h>
using namespace std;
int a[10],ch,k;


int  main(){
    cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4]>>k;
    for(int i=0;i<5;i++){
        for(int u=i+1;u<5;u++){
            if(a[u]-a[i]>k){
                 cout<<":("<<endl;
                return 0;
            }
        }
    }
    cout<<"Yay!"<<endl;





}




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

int main(){
    double x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    printf("%.7f\n", sqrt( pow (x1-x2, 2) + pow (y1-y2, 2) ) );
    return 0;
}


Measured memory_bytes: 3204
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        mut n: usize
    };
    //   26**10 = 141167095653376
    //          < 1000000000000001
    // < 26**11 = 3670344486987776
    let mut s = Vec::new();
    for i in 1..=11 {
        if n <= 26usize.pow(i) {
            n -= 1;
            for _ in 0..i {
                s.push((b'a' + ((n % 26) as u8)) as char);
                n /= 26;
            }
            break;
        } else {
            n -= 26usize.pow(i);
        }
    }
    println!("{}", s.iter().rev().collect::<String>());
}


Measured memory_bytes: 2184
/*                         _
                        _ooOoo_
                       o8888888o
                       88" . "88
                       (| -_- |)
                       O\  =  /O
                    ____/`---'\____
                  .'  \\|     |//  `.
                 /  \\|||  :  |||//  \
                /  _||||| -:- |||||_  \
                |   | \\\  -  /'| |   |
                | \_|  `\`---'//  |_/ |
                \  .-\__ `-. -'__/-.  /
              ___`. .'  /--.--\  `. .'___
           ."" '<  `.___\_<|>_/___.' _> \"".
          | | :  `- \`. ;`. _/; .'/ /  .' ; |
          \  \ `-.   \_\_`. _.'_/_/  -' _.' /
===========`-.`___`-.__\ \___  /__.-'_.'_.-'================

                  Please give me AC.
*/

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <bitset>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <chrono>
#include <random>

using namespace std;

using int64 = long long;
using uint64 = unsigned long long;
using vi = vector<int>;
using vl = vector<int64>;
using pii = pair<int, int>;
using pll = pair<int64, int64>;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) (v).begin(), (v).end()
#define print(x) cout << (x) << '\n'
#define print2(x, y) cout << (x) << ' ' << (y) << '\n'
#define print3(x, y, z) cout << (x) << ' ' << (y) << ' ' << (z) << '\n'
#define printn(v) rep(i, (v).size() - 1) cout << (v)[i] << ' '; cout << (v)[n - 1] << '\n';
#define debug(x) cerr << #x << ": " << (x) << '\n'
#define debug2(x, y) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v) for (size_t _ = 0; _ < v.size(); ++_){cerr << #v << "[" << _ << "] : " << v[_] << '\n';}
// constant
const int INF = (1<<30) - 1;
const int64 INF64 = (1LL<<62) - 1;

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

template<typename T> T lcm(const T a, const T b) {
    return a / gcd(a, b) * b;
}

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

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

// End of template.

int main() {
    cout << fixed << setprecision(15);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    // cin.read(buf, sizeof buf); // 注意: ./a.out < in か pbp | ./a.out で入力すること

    int64 h, w;
    cin >> h >> w;

    if (w == 1 || h == 1) {
        print(1);
        return 0;
    }
    print(((h + 1) / 2) * ((w + 1) / 2) + (h / 2) * (w / 2));

    return 0;
}



Measured memory_bytes: 256
from collections import deque
s=deque(list(input()))
q=int(input())
count=0
for i in range(q):
    query=input()
    if query=="1":
        count+=1
    elif query[2]=="1":
        if count%2==0:
            s.appendleft(query[-1])
        else:
            s.append(query[-1])
    else:
        if count%2==0:
            s.append(query[-1])
        else:
            s.appendleft(query[-1])
if count%2==1:
    s.reverse()
print(*s,sep="")

Measured memory_bytes: 16380
#include <iostream>
#include <cmath>
int main(){
  unsigned long long A;
  std::cin >> A;
  double B;
  std::cin >> B;
  int C = std::round(B * 100);

  unsigned long long mult;

  mult = A * C / 100;
 
  std::cout << mult;
  
  return 0;
}


Measured memory_bytes: 3160
#include<bits/stdc++.h>
#define    ll   long long int
#define    sz   200010

using namespace std;


ll num[sz];


int main()
{

     ll n,m,i,j,a,b,x,p;
     p=0;
     cin>>n;

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

     for(i=2;i<n;i++)
     {
         if(num[i]>num[i-1] && num[i]<num[i+1])p++;
         else  if(num[i]<num[i-1] && num[i]>num[i+1])p++;
     }

     cout<<p<<endl;


    return 0;
}


Measured memory_bytes: 256
# E - Sum of gcd of Tuples (Hard)
# https://atcoder.jp/contests/abc162/tasks/abc162_e

MOD = 10 ** 9 + 7

n, k = map(int, input().split())
dic = [0] * (k + 1)

ans = 0
for i in range(k, 0, -1):
  dic[i] = pow(k // i, n, MOD)

for i in range(k, 0, -1):
  for j in range(i * 2, k + 1, i):
    dic[i] -= dic[j]
    dic[i] %= MOD

ans = 0
for i in range(1, k + 1):
  ans += dic[i] * i
  ans %= MOD

print(ans)



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

int main(){

  int n,i;
  cin >> n;
  
  vector<int> a(n);
  vector<int> b(n);
  
  for(i=0;i<n;i++){
    cin >> a.at(i);
    b.at(a.at(i)-1) = i+1;
  }
  

   for(i=0;i<n;i++)
  cout << b.at(i) << ' ';
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <map>
#include <cmath>
#include <string>
#include <math.h>
using namespace std;

#define rep(i, o) for (int i = 0; i < (o); ++i)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)

typedef long long ll;


ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll c, ll d) { return c / gcd(c, d) * d; }

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;

  while (a > 0 && c > 0)
  {
      /* code */
      c -= b;
      if (c <= 0)
      {
          /* code */
          break;
      }
      a -= d;
  }
  string ans = (c <= 0) ? "Yes" : "No";
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3636
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		//入力の読み込み
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();  //整数Nの値
		int base = sc.nextInt();  //進数Kの値
		int i = 0;

		//基数の値^iごとに桁が増える
		while(Math.pow(base, i) <= n) {
			i++;
		}
		System.out.print(i);
	}
}

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

#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)(n-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define fi first
#define se second
#define debug(...) {cerr<<"[L"<<__LINE__<<"] "; _debug(__VA_ARGS__);}

template<typename T>
string join(const vector<T>&v, string del=", "){ stringstream s;
    for(auto x : v) s << del << x; return s.str().substr(del.size());
}
template<typename T>
ostream& operator<<(ostream& o, const vector<T>&v){
    if(v.size()) o << "[" << join(v) << "]"; return o;
}
template<typename T>
ostream& operator<<(ostream& o, const vector<vector<T> >&vv){
    int l = vv.size();
    if(l){ o<<endl; rep(i,l) o << (i==0 ? "[ " : ",\n  " ) << vv[i] << (i==l-1 ? " ]" : ""); }
    return o;
}
inline void _debug(){cerr<<endl;}
template<class First, class... Rest>
void _debug(const First& first, const Rest&... rest){cerr<<first<<" ";_debug(rest...);}

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

const double PI = (1*acos(0.0));
const double EPS = 1e-9;
const int INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const ll mod = 1e9 + 7;

inline void finput(string filename) {
    freopen(filename.c_str(), "r", stdin);
}

struct Sieve{
    int n;
    vi f, primes;
    Sieve(int n): n(n), f(n+1){
        f[0] = f[1] = -1;
        for(ll i=2; i<=n; i++){
            if(f[i]) continue;
            primes.push_back(i);
            f[i] = i;
            for(ll j=i*i; j<=n; j += i){
                if(!f[j]) f[j] = i;
            }
        }
    }
    bool isPrime(int x){ return f[x] == x; }
    vi prime_factor(int x){
        vi res;
        while(x != 1){
            res.push_back(f[x]);
            x /= f[x];
        }
        return res;
    }
    vector<pii> factor(int x){
        vi pf = prime_factor(x);
        if(pf.size() == 0) return {};
        vector<pii> res(1, pii(pf[0], 0));
        for(int p : pf){
            if(res.back().first == p){
                res.back().second++;
            }else{
                res.emplace_back(p, 1);
            }
        }
        return res;
    }
};

int main(){
    ios_base::sync_with_stdio(0);
    // finput("./input");
    auto sieve = Sieve(100010);
    vi cs(100010);
    REP(i,2,100010){
        if(sieve.isPrime(i) && sieve.isPrime((i+1)/2)){
            cs[i]++;
        }
        cs[i] += cs[i-1];
    }
    int q; cin >> q;
    rep(i,q){
        int l, r; cin >> l >> r;
        cout << cs[r] - cs[l-1] << endl;
    }
    return 0;
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
int main(){
  
  int N;
  cin>>N;
  vector<int> A(N);
  double reversesum = 0;
  
  for(int i=0;i<N;i++){
    
    cin>>A.at(i);
    reversesum+=1.0/A.at(i);
    
  }
  
  double ans = 1.0/reversesum;
  
  printf("%.10f\n",ans);
  
  return 0;
  
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define pa pair<int,int>
const int inf=2147483647;
int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return x*f;
}
int main()
{
	int a=read(),b=read(),c=read();
	printf("%d",min(b/a,c));
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	int c[3][3];
	for(int i=0;i<3;i++){
		for(int j=0;j<3;j++)cin>>c[i][j];
	}
	int a[3],b[3];
	a[0]=c[0][0];
	b[0]=0;
	a[1]=c[1][0];
	a[2]=c[2][0];
	b[1]=c[0][1]-a[0];
	b[2]=c[0][2]-a[0];
	for(int i=0;i<3;i++){
		for(int j=0;j<3;j++){
			if(a[i]+b[j]!=c[i][j]){
				cout<<"No"<<endl;
				return 0;
			}
		}
	}
	cout<<"Yes"<<endl;
	return 0;
}


Measured memory_bytes: 256
import sys

X = int(sys.stdin.readline())
exists = set()
for i in range(2, X + 10**5 + 1):
    if i in exists:
        continue
    exists.add(i)
    if X <= i:
        # print(exists)
        print(i)
        sys.exit()

    for j in range(i+i, X + 10**5 + 1, i):
        exists.add(j)

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

using namespace std;

typedef long long ll;

const ll MOD = 1000000007;
const ll INF = 1LL<<60;
//int INF = numeric_limits<int>::max();

int main(int, char**) {
	int n; cin >> n;
	vector<int> A(n), B(n), C(n-1);
	for (int i=0; i<n; i++) cin >> A[i];
	for (int i=0; i<n; i++) cin >> B[i];
	for (int i=0; i<n-1; i++) cin >> C[i];
	int ret = 0;
	ret += B[A[0] - 1];
	int prev = A[0];
	for (int i=1; i<n; i++) {
		ret += B[A[i] - 1];
		if (A[i] == prev + 1) ret += C[prev-1];
		prev = A[i];
	}
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 3624
n=int(input())
t,a=(int(i) for i in input().split(' '))
h=[int(i) for i in input().split(' ')]
T=[]
for i in range(n):
  T=T+[t-0.006*h[i]]
index=0
for i in range(n):
  if abs(T[i]-a)<abs(T[index]-a):
    index=i
print(index+1)


Measured memory_bytes: 3060
let scanInt _ = stdin.ReadLine() |> int
let scanInts _ = stdin.ReadLine().Split() |> Array.map int

let rec p2count cnt n =
  match n % 2 with
    | 1 -> cnt
    | _ -> p2count (cnt+1) (n/2)

scanInt 0
|> ignore

scanInts 0
|> Seq.map (p2count 0)
|> Seq.sum
|> printfn "%d"

Measured memory_bytes: 15068
function isPrime(num) {
    let c = Math.floor(Math.sqrt(num));
    while (c >= 2) {
        if(num % c === 0){
            return false;
        }
        c--;
    }
    return true;
}

function main(_stdin) {
    const stdin = _stdin.split('\n').filter(e => e.length).map(Number);
    const len = stdin.shift();
    let count = 0;

    for(let item of stdin) {
        if(isPrime(item)) {
            count++;
        }
    }
    console.log(count);
}


main(require('fs').readFileSync('/dev/stdin', 'utf8'));





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

using namespace std;

#define bug(x) cerr << #x << " = " << x << '\n'
#define ll     long long
#define maxn

int main() {
        //freopen(".inp","r",stdin);
        int x;
        cin >> x;
        (x >= 30) ? puts("Yes") : puts("No");
}



Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main () {
  ll N, K;
  cin >> N >> K;
  ll ans = 0;
  for (ll b = K + 1; b <= N; b ++) {
    for (ll sho = 0; sho * b <= N; sho ++) {
      ll kj = 0;
      if (sho * b + b - 1 <= N) kj = b - K;
      else {
        kj = max(0ll, N - sho * b - K + 1);
      }
      ans += kj;
    }
  }
  if (K == 0) ans -= N;
  cout << ans << endl;
}


Measured memory_bytes: 3604