akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll r1, r2;
    cin >> r1 >> r2;
    double a = 1.0 / r1;
    double b = 1.0 / r2;
    printf("%.10f\n", 1.0 / (a + b));
    return 0;
}


Measured memory_bytes: 256
/* 
	Author: ankrypt
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int
#define ff first
#define ss second
#define all(x) x.begin(), x.end() 
#define ub upper_bound
#define lb lower_bound
#define MAX_INT 15
#define PI 3.141592653589793
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define go ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define fi(a, b, c, d) for(int a = b; a < c; a += d)
#define fl(a, b, c, d) for(ll a = b; a < c; a += d)
#define fei(a, b, c, d) for(int a = b; a <= c; a += d)
#define fel(a, b, c, d) for(ll a = b; a <= c; a += d)
#define quit exit(0)
#define mem(x, a) memset(x, a, sizeof x)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pcl pair<char, ll>
#define psl pair<string, ll>


ll N, M, A, B;
ll arr[MAX_INT], arr1[MAX_INT], data[MAX_INT];
vector<ll> V;
unordered_map<char, char> mp;
set<ll> s;
string S = "";
ll cases;
char C;

int main() {
	go;
    cin >> C;
    mp['A'] = 'T';
    mp['T'] = 'A';
    mp['C'] = 'G';
    mp['G'] = 'C';
    cout << mp[C] << "\n";
	return 0;
}
/*
	Powered by Buggy Plugin
*/




Measured memory_bytes: 3460
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pint = pair<int,int>;
ll mod = 1000000007,mod2 = 998244353;

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

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL<<60;
ll gcd(ll a,ll b){
    if(b == 0) return a;
    else return gcd(b,a%b);
}

vector<string> ans;

int main() {
    string s,t;
    cin >> s;
    cin >> t;
    for (int i = 0; i < max(0,(int)s.size()-(int)t.size()+1); ++i) {
        string tmp = s;
        int cnt = 0;
        for (int j = 0; j < t.size(); ++j) {
            if(s[i+j] == t[j] || s[i+j] == '?') tmp[i+j] = t[j],cnt++;
            else break;
        }
        if(cnt == t.size()){
            for (int k = 0; k < tmp.size(); ++k) if(tmp[k] == '?') tmp[k] = 'a';
            ans.push_back(tmp);
        }
    }

    sort(ans.begin(),ans.end());
    if(ans.size() == 0) cout << "UNRESTORABLE" << endl;
    else cout << ans[0] << endl;
    return 0;
}

Measured memory_bytes: 3600
#include <iostream>
#include <string>

int main(int argc, char const *argv[])
{
    std::string s, t;
    std::cin >> s >> t;

    bool succ = false;
    for (size_t i = 0; i < s.size(); i++) {
        if (s[i] == t[0]) {
            if (s.substr(i) + s.substr(0, i) == t) {
                succ = true;
                break;
            }
        }
    }

    if (succ) {
        std::cout << "Yes" << std::endl;
    }
    else {
        std::cout << "No" << std::endl;
    }

    return 0;
}


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

int main() {
    string a, b, c;
    cin >> a >> b >> c;
    cout << char(toupper(a[0])) << char(toupper(b[0])) << char(toupper(c[0]))
         << endl;
    return 0;
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

#define ld long double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

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

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,m; cin>>n>>m;
    ll ans=1;
    for(ll i=1; i*i<=m; i++){
        if (m%i==0){
            if (m/i>=n) ans = max(ans, i);
            if (i>=n) ans = max(ans, m/i);
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, Q;
    string S;
    vector<set<int>> idx(26);
    REP(i, 26) idx[i].insert(INF);
    cin >> N >> S >> Q;
    REP(i,N) idx[S[i]-'a'].insert(i);
    while(Q--){
        int q, l, r;
        char c;
        cin >> q;
        if(q == 1){
            cin >> l >> c;
            l--;
            if(idx[S[l]-'a'].erase(l));
            S[l] = c;
            idx[c-'a'].insert(l);
        }
        else{
            cin >> l >> r;
            l--, r--;
            int cnt = 0;
            REP(i,26){
                auto itr = idx[i].lower_bound(l);
                if(*itr <= r) cnt++;
            }
            cout << cnt << endl;
            
        }
    }
}

Measured memory_bytes: 24220
#include "bits/stdc++.h"
using namespace std;
#define F first
#define S second 
#define PB push_back 
#define MP make_pair
#define INF 1000000009
typedef vector<int> vi; 
typedef pair<int,int> pi;
typedef long long ll;
#define REP(i,a,b) for (int i = a; i <= b; i++)

int main(int argc, char const *argv[])
{
	map<pair<int,pair<int,int> >,int>mp;
	int n;
	cin>>n;
	int gcd=0;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			for(int k=1;k<=n;k++)
			{
				
					gcd+=__gcd(i,__gcd(j,k));
				
			}
		}
	}
	cout<<gcd<<endl;
	return 0;
}																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																											

Measured memory_bytes: 3628
n=int(input())
h=list(map(int,input().split()))
r=[None]*(n-1)
for i in range(n-1):
  if h[i]>=h[i+1]:
    r[i]=True
  else:
    r[i]=False

m=0
count=0
for i in range(len(r)):
  if r[i]:
    count=count+1
    m=max(m,count)
  else:
    count=0

print(m)

