akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;using ll=long long;using vi=vector<int>;using vvi=vector<vi>;using vl=vector<ll>;using vvl=vector<vl>;using P=pair<int,int>;using PL=pair<ll,ll>;using vp=vector<P>;using vpl=vector<PL>;
template<typename T>constexpr auto inf=numeric_limits<T>::max()/2;constexpr int INF=inf<int>,MOD=1000000007;constexpr ll LINF=inf<ll>;
#define _ol3(_1,_2,_3,name,...)name
#define _rep(i,n)_repi(i,0,n)
#define _repi(i,a,b)for(int i=a,i##_l=(b);i<i##_l;++i)
#define REP(...)_ol3(__VA_ARGS__,_repi,_rep,)(__VA_ARGS__)
#define REPR(i,n)for(int i=n-1;i>=0;--i)
#define REPA(i,v)REP(i,(v).size())
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define bit(n)(1ll<<(n))
#define F first
#define S second
#define endl '\n'
#define cho(n,a,b)cout<<((n)?a:b)<<endl
void YES(int n){cho(n,"YES","NO");}void Yes(int n){cho(n,"Yes","No");}void Poss(int n){cho(n,"Possible","Impossible");}
void _print(ostream&){}template<class T,class...U>void _print(ostream&s,const T&t,const U&...u){s<<t<<(sizeof...(u)?' ':'\n');_print(s,u...);}
template<class...T>void print(const T&...t){_print(cout,t...);}template<class...T>void dprint(const T&...t){_print(cerr,t...);}
#ifndef LOCAL
struct osd{template<class T>osd&operator<<(const T&t){return*this;}};osd cer_;
#define dprint(...)
#define cerr cer_
#endif
template<class T>bool chmax(T&a,const T&b){bool x=a<b;x?a=b:b;return x;}template<class T>bool chmin(T&a,const T&b){bool x=a>b;x?a=b:b;return x;}
template<class T,class U>ostream&operator<<(ostream&o,const pair<T,U>&p){return o<<p.F<<' '<<p.S;}
template<class T,class U>istream&operator>>(istream&i,pair<T,U>&p){return i>>p.F>>p.S;}
template<class T>class iterable{template<class U>static auto c(U v)->decltype(all(v),true_type());static false_type c(...);public:const static bool value=decltype(c(declval<T>()))::value;};
//template<class T,typename=enable_if_t<iterable<T>::value>>ostream&operator<<(ostream&o,const T&v){for(auto&&i:v)o<<i<<' ';return o;}
template<class T>istream&operator>>(istream&i,vector<T>&v){for(T&j:v)i>>j;return i;}
template<class T>vector<T>&operator<<(vector<T>&v,const T&t){v.push_back(t);return v;}
template<class T>set<T>&operator<<(set<T>&v,const T&t){v.insert(t);return v;}
template<class T>multiset<T>&operator<<(multiset<T>&v,const T&t){v.insert(t);return v;}

int main(){
    cin.tie(0);ios::sync_with_stdio(0);
    string s;
    cin>>s;
    REPA(i,s){
        if((i%2 && s[i]=='R')||(i%2==0&&s[i]=='L')){
            Yes(0);
            return 0;
        }
    }
    Yes(1);
}


Measured memory_bytes: 256
parseInt(x) = parse(Int, x)

function main()
	n,m = parseInt.(split(readline()))
	x = zeros(Int, n)
	for i in 1:m
		a = parseInt.(split(readline()))
		x[a[1]] += 1
		x[a[2]] += 1
	end
	for i in 1:n
		println(x[i])
	end
end

main()

Measured memory_bytes: 116364
N, M = map(int, input().split())
L = []
P = [0]*(N+1)
for i in range(M):
    p, y = map(int, input().split())
    L.append([i, p, y, 0])

L = sorted(L, key = lambda x:x[2])

for l in L:
    P[l[1]] += 1
    l[3] = P[l[1]]    
        
for l in sorted(L, key = lambda x:x[0]):
    print('{0:0>6d}{1:0>6d}'.format(l[1], l[3]))

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

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i ,a, b) for (int i = a ; i <= b ; i++)
#define sz(a) int(a.size())
#define cuti(a) cout << a << endl;
#define cutii(a,b) cout << a << " " << b << endl;
#define cutiii(a,b,c) cout << a << " " << b << " " << c << endl;
#define vec(a) vector<int > a;

template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }

typedef long long LL;
typedef pair<int ,int > pii;
typedef pair<string ,int > psi;
typedef pair<string ,string > pss;
typedef pair<LL, LL> pLL;

const long long oo = 1e9 + 7;
const double PI = acos(-1.0);

double DEG_to_RAD(double d) { return d * PI / 180.0; }

long long n;

int main(){
  //  freopen("test.txt","r",stdin);
    cin >> n;
    int sum = 0;
    int tmp = n;
    while ( tmp ) {
        sum += tmp % 10;
        tmp /= 10;
    }
    if ( n % sum == 0) {
        cout << "Yes" << endl;
        return 0;
    } else {
        cout << "No" << endl;
        return 0;
    }
}


Measured memory_bytes: 256
# N, A, B = gets.split(" ").map(&:to_i)
S = gets.chomp
# N = gets.to_i

