akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <algorithm>
#include <utility>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const double EPS = 1e-9;


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

  int a,b,c;
  cin>>a>>b>>c;
  if(a + b >= c) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

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

		Scanner scan = new Scanner(System.in);

		int A = scan.nextInt();
		int B = scan.nextInt();

		int anser = -1;

		for(int i = 13;i<1010;i++) {
			if((int)(i*0.08) == A && (int)(i*0.1) == B) {
				anser = i;
				break;
			}
		}

		System.out.println(anser);
	}

}


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

namespace ABC114A
{
    class Program
    {
        static void Main(string[] args)
        {
            int X, a;

            X = int.Parse(Console.ReadLine());

            if (X == 3 || X == 5 || X == 7)
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
            Console.ReadKey();



        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define ALL(vec) vec.begin(), vec.end()
#define rALL(vec) vec.rbegin(), vec.rend()
using namespace std;
using ll = long long;

int main() {
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    if ((C + B - 1)/B <= (A + D - 1)/D) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3632
#include <stdio.h>

int main() {
    int n, k, s, i, cnt = 0;
    scanf("%d %d %d", &n, &k, &s);
    for (i = 0; i < n; i++) {
        if (cnt == k) {
            if (s == 1000000000){ printf("%d ", s - 1); }
            else { printf("%d ", s + 1); }
        }else{printf("%d ", s); cnt++;}
    }
    printf("\n");
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
 
int main()
{
    int A, B;

    cin >> A >> B;

    if((A <= 8) && (B <= 8))
    {
        cout << "Yay!";
    }
    else
    {
        cout << ":(";
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
ll inf = LLONG_MAX;
long double pi = M_PI;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
  ll n;
  cin >> n;
  ll ans = 1;
  while (ans <= n) ans *= 2;
  if (ans > n) ans /= 2;
  cout << ans << endl;
}

Measured memory_bytes: 256
// new day,new strength,new thougts
#include<bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define PF push_front
#define POB pop_back
#define POF pop_front
#define F first
#define S second
#define sz(c) int((c).size())
#define REP(i,n)  for(int i=0;i<int(n);i++)
#define REPD(i,n) for(int i=int(n)-1;i>=0;i--)
#define FOR(i,a,b) for(int i=int(a);i<=int(b);i++)
#define FORD(i,a,b) for(int i=int(a);i>=int(b);i--)
#define all(s) (s).begin(),(s).end()
#define bit(num,i) ((num>>i)&1)

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;

const ll inf=4e18;
const ll maxn=2e5+10;
const ll mod=1e9+7;

int main(){
    ll n;cin>>n;
    ll bef=-1,cn=0,ans=0;
    REP(i,n){
	ll x;cin>>x;
	if(bef==x){
	    cn++;
	}
	else{
	    ans+=cn/2;
	    cn=1;
	    bef=x;
	}
    }
    ans+=cn/2;
    cout<<ans;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
int p , q ,r;
scanf("%d %d %d",&p,&q,&r);

if(p==5&&q==7&&r==5||p==5&&q==5&&r==7||p==7&&q==5&&r==5){
    printf("YES");
}
else {printf("NO");}

return 0;
}


Measured memory_bytes: 1664
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <algorithm>

using namespace std;

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

    int buf;
    vector<int> hoge;
    for (int a = 0; a < num; ++a) {
        cin >> buf;
        hoge.push_back(buf);
    }

    sort(hoge.begin(),hoge.end(),greater<int>());

    long long int sum = 0;
    for(auto k : hoge){
        sum += k;
    }

    cout << hoge.at(num - 1) << " " << hoge.at(0) << " " << sum << endl;

}

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

int main() {
  int A, B, x;
  cin >> A >> B;
  x=0;
  for (int i = 0; i < 2; i++) {
    if (A > B) {
      x += A;
      A--;
    }
    else {
      x += B;
      B--;
    }
  }
  cout << x << endl;
}


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

#define INF 1000010000
#define nl '\n'
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define pdd pair<double,double>
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))
#define sz(c) (c).size()
#define rep(i,n) for( int i = 0; i < n; ++i )
#define repi(i,n) for( int i = 1 ; i <= n; ++i )
#define repn(i,n) for( int i = n - 1 ; i >= 0 ; --i )
#define repf(j,i,n) for( int j = i ; j < n ; ++j )
#define die(s) {std::cout << s << nl;}
#define dier(s) {std::cout << s; return 0;}
#define dbg(var) {std::cout << #var << "  = " << var << nl;}
#define vi vector<int>
typedef long long ll;

using namespace std;


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

	int n;
	cin >> n;
	
	vi v(n);
	rep(i , n){
		cin >> v[i];
	}
	
	SORT(v);
	
	int l = 0 , r = n - 2;
	while(r - l > 1){
		int mid = (r + l) / 2;
		if(2 * v[mid] <= v[n - 1]){
			l = mid;
		}else{
			r = mid;
		}
	}

	if(r != n - 1){
		if(abs(2 * v[r] - v[n - 1]) < abs(2 * v[l] - v[n - 1])){
			l = r;
		}
	}
	
	cout << v[n - 1] << " " << v[l] << endl;

	return 0;
}


Measured memory_bytes: 640
#include<stdio.h>
int main()
{
    int m,n,i,sum=0;
    int a[100000];
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        scanf("%d",&a[i]);
        sum+=a[i];
    }
    if(sum<=n)
    {
        printf("%d",n-sum);
    }
    else
        printf("-1");
    return 0;
}


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

int main() {
  int n;
  int dp[10001]={};
  dp[0]=1, dp[1]=2;
  for(int i=2; i<10001; i++) {
    dp[i]=dp[i-1]+i;
  }
  
  while(cin>>n) {
    cout<<dp[n]<<endl;
  }
  return 0;
}

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

using namespace std;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef long long ll;

int N,M,T;

mat mul(mat &A,mat &B){
  mat C(A.size(),vec(B[0].size()));
  for(int i = 0 ; i < (int)A.size() ; i++){
    for(int k = 0 ; k < (int)B.size() ; k++){
      for(int j = 0 ; j < (int)B[0].size() ; j++){
        C[i][j] = (C[i][j] + A[i][k]*B[k][j]) % M;
      }
    }
  }
  return C;
}

mat pow(mat A,ll n){
  mat B(A.size(),vec(A.size()));
  for(int i = 0 ; i < (int)A.size() ; i++){
    B[i][i] = 1;
  }
  while(n > 0){
    if(n & 1){ B = mul(B,A); }
    A = mul(A,A);
    n >>= 1;
  }
  return B;
}

int main(){
  int a[3];
  while(cin >> N >> M >> a[0] >> a[1] >> a[2] >> T, N){
    mat S(N,vec(1));
    for(int i = 0 ; i < N ; i++){
      cin >> S[i][0];
    }
    mat A(N,vec(N));
    for(int i = 0 ; i < N ; i++){
      for(int j = 0 ; j < N ; j++){
        A[i][j] = 0;
      }
      for(int j = i-1, k = 0 ; j < i+2 ; j++, k++){
        if(j < 0 || j >= N){ continue; }
        A[i][j] = a[k];
      }
    }
    mat B = pow(A,T);
    mat C = mul(B,S);
    for(int i = 0 ; i < N ; i++){
      if(i > 0){ cout << " "; }
      cout << C[i][0];
    }
    cout << endl;
  }
  return 0;
}

Measured memory_bytes: 1284
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;

namespace atcorder2
{
    class Program
    {
        public static long Read()
        {
            return long.Parse(Console.ReadLine());
        }

