akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
const ll N = 2e5 +9;
const ll p = 31;
const ll m = 1e9 + 7;
const ll inf= 1e14;
ll mod = 1e9+7;
ll powm(ll a, ll b) { ll res = 1; while (b) { if (b & 1) res = (res * a) % mod; a = (a * a) % mod; b >>= 1; } return res; }

int main() {   
     ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
     // #ifndef ONLINE_JUDGE
     // freopen("input.txt", "r", stdin);
     // freopen("output.txt", "w", stdout);
     // #endif
     ll q = 1;
     // cin>>q;
 
     while(q--){
          ll n,k;cin>>n>>k;
          ll r,p,s;cin>>r>>s>>p;
          string t;cin>>t;
          string ans;
          ll a = 0;
          for(int i = 0;i<n;i++){
               if(t[i]=='r'){
                    ans+='p';
                    a+=p;
               }
               if(t[i]=='p'){
                    ans+='s';
                    a+=s;
               }
               if(t[i] == 's'){
                    ans+='r';
                    a+=r;
               }
          }
          for(int i = k;i<n;i++){
               if(ans[i-k]==ans[i]){
                    ll p1,p2;
                    if(ans[i-k]=='r')p1 = r;
                    if(ans[i-k]=='p')p1 = p;
                    else p1=s;

                    if(ans[i]=='r')p2 = r;
                    if(ans[i]=='p')p2 = p;
                    else p2=s;
                    if(p2>p1){
                         ans[i-k] = 'd';
                         
                    }
                    else{
                         ans[i]='d';
                         
                    }
               }
          }
          a = 0;
          for(int i = 0;i<n;i++){
               if(ans[i]=='r')a+=r;
               if(ans[i]=='s')a+=s;
               if(ans[i]=='p')a+=p;
          }
          // cout<<ans<<'\n';
          cout<<a;

     }
}         

Measured memory_bytes: 640
function main(input){
  var ans = 0;
  for (var i=0; i<input[0].length; i++){
    if (input[0][i] === '2') 
      ans ++;
  }

  console.log(ans);
}


function parse(line){
  var ret = [];
  var arr = line.split(' ');
  for (var i = 0; i < arr.length; i++) {
    ret.push(parseInt(arr[i]));
  }
  return ret;
}

var input = '';

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
  input += chunk;
});
process.stdin.on('end', function() {
  input = input.split('\n');
  main(input);
});


Measured memory_bytes: 22204
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pp() pop_back()
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())

signed main(){
  int n,m,c;
  cin>>n>>m>>c;
  int d=0;
  int ans=0;
  V<int> b(m);
  fo(i,m){
    cin>>b[i];
  }
  for(int i=0; i<n; i++){
    V<int> a(m);
    fo(i,m){
      cin>>a[i];
    }
    for(int j=0; j<m; j++){
      d+=a[j]*b[j];

    }
    d+=c;
    if(d>0)
      ans++;
    d=0;
  }
  cout<<ans<<endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cassert>
#include <exception>
#include <numeric>
using namespace std;
typedef long long ll;
typedef string str;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<Pll> vp;
typedef vector<bool> vb;
#define rep(i, a, n) for (ll i = (a); i < (n); ++i)
#define rrep(i, a, n) for (ll i = (a); i > (n); --i)
#define erep(i, a, n) for (ll i = (a); i <= (n); ++i)
#define rerep(i, a, n) for (ll i = (a); i >= (n); --i)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mp make_pair
#define sz(x) ((int)x.size())
#define vec_max(V) *max_element(all(V))
#define vec_min(V) *min_element(all(V))
#define vec_sum(V) accumulate(all(V), 0LL)
#define print(X) cout << (X) << "\n"
#define _ << " " <<
#define Yes print("Yes")
#define No print("No")
static const int INF = 1e+9+7;

int main(){
  ll N;
  cin >> N;
  vll A(N);
  rep(i,0,N) cin >> A[i];

  sort(all(A));
  ll min = A[0];
  rep(i,1,N){
    if(A[i]%min != 0){
      ll tmp = A[i] % min;
      A[i] = min;
      min = tmp;
      i--;
    }
  }

  print(min);
  
  return 0;
}


Measured memory_bytes: 1024
class Main{
    public static void main(String[] a){
		String s = "";
		for(byte i=1;i<10;i++){
			for(byte j=1;j<10;j++){
				s+=i+"x"+j+"="+(i*j)+"\n";
			}
		}
		System.out.println(s.trim());
    }
}

Measured memory_bytes: 24288
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Numerics;

namespace AtCoderWorkspace
{
    public class Solver
    {
        public void Solve()
        {
            var cin = new Scanner();
            var n = cin.nextInt();
            var a = cin.ArrayInt(n);

            for (int i = 0; i < n; i++)
            {
                var N = a[i];

                if(N % 2 == 0)
                {
                    if(N % 3 == 0)
                    {
                        continue;
                    }

                    if( N % 5 == 0)
                    {
                        continue;
                    }

                    Console.WriteLine("DENIED");
                    return;

                }
            }

            Console.WriteLine("APPROVED");
        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return next();
            i = 0;
            return s[i++];
        }

        public int nextInt()
        {
            return int.Parse(next());
        }
        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt() + add;
            }
            return Array;
        }

        public int[] DPArrayInt(int N, int ex)
        {
            int[] Array = new int[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt();
            }
            return Array;
        }

        public long nextLong()
        {
            return long.Parse(next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong() + add;
            }
            return Array;
        }

        public long[] DPArrayLong(int N, int ex)
        {
            long[] Array = new long[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong();
            }
            return Array;
        }

        public double nextDouble()
        {
            return double.Parse(next());
        }


        public double[] ArrayDouble(int N, double add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextDouble() + add;
            }
            return Array;
        }
    }

    class Program
    {
        static void Main(string[] s) => new Solver().Solve();
    }
}


