akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("Ofast")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;

typedef pair<int,int>pi;
typedef vector<int>vi;

const int MAXN=100005;
const int MOD=1000000007;

#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define DEC(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
#define mp make_pair
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
#define db(x) cerr<<#x<<" = "<<x<<"\n"
#define LOW(v,x) (lower_bound(all(v),(x))-(v).begin())
#define UP(v,x) (upper_bound(all(v),(x))-(v).begin())

main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int X, Y; cin>>X>>Y;
	if ((4*X-Y)%2 == 1){
		cout<<"No";
		exit(0);
	}
	int a = (4*X-Y)/2;
	if (a>=0 && a<=X) cout<<"Yes";
	else cout<<"No";
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#pragma GCC optimize ("O3")
using namespace std;

#define f first
#define s second
#define lc (rt<<1)
#define rc (rt<<1|1)
#define mp make_pair
#define pb push_back
#define lowbit(a) (a&(-a))
#define sz(x) (int)(x).size()
#define all(x) x.begin(),x.end()
#define mst(a,v) memset(a,v,sizeof(a))
#define IOS {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<ld> vd;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

const int N=100010;
const int mod=1e9+7;
const ld PI=acos(-1.0);
const int inf=0x3f3f3f3f;
const ll INF=1e18;

int dp[N][4];
string s;

int main()
{
    IOS
    cin>>s;
    int n=sz(s);
    dp[n][3]=1;
    for(int i=n-1; ~i; i--)
        for(int j=3; ~j; j--)
        {
            dp[i][j]=dp[i+1][j]*(s[i]=='?'? 3LL:1)%mod;
            if(j<3&&(s[i]=='?'||s[i]=="ABC"[j]))
                dp[i][j]=(dp[i][j]+dp[i+1][j+1])%mod;
        }
    cout<<dp[0][0];
    return 0;
}


Measured memory_bytes: 2000
#include <iostream>
using namespace std;
int main(void){
    int a,b,c,d,x,y;
    cin>>a;
    cin>>b;
    cin>>c;
    cin>>d;
    
    cout<<(a+b+c+d)/60<<endl;
    cout<<(a+b+c+d)%60<<endl;
}



Measured memory_bytes: 3076
// -----------------------------------
// Author     : MatsuTaku
// Affiliation: Tokushima University
// Country    : Japan
// Date       : 03/28/2020
// -----------------------------------

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

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

  int K,N; cin>>K>>N;
  vector<int> A(N); for(auto& a:A) cin>>a;
  int max_dist = 0;
  int p = A.back()-K;
  for (auto a : A) {
    max_dist = max(max_dist, a-p);
    p = a;
  }
  cout << K-max_dist << endl;

  return 0;
}


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

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

    int a,b; cin >> a >> b;
    out((b+a-3)/(a-1));

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int a = sc.nextInt();
    int b = sc.nextInt();
    System.out.println((a-1)*(b-1));
  }
}

