akhauriyash/Code-Regression huggingface dataset:
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cfloat>
#include<climits>
#include<cmath>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;

using lint = long long;
using P = pair<int, int>;
using LLP = pair<long long, long long>;

#define REP(i, x, n) for(int i = (x), i##_len = (int)(n) ; i < i##_len ; ++i)
#define rep(i, n) for(int i = 0, i##_len = (int)(n) ; i < i##_len ; ++i)
#define reps(i, n) for(int i = 1, i##_len = (int)(n) ; i <= i##_len ; ++i)
#define rrep(i, n) for(int i = (int)(n) - 1 ; i >= 0 ; --i)
#define rreps(i, n) for(int i = (int)(n) ; i > 0 ; --i)
#define SORT(x) sort((x).begin(), (x).end())
#define SORT_INV(x) sort((x).rbegin(), (x).rend())
#define REVERSE(x) reverse((x).begin(), (x).end())
#define TWINS(x) cout << ((x) ? "Yay!" : ":(") << '\n'
#define endl '\n'

constexpr int IINF = (1 << 30) - 1;
constexpr long long LLINF = 1LL << 61;
constexpr double EPS = 1e-10;

constexpr int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
constexpr int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};

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

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

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

    int n;
    cin >> n;

    vector<string> s(n);
    vector<int> t(n);
    int sum = 0;
    rep(i, n){
        cin >> s[i] >> t[i];
        sum += t[i];
    }

    string x;
    cin >> x;

    int ans = 0;
    rep(i, n){
        ans += t[i];
        if(s[i] == x){
            break;
        }
    }

    ans = sum - ans;

    cout << ans << endl;

    cout << flush;

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cctype>
#include <algorithm>
#define ll long long
#define il inline
#define rgi register int

using namespace std;

il int read()
{
	rgi x = 0, f = 0, ch;
	while(!isdigit(ch = getchar())) f |= ch == '-';
	while(isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

int main()
{
	int k = read(), x = read();
	for(rgi i = x - k + 1; i <= x + k - 1; ++i)
		printf("%d ", i);
	return 0;
}


Measured memory_bytes: 128
/*
___ is a raging sadist.
*/

//Destroy all WA at test 2

#include <bits/stdc++.h>
#define fastio()                  \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0)
#define pb push_back
#define show(x) cout << (#x) << " : " << x << endl;
#define ll long long
#define ld long double
#define pow power
#define mp make_pair
#define ff first
#define ss second
#define pii pair<ll, ll>
#define sq(x) ((x) * (x))
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define siz(a) int((a).size())
#define For(i,a,b) for(int (i)=(a);(i) < (b); ++(i))
#define endl "\n"
#define PI 3.14159265
const ll MOD = 1000 * 1000 * 1000 + 7;
const ll MOD1 = 998244353;
const ll INF     = 1ll*1000*1000*1000*1000*1000*1000 + 7; 
using namespace std;

ll power(ll x, ll y) 
{ 
   ll res = 1;      
  
   
    while (y > 0) 
    { 
       
        if (y & 1) 
            res = (long long)(res*x); 
  

        y = y>>1; 

        if (x<=100000000)
        x = (long long)(x*x);

        //cout<<x<<'\n'; 
    } 
    return res; 
} 






int main()
{

#ifndef ONLINE_JUDGE    
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif

fastio();

    ll T;
    cin>>T;

     map <string,ll> s;

    while(T--)
    {

       

        string x;
        cin>>x;

        s[x]++;

        


    }

    cout<<"AC"<<' '<<'x'<<' '<<s["AC"]<<endl; 
        cout<<" WA"<<' '<<'x'<<' '<<s["WA"]<<endl; 
        cout<<"TLE"<<' '<<'x'<<' '<<s["TLE"]<<endl; 
        cout<<"RE"<<' '<<'x'<<' '<<s["RE"]<<endl; 

return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
#define endl              "\n"
#define pb              push_back
#define fir               first
#define sec               second
#define all(v)            ((v).begin()), ((v).end())
#define sz(v)            ((int)((v).size()))
#define ll              long long
#define ld              long double
#define lp(i, n)        for(int i = 0 ; (int)i<n ; i++)
#define loop(i, x, n)       for(int i=x ; (int)i<=n ; i++)
#define isPowerOfTwo(s) (!(s & (s-1)))
typedef vector<int> vi;
typedef deque<int> de;
void origi() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
}
int dig(int n) {
    int re = 0;
    while (n > 0)
        n /= 10, re++;
    return re;
}
void tiranga() {
    int a, b;
    cin >> a >> b;
    int sock = 1 , res=0;
    while (sock < b) {
        sock--;
        sock += a;
        res++;
    }
    cout << res;
}
int main() {
#ifndef ONLINE_JUDGE.
    //freopen("input.txt", "r", stdin);
#else
#endif
    
    origi();
    tiranga();
    //cout << sumOfDig(123654);
   // genLarge(10, 10);
   // genSmall(10);

}


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

long long int gcd(const long long int a, const long long int b) {
	switch (a % b) {
	case 0: return b;
	default: return gcd(b, a % b);
	}
}
long long int lcd(const long long int a, const long long int b) {
	return a * b / gcd(a, b);
}
class Mobile {
	long long int _left_length{ 0 }, _right_length{ 0 };
	Mobile *_left_mobile{ nullptr }, *_right_mobile{ nullptr };
	long long int _whole_weight{ 0 };
	bool is_balanced() {
		return _whole_weight != 0;
	}
	void balance() {
		if (is_balanced()) return;
		long long int l;
		if (_left_mobile == nullptr && _right_mobile == nullptr) {
			l = lcd(_left_length, _right_length);
		}
		else if (_left_mobile == nullptr) {
			_right_mobile->balance();
			l = lcd(_left_length, _right_length * _right_mobile->_whole_weight);
		}
		else if (_right_mobile == nullptr) {
			_left_mobile->balance();
			l = lcd(_right_length, _left_length * _left_mobile->_whole_weight);
		}
		else {
			_left_mobile->balance();
			_right_mobile->balance();
			l = lcd(_right_mobile->_whole_weight * _right_length, _left_mobile->_whole_weight * _left_length);
		}
		_whole_weight = l / _left_length + l / _right_length;
	}
public:
	Mobile() {}
	void set_infomation(long long int left, long long int right, Mobile *left_mobile, Mobile *right_mobile) {
		_left_length = left / gcd(left, right);
		_right_length = right / gcd(left, right);
		_left_mobile = left_mobile;
		_right_mobile = right_mobile;
	}
	long long int whole_weight() {
		if (!is_balanced()) balance();
		return _whole_weight;
	}
};
void solve() {
	int n;
	std::cin >> n;
	while (n != 0) {
		std::vector<Mobile> mobiles(n);
		{
			int p, q, r, b;
			for (auto &mobile : mobiles) {
				std::cin >> p >> q >> r >> b;
				mobile.set_infomation(p, q, (r == 0) ? nullptr : &mobiles[r - 1], (b == 0) ? nullptr : &mobiles[b - 1]);
			}
			long long int max{ 0 };
			for (auto &mobile : mobiles) if (max < mobile.whole_weight()) max = mobile.whole_weight();
			std::cout << max << std::endl;
		}
		std::cin >> n;
	}
}
int main() {
	solve();
}


Measured memory_bytes: 3088
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
  long long A,B;
  cin>>A>>B;
  vector<long long> v;
   vector<long long> ans;
 long long n=__gcd(A,B); 
 
   
    for (long long i=1; i<=sqrt(n); i++) 
    { 
        if (n%i == 0) 
        { 
            
            if (n/i == i) 
            {
                v.push_back(i);
            }
  
            else{
                v.push_back(i);
                v.push_back(n/i);
            } 
                
        } 
    } 
long long gcd;
long long cou=1;

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


ans.push_back(v[0]);
for(long long i=1;i<v.size();i++)
{
    ans.push_back(v[i]);
    int f=0;
    for(long long j=0;j<ans.size();j++ )
    {
        for(long long k=0;k<ans.size();k++)
        {
            if(j!=k)
            {
            gcd = __gcd(ans[k],ans[j]);
            if(gcd != 1)
            {
                f=1;
                break;
            }
            }
        }
    }
    if(f==1)
    {
        ans.pop_back();
    }
}
 cout<<ans.size()<<endl;

}

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

int main()
{
  int a, b;
  while(cin >> a >> b, a|b){
    int cnt = 0;

    if(a < b) swap(a, b);

    while(b){
      a = a%b;
      swap(a, b);
      cnt++;
    }

    cout << a << " " << cnt << endl;

  }

  return 0;

}



Measured memory_bytes: 2960
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>

using namespace std;

#define INF 1 << 29
#define LL long long int

LL const MOD = 1000000007;

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

    LL n;
    cin >> n;

    string str = "";
    if(n == 0){
        str += "0";
    }

    LL x = 2;
    bool minus = false;
    while(n != 0){
        if(n%x == 0){
            str += "0";
            minus ^= true;
        }else{
            str += "1";
            if(minus){
                n += x >> 1;
            }else{
                n -= x >> 1;
            }
            minus ^= true;
        }
        x <<= 1;
    }

    reverse(str.begin(),str.end());

    cout << str << endl;
    
    return 0;
}

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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

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

	string s; cin >> s;

	for (int i = 0;i < s.size();i += 2){
		cout << s[i];
	}

	cout << endl;

	return 0;

}


