akhauriyash/Code-Regression huggingface dataset:
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
 
using namespace __gnu_pbds;
using namespace std;

#define double      	long double
#define int         	long long
#define pb          	push_back
#define pii         	pair<int,int>
#define vi          	vector<int>
#define vii         	vector<pii>
#define mi          	map<int,int>
#define mii         	map<pii,int>
#define all(a)      	(a).begin(),(a).end()
#define sz(x)       	(int)x.size()
#define endl        	"\n"
#define repp(i,a,b) 	for(int i=a;i<b;i++)
#define rep(i,a,b) 		for(int i=a;i<=b;i++)
#define brep(i,a,b)     for(int i=a;i>=b;i--)
#define deb1(x)      	cout << #x << "=" << x << endl
#define deb2(x, y)  	cout << #x << "=" << x << "," << #y << "=" << y << endl
#define deb3(x, y, z)  	cout << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define trace(v) 		for(auto it=v.begin();it!=v.end();it++)cout<<*it<<" ";cout<<endl;
#define tracearr(a,l,r) for(int iii=l;iii<=r;iii++)cout << a[iii] << " ";cout << endl;
#define PI          	3.1415926535897932384626
#define F 				first
#define S 				second
#define clr(x,y) 		memset(x, y, sizeof(x))
#define IOS         	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);


typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
// *s.find_by_order(1) - gives the 2nd samllest element in set
// s.order_of_key(x)   - gives the number of elements in the set which are strictly smaller than x


const int N=1e5 + 5;
const int MOD=1e9 + 7;

int32_t main()
{
	IOS;
	int T=1;
	//cin >> T;
	// int numOfSetBits = __builtin_popcountll(n);
	std::cout << std::fixed << std::setprecision(12);
	while(T--)
	{
		int n,k;
		cin >> n >> k;
		vi v;
		rep(i,1,n)
		{
			int x;
			cin >> x;
			v.pb(x);
		}
		sort(all(v));
		int ans = 0;
		rep(i,0,k-1)
			ans += v[i];
		cout << ans;
	}
}