ok = true
S.split(//).each_with_index do |ch, i|
    ok = false if i%2 == 0 && ch == 'L'
    ok = false if i%2 == 1 && ch == 'R'
end

puts ok ? 'Yes' : 'No'


Measured memory_bytes: 1788
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>

using ll = long long;

using namespace std;

#define MAX 200010

vector<int> G[MAX];
int a[MAX] = {0};
int d[MAX];

void dfs(int i, int par, vector<int> &lis) {
    bool push = false;
    int id, val;
    auto pp = partition_point(lis.begin(), lis.end(), [&](int x) {
        return x < a[i];
    });
    if (pp == lis.end()) {
        push = true;
        lis.push_back(a[i]);
    } else {
        id = pp - lis.begin();
        val = *pp;
        *pp = a[i];
    }
    d[i] = lis.size();
    for (auto &g:G[i]) {
        if (g == par) continue;
        dfs(g, i, lis);
    }
    if (push) {
        lis.pop_back();
    } else {
        lis[id] = val;
    }
}

int main() {
    int n;
    cin >> n;
    for (int i=0; i<n; i++) {
        cin >> a[i];
    }
    for (int i=0, ui, vi; i<n-1; i++) {
        cin >> ui >> vi;
        ui--; vi--;
        G[ui].push_back(vi);
        G[vi].push_back(ui);
    }
    vector<int> lis;
    dfs(0, -1, lis);
    for (int i=0; i<n; i++) {
        cout << d[i] << '\n';
    }
    return 0;
}

Measured memory_bytes: 30468
#include <stdio.h>
#include <string.h>

void insertionSort(int e[], const int n) {
    int i;
    for (i = 0; i < n; i++) {
        int v = e[i];
        int j = i - 1;
        while ((j >= 0) && (e[j] > v)) {
            e[j + 1] = e[j];
            j -= 1;
        }
        e[j + 1] = v;
        int k;
        printf("%d", e[0]);
        for (k = 1; k < n; k++) {
            printf(" %d", e[k]);
        }
        printf("\n");
    }
}

int main() {
    int n;
    char nc[100], ec[400];
    fgets(nc, 100, stdin);
    sscanf(nc, "%d", &n);
    fgets(ec, 400, stdin);
    char *tok;
    int e[n];
    tok = strtok(ec, " ");
    int i;
    for (i = 0; i < n; i++) {
        sscanf(tok, "%d", e + i);
        tok = strtok(NULL, " ");
    }
    insertionSort(e, n);
    return 0;
}

Measured memory_bytes: 612
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <new>

using namespace std;

typedef long long ll;

#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
	
int main(){
    ll N,flag = 0;
    cin >> N;
    vector<ll> A(N,0);
    for(ll i = 0;i < N;i++){
        cin >> A[i];
    }

    sort(A.begin(),A.end());
    for(ll i = 0;i < N;i++){
        if(A[i] == A[i + 1]){
            cout << "NO" << endl;
            break;
        }else if(i == N - 1){
            flag = 1;
        }

    }

    if(flag == 1){
        cout << "YES" << endl;
    }
    return 0;

}

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

int d_i[4] = {0, 1, 0, -1};
int d_j[4] = {1, 0, -1, 0};

int main() {
  int H, W;
  cin >> H >> W;
  vector<string> s(H);
  for (int i = 0; i < H; i++) cin >> s[i];
  
  int can[H + 2][W + 2];
  for (int i = 0; i < H + 2; i++) {
    for (int j = 0; j < W + 2; j++) {
      can[i][j] = 0;
    }
  }
  
  for (int i = 1; i <= H; i++) {
    for (int j = 1; j <= W; j++) {
      if (s[i - 1][j - 1] == '#') can[i][j] = 1;
    }
  }
  
  for (int i = 1; i <= H; i++) {
    for (int j = 1; j <= W; j++) {
      if (can[i][j] == 1) {
        for (int k = 0; k < 4; k++) {
          int n_i = i + d_i[k], n_j = j + d_j[k];
          if (can[n_i][n_j] == 1) break;
          if (k == 3) { cout << "No" << endl; return 0; }
        }
      }
    }
  }
  cout << "Yes" << 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 rep_(i, n, m) for (int i = n; i < (int)(m); i++)
#define all(v) v.begin(), v.end()
#define int long long
#define stoi stoll
//#define _GLIBCXX_DEBUG

int score(int d, vector<int> &c, vector<vector<int>> &s, vector<int> lt, int t, int sc) {
  int score = sc;
  score += s[d][t];
  lt[t] = d;
  rep(j, 26) score -= c[j]*(d-lt[j]);
  return score;
}

signed main() {
  int D; cin >> D;
  vector<int> c(26);
  rep(i, 26) cin >> c[i];
  vector<vector<int>> s(D, vector<int>(26));
  rep(i, D) rep(j, 26) cin >> s[i][j];
  vector<int> t(D, 1);

  
  int sc = 0;
  vector<int> lt(26, -1);
  rep(i, D) {
    int nextsc = score(i, c, s, lt, 0, sc);
    rep(tmp, 26) {
      if(nextsc < score(i, c, s, lt, tmp, sc)) {
        t[i] = tmp+1;
        nextsc = score(i, c, s, lt, tmp, sc);
      }
    }
    lt[t[i]] = i;
    sc = nextsc;
  }
  rep(i, D) cout << t[i] << endl;
    

}

Measured memory_bytes: 3712
def gi() gets.to_i end
def gs() gets.chomp end
def gim() gets.split.map(&:to_i) end
def gsm() gets.split.map(&:chomp) end
def YesNo1(bool, yes="Yes", no="No") puts (bool ? yes : no) end
def YESNO2(bool, yes="YES", no="NO") puts (bool ? yes : no) end
def sqrt(i) i ** (1.0/2) end

require "bigdecimal"
#####

l = BigDecimal(gi.to_s)
puts ((l/3) ** 3).to_s("F")

Measured memory_bytes: 1916
#include<bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
typedef long long ll;
#define pb push_back
#define fi first
#define se second
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
template <class T, class U> ostream &operator<<(ostream &os, const pair<T, U> &p){os<<"("<<p.first<<","<< p.second<<")";return os;}
template <class T> ostream &operator<<(ostream &os, const vector<T> &v){os<<"{";REP(i,(int)v.size()){if(i)os<<",";os<<v[i];}os<<"}";return os;}
template <typename T, size_t S> void printArray(const T (&array)[S]){for(auto val : array)std::cout << val << ", ";std::cout << "\n";}
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}
const double PI=acos(-1);
const ll MOD = 1000000007;
using Graph = vector<vector<int>>;
//const int dx[4] = {1, 0, -1, 0};
//const int dy[4] = {0, 1, 0, -1};
//const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
//const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

void solve(){
    vector<string> vs;
    REP(i, 3){
        string ss; cin >> ss;
        vs.pb(ss);
    }
    cout << vs[0][0] << vs[1][1] << vs[2][2] << endl;
}

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

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main (String[] args){
        solve2197();
    }

    public static void solve2197() {
        Scanner sc = new Scanner(System.in);
        while(true) {
            int N = sc.nextInt();
            if(N == 0){
                break;
            }
            int count=0;
            if(N != 1 || N != 2){
                int sum = 1;
                for(int i = 2; sum + i <= N; i++){
                    sum += i;
                    if((N - sum)%i == 0){
                        count++;
                    }
                }
            }
            System.out.println(count);
        }
    }
}

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

