akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define __STDC_FORMAT_MACROS
#define p64 PRId64

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR (i, 0, n)
#define ALL(f, x, ...)                                                         \
    ([&] (decltype ((x)) ALL) {                                                \
        return (f) (begin (ALL), end (ALL), ##__VA_ARGS__);                    \
    }) (x)

using namespace std;
using ll = int64_t;

template<class T> void gc (T& x) {
    char c;
    int s = 0;
    x = 0;
    c = getchar_unlocked();
    if (c == '-')
        s = 1;
    else if ('0' <= c && c <= '9')
        x = c - '0';
    while (true) {
        c = getchar_unlocked();

        if (c < '0' || '9' < c)
            break;
        x = x * 10 + (c - '0');
    }
    if (s)
        x = -x;
}

int main() {
    int H, N;
    gc (H);
    gc (N);
    int A, accum;
    accum = 0;
    REP (i, N) {
        gc (A);
        accum += A;
    }
    cout << (H <= accum ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 256
attrs = Array.new
while line = $stdin.gets
  attrs << line.chomp.split
end

N = attrs[0][0].to_i
M = attrs[0][1].to_i
X = attrs[0][2].to_i
c = Array.new(N, 0)
a = []
N.times do |n|
  tmp = attrs[n+1].map &:to_i
  c[n] = tmp[0]
  a.push(tmp.slice(1..(M)))
end

is_clear = false
min_price = 10**7
N.times do |n|
  [*1..N].combination(n+1).to_a.each_with_index do |z, index|
    points = Array.new(M, 0)
    price = 0
    flag = false
    z.each do |p|
      price += c[p-1]
      M.times do |m|
        points[m] += a[p-1][m]
        flag = (points.select {|a| a >= X}).length == points.length
        break if flag
      end
    end
    if flag then
      is_clear = true
      min_price = price if price < min_price
    end
  end
end
puts is_clear ? min_price : -1

Measured memory_bytes: 14908
#include <iostream>
#include <string>
#include <stdlib.h>
#include <cstdlib>
using namespace std;


int main(){
	int N;	// 1 - 200,000
	int prev;	// 1 - 1,000,000,000
	long long total = 0;
	
	cin >> N;
	cin >> prev;
	
	for(int i=0; i<N-1; i++){
		int height;
		cin >> height;
		if(prev > height){
			total += (prev - height);
		} else {
			prev = height;
		}
	}
	
	cout << total << endl;
	return 0;
}


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

int mod = 1000000007;

int main()
{
    string W;
    cin >> W;
    vector<int> list(26);
    for (int i = 0; i < W.size(); i++)
        list[W[i] - 'a']++;

    bool x = true;

    for (int i = 0; i < 26; i++)
    {
        if(list[i]%2==1)
            x = false;
    }
    cout << (x ? "Yes" : "No");
}

Measured memory_bytes: 256
#include<cstdio>
const int N=404,P=998244353;
int f[N][N],A[N],B[N],fac[N],ifac[N];
int read(){int x;scanf("%d",&x);return x;}
int inc(int a,int b){return a+=b-P,a+(a>>31&P);}
int dec(int a,int b){return a-=b,a+(a>>31&P);}
int mul(int a,int b){return 1ll*a*b%P;}
int pow(int a,int k){int r=1;for(;k;k>>=1,a=mul(a,a))if(k&1)r=mul(a,r);return r;}
int main()
{
    int n=read(),ans=0,s=0;
    f[0][0]=P-1,fac[0]=1;
    for(int i=1;i<=n;++i) s+=A[i]=read(),B[i]=read();
    for(int i=1;i<=400;++i) fac[i]=mul(fac[i-1],i);
    ifac[400]=pow(fac[400],P-2);
    for(int i=400;i;--i) ifac[i-1]=mul(ifac[i],i);
    for(int i=1;i<=n;++i)
	for(int j=s;~j;--j)
	    for(int k=400;~k;--k)
		if(f[j][k])
		    for(int l=0,r=1;l<B[i];++l,r=mul(r,A[i]))
			f[j+A[i]][k+l]=dec(f[j+A[i]][k+l],mul(mul(r,ifac[l]),f[j][k]));
    for(int i=1;i<=s;++i)
        for(int r=pow(i,P-2),t=i==s? 1:mul(s,pow(i,P-2)),j=0,k=1;j<=400;++j,k=mul(k,r))
            ans=inc(ans,mul(mul(mul(f[i][j],fac[j]),k),t));
    printf("%d",ans);
}


Measured memory_bytes: 896
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;

namespace ABC120B_K_thCommonDivisor
{
    class Program
    {
        static void Main(string[] args)
        {
#if Local
            var sw = new Stopwatch();
            sw.Start();
            Console.SetIn(new StreamReader("input.in"));
#endif

            var solver = new Solver();
            solver.Solve();
#if Local
            Console.WriteLine($"{sw.ElapsedMilliseconds}ms");
#endif
        }
    }

    class Solver
    {
        public void Solve()
        {
            var input = Console.ReadLine().Split(' ').Select(elem => int.Parse(elem)).ToArray();
            var listA = GetYakusu(input[0]);
            var listB = GetYakusu(input[1]);
            var listKoyaku = GetCommon(listA, listB);

            var answer = listKoyaku[listKoyaku.Count - input[2]];
            Console.WriteLine(answer);
        }

        public List<int> GetCommon(List<int> listA, List<int> listB)
        {
            List<int> ret = new List<int>();
            foreach(var a in listA)
            {
                foreach(var b in listB)
                {
                    if (a == b)
                    {
                        ret.Add(a);
                    }
                }
            }

            return ret;
        }

        public List<int> GetYakusu(int num)
        {
            List<int> ret = new List<int>();
            for (int i = 1; i <= num; i++)
            {
                if ( num % i == 0)
                {
                    ret.Add(i);
                }
            }

            return ret;
        }
    }
}


Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define INF 999999999
#define rep(i,m,n) for(int i = m;i < n;i++)
#define pb(n) push_back(n)
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(20) << S << endl;
#define Vecpr vector<pair<lli,lli>>
#define mod 1000000007;
int main() {
  lli A,B,C=0,D=0,E=0,F=0,G=0,H=0,N,M;
  cin >> A >> B;
  vector<lli>P(A,0);
  string S;
  cin >> S;
  rep(i,1,A){
    P[i]=P[i-1];
    if(S[i-1]=='A'&&S[i]=='C')P[i]++;
  }
  rep(i,0,B){
    cin >> C >> D;
    Out(P[D-1]-P[C-1]);
  }
}

Measured memory_bytes: 1792
#include<stdio.h>
int main(){
  int n,m,i,j,k,ny,nx,w,h,d,y,x;
  int Y[]={-1,0,1,0};
  int X[]={0,1,0,-1};
  char c,s[4]={"^>v<"};
  scanf("%d",&n);
  while(n--){
   char m[22][22]={0};
   d=4;
   scanf("%d %d",&h,&w);
    for(i=1;i<=h;i++){
      for(j=1;j<=w;j++){
	scanf(" %c",&m[i][j]);
	if(d==4){
	  for(d=0;d<4;d++){
	    if(m[i][j]==s[d])break;
	  }
	  if(d-4)m[y=i][x=j]='.';
	}//printf("%d ",d);
      }
    }
    scanf("%d",&k);
    while(k--){
      scanf(" %c",&c);//printf("%d\n",d);
      if(c=='U')d=0;
      if(c=='R')d=1;
      if(c=='D')d=2;
      if(c=='L')d=3;
      if(c=='S'){
	for(i=1;1;i++){
	  nx=x+X[d]*i;
	  ny=y+Y[d]*i;
	  if(m[ny][nx]=='#'||m[ny][nx]==0)break;
	  if(m[ny][nx]=='*'){
	    m[ny][nx]='.';
	    break;
	  }
	}//printf("i%d\n",i);
      }
      else{
	nx=x+X[d];
	ny=y+Y[d];
	if(m[ny][nx]=='.'){
	  y=ny;
	  x=nx;
	}
      }
    }
    for(i=1;i<=h;i++){
      for(j=1;j<=w;j++){
	if(i==y&&j==x)printf("%c",s[d]);
	else printf("%c",m[i][j]);
      }
      printf("\n");
    }
    if(n)printf("\n");
  }
  return 0;
}
       
	  
	  
    
    
    

Measured memory_bytes: 568
#pragma GCC optimze("Ofast")
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#ifndef rd
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double f80;
#define double long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
const ll infl=0x3f3f3f3f3f3f3f3fLL;
const int infi=0x3f3f3f3f;
//const int mod=998244353;
const int mod=1000000007;
typedef vector<int> vi;
typedef vector<ll> vl;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> oset;
auto clk=clock();
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}
int powm(int a, int b) {
	int res=1;
	while(b) {
		if(b&1)
			res=(res*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return res;
}

void solve() {
	int x;
	cin>>x;
	cout<<360/gcd(360LL,x)<<endl;
}

signed main() {
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	srand(chrono::high_resolution_clock::now().time_since_epoch().count());
	cout<<fixed<<setprecision(8);
	int t=1;
//	cin>>t;
	fr(i,1,t)
		solve();
#ifdef rd
	cout<<endl<<endl<<endl<<endl<<"Time elapsed: "<<(double)(clock()-clk)/CLOCKS_PER_SEC<<endl;
#endif
	return 0;
}


Measured memory_bytes: 3612
#include <stdio.h>
int main(void){
    char n[5];
    scanf("%s",&n);
    if(n[0]==n[1]&&n[1]==n[2]){
        printf("Yes\n");
    }else if(n[1]==n[2]&&n[2]==n[3]){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <random>
#include <iomanip>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<pair<ll,ll> > vpll;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
typedef map<int,int> mii;
typedef set<int> si;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define arep(i,v) for(auto i : v)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STLL(s) strtoll(s.c_str(), NULL, 10)
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int
// #define endl '\n';
#define fi first
#define se second
#define NONVOID [[nodiscard]]
constexpr int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
template <class T> inline void dump(T &v){irep(i, v){cout<<*i<<((i==--v.end())?'\n':' ');}}
inline string getline(){string s; getline(cin,s); return s;}
inline void yn(const bool b){b?fin("yes"):fin("no");}
inline void Yn(const bool b){b?fin("Yes"):fin("No");}
inline void YN(const bool b){b?fin("YES"):fin("NO");}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
constexpr ll LLINF = 1LL<<60;
constexpr ll MOD = 1000000007;
constexpr double EPS = 1e-9;



int main(){
    string S=getline();
    vs s;
    rep(i,S.size()){
        int j=i;
        string res="";
        while(j<S.size()&&S[j]!=' '){
            res+=S[j];
            j++;
        }
        s.pb(res);
        i=j;
    }
    // dump(s);
    stack<int> st;
    int a,b;
    for(int i=0;i<s.size();i+=1){
        if(s[i][0]<='9'&&s[i][0]>='0'){
            st.push(STLL(s[i]));
        } else {
            a=st.top();
            st.pop();
            b=st.top();
            st.pop();
            // cout<<a<<" "<<b<<endl;
            if(s[i]=="+"){
                st.push(a+b);
            } else if(s[i]=="-"){
                st.push(b-a);
            } else {
                st.push(a*b);
            }
        }
    }
    fin(st.top());
}


Measured memory_bytes: 3200
#include <iostream>
using namespace std;
#include <bits/stdc++.h>
#include<cmath>
int operation(int x, int y, int z)
{
    int val = (x*x)+(y*y)+(z*z)+(x*y)+(y*z)+(x*z);
    return val;
}
int main()
{
    int n;
    cin >>n;
    int counter=0;
    for(int i =1; i<=n; i++)
    {
        for(int x=1; x<100; x++)
        {
            for(int y=1; y<100; y++)
            {
                for(int z=1; z<100; z++)
                {
                    if(i == operation(x,y,z))
                    {
                        counter++;
                    }
                    else if(i < operation(x,y,z))
                        break;

                }
            }
        }

        cout<<counter<<endl;
        counter=0;
    }

    return 0;
}

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

int main() {
    int n, m;
    cin >> n >> m;
    int tmp_a, tmp_b;
    int a[m], b[m], count[n];
    fill(count, count+n, 0);

    for (int i = 0; i < m; i++) {
        cin >> tmp_a >> tmp_b;
        a[i] = tmp_a-1;
        count[tmp_a-1]++;
        b[i] = tmp_b-1;
        count[tmp_b-1]++;
    }

    int ans = 0;
    for (int i = 0; i < n; i++) {
        int tmp = i;
        while (count[tmp] == 1) {
            for (int j = 0; j < m; j++) {
                if (a[j] == tmp) {
                    count[a[j]]--;
                    count[b[j]]--;
                    tmp = b[j];
                    a[j] = -1;
                    b[j] = -1;
                    ans++;
                    break;
                } else if (b[j] == tmp) {
                    count[a[j]]--;
                    count[b[j]]--;
                    tmp = a[j];
                    a[j] = -1;
                    b[j] = -1;
                    ans++;
                    break;
                }
            }
        }
    }

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
   cin.tie(0);
   ios::sync_with_stdio(false);
   long long n;
   cin >> n;
   long long p[n];
   for(int i = 0;i < n;i++) {
       cin >> p[i];
   }
   long long ans = 0;
   long long m = p[0];
   for(int i = 0;i < n;i++) {
       int flag = 0;
       m = min(m, p[i]);
       if(p[i]<=m) {
           ans++;
       }
   }
   cout << ans << endl;
}

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

typedef long long ll;

#define INF 10e17 // 4倍しても(4回足しても)long longを溢れない
#define rep(i,n) for(int i=0; i<n; i++)
#define rep_r(i,n,m) for(int i=m; i<n; i++)
#define END cout << endl
#define MOD 1000000007
#define pb push_back
#define sorti(x) sort(x.begin(), x.end())
#define sortd(x) sort(x.begin(), x.end(), std::greater<int>())
#define debug(x) std::cerr << (x) << std::endl;
#define roll(x) for (auto itr : x) { debug(itr); }

template <class T> inline void chmax(T &ans, T t) { if (t > ans) ans = t;}
template <class T> inline void chmin(T &ans, T t) { if (t < ans) ans = t;}

int main() {
  string s;
  cin >> s;
  int n = s.size();
  int l = 0, r = n - 1, ans = 0;
  while (l < r) {
    if (s[l] == s[r]) {
      l += 1, r -= 1;
    } else if (s[l] != 'x' and s[r] == 'x') {
      r -= 1;
      ans += 1;
    } else if (s[l] == 'x' and s[r] != 'x')  {
      l += 1;
      ans += 1;
    } else {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 512
#include "bits/stdc++.h"
#define rep(i,b) for(ll i=0;i<b;i++)
#define ll long long
using namespace std;
/*--Input//////////////////////////////////////////////////*/
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){cin >> first;IN(rest...);return;}
#define SS(T, ...)      T __VA_ARGS__; IN(__VA_ARGS__);
#define SV(type,c,n) vector<type> c(n);for(auto& i:c)cin >> i;
/*--Output/////////////////////////////////////////////////*/
inline int p(void){cout << endl; return 0;}
template<class Head> int p(Head&& head){cout << head;p();return 0;} template<class Head,class... Tail> int p(Head&& head,Tail&&... tail){cout<<head<<" ";p(forward<Tail>(tail)...);return 0;}
struct ProconInit {
    static constexpr bool AUTOFLUSH = false;
    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvvl vector<vector<vector<ll>>>
#define debug(x) cerr<<#x<<" "<<x<<'\n';
#define all(x) (x).begin(),(x).end()
#define bit(n) (1LL<<(n))
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; }
bool cmp(pair<ll,ll> a, pair<ll,ll> b) { return a.first+a.second > b.first+b.second; }

bool done[114514];
int dist[114514];
bool flag=true;
void dfs(int now, vector<vector<pair<int,int>>> &edge) {
	rep(i,edge[now].size()) {
		int next = edge[now][i].first;
		int len = edge[now][i].second;
		if(done[next]) {
			if(dist[next] != dist[now] + len)flag=false;
		} else {
			done[next] = true;
			dist[next] = dist[now] + len;
			dfs(next, edge);
		}
	}
}
 
int main() {
	SS(int,N,M);
	vector<vector<pair<int,int>>> edge(N+1);
	rep(i,M) {
		SS(int,l,r,d);
        l--;r--;
		edge[l].push_back({r, d});
		edge[r].push_back({l, -d});
	}
	rep(i,N) {
		if(!done[i]) {
			done[i] = true;
			dfs(i, edge);
		}
	}
	Yes(flag);
}

Measured memory_bytes: 12160
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define INF 1e18

int main() {
    fast;
    int n, v = 100000;
    ll w;
    cin>>n>>w;
    vector<ll> weight(n);
    vector<int> value(n);
    for (int i = 0; i < n; ++i) {
        cin>>weight[i]>>value[i];
    }
    vector<vector<ll>> dp(n+1, vector<ll>(v+1));
    for (int i = 0; i <= n; ++i) {
        for (int j = 0; j <= v; ++j) {
            if(i == 0 || j == 0)
                dp[i][j] = INF;
            else{
                ll leave = INF, take = INF;
                if(dp[i-1][j] != INF)
                    leave = dp[i-1][j];
                if(value[i-1] <= j) {
                    if(dp[i-1][j-value[i-1]] != INF)
                        take = weight[i-1] + dp[i-1][j-value[i-1]];
                    else if(value[i-1] == j)
                        take = weight[i-1];
                }
                dp[i][j] = min(leave, take);
            }
        }
    }
    ll max = 0;
    for (int i = 0; i < dp[n].size(); ++i) {
        if(dp[n][i] <= w)
            max = i;
    }
    cout<<max;
}

Measured memory_bytes: 80256
#include <bits/stdc++.h>
using namespace std;
#define endl '\n';

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  double L,x,y,z;
  cin >> L;
  x = L / 3.0;
  y = L / 3.0;
  z = L / 3.0;
  cout << fixed << setprecision(12) << x*y*z;
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		if (Math.max(A, B) <= 8) {
			System.out.println("Yay!");
		} else {
			System.out.println(":(");
		}
	}
	
}

Measured memory_bytes: 21844
/*
本宝的程序外人别想看！！

name: [夏宝宝]
run time：[] ms
compilation time: [] ms
output memory: [] MiB
where: []
state: []
*/
#include<bits/stdc++.h>
using namespace std;

long long int c[2000005];

int main()
{
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	long long int n, m;
	
	cin>>n>>m;
	
	c[0]=0;
	
	long long int a[m+1], b[m+1];
	
	for(int i=1; i<=2000005; i++)
	{
		c[i]=0x3fffffffffffffff;
	}
	
	for(int i=1; i<=m; i++)
	{
		cin>>a[i]>>b[i];
	}
	
	for(int i=1; i<=m; i++)
	{
		for(int j=a[i]; j<=20000; j++)
		{
			c[j]=min(c[j-a[i]]+b[i], c[j]);
		}
	}
	
	long long int minv=0x3ffffffffffffff;
	
	for(int i=n; i<=20000; i++)
	{
		if(c[i]<minv)
		{
			minv=c[i];
		}
	}
	
	cout<<minv<<endl;
	
	return 0;
}

Measured memory_bytes: 15872
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt(), m = in.nextInt();
            int[] x = new int[n];
            int[] y = new int[n];
            int[] checkX = new int[m];
            int[] checkY = new int[m];
            for (int i = 0; i < n; ++i) {
                x[i] = in.nextInt();
                y[i] = in.nextInt();
            }
            for (int i = 0; i < m; ++i) {
                checkX[i] = in.nextInt();
                checkY[i] = in.nextInt();
            }
            for (int i = 0; i < n; ++i) {
                long min = Integer.MAX_VALUE;
                int cur = 50;
                for (int k = 0; k < m; ++k) {
                    int dist = Math.abs(x[i] - checkX[k]) + Math.abs(y[i] - checkY[k]);
                    if (dist < min) cur = k;
                    if (dist == min) cur = Math.min(cur, k);
                    min = Math.min(min, dist);
                }
                out.println(cur + 1);
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



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

int main()
{
	string s,t;
	cin>>s>>t;
	ll ans = t.size(),temp=0;
	for(ll i=0;i<s.size() - t.size() + 1;++i)
	{
		temp=0;
		for(ll j=0;j<t.size();++j)
		{
			if(s[i+j] != t[j])	temp++;
		}
		if(temp<ans)	ans = temp;
	}

	cout<<ans<<endl;
}	

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  
  if (a+b > c+d){
    cout << "Left" << endl;
  }
  else if (a+b < c+d) {
    cout << "Right" << endl;
  }
  
  else {cout << "Balanced" << endl;
       }
}

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ALL(a) begin(a),end(a)
#define COUNTOF(a) (sizeof(a)/sizeof(a[0]))
#define SP << " " <<
#define FMT(a) #a<<":"<<a 
#define FMT2(a,b) #a<<":"<<a<<", "<<#b<<":"<<b 
#define FMT3(a,b,c) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c 
#define FMT4(a,b,c,d) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c<<", "<<#d<<":"<<d 
typedef long long ll;
template<class T> istream& operator >> (istream& s, vector<T>& v) {
  for (T& x: v) s >> x;
  return s;
}
inline void Yes(bool f=true){cout<<(f?"Yes":"No")<<endl;}
inline void YES(bool f=true){cout<<(f?"YES":"NO")<<endl;}
#define ANS(a) cout<<a<<endl

int digit_sum(int n) {
    int s = 0;
    while (n != 0) s+=n%10,n/=10;
    return s;
}

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

    int N; cin >>N;
    Yes(N%digit_sum(N)==0);
}


Measured memory_bytes: 256
d=int(input())
c=list(map(int,input().split()))
from collections import defaultdict
las=defaultdict(int)
ss=[list(map(int,input().split())) for i in range(d)]

for i in range(d):
    kai=-float("INF")
    ind=0
    for j in range(26):
        if kai<(g:=ss[i][j]-c[j]*(j+1-las[j])):
            kai=g;ind=j
    las[ind]=i+1
    print(ind+1)


Measured memory_bytes: 9812
#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
#define pb(a) push_back(a)
#define pr(a) cout<<(a)<<endl
#define PR(a,b) cout<<(a)<<" "<<(b)<<endl
#define F first
#define S second
#define ll long long
bool check(int n,int m,int x,int y){return (x<0||x>=n||y<0||y>=m)?false:true;}
const ll MAX=1000000007,MAXL=1LL<<60,dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
typedef pair<int,int> P;

int main() {
  int n;
  cin >> n;
  bool ck=true;
  int d=0;
  rep(i,n) {
    char c;
    int x;
    cin >> c >> x;
    if(c=='(') d+=x;
    else d-=x;
    if(d<0) ck=false;
  }
  if(ck && d==0) pr("YES");
  else pr("NO");
  return 0;
}


Measured memory_bytes: 1156
import java.util.HashSet;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			long n = sc.nextLong();
			HashSet<Long> set = new HashSet<Long>();

			for (int i = 0; i < n; i++) {
				long tmp = sc.nextLong();
				if (set.contains(tmp)) {
					set.remove(tmp);
				} else {
					set.add(tmp);
				}
			}

			System.out.println(set.size());
		}
	}
}


Measured memory_bytes: 65648
import java.util.*;
import java.io.*;

public class Main {
	private static void solve(){
		//Implement solution here.
		int n = ni();
		int[] a = na(n);
		int[] result = new int[n];
		for(int i = 0; i < n; i++) {
			result[a[i] - 1] = i + 1;
		}
		for(int ai : result) {
			System.out.print(ai + " ");
		}
	}

	//Switch input source (stdin/file)
	private static BufferedReader br  = new BufferedReader(new InputStreamReader(System.in));
	public static void main(String[] args){
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		} 
		solve();
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}

Measured memory_bytes: 45912
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
//#include <atcoder/all>
#define rep(i,n) for (int i = 0; i < (n); ++i)
typedef int64_t lint;
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using lb = long double;
//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SI(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
#define debug(x) cerr << #x << ": " << x << "\n"//手動デバッグ
#define debugV(x) for(int i=0;i<((ll)(x).size());i++)cerr << #x <<"at:"<<i<< ": " << x[i] << "\n"//手動デバッグ 
#define YES(c) cout<<((c)?"YES\n":"NO\n"),0
#define Yes(c) cout<<((c)?"Yes\n":"No\n"),0
#define O(p) cout<<p<<"\n",0
#define OS(p) cout<<p<<" ",0
#define ON(p) cout<<p,0
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define inf 2147483647 //int値の最大値
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
#define endl "\n"//endlを置き換える
//略記
#define PB emplace_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define CST(x) cout<<fixed<<setprecision(x)//小数点以下の桁数指定

const int dy[4]={1,0,-1,0};
const int dx[4]={0,1,0,-1};//^>v<

template<class T=int> T in(){
    T x;
    cin>>x;
    return (x);
}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int gcd(int a, int b) {
    if (b==0) return a;
    else return gcd(b, a%b);
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int two(int n){
	ll ans=1;
	rep(i,n){
		ans*=2;
	}
	return ans;
}
//------------------------------------------------------------





//------------------------------------------------------------
int main() {
	ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
//------------------------------------------------------------
    int n=in();
    if(n==1){
        O(0);
        return 0;
    }
    ll all=1;
    ll not_1=1;
    ll not_2=1;
    rep(i,n){
        all*=10;
        not_1*=9;
        not_2*=8;
        all%=MOD;
        not_1%=MOD;
        not_2%=MOD;
    }
    ll ans=all-2*not_1+not_2;
    if(ans<0){
        O(ans%MOD+MOD);
    }else{
        O(ans%MOD);
    }
    
    //O((-MOD-1)%MOD);
    
    
    
    
//------------------------------------------------------------
	return 0;
}


Measured memory_bytes: 3648
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 30;
const int MOD = 1e9 + 7;

const int N = 1e4 + 10;
bitset<N> dp;
int main() {
  int n;
  scanf("%d", &n);
  dp = 1;
  while (n--) {
    int x;
    scanf("%d", &x);
    dp = dp | dp << x;
  }
  int ret = 0;
  for (int i = 1; i < N; ++i) {
    if (dp[i] && i % 10) {
      ret = max(ret, i);
    }
  }
  printf("%d\n", ret);
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int h[100001]={},ans[100001]={};
  for(int i=2;i<100001;i++){
    int f=1;
    for(int j=2;j*j<=i;j++){
      if(i%j==0){
	f=0;
	break;
      }
    }
    h[i]=f;
  }
  int a=0;
  for(int i=2;i<100001;i++){
    if(h[i]==1&&h[(i+1)/2]==1){
      a++;
    }
    ans[i]=a;
  }

  //for(int i=1;i<10;i++)cout<<h[i]<<endl;
  
  int q,l,r;
  cin>>q;
  for(int i=0;i<q;i++){
    cin>>l>>r;
    cout<<ans[r]-ans[l-1]<<endl;
  }
  return 0;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#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 ll long long
#define lld long double
#define ALL(x) x.begin(), x.end()
using namespace std;

int main()
{
    int n, x, y;
    cin >> n >> x >> y;
    x--;
    y--;
    int len = y - x + 1;

    vector<vector<int>> dist(n, vector<int>(n, 0));
    rep(i, n) rep(j, n)
    {
        dist[i][j] = abs(i - j);
    }
    dist[y][x] = 1;
    dist[x][y] = 1;

    rep(i, n)
    {
        rep(j, n)
        {
            dist[i][j] = min({dist[i][j],
                              dist[i][x] + dist[x][j]});
        }
    }

    rep(i, n)
    {
        rep(j, n)
        {
            dist[i][j] = min({dist[i][j],
                              dist[i][y] + dist[y][j]});
        }
    }
    map<int, int> ans;
    rep(i, n) rep(j, i + 1, n)
    {
        ans[dist[i][j]]++;
    }
    rep(i, 1, n)
    {
        cout << ans[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 16000
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 整数の入力
		int n = sc.nextInt();
		int k = sc.nextInt();
        int amari = n % k;
        int avg = (n - amari) / k;
          
		// 出力
		System.out.println(amari == 0 ? 0 : 1);
	}
}


Measured memory_bytes: 23764
#include <iostream>

using namespace std;

int n;

int main(){
  cin >> n;
  int list[100000] = {0};
  for (int i=0; i<n; i++){
    int x;
    cin >> x;
    list[x]++;
  }
  int so_far = -1;
  for (int i=1; i<100000-1; i++){
    int sum = (list[i-1] + list[i] + list[i+1]);
    if (sum > so_far){
      so_far = sum;
    }
  }
  cout << so_far;
  return 0;
}

Measured memory_bytes: 1272
from collections import deque

k = int(input())

q = deque([])

for i in range(1, 10):
    q.append(i)

for i in range(k-1):
    a = q.popleft()
    if a % 10 != 0:
        q.append(10 * a + (a % 10) - 1)
    q.append(10 * a + (a % 10))
    if a % 10 != 9:
        q.append(10 * a + (a % 10) + 1)

print(q.popleft())


Measured memory_bytes: 40944
#include <cstdio>
#include <cmath>
#include <stack>
#include <algorithm>
using namespace std;

int main() {
    int n;
    int arr[] = {512, 256, 128, 64, 32, 16, 8, 4, 2, 1};
    while(scanf("%d", &n) != EOF) {
        stack<int> s;
        for (int i = 0; i < 10; i++) {
            if (arr[i] <= n) { n-= arr[i]; s.push(arr[i]); }
        }
        int idx = 0;
        while (!s.empty()) {
            if (idx) printf(" ");
            printf("%d", s.top()); s.pop();
            idx++;
        }
        printf("\n");
    }

    return 0;
}



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

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

template<class T> bool umin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool umax(T &a, T b) { return a < b ? (a = b, true) : false; }

using namespace std;

int main(int argc, char** argv) 
{
#ifdef HOME
	if(IsDebuggerPresent())
	{
		freopen("../in.txt", "rb", stdin);
		freopen("../out.txt", "wb", stdout);
	}
#endif
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.precision(10);
	cout << fixed;
	int N, K;
	cin >> N >> K;
	vector<bool> w(K + 1);
	vector<int> a(N);
	for (auto& ai : a)
		cin >> ai;
	forn(i, K)
	{
		if(w[i])
			continue;
		for (auto ai : a)
		{
			if(ai + i > K)
				break;
			w[ai + i] = true;
		}
	}
	cout << (w[K] ? "First" : "Second") << endl;
	return 0;
}


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

int main(){
    int N, L;
    cin >> N >> L;
    int sum = 0;
    int mindiff = 500000;
    int d;
    for (int i = 0; i < N; i++) {
        sum += L + i;
        int diff = abs(L + i);
        if (diff < mindiff){
            mindiff = diff;
            d = L + i;
        }
    }
    cout << sum - d << endl;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
typedef long long ll;
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 invrepr(i,a,b) for(int i=b-1;i>=a;i--)
#define invrep(i,n) invrepr(i,0,n)
#define repitr(itr,a) for(auto itr=a.begin();itr!=a.end();++itr)
#define P pair<int,int>
const int MOD=1e9+7;
const int INF=2e9;
const double PI=acos(-1);



ll gcd(ll a,ll b) {
    if (a<b) swap(a,b);
    while (b>0) {
        ll tmp=b;
        b=a%b;
        a=tmp;
    }
    return a;
}


int main() {
    ios_base::sync_with_stdio(false);

    ll a,b,c,d;
    cin >> a >> b >> c >> d;
    ll g=gcd(c,d);
    ll l=c/g*d;
    ll ans=b-a+1-(b/c-(a-1)/c+b/d-(a-1)/d-(b/l-(a-1)/l));
    cout << ans << endl;
   
    return 0;  
}

Measured memory_bytes: 3648
n = int(input())
s = [int(_) for _ in input().split()]
q = int(input())
t = [int(_) for _ in input().split()]


def Binary_Search(A, key):
    A_left = 0
    A_right = n
    while A_left < A_right:
        mid = (A_right+A_left) // 2
        if A[mid] < key:
            A_left = mid+1
        elif key < A[mid]:
            A_right = mid
        else:
            return mid
    return "Not_Found"


sol_coun = 0
for i in t:
    if Binary_Search(s, i) != "Not_Found":
        sol_coun += 1
    else:
        continue
print(sol_coun)



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

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl





using ll = long long;

const ll mod = 1e9+7;
const int maxn = 1e6 + 5;





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

    string s;
    cin>>s;
    int res = 0;
    int cur = 0;
    for (char c: s) {
	if (c=='R') {
	    cur += (c=='R');
	    res = max(res, cur);
	} else {
	    cur = 0;
	}
    }
    cout<<res<<endl;    
    return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 10000000000
int main()
{
        ll n,m,k;
        cin>>n>>m>>k;
        ll x=n/m;
        ll p=n%m;
        if(p==0)
        cout<<k*x<<"\n";
        else
        cout<<k*(x+1)<<"\n";
        

    return 0;
}


Measured memory_bytes: 3632
import sys
N, K = map(int, input().split())
A = list(map(int, input().split()))
c = 0

while(True):
    p = 0
    T = [0]*N
    for i in range(N):
        T[max(i-A[i], 0)] += 1
        if i+A[i]+1 > N - 1:
            pass
        else:
            T[i+A[i]+1] -= 1
    for i in range(1,N):
        T[i] += T[i-1]
    c += 1
    if c == K:
        for i in range(N):
            print(T[i], end=" ")
        sys.exit()
    for i in range(N):
        if T[i] < N:
            p = 1
            break
    if p == 0:
        for i in range(N):
            print(N, end= " ")
        sys.exit()
    A = T[:]

Measured memory_bytes: 169724
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repk(i, k, n) for (int i = k; i < n; i++)
#define MOD 1000000007
#define INF 1e9
#define PIE 3.14159265358979323

template <class T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
T GCD(T a, T b) {
    if (b == 0)
        return a;
    else
        return GCD(b, a % b);
}
template <class T>
inline T LCM(T a, T b) {
    return (a * b) / GCD(a, b);
}

using namespace std;
//#inculude <bits/stdc++.h>
//#define int long long

signed main() {
    int d, n;
    cin >> d >> n;
    if (d == 0) {
        if (n == 100)
            cout << 101 << endl;
        else
            cout << n << endl;
    }
    else if (d == 1) {
        if (n == 100)
            cout << 10100 << endl;
        else
            cout << n * 100 << endl;
    }
	else {
        if (n == 100)
            cout << 1010000 << endl;
        else
            cout << n * 10000 << endl;
    }
}


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



int32_t main(){
    int n;cin>>n;
    string ans;
    while(n){
        n--;
        int x=n%26;
        ans.push_back('a'+x);
        n/=26;
    }
    reverse(ans.begin(),ans.end());
    cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int N,P,Y,W,G;
  P = 0;
  Y = 0;
  W = 0;
  G = 0;
  string color;
  cin >> N;
  
  for ( int i=N ; i>=1 ; i--)
  {
    cin >> color;
    
    if (color == "P")
      P = 1;
    if (color == "Y")
      Y = 1;
    if (color == "W")
      W = 1;
    if (color == "G")
      G = 1;
    
    if (P+Y+W+G == 4)
      break;
  }
  
     if (P+Y+W+G == 4)
       cout << "Four" << endl;
  
     if (P+Y+W+G == 3)
       cout << "Three" << endl;
  
  return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var src1 = GetLineStr();
            var src2 = GetLineStr();
            var ary1 =src1.ToArray();
            var ary2= src2.ToArray();
            int cnt = 0;
            for (int i=0; i<ary1.Count(); i++)
            {
                if (ary1[i] != ary2[i])
                {
                    cnt++;
                }
            }
            Console.WriteLine(cnt);
        }

        static string GetLineStr()
        {
            var line = System.Console.ReadLine();
            return line;
        }
    }
}


Measured memory_bytes: 29300
local mmi, mma = math.min, math.max
local mab = math.abs
local mfl, mce = math.floor, math.ceil
local bls, brs = bit.lshift, bit.rshift
local bxor = bit.bxor

local n = io.read("*n")
local x, y, p = {}, {}, {}
local flag = {}
for i = 1, n do
  x[i], y[i], p[i] = io.read("*n", "*n", "*n")
end

local tot = 1
for i = 1, n do
  tot = tot * 3
end
local tot2 = bls(1, n)
local xlen, ylen = {}, {}
for i = 1, n do
  xlen[i] = {}
  ylen[i] = {}
  for j = 0, tot2 - 1 do
    local candx, candy = mab(x[i]), mab(y[i])
    local tj = j
    for k = 1, n do
      if tj % 2 == 1 then
        candx = mmi(candx, mab(x[i] - x[k]))
        candy = mmi(candy, mab(y[i] - y[k]))
      end
      tj = brs(tj, 1)
    end
    xlen[i][j + 1] = candx * p[i]
    ylen[i][j + 1] = candy * p[i]
  end
end
local box = {}
local rettbl = {}
for i = 1, n do
  rettbl[i] = 10000 * 1000000 * 15 + 1
end
rettbl[n + 1] = 0

local tmpx, tmpy = {}, {}
local tmpe = {}
for i = 0, 59048 do -- 3^10 = 59049
  local ti = i
  local mul = 1
  local tbl = {}
  local xv, yv = 0, 0
  for j = 1, 10 do
    local z = ti % 3
    if z == 0 then
      table.insert(tbl, j)
    elseif z == 1 then
      xv = xv + mul
    elseif z == 2 then
      yv = yv + mul
    end
    mul = mul * 2
    ti = mfl(ti / 3)
  end
  tmpx[i + 1] = xv
  tmpy[i + 1] = yv
  tmpe[i + 1] = tbl
end

for i = 0, tot - 1 do
  local ti = i
  local ecnt = 0
  local mul = 1
  local xv, yv = 0, 0
  local ofst = 0
  local rep = mfl(n / 10)
  for irep = 1, rep do
    local tti = ti % 59049
    xv = xv + mul * tmpx[tti + 1]
    yv = yv + mul * tmpy[tti + 1]
    for k = 1, #tmpe[tti + 1] do
      local z = ofst + tmpe[tti + 1][k]
      if z <= n then
        ecnt = ecnt + 1
        box[ecnt] = z
      end
    end
    ofst = ofst + 10
    ti = mfl(ti / 59049)
    mul = mul * 1024
  end
  local rem = n % 10
  for j = n + 1 - rem, n do
    local z = ti % 3
    if z == 0 then
      ecnt = ecnt + 1
      box[ecnt] = j
    elseif z == 1 then
      xv = xv + mul
    else
      yv = yv + mul
    end
    mul = mul * 2
    ti = mfl(ti / 3)
  end
  if 0 < ecnt then
    local ret = 0
    for j = 1, ecnt do
      local src = box[j]
      ret = ret + mmi(xlen[src][xv + 1], ylen[src][yv + 1])
    end
    rettbl[n - ecnt + 1] = mmi(rettbl[n - ecnt + 1], ret)
  end
end

print(table.concat(rettbl, "\n"))
-- print(os.clock())


Measured memory_bytes: 17112
#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mod 1000000007
#define test ll t; t=1; while(t--)
typedef long long int ll;
int main() {
    FIO;
    test{
        ll r;
        cin>>r;
        long double ans,pi;
        pi=3.1415926535897932;
        ans=2*pi;
        ans*=double(r);
        cout<<fixed<<setprecision(6)<<ans<<endl;
    }
	return 0;
}


Measured memory_bytes: 3796
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

int main()
{
	int n,sum=0,a;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a;
		sum+=a;
	}
	cout<<sum-n<<endl;
	return 0;
}

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

//const lol mod=1e9+7;

/*  author: H3XoRuSH  */

int main() {
    ios_base::sync_with_stdio(false);
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    lol n,a;
    lol ans=0;
    cin >> n;
    while(n--){
        cin >> a;
        while(a%2==0){
            ans++;
            a/=2;
        }
    }
    cout << ans;
    return 0;
}


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

using namespace std;

int main(void){
    int n, m;
    cin >> n >> m;
    cout << (n-1) * (m-1) << endl;
    return 0;
}


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

int main() {
  string S;
  cin >> S;
  int n = S.length();
  long long res = 0;
  for(int i = 0; i<(1<<(n-1)); i++) {
    long long tmp = 0;
    for(int j = 0; j<n; j++) {
      tmp = tmp * 10 + (S[j] - '0');
      if(i & (1<<j)) {
        res += tmp;
        tmp = 0;
      }
    }
    res += tmp;
  }
  cout << res << endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var d = Console.ReadLine().Split(' ').Select(int.Parse).ToList();

            var ret = 0;
            for (int i = 0; i < n; i++)
            {
                for (int j = i + 1; j < n; j++)
                {
                    ret += d[i] * d[j];
                }
            }

            Console.WriteLine(ret);
        }
    }
}


Measured memory_bytes: 13268