akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_ll.hpp>
//typedef boost::multiprecision::cpp_ll ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
string alp="abcdefghijklmnopqrstuvwxyz";
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);


int main(){
    string s;cin>>s;
    string ans="";
    rep(i,0,s.size()-1){
        if(s[i]=='B'){
            if(ans.size()>0){
                ans.pop_back();
            }
        }else{
            ans=ans+s[i];
        }
    }
    cout<<ans<<endl;
    
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int x,y,i;
  for(i=1;i<=3000;i++){
    scanf("%d %d",&x,&y);
    if(x == 0 && y == 0)
      break;
    if(x >= y){
      printf("%d %d\n",y,x);
    }else{
      printf("%d %d\n",x,y);
    }
   
  }
  return 0;
}

Measured memory_bytes: 600
/*~~~~~~~~~~~~~~~~~~~~~~~~*
 *  Jeevan ek rahasya hai *
 *     slow_processor     *
 * Author-maskman_lucifer *
 *~~~~~~~~~~~~~~~~~~~~~~~~*/
#include <bits/stdc++.h>                                        
#define ll long long 
#define mpr make_pair
#define pll pair<ll,ll>
#define pb push_back
#define M 1000000007
#define PI 3.141592653589793
#define lc '\n'
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    double r;
    cin>>r;
    cout<<setprecision(11)<<2.0*r*PI<<lc;
    return 0;
}

