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

using P = pair<int, int>;
const int M = 1000000007;
int dd[5] = { 0, 1, 0, -1, 0 };

int main() {
    int h, w;
    char s, g;
    cin >> h >> w >> s >> g;
    int si = -1, sj = -1, gi = -1, gj = -1;
    vector<string> b(h);
    for (int i = 0; i < h; ++i) {
        cin >> b[i];
        for (int j = 0; j < w; ++j) {
            if (b[i][j] == s) {
                si = i;
                sj = j;
            }
            if (b[i][j] == g) {
                gi = i;
                gj = j;
            }
        }
    }
    vector<vector<int>> dist(h, vector<int>(w, M));
    dist[si + 1][sj] = 0;
    deque<P> dq;
    dq.push_back(P(si + 1, sj));
    while (!dq.empty()) {
        P p = dq.front();
        int i = p.first, j = p.second;
        dq.pop_front();
        if (i + 1 < h) {
            if ((b[i][j] == 'o' && b[i + 1][j] == 'o' || b[i][j] == '|' && b[i + 1][j] == '|') && dist[i + 1][j] > dist[i][j]) {
                dist[i + 1][j] = dist[i][j];
                dq.push_front(P(i + 1, j));
            }
            if ((b[i][j] == 'o' && b[i + 1][j] == '|' || b[i][j] == '|' && b[i + 1][j] == 'o') && dist[i + 1][j] > dist[i][j] + 1) {
                dist[i + 1][j] = dist[i][j] + 1;
                dq.push_back(P(i + 1, j));
            }
        }
        if (i > 0) {
            if ((b[i][j] == 'o' && b[i - 1][j] == 'o' || b[i][j] == '|' && b[i - 1][j] == '|') && dist[i - 1][j] > dist[i][j]) {
                dist[i - 1][j] = dist[i][j];
                dq.push_front(P(i - 1, j));
            }
            if ((b[i][j] == 'o' && b[i - 1][j] == '|' || b[i][j] == '|' && b[i - 1][j] == 'o') && dist[i - 1][j] > dist[i][j] + 1) {
                dist[i - 1][j] = dist[i][j] + 1;
                dq.push_back(P(i - 1, j));
            }
        }
        if (j + 1 < w) {
            if ((b[i][j] == 'o' && b[i][j + 1] == 'o' || b[i][j] == '-' && b[i][j + 1] == '-') && dist[i][j + 1] > dist[i][j]) {
                dist[i][j + 1] = dist[i][j];
                dq.push_front(P(i, j + 1));
            }
            if ((b[i][j] == 'o' && b[i][j + 1] == '-' || b[i][j] == '-' && b[i][j + 1] == 'o') && dist[i][j + 1] > dist[i][j] + 1) {
                dist[i][j + 1] = dist[i][j] + 1;
                dq.push_back(P(i, j + 1));
            }
        }
        if (j > 0) {
            if ((b[i][j] == 'o' && b[i][j - 1] == 'o' || b[i][j] == '-' && b[i][j - 1] == '-') && dist[i][j - 1] > dist[i][j]) {
                dist[i][j - 1] = dist[i][j];
                dq.push_front(P(i, j - 1));
            }
            if ((b[i][j] == 'o' && b[i][j - 1] == '-' || b[i][j] == '-' && b[i][j - 1] == 'o') && dist[i][j - 1] > dist[i][j] + 1) {
                dist[i][j - 1] = dist[i][j] + 1;
                dq.push_back(P(i, j - 1));
            }
        }
    }
    cout << dist[gi + 1][gj] / 2 << "\n";

    return 0;
}



Measured memory_bytes: 3212
#include <cstdio>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <set>
using namespace std;

const int MAXN = 100000 + 10;
int N, M;
struct seg {
    int l, r;
    bool operator < (const seg& s) const {
        return r < s.r;
    }
};
seg s[MAXN];

int main()
{
    cin >> N >> M;
    for (int i = 0; i < M; i++) {
        cin >> s[i].l >> s[i].r;
    }
    sort(s, s + M);

    int ans = 0;
    int left = 0;
    for (int i = 0; i < M; i++) {
        seg now = s[i];
        if (now.l < left) continue; 
        left = s[i].r;
        ans++;
    }

    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 1024
/*16D8101024H Muramatsu Masaki 村松 将希 mentuyu C++*/

#include<iostream>

int gcd(int a,int b){
  int r,tmp;
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }

  r = a % b;

  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}

int main(){
  int x,y,z;
  std::cin >> x >> y;
  z = gcd(x,y);
  std::cout<<z<<"\n";
  return 0;
}



Measured memory_bytes: 3096
h, w = map(int, input().split())
S = [list(input()) for i in range(h)]

def bombNumber(y, x):
    tmp = 0
    for dx in range(-1, 2):
        for dy in range(-1, 2):
            if x + dx == -1 or x + dx == w or y + dy == -1 or y + dy == h:
                continue

            if S[y + dy][x + dx] == "#":
                tmp = tmp + 1

    return(tmp)


for i in range(h):
    for j in range(w):
        if S[i][j] == ".":
            S[i][j] = str(bombNumber(i, j))

for i in range(h):
    print("".join(S[i]))

Measured memory_bytes: 3188
#include <iostream>