Measured memory_bytes: 3660
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<ctime>
#include<map>
#include<bitset>
#include<set>
#define LL long long
#define mp(x,y) make_pair(x,y)
#define pll pair<long long,long long>
#define pii pair<int,int>
using namespace std;
inline int read()
{
	int f=1,x=0;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int stack[20];
inline void write(LL x)
{
	if(x<0){putchar('-');x=-x;}
    if(!x){putchar('0');return;}
    int top=0;
    while(x)stack[++top]=x%10,x/=10;
    while(top)putchar(stack[top--]+'0');
}
inline void pr1(int x){write(x);putchar(' ');}
inline void pr2(LL x){write(x);putchar('\n');}
const int MAXN=100005;
int rt[MAXN];
int findrt(int x){return rt[x]==x?rt[x]:rt[x]=findrt(rt[x]);}
struct edge{int x,y,next;}a[2*MAXN];int len,last[MAXN];
void ins(int x,int y){len++;a[len].x=x;a[len].y=y;a[len].next=last[x];last[x]=len;}
struct pt{int a,b,id;}w[MAXN];
int n,m,A[MAXN],B[MAXN];
bool cmp(pt n1,pt n2){return n1.a!=n2.a?n1.a<n2.a:n1.b>n2.b;}
vector<int> vec[MAXN];
LL sum[MAXN];
void init(int x)
{
	sum[x]=B[x];
	for(int k=last[x];k;k=a[k].next)init(a[k].y),sum[x]+=sum[a[k].y];
}
LL ans;
void cal(int x,LL ls1,LL ls2)//留下来的速度  上面会用掉的速度 
{
	if(x==10)
	{
		int gg;
		gg++;
	}
	LL down=sum[x]-B[x];//不考虑我走完要多少速度 
	LL nx=max(ls1,(LL)max(A[x],B[x]));
	LL canuse=min(down,nx-max(A[x],B[x]));//可以提供给子树的 
	ans=min(ans,nx-ls1+down-canuse+ls2);
	for(int k=last[x];k;k=a[k].next)
	{
		int y=a[k].y;
		cal(y,nx-B[x]-min(canuse,down-sum[y]),down-sum[y]+ls2+nx-ls1-min(canuse,down-sum[y]));
	}
}
int ri[MAXN];
bool is[MAXN];
int main()
{
//	freopen("subtask_1_09.in","r",stdin);
//	freopen("rescue.in","r",stdin);
//	freopen("rescue.out","w",stdout);
	n=read();m=read();
	for(int i=1;i<=n;i++)w[i].a=A[i]=read(),w[i].b=B[i]=read(),w[i].id=i;
	sort(w+1,w+1+n,cmp);
	for(int i=1;i<=m;i++)
	{
		int x=read(),y=read();
		vec[x].push_back(y);vec[y].push_back(x);
	}
	for(int i=1;i<=n;i++)rt[i]=i;
	for(int i=1;i<=n;i++)
	{
		is[w[i].id]=true; 
		for(int j=0;j<vec[w[i].id].size();j++)
		{
			int x=vec[w[i].id][j];
			int p=findrt(w[i].id),q=findrt(x);
			if(p!=q&&is[q])ins(w[i].id,q),ri[q]++,rt[q]=p;
		}
	}
//	for(int i=1;i<=len;i++)printf("YES %d %d\n",a[i].x,a[i].y);
//	for(int i=1;i<=n;i++)pr1(A[i]),pr2(B[i]);
	int root;
	for(int i=1;i<=n;i++)if(!ri[i])root=i;
	init(root);
	ans=(1LL<<63-1);
	cal(root,0,0);
	pr2(ans);
	return 0;
}


Measured memory_bytes: 19712
#include<iostream>
#include<string>
#include<stdio.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#include<algorithm>
#include<vector>
using namespace std;

int main() {
	int a, b, c, d, e;
	cin >> a >> b >> c >> d >> e;
	vector<int> dish(5);
	dish = { a,b,c,d,e };
	vector<int> time(5);
	rep(i, 5) {
		if (dish[i] % 10 != 0) time[i] = dish[i] + 10 - dish[i] % 10;
		else time[i] = dish[i];
	}

	int sumtime = 0;
	rep(i, 5) sumtime += time[i];
	int mintime = 114514;
	rep(i, 5) {
		int a;
		a = sumtime - time[i] + dish[i];
		mintime = min(a, mintime);
	}
	cout << mintime << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;

static const int INTINF = (2147483647 >> 1); // 10^9 + 5000
static const ll LLINF = (9223372036854775807 >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;

namespace Kunitaka{
    template<
        typename TYPE,
        std::size_t SIZE
    >
    std::size_t array_length(const TYPE (&array)[SIZE])
    {
        return SIZE;
    }
}
using namespace Kunitaka;
namespace Printer{
    void br(){
        cout << endl;
    }

    void loop_cnt(int i){
        cout << "i = " << i << endl;
    }

    void loop_cnt(int i, int j){
        cout << "i = " << i << ", " << "j = " << j << endl;
    }

    template<class T>
    void print(T x){
        cout << x << endl;
    }

    template<class T, class S>
    void print(T x, S y){
        cout << x << "," << y << endl;
    }

    template<class T, class S, class U>
    void print(T x, S y, U z){
        cout << x << "," << y << "," << z << endl;
    }

    template<class T, class S>
    void print(pair<T, S> p){
        cout << p.first << ", " << p.second << endl;
    }

    template<
        typename TYPE,
        std::size_t SIZE
    >
    void print(const TYPE (&array)[SIZE]){
        int lim = array_length(array);
        for(int i=0; i<lim; i++){
            if(i) cout << " ";
            cout << array[i];
        }
        cout << endl;
    }

    template<class S>
    void print(vector<S> v){
        for(int i=0; i<v.size(); i++){
            if(i) cout << " ";
            cout<< v[i];
        }
        cout << endl;
    }

    template<class S>
    void print(vector<vector<S> > vv){
        for(int i=0; i<vv.size(); i++){
            for(int j=0; j<vv[i].size(); j++){
                if(j) cout << " ";
                cout << vv[i][j];
            }
            cout << endl;
        }
    }

    void yesno(bool x){
        if(x) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
};
using namespace Printer;

int main(int argc, const char * argv[]) {
    //提出時、消す----//

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


    // input
    cout << fixed << setprecision(10);
    int N; cin >> N;
    rep(i, N){
        string S, T; cin >> S >> T;
        vector<vector<int> > dp(T.size()+1, vector<int>(S.size()+1));
        int ans = 0;
        rep2(j, 1, T.size()+1){
            rep2(k, 1, S.size()+1){
                if(T[j-1] == S[k-1]){
                    dp[j][k] = dp[j-1][k-1] + 1;
                }
                else{
                    dp[j][k] = max(dp[j][k-1], dp[j-1][k]);
                }
                ans = max(ans, dp[j][k]);
            }
        }
        print(ans);
    }
    
    return 0;
}



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

int main() {
    int N, H = 1, W = 0;
    cin >> N;
    while(H * W < 2 * N) H++, W++;
    if(H * W != 2 * N) {
        cout << "No" << '\n';
        return 0;
    }
    vector<vector<int>> ans(H, vector<int>(W));
    int n = 1;
    for(int b = 0; b < W; ++b) {
        for(int i = 0; b + i < W; ++i) {
            ans[i][b + i] = n;
            ans[b + i + 1][i] = n;
            n++;
        }
    }
    cout << "Yes" << '\n';
    cout << H << '\n';
    for(auto r : ans) {
        printf("%d ", W);
        for(auto p : r) printf("%d ", p);
        printf("\n");
    }
    return 0;
}


Measured memory_bytes: 2176
import sys
n = int(input())
si = []
for _ in range(n):
    s = input()
    l = 0
    r = 0
    count = 0
    for i in range(len(s)):
        if s[i] == "(":
            count += 1
        else:
            count = max(0, count-1)
    l = count
    count = 0
    for i in range(len(s)-1, -1, -1):
        if s[i] == ")":
            count += 1
        else:
            count = max(0, count-1)
    r = count
    si.append((l, r))

minus = []
plus = []
while si:
    a, b = si.pop()
    if a <= b:
        plus.append((a, b))
    else:
        minus.append((b, a))

plus.sort()
minus.sort()
countl = 0
for a, b in plus:
    if countl >= a:
        countl += b-a
    else:
        print("No")
        sys.exit()

countr = 0
for a, b in minus:
    if countr >= a:
        countr += b-a
    else:
        print("No")
        sys.exit()


if countr == countl:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 207856
n, a, b = map(int, input().split())

ans = 0
sum = 0
for i in range(1, n+1):
    q = len(str(i))
    for j in range(q):
        sum += int(str(i)[j])
    if sum >= a and sum <= b:
        ans += i
    sum = 0
print(ans)


Measured memory_bytes: 73636
#include<iostream>

int main()
{   
    int W,H,x,y,r;
    std::cin >> W >> H >> x >> y >> r;

    if (((x-r)>=0)&&((x+r)<=W)
        &&((y-r)>=0)&&((y+r)<=H)){
            std::cout << "Yes" <<std::endl;
        }else{
            std::cout <<"No"<<std::endl;
        }
    return 0;
}


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

bool s[20000001];

signed main(){
  int n;
  cin>>n;
  for(int i=2;i*i<=2*n;i++){
    if(!s[i])
      for(int j=2;i*j<=2*n;j++){
	s[i*j]=1;
    }
  }
  
  int c=0;
  for(int i=2;i<=n;i++){
    if(!s[i]&&!s[i+2])c+=2;
  }
  
  cout<<c<<endl;
  return 0;
}



Measured memory_bytes: 22504
import math
text = list(map(int, input().split()))

reply = -1
i = 0
while math.floor(i * 0.08) <= text[0] and math.floor(i * 0.1) <= text[1]:
    if math.floor(i * 0.08) == text[0] and math.floor(i * 0.1) == text[1]:
        reply = i
        break
    i += 1
print(reply)

Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
#define ALL(x) (x).begin(), (x).end()
#define sz(a) int(a.size())
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eps 1e-6
#define chu(x) cout<<"["<<#x<<" "<<(x)<<"]"<<endl
#define du3(a,b,c) scanf("%d %d %d",&(a),&(b),&(c))
#define du2(a,b) scanf("%d %d",&(a),&(b))
#define du1(a) scanf("%d",&(a));
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;}
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
ll powmod(ll a, ll b, ll MOD) { if (a == 0ll) {return 0ll;} a %= MOD; ll ans = 1; while (b) {if (b & 1) {ans = ans * a % MOD;} a = a * a % MOD; b >>= 1;} return ans;}
void Pv(const vector<int> &V) {int Len = sz(V); for (int i = 0; i < Len; ++i) {printf("%d", V[i] ); if (i != Len - 1) {printf(" ");} else {printf("\n");}}}
void Pvl(const vector<ll> &V) {int Len = sz(V); for (int i = 0; i < Len; ++i) {printf("%lld", V[i] ); if (i != Len - 1) {printf(" ");} else {printf("\n");}}}
inline long long readll() {long long tmp = 0, fh = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') fh = -1; c = getchar();} while (c >= '0' && c <= '9') tmp = tmp * 10 + c - 48, c = getchar(); return tmp * fh;}
inline int readint() {int tmp = 0, fh = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') fh = -1; c = getchar();} while (c >= '0' && c <= '9') tmp = tmp * 10 + c - 48, c = getchar(); return tmp * fh;}
const int maxn = 1000010;
const int inf = 0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
int n;
int a[maxn];
int main()
{
    //freopen("D:\\code\\text\\input.txt","r",stdin);
    //freopen("D:\\code\\text\\output.txt","w",stdout);
    n = readint();
    repd(i, 1, n)
    {
        a[i] = readint();
    }
    int isok = 1;
    repd(i, 1, n)
    {
        if (a[i] & 1)
            continue;
        if (a[i] % 3 == 0 || a[i] % 5 == 0)
            continue;
        isok = 0;
        break;
    }
    if (isok)
    {
        printf("APPROVED\n");
    } else
    {
        printf("DENIED\n");
    }

    return 0;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

ll INF = ll(1e18) + 1;

int main() {
  ll n, k;
  cin >> n >> k;
  vl a(n);
  rep(i, n) cin >> a[i];
  sort(all(a));
  ll l = -INF, r = INF;
  while(l + 1 < r) {
    ll x = (l + r) / 2;
    ll tot = 0;
    rep(i, n) {
      if(a[i] >= 0) {
        ll nl = -1, nr = n;
        while(nl + 1 < nr) {
          ll nx = (nl + nr) / 2;
          if(a[i] * a[nx] < x)
            nl = nx;
          else
            nr = nx;
        }
        tot += nr;
      } else {
        ll nl = -1, nr = n;
        while(nl + 1 < nr) {
          ll nx = (nl + nr) / 2;
          if(a[i] * a[nx] < x)
            nr = nx;
          else
            nl = nx;
        }
        tot += n - nr;
      }
      if(a[i] * a[i] < x) tot--;
    }
    tot /= 2;
    if(tot < k)
      l = x;
    else
      r = x;
  }
  cout << l << endl;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define SZ(x) ((int)(x).size())
typedef long long ll;
using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cout.setf(ios::fixed); cout.precision(20);
    int n; cin >> n;
    vector<int> a(n);
    for (int &x : a) {
        cin >> x;
    }
    int res = 0;
    for (int i = 0; i < n; i++) {
        bool ok = true;
        for (int j = i - 1; j >= 0; j--) {
            ok &= (a[j] <= a[i]);
        }
        res += ok;
    }
    cout << res << "\n";
}


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

public class Main {
	public static void main (String[] args) {
	Scanner s=new Scanner(System.in);	
	long n=s.nextLong();
	long k=n/2;
	if(n%2==0)
	{}
	else
	k++;
	System.out.println(k);
	}
}

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

using namespace std;

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

int dfs(int x, int y, vector<vector<bool> >& Cango){
  
  int counter = 0;
  Cango[x][y] = false;
  counter++;

  for(int i = 0; i < 4; i++){
    int nextx = x + dx[i];
    int nexty = y + dy[i];
    
    if(Cango[nextx][nexty]) counter += dfs(nextx, nexty, Cango);

  }

  return counter;
}

int main(void)
{
  
  int w, h;
  int si, sj;
  while(1){
    cin >> w >> h;
    if(w == 0 && h == 0) break;

    vector<vector<bool> > Cango(h + 2, vector<bool>(w + 2, false));
    for(int i = 1 ; i <= h; i++){
      for(int j = 1; j <= w; j++){
	char input; cin >> input;
	if(input != '#') Cango[i][j] = true;
	if(input == '@'){
	  si = i;
	  sj = j;
	}
      }
    }
    int ans = dfs(si, sj, Cango);
   
    cout << ans << endl;
  }

  return 0;
    
}

Measured memory_bytes: 2952
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rrep(i, n) for (ll i = n - 1; i >= 0; i--)
#define Rep(i, r, n) for (ll i = r; i < n; i++)
#define RRep(i, r, n) for (ll i = n - 1; i <= r; i--)
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define int long long
#define pb push_back
const int dx[] = {0, -1, 0, 1};
const int dy[] = {1, 0, -1, 0};
const int MOD = (1000000007);
//const int MOD = (998244353);
//const int INF = (1 << 30)-1;
const int INF = (1LL << 60)-1;
const double EPS = (1 >> 30);

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

using Graph = vector<vector<pair<int, int>>>;

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
    //---------------------------------------------
    
    int n;
    cin>>n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    int sum=0;
    rep(i,n){
        sum+=a[i];
    }
    int ans=sum;
    int memo=0;
    rep(i,n){
        sum-=a[i];
        memo+=a[i];
        ans=min(ans,abs(memo-sum));
    }
    cout<<ans<<endl;
    
}

Measured memory_bytes: 1792
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    void run() {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        int[] c = new int[n];

        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        for (int i = 0; i < n; i++) {
            b[i] = sc.nextInt();
        }
        for (int i = 0; i < n; i++) {
            c[i] = sc.nextInt();
        }

        Arrays.sort(a);
        Arrays.sort(b);
        Arrays.sort(c);

        long sum = 0;
        for (int i = 0; i < n; i++) {
            long ac = lowerBound(a, b[i]);
            long cc = n - upperBound(c, b[i]);
            sum += ac * cc;
        }

        System.out.println(sum);
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static int lowerBound(int[] array, int value) {
        int left = -1;
        int right = array.length;
        while (right - left > 1) {
            int middle = (right + left) / 2;
            if (array[middle] >= value) {
                right = middle;
            } else {
                left = middle;
            }
        }
        return right;
    }

    public static int upperBound(int[] array, int value) {
        int left = -1;
        int right = array.length;
        while (right - left > 1) {
            int middle = (right + left) / 2;
            if (array[middle] > value) {
                right = middle;
            } else {
                left = middle;
            }
        }
        return right;
    }

    public static void main(String[] args) {
        new Main().run();
    }

}


Measured memory_bytes: 65068
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::str::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

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

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let cin = stdin();
    let cin = cin.lock();
    let s: String = cin
        .bytes() // Bytes
        .map(|c| c.expect("failed reading char") as char)
        .skip_while(|c| c.is_whitespace()) // c が whitespace である限り skip
        .take_while(|c| !c.is_whitespace()) // c が whitespace でない限り要素を返す
        .collect();
    s.parse().ok().expect("failed parsing")
}

fn main() {
    input! {x:usize}
    let mut ans = 1;
    for p in 2..x + 1 {
        let mut y = p;
        while true {
            y *= p;
            if y <= x {
                ans = max(ans, y);
            } else {
                break;
            }
        }
    }
    println! {"{}", ans}
}


Measured memory_bytes: 4352
#include <algorithm>
#include <array>
#include <bitset>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <queue>

using namespace std;

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15);
  }
} initializer;

template<typename T> istream& operator>>(istream &s, vector<T> &v) {
  for (T &t : v) s >> t;
  return s;
}

template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
  for (const T &t : v) s << t << endl;
  return s;
}