        public static long[] Reads()
        {

            return Console.ReadLine().Split().Select(long.Parse).ToArray();
        }


        public static long GCM(long x, long y)
        {
            var s = x;
            var t = y;
            if (x < y) GCM(y, x);
            while (y != 0)
            {
                var z = x % y;
                x = y;
                y = z;
            }
            return s / x * t;
        }



        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            var input = Reads();
            var n = input[0];
            var y = input[1];
            var a = y / 10000 + 1;
            var b = y / 5000 + 1;
            long ans1 = -1;
            long ans2 = -1;
            long ans3 = -1;
            bool f = false;
            for (int i = 0; i < a; i++)
            {
                for (int j = 0; j < b; j++)
                {
                    if ((y - 10000 * i - 5000 * j) / 1000 == n - i - j&&n-i-j>=0)
                    {
                        ans1 = i;
                        ans2 = j;
                        ans3 = n - i - j;
               
                        break;
                    }
                }
            }
            Console.WriteLine("{0} {1} {2}", ans1, ans2, ans3);

            Console.Out.Flush();
        }
    }
}




Measured memory_bytes: 13396
#include<cstdio>
#include<algorithm>
#include<functional>
#include<cstring>
using namespace std;
int main(void)
{
	int a,n,i;
	double s;
	scanf("%d",&n);
	s=0.0;
	for(i=0;i<n;i++)	{
		scanf("%d",&a);
		s=s+=1.0/(double)a;
	}
	s=1/s;
	printf("%lf\n",s);
	return 0;
}

Measured memory_bytes: 128
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力

import copy

n, m = map(int, input().split())
ary = [int(s) for s in input().split()]

if n < m :
    ary.sort()
    sa = []
    
    for i in range(0, m - 1):
        sa.append(ary[i + 1] - ary[i])
    
    #print(sa)
    
    sa.sort()
    
    for i in range(0, n - 1):
        sa.pop(-1)
    
    print(sum(sa))
else :
    print(0)

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

int main(){
    random_device rd;
    mt19937_64 mt(rd());

    string s, t;
    cin >> s >> t;
    vector<ll>S(256, 0), T(256, 0);
    for(ll i = 0; i < s.size(); i++){
        ll hash = mt();
        S[s[i]]++;
        T[t[i]]++;
    }
    sort(S.begin(), S.end());
    sort(T.begin(), T.end());
    ll flg = 1;
    for(ll i = 0; i < 256; i++){
        if(S[i] != T[i])flg = 0;
    }
    cout << (flg ? "Yes" : "No") << endl;

    return 0;
}


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