Measured memory_bytes: 592
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s,t;
    cin>>s>>t;
    ll ans=INT_MAX;
    for(int i=0;i<=s.length()-t.length();i++){
        string temp=s.substr(i,t.length());
        ll cans=0;
        for(ll j=0;j<t.length();j++){
            if(t[j]!=temp[j])cans++;
        }
        ans=min(ans,cans);
    }
    cout<<ans<<endl;
    return 0;
}



Measured memory_bytes: 3660
// D.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include<string>
#include<vector>

using namespace std;
int main()
{
    int n;

    cin >> n;

    string s;
    cin >> s;

    int left = 0;
    int right = n - 1;
    int cnt = 0;
    while (1) {

        if (left >= right)break;
        if (s[left] != 'W') {
            left++;
        }
        if (s[right] != 'R') {
            right--;
        }

        if (s[left] == 'W' && s[right] == 'R') {
            cnt++;
            left++;
            right--;
       }
        
    }
    cout << cnt << endl;
    return 0;
}


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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

typedef long long ll;
typedef long double R;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

int main() {
  string a, b; cin >> a >> b;
  int itr = 0;
  if(a.length() < b.length()) cout << "LESS" << endl;
  else if (a.length() > b.length()) cout << "GREATER" << endl;
  else {
    for(itr = 0; itr < a.length(); itr++) {
      if(a[itr] < b[itr]) {
        cout << "LESS" << endl;
        return 0;
      }
      else if(a[itr] > b[itr]){
         cout << "GREATER" << endl;
         return 0;
      }
    }
    cout << "EQUAL" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main()
{
	int a,b,c,i;
	scanf("%d %d %d",&a,&b,&c);

	for (i=1;i<=10000;i++) {
		if (a*i % b == c) {
			printf("YES\n");
			return 0;
		}
	}
	printf("NO\n");
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define left 2*i+1
#define righ 2*i+2
#define mid (l+r)/2

using namespace std;

ll n,a[200005],st[800115],dp[200005];
pair<ll,ll>h[200005];

ll qry(ll i,ll l,ll r,ll ql,ll qr){
    if(ql>qr)return 0;
    if(r<ql||l>qr)return 0;
    if(l>=ql&&r<=qr)return st[i];
    return max(qry(left,l,mid,ql,qr),qry(righ,mid+1,r,ql,qr));
}

void update(ll i,ll l,ll r,ll id){
    if(r<id||l>id)return;
    if(l==r){st[i]=dp[id];return;}
    if(id>mid)update(righ,mid+1,r,id);
    else update(left,l,mid,id);
    st[i]=max(st[left],st[righ]);
}
int main(){
    cin>>n;
    for(ll i=0;i<n;i++){
        cin>>h[i].first;
        h[i].second=i;
    }
    for(ll i=0;i<n;i++){
        cin>>a[i];
    }

    sort(h,h+n);
    for(ll i=0;i<n;i++){
        ll id=h[i].second;
        dp[id]=a[id]+qry(0,0,n-1,0,id-1);
        update(0,0,n-1,id);
    }

    cout<<qry(0,0,n-1,0,n-1);
    return 0;
}


Measured memory_bytes: 12800
import sys
from itertools import accumulate

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def prime_numbers(n):
    if n < 2:
        return []

    m = (n + 1) // 2
    p = [1] * m
    for i in range(1, int((n ** 0.5 - 1) / 2) + 1):
        if p[i]:
            p[2 * i * (i + 1) :: 2 * i + 1] = [0] * (((m - 1) - 2 * i * (i + 1)) // (2 * i + 1) + 1)

    return {2} | {2 * i + 1 for i in range(1, m) if p[i]}


def main():
    primes = prime_numbers(10 ** 5)
    A = [n % 2 and n in primes and (n + 1) // 2 in primes for n in range(10 ** 5 + 1)]
    A = tuple(accumulate(A))

    Q, *LR = map(int, read().split())
    ans = [0] * Q
    for i, (l, r) in enumerate(zip(LR[::2], LR[1::2])):
        ans[i] = A[r] - A[l - 1]

    print(*ans, sep='\n')
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 28996
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> pi;
#define f first
#define s second
#define FAST ios_base::sync_with_stdio(0); cin.tie(0);
//const int maxn = 200010;
const int INF = INT_MAX/2;

int a;

int32_t main() {
	cin >> a;
	cout << a + a*a + a*a*a;
	
}









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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



int a,b;
void solve(){
	cin >> a >> b;
	
	for(int i = 0; i <= 1000; i++){
		if(floor((double)i*0.08) == a && floor((double)i*0.1 )== b){
			cout << i << endl;
			return;
		}
	}
	cout << -1 << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}


Measured memory_bytes: 256
n = int(input())
a_list = []
b_list = []
c_list = []
for _ in range(n):
    a, b = map(int, input().split())
    c_list.append([a, b])
    a_list.append(a)
    b_list.append(b)
a_list.sort()
b_list.sort()
if n % 2 == 1:
    ans = b_list[n // 2] - a_list[n // 2] + 1
else:
    ans_first_max = b_list[(n // 2) - 1]
    ans_first_min = a_list[(n // 2) - 1]
    ans_second_max = b_list[(n // 2)]
    ans_second_min = a_list[(n // 2)]
    ans = (ans_second_max + ans_first_max) - ((ans_second_min + ans_first_min)) + 1
print(ans)

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

int N ;
vector<int> s;
int main(){
  int a,flag=0;//whether exist mod 10 not= 0
  int sum = 0;
  cin >> N;
  flag = 0;
  for(int i = 0;i < N ; i++){
    cin >> a;
    s.push_back(a);
    sum+=s[i];
    if((s[i]%10)!= 0) flag =1;
  }
  
  if(flag == 0) {
    cout << "0" << endl;
    return 0;
  }

  else if(sum %10 !=0){
    cout << sum << endl;
    return 0;
  }
  sort (s.begin(),s.end());
  for(int i = 0;i<N;i++){
    if((sum - s[i])%10!=0){
      cout << sum -s[i] << endl;
      break;
    }
  }
  
  return 0;
}


Measured memory_bytes: 256
N = int(input())
A = [int(x) for x in input().split()]

A = sorted(A, reverse=True)

score = 0
for i in range(N):
    if i == 0:
        score += 0
    elif i == 1:
        score += A[0]
    else:
        score += A[i//2]

print(score)


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


int main() {
 char C;
  cin >>C;
  string A = "abcdefghijklmnopqrstuvwxyz";
  for(int i=0;i<26;i++){
   if (C == A.at(i)){
    cout << A.at(i+1) << endl; 
   }
  }
}


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

using namespace std;

int main()
{
	int a, b, k;
	cin >> a >> b >> k;

	for (int i = 0; i < k; i++) {
		if (i % 2 == 0) {
			b += a / 2;
			a /= 2;
		}
		else {
			a += b / 2;
			b /= 2;
		}
	}
	cout << a << " " << b << endl;
	return 0;
}

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

#define int long long
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define allrev(x) (x).rbegin(), (x).end()
#define pb push_back
#define pf push_front
#define fori(i, a, n) for(int i = a; i < n; ++i)
#define MAX(x) (*max_element(all(x)))
#define MIN(x) (*min_element(all(x)))
#define sortarr(a,n) sort(a, a+n)
#define sortvec(V) sort(all(V))

typedef vector<int> V;
typedef pair<int , int> pairi;
typedef set<int> seti;
typedef deque<int> deqi;

const int MOD = 1e9+7;
const int INF = 1e9+8;
const double pi = 3.14159265359;

template <class T>
T fac(T n)      // template function to find factorial of a number
{ 
    T res = 1, i; 
    for (i = 2; i <= n; i++) 
        res *= i; 
    return res; 
}
template<class T>
T lcm(T a, T b)     //template function to find lcm of two numbers 
{
    return (a * b) / __gcd(a,b);
}
template<class T>
T digitsum(T x)
{
    T sum = 0;
    while(x)
    {
        sum += x%10;
        x /= 10;
    }
    return sum;
}
// ternary search
/*double ternary(double l, double r){
    double eps = 1e-9;
    while(r - l > eps){
        double m1 = l + (r - l)/3;
        double m2 = r - (r - l)/3;
        double f1 = f(m1);
        double f2 = f(m2);
        if(f1 < f2)
            l = m1;
        else r = m2;
    }
    return f(l);
}*/
void nPermute(string str, int n)  //function to find nth  lexi string
{ 
    sort(all(str));
    int i = 1; 
    do {
        if (i == n) 
            break; 
  
        i++; 
    } while (next_permutation(str.begin(), str.end())); 
    cout<<str<<endl;
} 
vector<int> factors(int n) 
{ 
    vector<int> f; 
    for(int x = 2; x * x <= n; x++) { 
        while (n % x == 0) { 
            f.push_back(x); 
            n /= x; 
        } 
    } 
    if (n > 1) f.push_back(n); 
    return f; 
}
bool prime(int n) 
{ 
    if (n < 2)
        return false;
    for(int x = 2; x*x <= n; x++) 
        if (n%x == 0) 
            return false; 
    return true; 
}
// binomial coeficient in O(K) 
int ncr(int n, int k){
    int res = 1;
    if(k > n - k)
        k = n - k;
    for(int i = 0; i < k; i++){
        res *= (n - i);
        res /= (i + 1);
    }
    return res;
}
tuple<int, int, int> Gcd(int a, int b)      //extended Euclids Algorithm
{
    if(b == 0)
        return {1, 0, a};
    else{
        int x, y, g;
        tie(x, y, g) = Gcd(b, a%b);
        return {y, x - (a/b)*y, g};
    }
}
template<class T>       // modular Exponentiation x^n mod m = x^(n mod (m - 1)) mod m : if n  is very large;
T binpow(T a, T b, T m) {
    a %= m;
    T res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}
void solve()
{
    int n;
    cin >> n;
    string ans;
    while(n){
        n -= 1;
        ans += char('a' + n % 26);
        n /= 26; 
    }
    reverse(all(ans));
    cout << ans << endl;
}
signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    solve();
    cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
}

Measured memory_bytes: 3844
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>

#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))
#define FOR(i,n) for (int i = 1; (i) <= (n); ++ (i))
#define dump(x)  cout << #x << " = " << (x) << endl;
#define pb push_back
#define int long long

const int INF = 1e18;
const int MOD = 1e9+7;
//const lint LINF = 1e18;
const double eps = 0.000000001;//もとの値の10^(-16)まで

using namespace std;

//typedef pair<int, int> P;
//priority_queue< P, vector<P>, greater<P> > q;//ダイクストラの時、greaterで小さい順
//cout << fixed << setprecision(10) << ans << endl;
//int gcd(int a,int b){return b?gcd(b,a%b):a;}

int kai[300000];
int kotae[300000];


signed main(){
    int n,x,m;
    cin >> n >> x >> m;
    int ans = 0;
    int now = x;
    int nokori = 0;
    for(int i=1;i<=n;i++){
        //cout << "i=" << i << " ans=" << ans << endl;
        ans += now;
        if(kai[now]==0){
            kai[now] = i;
            kotae[now] = ans;
        }
        else{
            int syuuki = i-kai[now];
            int nokosyuuki = (n-i) / syuuki;
            nokori = (n-i)% syuuki;
            int tt = (ans-kotae[now]);
            ans += tt * nokosyuuki;
            now *= now;
            now %= m;
            break;
        }
        now *= now;
        now %= m;
    }
    for(int i=1;i<=nokori;i++){
        ans += now;
        now *= now;
        now %= m;
    }
    cout << ans << endl;
    



    return 0;
}

Measured memory_bytes: 5148
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<climits>
#include<string>
#include<vector>
#include<map>
#include<queue>
#include<set>
#include<algorithm>

#define ll long long
#define dl double
#define mod 1000000007
#define sz 205

using namespace std;

int main()
{
    ll n,m,r,a,b,c,arr[10],matrix[sz][sz];

    scanf("%lld %lld %lld",&n,&m,&r);

    for(ll i=0; i<r; i++)
    {
        scanf("%lld",&arr[i]);
    }

    for(ll i=1; i<=n; i++)
    {
        for(ll j=1; j<=n; j++)
        {
            matrix[i][j]=INT_MAX;
            matrix[j][i]=INT_MAX;
        }
    }

    while(m--)
    {
        scanf("%lld %lld %lld",&a,&b,&c);

        matrix[a][b]=min(matrix[a][b], c);
        matrix[b][a]=min(matrix[b][a], c);
    }

    for(ll k=1; k<=n; k++)
    {
        for(ll i=1; i<=n; i++)
        {
            for(ll j=1; j<=n; j++)
            {
                if(matrix[i][k]+matrix[k][j]<matrix[i][j])
                    matrix[i][j]=matrix[i][k]+matrix[k][j];
            }
        }
    }

    sort(arr, arr+r);

    ll mn=INT_MAX;

    do
    {
        ll sum=0;

        for(ll i=0; i<r-1; i++)
        {
            sum+=matrix[arr[i]][arr[i+1]];
        }

        mn=min(mn, sum);
    }
    while(next_permutation(arr, arr+r));

    printf("%lld\n",mn);

    return (0);
}




Measured memory_bytes: 512
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int[] L = new int[2*N];
		for(int i = 0; i <= 2*N - 1; i++){
			L[i] = stdIn.nextInt();
		}
		for(int i = 0; i <= 2*N - 1; i++){
			for(int j = 2*N - 1; j > i; j--){
				if(L[j - 1] > L[j]){
					int num = L[j - 1];
					L[j - 1] = L[j];
					L[j] = num;
				}
			}
		}
		
		int ans = 0;
		String str = "";
		for(int i = 0; i <= 2*N - 1; i += 2){
			ans += L[i];
		}
		
		System.out.println(ans);
	}
}

Measured memory_bytes: 9940
/*In the name of Allah*/
#include <bits/stdc++.h>
using namespace std;
int sz(int x){
	int c = 0;
	while(x){
		x/=10;
		c++;
	}
	return c;
}

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int n;
	cin>>n;
	int ans= 0;
	for(int i = 1; i <= n ; i++){
		if(sz(i)&1)ans++;
	} 
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
let n = Scanf.scanf " %d" (+) 0
let hs = Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let p = ref hs.(n - 1)
let _ = for i = n - 1 downto 0 do p := hs.(i) - if hs.(i) > !p then if hs.(i) - !p >= 2 then (print_endline "No"; exit 0) else 1 else 0 done; print_endline "Yes"

Measured memory_bytes: 5248
#include<bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define M 1000000007
#define ll long long
#define db double
#define pb push_back
#define F first
#define S second
#define vl vector<ll>
#define vvl vector<vl>
#define pii pair<int,int>
#define mkp make_pair

const ll N=100005;
ll dp[N];

int main()
{
	memset(dp,M,sizeof(dp));
	ll n,w;
	cin >> n >> w;
	
	dp[0]=0;
	ll ans=0;
	for(ll i=0;i<n;i++)
	{
		ll ww,val;
		cin >> ww >> val;
		for(ll j=100000;j>=val;j--)
		{
			dp[j]=min(dp[j],dp[j-val]+ww);
			if(dp[j]<=w)
			{
				ans=max(ans,j);
			}
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 1024
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int A = sc.nextInt();
    int B = sc.nextInt();
    int sub = Math.abs(A - B);
    if (sub % 2 == 0) {
      System.out.println("Alice");
    } else {
      System.out.println("Borys");
    }
  }
}

Measured memory_bytes: 21716
<?php

$nums = array();
while (true) {
    
    list($a, $op, $b) = explode(" ", trim(fgets(STDIN)));
    
    if($op == "?"){
        break;
    }
    
    if ($op == "+") {
        array_push($nums, $a + $b);
    }else if($op == "-"){
        array_push($nums, $a - $b);
    }else if($op == "/"){
        array_push($nums, floor($a / $b));
    }else{
        array_push($nums, $a * $b);
    }
}
echo implode("\n", $nums), PHP_EOL;

Measured memory_bytes: 15328
#include <iostream>
#include <string.h>
using namespace std;

int main() {
    int ia, iz;
    bool flag;
    bool flag2 = false;
    char s[100000];
    char str[] = "abcdefghijklmnopqrstuvwxyz";
    //ia = ('a' - '0') % 48;
    //iz = ('z' - '0') % 48;
    cin >> s;

    //cout << ia << iz << endl;

    for (int i = 0; i < 26; i++ ){
        for (int j = 0; j < strlen(s); j++ ){
            if (str[i] == s[j]) {
                flag = true;
            }
        }
        if (!flag) {
            cout << str[i] << endl;
            flag2 = true;
            break;
        }
        else flag = false;

    }


    if (!flag2) cout << "None" <<endl;

    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
typedef long long int lli;
const lli sqrtlimit = 1e5;

vector<bool> prime(sqrtlimit, true);
void initPrimeTable(){
    prime[0] = prime[1] = false;
    for(int i=2; i*i<sqrtlimit; i++){
        if(prime[i]){
            for(int j=i*2; j<sqrtlimit; j+=i){
                prime[j] = false;
            }
        }
    }
}
vector<pair<lli, lli> > factoring(int n){
    vector<pair<lli, lli> > ret;
    for(int i=2; i<=sqrtlimit; i++){
        if(!prime[i]) continue;
        if(n%i == 0){
            ret.emplace_back(i, 1);
            n /= i;
            while(n%i == 0){
                ret.back().second++;
                n /= i;
            }
        }
    }
    if(n != 1) ret.emplace_back(n, 1);
    return ret;
}

lli modpow(lli a, lli b, lli m){
    lli ret = 1;
    for(int i=63; i>=0; i--){
        ret = ret*ret %m;
        if((b & 1LL<<i) != 0) ret = ret*a %m;
    }
    return ret;
}

lli gcd(lli a, lli b){
    if(b==0) return a;
    return gcd(b, a%b);
}

lli lcm(lli a, lli b){
    lli d = gcd(a, b);
    return a/d*b;
}

int main(){
    initPrimeTable();

    lli n;
    cin >> n;
    vector<pair<lli, lli> > factor = factoring(n);
    for(auto f: factor){
        if(f.second != 1){
            cout << -1 << endl;
            return 0;
        }
    }

    lli l = 1;
    for(auto f: factor){
        l = lcm(l, f.first -1);
    }
    if(gcd(l, n) != 1){
        cout << -1 << endl;
        return 0;
    }

    factor = factoring(l);
    lli phi = 1;
    for(auto f: factor){
        phi *= modpow(f.first, f.second -1, (int)1e18) *(f.first -1);
    }

    vector<lli> fphi;
    for(int i=1; i*i<=phi; i++){
        if(phi%i == 0){
            fphi.push_back(i);
            fphi.push_back(phi/i);
        }
    }

    sort(fphi.begin(), fphi.end());
    for(lli f: fphi){
        if(modpow(n, f, l) == 1%l){
            cout << f << endl;
            break;
        }
    }
    return 0;
}



Measured memory_bytes: 3160
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define nl "\n"
#define rep(i,n) for(ll i=0; i<(n); i++)
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define sortup(V) sort(V.begin(), V.end())
#define sortdown(V) sort(V.rbegin(), V.rend())
#define MOD 998244353 //1000000007


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

    // solution comes here

    ll N, K, A, i=0;
    cin >> N >> K;

    ll ans = (N-1)/(K-1) + ((N-1)%(K-1)!=0);
    cout << ans << nl;
}

Measured memory_bytes: 256
#include<stdio.h>

void GetGCM(int x,int y){
 int temp;
 int r;

 if(x < y){
  temp=x; x=y; y=temp;
 }

 r=x%y;
 if(r==0)printf("%d\n",y);
 else GetGCM(y,r);

return;
}

int main(){
 int x,y;

 scanf("%d %d",&x,&y);

 GetGCM(x,y);

return 0;
}


Measured memory_bytes: 2104
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int A, B;
  cin >> A >> B;
  string S(B, '0'+A); // Aの文字をB回繰り返す
  string T(A, '0'+B);
  cout << min(S, T) << '\n';
  return 0;
}

Measured memory_bytes: 3620
#include<iostream>
using namespace std;
int main() {
	int n, b,mark,num;
	char a,c;
	cin >> n;
	int x[4][13];
	for (mark = 0; mark < 4; mark++) {
		for (num = 0; num < 13; num++) {
			x[mark][num] = 0;
		}
	}
	for (int i = 0; i < n; i++) {
		cin >> a >> b;
		if (a == 'S') {
			mark = 0;
		}
		else if (a == 'H') {
			mark = 1;
		}
		else if (a == 'C') {
			mark = 2;
		}
		else if (a == 'D') {
			mark = 3;
		}
		num = b - 1;
		x[mark][num] = 1;
	}
	for (mark = 0; mark < 4; mark++) {
		for (num = 0; num < 13; num++) {
			if (mark == 0) {
				c = 'S';
			}
			else if (mark == 1) {
				c = 'H';
			}
			else if (mark == 2) {
				c = 'C';
			}
			else if (mark == 3) {
				c = 'D';
			}
			if (x[mark][num] == 0) {
				cout << c << " " << num + 1 << endl;
			}
		}
	}
}

Measured memory_bytes: 1160
import collections

N = int(input())

A = [0] * N
for i in range(N):
    A[i] = int(input())


A = sorted(A)

if N % 2 == 1:
    d1 = A[0:N // 2 + 1]
    u1 = A[N // 2 + 1:N + 1]
else:
    d1 = A[0:N // 2]
    u1 = A[N // 2:N + 1]

d1 = collections.deque(d1)
u1 = collections.deque(u1)
d1.rotate(1)
u1.rotate(-1)

sum1 = 0
i = 0
while (True):
    # print("{},{},{}".format(i, len(d1), len(u1)))
    if i >= len(d1) or i >= len(u1):
        break
    sum1 += abs(u1[i] - d1[i])

    if i+1 >= len(d1) or i >= len(u1):
        break
    sum1 += abs(u1[i] - d1[i + 1])
    i += 1

sum2 = 0
i = 0
while (True):
    # print("{},{},{}".format(i, len(d1), len(u1)))
    if i >= len(d1) or i >= len(u1):
        break
    sum2 += abs(u1[i] - d1[i])

    if i >= len(d1) or i+1 >= len(u1):
        break
    sum2 += abs(u1[i+1] - d1[i])
    i += 1

###########################

if N % 2 == 1:
    d1 = A[0:N // 2]
    u1 = A[N // 2:N + 1]

d1 = collections.deque(d1)
u1 = collections.deque(u1)
d1.rotate(1)
u1.rotate(-1)

sum3 = 0
i = 0
while (True):
    # print("{},{},{}".format(i, len(d1), len(u1)))
    if i >= len(d1) or i >= len(u1):
        break
    sum3 += abs(u1[i] - d1[i])

    if i+1 >= len(d1) or i >= len(u1):
        break
    sum3 += abs(u1[i] - d1[i + 1])
    i += 1

sum4 = 0
i = 0
while (True):
    # print("{},{},{}".format(i, len(d1), len(u1)))
    if i >= len(d1) or i >= len(u1):
        break
    sum4 += abs(u1[i] - d1[i])

    if i >= len(d1) or i+1 >= len(u1):
        break
    sum4 += abs(u1[i+1] - d1[i])
    i += 1


print(max(sum1, sum2, sum3, sum4))


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

int main()
{
    ll N, M;
    cin >> N >> M;
    vector<ll> X(M);
    rep(i, M){
        cin >> X[i];
    }

    if (N >= M){
        puts("0");
        return 0;
    }

    vector<pair<ll, ll>> X_diff(M-1);
    sort(X.begin(), X.end());
    rep(i, M-1){
        X_diff[i] = make_pair<ll, ll>(X[i+1] - X[i], ll(i));
    }
    sort(X_diff.begin(), X_diff.end(), greater<pair<ll, ll>>());
    vector<ll> indices(N-1);
    rep(i, N-1){
        indices[i] = X_diff[i].second;
    }
    sort(indices.begin(), indices.end());
    ll ans = 0;
    ll pre_i = 0;
    rep(i, N-1){
        ll end_i = indices[i];
        ans += X[end_i] - X[pre_i];
        pre_i = end_i+1;
    }
    ans += X[M-1] - X[pre_i];

    cout << ans << endl;
    

    return 0;
}


Measured memory_bytes: 6048
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
using namespace std;

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

typedef unsigned long long ul;
typedef unsigned int ui;
ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int>P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);

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

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }
const int max_n = 10000;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}

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


void solve(){
	int x; cin >> x;
	int ans = 0;
	int d = x / 500; ans += d * 1000;
	x %= 500;
	ans += 5 * (x / 5);
	cout << ans << endl;
}


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(7);
	//init_f();
	//init();
	//int t; cin >> t; rep(i, t)solve();
	solve();
	stop
		return 0;
}


Measured memory_bytes: 384
Y=input()#1行に沢山の数値(または文字)が並んでいる場合にリストに格納していく
y=input()
X=[]
x=[]
X=Y.split(" ") #数値YをリストXに格納
x=y.split(" ")
Z=[int(i) for i in X] #リストXの要素を"文字"から"数値"に変換
z=[int(j) for j in x]
z.sort()
N=Z[0]
M=Z[1]
a=z[M-1]-z[0]
b=[]
c=0
if N<M :
    for i in range(0,M-1):
        b.append(int(abs(int(z[i+1])-int(z[i]))))
    b.sort()
    b.reverse()
    for j in range(0,N-1):
        c=b[j]+c
    print(a-c)
else :
    print('0')


Measured memory_bytes: 15356
#include <bits/stdc++.h>
using namespace std;
#define pi 2*asin(1.0)


//template functions
/////////////////////////
long Comb(long N,long M){// nCm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
for(long i=M;i>0;i--){
    ans=ans/i;
}
return ans;
}
long Perm(long N,long M){// nPm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
return ans;
}
/////////////////////////



//Answer


int main() {

long N;
long now=1;
long count=0;
cin>>N;
vector<long> A(N);
for(long i=0;i<N;i++){
cin>>A.at(i);
if(A.at(i)==now){
now++;
}else{
count++;
}
}

if(now>1){
cout<<count<<endl;
}else{
  cout<<-1<<endl;
}

}


Measured memory_bytes: 4840
#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
#define int long long
#define x first
#define y second
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ve vector
#define forn(i,n) for(int i=0;i<(int)n;i++)
#define pb push_back
#define sz(a) (int)(a.size())
//using namespace __gnu_pbds;
using namespace std;

// // // functions: find_by_order  & order_of_key
// typedef tree<
// int,
// null_type,
// less<int>,
// rb_tree_tag,
// tree_order_statistics_node_update>
// ordered_set;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;

const int inf=(int)2e9;
const long long mod=1000000007; //1E9+7
int dx[]={1,-1,0,0},dy[]={0,0,1,-1};

ll powmod(ll a,ll p){
	ll ans=1;
	while(p){
		if(p&1) ans*=a;
		p/=2;a*=a; ans%=mod;a%=mod;
	}
	return ans;
}
ll mdinv(ll a){return powmod(a,mod-2); }


signed main(){
	IOS
	int n;cin>>n;
	vvi v(n,vi(n,0));
	forn(i,n) forn(j,n) cin>>v[i][j];
	vi DP(1<<21,0),DP_new(1<<21);
	vi cnt(1<<21,0);
	for(int m=1;m<1<<21;m++)
		cnt[m]=cnt[m>>1]+(m&1);
	DP[0]=1;
	for(int i=0;i<n;i++){
		for(int msk=0;msk<(1<<n);msk++){
			DP_new[msk]=0;
			if(cnt[msk]!=i+1) continue; 
			for(int x=0;x<n;x++)
				if((msk>>x)&1 && v[i][x]){
					DP_new[msk]+=DP[msk^(1<<x)];
					if(DP_new[msk]>=mod)
						DP_new[msk]-=mod;
				}
		}
		swap(DP,DP_new);
	}
	cout<<DP[(1<<n)-1];
}


Measured memory_bytes: 49408
#include<bits/stdc++.h>
using namespace std;
int main(){
  cout << setprecision(10);
  int N;
  cin >> N;
  vector<int> B(N-1);
  for(auto &bi: B) cin >> bi;
  int ret = B[0] + B[N-2];
  for(int i=1; i<N-1; i++) ret += min(B[i-1],B[i]);
  cout << ret << endl;
}

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

using namespace std;
int main(){
    string s = "2019/04/30";
    string s1;
    cin>>s1;
    if(s1[5] - '0' > s[5] -'0'||s1[6] - '0' >s[6] -'0'){
        cout<<"TBD";
    }else if(s1[6] - '0' == s[6] -'0' && s1[8] - '0' < s[8] -'0'){
        cout<<"Heisei";
    }else{
        cout<<"Heisei";
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 1e18
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) Rep(i, 0, n)
#define all(a) (a).begin(), (a).end()
#define MAX 1000
#define ll long long
#define P pair<int,int>
using namespace std;
const int mod = 1000000007;
//char c[MAX][MAX];
int step[MAX][MAX];
int H,W,N; 
int vy[4] ={1,-1,0,0}, vx[4] = {0,0,-1,1}; //up,down,left,right 

signed main(){
    string s; int k; cin >> k >> s;
    if(s.size() <= k) cout << s << endl;
    else cout << s.substr(0,k) << "..." << endl;
    return 0;
}

Measured memory_bytes: 3624
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<cmath>
using namespace std;
#define REP(i, limit) for(int i=0; i< limit; ++i)
#define FOR(i, j, limit) for(int i=j; i< limit; ++i)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define LL long long
int INF = 2147483647;
LL LINF = 9223372036854775807;
LL MOD = 1000000007;
typedef pair<int, int>P;
typedef pair<LL, LL>PL;
typedef vector<int> vi;
typedef vector<LL> vl;


int main(){
  LL A, B, C;
  LL K;
  cin>>A>>B>>C>>K;
  if(K%2){
    LL a=B+C;
    LL b=C+A;
    LL c=A+B;
    A=a;
    B=b;
    C=c;
    --K;
  }
  cout<<A-B<<endl;

  return 0;
}


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

ll mod=1000000007;

int main(){
    ll n;
    cin>>n;
    ll cnt=0;
    for(ll _=0;_<n;++_){
        ll t,tt;
        cin>>t>>tt;
        if(t==tt){
            cnt++;
        }else{
            cnt=0;
        }
        if(cnt>=3){
            cout<<"Yes";
            return 0;
        }
    }
    cout<<"No";
}

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

int main() {
    int k;
    string s;
    cin >> k >> s;
    if (s.size() <= k) {
        cout << s << endl;
    } else {
        for (int i = 0; i < k; i++) {
            cout << s.at(i);
        }
        cout << "..." << endl;
    }
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
 using namespace std;
 #define double long long
 #define endl "\n"
 const double mod=1e9+7;
 #define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 #define clr(a,x) memset(a,x,sizeof(a))
 #define T double t;cin>>t; while(t--)
 #define vll vector<double>
 #define v22 vactor<vector<double>>
#define pb push_back
 #define sz size
 #define str to_string
 #define intt stoll
 #define sv() sort(a.begin(),a.end())
 #define vp vector<pair<double, double>> b(n)    
 const double N = 50000; 
 int32_t main()
 {
 int n,m;
 cin>>n>>m;
 int dp[n+1][m+1]={0};
 for(int i=0;i<n+1;i++)
 {
     for(int j=0;j<m+1;j++)
     dp[i][j]=0;
 }
 dp[0][0]=1; 
char a[n][m];
 for(int i=0;i<n;i++)
 {
     for(int j=0;j<m;j++)
     cin>>a[i][j];
 }
 for(int i=0;i<n;i++)
 {
     for(int j=0;j<m;j++)
     {
         if(a[i][j]=='#')
         continue;
         if(a[i][j+1]=='#' && j<m)
         dp[i][j+1]=0;
         if(a[i+1][j]=='#' && i<n)
         dp[i+1][j]=0;
         if(a[i][j+1]=='.' && j<m)
           dp[i][j+1]= (dp[i][j+1]+dp[i][j])%mod;
         if(a[i+1][j]=='.' && i<n)
         dp[i+1][j]= (dp[i+1][j]+dp[i][j])%mod;
       // cout<<a[i][j];
     }
    //cout<<endl;
 }
//  for(int i=0;i<n;i++)
//  {
//      for(int j=0;j<m;j++)
//      cout<<dp[i][j]<<" ";
//      cout<<endl;
//  }
cout<<dp[n-1][m-1]%mod;
 }
 


Measured memory_bytes: 8508
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define SIZE(x) ((int)(x).size())
#define UQ(v) v.erase(unique(v,begin(),v,end()),v.end());
ll INF = 1LL <<61;
#define pb push_back 
int dxy4[5] = { 0,1,0,-1,0 };
int dxy8[9] = { 0,1,1,0,-1,1,-1,-1,0 };
int gcd(int a, int b) { return min(a,b) ? gcd(min(a,b), max(a,b)%min(a,b)) : max(a,b); }
ll mod7 = 1000000007;
ll mod9 = 1000000009;
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < n; i++)
#define FOR(i,x,n) for(int i=x;i<n;++i)
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define print(x) cout<<x<<endl;
#define wait int xxxxxxx;cin>>xxxxxxx;
//vector< vector<int> > v (max1, vector<in t>(max2) );

int main(){
	int n;
	cin >> n;
	vector<int> a(n*2);
	rep(i, n*2)cin >> a[i];
	sort(all(a));
	int ans = 0;
	rep(i, n) {
		ans += a[i * 2];

	}
	print(ans);
	wait;
	return 0;
}

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

/*
  Gに無向グラフを入れ、getBridgeでそのグラフの持つ橋を戻す
  dfsはその補助用関数
*/

const int MAX_V=100010;
int ord[MAX_V];
int low[MAX_V];
vector<int> G[MAX_V];



void dfs(int now,int prv,int &cnt){
    ord[now]=low[now]=cnt++;
    int toSize=0;
    for(int i=0;i<(int)G[now].size();i++){
        int to=G[now][i];
        if(to==prv)continue;
        else if(ord[to]==-1){
            toSize++;
            dfs(to,now,cnt);
            low[now]=min(low[now],low[to]);
        }
        else
            low[now]=min(low[now],ord[to]);
    }
}

// 橋を検出
vector<pii> getBridge(int N){
    memset(ord,-1,sizeof(ord));
    for(int i=0;i<N;i++){
        if(ord[i]==-1){
            int cnt=0;
            dfs(i,-1,cnt);
        }
    }
    vector<pii> res;
    for(int i=0;i<N;i++){
        for(int j=0;j<(int)G[i].size();j++){
            int from=i;
            int to=G[i][j];
            if(ord[from]<low[to])
                res.push_back(pii(from,to));
        }
    }
    return res;
}


int main (){

    int N, M;
    cin >> N >> M;
    for(int i = 0; i < M; i++){
        int a, b;
        cin >> a >> b;
        a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    cout << getBridge(N).size() << endl;

    return 0;
}


Measured memory_bytes: 2944
#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <set>
#include <map>
#include <deque>
#include <math.h>
#include <string>
#include <iomanip>
#include <locale>
#include <list>
#include <bitset>
using namespace std;
#define FORN(i,m,n) for(ll i=(m); i<ll(n); i++)
#define PRINTVEC(v) FORN(i,0,v.size()) cout<<v[i]<<" "; cout<<endl
#define PRINTMAT(m) FORN(j,0,m.size()) {PRINTVEC(m[j]);}
#define PB(x) push_back(x)
#define MP(a,b) make_pair(a,b)
typedef long long ll;

int main(){
  ios_base::sync_with_stdio(false); cin.tie(NULL);
  ll k,x;
  cin>>k>>x;
  cout<<(500 * k >= x ? "Yes" : "No")<<endl;
}

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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define endl '\n';
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const ll POSITIVE_INFINITY = 9223372036854775807;
const ll NEGATIVE_INFINITY = -9223372036854775807;
const ll MOD = 1000000007;
const ld PI = acos(-1.0);

template <typename T> inline T bigMod(T A,T B,T M = MOD){A %= M;T ret = 1;while(B){if(B & 1) ret = (ret * A) % M;A = (A * A) % M;B = B >> 1;}return ret;}
template <typename T> inline T invMod (T A,T M = MOD){return bigMod(A,M-2,M);}

const int N = 200005;

int main(){
  FASTER;
  int a, b, c;
  cin >> a >> b >> c;
  if (c >= a && c <= b){
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
  return 0;
}


Measured memory_bytes: 256