Measured memory_bytes: 22868
#pragma region header
#define _GLIBCXX_DEBUG 
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>
using namespace std;
#define int long long
signed main() {
    int N;
    string S;
    cin>>N>>S;
    int ans=0;
    int count=0;

    for(int i=0;i<N;i++){
        if(S[i]=='I'){
            count++;
        }
        else{
            count--;
        }
        ans=max(ans,count);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 3624
x,y = map(int,input().split())
money=0
if x==1:
  money+=300000
elif x==2:
  money+=200000
elif x==3:
  money+=100000
if y==1:
  money+=300000
elif y==2:
  money+=200000
elif y==3:
  money+=100000
if x==1 and y==1:
  money+=400000
print(money)  

Measured memory_bytes: 3064
x = input().split()
a = int(x[0])
b = int(x[1])
c = int(x[2])
d = int(x[3])
while a > 0 and c > 0:
  c = c - b
  a = a - d
if c <= 0:
  print('Yes')
else:
  print('No')

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

#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << ": " << arg1 << "\t|";
    __f(comma + 1, args...);
}

#define print(x) for(auto it : x) cout<< it << ' '; cout << '\n';
typedef long long ll;
typedef unsigned long long ull;
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int n; cin >> n;
    string s; cin >> s;
    int i = 0, j = n - 1;
    int ans = 0;
    while (i < j) {
        if (s[i] == 'W') {
            while (j > i && s[j] != 'R') {
                j--;
            }
            if (s[j] == 'R') {
                swap(s[i], s[j]);
                ans++;
            }
        }
        i++;
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 3772
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007



s = S()
ans = 0
i = len(s) - 1
a_cnt = 0
bc_cnt = 0
while i >= 0:
    if s[i-1:i+1] == 'BC':
        i -= 2
        bc_cnt += 1
    elif s[i] == 'A':
        i -= 1
        a_cnt += 1
        ans += bc_cnt
    else:
        a_cnt = bc_cnt = 0
        i -= 1




print(ans)

Measured memory_bytes: 41172
#pragma GCC optimize ("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
using namespace std;
using Int = long long;
typedef pair<int,int> P; typedef pair<Int,Int> Pl;
static const int mod = 1e9+7;
#define END {cout<<ans<<'\n'; return 0;}
#define ALL(v) (v).begin(),(v).end()
#define Pr(t) priority_queue<t>
#define gPr(t) priority_queue<t,vector<t>,greater<t>>
#define V(t) vector<t>
#define rep(i,n) for(int i=0; i<n; i++)
#define rer(i,l,r) for(int i=l; i<=r; i++)
#define gnr(i,l,r) for(int i=r; i>=l; i--)
#define eb emplace_back
#define pri1(a) cout<<(a)<<'\n'
#define pri2(a,n) rep(i,n-1)cout<<a[i]<<' '; cout<<a[n-1]<<'\n'
#define prip(p) cout<<p.first<<' '<<p.second<<'\n'
template<class T> inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool cmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n,m,_,x,y,q;
string s,sb;
bool ok;
char cf,cb;

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

  cin>>s; list<char>seq(ALL(s));
  int ans=0;
  while(!seq.empty()){
    cf=seq.front(),cb=seq.back();
    if(cf!=cb){
      if(cf!='x'&&cb!='x'){pri1(-1); return 0;}
      else if(cf=='x'){seq.pop_front(); ans++;}
      else{seq.pop_back(); ans++;}
    }else{seq.pop_front(); if(!seq.empty())seq.pop_back();}
  }
  END
}

Measured memory_bytes: 3536
#include<iostream>
#include<stdio.h>
#include<vector>

long long comb(long long n) {
	return (n * (n - 1)) / 2;
}
using namespace std;
int main() {
	int n;
	cin >> n;

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

	long long sum = 0;
	for (int i = 0; i < n; i++) {
		sum += comb(cnt[i]);
	}

	for (int i = 0; i < n; i++) {
		long long ans = sum - comb(cnt[a[i]]) + comb(cnt[a[i] ]- 1);
		cout << ans << endl;
	}


	return 0;
}

Measured memory_bytes: 4096
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i <=(int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
int main(){
    int a,b;cin>>a>>b;
    int count=0;
    for(int i=a;i<=b;i++){
        string str=to_string(i);
        string tmp=str;
        reverse(all(str));
        if(str==tmp)count++;
    }
    
    cout<<count<<endl;
}

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

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

int N;

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

	cin>>N;
	
	map<int,int> mp;

	for(int x=1; x<=100; x++){
		for(int y=1; y<=100; y++){
			for(int z=1; z<=100; z++){
				int t = x*x + y*y + z*z + x*y + y*z + z*x;
				mp[t]++;
			}
		}
	}

	for(int a=1; a<=N; a++){
		cout<<mp[a]<<endl;
	}

    return 0;
}






Measured memory_bytes: 5404
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#include <deque>

using namespace std;
using ll = long long;

#define rep(countName, left, right, up) for (ll countName = left; countName < right; countName += up)
#define rev(countName, right, left, down) for (ll countName = right - 1; countName >= left; countName -= down)

auto solve1(void)
{
    int a, b;
    string ans;
    cin >> a >> b;

    if (a >= b)
    {

        rep(i, 0, a, 1)
        {
            ans += to_string(b);
        }
    }
    else
    {
        rep(i, 0, b, 1)
        {
            ans += to_string(a);
        }
    }

    return ans;
}

int main(void)
{
    cout << solve1() << endl;
    return 0;
}

Measured memory_bytes: 256
import math
n = int(input())
t = [0] * (n + 1)
m = math.floor(math.sqrt(n))

for i in range(1,m):
    for j in range(1,m):
        for k in range(1,m):
            p = i*i+j*j+k*k+i*j+j*k+i*k
            if p <= n:
                t[p] += 1

for i in range(1,n + 1):
    print(t[i])

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

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define dump(x)
#endif

typedef long long int ll;
typedef pair<int,int> pii;
//template<typename T> using vec=std::vector<T>;

const int inf=1<<30;
const long long int infll=1LL<<58;
const double eps=1e-9;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
	os << "[";
	for (const auto &v : vec) {
		os << v << ",";
	}
	os << "]";
	return os;
}

int p,q,a,n;

int dfs(int denom,int numer,int prev,int product,int num){
    {
        int tmp1=denom*prev,tmp2=numer*prev+denom*num;
        if(tmp2*q<p*tmp1) return 0;
    }
    if(numer*q>p*denom) return 0;

    int res=0;
    if(numer*q==p*denom) ++res;
    if(num==0) return res;

    int x=prev;
    while(true){
        if(product*x>a) break;
        res+=dfs(denom*x,numer*x+denom,x,product*x,num-1);
        ++x;
    }
    return res;
}