unsigned GetDigit(unsigned num){
  return log10(num)+1;
}

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

  int ans{};
  for (int i{1}; i <= N; ++i) {
    if  (GetDigit(i) % 2 == 1) ++ans;
  }

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


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define erep(i,a,b) for(int i=a;i<=(int)(b);++i)
#define per(i,a,b) for(int i=(a);i>(b);--i)
#define eper(i,a,b) for(int i=(a);i>=b;--i)
#define fore(x, a) for(auto &x : a)
#define pb push_back
#define mp make_pair
#define INF 100100100100
#define inf 2001001001
#define MOD 1000000007
#define ALL(x) begin(x),end(x)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using vii = vector<int>;
using vll = vector<ll>;
template<class T>using vv = vector<T>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
template<class T>void show(const vector<T> &a) { for (int i = 0; i < (int)a.size(); ++i) cout << a[i] << (i != (int)a.size()-1 ? " " : "\n"); }
template<class T>T gcd(T a, T b){ return b ? gcd(b, a % b) : a; }
template<class T>T lcm(T a, T b){ return a / gcd(a, b) * b; }
int dy[]={0, 1, -1, 0};
int dx[]={1, 0, 0, -1};

int n;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
    cin >> n;
    vii a(n);
    map<int, int> cnt;
    rep(i, 0, n) {
      cin >> a[i];
      cnt[a[i]]++;
    }
    sort(ALL(a));
    int pos = 0, ans = 0;
    rep(i, 1, 100005) {
      if (cnt[i-1] + cnt[i] + cnt[i+1] > ans) 
        ans = cnt[i-1] + cnt[i] + cnt[i+1];
    }
    cout << ans << endl;
    return 0;
}



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

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define debug(x) cerr << #x << ": " << x << ", "
#define debugln(x) cerr << #x << ": " << x << '\n'

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

using namespace std;
using ll = long long;
using P = pair<ll, ll>;

//constexpr ll mod = 998244353;
constexpr ll mod = 1e9+7;
const double PI = acos(-1.0);
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());

// Mod int
inline ll minv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a/b;
    swap(a -= t*b, b); swap(u -= t*v, v);
  }
  return (u%m+m)%m;
}

struct mint {
    ll x;
    mint():x(0){}
    mint(ll x):x((x%mod+mod)%mod){}
    mint& fix() { x = (x%mod+mod)%mod; return *this;}
    mint operator-() const { return mint(0) - *this;}
    mint& operator+=(const mint& a){ if((x+=a.x)>=mod) x-=mod; return *this;}
    mint& operator-=(const mint& a){ if((x+=mod-a.x)>=mod) x-=mod; return *this;}
    mint& operator*=(const mint& a){ (x*=a.x)%=mod; return *this;}
    mint& operator/=(const mint& a){ (x*=minv(a.x, mod))%=mod; return *this; }
    mint operator+(const mint& a)const{ return mint(*this) += a;}
    mint operator-(const mint& a)const{ return mint(*this) -= a;}
    mint operator*(const mint& a)const{ return mint(*this) *= a;}
    mint operator/(const mint& a)const{ return mint(*this) /= a;}
    bool operator<(const mint& a)const{ return x < a.x;}
    bool operator==(const mint& a)const{ return x == a.x;}
};
istream& operator>>(istream&i,mint&a){i>>a.x;return i;}
ostream& operator<<(ostream&o,const mint&a){o<<a.x;return o;}

vector<mint> fact(1001);

mint mod_pow(mint a, long long x) {
  mint res = 1;
  while(x > 0) {
    if (x & 1) res = res * a;
    a = a * a; x >>= 1;
  }
  return res;
}

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

  int n, a, b, c, d; cin >> n >> a >> b >> c >> d;
  mint dp[n+1][n+1];

  rep(i, n+1) {
    rep(j, n+1) {
      dp[i][j] = 0;
    }
  }

  for(int i=0; i<a; i++) {
    dp[i][0] = 1;
  }

  fact[0] = 1;
  for(int i=1; i<=1000; i++) fact[i] = fact[i-1]*i;

  for(int i=a; i<=b; i++) {
    for(int j=0; j<=n; j++) {
      dp[i][j] = dp[i-1][j];
      mint fik = mod_pow(fact[i],c);
      for(int k=c; k<=d; k++) {
        int s = j-i*k;
        if (s<0) break;
        dp[i][j] += dp[i-1][s]*fact[n-s]/(fik*fact[n-j]*fact[k]);
        fik *= fact[i];
      }
    }
  }
  cout << dp[b][n] << endl;
}

Measured memory_bytes: 8064
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int N; ll T;
ll t[int(2e5 + 5)];

int main(){
  scanf("%d%lld", &N, &T);
  for (int i = 0; i < N; i++) scanf("%lld", t + i);

  ll ans = T, now = 0;
  for (int i = 0; i < N - 1; i++){
    if (t[i+1] - t[i] >= T) ans += T;
    else ans += t[i+1] - t[i];
  }
  cout << ans << endl;

  return 0;
}


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

int main()
{
  int n ;
  cin >> n ;
  std::vector<int> data ;
  for(int i = 0 ; i < n ; i++)
  {
    int x ; cin >> x ;
    data.push_back(x) ;
    data.push_back(x + 1) ;
    data.push_back(x - 1) ;
  } 
  sort(data.begin(), data.end()) ;

  int count = 1 ;
  int answer = 0 ;
  for(int i = 0 ; i < n * 3 ; i++)
  {
    if(i == n * 3 - 1)
    {
      answer = max(count, answer) ;
      //cout << count << endl;
      break ;
    }

    if(data.at(i) == data.at(i + 1))
    {
      count++ ;
    }
    else
    {
      answer = max(count, answer) ;
      //cout << count << " " ;
      count = 1 ;
    }
    
  }

  cout << answer << endl ; 
}