Measured memory_bytes: 14224
#include <bits/stdc++.h>
#include <numeric>
#define rep(i, n) for(int i=0; i < n; i++)
#define reps(i, n) for(int i=1; i <= n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)

using namespace std;
using ll=long long;

ll mod=1000000007;

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


  rep(i,s.size()){
    char c= s[i];
    cout << char((int(c)+n-65)%26+65);
  }
}

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

list_mask = []

for _ in range(n):

    k, *list_b = map(int, input().split())

    mask = 0

    for i in range(k):
        mask += 2 ** list_b[i]

    list_mask.append(mask)

q = int(input())

bit_flag = 0


for _ in range(q):

    command, *list_num = input().split()

    m = int(list_num[0])


    if   command == "0":
        # test(i)
        i = m
        if bit_flag & (2 ** i):
            print(1)
        else:
            print(0)
    elif command == "1":
        # set(m)
        bit_flag = bit_flag | list_mask[m]
    elif command == "2":
        # clear(m)
        bit_flag = bit_flag & ~list_mask[m]
    elif command == "3":
        # flip(m)
        bit_flag = bit_flag ^ list_mask[m]
    elif command == "4":
        # all(m)
        if (bit_flag & list_mask[m]) == list_mask[m]:
            print(1)
        else:
            print(0)
    elif command == "5":
        # any(m)
        if bit_flag & list_mask[m]:
            print(1)
        else:
            print(0)
    elif command == "6":
        # none(m)
        if not bit_flag & list_mask[m]:
            print(1)
        else:
            print(0)
    elif command == "7":
        # count(m)
        print(bin(bit_flag & list_mask[m]).count("1"))
    elif command == "8":
        # val(m)
        print(bit_flag & list_mask[m])
    else:
        raise



Measured memory_bytes: 5624
#!/usr/bin/env python

def main():
    n = int(input())
    a = list(map(int, input().split()))

    a.sort(reverse=True)
    if n % 2 == 0:
        conf = a[0]
        for i in range(1, n//2):
            conf += a[i] * 2
    else:
        conf = a[0]
        for i in range(1, (n-1)//2):
            conf += a[i] * 2
        conf += a[(n-1)//2]

    print(conf)

if __name__ == '__main__':
    main()


Measured memory_bytes: 31432
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <algorithm>
#include <utility>
#include <numeric>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <limits>
#include <cassert>
#include <bitset>
#include <list>

#define for0(i, N)    for (int i = 0  ; i <  (N); ++i)
#define for1n(i, N)   for (int i = 1  ; i <= (N); ++i)
#define for1(i, N)    for (int i = 1  ; i <  (N); ++i)
#define forn(i, N)    for (int i = 0  ; i <= (N); ++i)
#define forx(i, N, x) for (int i = (x); i <  (N); ++i)
#define forl(i, N, x, a) for (int i = (x), a = 0; a < (N);  \
                              i = (i + 1) % (N), ++a)

template<size_t i>
std::bitset<i> operator++(std::bitset<i> b, int){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    return b = (unsigned long long)b + 1;
}

template<size_t i>
std::bitset<i> operator++(std::bitset<i> b){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    auto temp = b;
    b++;
    return temp;
}

template<size_t i>
std::bitset<i> operator--(std::bitset<i> b, int){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    return b = (unsigned long long)b - 1;
}

template<size_t i>
std::bitset<i> operator--(std::bitset<i> b){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    auto temp = b;
    b--;
    return temp;
}

using namespace std;

typedef long long ll;
typedef long double ld;
typedef priority_queue<ll> pq;
typedef priority_queue<ll,vector<ll>, greater<ll>> pql;
typedef stack<ll> stk;
typedef queue<ll> qu;
typedef pair<ll, ll> pll;
typedef map<ll, ll> mll;
typedef unordered_map<ll, ll> umll;
typedef set<ll> sll;
typedef unordered_set<ll> usll;
typedef vector<ll> vll;
typedef vector<ld> vld;


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

    int n;
    cin >> n;
    mll x;

    vll a(n);

    for0(i, n){
        ll q;
        cin >> q;
        if (x[q]) {
            cout << "NO";
            return 0;
        }
        ++x[q];
    }

    cout << "YES";


    return 0;
}


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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
typedef vector<ld> vld;
typedef vector<string> vstr;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef priority_queue<ll, vector<ll>, greater<ll>> spqll;  // 小さい順に取り出し
typedef priority_queue<ll, vector<ll>, less<ll>> bpqll;     // 大きい順に取り出し

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define IREP(i, v) for (auto i = (v).begin(); i != (v).end(); ++i)
#define ALL(v) (v).begin(), (v).end()
#define endl "\n"

ll MOD = 1000000007;
ll INF = 1e18;
ld EPS = 1e-9;
ld PI = M_PI;
vll dx = {1, 0, -1, 0, 1, -1, -1, 1};
vll dy = {0, 1, 0, -1, 1, 1, -1, -1};
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) { return a / gcd(a, b) * b;}     //最小公倍数

void yes(){ cout << "YES" << endl;}
void no(){ cout << "NO" << endl;}

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

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

  ll n;
  cin >> n;
  multiset<ll> st;

  REP(i,n){
    ll a;
    cin >> a;
    if(i == 0) st.insert(a);
    else{
      auto itr = st.lower_bound(a);
      if(itr == st.end()){
        auto tmp = st.end(); --tmp;
        st.erase(tmp);
        st.insert(a);
      }
      else if(itr == st.begin()){
        st.insert(a);
      }
      else{
        --itr;
        st.erase(itr);
        st.insert(a);
      }
    }
  }

  cout << st.size() << endl;



  return 0;
}