int main() {
	int n, k, s;
	std::cin >> n >> k >> s;

	constexpr int MaxS = 1e9;
	int dummy = (s == MaxS ? 1 : s + 1);
	std::cout << (k == 0 ? dummy : s) << std::endl;
	for (int i = 1; i < n; ++i)
		std::cout << (i < k ? s : dummy) << std::endl;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize ("Ofast")
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
using namespace __gnu_pbds;
using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
 
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<long long,long long> ii; 	
typedef complex<long double> com;

const ll mod = 1e9+7;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    ll n,k;
    cin >> n >> k;
    vector <ll> arr(n);
    for (int z=0;z<n;z++){
        cin >> arr[z];
    }
    vector <vector<ll>> dp(n,vector<ll>(k+1));
    for (int x=k-arr[0];x<=k;x++){
        dp[0][x] = 1;
    }
    for (int z=1;z<n;z++){
        vector <ll> pre(k+1);
        pre[0] = dp[z-1][0];
        pre[0] %= mod;
        for (int x=1;x<=k;x++){
            pre[x] += pre[x-1]+dp[z-1][x];
            pre[x] %= mod;
        }
        for (int x=0;x<=k;x++){
            if (x > 0) dp[z][x] = pre[min(x+arr[z],ll(k))]-pre[x-1];
            else dp[z][x] = pre[min(x+arr[z],ll(k))];
            dp[z][x] %= mod;
            if (dp[z][x] < 0) dp[z][x] += mod;
        }
    }
    cout << dp[n-1][0] << endl;
}

Measured memory_bytes: 79488
from sys import stdin


def main():
    n = int(stdin.readline())
    ar = map(int, stdin.readline().split())

    f = 0
    s = 0

    cf = 0
    cs = 0

    for idx, val in enumerate(ar):
        cf += val
        cs += val
        if idx % 2 == 0:
            if cf <= 0:
                f += 1 - cf
                cf = 1
            if cs >= 0:
                s += 1 + cs
                cs = -1
        else:
            if cs <= 0:
                s += 1 - cs
                cs = 1
            if cf >= 0:
                f += 1 + cf
                cf = -1
    print(min(s, f))


if __name__ == "__main__":
    main()


Measured memory_bytes: 59376
#include<iostream>
using namespace std;
int dp[10000000], n, m, r[10000000];
int main() {
	while (true) {
		cin >> n >> m; if (n == 0 && m == 0)break;
		for (int i = 0; i < 5000000 + 5 * m; i++)dp[i] = 0;
		for (int i = 0; i < 5000000 + 5 * m; i++)r[i] = i;
		for (int i = n; i < 2750; i++) {
			for (int j = i; j*j < 5000000 + 5 * m; j += i) {
				if (r[j] == 0)r[j] = i;
			}
		}
		int c = n;
		for (int i = 0; i < m; i++) {
			while (dp[c] == 1) c++;
			for (int j = c; j < 5000000 + 5 * m; j += r[c])dp[j] = 1;
		}
		while (dp[c] == 1) c++;
		cout << c << endl;
	}
	return 0;
}

Measured memory_bytes: 61608
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define INF (ll)1e18+7
#define md (ll)1e9+7
#define mk make_pair
#define pi pair<int,int>
#define pb emplace_back 
#define all(s) s.begin(),s.end()
#define fr(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define sz(x) ((long long)x.size())
#define mez(s) memset(s,0,sizeof s)
#define mex(s) memset(s,-1,sizeof s)
typedef vector<int> vi; 
typedef vector<ll>vl;
typedef map<int,int> mp;
typedef queue<int> que;
typedef vector<pi> vp;




void solve(){
int l,r,d;
cin>>l>>r>>d;
int a=l/d;
int b=r/d;
if(l%d==0)
b++;
cout<<b-a<<"\n";




}



int main(){
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
ios::sync_with_stdio(false);
cin.tie(0);
   int t=1;
  //cin>>t;
     while(t--){
     	solve();
	 }
     return 0;
}

Measured memory_bytes: 3684
/* 
Hey there stalker....
 
█▀▀▄░░░░░░░░░░░▄▀▀█
░█░░░▀▄░▄▄▄▄▄░▄▀░░░█
░░▀▄░░░▀░░░░░▀░░░▄▀
░░░░▌░▄▄░░░▄▄░▐▀▀
░░░▐░░█▄░░░▄█░░▌▄▄▀▀▀▀█ 
░░░▌▄▄▀▀░▄░▀▀▄▄▐░░░░░░█
▄▀▀▐▀▀░▄▄▄▄▄░▀▀▌▄▄▄░░░█
█░░░▀▄░█░░░█░▄▀░░░░█▀▀▀
░▀▄░░▀░░▀▀▀░░▀░░░▄█▀
░░░█░░░░░░░░░░░▄▀▄░▀▄
░░░█░░░░░░░░░▄▀█░░█░░█
░░░█░░░░░░░░░░░█▄█░░▄▀
░░░█░░░░░░░░░░░████▀
░░░▀▄▄▀▀▄▄▀▀▄▄▄█▀
 
Like what you see?
*/
#include <bits/stdc++.h>
using namespace std;
 
#define fastIO ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define endl '\n'
#define ld long double
#define lli long long int
#define p_b push_back
#define m_p make_pair
#define fs first
#define sc second
#define all(x) x.begin(),x.end()
#define fr(i,a,n) for(lli i=a; i<n; i++)
#define fre(i,a,n) for(lli i=a; i<=n; i++)
const lli mod = 1e9 + 7;
/*****************************************************/
int main()
{
    fastIO
    lli n,i;
    cin>>n;
    lli h[n+1],tab[n+1]={0};
    fre(i,1,n)
        cin>>h[i];
    tab[1]=0;
    tab[2]=abs(h[2]-h[1]);
    for(i=3;i<=n;i++)
        tab[i]=min(tab[i-1]+abs(h[i]-h[i-1]),tab[i-2]+abs(h[i]-h[i-2]));
    cout<<tab[n];
    //cerr<< '\n' << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms\n" ;
    return 0;
} 

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

using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#define LD long double
#define FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

template<class C> void mini(C& _a4, C _b4) { _a4 = min(_a4, _b4); }
template<class C> void maxi(C& _a4, C _b4) { _a4 = max(_a4, _b4); }