int main() {
    string a, b;
    cin>>a>>b;
    int la = a.length(), start=0, j;
    vector<int> ans(20, 0);
    for(int ii=3; ii>=0; ii--){
        if(b[ii]!='.'){
            int dig = (b[ii] - '0'), carry=0;
            // cout<<dig<<" ";
            j=start++;
            for(int i=la-1; i>=0; i--){
                int mul = dig*(a[i] - '0') + carry + ans[j];
                ans[j] = (mul)%10;
                carry = mul/10;
                j++;
            }
            while(carry){
                ans[j] = carry%10;
                carry = carry/10;
                j++;
            }
            // cout<<j<<" ";
            // for(int i = j-1; i>=0; i--){
            //     cout<<ans[i];
            // }
            // cout<<"\n";
        }
    }
    j=19;
    while(ans[j]==0 and j>2)j--;
    if(j>2){
        for(int i = j; i>1; i--){
            cout<<ans[i];
        }
    }
    else cout<<0;
    
}

Measured memory_bytes: 3624
using System;
using System.Collections.Generic;

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> dis = new List<int>();
            int a = 0;
            int b;
            int i;
            for ( i = 0; i < 5; i++)
            {
                dis.Add(int.Parse(Console.ReadLine()));
            }

            b = dis[0] % 10;
            
            for (i = 1; i <= 4; i++)
            {
                int c = dis[i] % 10;
               if(c < b && c > 0)
                {
                    b = dis[i] % 10;
                    a = i;
                }
            }

            b = dis[a];
            dis.RemoveAt(a);
            for (i = 0; i < 4; i++)
            {
                b += dis[i] / 10 * 10 ;
                if(dis[i] % 10 != 0)
                {
                    b += 10;
                }
            }
            Console.WriteLine(b);
   
        }
    }
}


Measured memory_bytes: 13140
#include<cstdio>
#include<cstring>
#include<cctype>
#include<cmath>
#include<algorithm>
#define ll long long
using namespace std;
int read(){
    char c;int s=0,t=1;
    while(!isdigit(c=getchar()))if(c=='-')t=-1;
    do{s=s*10+c-'0';}while(isdigit(c=getchar()));
    return s*t;
}
int min(int a,int b){return a<b?a:b;}
int max(int a,int b){return a<b?b:a;}
int abs(int x){return x>0?x:-x;}
void mins(int &a,int b){if(a>b)a=b;}
void maxs(int &a,int b){if(a<b)a=b;}
//void insert(int u,int v){tot++;e[tot].v=v;e[tot].from=first[u];first[u]=tot;}
/*------------------------------------------------------------*/
const int inf=0x3f3f3f3f,maxn=400010;

int n,a[maxn],b[maxn],c[maxn],d[maxn],e[maxn],tot,m;
char s[10000];
int main(){
    n=read();
    for(int i=1;i<=n;i++)a[i]=read(),c[++tot]=a[i];
    m=read();
    for(int i=1;i<=m;i++)b[i]=read(),c[++tot]=b[i];
    sort(c+1,c+tot+1);
    tot=unique(c+1,c+tot+1)-c-1;
    for(int i=1;i<=n;i++)a[i]=lower_bound(c+1,c+tot+1,a[i])-c;
    for(int i=1;i<=m;i++)b[i]=lower_bound(c+1,c+tot+1,b[i])-c;
    for(int i=1;i<=n;i++)d[a[i]]++;
    for(int i=1;i<=m;i++)e[b[i]]++;
    bool ok=1;
    for(int i=1;i<=tot;i++)if(e[i]>d[i])ok=0;
    if(ok)printf("YES");else printf("NO");
    return 0;
}

Measured memory_bytes: 6272
#include <stdio.h>
#define y 1000000007
int main(void){
  int h,w,dp[1001][1001]={},i,j;
  char f[1001][1001];
  scanf("%d%d\n",&h,&w);
  for (i=1;i<=h;i++){
    for (j=1;j<=w;j++){
      scanf("%c",&f[i][j]);
    }
    scanf("\n");
  }
  dp[0][1]=1;
  for (i=1;i<=h;i++){
    for (j=1;j<=w;j++){
      if (f[i][j]=='.') dp[i][j]=(dp[i-1][j]+dp[i][j-1])%y;
    }
  }
  printf("%d\n",dp[h][w]);
  return 0;
}

Measured memory_bytes: 4992
use std::io;

fn main() {
  let stdin = io::stdin();
  let mut buf = String::new();
  stdin.read_line(&mut buf).unwrap();
  let xs = buf.trim()
    .split_whitespace()
    .filter_map(|x| x.parse::<i32>().ok())
    .collect::<Vec<_>>();
  let a = xs[0];
  let b = xs[1];
  println!("{} {}", a * b, 2 * (a + b));
}