Measured memory_bytes: 8328
#include <stdio.h>

int main(){
    int X,Y;
    int i,j,k;
    scanf("%d %d",&X,&Y);
    int flag=0;
    for (i = Y/10000; i >= 0; i--){
        for (j = (Y-i*10000)/5000; j >= 0 ; j--){
            k = (Y-i*10000-j*5000)/1000;
            if (i+j+k == X && flag ==0){
                printf("%d %d %d\n",i,j,k);
                flag=1;
            }
        }
    }
    if (flag==0) printf("-1 -1 -1");
}

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

int main(){
    char S[32], tmp[32];
    int seireki;
    scanf("%s", S);
    
    int j=0;
    for (int i=0; S[i] != '\0'; i++) {
        if (S[i] != '/') {
            tmp[j] = S[i];
            j++;
        }
    }
    seireki = atoi(tmp);
    if (seireki < 20190431) {
        printf("Heisei");
    }else{
        printf("TBD");
    }
    return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if((a * b) % 2 == 0){
            System.out.println("Even");
        } else {
            System.out.println("Odd");
        }
    }
}

Measured memory_bytes: 21844
N = str(input())

N_long = len(N)


if N[N_long-1] == "3":
    print('bon')
elif N[N_long-1] == "0" or N[N_long-1] == "1" or N[N_long-1] == "6" or N[N_long-1] == "8":
    print('pon')
elif N[N_long-1] == "2" or N[N_long-1] == "4" or N[N_long-1] == "5" or N[N_long-1] == "7" or N[N_long-1] == "9":
    print('hon')


Measured memory_bytes: 9060
program test

implicit none
integer(8),parameter :: inf=1d17,inf_minus=-1d17
integer(8) :: a,b,q,i,j
integer(8) :: s(200000),t(200000),x(200000),sx(200000),tx(200000),ans1,ans2,ans3,ans4,ans
integer(8) :: sx2(200000),tx2(200000)
integer(8) :: s_left(200000),s_right(200000),t_left(200000),t_right(200000),s_l,s_r,t_l,t_r

read(*,*) a,b,q
do i=1,a
	read(*,*) s(i)
	sx(i)=s(i)
	sx2(i)=0
enddo
do i=1,b
	read(*,*) t(i)
	tx(i)=t(i)
	tx2(i)=0
enddo
do i=1,q
	read(*,*) x(i)
	sx(a+i)=x(i)
	tx(b+i)=x(i)
	sx2(a+i)=i
	tx2(b+i)=i
enddo

call heapsort_up(a+q,sx(1:(a+q)),sx2(1:(a+q)))
call heapsort_up(b+q,tx(1:(b+q)),tx2(1:(b+q)))

s_l = inf_minus
s_r = inf
t_l = inf_minus
t_r = inf

do i=1,(a+q)
	if(sx2(i) == 0)then
		s_l = sx(i)
	else
		s_left(sx2(i)) = abs(s_l - x(sx2(i)))
	endif
enddo

do i=(a+q),1,-1
	if(sx2(i) == 0)then
		s_r = sx(i)
	else
		s_right(sx2(i)) = abs(s_r - x(sx2(i)))
	endif
enddo

do i=1,(b+q)
	if(tx2(i) == 0)then
		t_l = tx(i)
	else
		t_left(tx2(i)) = abs(t_l - x(tx2(i)))
	endif
enddo

do i=(b+q),1,-1
	if(tx2(i) == 0)then
		t_r = tx(i)
	else
		t_right(tx2(i)) = abs(t_r - x(tx2(i)))
	endif
enddo

do i=1,q
	ans1= max(s_left(i),t_left(i))
	ans2= max(s_right(i),t_right(i))
	ans3= min(s_left(i)+2*t_right(i),2*s_left(i)+t_right(i))
	ans4= min(t_left(i)+2*s_right(i),2*t_left(i)+s_right(i))
	ans=min(ans1,ans2,ans3,ans4)
	write(*,*) ans
enddo


contains
 
subroutine heapsort_down(n,y1,y2)
 
	implicit none
	integer(8),intent(in) :: n
	integer(8),intent(inout) :: y1(1:n)
	integer(8),intent(inout) :: y2(1:n)
	integer(8) :: i,k,j,l
	integer(8) :: t1,t2
	
	l = n/2+1
	k = n
 
	do while (k /= 1)
		 if(l > 1) then
				l = l-1
				t1 = y1(l)
				t2 = y2(l)
				
		 else
				t1 = y1(k)
				t2 = y2(k)
				y1(k) = y1(1)
				y2(k) = y2(1)
				k = k-1
				if(k == 1) then
					 y1(1) = t1
					 y2(1) = t2
					 exit
				endif
		 endif
 
		 i = l
		 j = l+l
 
		 do while(j <= k)
				if(j < k) then
					 if(y1(j) > y1(j+1)) j = j+1
				endif
				
				if (t1 > y1(j)) then
					 y1(i) = y1(j)
					 y2(i) = y2(j)
					 i = j
					 j = j+j
				else
					 j = k+1
				endif
		 
		 enddo
		 
		 y1(i) = t1
		 y2(i) = t2
	
	enddo
	return
 
end subroutine heapsort_down