Measured memory_bytes: 13140
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int W=scanner.nextInt();
        int H=scanner.nextInt();
        int x=scanner.nextInt();
        int y=scanner.nextInt();
        int r=scanner.nextInt();

        if(x+r>W || x-r<0 || y+r>H || y-r<0){
            System.out.println("No");
        }else{
            System.out.println("Yes");
        }
    }
}



Measured memory_bytes: 26264
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <climits>
#include <algorithm>
#include <utility>

using namespace std;
using Int = long long int;
using UInt = unsigned long long int;
using VI = vector<long long int>;

namespace BasicMath {
    // 二つの値の最大値を求める関数
    static Int Max(const Int a, const Int b);
    // 最大公約数を求める(ユークリッドの互除法) 
    // O(log max(a, b)) time, O(1) space
    static UInt GreatestCommonDivisor(UInt a, UInt b);

    // 二つの値の最大値を求める関数
    Int Max(const Int a, const Int b) {
        if (a >= b) {
            return a;
        } else {
            return b;
        }
    }
    // 最大公約数を求める(ユークリッドの互除法) 
    UInt GreatestCommonDivisor(UInt a, UInt b) {
        if (b == 0) {
            return a;
        } else {
            if (a < b) {
                std::swap(a, b);
            }
            return GreatestCommonDivisor(b, a % b);
        }
    }
#define GCD GreatestCommonDivisor
}
using namespace BasicMath;

int main(void) {
    Int n;
    cin >> n;
    vector<Int> v(n);
    for (Int i = 0; i < n; ++i) {
        cin >> v[i];
    }
    vector<Int> l(n);
    vector<Int> r(n);
    l[0] = v[0];
    for (Int i = 1; i < n; ++i) {
        l[i] = GCD(l[i - 1], v[i]);
    }
    r[n - 1] = v[n - 1];
    for (Int i = n - 2; i >= 0; --i) {
        r[i] = GCD(r[i + 1], v[i]);
    }
    if (n == 2) {
        cout << Max(v[0], v[1]) << endl;
    } else {
        Int result = Max(r[0], r[1]);
        for (Int i = 0; i < n - 2; ++i) {
            result = Max(result, GCD(l[i], r[i + 2]));
        }
        result = Max(result, l[n - 2]);
        cout << result << endl;
    }
    return 0;
}



Measured memory_bytes: 5612
#include<iostream>

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

using namespace std;

int main(void){
  string s;
  while(1){
    int cell[16][16]={0};
    int x, y, xx, yy;
    int W = -1, w=0;
    int d = 0;

    cin >> s;
    if(s[0] == '#')break;
    rep(i, s.size()){
      if(s[i] == '/'){
        d++;
        if(W == -1)W = w;
        w = 0;
      }else if(s[i] == 'b'){
        cell[d][w] = 1;
        w++;
      }else{
        w += s[i] - '0';
      }
    }
    d++;
    cin >> x >> y >> xx >> yy;
    x--;y--;xx--;yy--;

    int cnt = 1;
    
    cell[x][y] = 0;
    cell[xx][yy] = 1;

    rep(i, d){
      rep(j, W){
        if(cell[i][j] == 0){
          if( j + 1 < W && cell[i][j+1] == 0) cnt++;
          else{
            cout << cnt;
            cnt=1;
          }
        }else if( cell[i][j] == 1){
          cout << 'b';
        }
      }
      if(i != d-1)cout << '/';
    }
    cout << endl;
  }

  return 0;
}

Measured memory_bytes: 3140
def main():
  n=int(input())
  a=sorted([int(input()) for _ in [0]*n])
  a.append(0)
  a=tuple(a)
  cnt,x,ans=0,a[0],0
  for i in a:
    if x==i:
      cnt+=1
    else:
      ans+=1 if cnt%2==1 else 0
      cnt,x=1,i
  print(ans)