Measured memory_bytes: 5028
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <string>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <list>
#include <tuple>
#include <bitset>
#include <ciso646>
#include <cassert>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;

inline bool check(ll x, ll y, ll xMax, ll yMax) { return x >= 0 && y >= 0 && xMax > x && yMax > y; }
inline int toint(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string tostring(T x) { ostringstream sout; sout << x; return sout.str(); }
template<class T> inline T sqr(T x) { return x*x; }
template<class T> inline T mypow(T x, ll n) { T res = 1; while (n > 0) { if (n & 1)res = res * x;	x = x * x;	n >>= 1; }return res; }
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

#define For(i,a,b)	for(ll (i) = (a);i < (b);(i)++)
#define rep(i,n)	For(i,0,n)
#define rFor(i,a,b)	for(ll (i) = (a-1);i >= (b);(i)--)
#define rrep(i,n)	rFor(i,n,0)
#define each(i,n)	for(auto &i : n)
#define clr(a)		memset((a), 0 ,sizeof(a))
#define mclr(a)		memset((a), -1 ,sizeof(a))
#define all(a)		(a).begin(),(a).end()
#define sz(a)		(sizeof(a))
#define tostr(a)	tostring(a)
#define dump(val) 	cerr << #val " = " << val << endl;
#define Fill(a,v)	fill((int*)a,(int*)(a+(sz(a)/sz(*(a)))),v)

const ll dx[8] = { 1, 0, -1, 0, 1, 1, -1, -1 }, dy[8] = { 0, -1, 0, 1, -1, 1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = 1e17 + 9;

#define int ll
#define double ld

ll mod_pow(ll x, ll n, ll mod) {
	ll res = 1;
	while (n > 0) {
		if (n & 1)res = res * x % mod;
		x = x * x % mod;
		n >>= 1;
	}
	return res;
}

signed main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);

	int n;
	cin >> n;

	vector<int> y(n, -1);

	vector<int> t(n);
	for (int i = 0; i < n; i++) {
		cin >> t[i];
		if (i == 0 || t[i] > t[i - 1]) {
			y[i] = t[i];
		}
	}
	vector<int> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	rrep(i, n) {
		if (i == n - 1 || a[i] > a[i + 1]) {
			if (y[i] != -1 && y[i] != a[i]) {
				cout << 0 << endl; return 0;
			}
			y[i] = a[i];
		}
	}


	{
		int ma = 0;
		rep(i, n) {
			if (y[i] != -1) {
				ma = max(y[i], ma);
			}
			if (ma != t[i]) {
				cout << 0 << endl; return 0;
			}
		}
	}
	{
		int ma = 0;
		rrep(i, n) {
			if (y[i] != -1) {
				ma = max(y[i], ma);
			}
			if (ma != a[i]) {
				cout << 0 << endl; return 0;
			}
		}
	}
	
	int ans = 1;
	int p = y[0];
	int l = 0;
	for (int i = 1; i < n; i++) {
		if (y[i] == -1) {
			l++;
		}
		else {
			ans *= mod_pow(min(y[i], p), l, mod);
			ans %= mod;
			l = 0;
			p = y[i];
		}
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ld long double
#define pb push_back
#define pll pair<ll, ll> 
#define vl vector<ll> 
#define vvl vector< vector<ll> > 
#define vlp vector< pair<ll, ll> >
#define vllp vector<pair<pll, ll> > 
#define mll map<ll, ll> 
#define rep(i,a)  for(ll i=0; i< a; i++)
#define rep1(i,a)   for(ll i = 1; i< a; i++)
#define foi(i, a, b)    for(ll i = a; i<b ; i++)
#define fod(i, a, b)    for(ll i = a; i>=b ; i--)
#define mp make_pair
#define all(v)  (v).begin(), (v).end()
#define fst first
#define sec second
#define ff first.first
#define fs first.second
#define max3(a, b, c)   max(max(a, b), c)
#define min3(a, b, c)   min(min(a, b), c)
#define MAX 1000001
#define MOD 1000000007
// #define MOD 998244353
#define endl "\n"
#define INF (ll)1e18
#define s(v) (ll)v.size()
#define e(v) v.empty()
#define bscount(x) __builtin_popcountll(x)
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

using namespace std;
// using namespace __gnu_pbds;

ll gcd(ll a, ll b){if(b==0)return a;return gcd(b, a%b);}
ll lcm(ll a, ll b){return a*b/gcd(a, b);}
ll fexp(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%MOD; b/=2;a=a*a%MOD;}return ans;}
ll inverse(ll a, ll p){return fexp(a, p-2);} 
void ingraph(vvl& graph, ll m){ll x, y;rep(i, m){cin>>x>>y;x--, y--;graph[x].pb(y);graph[y].pb(x);}}
ll modify(ll n){ll res = n;res%=MOD;res+=MOD;res%=MOD;return res;}

int main(){
    // #ifndef ONLINE_JUDGE
    //     freopen("../input.txt", "r", stdin);
    //     freopen("../output.txt", "w", stdout);
    // #endif
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll t;
    // cin>>t;
    t = 1;
    while(t--){
        string str;
        cin>>str;
        cout<<str[0]<<str[1]<<str[2]<<endl;
    }
}

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

//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    ll n;cin>>n;
    ll res = 100;
    ll cnt = 0;
    while(1){
        res = res*1.01;
        cnt++;
        if(res >= n){
            out(cnt);
            return 0;
        } 
    }
}


Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	vector<double> a(n);
	for(int i = 0 ; i < n ;i++){
		cin>>a[i];
	}
	double dp[n+1][n+1];
	dp[0][0] = 1;
	for(int i = 1 ; i <= n ; i++){
		for(int j = 0 ; j <=i ; j++){
			if(j==0){
				dp[i][j] = dp[i-1][j]*(1-a[i-1]);
			}
			else{
				dp[i][j] = dp[i-1][j-1]*a[i-1] + dp[i-1][j]*(1-a[i-1]);
			}
		}
	}
	double ans = 0;
	for(int i = n/2+1 ; i <= n ; i++){
		ans+=dp[n][i];
	}
	cout<<fixed<<setprecision(10)<<ans;
}


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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