int main() {
  int n, r = 0;
  string s;
  cin >> n >> s;
  for (int i = 1; i < n; ++i) {
    string x = s.substr(0, i), y = s.substr(i);
    set<char> a(x.begin(), x.end()), b(y.begin(), y.end());
    int k = 0;
    for (char c : a) k += b.count(c);
    r = max(r, k);
  }
  cout << r << endl;
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<cmath>
#include<bitset>
typedef long long ll;
#define PB	push_back
#define FOR(n)			for(int i = 0; i < n; ++i)
#define RFOR(n)			for(int i = n; i >= 0; --i)
#define FORR(start,end) for(int i = start; i < end; ++i)
#define COUT(n)			cout << n << " " << flush
#define vi(v)			vector<int> v
#define vii(v)			vector<pair<int,int>> v
#define pii(p)			pair<int,int> p
#define mii(m)			map<int, int> m
#define msi(m)			map<string, int, less<>> m
#define mmsi(m)			multimap<string, int, less<>> m
#define mkp(a,b)		make_pair(a,b)
#define ALL(obj)		obj.begin(), obj.end()
#define PI 3.141592
#define MOD 1e9+7
using namespace std;

void solve() {
	int a, b, c;
	cin >> a >> b >> c;
	if (a == b)
	{
		if (a != c) {
			cout << "Yes" << endl;
			return;
		}
	}
	if (b == c)
	{
		if (b != a) {
			cout << "Yes" << endl;
			return;
		}
	}
	if (a == c)
	{
		if (a != b) {
			cout << "Yes" << endl;
			return;
		}
	}
	cout << "No" << endl;
}

int main() {
	solve();
	return 0;
}

Measured memory_bytes: 256
import bisect

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort()
B.sort()
C.sort()

ans = 0

for b in B:
    a_count = bisect.bisect_left(A, b)
    c_count = N - bisect.bisect_right(C, b)
    ans += a_count * c_count
print(ans)


Measured memory_bytes: 29512
#include <iostream>


using namespace std;
int main()
{

    int r;
    cin>>r;
if(r>=10 &&  r<=99){
    
    if((r%10==9) ||(r/10==9)){
    cout<<"Yes";

    }
    else{
        cout<<"No";
    }
}
else cout<<"WRONG";
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0;i < n;i++)
#define all(i) i.begin(), i.end()
template<class T, class U> bool cmax(T& a, U b) { if (a<b) {a = b; return true;} else return false; }
template<class T, class U> bool cmin(T& a, U b) { if (a>b) {a = b; return true;} else return false; }

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

  int r;
  cin >> r;
  cout << r*r  << endl;
}