subroutine heapsort_up(n,y1,y2)
 
	implicit none
	integer(8),intent(in) :: n
	integer(8),intent(inout) :: y1(1:n)
	integer(8),intent(inout) :: y2(1:n)
	integer(8) :: i,k,j,l
	integer(8) :: t1,t2
	
	l = n/2+1
	k = n
 
	do while (k /= 1)
		 if(l > 1) then
				l = l-1
				t1 = y1(l)
				t2 = y2(l)
				
		 else
				t1 = y1(k)
				t2 = y2(k)
				y1(k) = y1(1)
				y2(k) = y2(1)
				k = k-1
				if(k == 1) then
					 y1(1) = t1
					 y2(1) = t2
					 exit
				endif
		 endif
 
		 i = l
		 j = l+l
 
		 do while(j <= k)
				if(j < k) then
					 if(y1(j) < y1(j+1)) j = j+1
				endif
				
				if (t1 < y1(j)) then
					 y1(i) = y1(j)
					 y2(i) = y2(j)
					 i = j
					 j = j+j
				else
					 j = k+1
				endif
		 
		 enddo
		 
		 y1(i) = t1
		 y2(i) = t2
	
	enddo
	return
 
end subroutine heapsort_up

end program

Measured memory_bytes: 18048
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e17;
constexpr int MOD = 998244353;
constexpr double PI = 3.14159265358979323846;


//1-indexedに注意！！！
struct BIT{
    private:
    int n,n_;
    vector<long long> bit;

    public:
    BIT(int n):n(n){
        bit.resize(n+1);
        n_ = 1;
        while(n_<=n) n_<<=1;
        n_ >>= 1;
    }
    //1-index
    long long sum(int i){
        long long res = 0;
        while(i > 0){
            res += bit[i];
            i -= i&-i;
        }
        return res;
    }
    //1-index
    void add(int i,long long val){
        while(i <= n){
            bit[i] += val;
            i += i&-i;
        }
    }
    //return 1-index
    int lowerbound(long long w){
        if(w <= 0) return 0;
        int x = 0;
        for(int k=n_;k>0;k>>=1){
            if(x+k<=n&&bit[x+k]<w){
                w -= bit[x+k];
                x += k;
            }
        }
        return x+1;
    }
};

struct point{
    ll x,y,id;
};

int main(){
    ll n;
    cin >> n;
    vector<point> xy(n);
    rep(i,n){
        cin >> xy[i].x >> xy[i].y;
        xy[i].id = i;
    }
    sort(xy.begin(),xy.end(),[](const point& l,const point& r){
        return l.y < r.y;
    });
    rep(i,n) xy[i].y = i+1;
    vector<ll> y(n);
    ll yy = 0;
    rep(i,n){
        y[xy[i].id] = yy;
        yy ++;
    }
    sort(xy.begin(),xy.end(),[](const point& l,const point& r){
        return l.x < r.x;
    });
    BIT bit(n+10);
    vector<ll> a(n),b(n),c(n),d(n);
    ll xx = 0;
    rep(i,n){
        a[xy[i].id] = bit.sum(xy[i].y);
        b[xy[i].id] = y[xy[i].id] - a[xy[i].id];
        c[xy[i].id] = xx - a[xy[i].id];
        d[xy[i].id] = n-1-a[xy[i].id]-b[xy[i].id]-c[xy[i].id];

        bit.add(xy[i].y,1);
        xx ++;
    }
    vector<ll> ppow(n+10);
    ll cc = 1;
    rep(i,n+10) ppow[i] = cc,cc=(cc*2)%MOD;
    ll ans = (n*ppow[n-1])%MOD;
    rep(i,n){
        ll res = 0;
        res += ((((ppow[a[i]]-1)*(ppow[d[i]]-1))%MOD)*(ppow[b[i]+c[i]]))%MOD;
        res %= MOD;
        res += ((((ppow[b[i]]-1)*(ppow[c[i]]-1))%MOD)*(ppow[a[i]+d[i]]))%MOD;
        res %= MOD;
        res -= ((((((ppow[a[i]]-1)*(ppow[b[i]]-1))%MOD)*(ppow[c[i]]-1))%MOD)*(ppow[d[i]]-1))%MOD;
        res = (res + MOD)%MOD;
        ans = (ans + res)%MOD;
    }
    cout << ans << endl;

    return 0;
}

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