Measured memory_bytes: 2420
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
static const ll MAX = 1000000000000000;
static const int NIL = -1;
using namespace std;
const long double EPS = 0.0000000001;
const long double PI = (acos(-1));
const int MOD = 1000000007;

int main() {
  int n;
  bool flag = false;
  cin >> n;
  if (n % 10 == 7) flag = true;
  if (n / 10 % 10 == 7) flag = true;
  if (n / 100 % 10 == 7) flag = true;
  cout << (flag ? "Yes" : "No") << endl;
}


Measured memory_bytes: 3564
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{Write, BufWriter};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, [ $t:tt ]) => {{
        let len = read_value!($next, usize);
        (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    }};

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}
#[allow(unused)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }
    input! {
        n: usize, m: usize,
        ps: [(usize1, chars); m],
    }
    let mut ch = vec![vec![]; n];
    for (p, s) in ps {
        let k = if s == &['A', 'C'] { 0 } else { 1 };
        ch[p].push(k);
    }
    let mut ok = 0;
    let mut pen = 0;
    for i in 0..n {
        let mut cur = 0;
        let mut cor = false;
        for &v in &ch[i] {
            match v {
                0 => cor = true,
                1 => {
                    if !cor {
                        cur += 1;
                    }
                }
                _ => unreachable!(),
            }
        }
        if cor {
            ok += 1;
            pen += cur;
        }
    }
    puts!("{} {}\n", ok, pen);
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


Measured memory_bytes: 16636
import java.util.Scanner

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    var sa = scanner.next().toCharArray()
    val c = listOf<Char>('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x','y', 'z')
    var n = 0
    for (n in 0..26){
        if (c[n] == sa[0]){
            println(c[n+1])
            break
        }
    }
}

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

int top = 0, S[1000];

void push(int x) {
  S[++top] = x;
}

int pop(void) {
  top--;
  return S[top+1];
}

int main(void) {
  int a, b;
  top = 0;
  char s[100];
  while(scanf("%s",s) != EOF) {
    if(s[0] == '+') {
      a = pop();
      b = pop();
      push(a + b);
    } else if(s[0] == '-') {
      b = pop();
      a = pop();
      push(a - b);
    } else if(s[0] == '*') {
      a = pop();
      b = pop();
      push(a * b);
    } else {
      push(atoi(s));
    }
  }
  printf("%d\n",pop());

  return 0;
}


Measured memory_bytes: 2116
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
const int INF =1001001001;
using P = pair<int,int>;

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

    // x ^ x = 0  ➡️　奇数なら x 偶数なら 0 ......①
    // x1 ^ x2 ^ x3 ^ x4 に x2 ^ x3 ^ x4 をxorすると x1だけ取り出せる
    // a1 = x2 ^ x3 ^ x4  ↓
    // a2 = x1 ^ x3 ^ x4  ↓
    // a3 = x1 ^ x2 ^ x4  ↓
    // a4 = x1 ^ x2 ^ x3  ↓
    // この場合全て3つずつ(nは偶数なので、どのパターンでも奇数になる　①より無視できる)
    // x1 ^ x2 ^ x3 ^ x4と同値になる = sとする
    // sにそれぞれのaをxorするとそれぞれのxを取り出せる

    int s = 0;
    rep(i,n) s ^= a[i];
    rep(i,n) a[i] ^= s;
    rep(i,n) cout << a[i] << " ";
    cout << endl;
    return 0;

}
     

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