if __name__=='__main__':
  main()

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

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

const ll MOD = ll(1e9 + 7);
const ll LLINF = LLONG_MAX;
const int IINF = INT_MAX;
const int MAX_N = int(1e5) + 5;
const double EPS = 1e-8;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#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 (ll i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()

int main() {
    int a,b;
    cin >> a >> b;
    cout << (a%2+b%2==2?"Yes":"No") << endl;
    return 0;
}


Measured memory_bytes: 256
import math
N , D = ( int(x) for x in input().split() )
X = [ ]
Y = [ ]

for i in range(N):
    x , y = ( int(x) for x in input().split() )
    X.append(x)
    Y.append(y)


ans = 0
for i in range( N ):
    x1 = X[i]
    y1 = Y[i]
    d = math.sqrt( (x1)**2 + (y1)**2 )
    if d <= D:
        ans += 1

print(ans)

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

using namespace std;
#define DBG(x)                         \
    (void)(cout << "L" << __LINE__     \
                << ": " << #x << " = " \
                << (x) << '\n')

typedef long long ll;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int INF = 0x3f3f3f3f;
const int maxn = 210000;
int a[maxn];
int main()
{
    //检查有没有特判0,有没有越界限.
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setiosflags(ios::fixed) << setprecision(12);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }
    int cur = 1;
    for (int i = 1; i <= n; i++)
    {
        if (a[i] == cur)
        {
            cur++;
        }
    }
    if (cur == 1)
        cout << -1 << "\n";
    else
        cout << n - cur + 1 << "\n";
    return 0;
}

Measured memory_bytes: 4404
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
using namespace std;
int main(){
  int M,D;
  cin>>M>>D;
  int answer=0;
  if(D>=22){
  for(int i=2;i<=D/10;i++){
    if(i<D/10){
      for(int j=2;j<=9;j++){
        if(i*j<=M){
          answer++;
        }
      }
    }
    else if(i==D/10&&D%10>=2){
      for(int j=2;j<=D%10;j++){
        if(i*j<=M){
          answer++;
        }
      }
    }
  }
 }
  cout<<answer<<endl;
}
/*int main(){
  int N;
  cin>>N;
  int A[20],B[20],C[20];
  for(int i=1;i<=N;i++){
    cin>>A[i];
  }
  for(int i=1;i<=N;i++){
    cin>>B[i];
  }
  int answer=0;
  for(int i=1;i<=N-1;i++){
   cin>>C[i]; 
  }
  for(int i=1;i<=N;i++){
    answer+=B[A[i]];
    if(i>=2&&A[i]-A[i-1]==1){
      answer+=C[A[i-1]];
    }
  }
  cout<<answer<<endl;
}*/
/*int main(){
  int N;
  cin>>N;
  cout<<N*N*N<<endl;
}*/

Measured memory_bytes: 256
//Sani buyuk Osman Pasa Plevneden cikmam diyor.
//FatihSultanMehmedHan
//Abdulhamid Han
//Bismillahirrahmanirrahim

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

typedef long long int lo;
typedef pair< int,int > PII;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(lo i=1;i<=n;i++)
#define mid (start+end)/2
#define ort (bas+son)/2

const lo MAX = -1000000000000000000; 
const lo MIN = 1000000000000000000; 
const lo inf = 1000000000; 
const lo KOK = 100000; 
const lo LOG = 30; 
const lo li = 100005; 
const lo mod = 1000000007; 

lo n,m,cev,b,a[li],k,x,y,z,c,c1,mx,b1,b2,b3,b4,b5,b6,b7,b8;
string s;
vector<lo> v1;
vector<lo> v2;
vector<lo> v3;
vector<lo> v4;
vector<lo> v5;
vector<lo> v6;
vector<lo> v7;
vector<lo> v8;

int main(void){
	scanf("%lld %lld",&n,&m);
	FOR{
		scanf("%lld %lld %lld",&x,&y,&z);
		v1.pb(x+y+z);
		v2.pb(x+y-z);
		v3.pb(x-y-z);
		v4.pb(-x-y-z);
		v5.pb(-x+y-z);
		v6.pb(x-y+z);
		v7.pb(-x+y+z);
		v8.pb(-x-y+z);
	}
	sort(v1.begin(),v1.end());
	reverse(v1.begin(),v1.end());
	
	sort(v2.begin(),v2.end());
	reverse(v2.begin(),v2.end());
	
	sort(v3.begin(),v3.end());
	reverse(v3.begin(),v3.end());
	
	sort(v4.begin(),v4.end());
	reverse(v4.begin(),v4.end());
	
	sort(v5.begin(),v5.end());
	reverse(v5.begin(),v5.end());
	
	sort(v6.begin(),v6.end());
	reverse(v6.begin(),v6.end());
	
	sort(v7.begin(),v7.end());
	reverse(v7.begin(),v7.end());
	
	sort(v8.begin(),v8.end());
	reverse(v8.begin(),v8.end());
	
	for(lo i=0;i<(lo)m;i++){
		b1+=v1[i];
		b2+=v2[i];
		b3+=v3[i];
		b4+=v4[i];
		b5+=v5[i];
		b6+=v6[i];
		b7+=v7[i];
		b8+=v8[i];
	}
	mx=max(b1,b2);
	mx=max(mx,b3);
	mx=max(mx,b4);
	mx=max(mx,b5);
	mx=max(mx,b6);
	mx=max(mx,b7);
	mx=max(mx,b8);
	printf("%lld\n",mx);
	return 0;
}