void solve(){
    while(cin >> p >> q >> a >> n){
        if(p==0 and q==0 and a==0 and n==0) break;
        cout << dfs(1,0,1,1,n) << endl;
    }
}

int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	solve();
	return 0;
}

Measured memory_bytes: 3116
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <queue>
using namespace std;
#define N 200050
int n,a[N],b[N];
int check(int mid) {
	int i;
	for(i=1;i<=n;i++) b[i]=a[i]>=mid;
	int t=(n+1)>>1;
	for(i=1;t-i>=1;i++) {
		if(b[t-i]==b[t-i+1]) {
			return b[t-i];
		}
		if(b[t+i]==b[t+i-1]) {
			return b[t+i];
		}
	}return (!(t&1))^b[t];
}
int main() {
	scanf("%d",&n);n=n*2-1;
	int i;
	for(i=1;i<=n;i++) scanf("%d",&a[i]);
	int l=1,r=n+1;
	while(l<r) {
		int mid=(l+r)>>1;
		if(check(mid)==0) r=mid;
		else l=mid+1;
	}l--;
	printf("%d\n",l);
}


Measured memory_bytes: 1664
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
const ll INF = 1001001001001;

int main(){
    int n; cin >> n;
    int mi=1001001001,ma=0;
    rep(i,n){
        int a; cin >> a;
        mi = min(mi,a);
        ma = max(ma,a);
    }
    cout << ma-mi << endl;
}



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