Measured memory_bytes: 892
#include <stdio.h>
#include <string.h>

int main(){
    char str [101];
    long len;
    int counter = 0;
    int a = 0;
    int i;
    char j;
    while (scanf("%s",str)!= EOF) {
        counter = 0;
        len = strlen(str);
        for (i = 0; i < len; i++) {
            j = str[len - 1 - i];
            if (j != str[i]) {
                counter++;
            }
        }
        if (counter == 0) {
            a++;
        }
    }
    printf("%d\n",a);
    return 0;
}

Measured memory_bytes: 540
#include <stdio.h>

int main(void){
  int a, b, c, ans;
  int cnt = 1;

  scanf("%d%d", &a, &b);
  c = (b - 1) / (a - 1);

  if ((a - 1) * c == (b - 1))
    ans = c;
  else
    ans = c + 1;

  printf("%d", ans);
}


Measured memory_bytes: 128
#include <stdio.h>
#include <math.h>

int n, dp[40];

int main(void){
    int x;
    dp[0] = 1;
    while(1){
        scanf("%d", &n);
        if(n == 0) break;
        for(x = 1; x <= n; x++){
            dp[x] = 0;
        }
        for(x = 1; x <= n; x++){
            if(x >= 1) dp[x] += dp[x-1];
            if(x >= 2) dp[x] += dp[x-2];
            if(x >= 3) dp[x] += dp[x-3];
        }
        printf("%d\n", (int)ceil((double)dp[n]/3650));
    }
    return 0;
}