using namespace std;

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

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int main(){
  string s;
  cin>>s;
  set<char> S;
  REP(i,s.size())S.insert(s[i]);
  puts(s.size()==S.size() ? "yes" : "no");
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#define ll long long
#define uint unsigned int
#define c_double static_cast<double>
using namespace std;

void problem_B() {
	int N, L;
	cin >> N >> L;
	int iterator = 0;
	int mini = 1000;
	int Taste = 0;
	for (int i = 1; i < N + 1; i++) {
		Taste += L + i - 1;
		if (mini - abs(L + i - 1) > 0) {
			mini = abs(L + i - 1);
			iterator = i;
		}
	}
	Taste -= (L + iterator - 1);
	cout << Taste << endl;

}

int main() {
	problem_B();
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
using namespace std;

#define ll long long
#define pb push_back

int main(){

	int N, sum = 0, max = 0;
	cin >> N;
	for(int i = 0; i < N; i ++){
		int l;
		cin >> l;
		sum += l;
		if(max < l)max = l;
	}
	sum -= max;
	if(max < sum)cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

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

int main(){
int N; cin >> N;
vector<int> d(N);

for (int i = 0; i < N; i++) {
    cin >> d[i];
}
sort(d.begin(), d.end());

int last_val = 0;
int ans = 0;
for (int i = 0; i < N; i++) {
    if (d[i] > last_val) {
        last_val = d[i];
        ans++;
    }
}

cout << ans << endl;

}



Measured memory_bytes: 256
N, K, L = [int(_) for _ in input().split()]


def find(a, x):
    if a[x] != x:
        a[x] = find(a, a[x])
    return a[x]


def unite(a, x, y):
    x = find(a, x)
    y = find(a, y)
    if x != y:
        a[x] = min(x, y)
        a[y] = a[x]


a_road = [i for i in range(N)]
for _ in range(K):
    p, q = [int(_) - 1 for _ in input().split()]
    unite(a_road, p, q)
a_railway = [i for i in range(N)]
for _ in range(L):
    r, s = [int(_) - 1 for _ in input().split()]
    unite(a_railway, r, s)
memo = {}
for i in range(N):
    memo[a_road[i], a_railway[i]] = memo.get(
        (find(a_road, i), find(a_railway, i)), 0) + 1

print(' '.join(str(memo[a_road[i], a_railway[i]]) for i in range(N)))


Measured memory_bytes: 55056
def main():
    N = input_ints()
    A = input_int_list_in_line()

    A.sort(reverse=True)

    ans = A[0]

    for i in range(N-2):
        ans += A[i // 2 + 1]

    print(ans)


def input_ints():
    line_list = input().split()

    if len(line_list) == 1:
        return int(line_list[0])
    else:
        return map(int, line_list)


def input_int_list_in_line():
    return list(map(int, input().split()))


def input_int_tuple_list(n: int):
    return [tuple(map(int, input().split())) for _ in range(n)]


main()


Measured memory_bytes: 31620
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9+7;




int main(){
    ll N; cin >> N;
    vector<ll> A(N); for(int i = 0; i < N; i++) cin >> A[i];
    vector<ll> V;
    for(int i = N-1; i >= 0; i--){
        ll X = A[i];
        auto itr = upper_bound(V.begin(), V.end(), X);
        if(itr == V.end()) {
            V.push_back(X);
        }
        else{
            ll idx = distance(V.begin(), itr);
            V[idx] = X;
        }
    }
    cout << V.size() << endl;
}

Measured memory_bytes: 2168
#include <iostream>

using ll = long long;
int main(int argc, char ** argv)
{
  //
  int x;
  std::cin >> x;

  if (x == 0) {
    std::puts("0");
    return 0;
  }

  int i500 = 0;
  int i5 = 0;

  int tmp = x;
  i500 = tmp/500;;
  tmp -= 500*i500;
  i5 = tmp/5;
  std::printf("%d\n", 1000 * i500 + 5 * i5);
  return 0;
}

Measured memory_bytes: 888
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pb push_back
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
signed main(){
  int N; cin>>N;
  vii A(N);
  rep(i,1,N){
    int X,Y; cin>>X>>Y;
    A[X-1].pb(Y-1);
    A[Y-1].pb(X-1);
    }
  vi C(N);
  rep(i,0,N) cin>>C[i];
  sort(ALL(C),greater<int>());
  int sum=0;
  rep(i,1,N) sum+=C[i];
  cout<<sum<<endl;
  vi F(N,-1);
  F[0]=0;
  int count=1;
  queue<int> Q;
  Q.push(0);
  while(Q.size()>0){
    int X=Q.front(); Q.pop();
    rep(i,0,A[X].size()){
      int Y=A[X][i];
      if(F[Y]==-1){
        F[Y]=count++;
        Q.push(Y);
        }
      }
    }
  rep(i,0,N) cout<<C[F[i]]<<" ";
  cout<<endl;
  }


Measured memory_bytes: 1152
main :: IO()
main = do
    [_,_,x,y] <- map read . words <$> getLine
    xls <- map read . words <$> getLine
    yls <- map read . words <$> getLine
    putStrLn $ if (judge x y xls yls) then "War" else "No War"

--戦争起こるならTrue 起こらないならFalse
judge :: Int -> Int -> [Int] -> [Int] -> Bool
judge x y xls yls
    | xmax >= ymin			= True
    | ymin <= x				= True
    | xmax >= y				= True
    | otherwise				= False
    where xmax = maximum xls
          ymin = minimum yls





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

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    int num=a*100+b*10+c;
    string ans;
    
    if (num%4 == 0) {
        ans = "YES";
    } else ans = "NO";
    
    cout << ans << endl;
    return 0;
    
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pii pair<int,int>
const long long MOD=1e9+7;

int main() {
  int a,b;
  cin>>a>>b;
  if(a<=b) cout<<a<<endl;
  else cout<<a-1<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define F first
#define S second
#define int long long
#define double long double
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> iP;
typedef pair<P,int> Pi;
typedef pair<P,P> PP;
double eps=1e-8;
int mod=1e9+7;
int inf=1LL<<55;

priority_queue<P,vector<P>,greater<P> > pq;

template <typename T>
int Count(const vector<T> &v, T l,T r){
  //counting [l,r]
  auto L = lower_bound(v.begin(), v.end(), l );
  auto R = upper_bound(v.begin(), v.end(), r );
  // [l,r) change upper -> lower
  return R-L;
}
char c[100][100];
signed main(){
  int a,b;
  cin>>a>>b;
  for(int i=0;i<100;i++)
    for(int j=0;j<100;j++)
      if(i<50)c[i][j]='#';
      else c[i][j]='.';
  a--,b--;
  for(int i=0;i<50&&a;i+=2)
    for(int j=0;j<100&&a;j+=2){
      c[i][j]='.';
      a--;
    }
      
  for(int i=99;i>=50&&b;i-=2)
    for(int j=0;j<100&&b;j+=2){
      c[i][j]='#';
      b--;
    }
  
  cout<<100<<" "<<100<<endl;
  for(int i=0;i<100;i++){
    for(int j=0;j<100;j++)cout<<c[i][j];
    cout<<endl;
  }
  
  return 0;
}


Measured memory_bytes: 256
// #include <bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<set>
#include<vector>
#include<map>
#include<queue>
#include<stack>
#include<algorithm>
#include<math.h>
using namespace std; 

// #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

typedef long long ll; 
typedef long double ld; 
#define prarr(a,n) cerr<<#a<<" : ";for(ll i=0;i<n;i++) cerr<<a[i]<<" "; cerr<<endl;
#define prmat(mat,row,col) cerr<<#mat<<" :\n";for(ll i=0;i<row;i++) {for(ll j=0;j<col;j++) cerr<<mat[i][j]<<"\t";cerr<<endl;}
#define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__)
#define all(a) a.begin(),a.end()
#define sz(x) ((int)x.size())
#define endl '\n'
#define fast_io ios_base::sync_with_stdio(NULL); cin.tie(NULL)
template <class T> void dbs(string str, T t) {cerr << str << " : " << t << "\n";}
template <class T, class... S> void dbs(string str, T t, S... s) {ll idx = str.find(','); cerr << str.substr(0, idx) << " : " << t << ", "; dbs(str.substr(idx + 1), s...);}
template <class T> void prc(T a, T b) {cerr << "["; for (T i = a; i != b; ++i) {if (i != a) cerr << ", "; cerr << *i;} cerr << "]\n";}
template <class T> void prall(T a) { prc(all(a)); }
const int inf=1000*1000*1000+9; 
const ll infl=1ll*inf*inf; 
const int mod=1000*1000*1000+7;  

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

vector<pair<int,int>> adj[30]; 
void solve(){
	int l ;cin>>l; 
	int n=1; 
	while((1<<n)<=l) n++; 
	int start[30]={0}; 
	int m=0; 
	for(int i=1;i<n;i++){
		adj[i].push_back({i+1,1<<(n-i-1)}); 
		start[n-i-1]=i; 
		adj[i].push_back({i+1,0}); 
		m+=2; 
	}
	int len=1<<(n-1); 
	for(int i=n-2;i>=0;i--){
		if( (1<<i & l ) > 0){
			adj[1].push_back({ (i>=1? start[i-1]:n) , len}); 
			len^=(1<<i); 
			m++; 
		}
	}
	cout<<n<<" "<<m<<endl; 
	for(int i=1;i<=n;i++){
		for(auto p:adj[i]){
			cout<<i<<" "<<p.first<<" "<<p.second<<endl; 	
		}
	}
}


int main(){
	// clock_t beg=clock(); 
	fast_io; 
    cout << fixed << setprecision(13); 
	solve(); 	
	// clock_t end=clock(); 
	// fprintf(stderr, "%lf\n", (double)(end-beg)/(CLOCKS_PER_SEC));
}

Measured memory_bytes: 256
#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;
#ifdef TEST
#define getchar_unlocked _getchar_nolock
#endif
#define int long long
#define ins insert
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define pp pop
#define ppb pop_back
#define ppf pop_front
#define eb emplace_back
#define g0(a) get<0>(a)
#define g1(a) get<1>(a)
#define g2(a) get<2>(a)
#define g3(a) get<3>(a)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef double db;
typedef long long ll;
typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;
typedef tree<pair<int, int>, null_type, less<pair<int, int> >, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	string s;
	cin >> s;
	if (s == "ABC") cout << "ARC\n";
	else cout << "ABC\n";
}


Measured memory_bytes: 3644
import java.util.Scanner;
public class Main {
	
	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)) {
			char[][] keitai = {
					{},
					{'.', ',', '!', '?', ' '},
					{'a', 'b', 'c'},
					{'d', 'e', 'f'},
					{'g', 'h', 'i'},
					{'j', 'k', 'l'},
					{'m', 'n', 'o'},
					{'p', 'q', 'r', 's'},
					{'t', 'u', 'v'},
					{'w', 'x', 'y', 'z'}
			};
			
			int n = sc.nextInt();
			while(n-- != 0) {
				char[] b = sc.next().toCharArray();
				StringBuilder s = new StringBuilder();
				int i = 0;
				while(i < b.length) {
					if(b[i] == '0') i++;
					else {
						char c = b[i++];
						int j = 0;
						while(b[i] == c) {
							i++;
							j++;
						}
						s.append(keitai[c - '0'][j % keitai[c - '0'].length]);
						i++;
					}
				}
				System.out.println(s);
			}
		}
	}
}



Measured memory_bytes: 29088
import queue

n = int(input())
go = [[]for _ in range(n)]
ge = [[]for _ in range(n)]
 
for _ in range(n-1):
    x,y,z = map(int, input().split())
    if z % 2 == 0:
        ge[x-1].append(y-1)
        ge[y-1].append(x-1)
    else:
        go[x-1].append(y-1)
        go[y-1].append(x-1)

color = [0] * n
color[0] = 1

q = queue.Queue()

q.put(0)

while not q.empty():
    v = q.get()
    for i in range(len(go[v])):
        if color[go[v][i]] == 0:
            color[go[v][i]] = - color[v]
            q.put(go[v][i])
    for i in range(len(ge[v])):
        if color[ge[v][i]] == 0:
            color[ge[v][i]] = color[v]
            q.put(ge[v][i])

for i in range(n):
    if color[i] == -1:
        print(0)
    else:
        print(1)

Measured memory_bytes: 97820
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1e9+7;

int main(){
    int n;
    cin >> n;
    if(n%2 == 0){
        cout << n*(n-2)/2 << endl;
        for(int i = 1; i <= n-1; i++){
            for(int j = i+1; j <= n; j++){
                if(i+j == n+1) continue;
                cout << i << " " << j << endl;
            }
        }
    }  
    else{
        cout << (n-1)*(n-1)/2 << endl;
        for(int i = 1; i <= n-1; i++){
            for(int j = i+1; j <= n; j++){
                if(i+j == n) continue;
                cout << i << " " << j << endl;
            }
        }
    }  
}

Measured memory_bytes: 256
#include <iostream>
#include <ccomplex>
#include <vector>
#include <cassert>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <numeric>
#include <list>
#include <assert.h>
#include <math.h>
#include <valarray>
#include <stdio.h>
#include <algorithm>
#include <set>
#include <complex>
#include <list>
#include <time.h>
#include <stack>
#include <locale>
#include <clocale>
#include <ctype.h>
#include <wchar.h>
#include <random>
#include <vector>
#include <unordered_map>

using namespace std;
typedef long long int LL;
typedef long long int ll;
typedef pair<long long int, long long int> pii;
typedef pair<double, double> pdd;

#define SORT(c) sort((c).begin(),(c).end())
#define BACKSORT(c) sort((c).begin(),(c).end(),std::greater<LL>())
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

int main() {
  int n;
  cin >> n;
  vector<LL> a(n);
  REP(i,n){
    cin >> a[i];
    a[i] *= 2;
  }
  SORT(a);

  LL max = a[n - 1]/2;

  LL num = -1;

  REP(i,n-1){
    if(abs(max-num)>abs(max-a[i])){
      num = a[i];
    }
  }

  cout << max << " "<<num/2 << endl;
}


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

int main()
{
	int X,Y;
	cin>>X>>Y;
	
	if(X==Y)
	{
		cout<<"0";
		return 0;
	}
	
	if(X==0)
	{
		if(Y<0)
		cout<<-Y+1;
		else cout<<Y;
		return 0;
	}
	
	if(Y==0)
	{
		if(X<0)
		cout<<abs(X);
		
		else cout<<X+1;
		return 0;
	}
	
	if((X<0 && Y<0) || (X>0 && Y>0) )
	{
		if(X>Y)
		cout<<abs(abs(X)-abs(Y))+2<<endl;
		
		else
		cout<<abs(Y-X)<<endl;
	}
	
	else
	{
		cout<<abs(abs(X)-abs(Y))+1<<endl;
	}
	
	
}

Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String args[]) {
		FastScanner sc = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int N = sc.nextInt();
		int a[] = new int[N];
		for(int i=0;i<N;i++) {
			a[i] = sc.nextInt();
		}
		int now = 1;
		int result = 0;
		for(int i=0;i<N;i++) {
			if(now==a[i]) {
				now++;
				result++;
			}
		}
		

		if(now==1) out.println("-1");
		else{
			out.println(N-result);
		}

		out.flush();
	}


	public static long gcd(long a, long b) {
		if(b==0) {
			return a;
		}
		else {
			return gcd(b,a%b);
		}
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;
	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		}else{
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}
	private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
	private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
	public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
	public String next() {
		if (!hasNext()) throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while(isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	public long nextLong() {
		if (!hasNext()) throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			}else if(b == -1 || !isPrintableChar(b)){
				return minus ? -n : n;
			}else{
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) nl;
	}
	public double nextDouble() { return Double.parseDouble(next());}
}



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