int N, M;
int X[100100];

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

    std::cin >> N >> M;

    for(int i=0;i<M;++i){
        std::cin >> X[i];
    }

    std::sort(X, X + M);
    
    std::vector<int> v;

    for(int i=1;i<M;++i){
        v.emplace_back(X[i] - X[i - 1]);
    }

    std::sort(v.rbegin(), v.rend());

    int res = std::accumulate(v.begin() + std::min(N - 1, M - 1), v.end(), 0);
    std::cout << res << std::endl;
}


Measured memory_bytes: 1276
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll n,m,v,p;
    cin>>n>>m>>v>>p;
    ll a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    sort(a,a+n);reverse(a,a+n);
    ll le=p-1,ri=n;
    while(ri-le>1LL){
    	ll mid=(ri+le)/2;
    	ll num=a[mid]+m;
    	ll sum=0;
    	ll nes=max(0LL,v-(n-mid)-p+1);
    	for(int i=p-1;i<mid;i++)sum+=min(m,max(0LL,num-a[i]));
    	if(nes*m<=sum&&a[p-1]<=num)le=mid;
    	else ri=mid;
    }
    cout << le+1<<endl;
    return 0;
}


Measured memory_bytes: 1152
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cmath>
#include<cstdio>
#include<time.h>
#include<vector>
#include<cstring>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#define R register
#define LL long long
using namespace std;
const int N=2e5+10;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;

int n,a[N];

namespace FastIO {
	template<typename tp> inline void read(tp &x) {
		x=0; register char c=getchar(); register bool f=0;
		for(;c<'0'||c>'9';f|=(c=='-'),c = getchar());
		for(;c>='0'&&c<='9';x=(x<<3)+(x<<1)+c-'0',c = getchar());
		if(f) x=-x;
	}
	template<typename tp> inline void write(tp x) {
	  if (x==0) return (void) (putchar('0'));
     if (x<0) putchar('-'),x=-x;
     int pr[20]; register int cnt=0;
     for (;x;x/=10) pr[++cnt]=x%10;
     while (cnt) putchar(pr[cnt--]+'0');
	}
	template<typename tp> inline void writeln(tp x) {
		write(x);
		putchar('\n');
	}
}
using namespace FastIO;

int main() {
	read(n);
	for (int i=1;i<=n;i++) read(a[i]);
	sort(a+1,a+n+1);
	int ans=-1;
	for (int i=1;i<n;i++) {
		int t1=max(a[i],a[n]-a[i]);
		int t2=max(ans,a[n]-ans);
		if (t1<t2) ans=a[i];
	}
	cout<<a[n]<<' '<<ans;
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)  for(int i = 0; i < n; i++)
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.rbegin(), cont.rend()
#define unique(a)  (a).erase(unique((a).begin(), (a).end()),(a).end())
#define fastio          ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define PB push_back
#define endl "\n"
#define mod 1000000007
typedef long long LL;
#define int long long
typedef long double LD;
typedef vector<int> VI;
inline LL add(LL x, LL y) { x += y; if (x >= mod) x -= mod; return x; }
inline LL moduloMultiplication(LL x, LL y) {
	return (x%mod * 1LL * y%mod) %

		mod;
}
inline LL power(LL a, LL b) {
	LL x = 1 % mod;
	while (b) {
		if (b & 1) x = moduloMultiplication(x, a);
		a = moduloMultiplication(a, a);
		b >>= 1;
	}
	return x % mod;
}

inline LL inv(LL a) { return power(a, mod - 2) % mod; }
LL gcd(LL a, LL b)
{
	if (!a)
		return b % mod;
	return gcd(b%a, a) % mod;
}