Measured memory_bytes: 604
// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

int main() {
    fastio();

    string s;
    set<char> t;
    cin >> s;

    for (char c : s) {
        t.insert(c);
    }

    if (s.size() == t.size()) {
        cout << "yes\n";
    } else {
        cout << "no\n";
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,s,e) for(int i=(s); i<(e);i++)
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n)
#define repe(i,n) for(auto &&i:n)
#define all(v) (v).begin(),(v).end()
#define decimal fixed<<setprecision(20)
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)
using namespace std;
using LL = long long;
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; }
const int INF = 1e9;
const LL LLINF = 1e16;

struct UnionFind {
  private:
    vector<int> data;
  public:
    UnionFind(int size) : data(size, -1) {}

    bool merge(int x, int y) {
        x = root(x);
        y = root(y);
        if(x == y) return false;
        if(data[y] < data[x]) swap(x, y);
        data[x] += data[y];
        data[y] = x;
        return true;
    }

    int root(int x) { return data[x] < 0 ? x : (data[x] = root(data[x])); }

    int size(int x) { return -data[root(x)]; }
};


int main(){
    fastcin();

    int n, m, k;
    cin >> n >> m >> k;
    UnionFind UF(n);
    vector<vector<int>> fr(n), block(n);

    rep(i, m){
        int a, b;
        cin >> a >> b;
        a--; b--;
        fr[a].push_back(b);
        fr[b].push_back(a);
        UF.merge(a, b);
    }
    rep(i, k){
        int c, d;
        cin >> c >> d;
        c--; d--;
        block[c].push_back(d);
        block[d].push_back(c);
    }

    vector<int> ans(n, 0);
    rep(i, n){
        ans[i] = UF.size(i)-1;
        ans[i] -= fr[i].size();
        repe(j, block[i]){
            if(UF.root(j) == UF.root(i)) ans[i]--;
        }
    }
    rep(i, n) cout << ans[i] << (i==n-1 ? "\n":" ");
}