#define COUT(x) cout << x << endl
#define CIN(x) cin >> x
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define REP(i, n) FOR(i, 0, n)
#define EXIST(s, e) (s.find(e) != s.end())
#define SORT(c) sort(c.begin(), c.end())
#define ERASEUNIQE(v) v.erase(unique(v.begin(), v.end()), v.end())

// conversion
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();
}

// math
template <class T>
inline T sqr(T x) { return x * x; }

// typedef
typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

// container util
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.rend()

// constant
const double EPS = 1e-10;
const double PI = acos(-1.0);

// debug
#define dump(x) cerr << #x << " = " << x << endl;
#define debug(x) cerr << #x << " = " << x << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;

// clear memory
#define CLR(a) memset((a), 0, sizeof(a))

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

int main(int argc, char const *argv[])
{
    int a, b;
    CIN(a), CIN(b);
    cout << a * b << " " << 2 * a + 2 * b << endl;
    return 0;
}



Measured memory_bytes: 3068
#include<iostream>
#include<cstdio>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<deque>
#include<queue>
#include<climits>
#include<cassert>
#include<cstring>
#include<iomanip>
#include<bitset>
#include<sstream>

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

using namespace std;

int main() {
  int A,B,C;
  cin >> A >> B >> C;
  int step = 0;
  while(1) {
    if( (A&1) || (B&1) || (C&1) ) break;
    if( A == B && B == C ) { puts("-1"); return 0; }
    int nA = B / 2 + C / 2;
    int nB = A / 2 + C / 2;
    int nC = A / 2 + B / 2;
    A = nA, B = nB, C = nC;
    ++step;
  }
  cout << step << endl;
  return 0;
}