int main() {
  vector<int> deta(3),rest(3);
  cin>>deta.at(0)>>deta.at(1)>>deta.at(2);
  sort(deta.begin(), deta.end());
  int a,dif,sum;
  a=deta.at(2)*3;
  dif=a-(deta.at(0)+deta.at(1)+deta.at(2));
  rest.at(0)=deta.at(0)%2;
  rest.at(1)=deta.at(1)%2;
  rest.at(2)=deta.at(2)%2;
  sum= rest.at(0)+rest.at(1)+ rest.at(2);
  if(sum==0||sum==3)
  {
    cout<<dif/2<<endl;
  }
  else if(sum==1)
  {
    if(rest.at(2)==0)
    {
      cout<<(dif+3)/2<<endl;
    }
    else
    {
      cout<<(dif)/2<<endl;
    }
  }
  else if(sum==2)
  {
    if(rest.at(2)==0)
    {
      cout<<(dif)/2<<endl;
    }
    else
    {
      cout<<(dif+3)/2<<endl;
    }
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>

using namespace std;
typedef long long ll;

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

  ll s = 0;
  for(int i=0; i<n.length(); ++i){
    s += int(n[i]) - '0';
  }

  if(s%9 == 0)
    cout << "Yes" <<endl;
  else
    cout << "No" <<endl;

  return 0;
}


Measured memory_bytes: 3424
fun main() {
    val (n, m) = readLine()!!.split(" ").map { it.toInt() }
    val arr = IntArray(n)
    for (i in 1..m) {
        val (a, b) = readLine()!!.split(" ").map { it.toInt() }
        arr[a-1]++
        arr[b-1]++
    }
    arr.forEach { println(it) }
}

Measured memory_bytes: 36640
#include <algorithm>
#include <array>
#include <iostream>
#include <vector>

#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(a) (a).begin(), (a).end()

#define INF 1000000000

using namespace std;

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

    vector<int> input(N);

    REP(i, N)
    cin >> input[i];

    sort(input.rbegin(), input.rend());

    int a = 0, b = 0;

    REP(i, N) {
        if (i % 2 == 0)
            a += input[i];
        else
            b += input[i];
    }

    cout << a - b << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  int ans =700;
  if(s[0]=='o'){
    ans+=100;
  }
  if(s[1]=='o'){
    ans+=100;
  }
  if(s[2]=='o'){
    ans+=100;
  }
  cout << ans << endl;
  }


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

using namespace std;

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

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int sz = n;
    vector<int> res, a(n);
    rep (i, n) cin >> a[i];
    rep (i, n) {
        int index = -1;
        rep (j, sz) {
            if (a[j] == j + 1) index = j;
        }
        if (index == -1) {
            cout << -1 << endl;
            return 0;
        }
        a.erase(a.begin() + index);
        res.push_back(index + 1);
        sz--;
    }
    for (int i = res.size() - 1; i >= 0; --i) cout << res[i] << endl;
    
    return 0;
}



Measured memory_bytes: 256
from collections import deque
n, m = map(int, input().split())
a = set(int(input()) for _ in range(m))
M = 1000000007
dp = {}
dp[0] = 1
for i in range(1, n+1):
    if i in a:
        dp[i] = 0
        continue
    if i - 2 < 0:
        dp[i] = dp[i-1]
    else:
        dp[i] = dp[i-1] + dp[i-2]

print(dp[n] % M)

Measured memory_bytes: 468952
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
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; }
const int INF=1001001001;
vector<pair<int64_t,int64_t>>prime_factorize(int64_t x){
  vector<pair<int64_t,int64_t>>p;
  for(int64_t i=2;i*i<=x;i++){
    int cnt=0;
    if(x%i==0){
    while(x%i==0){cnt++;x/=i;}
    p.push_back(make_pair(i,cnt));
    }
  }
  if(x!=1){p.push_back(make_pair(x,1));}
  return p; 
}
const int MOD=1000000007;
int main() {
  string s,t;
  cin>>s>>t;
  int n=s.size();
  vector<int>S(26,-1),T(26,-1);
  for(int i=0;i<n;i++){
    int l=s[i]-'a',r=t[i]-'a';
    if(S[l]!=-1||T[r]!=-1){
      if(r!=S[l]||l!=T[r]){
        cout<<"No"<<endl;return 0;
      }
    }
    S[l]=r,T[r]=l;
  }
  cout<<"Yes"<<endl;
  return 0;
}

Measured memory_bytes: 3924
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B, H, M; cin >> A >> B >> H >> M;
  double Aang, Bang, pi = 3.14159265358979;
  Aang=pi*2*(H*60+M)/720;
  Bang=pi*2*M/60;
  double x,y;
  x=cos(Aang)*A-cos(Bang)*B;
  y=sin(Aang)*A-sin(Bang)*B;
  cout << fixed << setprecision(16);
  cout  << sqrt(x*x+y*y);
}

Measured memory_bytes: 4064
/* ---------- STL Libraries ---------- */

// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>

/* ---------- Namespace ---------- */

using namespace std;
using ll = long long;

template <typename T>
T gcd(T a, T b) {
    if (a == 0 || b == 0) return 0;

    while (a != b) {
        if (a > b) {
            a -= b;
        } else {
            b -= a;
        }
    }
    return a;
}

int main() {
    ll N, M;
    string S, T;
    cin >> N >> M >> S >> T;
    ll g = gcd(N, M);
    ll a = N / g, b = M / g;
    for (ll i = 0; i < g; ++i) {
        if (S[a * i] != T[b * i]) {
            cout << -1 << endl;
            return 0;
        }
    }

    cout << N * M / g << endl;
    return 0;
}


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