Measured memory_bytes: 384
import sys
A, B, C, X, Y = map(int, input().split())

Z = max(X,Y)
W = min(X,Y)

if Z % 2 == 1:
  Zeven = Z + 1
else:
  Zeven = Z

if W % 2 == 1:
  Weven = W + 1
else:
  Weven = W

# 個別
price1 = X*A + Y*B

# 全部Cで賄う（超えても良い）
price2 = C * Z * 2

# X,YのMAXが奇数の時、MAX-1までをCで賄う。端数はABでやる
if Z % 2 == 0:
  price3 = price2
else:
  price3 = C * (Z-1)*2 + A * max(0, X - Z + 1) + B * max(0,Y - Z + 1)

# 少ない方に合わせてCでまかない、端数はAかBでやる（超えるver)
price4 = C * W * 2 + A * max(0,X-W) + B * max(0,Y-W)

# 少ない方に合わせてCでまかない、端数はAかBでやる（超えないver)
if W % 2 == 0:
  price5 = price4
else:
  price5 = C * (W-1) * 2+ A * max(0,X - W + 1) + B * max(0,Y - W + 1)

#print(price1, price2, price3, price4, price5)
print(min(price1,price2,price3,price4,price5))

Measured memory_bytes: 3064
#include<iostream>
#include<cmath>
using namespace std;
#define F(i,s,e) for(int i=s;i<e;++i)

int main(){
    int n;
    cin >> n;
    int x[n],y[n];
    F(i,0,n) cin >> x[i];
    F(i,0,n) cin >> y[i];
    double d1=0,d2=0,d3=0,di=0;
    F(i,0,n){
        double d=abs(x[i]-y[i]);
        d1+=d;
        d2+=d*d;
        d3+=d*d*d;
        if(di<=d) di=d;
    }
    d2=sqrt(d2);
    d3=cbrt(d3);
    printf("%.10f\n%.10f\n%.10f\n%.10f\n",d1,d2,d3,di);
    return 0;
}


Measured memory_bytes: 3344
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>

#define f first
#define s second
#define mp make_pair

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

using namespace std;

typedef unsigned int uint;
typedef long long ll;

int main(){
  int n;
  while(cin>>n, n){
    vector<int> v(n);
    REP(i,n) cin>>v[i];
    
    int cnt = 0;
    int low = 0, high = n-1;
    int s; cin>>s;
    while(true){
      int mid = (low+high)/2;
      //cout << "mid=" << mid << endl;
      cnt++;
      if(v[mid] == s) break;
      if(low == high) break;
      if(v[mid] > s){
	high = mid-1;
      }else{
	low  = mid+1; 
      }
      if(low > high) break;
    }
    cout << cnt << endl;
  }
  return 0;
}

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

int main(){
    int n, k;
    while(cin >>n >>k){
        if(n == 0 && k == 0) break;
        vector<int> vec;
        int max = 0, now = 0;
        for(int i = 0; i < k; i++){
            int tmp;
            cin >>tmp;
            max += tmp;
            now += tmp;
            vec.push_back(tmp);
        }
        for(int i = k; i < n; i++){
            int tmp;
            cin >>tmp;
            vec.push_back(tmp);
            now += tmp;
            now -= vec[i - k];
            if(max < now) max = now;
        }
        cout <<max <<endl;
    }
    return 0;
}

Measured memory_bytes: 1412
n, m = gets.split.map(&:to_i)
puts m.times.map{|i| [i, gets.split.map(&:to_i)]}.group_by{|x,(y,z)| y}.map{|k,v| v.sort_by{|x,(y,z)|z}.each_with_index.map{|(x,(y,z)),i| [x, '%06d%06d' % [y, i+1]]}}.flatten(1).sort.map{|x,y|y}


Measured memory_bytes: 59528
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<ll>;
using VV = vector<VI>;
using VS = vector<string>;

// tourist set
template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif
// tourist set end

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; }

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,b) FOR(i, 0, b)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("YES")
#define p_no() p("NO")
#define pb(s) push_back(s)
#define SZ(x) ((int)(x).size())

void no(){p_no(); exit(0);}
void yes(){p_yes(); exit(0);}

const ll mod = 1e9 + 7;
const ll inf = 1e18;