signed main()
{
	fastio;
	string s;
	cin >> s;
	bool pos = false;
	rep(i, s.length() - 1) {
		if (s.substr(i, 2) == "BA" || s.substr(i, 2) == "AB") {
			pos = true;
		}
	
	}
	if (pos) {
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

}



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

int main() {
	string s;
	cin >> s;
	
	sort(s.begin(), s.end());

	string ret;
	if (s[0] == s[1] && s[1] != s[2] && s[2] == s[3]) ret = "Yes";
	else ret = "No";
	
	cout << ret << endl;
}


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

const int MOD = 1000000007;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

// 最小公倍数
unsigned lcm(unsigned a, unsigned b){
    return a / gcd(a, b) * b; 
}

int main(){
  string S;
  cin >> S;
  int A = 0, B = 0, C = 0;
  REP(i, 3){
    if(S.at(i) == 'a') A++;
    if(S.at(i) == 'b') B++;
    if(S.at(i) == 'c') C++;
  }

if(A == 1 && B == 1 && C == 1) yes;
else no;

}

Measured memory_bytes: 256
#include<vector>
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<string.h>
#include<list>
#include<limits>
#include<bitset>
#include<ctype.h>
#include<set>
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
const ll MOD=10000;
const ll INF=1000000000;
const int MAX=100001;
const double EPS=1e-10;
int main(){
    string s;
    cin>>s;
    int sl=s.length();
    int l=0;
    int r=sl-1;
    bool f=false;
    int ans=0;
    while(r-l>=1){
        if(s[r]==s[l]){
            r--;
            l++;
        }else if(s[r]=='x'){
            r--;
            ans++;
        }else if(s[l]=='x'){
            l++;
            ans++;
        }else{
            f=true;
            break;
        }
    }
    if(f){
        cout<<-1<<endl;
    }else{
        cout<<ans<<endl;
    }
    return 0;
}

Measured memory_bytes: 512
#include <stdio.h>

int main() {
	unsigned long long n = 100;//預金額
	unsigned long long x;//目標額
	int count = 0;
	scanf("%llu", &x);
	while(n < x) {
		n += n / 100;
		count += 1;
	}
	printf("%d", count); 

	return 0;
}

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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) ((a+b-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/2

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;

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> void YesNo(T a) {cout<<(a?"Yes":"No")<<endl;}
template<class T> void YESNO(T a) {cout<<(a?"YES":"NO")<<endl;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
void uniq(vector<int> &vec){sort(vec.begin(), vec.end());vec.erase(unique(vec.begin(), vec.end()), vec.end());}
void start(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);}

signed main() {
    int n;
    cin>>n;
    Vi d(n);
    REP(i,0,n) cin>>d[i];
    sort(ALL(d));
    cout<<d[n/2]-d[n/2-1]<<endl;
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
	long long n,a,b,c,d;
	cin >> n>> a >> b >> c >> d;
	string s;
	cin >> s;
	for(int i=a;i<max(c,d)-1;i++){
		if(s[i]=='#'&&s[i-1]=='#'){
			cout << "No";
			return 0;
		}
	}
	if (s[c-1]=='#'||s[d-1]=='#') {
		printf("No");
		return 0;
	}
	if(d>c){
		cout <<"Yes";
		return 0;
	}
	else if(d<c){
		for(int i=b-1;i<min(c,d);i++)
		{
			if(s[i]=='.'&&s[i+1]=='.'&&s[i-1]=='.'){
				cout <<"Yes";
				return 0;
			}
		}
		cout << "No";
	}
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
 
using namespace std;
 
#define rep(i,n) for(int i=0 ; i<(n) ; i++)
#define repr(i,n) for(int i=(n) ; i>=0 ; i--)
#define ALL(x) (x).begin(),(x).end()
 
int GCD(int a,int b){ return b ? GCD(b,a%b) : a ;}
int LCM(int a,int b){ return a*b / GCD(a,b) ;}
 
typedef long long ll;
typedef unsigned long long ull;
 
const int INF = 1e9;

int main(){
      int n;cin >> n;
      vector<int> a(n);
      rep(i,n)cin >> a[i];
      cout << accumulate(ALL(a),0) - a.size() << endl;
      return 0;
}


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

#define N 10

int main() {
	static char s[N + 1];
	int n, i, a, b, c, d, min;

	scanf("%s", s);
	n = strlen(s);
	min = 123456;
	for (i = 0; i < n - 2; i++) {
		a = s[i] - '0';
		b = s[i + 1] - '0';
		c = s[i + 2] - '0';
		d = a * 100 + b * 10 + c;
		if (min > abs(d - 753))
			min = abs(d - 753);
	}
	printf("%d\n", min);
	return 0;
}


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

const double pi = 3.14159265358979323846;
const ll mod = 1000000007;


int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
	ll n; cin >> n;
	const ll a = n;
	vector<PL> fac;
	for(ll i = 2; i * i <= a; i++){
		if(n % i == 0){
			int cnt = 0;
			while(n % i == 0){
				cnt++;
				n /= i;
			}
			fac.push_back({i, cnt});
			//cout << i << " " << cnt << endl;
		}
	}
	if(n != 1) fac.push_back({n, 1});
	int ans = 0;
	for(int i = 0; i < fac.size(); i++){
		ll b = fac.at(i).second;
		int cnt = 1;
		while(b > 0){
			ans++;
			b -= cnt;
			cnt++;
		}
		if(b < 0) ans--;
	}
	if(a == 1) cout << 0 << endl;
	else if(fac.size() == 0) cout << 1 << endl;
	else cout << ans << endl;
} 

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
int main()
{
           int i,j,b,c=0,x,y,m,n,k,p,h=0,t1,d;
      string a[100],s[100];
      int g[100];
      cin>>n;
      for(i=0;i<n;i++)
      {
          cin>>a[i];
      }
      cin>>p;
      for(i=0;i<p;i++)
      {
          cin>>s[i];
      }
       for(i=0;i<n;i++)
      {
          if(a[i]!="0")
          {
              m = 1;
          for(j=i+1;j<n;j++)
          {
              if(a[i]==a[j])
              {
                 m++;
                 a[j]='0';
              }
          }
          }
          for(k=0;k<p;k++)
          {
              if(a[i]!="0")
              {
                  if(a[i]==s[k])
                  {
                     h++;
                  }
              }
          }
          g[c] = m-h;
          c++;
          m = 0;
          h = 0;
      }
      d = c;
       sort(g,g+d);
       if(g[d-1]<=0)
       {
           cout<<"0"<<endl;
       }
       else
       cout<<g[d-1]<<endl;


      return 0;
      }

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

int main() {
  string S, T;
  cin >> S >> T;
  int slen = S.length();
  int tlen = T.length();
  for (int i{slen - tlen}; i >= 0; --i) {
    bool bingo{true};
    for (int j{}; j < tlen; ++j) {
      if (S[i + j] == '?')
        continue;
      if (S[i + j] != T[j]) {
        bingo = false;
        break;
      }
    }
    if (bingo) {
      for (int k{}; k < i; ++k) {
        if (S[k] == '?') {
          S[k] = 'a';
        }
      }
      S.replace(i, tlen, T);
      for (int k{i + tlen}; k < slen; ++k) {
        if (S[k] == '?') {
          S[k] = 'a';
        }
      }
      cout << S << endl;
      return 0;
    }
  }

  cout << "UNRESTORABLE" << endl;
  return 0;
}


Measured memory_bytes: 888
import java.util.*;import java.io.*;import java.math.*;

public class Main
{

    public static void process()throws IOException
    {
        int n=ni(),x=ni(),y=ni(),f[]=new int[100*1000+1];

        for(int i=1;i<=n;i++){
            for(int j=i+1;j<=n;j++){
                int edge=Math.min(j-i, Math.abs(x-i)+1+Math.abs(y-j));
                f[edge]++;
            }
        }
        for(int i=1;i<n;i++)
            pn(f[i]);
    }


    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter(System.out);
        sc=new AnotherReader();
        boolean oj = true;

        //oj = System.getProperty("ONLINE_JUDGE") != null;
        if(!oj) sc=new AnotherReader(100);

        long s = System.currentTimeMillis();
        int t=1;
        while(t-->0)
            process();
        out.flush();
        if(!oj)
            System.out.println(System.currentTimeMillis()-s+"ms");
        System.out.close();  
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean multipleTC=false;



/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}
    
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
    
    
    

Measured memory_bytes: 21588
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int N;
    cin >> N;
    int p[N];
    for (int i = 0; i < N; i++) {
        cin >> p[i];
    }
    int ans = INT32_MAX;
    int a[N];
    for (int i = 0; i <= p[0]; i++) {
        for (int j = 0; j < N; j++) a[j] = p[j];
        int t = i;
        a[0] -= i;
        for (int j = 0; j < N - 1; j++) {
            t += 2 * a[j];
            a[j + 1] = max(0, a[j + 1] - a[j]);
        }
        t += a[N - 1];
        ans = min(ans, t);
    }
    cout << ans << "\n";
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
const int nmax=100;

int root;
vector<int> dep(nmax),par(nmax),high(nmax);
vector<int> des[nmax];

void dep_dfs(int id){
    for(int i=0;i<(int)des[id].size();i++){
        dep[des[id][i]]=dep[id]+1;
        dep_dfs(des[id][i]);
    }
}
void hi_dfs(int id){
    if(par[id]!=-1){
        high[par[id]]=max(high[par[id]],high[id]+1);
        hi_dfs(par[id]);
    }
}
int bro(int id){
    int p=par[id];
    if(p==-1) return -1;
    for(int i=0;i<(int)des[p].size();i++)if(des[p][i]!=id) return des[p][i];
    return -1;
}

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

  int n;cin>>n;
  for(int i=0;i<n;i++){
      par[i]=-1;
      high[i]=0;
      dep[i]=0;
  }
  //cout<<0<<endl;
  for(int i=0;i<n;i++){
      int id,left,right;cin>>id>>left>>right;
      if(left!=-1){
          des[id].push_back(left);
          par[left]=id;
      }
      if(right!=-1){
          des[id].push_back(right);
          par[right]=id;
      }
      //cout<<i<<endl;
  }
  for(int i=0;i<n;i++){
      if(par[i]==-1){
          root=i;
          dep_dfs(root);
      }
      if((int)des[i].size()==0){
          high[i]=0;
          hi_dfs(i);
      }
      //cout<<i<<endl;
  }
  for(int i=0;i<n;i++){
      string type;
      if(par[i]==-1) type="root";
      else if((int)des[i].size()==0) type="leaf";
      else type="internal node";
      cout<<"node"<<" "<<i<<": parent = "<<par[i]<<", sibling = "<<bro(i)<<", degree = "<<des[i].size()<<", depth = "<<dep[i]<<", height = "<<high[i]<<", "<<type<<endl;
  }
  return 0;
}

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

#define int long long
#define itn int
#define For(i, a, b) for (int i = (a); i <= static_cast<int>(b); i++)
#define Forr(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--)
#define rep(i, n) For(i, 0, n - 1)
#define repall(i, arr) for (auto& i : (arr))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define dump(x) cerr << #x << " = " << (x) << '\n'
#define dump2(x, y) \
    cerr << #x << " = " << (x) << " " << #y << " = " << (y) << '\n'
#define SZ(x) ((int)(x).size())
#define bit(n) (1LL << (n))
constexpr int MOD = 1e9 + 7;

template <typename T>
using pq = priority_queue<T>;
template <typename T>
using pqr = priority_queue<T, vector<T>, greater<T>>;
const int INF = LLONG_MAX / 2;
using P = pair<int, int>;
using vec = vector<int>;
template <typename T>
using mat = vector<vector<T>>;

// clang-format off
template <typename T1, typename T2>
ostream& operator<<(ostream& stream, const pair<T1, T2>& p) { return stream << p.first << "," << p.second; }
template <typename T>
void print(const vector<T> vec) { rep (i, vec.size() - 1) cout << vec[i] << ' '; cout << vec[vec.size() - 1] << '\n'; }
template <typename Arg>
void print(const Arg arg) { cout << arg << '\n'; }
template <typename Head, typename... Args>
void print(const Head head, const Args... args) { cout << head << " "; print(args...); }
template <typename T, typename U>
void init(vector<T>& v, vector<U>& w) { rep (i, v.size()) cin >> v[i] >> w[i]; }
template <typename T>
void init(vector<T>& v) { rep (i, v.size()) cin >> v[i]; }
template <typename T>
T sum_(vector<T> vec, T init = 0) { return std::accumulate(all(vec), T(init)); }
template<typename T>
bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }
template<typename T>
bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }
template <typename T>
int index(const T& vec, const typename T::iterator it) { return distance(vec.begin(), it); }
template <typename T = int>
mat<T> mmat(int n, int m=0) { return mat<T>(n, vector<T>(m)); }
template <typename T = int>
vector<T> ivec(int n) { vector<T> v(n); init(v); return v; }
// clang-format on