main(){
  int N;
  cin >> N;
  int B[N-1];
  for(int ii=0;ii<N-1;ii++){
    cin >> B[ii];
  }
  int ans=0;
  ans+=B[0];
  for(int ii=0;ii<N-2;ii++){
    ans+=min(B[ii],B[ii+1]);
  }
  ans+=B[N-2];
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
double INF = 1e20;
int MOD = 1e9+7;
int N;
double graph[1002][1002];  //0:start 1:goal
double dijkstra(int s) {
    vector<double> dist(N, INF);
    vector<int> used(N);
    dist[s] = 0;
    while (1) {
        int v = -1;
        for (int j = 0; j < N; j++)
            if (!used[j] && (v == -1 || dist[j] < dist[v])) v = j;
        if (v == -1) break;
        used[v] = true;
        for (int i = 0;i < N;i++){
            dist[i] = min(dist[i], dist[v] + graph[v][i]);
        }
    }
    return dist[0];
}
main(){
    int xs,ys,xg,yg;
    cin >> xs >> ys >> xg >> yg >> N;
    N += 2;
    vector<int>x(N),y(N),r(N);
    x[0] = xs;y[0] = ys;
    x[1] = xg;y[1] = yg;
    r[0] = r[1] = 0;
    for(int i = 2;i < N;i++)cin >> x[i] >> y[i] >> r[i];

    for(int i = 0;i < N;i++){
        for(int j = 0;j < N;j++){
            int dx = x[i] - x[j],dy = y[i] - y[j];
            double dist = sqrt(1.*dx*dx + 1.*dy*dy);
            graph[i][j] = graph[j][i] = max(0.0,dist - r[i] - r[j]);
        }
    }
    printf("%.10lf\n",dijkstra(1));
}


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

int main() {
  long n,m;
  cin >> n >> m;
  if(n!=1&&m!=1) cout << (n-2)*(m-2) << endl;
  else if(n!=m) cout << max(n,m)-2 << endl;
  else cout << 1 << endl;
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    h,a=MI()
    print((h+a-1)//a)

main()

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long int LL;
#define pb push_back



int main()
{
    int cnt = 1, mx = 0;
    string s;
    cin >> s;

    for(int i = 0; i < s.size()-1; i++)
    {
        if(s[i] == s[i+1])
        {
            cnt++;
            mx = max(mx, cnt);
        }
        else
            cnt = 1;
    }

    if(mx == 3 || mx == 4)
        cout << "Yes" << '\n';
    else
        cout << "No" << '\n';



    return 0;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long dp[120][100100], N, W;
pair<long long, long long>wv[120];
int main() {
	cin >> N >> W;
	for(long long i = 1; i < N + 1; i++) {
		cin >> wv[i].first >> wv[i].second;
	}
	//sort(wv + 1, wv + N + 1);
	for(long long i = 1; i <= N; i++) {
		for(long long j = 1; j <= W; j++) {
			if(wv[i].first > j) {
				dp[i][j] = dp[i - 1][j];
				continue;
			}
			dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - wv[i].first] + wv[i].second);
		}
	}
	cout << dp[N][W];
}


Measured memory_bytes: 81716
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<cmath>
using namespace std;
#define REP(i, limit) for(int i=0; i< limit; ++i)
#define FOR(i, j, limit) for(int i=j; i< limit; ++i)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ECHO(x) cout<<x<<endl;
#define MEMSET(a, n, x) REP(i, n) a[i]=x;
#define ARRIN(a, n) REP(i, n) cin>>a[i];
#define LL long long
int INF = 2147483647;
LL LINF = 9223372036854775807;
LL MOD = 1000000007;
typedef pair<int, int>P;
typedef pair<LL, LL>PL;
typedef vector<int> vi;
typedef vector<LL> vl;


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

  double ans=0;
  double r=1;
  int rr=1;
  for(int i=n; i>0; --i){
    while(i*rr<k){
      rr*=2;
      r/=2;
    }
    
    ans+=r;
  }

  ans/=n;
  printf("%.12f\n", ans);
  return 0;
}


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

int main() {

  int N, A, B;
  cin >> N >> A >> B;
  
  if ( N * A <= B ) {
    cout << N * A << endl;
  }
  
  else if ( N * A > B ) {
    cout << B << endl;
  }
  
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int n;
        cin >> n;
        if(n == 0)
            return 0;

        vector<int> y(n), x(n);
        for(int i=0; i<n; ++i)
            cin >> y[i];
        for(int i=0; i<n; ++i)
            cin >> x[i];
        sort(y.begin(), y.end());
        sort(x.begin(), x.end());

        int yAdd = 0;
        int xAdd = 0;
        int yRest = n;
        int xRest = n;

        int a = 0;
        int b = n-1;
        int c = 0;
        int d = n-1;
        for(;;){
            bool change = false;
            while(a <= b && y[a] == xAdd){
                ++ a;
                -- yRest;
                change = true;
            }
            while(a <= b && y[b] == xRest){
                -- b;
                ++ yAdd;
                change = true;
            }
            while(c <= d && x[c] == yAdd){
                ++ c;
                -- xRest;
                change = true;
            }
            while(c <= d && x[d] == yRest){
                -- d;
                ++ xAdd;
                change = true;
            }
            if(!change)
                break;
        }

        if(a > b && c > d)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }
}

Measured memory_bytes: 0
use std::io::Read;

fn run() {
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();
    let mut it = s.trim().split_whitespace();
    let n: usize = it.next().unwrap().parse().unwrap();
    let k: usize = it.next().unwrap().parse().unwrap();
    let mut a: Vec<usize> = (0..n).map(|_| it.next().unwrap().parse::<usize>().unwrap() - 1).collect();
    a.push(0);
    for i in (0..n).rev() {
        a[i] += a[i + 1];
        a[i] %= k;
    }
    let mut map = std::collections::BTreeMap::new();
    map.insert(0, 1);
    let mut ans = 0u64;
    for i in (0..n).rev() {
        if i + k <= n {
            *map.get_mut(&a[i + k]).unwrap() -= 1;
        }
        let po = map.entry(a[i]).or_insert(0);
        ans += *po;
        *po += 1;
    }
    println!("{}", ans);
}

fn main() {
    run();
}