template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}

template<class T> ostream& operator<<(ostream& os, vector<T> V) {
  os << "["; for (auto& vv : V) os << vv << ","; os << "]";
  return os;
}

#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif

// int find(int a){
//   return f[a] == a ? a : f[a] = find(f[a]);
// }
// void uni(int a,int b){
//   
// }


#define MAX 100101
int n,m,t[MAX],s[MAX];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  cerr << fixed << setprecision(6);
  cin >> n >> m;
  R(i,n){
    cin >> t[i];
  }
  t[n] = 1e9;
  R(i,m){
    cin >> s[i];
  }
  s[m] = 1e9;
  sort(t,t+n);
  sort(s,s+m);
  int i = 0;
  int j = 0;
  int res = 0;
  while(i != n || j != m){
    if(t[i] < s[j]){
      res += t[i] * (m - j + 1);
      i++;
    }else{
      res += s[j] * (n - i + 1);
      j++;
    }
  }
  cout << res << endl;
}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define REP(i, n) for (int i=0, i##_len=(n); i<i##_len; ++i)
#define FOR(i, a, b) for (int i=(a); i<(b); ++i)
using ll = long long;
using namespace std;

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

    bool colors[N];
    REP(i, N) colors[i] = (S[i] == '#'); // T->B F->W

    ll b = 0;
    ll w = 0;

    REP(i, N) if (!colors[i]) ++w;
    ll ret = w;

    REP(i, N)
    {
        if (colors[i]) ++b;
        else --w;
        ret = min(ret, w+b);
    }

    cout << ret << endl;
    return 0;
}


Measured memory_bytes: 772
a_list = []
for i in range(3):
    a = list(map(int, input().split()))
    a_list.append(a)
n = int(input())
b = []
for i in range(n):
    b.append(int(input()))

for i in range(n):
    for j in range(3):
        if (b[i] in a_list[j]):
            a_list[j][a_list[j].index(b[i])] = 'ok'

yn = 'No'
for i in range(3):
    if a_list[i] == ['ok', 'ok', 'ok']:
        yn = 'Yes'
for i in range(3):
    if a_list[0][i] == 'ok' and a_list[1][i] == 'ok' and a_list[2][i] == 'ok':
        yn = 'Yes'
if a_list[0][0] == 'ok' and a_list[1][1] == 'ok' and a_list[2][2] == 'ok':
    yn = 'Yes'
if a_list[0][2] == 'ok' and a_list[1][1] == 'ok' and a_list[2][0] == 'ok':
    yn = 'Yes'

if yn == 'Yes':
    print('Yes')
else:
    print('No')

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

using namespace std;

#define int long long
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define bitcnt __builtin_popcount
#define SZ(x) ((ll)(x).size())
#define fi first
#define se second
#define All(a) (a).begin(), (a).end()
#define rAll(a) (a).rbegin(), (a).rend()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CCIN(...)                                                              \
    char __VA_ARGS__;                                                          \
    CIN(__VA_ARGS__)
#define DCIN(...)                                                              \
    double __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"
#define Printv(v)                                                              \
    {                                                                          \
        FOREACH(x, v) { cout << x << " "; }                                    \
        cout << "\n";                                                          \
    }
template <typename T = string> inline void eputs(T s) {
    cout << s << "\n";
    exit(0);
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    std::fill((T *)array, (T *)(array + N), val);
}
template <typename T> using PQG = priority_queue<T, vector<T>, greater<T>>;
template <typename T> using PQ = priority_queue<T>;

typedef long long ll;
typedef pair<ll, ll> PL;
typedef vector<PL> VPL;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<double> VD;

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
const double PI = atan(1.0) * 4.0;
const ll dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
#define PI 3.141592653589793238

void cinfast() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}


signed main() {
    LCIN(N);
    cout << (ll)pow(N, 3) << "\n";
}

Measured memory_bytes: 256
#include <stdio.h>
#define SECTIONS 10

/*

QäÌßÃ­¬xÍ(v1+v2)B
^[~iwÔÌLðlÆ·êÎA·êá¤tÍ

t=l/(v1+v2)

ÈÌÅA»ÌÌdÔÌÊuÍ

v1/(v1+v2) * l

*/

int main(void){
	int d[SECTIONS+1], v1, v2, pos, i;
	
	while(1){
		for(i=1; i<=SECTIONS; i++) if(scanf("%d%*c",&d[i])==EOF) return 0;	/* ZNV· */
		for(i=2; i<=SECTIONS; i++) d[i]+=d[i-1];	/* ZNVÌIíéÊu */
		scanf("%d,%d",&v1,&v2);
		
		i=1;
		while((double)d[SECTIONS]*v1/(v1+v2) > d[i]) i++;
		
		printf("%d\n",i);
	}
}

Measured memory_bytes: 0
n = int(input())
zero = 0
two = 0
four = 0
for i in map(int, input().split()):
  if i % 4 == 0:
    four += 1
  elif i % 2 == 0 and i % 4 != 0:
    two += 1
  else :
    zero += 1
flag = True
if zero > four:
  flag = False
  if zero == four + 1 and two == 0:
    flag = True

print('Yes' if flag else 'No')

Measured memory_bytes: 11480
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace()
    .map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
    use std::cmp::*;
    loop {
        let v: Vec<i32> = read_vec();
        let (x,y) = (v[0],v[1]);
        if x == 0 && y == 0 {
            break;
        }
        println!("{} {}", min(x,y), max(x,y));
    }
}


Measured memory_bytes: 5044
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
)