int main() {
  ll X;
  cin >> X;
  ll i = 1;
  while (true) {
    if (360 * i % X == 0) {
      cout << 360 * i / X << endl;
      return 0;
    }
    i++;
  }
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define pcnt __builtin_popcount
#define show(x) cout<<#x<<" = "<<x<<endl;
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define fi first
#define se second
#define rng(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define sz(x) (int)(x).size()
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> si;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll;
typedef set<ll> sl;
typedef __int128_t lll;
typedef pair<lll,lll> plll;
typedef vector<lll> vlll;
template<typename T>string join(vector<T>&v)
{stringstream s;FOR(i,0,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename A, size_t N, typename T>void Fill(A (&array)[N], const T&v)
{fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0; return gcd(a, b, x, y);}
ll modpow(lll a,lll n,ll m){if(a==0)return a;lll p=1;for(;n>0;n/=2,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
void dout(double d){printf("%.12f\n",d);}

const int iinf = 1e9;
const ll linf = 1e18;
const double pi = acos(-1);
const double eps = 1e-10;
const int N = 0;

int n;
string s, t;

main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> s >> t;
  FORR(i, n, 0){
    bool z = false;
    FOR(j, 0, i) z |= (s[n-i+j] != t[j]);
    if(!z){
      cout << n+n-i << endl;
      break;
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){

	int a, b;
	int ans;

	for(a = 1; a <= 9; a++){
		for(b = 1; b <= 9; b++){

		ans = a * b;
		printf("%dx%d=%d\n",a ,b ,ans);
		}
	}
		
	

    return 0;
}

Measured memory_bytes: 524
import java.util.*;

class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    char[] S = sc.next().toCharArray();
    Set<Character> stype = new HashSet<Character>();
    int[] counts = new int[N];
    int max = 0;
    
    for(int i=0; i < N - 1; i++){
      if(stype.contains(S[i])){
        continue;
      }
      stype.add(S[i]);
      //後ろから
      boolean match = false;
      for(int ri=N - 1; !match && ri > i; ri--){
        if(S[i] == S[ri]){
          match = true;
          for (int j=i; j <= ri; j++){
            ++counts[j];
            if(counts[j] > max){
              max = counts[j];
            }
          }
        }
      }      
    }
    
    System.out.println(max);
  }
}

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

using namespace std;

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,n) for(int i=1;i<=(int)(n);i++)
#define rep3(i,n) for(int i=0;i<=(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
#define repll(i,n) for(ll i=0;i<(ll)(n);i++)
#define repll2(i,n) for(ll i=1;i<=(ll)(n);i++)
#define REPLL(i,m,n) for(ll i=m;i<(ll)(n);i++)
#define INF 1000000000 //
#define LINF (ll)4000000000000000000 //
#define MOD (ll)1000000007
#define MP make_pair
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define PI 3.1415926535898
#define NP(v) next_permutation(v.begin(),v.end())

//------------------------------------------------------

int main() {
    int sx, sy, tx, ty;
    cin >> sx >> sy >> tx >> ty;
    int dx = tx - sx;
    int dy = ty - sy;

    rep(i, dy) cout << 'U';
    rep(i, dx) cout << 'R';
    rep(i, dy) cout << 'D';
    rep(i, dx + 1) cout << 'L';
    rep(i, dy + 1) cout << 'U';
    rep(i, dx + 1) cout << 'R';
    cout << "DR";
    rep(i, dy + 1) cout << 'D';
    rep(i, dx + 1) cout << 'L';
    cout << 'U' << endl;

    return 0;
}

Measured memory_bytes: 256
/*
   TASK: nocows
   LANG: C++14
 */

#include "bits/stdc++.h"
typedef long long ll;
typedef long double ld;

using namespace std;
#define finish(x) return cout << x, 0;

void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }

const string USCAO_TAG = "nocows";
void usaco() { setIn(USCAO_TAG + ".in"); setOut(USCAO_TAG + ".out"); }
/*
template<typename... Args>
void print(Args... args) {
	((std::cout << args << " "), ...);
}
*/
const int mod = 1e9 + 7;
ll dp[1001][1001];
char g[1001][1001];

int main() {
	//usaco();
	#ifndef ONLINE_JUDGE
	//setIn("in.txt");
	#endif

	int n, m;
	cin >> n >> m;

	for(int i = 0; i < n; i++){
		for(int j = 0; j < m; j++){
			cin >> g[i][j];
		}
	}

	dp[n - 1][m - 2] = (g[n - 1][m - 2] == '.');
	dp[n - 2][m - 1] = (g[n - 2][m - 1] == '.');
	for(int i = m - 3; i >= 0; i--){
		if(g[n - 1][i] == '#') continue;
		dp[n - 1][i] = dp[n - 1][i + 1];
	}
	for(int i = n - 3; i >= 0; i--){
		if(g[i][m - 1] == '#') continue;
		dp[i][m - 1] = dp[i + 1][m - 1];
	}

	for(int i = n - 2; i >= 0; i--){
		for(int j = m - 2; j >= 0; j--){
			if(g[i][j] != '#')
				dp[i][j] = ((g[i + 1][j] != '#' ? dp[i + 1][j] : 0) + (g[i][j + 1] != '#' ? dp[i][j + 1] : 0)) % mod;
		}
	}

	cout << dp[0][0];
}


Measured memory_bytes: 9088
#include <stdio.h>
#include <string.h>
int LCS(void);
char X[1000],Y[1000];
int c[1001][1001],k[150];
int main(){
  int i,n;

 
  
  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%s",X);
    scanf("%s",Y);
    k[i]=LCS();
  }

  for(i=0;i<n;i++)
    printf("%d\n",k[i]);

  return 0;
}

int LCS(){
  int m=0,n=0,i,j;

 
  m=strlen(X);
  n=strlen(Y);
  
 
  for(i=1;i<=m;i++)
    c[i][0]=0;
  for(j=0;j<=n;j++)
    c[0][j]=0;
  for(i=1;i<=m;i++){
    for(j=1;j<=n;j++){
      if(X[i-1]==Y[j-1])
	c[i][j]=c[i-1][j-1]+1;
      else if(c[i-1][j]>=c[i][j-1])
	c[i][j]=c[i-1][j];
      else
	c[i][j]=c[i][j-1];
      
    }
   
  }
  return c[m][n];
}

Measured memory_bytes: 4516
#include<bits/stdc++.h>
using namespace std;
#define rep(i,l,r) for(int i=(l); i<(r); i++)
#define all(x) (x).begin(), (x).end()

// vector sepで指定した位置で文字列を分割
// vector<string> split(string str, vector<long long> sep){
//     if(sep.size() == 0) return vector<string> None{};
//     long long first = 0;
//     long long last = sep[0];
//     vector<string> result;
//     for(int i = 1; i < sep.size(); i++){
//         string subStr(str, first, last - first);
//         result.push_back(subStr);
//         first = last + 1;
//         last = sep[1];
//         if (last == npos) last = str.size();
//     }
//     return result;
// }
vector<string> split(string str, int sep){
    vector<string> result;
    string subStr1(str, 0, sep);
    result.push_back(subStr1);
  	string subStr2(str, sep, str.size()-(sep));
    result.push_back(subStr2);
    return result;
}

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

    int ans = 0;
    rep(i,1,n-1){
        set<char> st[3];
        vector<string> sp = split(s,i);
        rep(j,0,2){
            rep(k,0,sp[j].length()){
                st[j].insert(sp[j][k]);
            }
        }
        set_intersection(all(st[0]), all(st[1]), inserter(st[2], st[2].end()));
        if(ans < st[2].size()) ans = st[2].size();
      	//cout << sp[0] << " " << sp[1] << endl;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp5
{

    class Program
    {
        static void Main(string[] args)
        {

            String S = Console.ReadLine();
            int k = S.Length;
            int win = 0;

            for(int i=0; i<k; i++)
            {
                if(S[i] == 'o')
                {
                    win++;
                }
            }

            if (win + (15 - k) >= 8)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}

Measured memory_bytes: 11092
#include <iostream>
#include <functional>
#include <algorithm>
#include <vector>

using namespace std;

typedef long long ll;

const int MAX = 1000;

int X,Y,Z,K;
ll A[MAX],B[MAX],C[MAX];
vector<ll> T;

int main() {
    cin >> X >> Y >> Z >> K;
    for (int i=0; i<X; i++) cin >> A[i];
    for (int i=0; i<Y; i++) cin >> B[i];
    for (int i=0; i<Z; i++) cin >> C[i];

    sort(A, A+X, greater<ll>());
    sort(B, B+Y, greater<ll>());
    sort(C, C+Z, greater<ll>());

    for (int i=0; i<X; i++) {
        for (int j=0; j<Y; j++) {
            for (int k=0; k<Z; k++) {
                if ((i+1)*(j+1)*(k+1)<=K) T.push_back(A[i]+B[j]+C[k]);
                else break;
            }
        }
    }

    sort(T.begin(), T.end(), greater<ll>());
    for (int i=0; i<K; i++) cout << T[i] << endl;
}


Measured memory_bytes: 1400
def dist(a, b):
	res = 0
	for i in range(D):
		res += (a[i] - b[i]) ** 2
	res = res ** 0.5
	return res


N, D = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]
ans = 0
for i in range(N - 1):
	for j in range(i + 1, N):
		if dist(X[i], X[j]).is_integer():
			ans += 1
print(ans)


Measured memory_bytes: 3188
#include<bits/stdc++.h>
#define ll long long
#define inf 100000000
#define pii pair<ll,ll>
#define magic ios_base::sync_with_stdio(false);cin.tie(nullptr)
using namespace std;
#define forn(i,n) for(ll i=1;i<=n;i++)
#define forRn(i,n) for(ll i=n;i>=1;i--)
#define forz(i,n) for(ll i=0;i<n;i++)
#define forRz(i,n) for(ll i=n-1;i>=0;i--)
#define forab(i,a,b) for(ll i=a;i<=b;i++)
#define mod 10007
#define has 3
ll gcd(ll x,ll y){ return y==0?x:gcd(y,x%y); }
ll lcm(ll x,ll y){ return x/gcd(x,y)*y; }


int main(void)
{
    magic;
    ll N;
    cin>>N;
    cout<<(3*N*N);


}


Measured memory_bytes: 256
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//clock_t start=clock();clock_t end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef pair<pii,pii> P;
typedef tuple<ll,ll,ll> tl;
typedef pair<double,double> pdd;
typedef vector<vector<ll>> mat;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll mod5=1000000009;
ll inf=1LL<<62;
double pi=3.141592653589793238462643383279L;
double eps=1e-14;
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define rrep(i,n,m) for(ll i=n;i>=m;i--)
#define srep(itr,st) for(auto itr=st.begin();itr!=st.end();itr++)
#define mrep(itr,mp) for(auto& itr:mp)
#define Max(a,b) a=max(a,b)
#define Min(a,b) a=min(a,b)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
#define umh unordered_map<ll,ll,custom_hash>
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    ll c=gcd(a,b);
    return a*b/c;
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
ll beki(ll n,ll k,ll md){
  ll ret=1;
  ll now=n;
    now%=md;
  while(k>0){
    if(k%2==1){
      ret*=now;
      ret%=md;
    }
    now*=now;
    now%=md;
    k/=2;
  }
  return ret;
}
ll gyaku(ll n,ll md){
  return beki(n,md-2,md);
}
ll popcount(ll n){
    ll ret=0;
    ll u=n;
    while(u>0){
        ret+=u%2;
        u/=2;
        
    }
    return ret;
}

int main(){
    ios::sync_with_stdio(false);cin.tie(0);
    ll n,m;cin>>n>>m;
    ll ans=0;
    ll kai[10000];
    kai[0]=1;
    rep(i,1,10000)kai[i]=kai[i-1]*i%m;
    ll gya[10000];
    gya[0]=1;
    rep(i,1,10000)gya[i]=gyaku(kai[i],m);
    ll be3[10000],be2[10000];
    rep(i,0,10000){
        be3[i]=beki(kai[3],i,m);
        be2[i]=beki(kai[2],i,m);
    }
    rep(i,0,3*n+1){
        rep(j,0,3*n+1){
            ll a=3*n-3*i-2*j;
            ll b=j;
            ll c=i;
            if(a<b)break;
            //cout<<a<<" "<<b<<" "<<c<<endl;
            ll sum=kai[3*n];
            (sum*=gya[a])%=m;
            (sum*=gya[b])%=m;
            (sum*=gya[c])%=m;
            ll y=be3[c];
            (y*=be2[b])%=m;
            (sum*=gyaku(y,m))%=m;
            (sum*=beki(2,c,m))%=m;
            (ans+=sum)%=m;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 512
N=input()
if N[-1] == '2' :
    print("hon")
elif N[-1] == '4' :
    print("hon")
elif N[-1] == '5' :
    print("hon")
elif N[-1] == '7' :
    print("hon")
elif N[-1] == '9' :
    print("hon")
elif N[-1] == '0' :
    print("pon")
elif N[-1] == '1' :
    print("pon")
elif N[-1] == '6' :
    print("pon")
elif N[-1] == '8' :
    print("pon")
else :
    print("bon")

Measured memory_bytes: 9076
import sys
import math
from collections import deque
from collections import Counter

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


#隣接リスト 1-order
def make_adjlist_d(n, edges):
    res = [[] for _ in range(n + 1)]
    for edge in edges:
        res[edge[0]].append(edge[1])
        res[edge[1]].append(edge[0])
    return res


def make_adjlist_nond(n, edges):
    res = [[] for _ in range(n + 1)]
    for edge in edges:
        res[edge[0]].append(edge[1])
    return res


#nCr
def cmb(n, r):
    return math.factorial(n) // math.factorial(r) // math.factorial(n - r)


def main():
    N = NI()
    A = NLI()
    Q = NI()
    querys = [NLI() for _ in range(Q)]
    res = sum(A)
    Dic = dict(Counter(A))
    for b, c in querys:
        Dic.setdefault(c, 0)
        Dic.setdefault(b, 0)
        gap = (c-b) * Dic[b]
        Dic[c] += Dic[b]
        del Dic[b]
        res += gap
        print(res)


if __name__ == "__main__":
    main()

Measured memory_bytes: 40084
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
#include <bitset>
#include <functional>

#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 62;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}
 
ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
 
//-----------------------ここから-----------
ll h, w, k;
ll memo[110][10];

ll rec(ll i, ll j){
    if(i == 0 && j == 0) return 1;
    if(i == 0) return 0;
    if(memo[i][j] != -1) return memo[i][j];
    ll res = 0;
    //cout << i << " " << j << endl;
    for(ll bit = 0; bit < (1LL << (w - 1)); bit++){
        bool ok = true;
        for(ll ii = 0; ii < w - 2; ii++){
            if((bit & (1LL << ii)) && (bit & (1LL << (ii + 1)))){
                ok = false;
                break;
            }
        }
        if(ok){
            if(bit & (1LL << j) && j + 1 < w){
                res += rec(i - 1, j + 1);
            } else if(bit & (1 << (j - 1)) && j - 1 >= 0){
                res += rec(i - 1, j - 1);
            } else {
                res += rec(i - 1, j);
            }
            res %= MOD;
        }
    }
    return memo[i][j] = res;

}
int main(void){

    cin >> h >> w >> k;
    
    rep(i, 110) rep(j, 10) memo[i][j] = -1;
    cout << rec(h, k - 1) % MOD << endl;

}

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

Measured memory_bytes: 3576
#include<iostream>
using namespace std;
int main(){
  int l,i,sum=0,flag,m,n;
  cin >>l;
  while(l!=0){
    sum=0;flag=-1;
    for(i=0;i<12;i++){
      cin >> m >> n;
      sum+=m-n;
      if(flag==-1&&sum>=l){
	flag=i+1;
      }
    }
    if(flag!=-1){
      cout << flag<<endl;
    }else{
      cout << "NA"<<endl;
    }
    cin >>l;
  }
}



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

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define first_more_idx(ve, num) upper_bound(all(ve), num)-ve.begin() // idx = first_more_idx(ve,num); if(idx = ve.size()) , then not exist
#define first_lessequal_idx(ve, num) lower_bound(all(ve), num)-ve.begin()
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > >
#define pq_pair_ts priority_queue <pair<ll,ll> > // only sort first param
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}
ll power(ll x, ll n){if(n == 0) return 1;return  (n%2)? x*power(x, n-1)%MOD : power(x*x%MOD, n/2);}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll N ;
    cin >> N ;
    vector<ll> a;
    vector<ll> ans;
    
    rep(i, N){
        ll inp; cin >> inp;
        a.pb(inp);
    }
    
    while(a.size() != 0){
        ll beforesiz = a.size();
        
        for(ll i = beforesiz-1; i >= 0; i--){
            if(a[i] == (i+1)){
                ans.pb(a[i]);
                a.erase(a.begin() + i);
                break;
            }
        }
        
        ll aftersiz = a.size();
        if(beforesiz == aftersiz) break;
    }
    
    if(ans.size() != N){
        cout << -1 << endl;
    }else{
        rep(i, ans.size()){
            cout << ans[N-1-i] << endl;
        }
    }

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


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

int best = INT_MAX;

int dish[5];
bool checked[5] = {false};

void dfs(int depth, int i_time);

int main()
{
    int i_time = 0;
    int cook = 0;
    cin >> dish[0];
    cin >> dish[1];
    cin >> dish[2];
    cin >> dish[3];
    cin >> dish[4];

    dfs(1, i_time);

    cout << best << endl;

    return 0;
}

void dfs(int depth, int i_time)
{

    for (int i = 0; i < 5; i++)
    {
        //メニューを選んで
        if (checked[i])
            continue;

        //注文する
        checked[i] = true;
        if (depth == 5)
        {
            if (i_time + dish[i] < best)
            {
                best = i_time + dish[i];
            }
        }
        else
        {
            int cook = dish[i];
            int i_i_time = i_time;
            //注文して時間を加算する 次の注文ができる時刻を求める
            while (cook > 0)
            {
                i_i_time = i_i_time + 10;
                cook = cook - 10;
            }
            dfs(depth+1, i_i_time);
        }
        checked[i] = false;
    }
}


Measured memory_bytes: 256
// abc174_b
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

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

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF (ll)(1e9)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
#define print_line(vec, n) {for(int idx=0;idx<(n-1);idx++) cout << (vec)[idx] << " "; cout << (vec)[(n)-1] << endl;}
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif

    ll N, D;
    cin >> N >> D;
    vector<ll> X(N), Y(N);
    REP(i, N) cin >> X[i] >> Y[i];

    int cnt = 0;
    REP(i, N){
        ll dist = X[i] * X[i] + Y[i] * Y[i];
        if (dist <= D * D){
            cnt ++;
        }

    }
    print(cnt);


    return 0;
}


Measured memory_bytes: 6336
#include<stdio.h>
int main(){
    int H,W,i,a;
    for(;;){
        scanf("%d%d",&H,&W);
        if(H == 0 && W == 0){
            break;
        }
        for(a = 0;a < H; a++ ){
            for(i = 0;i < W; i++ ){
                if(i == W-1){
                    printf("#\n");
                    break;
                }
                printf("#");
                
            }
        }
        printf("\n");
    }
    return 0;
}

Measured memory_bytes: 588
#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 INF 2e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;

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

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

	vector<int> l(n);
	REP(i, n) cin >> l[i];

	sort(ALL(l), greater<int>());

	int sum = 0;

	REP(i, k){
		sum += l[i];
	}

	cout << sum << endl;


}


Measured memory_bytes: 384
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        Map<Integer, Integer> map = new TreeMap<>();
        for (int i = 0; i < n; i++) {
            int a = sc.nextInt() - 1;
            map.put(a, i);
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n - 1; i++) {
            String x = String.format("%d ", map.get(i) + 1);
            sb.append(x);
        }
        sb.append(map.get(n - 1) + 1);
        System.out.println(sb.toString());
    }
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }

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


Measured memory_bytes: 81584
N = gets.strip.to_i
p =  (0...N).map{gets.strip.to_i}

pmax = p.max.floor

sum_p = 0
used_coupon = false
p.size.times{|i|
	if pmax == p[i] && !used_coupon
		sum_p += (p[i] * 0.5).floor
		used_coupon = true
	else
		sum_p += p[i]
	end
}
puts sum_p


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

int n;
double x[200000],y[200000];
char d[200000][2];
int dx[]{1,-1,0,0},dy[]{0,0,1,-1};
map<char,int>dir;

double f(double t,int mode){
  double Min=-1,Max=-1;
  for(int i = 0; i < n; i++) {
    double X;
    if(mode == 0) X = x[i] + dx[dir[d[i][0]]] * t;
    else X = y[i] + dy[dir[d[i][0]]] * t;
    if(i == 0) Min = Max = X;
    else Min = min(Min, X), Max = max(Max, X);
  } return Max - Min;
}

int main() {
  dir['R'] = 0; dir['L'] = 1;
  dir['U'] = 2; dir['D'] = 3;
  cin >> n;
  rep(i, n) scanf("%lf%lf%s",&x[i],&y[i],d[i]);
  double l = 0, r = 1e15;
  for(int i = 0; i < 200; i++) {
    double l1 = (l + l + r) / 3;
    double l2 = (l + r + r) / 3;
    if(f(l1, 0) * f(l1, 1) < f(l2, 0) * f(l2, 1))
      r = l2; else l = l1;
  } printf("%.12lf\n", f(l, 0) * f(l, 1));
}


Measured memory_bytes: 2048
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
int main(){
    int N;
    cin>>N;
    int ans=0;
    for(int i=1;i<=N;i++){
        if(0<=i&&i<=9)ans++;
        if(100<=i&&i<=999)ans++;
        if(10000<=i&&i<=99999)ans++;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
//includes
#include<iostream>
#include<vector>
#include<set>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<map>
#include<queue>
#include<iomanip>
#include<numeric>
#include<assert.h>
#include<cstring>
#include<unordered_map>
#include<bitset>

//macros and consts
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define all(a) (a).begin(),(a).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define FORE(i,a) for(auto &i : a)
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define accm accumulate
#define Fi first
#define Se second
#define INF 1e9
#define llINF (1LL<<60)
#define mINF -1e9
#define mllINF -(1LL<<60)
#define endl "\n"
#define CONT continue
#define BRK break
#define modulo(n, m) (((n)%(m)+(m))%m)

//shorter types
using namespace std;
using ll = long long;
using vi = std::vector<int>;
using vc = std::vector<char>;
using vll = std::vector<long long>;
using vs = std::vector<string>;
using Mi = map<int,int>;
using Mll = map<ll,ll>;
using UMi = unordered_map<int,int>;
using UMll = unordered_map<ll,ll>;
using Pi = pair<int,int>;
using Pll = pair<ll,ll>;
using vPi = vector<Pi>;
using vPll = vector<Pll>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<ll>>;
using vvc = vector<vector<char>>;
using vvs = vector<vector<string>>;
using pqgi = priority_queue<int,vector<int>,greater<int>>;
using pqsi = priority_queue<int,vector<int>,less<int>>;
using pqgll = priority_queue<int,vector<int>,greater<int>>;
using pssll = priority_queue<int,vector<int>,less<int>>;
template<class T>
using vec = vector<T>;
#define int long long

int N,K;
int dp[305][305];
//here begins your code
signed main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  cin >> N >> K;
  int M = N - K;

  vector<int> h(N);
  REP(i,N){
  	cin >> h[i];
  }
  h.insert(h.begin(),0);
  REP(i, N + 1){
  	REP(j, M + 1){
  		dp[i][j] = llINF;
  	}
  }
  dp[0][0] = 0;
  for(int i = 1; i <= N ; i++){
  	REP(j,M)   {
  		int now = llINF;
  		REP(k, i){
  			now = min(now, dp[k][j] + max(0LL,h[i] - h[k]));
  		}
  		dp[i][j + 1] = now;
  	}
  }

  int ans = llINF;
  REP(i, N+1){
  	ans = min(ans,dp[i][M]);
  }
  cout << ans << endl;

  //check types
  //do not eb if you resize
  //resize before you access by idx
  return 0;
} 

Measured memory_bytes: 1024
#include "stdio.h"

int main()
{
while(1)
{
int n,a=0,b=0,x,y;
scanf("%d",&n);
if(n==0)
{
break;
}
for(int i=0;i<n;i++)
{
scanf("%d %d",&x,&y);
if(x==y)
{
a+=x;
b+=y;
}
else if(x < y)
{
b+=x+y;
}
else
{
a+=x+y;
}
}
printf("%d %d\n",a,b);
}
return 0;
}

Measured memory_bytes: 1028
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstring>
#include <cstdio>
#include <cstdlib>
using namespace std;

signed main(){
    cin.tie(0); 
    ios::sync_with_stdio(false);
    int n,r;
    cin >> n >> r;
    if( n >= 10 ){
        cout << r << "\n";
    }else{
        cout << r + 100 * (10 - n) << "\n";
    }
    return 0;
}



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

using namespace std;

const int NMAX = 1000;
const int SIGMA = 26;

int N;

int main()
{
    long long A,B;
    cin >> A >> B;
    long long ans = (1LL << 61);
    vector<long long> xx = {A, -A};
    vector<long long> yy = {B, -B};
    for( int i = 0;  i < 2;  ++i ) {
        for( int j = 0;  j < 2;  ++j ) {
            if( xx[i] > yy[j] ) continue;
          ///  cout << i + j + yy[j] - xx[i] << '\n';
            ans = min(ans, i+j + yy[j] - xx[i]);
        }
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long x = sc.nextLong();
        long y = sc.nextLong();

        long ans;
        if(x==0) ans = y>0?y:-y+1;
        else if(y==0) ans = x<0?-x:x+1;
        else if(x*y<0) ans = Math.abs(Math.abs(y)-Math.abs(x))+1;
        else{
            if(x<y) ans = y-x;
            else ans = x-y+2;
        }
        System.out.println(ans);

    }
}


Measured memory_bytes: 23252