Measured memory_bytes: 764
#include  <bits/stdc++.h>
using namespace std;
#define    error(args...){string _s=#args;replace(_s.begin(), _s.end(), ',', ' ');stringstream _ss(_s);istream_iterator<string> _it(_ss);err(_it,args);}
void err  (istream_iterator<string> it) {}
template  <typename T, typename... Args>
void err  (istream_iterator<string> it, T a, Args... args)
{
    cerr << *it << " = " << a <<" ; ";
    err(++it, args...);
    cout << endl;
}
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/*Let's start.............*/
#define   ll                long long
#define   pb                push_back
#define   ff                first
#define   ss                second
#define   srt(v)            sort(v.begin(),v.end())
#define   inf               200000000000000000
#define   mxn               100009
#define   MOD               1000000007
#define   pi                acos(-1)



int main()
{

    //freopen("input.txt","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    vector<ll> v;
    ll n;
    cin >> n;
    for(ll i = 1;i <= n;i++){
        ll x;cin >> x;
        v.pb(x);
    }
    srt(v);
    ll cnt = 0;
    for(ll i = 0;i < v.size();i++){
        for(ll j = i+1;j < v.size();j++){
            for(ll k = j+1;k < v.size();k++)
            if(v[i]+v[j] > v[k]){
                set<ll> s;
                s.insert(v[i]);
                s.insert(v[j]);
                s.insert(v[k]);
                if(s.size() == 3) cnt++;
            }
        }
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 3660
#include <iostream>
#include <vector>

void funcC() {
  int n, temp;
  std::cin >> n;
  std::vector<int> child(n, 0);
  for (int i = 1; i < n; i++) {
    std::cin >> temp;
    child[temp - 1]++;
  }
  for (int i = 0; i < n; i++)std::cout << child[i] << "\n";
}

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

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

using LL = long long int;
using uLL = unsigned long long int;
using uint = unsigned int;
using ld = long double;


int main(){
	cin.tie(NULL);
	ios_base::sync_with_stdio(0);
    int X;
    cin >> X;
    cout << X/500*1000+X%500/5*5 << '\n';

	return 0;
}


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

int main(){
    int n; cin >> n;
    int r;
    int DELTA_MAX = -1e9;
    
    int MIN; cin >> MIN;
    
    for(int i=1;i<n;i++){
        cin >> r;
        DELTA_MAX = max(r - MIN, DELTA_MAX);
        MIN = min(MIN, r);
    }
    cout << DELTA_MAX << endl;
}


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

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
    ll x; // typedef long long ll;
    mint(ll x=0):x((x%mod+mod)%mod){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= a;}
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod-2);}
    mint& operator/=(const mint a) { return *this *= a.inv();}
    mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
    vector<mint> fact, ifact;
    combination(int n):fact(n+1),ifact(n+1) {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
    }
    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return fact[n]*ifact[k]*ifact[n-k];
    }
};