void vprint(vector<ll> A){
    ll L = A.size();
    FOR(i, 0, L){
        if(i) cout << ' ';
        cout << A[i];
    }
    cout << endl;
}

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

    // input
    ll A, B;
    cin >> A >> B;

    double scarcity = B-1;
    ll num = ceil(scarcity / (A-1));
    p(num);

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.util.*;
    public class Main {
        public static void main(String args[]) {
          
          Scanner sc = new Scanner(System.in);
          
          int a,b,c;
          
          int sum = 0;
          
          a = sc.nextInt();
          b = sc.nextInt();
          c = sc.nextInt();
          
          sc.close();
          
          sum = a * b / 2;
          
          System.out.print(sum);
          
        }
    }

Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
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; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    cin.tie(0);
    ios::sync_with_stdio(false);<- これら、printfとかと併用しない方が良さそう

*/

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n==0) return 1;
    ll res=modpow(x, n/2);

    if(n%2==0) return res*res%mod;
    else return res*res%mod*x%mod;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };


// 線分 ab の偏角 返り値は[-π, π]
double argument(const pair<double, double> &a, const pair<double, double> &b){
    double ax=a.first, ay=a.second, bx=b.first, by=b.second;
    return atan2(by-ay, bx-ax);
}

/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */

int N;
vector<vector<int>> adj;
vector<int> child;
vector<int> par;

void input() {
    cin >> N;
    adj.resize(N, vector<int>());
    child.resize(N, 0);
    par.resize(N, -1);
    rep(i, N-1) {
        int a, b; cin >> a >> b;
        --a; --b;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
}

int dfs(int from, int now) {
    int res = 1;
    for(auto to: adj[now]) if (to!=from) { par[to] = now; res += dfs(now, to); }
    return child[now] = res;
}

void solve() {
    dfs(-1, 0);
    ll ans = 0;
    rep(now, N) {
        ll num = modpow(2, N-1) + 1;
        ll ue = N-1;
        for(auto to: adj[now]) if (par[to] == now) ue -= child[to];
        //cout << ue << endl;
        for(auto to: adj[now]) {
            if (par[to] == now) num += modpow(2, child[to]) + mod - 1;
            else num += modpow(2, ue) + mod - 1;
            chmod(num);
            
        }
        num = modpow(2, N) - num;
        chmod(num);
        num *= modpow(modpow(2, N), mod-2);
        chmod(num);
        ans += num;
        chmod(ans);
    }

    // ans *= modpow(modpow(2, N), mod-2);
    // chmod(ans);

    cout << ans << endl;
}


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

    input();
    solve();

    return 0;
}


Measured memory_bytes: 21632
#include<iostream>
#include<string>
#include<cstring>
using namespace std;
int hantei(char a[],int start,int end)
{
	int i;
	int count;
	for(i=0;i<end-start+1;i++)
	{
		if(a[start+i-1] != a[end-i-1]) {count = 0; break;}
		if(i == end-start){count = 1;}
	}
	return count;
}
int main()
{
	char a[100];
	cin >> a;
	int count;
	int N = strlen(a);
    count = hantei(a,1,N) +
    hantei(a,1,(N-1)/2)+
    hantei(a,(N+3)/2,N);
	if(count == 3) cout << "Yes";
	else cout << "No";
	return 0;
}
		

Measured memory_bytes: 256
#include <stdio.h>

int main(){
  char op;
  int a,b,ans=0;  

  while(1){
    scanf("%d %c %d", &a, &op, &b);
    if(op == '?')
      break;
    if(op == '+') ans = a + b;
    if(op == '-') ans = a - b;
    if(op == '/') ans = a / b;
    if(op == '*') ans = a * b;
  
    printf("%d\n", ans);
  }
  
  return 0;
}

Measured memory_bytes: 600
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] NList = new long[N+1];
		NList[0] = 2;
		NList[1] = 1;
		for (int i=2 ; i <=  N; i++) {
			NList[i] = NList[i-2] + NList[i-1];
		}
		System.out.println(NList[N]);

	}
}


Measured memory_bytes: 23764
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
	int R; cin >> R;
	if (R < 1200) cout << "ABC" << endl;
	else if (R < 2800) cout << "ARC" << endl;
	else cout << "AGC" << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
  public static void main(String...args) {
	final Scanner sc = new Scanner(System.in);
    final int N = sc.nextInt();
    int A = sc.nextInt();
    int B = sc.nextInt();
    while(true) {
		if(A < B - 1)
          A++;
      	else
          A--;
      	if(A == 0) {
          System.out.println("Borys");
          break;
        }
		if(A + 1 < B)
          B--;
      	else
          B++;
      	if(B == N + 1) {
          System.out.println("Alice");
          break;
        }
    }
  }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
using ll = long long;
using P = pair<int, int>;
/* ------------------------------------------------ */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ------------------------------------------------ */