Measured memory_bytes: 3800
#include<cstdio>
#include<iostream>
int ans=0x3f3f3f3f;
int main() {
	int n;
	scanf("%d", &n);
	for(int i=1; i<=n; i++) {
		int num;
		scanf("%d", &num);
		int count=0;
		while(num%2==0){
			num/=2;
			count++;
		}
		ans=std::min(ans, count);
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <string>
#include <queue>
#include <deque>
#include <tuple>
#include <map>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const long double PI  = acos(-1.0L);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
#define chmax(a,b) a = (((a)<(b))?(b):(a))
#define chmin(a,b) a = (((a)>(b))?(b):(a))

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

signed main(){
	string s,t; cin>>s>>t;
	cout << t << s << endl;


  return 0;
}


Measured memory_bytes: 256
Bingo=[list(map(int,input().split())) for i in range(3)]

N = int(input())
List=[int(input()) for i in range(N)]

for i in List:
  if i in Bingo[0]:
    a = Bingo[0].index(i)
    Bingo[0][a] = 0
  if i in Bingo[1]:
    a = Bingo[1].index(i)
    Bingo[1][a] = 0
  if i in Bingo[2]:
    a = Bingo[2].index(i)
    Bingo[2][a] = 0
    
ans = "No"

if Bingo[0][0] == Bingo[0][1] and Bingo[0][1] == Bingo[0][2]:
  ans = "Yes"
if Bingo[1][0] == Bingo[1][1] and Bingo[1][1] == Bingo[1][2]:
  ans = "Yes"
if Bingo[2][0] == Bingo[2][1] and Bingo[2][1] == Bingo[2][2]:
  ans = "Yes"
  
if Bingo[0][0] == Bingo[1][0] and Bingo[1][0] == Bingo[2][0]:
  ans = "Yes"
if Bingo[0][1] == Bingo[1][1] and Bingo[1][1] == Bingo[2][1]:
  ans = "Yes"
if Bingo[0][2] == Bingo[1][2] and Bingo[1][2] == Bingo[2][2]:
  ans = "Yes"
  
if Bingo[0][0] == Bingo[1][1] and Bingo[1][1] == Bingo[2][2]:
  ans = "Yes"
if Bingo[0][2] == Bingo[1][1] and Bingo[1][1] == Bingo[2][0]:
  ans = "Yes"
  
print(ans)

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

int32_t main() {
    
   int n,k;
   cin >> n >> k;
   int a[n];
   for(int i=0;i<n;i++)
   cin >>a[i];
   
   int c=0;
   
   for(int i=0;i<n;i++) {
       int x = min(abs(a[i]-k),a[i]);
       c+=(2*x);
   }
   cout << c;
   
    
    return 0;
}

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

namespace roadagain
{

struct union_find_node
{
    unsigned parent;
    unsigned lank;

    union_find_node() = default;
    union_find_node(unsigned num)
    {
        this->parent = num;
        this->lank = 1;
    }
};

class union_find_tree
{
public:
    union_find_tree(unsigned size) : size(size), group(size)
    {
        this->forest = new union_find_node[size];
        for (unsigned i = 0; i < size; i++){
            this->forest[i] = union_find_node(i);
        }
    }
    ~union_find_tree()
    {
        delete[] this->forest;
    }

    unsigned get_size()
    {
        return (this->size);
    }

    unsigned get_group()
    {
        return (this->group);
    }

    void unite(unsigned a, unsigned b)
    {
        if (this->forest[a].lank <= this->forest[b].lank){
            this->forest[b].parent = this->forest[a].parent;
            this->forest[a].lank++;
        }
        else {
            this->forest[a].parent = this->forest[b].parent;
            this->forest[b].lank++;
        }
        this->group--;
    }

    unsigned find(unsigned num)
    {
        if (this->forest[num].parent == num){
            return (num);
        }
        return (this->forest[num].parent = find(this->forest[num].parent));
    }

    bool same(unsigned a, unsigned b)
    {
        return (this->find(a) == this->find(b));
    }

private:
    const unsigned size;
    unsigned group;
    union_find_node* forest;
};

}
using namespace roadagain;

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

union_find_tree* uf;
char map[16][16];

void island(int y, int x)
{
    if (map[y][x] == '0') return;
    map[y][x] = '0';
    for (int i = 0; i < 4; i++){
        int tx = x + dx[i];
        int ty = y + dy[i];

        if (0 <= tx && tx < 12 && 0 <= ty && ty < 12){
            uf->unite(y * 12 + x, ty * 12 + tx);
            island(ty, tx);
        }
    }
}

int main()
{
    while (~scanf("%s", map[0])){
        for (int i = 1; i < 12; i++){
            scanf("%s", map[i]);
        }
        uf = new union_find_tree(12 * 12);

        int cnt = 0;
        for (int i = 0; i < 12; i++){
            for (int j = 0; j < 12; j++){
                if (map[i][j] == '1'){
                    cnt++;
                    island(i, j);
                }
            }
        }

        printf("%d\n", cnt);
        delete uf;
    }

    return 0;
}

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

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

    ll ans = k * pow(k - 1, n - 1);

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


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

int main(){
    int n;
    cin >> n;
    vector <int> d(n);
    rep(i,n) cin >> d[i];

    sort(all(d));

    int maxleft = d[n/2 - 1];
    int minright= d[n/2];
    cout << -maxleft + minright << endl;
} 


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

#define _p(...) (void)printf(__VA_ARGS__)
#define forr(x,arr) for(auto&& x:arr)
#define _overload3(_1,_2,_3,name,...) name
#define _rep2(i,n) _rep3(i,0,n)
#define _rep3(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,_rep3,_rep2,)(__VA_ARGS__)
#define _rrep2(i,n) _rrep3(i,0,n)
#define _rrep3(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define rrep(...) _overload3(__VA_ARGS__,_rrep3,_rrep2,)(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
#define bit(n) (1LL<<(n))
#define sz(x) ((int)(x).size())
#define fst first
#define snd second
using ll=long long;using pii=pair<int,int>;using vb=vector<bool>;
using vi=vector<int>;using vvi=vector<vi>;using vvvi=vector<vvi>;
using vl=vector<ll>;using vvl=vector<vl>;using vvvl=vector<vvl>;
using vd=vector<double>;using vvd=vector<vd>;using vvvd=vector<vvd>;
using vpii=vector<pii>;using vvpii=vector<vpii>;using vvvpii=vector<vvpii>;
template <typename T> T read() {T t; cin >> t; return t;}

void Main() {
  string s = read<string>();
  char p = s[0];
  int ans = 0;
  forr(c, s) {
    if (c != p) ans++;
    p = c;
  }
  cout << ans << endl;
}
int main() { cin.tie(nullptr); ios::sync_with_stdio(false); Main(); return 0; }


Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
        int a,b,c;
        a = sc.nextInt();
        b = sc.nextInt();
        c = sc.nextInt();
        
        if(a<b&&b<c){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
        
        sc.close();

	}

}


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

typedef pair<long, long> P;

P f(long x) {
    long a = x % 10;
    long b = 0;
    while (x) {
        b = x;
        x /= 10;
    }
    return P(a, b);
}

void solve(long long N) {
    long long ans = 0;
    map<P, long> m;
    for (long long a = 1; a <= N; a++) {
        m[f(a)]++;
    }
    for (long long a = 1; a <= N; a++) {
        P tmp = f(a);
        P tmp2(tmp.second, tmp.first);
        ans += m[tmp2];
    }

    cout << ans << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You
// can remove this line by using your custom template)
int main() {
    long long N;
    scanf("%lld", &N);
    solve(N);
    return 0;
}


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

#define ll long long
#define REP(i,n) for(int i = 0; i < n; i++)
#define PI 3.141592653589

using namespace std;

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

void solve_A(){
    string s;
    cin >> s;

    if(s[0] == '7' || s[1] == '7' || s[2] == '7') cout << "Yes" << endl;
    else cout << "No";
}

int main(void){
    solve_A();
    
    return 0;
}

Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define N 200005
bool prime[200005];

void sieve(){
	memset(prime, true, sizeof(prime));
	prime[0] = prime[1] = false;
	for(int i=2; i*i<N; i++)
		for(int j=2; j*i < N; j++)
			prime[i*j] = false;
}

signed main(){
	int x;
	cin>>x;
	sieve();
	for(int i=x; i<N; i++){
		if(prime[i]){
			cout<<i;
			return 0;
		}
	}
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#define FOR(i,a,b) for(size_t i=(a);i<(size_t)(b);i++)
using namespace std;

const int mod = 2011;
vector<string> s;
vector<int> inv(mod,1);

inline int get_base(size_t l, size_t t, size_t b){
  FOR(i,t,b)if(s[i][l]!='.')return i;
  return t;
}

int expr(size_t &l, size_t &t, size_t &r, size_t &b);

int fraction(size_t &l, size_t &t, size_t &r, size_t &b){
  size_t base = t;
  FOR(i,t,b)if(s[i][l]!='.')base = i;

  size_t ll = l+1;
  while(++l < r && s[base][l]=='-');

  size_t ul = ll, ur = l-1, dl = ll, dr = l-1;
  size_t ut = t, ub = base, dt = base+1, db = b;
  return expr(ul,ut,ur,ub) * inv[expr(dl,dt,dr,db)] % mod;
}

int primary(size_t &l, size_t &t, size_t &r, size_t &b){
  size_t base = get_base(l,t,b);
  if(isdigit(s[base][l]))return s[base][l++]-'0';

  l+=2;
  int res = expr(l,t,r,b);
  l+=2;
  return res;
}

int powexpr(size_t &l, size_t &t, size_t &r, size_t &b){
  int res = primary(l,t,r,b);
  size_t base = get_base(l,t,b);

  if(l<r && isdigit(s[base][l])){
    int p = s[base][l]-'0';
    l++;
    int tmp = res; res = 1;
    while(p--) (res *= tmp) %= mod;
  }
  return res;
}

int factor(size_t &l, size_t &t, size_t &r, size_t &b){
  size_t base = get_base(l,t,b);

  if(s[base][l] == '-'){
    if(s[base][l+1] == '.'){
      l+=2;
      return mod - factor(l,t,r,b);
    }else return fraction(l,t,r,b);
  }
  return powexpr(l,t,r,b);
}

int term(size_t &l, size_t &t, size_t &r, size_t &b){
  size_t base = get_base(l,t,b);

  int res = factor(l,t,r,b);
  while(l+1<r && s[base][l+1]=='*'){
    l+=3;
    res = (res * factor(l,t,r,b)) % mod;
  }
  return res;
}

int expr(size_t &l, size_t &t, size_t &r, size_t &b){
  //remove spaces
  for(bool f=true;l<r;l++){FOR(i,t,b)f &= (s[i][l]=='.');   if(!f)break;}
  for(bool f=true;l<r;r--){FOR(i,t,b)f &= (s[i][r-1]=='.'); if(!f)break;}
  for(bool f=true;t<b;t++){FOR(i,l,r)f &= (s[t][i]=='.');   if(!f)break;}
  for(bool f=true;t<b;b--){FOR(i,l,r)f &= (s[b-1][i]=='.'); if(!f)break;}

  size_t base = get_base(l,t,b);

  int res = term(l,t,r,b);
  while(l+1<r && (s[base][l+1]=='+' || s[base][l+1]=='-')){
    l+=3;
    if(s[base][l-2]=='+')res = (res + term(l,t,r,b)) % mod;
    else res = (res - term(l,t,r,b) + mod) % mod;
  }
  return res;
}

int main(){
  cin.tie(); ios::sync_with_stdio(0);
  FOR(i,2,mod)inv[i] = (mod - mod/i) * inv[mod%i] % mod;

  int n;
  while(cin>>n,n){
    s.resize(n);
    FOR(i,0,n)cin >> s[i];

    size_t l = 0, t = 0, r = s[0].size(), b = n;
    cout << expr(l,t,r,b) << endl;
  }
}

Measured memory_bytes: 1228
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>

void CountCircumReference()
{
	long double circleRadius, circumReference;
	while (1)
	{
		scanf("%Lf", &circleRadius);
		if (circleRadius <= 100 && circleRadius >= 1)
		{
			break;
		}
		printf("Wrong input \n");
	}

	circumReference = 2 * M_PI * circleRadius;
	printf("%Lf \n", circumReference);

	return;
}

int main(int argc, const char* argv[])
{
	CountCircumReference();

	return 0;
}

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

using ll = long long;
#define repi(n) for (int i = 0; i < (n); i++)
#define repj(n) for (int j = 0; j < (n); j++)
#define repk(n) for (int k = 0; k < (n); k++)
#define repl(n) for (int l = 0; l < (n); l++)
#define rep(i, n) for (int i = 0; (i) < (n); i++)
#define repr(i, a, b) for (auto i = (a); i < (b); i++)
#define repv(itr) for (auto&& v : (itr))
#define updatemax(t, v) (t = max((t), (v)))
#define updatemin(t, v) (t = min((t), (v)))
const int dx[] = {-1, 0, 0, 1, -1, -1, 1, 1};
const int dy[] = {0, -1, 1, 0, -1, 1, -1, 1};
template <typename T>
T minptr(T begin, T end) {
  T re = begin;
  for (T i = begin + 1; i != end; i++) {
    if (*i < *re) re = i;
  }
  return re;
}
template <typename T>
T maxptr(T begin, T end) {
  T re = begin;
  for (T i = begin + 1; i != end; i++) {
    if (*i > *re) re = i;
  }
  return re;
}
int __vmax(int x) {
  return INT_MAX;
}
double __vmax(double x) {
  return 1e+300;
}
ll __vmax(ll x) {
  return LLONG_MAX;
}
int __vmin(int x) {
  return INT_MIN;
}
double __vmin(double x) {
  return -1e+300;
}
ll __vmin(ll x) {
  return LLONG_MIN;
}
template <typename T>
vector<T> lis(T begin, T end, bool allowequal = false, bool lds = false) {
  using V = typename iterator_traits<T>::value_type;
  int n = end - begin;
  vector<V> a(n, lds ? __vmin(*begin) : __vmax(*begin));
  vector<int> id(n);
  if (lds && allowequal) {
    for (int i = 0; i < n; i++) {
      id[i] = n - 1 -
              (lower_bound(a.rbegin(), a.rend(), begin[i]) - 1 - a.rbegin());
      a[id[i]] = begin[i];
    }
  } else if (lds) {
    for (int i = 0; i < n; i++) {
      id[i] = n - 1 -
              (upper_bound(a.rbegin(), a.rend(), begin[i]) - 1 - a.rbegin());
      a[id[i]] = begin[i];
    }
  } else if (allowequal) {
    for (int i = 0; i < n; i++) {
      id[i] = upper_bound(a.begin(), a.end(), begin[i]) - a.begin();
      a[id[i]] = begin[i];
    }
  } else {
    for (int i = 0; i < n; i++) {
      id[i] = lower_bound(a.begin(), a.end(), begin[i]) - a.begin();
      a[id[i]] = begin[i];
    }
  }
  int m = *maxptr(id.begin(), id.end());
  vector<T> re(m + 1);
  for (int i = n - 1; i >= 0; i--) {
    if (id[i] == m) re[m--] = begin + i;
  }
  return re;
}

int main() {
  int n, m, x, y;
  cin >> n >> m >> x >> y;
  vector<int> a(n), b(m);
  repi(n) cin >> a[i];
  repi(m) cin >> b[i];
  repr(i, x + 1, y + 1) {
    repv(a) if (i <= v) goto continue_i;
    repv(b) if (i > v) goto continue_i;
    cout << "No War" << endl;
    return 0;
  continue_i:
    0;
  }
  cout << "War" << endl;
}


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

typedef struct {
	double x, y, z, r;
} Coord;

typedef struct {
	int parent, rank;
} Node;

typedef struct {
	int from, to;
	double weight;
} Edge;

Coord coord[ 100 ];
Node node[ 100 ];
Edge edge[ 4950 ];

int compare( const void *a, const void *b ) {
	double at = (*(Edge *)a).weight, bt = (*(Edge *)b).weight;

	if ( at < bt )
		return -1;
	if ( at > bt )
		return 1;
	return 0;
}

int find( int x ) {
	if ( node[ x ].parent == x )
		return x;
	else
		return node[ x ].parent = find( node[ x ].parent );
}

void unite( int x, int y ) {
	int xRoot = find( x ), yRoot = find( y );

	if ( node[ xRoot ].rank < node[ yRoot ].rank )
		node[ xRoot ].parent = yRoot;
	else {
		node[ yRoot ].parent = xRoot;
		if ( node[ xRoot ].rank == node[ yRoot ].rank )
			node[ xRoot ].rank++;
	}
}

double kruskal( int v, int e ) {
	int i;
	double sum;

	qsort( edge, e, sizeof(Edge), &compare );

	for ( i = 0; i < v; i++ ) {
		node[ i ].parent = i;
		node[ i ].rank = 0;
	}

	sum = 0.0;
	for ( i = 0; i < e; i++ )
		if ( find( edge[ i ].from ) != find( edge[ i ].to ) ) {
			unite( edge[ i ].from, edge[ i ].to );
			sum += edge[ i ].weight;
		}

	return sum;
}

int main( void ) {
	int i, j;
	int n, cnt;

	while ( scanf( "%d", &n ), n ) {
		for ( i = 0; i < n; i++ )
			scanf( "%lf %lf %lf %lf", &coord[ i ].x, &coord[ i ].y, &coord[ i ].z, &coord[ i ].r );

		cnt = 0;
		for ( i = 0; i < n; i++ )
			for ( j = i + 1; j < n; j++ ) {
				edge[ cnt ].from = i;
				edge[ cnt ].to = j;
				edge[ cnt ].weight = fmax( sqrt( ( coord[ i ].x - coord[ j ].x ) * ( coord[ i ].x - coord[ j ].x ) + ( coord[ i ].y - coord[ j ].y ) * ( coord[ i ].y - coord[ j ].y ) + ( coord[ i ].z - coord[ j ].z ) * ( coord[ i ].z - coord[ j ].z ) ) - coord[ i ].r - coord[ j ].r, 0.0 );
				cnt++;
			}

		printf( "%.3f\n", kruskal( n, n * ( n - 1 ) / 2 ) );
	}

	return 0;
}

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

int main() {
  char c;
  cin >> c;
  
  if(c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o'){
      cout << "vowel" << endl;
  }else{
      cout << "consonant" << endl;
  }
}


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

#define N 100
 
int main(){
  int a, stack[N], i = 0;
  char s[N];
   
  while(scanf("%s", s) != EOF){
    if(s[0] == '+'){
      stack[i - 2] += stack[i - 1]; //push = pop + pop
      i -= 1;
    }

    else if(s[0] == '-'){
      stack[i - 2] -= stack[i - 1]; //push = pop - pop
      i--;
    }

    else if(s[0] == '*'){
      stack[i - 2] *= stack[i - 1]; // push = pop * pop
      i--;
    }

    else{
      a = atoi(s); // push
      stack[i] = a;
      i++;
    }
  }

  printf("%d\n",stack[0]); //result

  return 0;
}

Measured memory_bytes: 548
N = int(input())
A = [int(e)-1 for e in input().split(' ')][:N]
B = [int(e) for e in input().split(' ')][:N]
C = [int(e) for e in input().split(' ')][:N-1]

score = 0
for n in range(N):
    i = A[n]
    score += B[i]
    if n+1 < N and A[n+1] == i+1:
        score += C[i]

print(score)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#include<bitset>
#include<string>
using namespace std;
#include <numeric> 
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using pi=pair<long long,long long>;
#define pii 3.1415926536
#define binary
#define mod 1000000007
typedef long long ll;
typedef long double ld;
bool sortbysec(const pair<long long,long long> &a, 
              const pair<long long,long long> &b) 
{ 
    return (a.first < b.first); 
}
bool compare(const pair<pair<ll,ll>,ll> &a,const pair<pair<ll,ll>,ll>&b)
{
    if(a.first.first==b.first.first)return (a.first.second<b.first.second);
    return (a.first.first < b.first.first); 
}
 int lcm(int a, int b)  
 {  
    return (a*b)/__gcd(a, b);  
 }  
 int Kad(ll dp[],ll n)
{
  ll curr_max=0,maxx=INT_MIN;
  for(int i=0;i<n;i++)
  {
    curr_max=curr_max+dp[i];
    if(curr_max>maxx)
      maxx=curr_max;

    if(curr_max<0)
      curr_max=0;
   
  }

  return maxx;
}

/*void dfs(int u)
{
    vis[u]=true;
    //cout<<u<<" ";
    std::vector<ll> ::iterator i;
     for (i = g[u].begin(); i != g[u].end(); ++i) 
        if (!vis[*i]) 
            dfs(*i); 
    for(int i=1;i<g[u].size();i++)
    {
        if(!vis[g[u][i]])
        {
            dfs(i);
        }
    }
}*/
ll solve(std::vector<ll> &v,int sum)
{
  unordered_map<ll,ll> m;
  ll curr=0;
  ll ans=0;
  for(ll i=0;i<v.size();i++)
  {
    curr+=v[i];
    if(curr==sum)
      ans++;
    if(m.find(curr)!=m.end())
    {
      ans+=m[curr];
    }
    m[curr]++;
  }
  return ans;
}
int main()
{
 #ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  freopen("error.txt", "w", stderr);
  #endif  
 
  IOS;
  ll x,k,d;
  cin>>x>>k>>d;
  x=abs(x);
  ll temp=k-(x/d);
  temp=temp/2;
  temp=max(0ll,temp);
  ll ans=x+(2*temp-k)*d;
  ll ans2=abs(x+(k*d));
  ll ans3=abs(x-(k*d));
  cout<<min(abs(ans),min(ans2,ans3))<<endl;

}

Measured memory_bytes: 3572
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
const int inf = 1e9 + 7;
const ll INF = 1e18;
const int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<typename T> T pow(T a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, int b, int _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { for (auto &vi: vec) os << vi << " "; return os; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<typename T >inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T> inline void add(T &a, int b) { a += b; if (a >= mod) a -= mod; }



void solve();

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

    int T;
    // cin >> T;
    T = 1;

    while (T--) {
        solve();
    }
}

int dp[100006][2];
void solve() {
  string s;
  cin >> s;
  int n = sz(s);

  // 桁, a + b が smaller
  fill_n(*dp, 100006 * 2, 0);
  dp[0][0] = 1;

  rep(i, n) rep(sm, 2) rep(ai, 2) rep(bi, 2) {
    if (ai == 1 && bi == 1) continue;
    int sum = ai + bi;
    if (sm == 0 && s[i] - '0' < sum) continue;
    add(dp[i + 1][sm | s[i] - '0' > sum], dp[i][sm]);
  }
  int ans = 0;
  rep(sm, 2) add(ans, dp[n][sm]);
  cout << ans << endl;
}


Measured memory_bytes: 1232
import sys

def I(): return int(sys.stdin.readline().rstrip())

N = I()

d = []  # Nの約数(Nが平方数のとき、N**.5を敢えて2回dに入れている)
for i in range(1,int(N**.5)+1):
    if N % i == 0:
        d.append(i)
        d.append(N//i)

# 目的地の(i,j)は、i*j==Nを満たす(i,j)の中でiとjが最も近いもの

d.sort()
a = len(d)

print(d[a//2] + d[a//2-1] - 2)

Measured memory_bytes: 64504
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef long long int ll;

int main(){

    ll n,h;
    cin >> n >> h;
    vector<ll> a(n),b(n);
    REP(i,n){
        cin >> a[i] >> b[i]; 
    }

    sort(a.begin(),a.end(),greater<ll>());
    sort(b.begin(),b.end(),greater<ll>());
    
    ll cut_damage = a[0];
    ll count = 0;

    bool flag = true;/*操作の継続条件*/

    while(flag){

        for(int i = 0;i < n;i++){
            /*切るダメージが投げるダメージを超えるまではひたすら投げる*/
            if(h <= 0){
                //cout << "a " << count << endl;
                flag = false;
                break;
            }

            if(b[i] <= cut_damage){
                //cout << "b " << count << endl;
                /*切るダメージのほうが大きくなるので投げるのを終了*/
                break;
            }else{
                /*投げるダメージのほうが大きい*/
                if(b[i] >= h){
                    /*この投げる操作でダメージが0になるのでカウントして操作を終了する*/
                    count++;
                    flag = false;
                    h -= b[i];
                    //cout << "c " << h << " " << count << endl;
                }else{
                    /*投げてダメージを減らす*/
                    h -= b[i];
                    count++;
                    //cout << "d " << h << " " << count << endl;
                }
            }
            //cout << count << endl;
        }

        if(h <= 0){
            break;
        }

        /*この時点で残りは切るのみ*/


        if(h % cut_damage == 0){
            count += h/cut_damage;
            flag = false;
        }else{
            count += h/cut_damage + 1;
            flag = false;
        }
    }
    cout << count << endl;
    return 0;
}

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

using namespace std;

int main() {
    int n;
    cin >> n;
    int a[n];
    for (int &i : a) cin >> i;
    int T;
    cin >> T;
    while (T--) {
        int t;
        cin >> t;
        cout << (lower_bound(a, a + n, t) - a)<< " "<< (upper_bound(a, a + n, t) - a) << endl;
    }
    return 0;
}


Measured memory_bytes: 3492
#![allow(unused_imports)]
#![allow(clippy::many_single_char_names)]
#![allow(clippy::suspicious_arithmetic_impl)]

// using Rust(1.42.0)
// My Library Repo is at "https://github.com/Loptall/prcn_lib"
// check available crates on AtCoder at "https://atcoder.jp/contests/language-test-202001"

/*
    AtCoder Language Update 2020204 お疲れ様でした! 有難いです
*/

// Dep crates are...
use std::cmp::{max, min, Ordering};
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque};
use std::mem::swap;
use std::ops::*;
use std::{i32, i64, isize, u32, u64, usize};

use itertools::*;
use itertools_num::*;
use lazy_static::lazy_static;
use maplit::{btreemap, btreeset, hashmap, hashset};
use num_bigint::{BigInt, BigUint};
use num_integer::{binomial, gcd, lcm, Integer};
use permutohedron::Heap;
use proconio::{fastout, input, is_stdin_empty, marker::*};
use rand::random;

use num::{one, zero};
use std::convert::{From, Into};

/// `n`を十進法で表したときの桁数
pub fn scale_dight<T: Integer + DivAssign + Mul + From<u8>>(n: T) -> usize {
    if n == zero() {
        return 1;
    }
    let mut count = 0;
    let mut n = n;
    while n >= one() {
        n /= one::<T>() * 10u8.into();
        count += 1;
    }
    count
}

/// `n`を`base`進法で表したときの桁数
pub fn scale_n_base<T: Integer + DivAssign + Mul + From<u8>>(n: T, base: u8) -> usize {
    if n == zero() {
        return 1;
    }
    let mut count = 0;
    let mut n = n;
    while n >= one() {
        n /= one::<T>() * base.into();
        count += 1;
    }
    count
}

/// 整数を桁ごとに`Vec<u64>`に分解
pub fn dight_vec<
    T: std::ops::MulAssign + std::convert::From<u8> + std::ops::DivAssign + Integer + Copy,
>(
    n: T,
) -> Vec<T> {
    let mut idx = scale_dight(n) - 1;
    let mut ret = Vec::new();
    loop {
        ret.push(n / pow_bin(10.into(), idx as u32) % 10.into());
        if idx == 0 {
            break;
        }
        idx -= 1;
    }
    ret
}

/// 整数の十進法での各桁の和
pub fn dight_sum<
    T: std::ops::MulAssign + std::convert::From<u8> + std::ops::DivAssign + Integer + Copy + AddAssign,
>(
    n: T,
) -> T {
    let mut res = zero();
    for i in dight_vec(n) {
        res += i;
    }
    res
}


/// 二分累乗法,
/// - `O(log n)`で累乗を求める
pub fn pow_bin<T: Integer + MulAssign + Copy>(n: T, r: u32) -> T {
    let mut res: T = one();
    let mut a = n;
    let mut n = r;
    while n > 0 {
        if n & 1 != 0 {
            res *= a
        }
        a *= a;
        n >>= 1;
    }
    res
}


// code...
#[fastout]
fn main() {
    input! {
        n: usize
    }

    if dight_vec(n).contains(&7) {
        println!("Yes");
    } else {
        println!("No");
    }
}


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

#define sync {ios_base ::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}
#define ll long long int
#define mod 1000000007

double d,t,s;

void solve()
{
    cin>>d>>t>>s;
    
    if(t>=d/s)
        cout<<"Yes";
    
    else
        cout<<"No";
}

int main()
{
    sync;
    int t = 1;
    //cin>>t;
    while(t--){
        solve();
        cout<<"\n";
    }
    return 0;
}







Measured memory_bytes: 3732
#include<iostream>
#include<bitset>
#include<vector>
#include<cstdlib>

#define INV (-1)
#define INFTY 2000000000
#define UNIT 20
#define MAX 15
#define ST_MAX 32756

using namespace std;

int ids[MAX];
int weights[MAX];
double distances[MAX][MAX];
double A[ST_MAX][MAX];
int a[ST_MAX][MAX];

inline double V(int n)
{
	return double(2000) / (70 + n*UNIT);
}
double W(int from, int to, unsigned long bits)
{
	int nb = 0;
	int w = 0;
	while(bits > 0)
	{
		w += ( (bits & 1) ? weights[nb] : 0);
		bits = bits >> 1;
		++nb;
	}
	return distances[from][to] / V( w );
}
void comb_compute(int n, int k)
{
	int *p;
	bool loop = false;
	p = new int[k];for(int i = 0; i < k; i++) p[i] = i;	
	do{

		bitset<MAX> b;
		loop = false;
		
		for(int i = 0; i < k; ++i)
			b.set(p[i]);
		
		for(int i = 0; i < n; ++i)
		{
			if( !b[i] )
			{
				int min_ind = INV;
				double min_t = INFTY;
				for(int j = 0; j < k; ++j)
				{
					double t;
					bitset<MAX> tb = b;
					tb.reset( p[j] );
					t = A[tb.to_ulong()][ p[j] ] + W( p[j], i, b.to_ulong() );
					if( t < min_t )
					{
						min_t = t;
						min_ind = p[j];
					}
				}
				A[b.to_ulong()][i] = min_t;
				a[b.to_ulong()][i] = min_ind;
			}
		}

	for(int pk=k-1;pk>=0;pk--){p[pk]++;if(p[pk]<=n-(k-pk)){for(int j=pk+1;j<k;j++)p[j]=p[j-1]+1;pk++;loop=true;break;}}
	}while(loop);delete [] p;
}
void input(int n){
	int dist[MAX];

	for(int i = 0; i < n; ++i)
		cin >> ids[i] >> dist[i] >> weights[i];
	
	for(int i = 0; i < n; ++i)
		for(int j = 0; j < n; ++j)
			distances[i][j] = abs( dist[i] - dist[j] );
}
void compute(int n)
{
	unsigned long l = 1;

	for(int i = 0; i < ST_MAX; ++i)
		for(int j = 0; j < MAX; ++j)
		{
			A[i][j] = INFTY;
			a[i][j] = INV;
		}
	
	for(int i = 0; i < MAX; ++i)
		A[0][i] = 0;

	for(int k = 1; k <= n; ++k)
		comb_compute(n, k);
}
void result(int n)
{
	int min_ind = INV;
	double min_t = INFTY;
	unsigned long min_st = (1<<n)-1;
	vector<int> vAns;
	bitset<MAX> bMax( (1<<n) - 1 );

	/*for(int i = 0; i < (1<<n); ++i){
		bitset<MAX> b(i);
		for(int j = 0; j < n; ++j){
			cout << b.to_string() << ':' << A[b.to_ulong()][j] << endl;
		}
		cout << "---\n";
	}*/

	for(int i = 0; i < n; ++i)
	{
		bMax.reset( i );
		if( A[bMax.to_ulong()][i] < min_t )
		{
			min_t = A[bMax.to_ulong()][i];
			min_ind = i;
			min_st = bMax.to_ulong();
		}
		bMax.set( i );
	}

	while( true )
	{
		vAns.push_back( min_ind );
		bMax.reset( min_ind );
		min_ind = a[bMax.to_ulong()][ min_ind ];
		if( min_ind == INV )
			break;
	}

	for(int i = vAns.size() - 1; i >= 0; --i){
		if( i == vAns.size() - 1 )
			cout << ids[vAns[i]];
		else
			cout << ' ' << ids[vAns[i]];
	}
	cout << '\n';
}
int main()
{
	int n;
	cin >> n;

	input( n );
	compute( n );
	result( n );

	return 0;
}

Measured memory_bytes: 6632
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Practice
{
    class Program
    {
        static void Main(string[] args)
        {
            SolveA();
            //SolveB();
            //SolveC();
            //SolveD();
        }
        private const long MOD = 1000000007;
       
        static void SolveA()
        {
            int a = ReadAndParseInt();
            int b = ReadAndParseInt();
            int c = ReadAndParseInt();
            int x = ReadAndParseInt();
            int ans = 0;
            for(int i = 0;i<=a;++i)
            {
                for(int j=0;j<=b;++j)
                {
                    for(int k=0;k<=c;++k)
                    {
                        int total = i * 500 + j * 100 + k * 50;
                        if( total != x) { continue; }
                        ans++;
                    }
                }
            }
            Console.WriteLine(ans);
        }
        
        
        #region よく使う便利関数
        private static bool isPrime(long x)
        {
            if( x == 2) { return true; }
            if( x < 2 || x % 2 == 0) { return false; }
            long i = 3;
            while( i * i <= x)
            {
                if( x % i == 0) { return false; }
                i = i + 2;
            }
            return true;
        }
        private static long lcm(long x, long y)
        {
            return x / gcd(x, y) * y;
        }
        private static long gcd(long x, long y)
        {
            return y > 0 ? gcd(y, x % y) : x;
        }

        private static int ReadAndParseInt()
        {
            return int.Parse(Console.ReadLine());
        }
        private static int[] ReadAndParseIntArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
        }
        private static long ReadAndParseLong()
        {
            return long.Parse(Console.ReadLine());
        }
        private static long[] ReadAndParseLongArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
        }
        #endregion
    }
}

Measured memory_bytes: 13140
// #include {{{
#include <iostream>
#include <cassert>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <string>
#include <bitset>
#include <vector>
#include <complex>
#include <algorithm>
using namespace std;
// }}}
// #define {{{
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
// }}}

const int N = 1e5 + 10;
int n,m,vis[N];
vi g[N];

int main(){
  scanf("%d%d",&n,&m);
  rep(i,0,m){
    int u,v;scanf("%d%d",&u,&v);
    g[u].pb(v);
    g[v].pb(u);
  }
  vi v;
  v.pb(1);vis[1]=true;
  auto append = [&]{
    int x=v.back();
    for(auto e:g[x]) if(!vis[e]){
      v.pb(e);
      vis[e]=true;
      return true;
    }
    return false;
  };
  while(append());
  reverse(all(v));
  while(append());
  printf("%d\n",sz(v));
  rep(i,0,sz(v)) printf("%d%c",v[i]," \n"[i+1==sz(v)]);
  return 0;
}


Measured memory_bytes: 7160
import itertools

n = int(input())
ii = [0 for _ in range(n)]
member = [i for i in range(n)]
p = []
for i in range(n):
    p.append([])
    buf = int(input())
    for j in range(buf):
        p[i].append([int(x) for x in input().split(" ")])

for i in range(n+1):
    flg = True
    buf_l = list(itertools.combinations(member, n - i))
    for j in buf_l:
        flg = True
        buf_i = ii.copy()
        for k in j:
            buf_i[k] = 1
        for l in j:
            for k in p[l]:
                if buf_i[k[0]-1] != k[1]:
                    flg = False
                    break
            if not flg:
                break
        if flg:
            break
    if flg:
        break
print(n-i)

Measured memory_bytes: 5364
#include <iostream>
#include <limits.h>
using namespace std;

int main()
{
    int n;
    while(cin >> n && n)
    {
        int buf[5001]={};
        int max_sum = INT_MIN;

        /* store input values */
        for(int i=0; i<n; i++)
        {
            cin >> buf[i];
        }
        /* calc maximum sum */
        for(int i=0; i<n; i++)
        {
            int sum = 0;
            for(int j=i; j<n; j++)
            {
                sum += buf[j];
                if(sum > max_sum)
                {
                    max_sum = sum;
                }
            }
            
        }
        cout << max_sum << endl;
    }
    return 0;
}

Measured memory_bytes: 3064
a = list(map(int, input().split()))
 
p = [list(map(int, input().split())) for i in range(a[1])]
q = [list(map(int, input().split())) for i in range(a[2])]
 
res = [[0]*a[0] for i in range(a[0])]
 
def lsadd(L,R):
    L-=1
    R-=1
    for i in range(0,L+1):  
        res[i][R] += 1
 
for l,r in p:
    lsadd(l,r)
 
for l,r in q:
    print(sum(res[l-1][:r]))

Measured memory_bytes: 114776
#define _CRT_SECURE_NO_DEPRECATE
#define _USE_MATH_DEFINES
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <memory.h>
#include <set>
#include <ctime>
#include <map>
#include <cstring>
#include <iterator>
#include <queue>
#include <assert.h>
#include <bitset>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <functional>

//#pragma comment(linker, "/STACK:512000000")

using namespace std;

#define pb emplace_back
#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define forn(i, n) for (int i = 0; i < (n); ++i)
#define forab(i, a, b) for (int i = (a); i < (b); ++i)

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

const int infi = 1e9 + 7;
const ll infl = (ll)1e18 + (ll)7;


int32_t main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    //srand(time(NULL));
   // freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    //freopen("customs.in", "r", stdin); freopen("customs.out", "w", stdout);
    int n, h, w;
    cin >> n >> h >> w;
    cout << (n - h + 1) * (n - w + 1) << '\n';

    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;
class Main{
  public static void main(String args[]){
    // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    // int n = Integer.parseInt(br.readLine());
    StringBuilder build = new StringBuilder();
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int id,d,c,left=0;
    Node node[] = new Node[n];
    for(int i = 0 ; i < n; i++){
      node[i] = new Node();
    }
    for(int i = 0; i<n; i++){
      // StringTokenizer token = new StringTokenizer(br.readLine());
      id = sc.nextInt();
      d = sc.nextInt();
      for(int j = 0; j<d;j++){
        c = sc.nextInt();
        if(j == 0 )node[id].left = c;
        else node[left].right_sibling = c;
        left = c;
        node[c].parent = id;
      }
    }

    for(int i = 0; i<n; i++){
      build.append("node ").append(i).append(": parent = ").append(node[i].parent).append(", depth = ").append(getDepth(i , node)).append(", ");
      if(node[i].parent == -1){
        build.append("root, [");
        PrintCildren(i,node,build);
      }
      else if(node[i].left == -1){
        build.append("leaf, [");
      }
      else {
        build.append("internal node, [");
        PrintCildren(i,node,build);
      }
      build.append("]\n");
    }
    System.out.print(build);
  }

  static int getDepth(int u, Node node[]){
    int d = 0;
    while(node[u].parent != -1){
      u = node[u].parent;
      d++;
    }
    return d;
  }

  static void PrintCildren(int u, Node node[], StringBuilder bl){
    int c = node[u].left;
    if(c!=-1){
      bl.append(c);
      c = node[c].right_sibling;
    }
    while(c != -1){
      // System.out.print(c);
      bl.append(", ").append(c);
      c = node[c].right_sibling;
    }
  }
}

class Node{
  int parent = -1;
  int left = -1;
  int right_sibling = -1;
  Node(int parent, int left, int right_sibling){
    this.parent = parent;
    this.left = left;
    this.right_sibling = right_sibling;
  }
  Node(){}

  }


Measured memory_bytes: 111460
import java.io.*;
import java.util.Scanner;

public class Main {
	public static String watch(int s) {
		String res = "" + s / 3600;
		s = s % 3600;
		res = res + ":" + s / 60 + ":" + s % 60;
		return res;
	}

	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        System.out.println(watch(s));
	}
}


Measured memory_bytes: 26352
#include<stdio.h>
#include<math.h>
int fibonacci(int n) {
    return round((pow((1 + sqrt(5)) / 2, n)
                - pow((1 - sqrt(5)) / 2, n)) / sqrt(5));
}
int main(){
  int n;
  scanf("%d",&n);
  printf("%d\n",fibonacci(n+1));
}


Measured memory_bytes: 2108
import kotlin.math.*
import kotlin.system.exitProcess

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() //single long
private fun readDouble() = readLn().toDouble()

private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints
private fun readLongs() = readStrings().map{it.toLong()} // list of longs
private fun readDoubles() = readStrings().map { it.toDouble() }

fun main(){
    val (x, y) = readDoubles()

    val t: Double = (y-2*x)/2
    val c: Double = x-t

    if(t<0 || c < 0){
        println("No")
        exitProcess(0)
    }

    if (t%1 == 0.0 && c%1 ==0.0){
        println("Yes")
    }
    else{
        println("No")
    }
}


Measured memory_bytes: 36572
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, x, y) for(int i = (x); i <= (y); i ++)
inline int read() {
	char ch = getchar(); int x = 0, f = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-') f = -1;
		ch = getchar();
	} while('0' <= ch && ch <= '9') {
		x = x * 10 + ch - '0';
		ch = getchar();
	} return x * f;
}
int fac[10010], inv[10010];
inline void init() {
	fac[0] = 1;
	rep(i, 1, 10000) fac[i] = 1ll * fac[i - 1] * i % MOD;
	inv[0] = inv[1] = 1;
	rep(i, 2, 10000) inv[i] = 1ll * inv[MOD % i] * (MOD - MOD / i) % MOD;
	rep(i, 1, 10000) inv[i] = 1ll * inv[i - 1] * inv[i] % MOD;
}
int dp[4010][4010], a[4010][4010];
inline int C(int n, int m){
	return 1ll * fac[n] * inv[m] % MOD * inv[n - m] % MOD;
}
int main() {
	int n = read(); init();
	int ans = 0;
	rep(i, 1, n) {
		int x = read(), y = read();
		ans -= C(2*x+2*y,2*x) - MOD; ans %= MOD;
		a[2001 + x][2001 + y] ++;
		dp[2001 - x][2001 - y] ++; 
	} rep(i, 1, 4001) rep(j, 1, 4001) {
		dp[i][j] += dp[i - 1][j] + dp[i][j - 1];
		dp[i][j] %= MOD; (ans += 1ll * dp[i][j] * a[i][j] % MOD) %= MOD;
	} cout << 1ll * ans * (MOD + 1) / 2 % MOD;
	return 0;
}

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

int main(){
    int a, b, i1, i2, i3, i4, i5, cnt=0;
    cin>>a>>b;

    for(int i=a; i<=b; i++){
        i1=i%10;
        i2=(i%100-i1)/10;
        i3=(i%1000-i2-i3-i1)/100;
        i4=(i%10000-i3-i2-i1)/1000;
        i5=(i%100000-i4-i3-i2-i1)/10000;
        if(i1==i5 && i2==i4){
            cnt++;
        }
    }
    cout<<cnt<<endl;
}


Measured memory_bytes: 3520
import java.util.Scanner;

class Main{
    public static void main(String args[]){
        
        Scanner sc = new Scanner(System.in);
        
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        int sum = a * b;
        int s = a + a + b + b;
        System.out.println(sum + " " + s);
    }
}


Measured memory_bytes: 26096
#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;
typedef double D;
typedef long double LD;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> opset;
#define SZ(X) ((int)X.size())
#define ALL(I) I.begin(), I.end()
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define eps 1e-12
#define INF 1000000007
#define MXN 200005
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)