void yn(bool tf) { print(tf ? "Yes" : "No"); }
void YN(bool tf) { print(tf ? "YES" : "NO"); }

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
// -------------------------------------------------------------------
// sort 1 2 3 4
// pqr 1 2 3 must impl >

signed main() {
    cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<string> s(n);
    vector<int> t(n);
    rep (i, n)
        cin >> s[i] >> t[i];
    string x;
    cin >> x;
    bool wake = true;
    int ans = 0;
    rep (i, n) {
        if (s[i] == x)
            wake = false;
        else if (not wake)
            ans += t[i];
    }
    print(ans);

    return 0;
}


Measured memory_bytes: 256
/*
        _            _                  _            _       _     _         _   _          _          _             _        
       / /\         / /\               / /\         / /\    / /\  /\ \      /\_\/\_\ _     /\ \       /\ \     _    /\ \      
      / /  \       / /  \             / /  \       / / /   / / /  \ \ \    / / / / //\_\   \ \ \     /  \ \   /\_\ /  \ \     
     / / /\ \__   / / /\ \           / / /\ \__   / /_/   / / /   /\ \_\  /\ \/ \ \/ / /   /\ \_\   / /\ \ \_/ / // /\ \_\    
    / / /\ \___\ / / /\ \ \         / / /\ \___\ / /\ \__/ / /   / /\/_/ /  \____\__/ /   / /\/_/  / / /\ \___/ // / /\/_/    
    \ \ \ \/___// / /  \ \ \        \ \ \ \/___// /\ \___\/ /   / / /   / /\/________/   / / /    / / /  \/____// / / ______  
     \ \ \     / / /___/ /\ \        \ \ \     / / /\/___/ /   / / /   / / /\/_// / /   / / /    / / /    / / // / / /\_____\ 
 _    \ \ \   / / /_____/ /\ \   _    \ \ \   / / /   / / /   / / /   / / /    / / /   / / /    / / /    / / // / /  \/____ / 
/_/\__/ / /  / /_________/\ \ \ /_/\__/ / /  / / /   / / /___/ / /__ / / /    / / /___/ / /__  / / /    / / // / /_____/ / /  
\ \/___/ /  / / /_       __\ \_\\ \/___/ /  / / /   / / //\__\/_/___\\/_/    / / //\__\/_/___\/ / /    / / // / /______\/ /   
 \_____\/   \_\___\     /____/_/ \_____\/   \/_/    \/_/ \/_________/        \/_/ \/_________/\/_/     \/_/ \/___________/    
                                                                                                                              
*/
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for(int i = 0;i < (n);++i)