int main() {
    int n;
    cin >> n;
    cout << n*n << endl;
    return 0;
}

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for(int i = 0; i < n; i++) {
    a[i]--;
  }
  vector<int> idx(n);
  for(int i = 0; i < n; i++) {
    idx[a[i]] = i;
  }
  set<int> s;
  ll ans = 0;
  for (int x = n-1; x >= 0; --x) {
    int i = idx[x];
    ll c = 0;
    { // calc c
      s.insert(i);
      vector<int> l(2,-1);
      vector<int> r(2,n);
      { // calc l
        auto it = s.find(i);
        for(int j = 0; j < 2; j++) {
          if (it == s.begin()) break;
          --it;
          l[j] = *it;
        }
      }
      { // calc r
        auto it = s.find(i);
        for(int j = 0; j < 2; j++) {
          ++it;
          if (it == s.end()) break;
          r[j] = *it;
        }
      }
      vector<int> ls(2);
      ls[0] = i-l[0]; ls[1] = l[0]-l[1];
      vector<int> rs(2);
      rs[0] = r[0]-i; rs[1] = r[1]-r[0];
      c = (ll)ls[0]*rs[1] + (ll)ls[1]*rs[0];
    }
    ans += c*(x+1);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 5760
#include <iostream>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <stdio.h> 
#include <map>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <sstream>
#include <vector>
#include <algorithm>
using namespace std;


int main() {
	int n,d;
	cin>>n>>d;
	
	vector<int> v[11];
	for (int i=0; i<n; i++) {
		for (int j=0; j<d; j++) {
			int t;
			cin>>t;
			v[i].push_back(t);
		}
	}
	int cnt = 0;
	for (int i=0; i<n; i++) {
		for (int k=0; k<n; k++) {
			if(i!=k && i < k) { 
				vector<int> v1 = v[i];
				vector<int> v2 = v[k];
				double sum = 0;
				for (int l = 0; l<v1.size(); l++) {
					sum+=(v1[l]-v2[l]) * (v1[l]-v2[l]);
				}
				sum = sqrt(sum);
				
				ostringstream strs;
				strs << sum;
      	string str = strs.str();
      	if(str.find('.')==-1) {
      		cnt++;
      	}
			}
		}
	}
	cout << cnt;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e15;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
typedef pair<ll,ll> P;
typedef pair<double,double> point;
const ll MAX = 200005;
constexpr ll nx[8] = {1,0,-1,0,1,-1,1,-1};
constexpr ll ny[8] = {0,1,0,-1,1,1,-1,-1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vector<ll> a(n);
    cins(all(a));
    ll k = 0;
    rep(i,n) k = k xor a[i];
    vector<ll> ans;
    rep(i,n){
        ans.push_back(k xor a[i]);
    }
    array_output(all(ans));
}


Measured memory_bytes: 12144
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
// typedef long  l;
typedef pair<int,int> P;
const ll INF=100000000000000001;
const double PI=3.141592653589;

int dp[30005][3];

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

  return 0;
}


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

using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;

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

template<typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }

template<typename T> vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type
fill_v(T &t, const V &v) { t=v; }
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t, const V &v ) { for(auto &e:t) fill_v(e,v); }

template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a) {
    out<<'('<<a.first<<','<<a.second<<')'; return out;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
    out<<'[';
    for(const T &i: a) out<<i<<',';
    out<<']';
    return out;
}
template<class T>
ostream &operator <<(ostream& out, const set<T>& a) {
    out<<'{';
    for(const T &i: a) out<<i<<',';
    out<<'}';
    return out;
}
template<class T, class S>
ostream &operator <<(ostream& out, const map<T,S>& a) {
    out<<'{';
    for(auto &i: a) out<<i<<',';
    out<<'}';
    return out;
}

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; // DRUL
const int INF = 1<<30;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;

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

    ll n, l;
    cin >> n >> l;

    ll sum = 0;
    REP(i, n) sum += l+i;

    ll ret, mi = LLINF;
    REP(i, n) {
        ll num = 0;
        REP(j, n) {
            if(i == j) continue;
            num += l+j;
        }
        // cout << i << " " << num << endl;
        if(abs(sum-num) < mi) {
            mi = abs(sum-num);
            ret = num;
        }
    }

    cout << ret << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
using lint = long;
using llint = long long;
using namespace std;

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

    int cnt = 0;
    for (int i = 0; i <= a; i++) {
        for (int j = 0; j <= b; j++) {
            for (int k = 0; k <= c; k++) {
                int total = 500 * i + 100 * j + 50 * k;
                if (total == x)
                    cnt++;
            }
        }
    }

    cout << cnt << endl;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
static auto faster_iostream = []() { ios::sync_with_stdio(0); cin.tie(0); return 0; }();
typedef long long ll; typedef long double db;
const int N = 1e5 + 5, M = 1e9 + 7;