int main() {
    ll K, N; cin >> K;
    string s; cin >> s; N = s.size();
    combination c(N + K);
    mint ans(0);
    for (int i = 0; i <= K; ++i) {
        mint x = mint(25).pow(i);
        x *= mint(26).pow(K - i);
        x *= c(i+N-1, N-1);
        ans += x;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 35560
N = int(input())
W = list(map(int, input().split()))
ans = 10**9

for T in range(N):
  S1 = 0
  S2 = 0
  for i in range(N):
    if i <= T:
      S1 += W[i]
    else:
      S2 += W[i]
  ans = min(ans, abs(S1 - S2))

print(ans)

Measured memory_bytes: 38768
#include<iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
if(b<10)
a=a*10+b;
if(b>=10 and b!=100)
a=a*100+b;
if(b==100)
a=a*1000+100;
int sum=0;
for(int i=1;i<333;i++)
if(a==i*i)
sum++;
if(sum!=0)
cout<<"Yes";
else cout<<"No";
system ("pause");
return 0;
}


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

int main()
{
	char a, b, c, ans='A';
	while (cin >> a >> c >> b) {
		if (a == 'A' && a == ans) {
			if (b == 'B') {
				ans = 'B';
			}
			if (b == 'C') {
				ans = 'C';
			}
		}
		else if (a == 'B' && a == ans) {
			if (b == 'A') {
				ans = 'A';
			}
			if (b == 'C') {
				ans = 'C';
			}
		}
		else if (a == 'C' && a == ans) {
			if (b == 'A') {
				ans = 'A';
			}
			if (b == 'B') {
				ans = 'B';
			}
		}
		else if (b == 'A' && b == ans) {
			if (a == 'B') {
				ans = 'B';
			}
			if (a == 'C') {
				ans = 'C';
			}
		}
		else if (b == 'B' && b == ans) {
			if (a == 'A') {
				ans = 'A';
			}
			if (a == 'C') {
				ans = 'C';
			}
		}
		else if (b == 'C' && b == ans) {
			if (a == 'A') {
				ans = 'A';
			}
			if (a == 'B') {
				ans = 'B';
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3100