Measured memory_bytes: 20728
n,k = map(int, input().split())
l = list(map(int, input().split()))
l2 = [0 for _ in range(n+1)]
for i in range(n):
  l[i] = 1+l[i]
for i in range(n):
  l2[i + 1] = l2[i]+l[i]
l3 = []
for i in range(n-k+1):
  l3.append(l2[i+k]-l2[i])
print("{:.8}".format(max(l3)/2))

Measured memory_bytes: 25064
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long int
#define pb(x) push_back(x)
#define MP(x,y) make_pair(x,y)
using namespace std;
ll power(ll a,ll b,ll m)
{
    if(b==0)
        return(1);
    ll sol=power(a,b/2,m);
    sol=(sol*sol)%m;
    if(b%2==1)
        sol=(sol*a)%m;
    return(sol);
}
ll a[200007];
void solve()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        a[i]=a[i]-(i+1);
    }
    sort(a,a+n);
    ll x=a[n/2];
    ll ans=0;
    for(int i=0;i<n;i++)
    {
        ans+=abs(a[i]-x);
    }
    cout<<ans;
}
int main()
{
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


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

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl

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

#define INF 1000000000

int gcd(int a, int b){
  int c;
  while(a!=0){
    c=a;
    a=b%a;
    b=c;
  }
  return b;
}


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

  int reps=60/gcd(a+b,60);

  int remain=c%(a+b);
  if( remain <=a ){
    cout << c << endl;
    return 0;
  }

  rep(cnt,reps){
    remain = (remain+60)%(a+b);
    if( remain <= a){
      cout << c + (cnt+1)*60 << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}

Measured memory_bytes: 1164
#include <algorithm>
#include<iostream>
#include<vector>
#include<map>
#include<string>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;
int main(){
  string s,t;
  cin >> s;
  cin >> t;
  long size;
  long pos,start,jj;
  bool flg =false;
  size = s.size();

  for(pos=0;pos<size;pos++){

	for(jj=0;jj<size;jj++){
	  if(s[jj] != t[(jj+pos) % size]){
		break;
	  }
	}
	if(jj == size){
	  flg = true;
	  break;
	}
	
  }
  if(flg==true){
	cout << "Yes" << endl;
  }
  else{
	cout << "No" << endl;
  }
  return 0;
}


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


#define MAX 100000

int A[MAX], n;

int partition(int p, int r) {
	int x, i, j, t;
	x = A[r];
	i = p - 1;
	for (j = p; j < r; j++) {
		if (A[j] <= x) {
			i++;
			t = A[i]; A[i] = A[j]; A[j] = t;
		}
	}
	t = A[i + 1]; A[i + 1] = A[r]; A[r] = t;
	return i + 1;

}
int main(){
	int i, q;

	scanf("%d", &n);
	for (int i = 0; i < n; i++)scanf("%d", &A[i]);

	q = partition(0, n - 1);
	for (int i = 0; i < n; i++) {
		if (i)printf(" ");
		if (i == q)printf("[");
		printf("%d", A[i]);
		if (i == q)printf("]");
	}
	printf("\n");
	return 0;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define int long long
using namespace std;

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

    string t[3];
    int idx = 0;
    for (char c : s) {
        if (c == '/') idx++;
        else t[idx] += c;
    }

    cout << (t[1] < "05" ? "Heisei" : "TBD") << endl;

    return 0;
}


Measured memory_bytes: 256
gets
a = gets.split(" ").map(&:to_f)
b = gets.split(" ").map(&:to_f)

c = []
a.size.times do |i|
    c.push((a[i] - b[i]).abs)
end

print c.map{|a| a**1}.sum**(1/1.0), "\n"
print c.map{|a| a**2}.sum**(1/2.0), "\n"
print c.map{|a| a**3}.sum**(1/3.0), "\n"
print c.max, "\n"



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

typedef long long ll;
using vi = vector<int>;
using vvi = vector<vi>;

int main() {
  ll x;
  cin >> x;

  string ans;
  if (x >= 30) {
    ans = "Yes";
  } else {
    ans = "No";
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3624
var d = require("fs").readFileSync("/dev/stdin", "utf8").trim().split('\n');
var s = d[0];
var s2 = s + s;
var p = d[1];
var exists = false;
for (var i = 0; i < s.length; i++) {
  if (s2.substr(i, p.length) === p) {
    exists = true;
    break;
  }
}
console.log(exists ? 'Yes' : 'No');

Measured memory_bytes: 7384
import java.util.Scanner;

public class Main{
    public static void main(String[] hides){
        Scanner s = new Scanner(System.in);

        String str = s.next();
        switch (str){
            case "MON":
                System.out.print("6");
                break;
            case "TUE":
                System.out.print("5");
                break;
            case "WED":
                System.out.print("4");
                break;
            case "THU":
                System.out.print("3");
                break;
            case "FRI":
                System.out.print("2");
                break;
            case "SAT":
                System.out.print("1");
                break;
            case "SUN":
                System.out.print("7");
                break;

        }
    }
}

Measured memory_bytes: 21712
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

int p[123];
string s[123];

bool comp(int i, int j){
	--i; --j;
	return ((s[i]==s[j])?(p[i]>p[j]):(s[i]<s[j]));
}

int main(void){
	int n,i;
	cin >> n;
	vector<int> v(n);
	iota(v.begin(),v.end(),1);
	for(i=0; i<n; ++i){
		cin >> s[i] >> p[i];
	}
	sort(v.begin(),v.end(),comp);
	for(i=0; i<n; ++i){
		cout << v[i] << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<pair<ll, ll>>> vvpll;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

int main() {
    ll n;
    string s, t;
    cin >> n >> s >> t;
    
    rep(i, n) {
        cout << s[i] << t[i];
    }

    cout << endl;
    re0;
}

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

namespace ABC114A
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = int.Parse(Console.ReadLine());

            if (x == 7 || x == 5 || x == 3)

                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");

            Console.ReadKey();
       }
    }
}


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

int main(){
  int n,k;
  cin>>n>>k;
  int a[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  sort(a,a+n);
  int sum=0;
  for(int i=0;i<k;i++)
    sum+=a[i];
  cout<<sum;
  return 0;
}

Measured memory_bytes: 3560
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#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()
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
using namespace std;
typedef long long ll;

int vector_finder(std::vector<int> vec, int number)
{
    auto itr = std::find(vec.begin(), vec.end(), number);
    size_t index = std::distance(vec.begin(), itr);
    if (index != vec.size())
    { // 発見できたとき
        return 1;
    }
    else
    { // 発見できなかったとき
        return 0;
    }
}
void Main()
{
    int n, k;
    cin >> n >> k;
    vector<int> p;
    vector<vector<int>> data(k, vector<int>());
    for (int i = 0; i < k; i++)
    {
        int d;
        cin >> d;

        for (int j = 0; j < d; j++)
        {
            int t;
            cin >> t;
            p.push_back(t);
        }
    }

    sort(p.begin(), p.end());
    p.erase(std::unique(p.begin(), p.end()), p.end());

    int count = 0;
    for (int i = 1; i <= n; i++)
    {
        if (vector_finder(p, i) == 0)
        {
            count++;
        }
    }
    cout << count << endl;
}

int main()
{
    std::cout << std::fixed << std::setprecision(15);
    Main();
}

Measured memory_bytes: 3708
def cmb(n, r, mod):
    if (r < 0 or r > n):
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod


mod = 10 ** 9 + 7
N = 10**6
g1 = [1, 1]  # 元テーブル
g2 = [1, 1]  # 逆元テーブル
inverse = [0, 1]  # 逆元テーブル計算用テーブル

for i in range(2, N + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)

x, y = map(int, input().split())

if (x + y) % 3 != 0:
    print(0)
    exit(0)

m_n = (x + y) / 3
n = (2 * y - x) / 3

ans = cmb(int(m_n), int(n), mod)
print(ans)


Measured memory_bytes: 122000
use std::io;

fn read_line()  -> String {
    let mut buffer = String::new();
    io::stdin().read_line(&mut buffer).expect("Couldn't read line");
    buffer.trim().to_owned()
}

fn main() {
    let input: String = read_line();
    let vec: Vec<f32> = input.split_whitespace()
        .map(|n| n.parse().unwrap())
        .collect();
    print!("{}", ((vec[0] + vec[1]) / 2f32).round());
}


Measured memory_bytes: 4604
#include<bits/stdc++.h>
using namespace std;
int main()
{
	map<string,int>m;
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		string s;
		cin>>s;
		m[s]++;
	}
	map<string,int>::iterator it;
	int sum=0;
    for(it=m.begin();it!=m.end();it++)
    {
    	if((*it).second>sum)
    	sum=(*it).second;
	}
	for(it=m.begin();it!=m.end();it++)
    {
    	if((*it).second==sum)
    	cout<<(*it).first<<endl;
	}
} 

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



        String s1 = sc.next();
      int won  = 0;
      int lose = 0;
      int g = 0;
      int p = 0;
      
      for(int i = 0; i < s1.length(); i++){
          
          if(s1.charAt(i)=='g')
          {
            if(p==g)
            {
                g++;
                
            }else if(p < g){
                p++;
                won++;
            }
            
            
            
          }
          else if(s1.charAt(i)=='p')
          {
            if(p==g)
            {
                g++;
                lose++;
                
            }else if(p < g){
                p++;
            }else{
                g++;
                lose++;
            }
          }
          
      }

//System.out.print(won);
//System.out.print(lose);

        System.out.print(won-lose);
        System.out.println();
	}
}

Measured memory_bytes: 13724
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(V) V.begin(),V.end()
#define MOD 1000000007

int main() {
	ll N;
	cin >> N;
	ll d = 1;
	while (1) {
		if (N / (1LL << d) < 1LL) {
			break;
		}
		d++;
	}
	d--;
	N -= (1LL << d);
	ll ad = 99;
	queue<int> Q;
	Q.push(100);
	for (ll i = 0;;i++) {
		if (N & (1LL << i)) {
			Q.push(ad);
			ad--;
		}
		if (i == d)break;
		Q.push(i + 1);
	}
	for (int i = 1;i <= 100;i++) {
		Q.push(i);
	}
	cout << Q.size() << endl;
	while (!Q.empty()) {
		cout << Q.front() << " ";
		Q.pop();
	}
	cout << endl;
}

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

int main() {
  
    int D, N;
    cin >> D >> N;
    
    long long res=0;
    switch(D){
      case 0:
        res = (N<100) ? N : 101;
        break;
      case 1:
        res = (N<100) ? 100*N : 10100;
        break;
      case 2:
        res = (N<100) ? 10000*N : 1010000;
        break;
    }
    
   cout << res << endl;
}

Measured memory_bytes: 256