int main() {
  map<string, int> mp;
  int n; cin >> n;
  string s;
  int mx = 0;
  for (int i = 0; i < n; i++) {
    cin >> s;
    mp[s]++;
    mx = max(mp[s], mx);
  }
  vector<string> a;
  for (auto& it : mp) {
    if (it.second == mx) a.push_back(it.first);
  }
  sort(a.begin(), a.end());
  for (auto &s : a) {
    cout << s << '\n';
  }
}


Measured memory_bytes: 25584
/*
AOJ - ITP1_8_b
Date: 20181004
Author: Mikoron * ♡mikoiwate♡
 */

#define MAX 1000

#include<stdio.h>
#include<stdlib.h>

int main(void) {
        //short i;
        char ch[MAX];
        int i, sum;

        while(1) {
                scanf("%s", ch);
                if(ch[0] == '0') break;
                else {
                        i = 0;
                        sum = 0;
                        while(ch[i] != '\0') {
                                sum += (ch[i] - '0');
                                i++;
                        }
                        printf("%d\n", sum);
                }
        }

        return 0;
}



Measured memory_bytes: 2060
/*input
5
2 1 5 4 3
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
int n,x,t, ans=0;
const int N=2e5+5;
int a[N];
int mx=0;

signed main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin>>n;
	for(int i=0; i<n; ++i){
		cin>>a[i];
		ans += max(0LL, mx-a[i]);
		mx = max(mx, a[i]);
	}
	cout<<ans;
	return 0;	
}

Measured memory_bytes: 5168
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
#define swap(a, b, type) { type _tmp = a; a = b; b = _tmp; }
typedef long long ll;
typedef unsigned long long ull;

int main()
{
	int N, X, S = 0;

	cin >> N;
	X = N;

	while (X > 0) {
		S += X % 10;
		X /= 10;
	}

	if (N % S == 0) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}


Measured memory_bytes: 256
N = int(input())
ans = ''
for i in range(1, 99):
    if N <= 26 ** i:
        N -= 1
        for j in range(i):
            ans += chr(ord('a') + N % 26)
            N //= 26
        break
    else:
        N -= 26 ** i
print(ans[::-1])


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

int main() {
	string S;
	cin >> S;

	if (S == "A") cout << "T";
	else if (S == "T") cout << "A";
	else if (S == "C") cout << "G";
	else cout << "C";

	return 0;
}

Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <math.h> // sqrt
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <iomanip> // setprecision
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vb = vector<bool>;
using vll = vector<long long>;
using pii = pair<int, int>;
using psi = pair<string, int>;

int main() {
    int N;
    cin >> N;
    vi data(N);
    for (int i = 0; i < N; i++) {
        cin >> data[i];
    }
    ll k = 0;
    ll money = 1000;
    if (data[0] <= data[1]) {
        k = floor(money / data[0]);
        money -= k * data[0];
    }
    for (int i = 1; i < N - 1; i++) {
        if (max({data[i], data[i - 1], data[i + 1]}) == data[i]) {
            money += k * data[i];
            k = 0;
        }
        else if (min({data[i], data[i - 1], data[i + 1]}) == data[i]) {
            ll a = floor(money / data[i]);
            k += a;
            money -= a * data[i];
        }
    }
    money += k * data[N - 1];
    cout << money << endl;
}

Measured memory_bytes: 3628
#include <stdio.h>

int main(){
	int n,i,a[100];
	
	scanf("%d", &n);
	for(i = 0; i < n; i++){
		scanf("%d", &a[i]);
	}
	
	for(i = n - 1; i >= 0; i--){
		if(i != n - 1){
			printf(" ");
		}
		printf("%d", a[i]);
	}
	printf("\n");
	
	return 0;
}

Measured memory_bytes: 600
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
typedef int64_t int64;
typedef uint32_t uint;
typedef uint64_t uint64;
using namespace std;

//---

template <typename T>
inline void print(const T& rhs){ std::cout<<" = "<<rhs<<std::endl; }
template <typename T>
inline void print(const std::vector<T>& rhs){
    std::cout<<" = [ ";
    for(uint i=0; i<rhs.size(); ++i){ std::cout<<rhs[i]<<' '; }
    std::cout<<"]"<<std::endl;
}
template <typename T>
inline void print(const std::vector<std::vector<T>>& rhs){
    std::cout<<" = "<<std::endl;
    std::cout<<"[[ ";
    for(uint p=0; p<rhs.size(); ++p){
        if(p!=0){ std::cout<<" [ "; }
        for(uint q=0; q<rhs[p].size(); ++q){
            std::cout<<rhs[p][q]<<' ';
        }
        if(p!=rhs.size()-1){ std::cout<<"]"<<std::endl; }
    }
    std::cout<<"]]"<<std::endl;
}
template <typename TL, typename TR>
inline void print(const std::vector<std::pair<TR,TL>>& rhs){
    std::cout<<" = [";
    uint i=0;
    for(; i<rhs.size()-1; ++i){ std::cout<<"[f: "<<rhs[i].first<<", s: "<<rhs[i].second<<"], "; }
    std::cout<<"[f: "<<rhs[i].first<<", s: "<<rhs[i].second<<"]]" << endl;
}
#define printn(var) {printf("%s", #var);print(var);}
#define printn_all(var) {printf("%s(%d): ", __func__, __LINE__);printf("%s", #var);print(var);}

//---

int64 sum(const vector<int>& v){
    int64 s=v[0];
    for(uint i=1; i<v.size(); ++i){ s+=v[i]; }
    return s;
}
int min(const vector<int>& v){
    int m=v[0];
    for(uint i=1; i<v.size(); ++i){ m=min(m, v[i]); }
    return m;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int N, X; cin >> N >> X;
    vector<int> vM(N); for(int i=0; i<N; ++i){ cin >> vM[i]; }
    
    int64 s = sum(vM);
    int64 m = min(vM);
    
    cout << N + (X-s)/m << endl;
    
    return 0;
}

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

#define pout(n)  printf ("%d\n", n)

#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());

const int d4x[4] = {1, 0, -1, 0};
const int d4y[4] = {0, 1, 0, -1};
const int d8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const int d8y[8] = { 0,1,1,1,0,-1,-1,-1 };

#define MAX_N (int)2e5+20
#define INF 1e12+20

typedef long long ll;
using namespace std;

int n;
int main() {
	cin >> n;
	int a[n];
	rep(i,0,n){
		cin >> a[i];
	}
	sort(a,a+n);

	int ans = a[n-1]-a[0];
	pout(ans);	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n); for(int i = 0;i < (int)(n);i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
int main(){
    int x;
    cin >> x;
    int ans = 10;
    ans -= x/200;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3668
import java.math.BigDecimal
import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val r =scanner.nextDouble()
    val area = BigDecimal(Math.PI * r * r)
    val coc = BigDecimal(2 * Math.PI * r)
    println("${area.toPlainString()} ${coc.toPlainString()}")
}



Measured memory_bytes: 27212
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

const long long int MAX_N = 100000;

int main(int argc, char const *argv[]) {
  long long int n;
  cin >> n;
  vector<long long int> a;
  for (size_t i = 0; i < n; i++) {
    long long int temp;
    cin >> temp;
    a.push_back(temp);
  }

  sort(a.begin(), a.end());

  long long int ans = 0;

  for (size_t i = 0; i < n;) {
    vector<long long int>::iterator lb = lower_bound(a.begin(), a.end(), a[i]), ub = upper_bound(a.begin(), a.end(), a[i]);
    if (((ub-a.begin())-(lb-a.begin()))%2 == 1) ans++;
    i = ub-a.begin();
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1400
#define ENABLE_DEBUG 1
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
#define REP(i, n) for (int i = 0; (i64)(i) < (i64)(n); ++i)

#if ENABLE_DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define DEBUG(...)                     \
  do {                                 \
    cerr << " (L" << __LINE__ << ") "; \
    cerr << #__VA_ARGS__ << ": ";      \
    debug(__VA_ARGS__);                \
    cerr << endl;                      \
  } while (0)
#else
#define debug(...)
#define DEBUG(...)
#endif

const i64 INF = 1LL << 60;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  i64 N;
  cin >> N;
  vector<i64> A(3 * N);
  for (auto& x : A) cin >> x;
  i64 lsum = 0, rsum = 0;
  priority_queue<i64> lq, rq;
  REP(i, N) {
    lsum += A[i];
    lq.push(-A[i]);
    rsum += A[3 * N - 1 - i];
    rq.push(A[3 * N - 1 - i]);
  }
  vector<i64> lcum(N + 1), rcum(N + 1);
  rcum[N] = rsum;
  REP(i, N) {
    i64 r2 = A[2 * N - 1 - i];
    rq.push(r2);
    i64 r = rq.top();
    rq.pop();
    rcum[N - 1 - i] = rcum[N - i] - r + r2;
  }
  lcum[0] = lsum;
  REP(i, N) {
    i64 l2 = A[N + i];
    lq.push(-l2);
    i64 l = -lq.top();
    lq.pop();
    lcum[i + 1] = lcum[i] - l + l2;
  }
  i64 ans = -INF;
  for (int i = 0; i <= N; ++i) {
    ans = max(ans, lcum[i] - rcum[i]);
  }
  cout << ans << '\n';
}


Measured memory_bytes: 8768
#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
    char input[7];
    scanf("%s",input);

    if(input[2]==input[3] && input[4]==input[5]){
        cout << "Yes" << endl;
    }else{
        cout << "No" <<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <numeric>
using namespace std;
typedef long long ll;

int main(){
    int a,b;cin>>a>>b;
    cout<<max(max(a+b,a-b),a*b);
}

Measured memory_bytes: 256