func main() {
	s := " " + getString()
	t := " " + getString()

	dp := make([][]int, len(s))
	for i := 0; i < len(s); i++ {
		dp[i] = make([]int, len(t)+1)
	}

	for i := 1; i < len(s); i++ {
		for j := 1; j < len(t); j++ {
			if s[i] == t[j] {
				dp[i][j+1] = dp[i-1][j] + 1
			} else {
				dp[i][j+1] = max(dp[i-1][j+1], dp[i][j])
			}
		}
	}

	ans := ""
	i := len(s) - 1
	j := len(t)
	for ; ; {
		if s[i] == t[j-1] {
			ans += string(s[i])
			i--
			j--
		} else {
			if dp[i-1][j] < dp[i][j-1] {
				j--
			} else {
				i--
			}
		}

		if dp[i][j] == 0 {
			break
		}
	}

	fmt.Println(reverse(ans))
}

type Graph struct {
	n     int
	edges [][]int
}

func NewGraph(n int) *Graph {
	g := &Graph{
		n:     n,
		edges: make([][]int, n),
	}
	return g
}

func (g *Graph) AddEdge(u, v int) {
	g.edges[v] = append(g.edges[v], u)
	g.edges[u] = append(g.edges[u], v)
}

func dfs(c int, edges [][]int, visited map[int]struct{}) {
	visited[c] = struct{}{}

	for _, v := range edges[c] {
		_, flag := visited[v]
		if flag {
			continue
		}
		dfs(v, edges, visited)
	}
}

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func powMod(n, p int) int {
	if p == 0 {
		return 1
	} else if p%2 == 0 {
		t := powMod(n, p/2)
		return calcMod(t * t)
	} else {
		return n * powMod(n, p-1)
	}
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func printIntArray(array []int) {
	strArray := fmt.Sprint(array)
	fmt.Println(strArray[1 : len(strArray)-1])
}

func calcMod(x int) int {
	return x % mod
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}


Measured memory_bytes: 80640
#include<stdio.h>
#include<string.h>
//#include<stdlib.h>
#include<math.h>
#define N 20 

int main(void){
  long A,V,B,W,T;
  scanf("%ld %ld",&A,&V);
  scanf("%ld %ld",&B,&W);
  scanf("%ld",&T);
  //printf("%ld %ld %ld %ld %ld\n",A,V,B,W,T);
  if(W >= V){
    printf("NO\n");
  }else if(labs(A - B) <= labs(W - V) * T){
    printf("YES\n");
  }else{
      printf("NO\n");
    }
  return 0;
}

Measured memory_bytes: 1600
#include <iostream>
#include <math.h>

using namespace std;

class Point
{
private:
  double x;
  double y;
public:
  void setX(double x);
  void setY(double y);
  double getX();
  double getY();
};

void Point::setX(double a) {
  x = a;
}

void Point::setY(double a) {
  y = a;
}

double Point::getX() {
  return x;
}

double Point::getY() {
  return y;
}

int main() {
  double px, py, qx, qy;
  Point p, q;
  cin >> px >> py >> qx >> qy;
  p.setX(px);
  p.setY(py);
  q.setX(qx);
  q.setY(qy);
  cout << fixed << sqrt(pow(p.getX()-q.getX(), 2)+pow(p.getY()-q.getY(), 2)) << endl;
  return 0;
}

Measured memory_bytes: 1284
#include"bits/stdc++.h"
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;

void Main() {
    int n, k; cin >> n >> k;
    string s; cin >> s;
    
    vi ruiseki = {0, 0};
    
    rep(i, n){
        if(i == n-1 || s[i] != s[i+1]){
            ruiseki.pb(i+1);
        }
    }
    
    ruiseki.pb(n);
    
    /*
    for(auto x : ruiseki) cout << x << " ";
    cout << endl;
    //*/
    
    int r = ruiseki.size();
    int d = 2 * k + 1;
    int ans = 0;
    
    if(s[0] == '0'){
        if(d >= r) ans = n;
        else{
            for(int i = 0; i + d < r; i += 2){
                int temp = ruiseki[i + d] - ruiseki[i];
                // cout << temp << endl;
                ans = max(ans, temp);
            }
        }
    }else{
        if(d >= r - 2) ans = n;
        else{
            for(int i = 1; i + d < r; i += 2){
                int temp = ruiseki[i + d] - ruiseki[i];
                // cout << temp << endl;
                ans = max(ans, temp);
            }
        }
    }
    
    cout << ans << endl;
    return;
}

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


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

#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,n) for (int i = 0; i < n; i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb(x) push_back(x)

using namespace std;

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

int n, m, k, res;
char c[10][10];

int main () {
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	cin >> n >> m >> k;
	forn (i, n) cin >> c[i];

	for (int x = 0; x < (1 << n); x++)
		for (int y = 0; y < (1 << m); y++) {
			int cn = 0;
			forn (i, n) forn (j, m) if (!(x & (1 << i)) && !(y & (1 << j))) 
				cn += c[i][j] == '#';
			res += cn == k;
		}

		cout << res << endl;

	return 0;
}


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

ll modex(ll x,ll n,ll m)
{
	ll res=1;
	while(n>0)
	{
		if(n&1)
			res=(res*x)%m;
		x=(x*x)%m;
		n=n/2;
	}
	return res;
}
int main()
{

	ios_base::sync_with_stdio(0);
	cout.tie(0);
	cin.tie(0);

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


    ll x,y,sum=0,k=1,k1=1,k2=1,m=1e9+7,a=0,b=0,f=1;
    cin>>x>>y;
    if((2*x-y)%3==0)
    {
    	a=(2*x-y)/3;
    	b=x-2*a;
    	if(a>=0&&b>=0)
    	f=0;
    }
    if(!f)
    {
    for(ll i=1;i<=a+b;i++)
    	k=(k*i)%m;
    for(ll i=1;i<=a;i++)
    	k1=(k1*modex(i,m-2,m))%m;
    for(ll i=1;i<=b;i++)
    	k2=(k2*modex(i,m-2,m))%m;
}
    if(f==1)
    	cout<<0<<endl;
    else
    {
    	sum=(((k*k1)%m)*k2)%m;
    cout<<sum<<endl;
}



	
	
}


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

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

int main(){
	int a,d;
	long int n, ans;
	while(std::cin >> a >> d >> n && (a || d || n)){
		long int i=0;
		while(n){
			int count=0;
			ans = a + (i*d);
			i++;
			rep(j,sqrt(ans)+1){
				if (ans == 2 || ans == 3 || ans == 5)
					continue;
				else if(ans % (j + 2) == 0)
				{
					count = 1;
					break;
				}
			}
			if(count == 0 && ans != 1){
				n--;
			}
		}
		std::cout << ans << std::endl;
	}
	return 0;
}

Measured memory_bytes: 868
def lcs(X, Y):
	m = len(X)
	n = len(Y)
	c = [0 for i in range(n+1)]
	for i in range(m):
		pre_c = c[:]
		XX = X[i]
		for j in range(n):
			if XX == Y[j]:
				c[j+1] = pre_c[j] + 1
			elif c[j + 1] < c[j]:
				c[j+1] = c[j]
	return c[-1]

if __name__ == "__main__":
	q = int(input())
	for _ in range(q):
		X = input()
		Y = input()
		print(lcs(X, Y))


Measured memory_bytes: 5632
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

void solve(int n){
    int x[n+1],y[n+1];
    rep(i,n){
        cin>>x[i]>>y[i];
        x[i]+=2000;
    }
    x[n]=x[0];y[n]=y[0];
    double sum = 0;
    rep(i,n)sum+=(x[i]*y[i+1]-x[i+1]*y[i]);
     if(sum<0){
        reverse(x,x+n+1);
        reverse(y,y+n+1);
    }
    vector<vector<int>> v(4001),w(4001);
    rep(i,n){
        if(x[i]==x[i+1])continue;
        bool sp=(x[i]>x[i+1]);
        if(sp){
            swap(x[i],x[i+1]);
            swap(y[i],y[i+1]);
        }
        REP(xx,x[i],x[i+1]){
            int yy=-1;
            if(y[i+1]>y[i]){
                if(!sp)yy = y[i]+ ((y[i+1]-y[i])*(xx-x[i]))/(x[i+1]-x[i]) ;
                else yy = y[i]+ ((y[i+1]-y[i])*(xx+1-x[i])-1)/(x[i+1]-x[i]) ;
            }
            else if(y[i+1]<y[i]){
                if(!sp)yy = y[i+1]+ ((y[i]-y[i+1])*(x[i+1]-xx-1))/(x[i+1]-x[i]) ;
                else yy = y[i+1]+ ((y[i]-y[i+1])*(x[i+1]-xx)-1)/(x[i+1]-x[i]) ;
            }
            else if(sp){
                yy = y[i]-1;
            }
            else yy = y[i];
            
            if(sp)v[xx].push_back(yy);
            else w[xx].push_back(yy);
        }
        if(sp){
            swap(x[i],x[i+1]);
            swap(y[i],y[i+1]);
        }
    }
    int ans = 0;
    rep(i,4001){
        sort(v[i].rbegin(),v[i].rend());
        sort(w[i].rbegin(),w[i].rend());
        v[i].push_back(-inf);
        rep(j,w[i].size()){
            ans+=v[i][j]-max(w[i][j]-1,v[i][j+1]);
        }
    }
    cout<<ans<<endl;
}

int main(){
    int n;
    while(cin>>n,n)solve(n);
    return 0;
}


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

int main()
{
	long long n, a, b, ans;
	cin >> n >> a >> b;
	long long temp = n / (a + b);
	n -= temp * (a + b);
	if(n <= a)
		ans = temp * a + n;
	else 
		ans = (temp + 1) * a;
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define C 100003
using namespace std;
 
int main()
{
   int x,y;
   cin >> x >> y;
   int l=2*x,h=4*x;
   if(y%2==0 && y>=l && y<=h)
   {
       cout << "Yes";
   }
   else cout << "No";
}

Measured memory_bytes: 3624
#pragma GCC optimize ("O2")
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-label"
#pragma GCC diagnostic ignored "-Wsign-compare"

#include <bits/stdc++.h>
using namespace std;

#define trav(a, A) for (auto & a : A)
#define f first
#define s second

typedef long long ll;

const ll MOD = 998244353;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const int INF = 0x3f3f3f3f;
const ll MAXN = 2e+5+7;

ll ft[MAXN];
void update(int i, ll v){
    for (; i <= MAXN; i += i & -i) ft[i] += v, ft[i] %= MOD;
}

ll get(int i){
    ll ans = 0;
    for (; i > 0; i -= i  & -i) ans += ft[i], ans%= MOD;
    return ans;
}

void solve(){
	int n, k;
	cin >> n >> k;
	vector<pair<int, int>> seg(k);
	for (auto &a: seg) cin >> a.first >> a.second;
	sort(seg.begin(), seg.end());
	update(1, 1);
	for (int i = 2; i <= n; ++i){
		for (int j = 0; j < k; ++j){
			ll l = seg[j].f, r = seg[j].s;
			if (l > i) break;
			if (i >= l and i > r){
				update(i, (get(i - l) - get(i - r - 1) + MOD)%MOD);
			}
			else if (i <= r and i >= l) update(i, (get(i - l)+MOD)%MOD);
		}
	}
	cout << (get(n) - get(n-1)+MOD)%MOD << '\n';
}

int main ()
{
	ios_base::sync_with_stdio (0);
	cin.tie (0);
	ll tc = 1; //cin >> tc;
	while (tc--)
	{
		solve();
	}

	return 0;
}




Measured memory_bytes: 5172
#include<stdio.h>

int main(void)
{
	char S[100];
	int i,count=0;
	long int K;
	
	scanf("%s",S);
	scanf("%ld",&K);
	
	for(i=0;i<K;i++){
		if(S[i]!='1'){
			printf("%c\n",S[i]);
			return 0;
		}
	}
	
	printf("1\n");
	
	return 0;
}

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

int main() {
    int A,B,C;
    cin>>A>>B>>C;
    if((A<C&&C<B)||(B<C&&C<A)){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
return 0;}
/*compile
g++ code.cpp
./a.out
run*/

Measured memory_bytes: 256
// Problem : A - Not
// Contest : AtCoder - AtCoder Beginner Contest 178
// URL : https://atcoder.jp/contests/abc178/tasks/abc178_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

// Macros

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long
#define db long double
#define pb push_back
#define eb emplace_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 fi first
#define se second
#define all(a) (a).begin(), (a).end()
#define sz(x) (int) x.size()
#define mod 1000000007
#define EPS 1e-9
#define inf 1e10
#define PI acos(-1.0)
#define int long long
#define N 100005

// Solution

void solve() {
  int x;
  cin >> x;
  cout << (int)(x == 0);
}

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  // freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);

  int tests;
  tests = 1;
  // cin>>tests;

  for (int test = 1; test <= tests; test++) {
    // cout<<"Case #"<<test<<": ";
    solve();
  }

  return 0;
}

Measured memory_bytes: 3576
#include<bits/stdc++.h>
using namespace std;
signed main(){
    int N; cin >> N;
    using tp = tuple<int,int>;
    vector<tp>ans;
    for(int i = 1; i <= N; ++i){
        int nvalid = N - i + (N % 2 == 0);
        for(int v = 1; v <= N; ++v){
            if(v == i or v == nvalid)continue;
            int mini = min(v,i);
            int maxi = max(v,i);
            if(find(ans.begin(), ans.end(),tp(mini,maxi)) != ans.end())continue;
            ans.emplace_back(mini,maxi);
        }
    }
    cout << ans.size() << endl;
    for(auto p : ans){
        cout << get<0>(p) << " " << get<1>(p) << endl;
    }
}


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

using namespace std;


int main(){
    long long x;
    cin >> x;
    for(long long i = -120; i <= 120; i++){
        for(long long j = -120;j <= 120; j++){
            if(pow(i, 5) - pow(j, 5) == x){
                cout << i << ' ' << j << '\n';
                return 0;
            }
        }
    }
}

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

using namespace std;

int main(){
 int N,Q;
 cin >> N >> Q;
 string S;
 cin >> S;

 vector<int> l(Q);
 vector<int> r(Q);

 for(int i = 0; i < Q; i++) cin >> l[i] >> r[i];
  int ans = 0;
 vector<int> sum(N + 1,0);
 for(int i = 0; i < N; i++){
   if(S[i] == 'A' && S[i + 1] == 'C') sum[i + 1] = sum[i] + 1;
   else sum[i + 1] = sum[i]; 
 }


 for(int q = 0; q < Q; q++){
   cout << sum[r[q] - 1] - sum[l[q] - 1] << endl;
 }



 return 0;
}





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

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

  for(int i = 0; i < n; i++){
    int x, y, b, p;
    cin >> x >> y >> b >> p;

    int ans = x * b + y * p;

    for(int b_use = b; b_use <= 6; b_use++){
      for(int p_use = p; p_use <= 6; p_use++){
        int price = x * b_use + y * p_use;

        //割引適用
        if(5 <= b_use && 2 <= p_use){
          price = price * 80 / 100;
        }

        ans = min(ans, price);
      }
    }

    cout << ans << endl;
  }
}

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

typedef struct _Node {
  int key;
  struct _Node *next, *prev;
} Node;

Node *nil;

Node* listSearch(int key) {
  Node *cur = nil->next;
  while(cur != nil && cur->key != key) {
    cur = cur->next;
  }
  return cur;
}

void init(void) {
  nil = (Node *)malloc(sizeof(Node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(void) {
  Node *cur = nil->next;
  int isf = 0;
  while(1) {
    if(cur == nil) break;
    if(isf++>0) printf(" ");
    printf("%d",cur->key);
    cur = cur->next;
  }
  printf("\n");
}

void deleteNode(Node *t) {
  if(t==nil) return;
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}

void deleteFirst(void) {
  deleteNode(nil->next);
}

void deleteLast(void) {
  deleteNode(nil->prev);
}

void deleteKey(int key) {
  deleteNode(listSearch(key));
}

void insert(int key) {
  Node *x = (Node *)malloc(sizeof(Node));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
}

int main(void) {
  int key, n, i;
  char com[20];
  scanf("%d", &n);
  init();
  for(i=0;i<n;i++) {
    scanf("%s%d",com, &key);
    if (com[0] == 'i') insert(key);
    else if(com[0] == 'd') {
      if(strlen(com) > 6) {
        if(com[6] == 'F')
          deleteFirst();
        else if(com[6] == 'L') deleteLast();
      } else deleteKey(key);
    }
  }
  printList();
  return 0;
}


Measured memory_bytes: 33016
#include<string.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<stack>
#include<set>
#include<map>
#define lli long long int
#define ULTRA_INSTINCT ios_base::sync_with_stdio(false); cin.tie(0)
#define fo(i,n) for(int i=0;i<(n);i++)
using namespace std;
const int MAXN = 1e6 + 5;
int spf[MAXN];

int a[MAXN];
    int n;
void sieve(){ 
    spf[1] = 1; 
    for (int i=2; i<MAXN; i++) 
        spf[i] = i; 
    for (int i=4; i<MAXN; i+=2) 
        spf[i] = 2; 
    for (int i=3; i*i<MAXN; i++){ 
        if (spf[i] == i){ 
            for (int j=i*i; j<MAXN; j+=i)   
                if (spf[j]==j) 
                    spf[j] = i; 
        } 
    } 
}

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

bool is_done(){
    map<int,int> mp;
    fo(i,n){
        int ele = a[i];
        set<int> here;
        while (ele != 1){
            here.insert(spf[ele]);
            ele = ele/spf[ele];
        }
        for(int fac : here){
            // cout<<"fac "<<fac<<" "<<a[i]<<endl;
            if(mp[fac] >= 1){
                return false;
            }
            mp[fac] = 1;
        }
    }
    return true;
}
void solve(){
    cin>>n;
    fo(i,n){
        cin>>a[i];
    }
    int g = a[0];
    for(int i = 1;i<n;i++){
        g = gcd(g , a[i]);
    }
    if(g != 1){
        cout<<"not coprime\n";return;
    }
    sieve();
    if( is_done()){
        cout<<"pairwise coprime\n"; return;
    }
    cout<<"setwise coprime\n";

}

int main(){
    ULTRA_INSTINCT;
    int t =1;
    // cin>>t;
    while(t--){
        solve();
    }

    return 0;
}

Measured memory_bytes: 11528
// Do you knOW what it feels like?

		// To be TorTured by your own MinD?
	
	// I don't wanna feel the PAIN.

// I BeG you to KILL me, pleASE...

#include <bits/stdc++.h>
using namespace std;

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("Os") 

#define F first
#define S second
#define pb push_back
#define SZ(x) (ll)(x.size())
#define all(x) x.begin(),x.end()
#define mp make_pair

typedef long long ll;
typedef pair<ll,ll> pll;
typedef long double ld;

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll maxn=1e5+10, lg=23, mod=1e9+7, inf=1e18;

ll n,k,ans=0;
ll f[maxn];
vector<ll> son[maxn];
set<pll> dep;

void dfs(ll v=1,ll h=0){
	dep.insert({h,v});
	for(auto u:son[v]) dfs(u,h+1);
}

bool mk[maxn];
void dfb(ll v,ll h){
	if(mk[v]) return;
	mk[v]=1;
	dep.erase({h,v});
	for(auto u:son[v]) dfb(u,h+1);
}

void mak(ll v,ll h){
	for(int i=0;i<k-1;i++) v=f[v], h--;
	//cout<<v<<' '<<h<<endl;
	dfb(v,h);
	ans++;
}

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

	cin>>n>>k;
	for(int i=1;i<=n;i++){
		cin>>f[i];
		if(i>1) son[f[i]].pb(i);
	}
	if(f[1]!=1) f[1]=1, ans++;
	dfs();
	while(!dep.empty()){
		auto x=*(--dep.end());
		if(x.F<=k) break;
		mak(x.S,x.F);
	}
	cout<<ans<<endl;

	return 0;
}








 






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





int main() {
  int a,b,c;
  cin>>a>>b>>c;
  
  if (a==b){
    cout<<c<<endl;
  }
  else {
    if (b==c){
      cout<<a<<endl;
    }
    else {
      cout<<b<<endl;
    }
  }
  
  
}

  













Measured memory_bytes: 256
function Main(input) {

  input = input.split("");
  // input = input.split("\n");
  // tmp = input[1].split(" ");

  // var a = parseInt(input[0], 10);
  // var b = parseInt(tmp[0], 10);
  // var c = parseInt(tmp[1], 10);
  // var s = input[2];

  // Convert String to Integer
  // var a = ~~input[0];
  // var b = ~~input[1];


  var Sunuke = function(input){
    this.masu = input;
  };

  Sunuke.prototype = {
    putBall : function(){
      var count = 0;
      for(var masume of this.masu){
        if(masume == '1'){
          ++count;
        }
      }
      return count;
    }
  }
    var sunuke = new Sunuke(input);
    console.log(sunuke.putBall());

    // console.log('%d %d',N,Q);

  }


  Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7372
import sys
sys.setrecursionlimit(10 ** 7)
from functools import lru_cache

n = int(input())
ans = []

if n == 1:
    print('a')
    exit()

@lru_cache(None)
def rec(before, depth, MAX):
    for i in range(MAX-ord('a') +2):
        tmp = before + chr(ord('a') + i)
        if len(tmp) >= n:
            ans.append(tmp)
        else:
            MAX = max(MAX, ord(tmp[-1]) )
            rec(tmp, depth+1, MAX)


rec('a',1, ord('a'))

ans.sort()

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


Measured memory_bytes: 22904
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
 
inline int read()
{
	int sum=0,ff=1; char ch=getchar();
	while(!isdigit(ch))
	{
		if(ch=='-') ff=-1;
		ch=getchar();
	}
	while(isdigit(ch))
		sum=sum*10+(ch^48),ch=getchar();
	return sum*ff;
}
 
int n,x,y,dis[100005];
 
int main()
{
	n=read();
	x=read();
	y=read();
	for ( int i=1;i<=n;i++ ) 
		for ( int j=i+1;j<=n;j++ ) 
		{
			int d=min(j-i,abs(i-x)+abs(j-y)+1);
			dis[d]++;
		}
	for ( int i=1;i<n;i++ ) printf("%d\n",dis[i]);
	return 0;
}

Measured memory_bytes: 256
// https://atcoder.jp/contests/abcXXX/tasks/abcXXX_x

#include <iostream>
#include <vector>
#include <tuple>
#include <bitset>

using namespace std;
using ll = long long;
using ull = unsigned long long;

struct C1 {
    ll G_{};
    ll D_{};
    vector<ll> P_{};
    vector<ll> C_{};
    ll min_solved_{INT64_MAX};
    explicit C1(ll G, vector<pair<ll,ll>> v) : G_(G) {
        D_ = v.size();
        P_.reserve(D_);
        C_.reserve(D_);
        for (auto&&p : v) {
            P_.emplace_back(p.first);
            C_.emplace_back(p.second);
        }
    }
    ll resolve() {
        for(ull l=0; l < 1 << D_; ++l) {
            bitset<10> solved_problems{l};
            int special_problem{-1};  // index of the problem not completely solved
            for(int j=0; j <= solved_problems.size(); j++) {
                if (j == solved_problems.size()) {
                    special_problem = -1;
                } else if (solved_problems[j]) {
                    special_problem = j ;
                } else {
                    continue;
                }

                ll solved_score_other_than_one = 0;
                ll solved_count_other_than_one = 0;
                for(int i=0; i < solved_problems.size(); ++i) {
                    if (i == special_problem) {
                        continue;
                    }
                    if (solved_problems[i]) {
                        solved_score_other_than_one += (i+1) * 100 * P_[i] + C_[i];
                        solved_count_other_than_one += P_[i];
                    }
                }
                for(ll num_solved = 0; num_solved <= (special_problem >= 0 ? P_[special_problem] : 0); num_solved++) {
                    if (solved_score_other_than_one + (special_problem + 1) * 100 * num_solved >= G_) {
                        min_solved_ = min(min_solved_, solved_count_other_than_one + num_solved);
                        break;
                    }
                }
            }
        }
        return min_solved_;
    }
};

int main() {
    ll D, G;
    cin >> D >> G;
    vector<pair<ll, ll>> v{};
    for (int i=0; i < D; ++i) {
        ll p, c;
        cin >> p >> c;
        v.emplace_back(p,c);
    }
    C1 c{G, move(v)};
    cout << c.resolve() << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  string s;
  cin >> s;
  if (s.at(2) == s.at(3) && s.at(4) == s.at(5))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
 
public class Main {
    static char[] alps = "abcdefghijklmnopqrstuvwxyz".toCharArray();
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        dfs(0,"",0,n);
    }
    
    public static void dfs(int max, String s, int len, int n){
        if(len == n){
            System.out.println(s);
            return;
        }
        for(int i = 0; i < max+1; i++){
            String tmp = s + alps[i];
            if(i == max){
                dfs(max+1,tmp,len+1,n);
            }else{
                dfs(max,tmp,len+1,n);
            }
        }
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

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

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

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

    public double nextDouble() {
         return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}


Measured memory_bytes: 45176
#include <bits/stdc++.h>
using namespace std;
#define N_PRIME 1000000007
#define ll int64_t


int main(void){
    int h,w;
    cin >> h >> w;
    bool mat[10][10];
    
    for(int i = 0 ; i < 10 ; i++ ){
        for(int j = 0 ; j < 10 ; j++ ){
            mat[i][j] = false;
        }
    }
    
    for(int i = 0 ; i < h ; i++ ){
        string s;
        cin >> s;
        
        for(int j = 0 ; j < w ; j++ ){
            // #がtrue
            mat[j+1][i+1] = s[j] == '#';
        }
    }
    
    
    int x = 1;
    int y = 1;
    
    while(true){
        if( x == w && y == h ){
            mat[x][y] = false;
            break;
        }
        if( x > w || y > h ){
            break;
        }
        
        if( mat[x+1][y] ){
            mat[x][y] = false;
            x++;
            
        }else if(mat[x][y+1] ){
            mat[x][y] = false;
            y++;
        }else{
            break;
        }
        
    }
    
    for(int i = 1 ; i <= w ; i++ ){
        for(int j = 1 ; j <= h ; j++ ){
            if( mat[i][j] ){
                cout << "Impossible" << endl;
                return 0;
            }
        }
    }
    
    cout << "Possible"<< endl;
    
    
    
    
    
    
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <functional>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <deque>
#include <ctime>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define pb push_back
#define mp make_pair
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second
#define println(X) cout<<X<<endl;
#define DBG(X) cout<<#X<<" : "<<X<<endl;
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<ll, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;
const double PI = acos(-1);

int main(){
	int d, e;
	while(cin>>d>>e && d && e){
		double ans = 1e18;
		for(int x = 0; x <= d / 2; x++){
			int y = d - x;
			ans = min(ans, abs(sqrt(x*x+y*y) - e));
		}
		printf("%.15lf\n", ans);
	}
}

Measured memory_bytes: 1196
#include<iostream>
#include<vector>
#include<queue>
#include<functional>
#include<boost/optional.hpp>

template<class T>using p_queue = std::priority_queue<T, std::vector<T>, std::greater<>>;

int main()
{
	p_queue<std::uint64_t> queue;
	std::uint64_t N;
	std::cin >> N ;
	for (int i{}; i < N; ++i) 
	{
		std::uint64_t v;
		std::cin >> v;
		queue.emplace(v);
	}
	int count = 1;
	std::uint64_t now = queue.top();
	queue.pop();
	while (queue.size())
	{
		auto top = queue.top();
		queue.pop();
		if (2 * now < top)
		{
			count = 1;
		}
		else
		{
			++count;
		}
		now += top;
	}
	std::cout << count << std::endl;
}

Measured memory_bytes: 1400
#include <iostream>
#include <string>
#include <queue>
#include <algorithm>
using namespace std;
int d[100005];
int main() {
	int n;
	int k;
	int q;
	cin >> n;
	cin >> k;
	cin >> q;
	int a[100005];
	
	for (int i = 0; i < q; i++) {
		cin >> a[i];
		d[a[i]] += 1;
	}
	for (int i = 0; i < n;i++) {
		if (k - (q - d[i + 1]) > 0)cout << "Yes"<<endl;
		else cout << "No"<<endl;
	}
}

Measured memory_bytes: 1408