int n, a[MXN], A, B;

void sol(int l, int r, int h, int t, int msk){
	if(l == r) return;
	int mid = (l + r) >> 1, pos, M;
	for(int i = 1; i < (1 << n); i <<= 1){
		if(msk & i && (h ^ t) & i) pos = i;
	}
	M = h ^ ((msk ^ pos) & -(msk ^ pos));
	sol(l, mid, h, M, msk ^ pos);
	sol(mid + 1, r, M, t, msk ^ pos);
	for(int i = l; i <= mid; i ++) a[i] ^= (h & pos);
	for(int i = mid + 1; i <= r; i ++) a[i] ^= (t & pos);
}

int main(){
	scanf("%d%d%d", &n, &A, &B);
	if(__builtin_popcount(A ^ B) % 2 == 0){
		puts("NO");
		return 0;
	}
	sol(1, 1 << n, A, B, (1 << (n + 1)) - 1);
	puts("YES");
	for(int i = 1; i <= 1 << n; i ++) printf("%d%c", a[i], " \n" [i == (1 << n)]);
}



Measured memory_bytes: 1536
#include <iostream>

int main(){
  int money = 100000;
  int n;

  std::cin >> n;

  for(int i = 0; i < n; i++){
    money *= 1.05;
    if(money % 1000 != 0)
      money += 1000 - money % 1000;
  }

  std::cout << money << std::endl;

}

Measured memory_bytes: 1160
#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y-1);(X) >=0;--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"<<endl; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}

int main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);
  int i,j,k,T;
  cin>>T;
  while(T--){
    double xx,yy;
    ll x[4],y[4];
    rep(i,4){
      cin>>xx>>yy;
      x[i]=xx*1e6;
      y[i]=yy*1e6;
      //   cout<<x[i]<<","<<y[i]<<endl;
    }
    rep(i,2){
      x[i*2+1]-=x[i*2];
      y[i*2+1]-=y[i*2];
    }
    cout<<(x[1]*y[3]==x[3]*y[1]?"YES":"NO")<<endl;
  }
  return 0;
}

Measured memory_bytes: 1228
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    while(a>0 && c>0)
    {
        c=c-b;
        if(c<=0)
        {
            cout<<"Yes";
            return 0;
        }
        a=a-d;
        if(a<=0)
        {
        cout<<"No";
        return 0;
        }
    }
}

Measured memory_bytes: 3636