Measured memory_bytes: 12664
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll MOD = 1000000007;

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

    vector<int> a(N);
    for(int i=0;i<N;i++){
        cin >> a[i];
    }

    int ans = 0;
    for(int i=1;i<N;i++){
        if(a[i] == a[i - 1]){
            ans++;
            i++;
        }
    }
    cout << ans << endl;

    return 0;
}

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

using namespace std;

long long inf=1000000007;

int main(){
	long long a,v,b,w,t;
	cin>>a>>v>>b>>w>>t;

	long long kyori=abs(a-b);
	long long hayasa=v-w;

	if(hayasa>0 && hayasa*t>=kyori) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;

	return 0;
}


Measured memory_bytes: 3624
n = gets.to_i

playlist = []
n.times do
  x, y = gets.split(" ")
  playlist.push({"#{x}" => y.to_i })
end
n = gets.chomp!
index = playlist.index { |item| item.key? n }
ans = 0
playlist.shift(index + 1)
playlist.each do |item|
  ans += item.values.first
end

puts ans


Measured memory_bytes: 1788
input = gets

target_n = input.chomp.to_i

list = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
  'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
]

r = target_n
char = ''
while r > 0
  idx = r % 26
  idx = 26 if idx == 0
  char = "#{list[idx - 1]}#{char}"
  r = (r - idx) / 26
end

puts char


Measured memory_bytes: 14288
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;

vector<string>sts{

"mon"
,"tue"
, "wed"
, "thu"
, "fri"
, "sat"
, "sun"
};

int main() {	
	int N;cin>>N;
	cout<<sts[(N+3)%7]<<endl;
	return 0;
}

Measured memory_bytes: 3200
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
using Graph=vector<vector<int>>;
using edge= struct{int to;ll cost;};


template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}

int main(){
  int a;cin>>a;
  string s;cin>>s;
  if(a>=3200){
    cout<<s<<endl;
  }
  else{
    cout<<"red"<<endl;
  }

}


Measured memory_bytes: 256
// Anve$hi $hukla
#include <bits/stdc++.h>
using namespace std;
struct ${$(){ios_base::sync_with_stdio(false);cin.tie(NULL);}}$;

typedef long long LL;
const long long Maxn = 200005;

long long a[Maxn], b[Maxn];
const long long inf = 1e9;
long long search(long long a1, long long b1, long long ai, long long bi, long long st, long long end) {


   while(st + 1 < end) {
      long long mid = (st + end) / 2;
      if(mid * ai >= a1 && mid * bi >= b1)
         end = mid;
      else
         st = mid;
   }
   if(st * ai >= a1 && st * bi >= b1)
      return st;
   return end;
}

int main() {
   long long n;
   cin >> n;
   for(long long i = 1; i <= n; i++) {
      cin >> a[i] >> b[i];
   }   
   for(long long i = 2; i <= n; i++) {
      if(a[1] <= a[i] && b[1] <= b[i]) {
         a[1] = a[i];
         b[1] = b[i];
      } else {
         long long y1 = a[i] / a[1], y2 = b[i] / b[1];
         y1 = max(y1, a[1] / a[i]);
         y2 = max(y2, b[1] / b[i]);
         y1 = max(y1, y2);
         long long x = search(a[1], b[1], a[i], b[i], 1, y1 + 50);
         a[1] = x * a[i];
         b[1] = x * b[i]; 
      }
   }
   cout << a[1] + b[1] << endl;
   return 0;
}


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