#define endl '\n'
#define pb emplace_back
#define mkp make_pair
#define p_q priority_queue
#define INF 2000000000
#define PI 3.1415926
#define coutdb cout << fixed << setprecision(10)

const int dx[]={1,0,-1,0}, dy[]={0,-1,0,1};
const int dx_8[]={1,1,0,-1,-1,-1,0,1}, dy_8[]={0,-1,-1,-1,0,1,1,1};
const long long MOD = 1e9+7;

// typedef long long ll;
#define int long long

template <typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template <typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template <typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template <typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}

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

  int P, Q, R; cin >> P >> Q >> R;
  cout << min({P+Q, Q+R, R+P}) << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pi 3.1415926
int main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
    cout.tie(NULL);
    long double r;
    cin>>r;
    long double a=2*pi*r;
    cout<<a<<"\n";


    return 0;
}

Measured memory_bytes: 3768
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;

signed main(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    cout << max(a * b, c * d) << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>

using namespace std;

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

const ll mod = 1000000007;

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

  int k;
  cin >> k;

  vector<int> term = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  int ans = term[k-1];

  cout << ans << endl;

  return 0;
}


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


fun main(args: Array<String>) {
    val sc = FastScanner(System.`in`)

    val k = sc.nextInt()

    val vs = Array(k) { Vertex(it) }

    for (x in 1 until k) {
        vs[x].adj.add(Edge(vs[(x * 10) % k], 0))
        vs[x].adj.add(Edge(vs[(x + 1) % k], 1))
    }

    vs[1].dist = 0

    val bfs = PriorityQueue<Vertex>()

    bfs.add(vs[1])
    while (!bfs.isEmpty()) {
        val v = bfs.poll()
        for (edge in v.adj) {
            if (edge.to.dist == -1 || edge.to.dist > v.dist + edge.length) {
                edge.to.dist = v.dist + edge.length
                bfs.add(edge.to)
            }
        }
    }


    println(vs[0].dist + 1)

}


data class Vertex(val x: Int): Comparable<Vertex> {
    override fun compareTo(other: Vertex): Int {
        return this.dist - other.dist
    }

    var dist = -1
    val adj = mutableListOf<Edge>()
}

class Edge(val to: Vertex, val length: Int)


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

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

        return st.nextToken()
    }

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




Measured memory_bytes: 63920
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <map>
#include <set>
#include <utility>
#include <queue>
#include <bitset>
#include <math.h>
#include <numeric>
#include <stack>

using namespace std;
 
#define rep(i,m,n) for(int i=m;i<(int)(n);i++)
#define endl '\n'
typedef long long ll;

int gcd(int x,int y){
    return y ? gcd(y,x%y) : x;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n; cin >> n;
    string s; cin >> s;
    for(int i=0;i<s.size();i++){
        char c = (char)(s[i]+n);
        if(c > 90){
            int s = abs(c-90);
            c = (char)(64 + s);
        }
        cout<<c;
    }
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int a;
	cin>>a;
	int b=0;
	int z=a;
	while(z){
		b+=z%10;
		z/=10;
	}
	if(a%b==0)	cout<<"Yes"<<endl;
	else 	cout<<"No"<<endl;
	return 0;
} 

Measured memory_bytes: 256