int main(){
	int a, b;
	bool first = true;
	bool na;
	while (cin >> a >> b) {
		if(a == 0 && b == 0) break;
		if(first) first = false;
		else cout << endl;
		na = true;
		for (int i = a; i <= b; i++) {
			if (i % 4 == 0 && (i % 100 != 0 || i % 400 == 0)) {
				na = false;
				cout << i << endl;
			}
		}
		if (na) {
			cout << "NA" << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const int dx[4] = { 0, -1, 1, 0 };
const int dy[4] = { -1, 0, 0, 1 };
const int INF = 1e9 + 7;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}

template<class T1, class T2> void chmin(T1 &a, T2 b) { if (a>b)a = b; }

template<class T1, class T2> void chmax(T1 &a, T2 b) { if (a<b)a = b; }
template<class T>
void Add(T &a, const T &b, const T &mod = 1000000007) {
	int val = ((a % mod) + (b % mod)) % mod;
	if (val < 0) { val += mod; }
	a = val;
}
////////////////////////////////////////

int main() {
	int A, B;
	cin >> A >> B;
	if (A == B) {
		cout << A + B << endl;
	}
	else {
		cout << 2 * max(A, B) - 1 << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#include <random>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <random>
#include <time.h>
#include <chrono>
#include <sstream>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define MOD 1000000007
#define SORT(s) sort(s.begin(), s.end());
#define reverse(s) reverse(s.begin(), s.end());
#define P pair<int,int>
#define mp make_pair
#define valid(x,y,h,w) (0<=x&&x<h&&0<=y&&y<w)
//#define int ll
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
int ndx[8] = { 0,1,0,-1, 1,1,-1,-1 };
int ndy[8] = { 1,0,-1,0, 1,-1,-1,1 };
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }




int main() {
	string s, t;
	cin >> s >> t;
	cout << (s[0] == t[0]) + (s[1] == t[1]) + (s[2] == t[2]) << endl;
}

Measured memory_bytes: 256
/* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>

/* ---------- Namespace ---------- */
using namespace std;

/* ---------- Type ---------- */
using ll = long long;
#define int ll
#define P pair<ll, ll>

/* ---------- Constants  */
const ll MOD = 1e9 + 7;
const int INF = 1LL << 55;

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */
vector<int> manacher(string &str) {
    vector<char> newstr(2 * str.size() - 1);
    for (int i = 0; i < newstr.size(); i++) {
        if (i % 2 == 0) {
            newstr[i] = str[i / 2];
        } else {
            newstr[i] = '.'; // means spaces between characters
        }
    }

    vector<int> cnt(newstr.size());

    int i = 0;
    int j = 0;

    while (i < newstr.size()) {
        while (i - j >= 0 && i + j < newstr.size() && newstr[i - j] == newstr[i + j]) j++;
        cnt[i] = j;

        int k = 1;
        while (i - k >= 0 && i + k < newstr.size() && k + cnt[i - k] < j) {
            cnt[i + k] = cnt[i - k];
            k++;
        }

        i += k;
        j -= k;
    }

    for (int i = 0; i < cnt.size(); i++) {
        if (i % 2 == 1) {
            cnt[i] = 2 * ceil(1.0 * (cnt[i] - 1) / 2);
        } else {
            int side = ceil(1.0 * cnt[i] / 2) - 1;
            cnt[i] = side * 2 + 1;
        }
    }

    return move(cnt);
}

signed main() {
    string str;
    cin >> str;
    int N = str.size();

    map<char, int> m;
    map<char, int> :: iterator it;
    for (int i = 0; i < N; i++) {
        m[str[i]]++;
    }

    int paircnt = 0;

    for (it = m.begin(); it != m.end(); it++) {
        if (it->second >= 2) {
            paircnt += it-> second * (it->second - 1) / 2;
        }
    }

    cout << 1 + N * (N - 1) / 2 - paircnt << endl;

    return 0;
}

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


int main() {
	string s;
	cin >> s;
	int ans = 700;
	for (int i = 0;i < 3;++i) {
		if (s[i] == 'o')ans += 100;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
template <typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
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;
}

void print(const std::vector<ll> &v) {
    std::for_each(v.begin(), v.end(), [](ll x) { std::cout << x << " "; });
    std::cout << std::endl;
}
double to_deg(double r) { return r * 180.0 / (atan(1.0) * 4.0); }
ll N, K;
vector<ll> A;
vector<ll> F;
//めぐる式二分探索
// leftは常に条件を満たさない
// rightは常に条件を満たす
// right - left = 1になるまで

// index が条件を満たすかどうか
bool isOK(ll v) {
    // v時間で完食できるか
    ll sum = 0LL;
    REP(i, N) {
        ll ma = v / F[i];
        if(ma < A[i]) {
            sum += A[i] - ma;
        }
        if(sum > K) {
            return 0;
        }
    }
    return 1;
}

// 汎用的な二分探索のテンプレ
ll binary_search() {
    ll ng = -1; //「index = 0」が条件を満たすこともあるので、初期値は -1
    ll ok = INF; // 「index =
                 // a.size()-1」が条件を満たさないこともあるので、初期値は
                 // a.size()

    /* ok と ng のどちらが大きいかわからないことを考慮 */
    while(abs(ok - ng) > 1LL) {
        ll mid = (ok + ng) / 2LL;

        if(isOK(mid))
            ok = mid;
        else
            ng = mid;
    }
    return ok;
}

int main() {
    cin >> N >> K;
    // Kが合計の修行回数
    // Fは食べにくさ
    // Aは消化コスト
    // sum A[i] * F[j]を最小にする
    // FとAはソートして良さそう
    // N人のメンバーそれぞれが完食にかかる時間のうち最大値が、チーム全体の成績となる。
    A.resize(N);
    F.resize(N);
    REP(i, N) { cin >> A[i]; }
    sort(A.begin(), A.end());
    REP(i, N) { cin >> F[i]; }
    ll asum = accumulate(A.begin(), A.end(), 0LL);
    if(asum <= K) {
        cout << 0 << endl;
        return 0;
    }
    sort(F.begin(), F.end(), greater<ll>());
    cout << binary_search() << endl;
    return 0;
}

Measured memory_bytes: 3328
package main

import (
  "fmt"
  "sort"
)

func main() {
  var n int
  fmt.Scan(&n)
  a := make([]int, n)
  for i := 0; i < n; i++ {
    fmt.Scan(&a[i])
  }
  sort.Sort(sort.Reverse(sort.IntSlice(a)))
  var alice, bob int
  for i, v := range a {
    if i%2 == 0 {
      alice += v
    } else {
      bob += v
    }
  }
  fmt.Println(alice - bob)
}

Measured memory_bytes: 512
#include<iostream>
#include<string>
#include<vector>
#include<stdbool.h>
#include<numeric>
#include<math.h>
#include<algorithm>
#include<set>
#include<string>
#include<stdlib.h>
typedef long long ll;
using namespace std;

int main() {
	ll A, B, K;
	cin >> A >> B >> K;
	ll l = 0;
	l = B - A+1;
	if (l % 2 == 0) {
		if (K >= l / 2) {
			for (ll i = A;i <= B;i++) {
				cout << i << endl;
			}
			return 0;
		}
		else {
			for (ll i = A;i <= A + K - 1;i++) {
				cout << i << endl;
			}
			for (ll i = B - K + 1;i <= B;i++) {
				cout << i << endl;
			}
			return 0;
		}
	}
	else {
		if (K >= l / 2 + 1) {
			for (ll i = A;i <= B;i++) {
				cout << i << endl;
			}
			return 0;
		}
		else {
			for (ll i = A;i <= A + K - 1;i++) {
				cout << i << endl;
			}
			for (ll i = B - K + 1;i <= B;i++) {
				cout << i << endl;
			}
			return 0;
		}
	}
	return 0;
}
	

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

#define rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);++i)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;i>=(int)(m);--i)
#define REP(i,n) rep(i,0,n)
#define REP2(i,n) rep2(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll) 1e9 + 7;
//constexpr long long MOD = 998244353LL;
using ld=long double;
static const ld pi = 3.141592653589793L;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


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

struct Edge {
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
	to = _to; cap = _cap; rev = _rev;
	}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

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

    set<int> st;
    for(int i=0;i<26;i++) st.insert(i);

    ll n=s.size();
    REP(i,n){
        st.erase(s[i]-'a');
    }
    if(st.size()>0){
        s+=string(1,'a'+*(st.begin()));
        cout<<s<<en;
        return;
    }

    string ans=s;
    REP2(i,n){
        ans.pop_back();
        st.insert(s[i]-'a');
        auto it=st.upper_bound(s[i]-'a');
        if(it==st.end()) continue;
        ans+=string(1,'a'+*it);
        break;
    }
    if(ans.size()==0) cout<<-1<<en;
    else cout<<ans<<en;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
	
	solve();
	//ll t;cin>>t;REP(i,t) solve();

    return 0;
}

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

namespace AGC020A {
    class Program {
        static void Main(string[] args) {
            int[] input = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
            int A = input[1];
            int B = input[2];
            if((B - A) % 2 == 0) {
                Console.WriteLine("Alice");
            } else {
                Console.WriteLine("Borys");
            }
        }
    }
}

Measured memory_bytes: 13268
#include<bits/stdc++.h>
#define int long long
#define rg register
#define file(x) freopen(x".in","r",stdin);freopen(x".out","w",stdout);
using namespace std;
const int N=200000+10;
const int mod=1e9+7;
int read(){
    int x=0,f=1;char c=getchar();
    while(c<'0'||c>'9') f=(c=='-')?-1:1,c=getchar();
    while(c>='0'&&c<='9') x=x*10+c-48,c=getchar();
    return f*x;
}
int inv[N],jc[N];
int ksm(int a,int b){
	int ans=1;
	while(b){
		if(b&1) ans=ans*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return ans;
}
int C(int n,int m){
	return jc[n]*inv[m]%mod*inv[n-m]%mod;
}
int calc(int x,int y,int X,int Y){
	int n=abs(X-x),m=abs(Y-y);
	return C(n+m,n);
}
main(){
    //file("");
	jc[0]=1;
	for(int i=1;i<=N-10;i++)
		jc[i]=jc[i-1]*i%mod;
	inv[N-10]=ksm(jc[N-10],mod-2);
	for(int i=N-11;i>=0;i--)
		inv[i]=inv[i+1]*(i+1)%mod;
	int H=read(),W=read(),A=read(),B=read(),ans=calc(1,1,H,W);
	for(int i=H-A+1;i<=H;i++)
		ans=(ans-calc(1,1,i,B)*calc(i,B+1,H,W)%mod+mod)%mod;
	cout<<ans;
    return 0;
}


Measured memory_bytes: 3328
#include <iostream>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;

struct pos{
    int x;
    int l;
}p[100000];

bool cmp(pos p1,pos p2){
    return p1.x < p2.x;
}

int main(){

   int n,ans = 0;

   cin >> n;
   for(int i = 0;i < n;i++){
        cin >> p[i].x >> p[i].l;
   }
   sort(p,p+n,cmp);
   int d = p[0].x+p[0].l;
   for(int i = 1;i < n;i++){
        if(p[i].x-p[i].l<d){
            ans++;
            d = min(d,p[i].x+p[i].l);
        }
        else d = p[i].x+p[i].l;
   }
   cout << n-ans;
}


Measured memory_bytes: 1024
package main

import (
	"fmt"
	"strings"
)

func main() {
	var ans []string

	for {
		var H, W int
		fmt.Scan(&H, &W)

		if H+W == 0 {
			break
		}

		for i := 0; i < H; i++ {
			ans = append(ans, strings.Repeat("#", W))
		}
		ans = append(ans, "")
	}
	fmt.Println(strings.Join(ans, "\n"))
}



Measured memory_bytes: 1408