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

using namespace std;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(ll (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(ll (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define MOD 1000000007

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

ll dp[222][222][222];

int main(){
	
	int n;cin >> n;
	vector<char> v(n);
	REP(i,n)cin >> v[i];
	
	dp[0][0][0] = 1;
	
	REP(i,n){
		REP(j,n){
			REP(k,n){
				if(dp[i][j][k]){
					DBG(cout << "ijk ; " << i << ' ' << j << ' ' << k  << ' ' << dp[i][j][k] << endl;)
					if(v[i] == '-'){
						dp[i+1][j][k] += dp[i][j][k];
						dp[i+1][j][k] %= MOD;
					}
					else if(v[i] == 'U'){
						if(k > 0){
							dp[i+1][j][k] += dp[i][j][k] * k;
							dp[i+1][j][k] %= MOD;
						}
						dp[i+1][j+1][k+1] += dp[i][j][k];
						dp[i+1][j+1][k+1] %= MOD;
					}
					else{
						if(j > 0){
							dp[i+1][j][k] += dp[i][j][k] * j;
							dp[i+1][j][k] %= MOD;
							if(k > 0){
								dp[i+1][j-1][k-1] += dp[i][j][k] * j * k;
								dp[i+1][j-1][k-1] %= MOD;
							}
						}
					}
				}
			}
		}
	}
	
	cout << dp[n][0][0] << endl;
							
							
						
						
						
	
	return 0;
}


Measured memory_bytes: 22128
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int n[10],i,j;
	for(i=0;i<10;i++){
	cin>>n[i];
	}
	sort(n,n+10);
	for(i=10;i>7;i--){
		cout<<n[i-1]<<endl;
	}
return 0;
}

Measured memory_bytes: 3080
#include <stdio.h>
int main(void){
int a,b;
char op;
while(1){
scanf("%d %c %d",&a,&op,&b);
if(op=='?'){break;
}
else if(op=='+'){
    printf("%d\n",a+b);
}
else if(op=='-'){
    printf("%d\n",a-b);
}
else if(op=='*'){
    printf("%d\n",a*b);
}
else if(op=='/'){
    printf("%d\n",a/b);
}
}
return 0;
}



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

int main() {
	int q, i, j, k, key;
	int array[100];
	cin >> q;
	for (i = 0; i<q; i++)
		cin >> array[i];
	for (i = 1; i < q; i++){
		for (int j = 0; j<q; j++){
			cout << array[j];
			if (j == q - 1) cout << endl;
			else cout << " ";
		}
		key = array[i];
		j = i - 1;
		while (j >= 0 && array[j]>key){
			array[j + 1] = array[j];
			j--;
			array[j + 1] = key;
		}
	}
		for (int i = 0; i < q; i++){
			cout << array[i];
			if (i == q - 1) cout << endl;
			else cout << " ";
		}
	
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int,int> P;
 
const int INF = 1e9;
const int mod = 1e9+7;

int main()
{
    int n;
    cin >> n;
    vector<int> l(n+10),r(n+10);
    int l_sum = 0,r_sum = 0;
    for(int i = 0; i < n; i++) cin >> l[i];
    for(int i = 0; i < n; i++){
        cin >> r[i];
        r_sum += r[i];
    }

    int ma = 0;
    for(int i = 0; i < n; i++){
        l_sum += l[i];
        ma = max(ma,l_sum+r_sum);
        r_sum -= r[i];
    }

    cout << ma << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define WHATIS(x) cout << #x << " is " << x << endl;
#define ERROR(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x

using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<II, int> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cout << *it << " = " << a << endl;
    err(++it, args...);
}

const ll MODBASE = 1000000007LL;
const int MAXN = 310;
const int MAXM = 1000010;
const int MAXK = 510;
const int MAXQ = 200010;

int n, a[MAXN], cnt[4];
ld dp[MAXN][MAXN][MAXN];

ld solve(int a, int b, int c) {
    if (dp[a][b][c] != -1) return dp[a][b][c];
    int g = a+b+c;
    ld res = 1.0 * (n - g) / g;
    if (a) res += 1.0 * a / g * (1 + solve(a-1, b, c));
    if (b) res += 1.0 * b / g * (1 + solve(a+1, b-1, c));
    if (c) res += 1.0 * c / g * (1 + solve(a, b+1, c-1));
    return dp[a][b][c] = res;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cin >> n;
    FOR(i,1,n) cin >> a[i];
    FOR(i,1,n) cnt[a[i]]++;
    FOR(i,0,300) FOR(j,0,300) FOR(k,0,300) dp[i][j][k] = -1;
    dp[0][0][0] = 0;
    cout << fixed << setprecision(9) << solve(cnt[1], cnt[2], cnt[3]);
    return 0;
}


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

int main(){
    vector<string> s(3); rep(i,3) cin >> s[i];
    int now = 0;
    int cnt[4]; rep(i,3) cnt[i] = 0;
    while(1){
        if(cnt[now] == s[now].size()) break;
        int tmp = cnt[now];
        cnt[now]++;
        now = int(s[now][tmp]-'a');
    }
    cout << char('A' + now) << endl;
}

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

inline int read()
{
	char c=getchar();
	int x=0,f=1;
	while (c<'0'||c>'9') {if (c=='-') f=-1;c=getchar();}
	while (c>='0'&&c<='9') {x=(x<<3)+(x<<1)+c-'0';c=getchar();}
	return x*f;
}

int main()
{
	int n,pre,cur,cnt,ans;
	n=read();
	pre=read();cnt=1;ans=0;
	for (ri i=2;i<=n;i++)
	{
		cur=read();
		if (cur==pre) cnt++;
			else ans+=cnt/2,cnt=1;
		pre=cur;
	}
	ans+=cnt/2;
	printf("%d\n",ans);
	return 0;
}

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

#define pb push_back
#define mp make_pair
#define ft first
#define sc second
#define ull unsigned long long int
#define lli long long int
#define li long int

#define si(n) scanf("%d",&n)
#define sl(n) scanf("%ld",&n)
#define sll(n) scanf("%lld",&n)

#define pi(n) printf("%d",n)
#define pl(n) printf("%ld",n)
#define pll(n) printf("%lld",n)

using namespace std;

const int MAX=1e5+5;

int main() {
    // freopen("a.in","r",stdin);
    // freopen("a.out","w",stdout);
    int K; cin >> K;
    int odd = (K>>1), even = (K>>1);
    if(K&1)
        odd++;

    cout << odd * even << "\n";


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 998244353;

#define MAX_N 400005
ll inv[MAX_N], fac[MAX_N], finv[MAX_N];
void make() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for(int i=2; i<MAX_N; i++) {
    inv[i] = mod - inv[mod%i] * (mod/i) % mod;
    fac[i] = fac[i-1] * (ll)i % mod;
    finv[i] = finv[i-1] * inv[i] % mod;
  }
}
ll perm(ll n, ll r) {
  if(n < 0)       return 0;
  else if(n < r)  return 0;
  else            return (fac[n] * finv[n-r]) % mod;
}
ll comb(ll n, ll r) {
  ll ans = 1;
  ans = perm(n, r); // n * (n-1) * ... * (n-r+1)
  ans = (ans * finv[r]) % mod; // フェルマーの小定理
  return ans;
}

ll binary_pow(ll a, ll N) {
  ll ans = 1;
  ll tmp = a;
  while(N > 0) {
    if(N % 2 == 1) {
      ans *= tmp;
      ans %= mod;
    }
    N /= 2;
    tmp *= tmp;
    tmp %= mod;
  }
  return ans;
}

int main() {
  make();
  int N, M, K;
  cin >> N >> M >> K;
  ll ans = 0;
  ll pow = (M * binary_pow(M-1, N-K-1)) % mod;
  for(ll k=K; k>=0; k--) {
    (ans += (comb(N-1, k) * pow) % mod) %= mod;
    (pow *= M-1) %= mod;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 13048
from typing import List


def get_max_v2(R: List[int]) -> int:
    max_diff: int = R[1] - R[0]
    min_r: int = min(R[0], R[1])

    for r in R[2:]:
        if r - min_r > max_diff:
            max_diff = r - min_r
        if r < min_r:
            min_r = r
    return max_diff


def main():
    n: int = int(input())
    R: List[int] = []
    for _ in range(n):
        R.append(int(input()))

    result = get_max_v2(R)
    print(result)


if __name__ == "__main__":
    main()



Measured memory_bytes: 16724
#include<bits/stdc++.h>
#include<tuple>
using namespace std;
#define ll long long
vector<int> edge[100001];
int par[100001]={};


int main(){
  int n, m;
  int a,b;
  cin >> n >> m;
  int h[100001] = {};
  for(int i=0;i<n+m-1;i++){
    cin >> a >> b;
    edge[a].push_back(b);
    h[b]++;
  }
  int root;
  for(int i=1;i<=n;i++){
    if(h[i] == 0) root = i;
  }

  queue<int> q;
  
  for(int i=0;i<edge[root].size();i++){
    h[edge[root][i]]--;
    if(h[edge[root][i]] == 0){
      q.push(edge[root][i]);
      par[edge[root][i]] = root;
    }
  }
  par[root] = 0;
  while(!q.empty()){
    int crr=q.front();q.pop();
    for(int i=0;i<edge[crr].size();i++){
      h[edge[crr][i]]--;
      if(h[edge[crr][i]] == 0){
        q.push(edge[crr][i]);
        par[edge[crr][i]] = crr;
      }
    }
  }
  for(int i=1;i<=n;i++){
    cout << par[i]<< endl;
  }
}

Measured memory_bytes: 7040
from itertools import accumulate
import sys

sys.setrecursionlimit(1000000)


def main():
    w, h = map(int, input().split())
    mp = [list(map(int, input().split())) for _ in range(h)]
    acc_mp = list(map(lambda line:[0] + list(accumulate(line)), mp))
    mem = {}

    def score(x, y, turn):
        if (x, y) in mem:return mem[(x, y)]
        if y >= h:
            ret = 0
        elif x >= w:
            ret = acc_mp[y][x] + score(x, y + 1, 0)
        else:
            left = acc_mp[y][x]
            right = acc_mp[y][w] - left
            if turn == 0:
                ret = max(score(x + 1, y, 1), left - right + score(x, y + 1, 1))
            if turn == 1:
                ret = min(score(x + 1, y, 0), left - right + score(x, y + 1, 0))
        mem[(x, y)] = ret
        return ret

    print(abs(score(0, 0, 1)))


main()


Measured memory_bytes: 232036
#include <cstdio>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stack>
#include <algorithm>
#include <random>
#include <iomanip>
#include <map>
#include <queue>
#include <functional>
#include <numeric>
#include <chrono>
#include <cstdlib>
using ll = long long;
using namespace std;

const ll MOD = 1e9 + 7;
const double pi = acos(-1);
typedef pair<int, int> P;
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EPS 1e-4
#define OUTPUT(i) (cout << (ll)i << endl)
#define ALL(a) ((a).begin(), (a).end())

bool operator<(const pair<ll, ll> &a, const pair<ll, ll> &b)
{

    if (a.first == b.first)
        return a.second < b.second;

    return a.first < b.first;
}

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    //cout << fixed << setprecision(15);

    int a[10], b[10];
    REP(i, 10)
    {
        cin >> a[i];
    }
    REP(i, 10)
    {
        cin >> b[i];
    }
    sort(a, a + 10);
    sort(b, b + 10);

    cout << a[7] + a[8] + a[9] << " " << b[7] + b[8] + b[9] << endl;
    return 0;
}



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

int main() {
    /* 入力受け取り */
    int n, a, b;
    cin >> n;
    vector<pair<int, int>> p(n);

    for(int i = 0; i < n; i++){
        cin >> a >> b;
        p[i] = make_pair(b, -a);
    }
    sort(p.begin(), p.end());
    for(int i = 0; i < n; i++){
        p[i].second = p[i].second * (-1);
    }
    long long sum = 0;
    for(int i = 0; i < n; i++){
        sum = sum + p[i].second;
        if(sum > p[i].first){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

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

using namespace std;

int main(){
   long double avmhand = 2*M_PI/3600;
   long double avhhand = 2*M_PI/(12*3600);
   long double a,b,h,m;
   cin>>a>>b>>h>>m;
   long double angle = fabs(avhhand*(h+m/60)*3600-avmhand*m*60);
   long double c = sqrt(a*a+b*b-2*a*b*cos(angle));
   cout << std::setprecision(30);
   cout<<c<<endl;
   //cout<<angle;
   
   return 0;
}


Measured memory_bytes: 4124
#include<bits/stdc++.h>
using namespace std;
#define maxn 10005
int n,u,k;
int g[maxn][maxn];
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        int v;
        scanf("%d%d",&u,&k);
        for(int j=1;j<=k;j++)
        {
            scanf("%d",&v);
            g[u][v]=1;
        }
    }

    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<n;j++)
        {
            printf("%d ",g[i][j]);
        }
        printf("%d\n",g[i][n]);
    }

    return 0;
}

Measured memory_bytes: 3612
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100007)

def main():
    h, w = map(int, input().split())
    grid = [None]*h
    for i in range(h):
        grid[i] = input()
    
    mod = pow(10, 9)+7
    dp = [[0]*w for _ in range(h)]
    dp[0][0] = 1
    for i in range(h):
        for j in range(w):
            dp[i][j] %= mod
            if i != h-1 and grid[i+1][j] == ".":
                dp[i+1][j] += dp[i][j]
            if j != w-1 and grid[i][j+1] == ".":
                dp[i][j+1] += dp[i][j]
    
    print(dp[h-1][w-1])
    
if __name__ == "__main__":
    main()


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

#ifdef HOME
#define db(x) cerr << #x << " = " << x << endl
#define db3(x, y, z) cerr << "(" << #x << ", " << #y << ", " << #z << ") = (" << x << ", " << y << ", " << z << ")" << endl
#define db2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")" << endl
#define dbv(a) cerr << #a << " = "; for (auto xxx: a) cerr << xxx  << " "; cerr << endl
#else
#define db(x) ;
#define db3(x, y, z) ;
#define db2(x, y) ;
#define dbv(a) ;
#endif

using namespace std;
typedef long long ll;
typedef double dbl;


const int INF = 1.01e9;



int main() {
#ifdef HOME
    assert(freopen("in", "r", stdin));
#endif

    int n, m;
    while (scanf("%d%d", &n, &m) == 2) {
        vector<vector<int>> e(n);
        for (int i = 0; i < m; i++) {
            int u, v;
            scanf("%d%d", &u, &v);
            u--; v--;
            e[u].push_back(v);
            e[v].push_back(u);
        }

        if (m % 2 == 1) {
            cout << -1 << endl;
            continue;
        }

        vector<pair<int, int>> ans;
        vector<int> c(n);
        function<bool(int, int)> dfs = [&](int v, int pr) {
            c[v] = 1;

            int cur = 0;
            for (int to : e[v]) {
                if (to == pr) continue;
                if (c[to] == 2) continue;
                if (c[to] == 1 || !dfs(to, v)) {
                    ans.push_back({v, to});
                    cur++;
                }
            }
            if (cur % 2 == 1) {
                ans.push_back({v, pr});
            }

            c[v] = 2;
            return cur % 2 == 1;
        };
        dfs(0, -1);

        vector<int> deg(n);
        for (auto o : ans) deg[o.first]++;
        assert(ans.size() == m);
        for (int i =0; i < n; i++) assert(deg[i] % 2 == 0);

        for (auto o : ans) printf("%d %d\n", o.first + 1, o.second + 1);
    }

#ifdef HOME
    cerr << "time: " << clock() * 1.0 / CLOCKS_PER_SEC << endl;
#endif
}


Measured memory_bytes: 19316
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
using ll = long long;

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

template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T>>;

int main() {
	int n, w;
	cin >> n >> w;
	VV<ll> dp(n+1, V<ll>(w+1, 0));
	V<int> vw(n);
	V<int> vv(n);
	rep(i, n) {
		cin >> vw[i] >> vv[i];
	}
	rep(i, n) {
		for (int sum_w = 0; sum_w <= w; ++sum_w) {
			chmax(dp[i + 1][sum_w], dp[i][sum_w]);
			if (sum_w - vw[i] < 0)continue;
			chmax(dp[i + 1][sum_w], dp[i][sum_w - vw[i]] + vv[i]);
		}
	}
	cout << dp[n][w] << endl;
	return 0;
}


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

typedef long long ll;

ll cnt[2020], ans;

int main()
{
    string s;
    cin >> s;
    int l = s.length();
    int x = 0; ++cnt[x]; int t = 1;
    for(int i=l-1; i>=0; --i){
        x = (x+(t*(s[i]-'0')))%2019;
        ++cnt[x];
        t = (t*10)%2019;
    }
    for(int i=0; i<2019; ++i) ans += (cnt[i]*(cnt[i]-1))/2;
    cout << ans << endl;
}

Measured memory_bytes: 3732
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;

int main()
{
long long a,b,c,d; cin>>a>>b>>c>>d;
cout << max(b*d, max(b*c, max(a*d, a*c))) ;

}

Measured memory_bytes: 3572
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception{
		new Main(new Scanner(System.in), System.out, System.err).exec();
	}
	public final Scanner sc;
	public final PrintStream out, err;
	public Main(final Scanner sc, final PrintStream out, final PrintStream err) {
		this.sc = sc;this.out = out;this.err = err;
	}
	static public final long pair(int a, int b) {return (((long)a) << 32) + b;}
	static public final int getPair1(long v) {return (int)(v >> 32);}
	static public final int getPari2(long v) {return (int)(v & 0xFFFFFFFF);}

	static public final long quad(long a, long b, long c, long d) {
		return ((a&0xFFFF)<< 48) + ((b&0xFFFF)<< 32) + ((c&0xFFFF)<< 16) +(d&0xFFFF);}
	static public final int getQuad1(long v) {return (int)( v >> 48          );}
	static public final int getQuad2(long v) {return (int)((v >> 32) & 0xFFFF);}
	static public final int getQuad3(long v) {return (int)((v >> 16) & 0xFFFF);}
	static public final int getQuad4(long v) {return (int)( v        & 0xFFFF);}

	static public final long record(int e, int m, int i) {
		return quad(-1, e, m, i);
	}
	static public final int re(long record) {
		return getQuad2(record);
	}
	static public final int rm(long record) {
		return getQuad3(record);
	}
	static public final int ri(long record) {
		return getQuad4(record);
	}

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

	private int p;
	private int[] inv;
	private int[] fact;
	private int[] finv;
	public final int mod(long v) {
		v %= p;
		return (int)(v < 0 ? v+p : v);
	}
	public final int mul(long a, long b) {
		return mod(a*b);
	}
	public final void initFact(double limit, double p) {
		initFact((int)limit, (int)p);
	}
	public final void initFact(int limit, int p) {
		this.p = p;
		this.inv = new int[limit+1];
		this.fact = new int[limit+1];
		this.finv = new int[limit+1];
		fact[1] = finv[1] = inv[0] = inv[1] = 1;
		for(int i=2;i<=limit;i++) {
			int a = p / i;
			int b = p % i;
			inv[i]  = mul(-a, inv[b]);
			fact[i] = mul(fact[i-1], i);
			finv[i] = mul(finv[i-1], inv[i]);
		}
	}
	public final int comb(int m, int n) {
		return mul(mul(fact[m], finv[n]), finv[m-n]);
	}

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


	public void exec() throws Exception{
		final int N = 6;
		final int A = sc.nextInt();
		final int B = sc.nextInt();
		out.println((N/A)/B);
	}
}


Measured memory_bytes: 21844
#include<stdio.h>

int main() {
	int n, m, k[30], ans[30][30], i, j, like[30];
	scanf("%d%d", &n, &m);
	for (i = 0; i < m; i++) like[i] = 0;
	for (i = 0; i < n; i++) {
		scanf("%d", &k[i]);
		for (j = 0; j < k[i]; j++) {
			scanf("%d", &ans[i][j]);
		}
	}
	for (i = 0; i < n; i++) {
		for (j = 0; j < k[i]; j++) {
			like[ans[i][j] - 1]++;
		}
	}
	int cnt = 0;
	for (i = 0; i < m; i++) {
		if (like[i] == n) {
			cnt++;
		}
	}
	printf("%d", cnt);
}

Measured memory_bytes: 128
#include <iostream>
#include <numeric>
#include <string>
#include <algorithm>
#include <vector>
 
#define repd(i,a,b); for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
 
 
using namespace std;
int main() {
int s=0;
  cin >> s;
  int a[1000000];
  a[1]=s;
  int ans=0;
  repd(i,2,1000000){
    if(a[i-1]%2 == 1){
      a[i]=a[i-1]*3+1;
    } else {
      a[i]=a[i-1]/2;
    }
    repd(j,1,i-1){
      if (a[i] == a[j]){
        ans = i;
        break;
      }
    }
      if (ans != 0){
        break;
      }
  }
  cout << ans;
 return 0;
}

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

int main() {
  int n, p;
  cin>>n>>p;
  int odd = 0;
  int even = 0;
  for (int i=0; i<n; i++) {
    int a;
    cin>>a;
    if (a % 2 == 0) {
      ++even;
    } else {
      ++odd;
    }
  }
  long long combs[51][51];
  combs[0][0] = 1;
  for (int i=0; i<51; i++) {
    for (int j=0; j<51; j++) {
      if (i == 0 && j == 0) {
        continue;
      } else if (i == 0) {
        combs[i][j] = 0;
        continue;
      } else if (j == 0) {
        combs[i][j] = 1;
        continue;
      }
      combs[i][j] = combs[i-1][j-1] + combs[i-1][j];
    }
  }
  long long ans = 0;
  if (p == 1) {
    long long tmp1 = 0;
    for (int i=0; i<=even; i++) {
      tmp1 += combs[even][i];
    }
    long long tmp2 = 0;
    for (int i=1; i<=odd; i+=2) {
      tmp2 += combs[odd][i];
    }
    ans = tmp1 * tmp2;
  } else {
    long long tmp1 = 0;
    for (int i=0; i<=even; i++) {
      tmp1 += combs[even][i];
    }
    long long tmp2 = 0;
    for (int i=0; i<=odd; i+=2) {
      tmp2 += combs[odd][i];
    }
    ans = tmp1 * tmp2;
  }
  cout<<ans<<endl;

}

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

using namespace std;

int n;

int main(void) {
	cin >> n;
	int ans = 0;
	for (int i = 1; i <= n; ++ i) if (i & 1){
		int cur = 0, tmp = i;
		for (int j = 1; j <= i; ++ j) if (i % j == 0) ++ cur;
		if (cur == 8) ++ ans;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
int main()
{
	std::string S;
	std::cin >> S;

	bool yymm = false;
	bool mmyy = false;

	if (((S.at(2) == '0') and (S.at(3) != '0')) or ((S.at(2) == '1') and ((S.at(3) == '0') or (S.at(3) == '1') or (S.at(3) == '2'))))
		yymm = true;
	
	if (((S.at(0) == '0') and (S.at(1) != '0')) or ((S.at(0) == '1') and ((S.at(1) == '0') or (S.at(1) == '1') or (S.at(1) == '2'))))
		mmyy = true;

	if ((yymm == true) and (mmyy == true)) {
		std::cout << "AMBIGUOUS" << std::endl;
	}
	else if ((yymm == true) and (mmyy == false)) {
		std::cout << "YYMM" << std::endl;
	}
	else if ((yymm == false) and (mmyy == true)) {
		std::cout << "MMYY" << std::endl;
	}
	else if ((yymm == false) and (mmyy == false)) {
		std::cout << "NA" << std::endl;
	}

	return 0;
}


Measured memory_bytes: 256
from collections import deque, defaultdict
import sys
input = sys.stdin.buffer.readline

n, m, k = map(int, input().split())

#先ずは連結成分の数を調べる
G = defaultdict(lambda:deque([]))
for _ in range(m):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    G[a].append(b)
    G[b].append(a)

NIL = -1
color = [NIL]*n
def dfs(r, c):
    S = deque([])
    S.append(r)
    color[r] = c
    while S:
        u = S.popleft()
        for v in G[u]:
            if color[v] == NIL:
                color[v] = c
                S.append(v)
                
def make_color():
    id = 1
    for u in range(n):
        if color[u] == NIL:
            dfs(u, id)
            id += 1
            
make_color()
#グラフの塗り分け完了

#各色ごとの連結成分の数を数える
count = defaultdict(lambda:0)
for i in range(n):
    count[i] = 0
for i in range(n):
    count[color[i]] += 1

#ブロック関係の辞書を作成
block = defaultdict(lambda:deque([]))
for _ in range(k):
    c, d = map(int, input().split())
    c, d = c-1, d-1
    block[c].append(d)
    block[d].append(c)

temp = []
for i in range(n):
    x = count[color[i]] - 1#自分以外の連結成分の和
    y =  len(G[i])#友達の数
    z = 0 #連結内のブロック数
    for v in block[i]:
        if color[i] == color[v]:
            z += 1
    temp.append(x-y-z)
print(*temp)


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

using namespace std;

const int maxn=15;
double a[maxn];

int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	sort(a,a+n);
	double sum=0;
	for(int i=0;i<n-1;i++){
		sum=sum+a[i];
	}
	cout<<sum+a[n-1]/2;
}

Measured memory_bytes: 256
n = int(input())
line = list(input())
cum_sum_w = [0]
cum_sum_e = [0]
count_w = 0
count_e = 0
for i in range(n):
    if line[i] == 'W':
        count_w += 1
    else:
        count_e += 1
    cum_sum_w.append(count_w)
    cum_sum_e.append(count_e)
count_list = []
for i in range(1, n + 1):
    count = 0
    count += cum_sum_w[i - 1]
    count += cum_sum_e[n] - cum_sum_e[i]
    count_list.append(count)
print(min(count_list))


Measured memory_bytes: 32332
H, W = map(int, input().split())
s = [input() for i in range(H)]

def count(x, y):
    c = 0
    if x-1 >= 0 and s[x-1][y] =="#":
        c += 1
    if x+1 <= H-1 and s[x+1][y] =="#":
        c += 1
    if y-1 >= 0 and s[x][y-1] =="#":
        c += 1
    if y+1 <= W-1 and s[x][y+1] =="#":
        c += 1
    return c

for i in range(H):
    for j in range(W):
        if s[i][j] == "#":
            a = count(i, j)
            if a == 0:
                print("No")
                exit()

print("Yes")

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

int main () {
  int R;
  cin >> R;
  
  if (R < 1200) {
    cout << "ABC" << endl;
  }
  else if (R < 2800) {
    cout << "ARC" << endl;
  }
  else {
    cout << "AGC" << endl;
  }
}

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

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

constexpr lint MOD = 1000000007;

vector<lint> X{250007, 861743};
vector<lint> Xinv(2);

int N;
string S;

// ax+by=gcd(a, b)
template <typename T>
T extgcd(T a, T b, T &x, T &y)
{
    T d = a;
    if (b != 0)
    {
        d = extgcd(b, a % b, y, x);
        y -= a / b * x;
    }
    else
    {
        x = 1;
        y = 0;
    }
    return d;
}

P nxt_hash(P prev_hash, lint x, lint xinv, char c)
{
    P res = prev_hash;
    if (c == '+')
    {
        res.first++;
    }
    if (c == '-')
    {
        res.first += MOD - 1;
    }
    if (c == '>')
    {
        res.first *= x;
        res.second *= x;
    }
    if (c == '<')
    {
        res.first *= xinv;
        res.second *= xinv;
    }
    res.first %= MOD;
    res.second %= MOD;
    return res;
}

int main()
{
    for (int i = 0; i < 2; i++)
    {
        lint xinv, tmp;
        extgcd(X[i], MOD, xinv, tmp);
        Xinv[i] = (xinv + MOD) % MOD;
    }

    cin >> N >> S;

    vector<vector<P> > hash(2, vector<P>(N+1, make_pair(0LL, 1LL)));

    for (unsigned ix = 0; ix < 2; ix++)
    {
        lint x = X[ix];
        lint xinv = Xinv[ix];
        for (int i = N - 1; i>=0; i--) hash[ix][i] = nxt_hash(hash[ix][i + 1], x, xinv, S[i]);
    }

    for (int ix = 0; ix < 2; ix++)
    {
        for (int i = 0; i <= N; i++)
        {
            lint invh, tmp;
            extgcd(hash[ix][i].second, MOD, invh, tmp);
            hash[ix][i].second = (invh + MOD) % MOD;
        }
    }

    lint ans = 0;
    map<P, int> hash_lst;
    for (int m = N; m >= 0; m--)
    {
        P h_query;
        h_query.first = (hash[0][m].first - hash[0][0].first + MOD) * hash[0][m].second % MOD;
        h_query.second = (hash[1][m].first - hash[1][0].first + MOD) * hash[1][m].second % MOD;

        ans += hash_lst[h_query];

        P h_append;
        h_append.first = hash[0][m].first * hash[0][m].second % MOD;
        h_append.second = hash[1][m].first * hash[1][m].second % MOD;
        hash_lst[h_append]++;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 39616
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, o, n) for (auto i = (o); (i) < (n); ++(i))
#define FOR1(i, n) FOR(i, 1, n+1)
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (auto i = (n)-1; (i) >= 0; --i)
#define REPI(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define REPIR(itr, v) for (auto itr = v.rbegin(); itr != v.rend(); ++itr)
#define fi first
#define se second
#define ll long long
#define int long long
#define V2(name, h, w) vector<vector<int> > name((h), vector<int>(w));
#define myCeil(dividend, divisor) ceil((double)(dividend) / (double)(divisor))
#define myFloor(dividend, divisor) floor((double)(dividend) / (double)(divisor))
#define calcDigits(num) floor(log10(num))+1

#define dl(line) cerr << "RUN: until " << (line) << "th line." << endl;
#define dv(name, value) cerr << (name) << " is " << (value) << endl;
#define da(v)  cerr << "["; REPI(itr, v){cerr << *itr << (itr != --v.end() ? ", " : "");} cerr << "]" << endl;
#define dpa(v) cerr << "[ " << endl;REPI(itr, v) { cerr << "  [" << (*itr).first << ", " << (*itr).second << ']' << (itr != --v.end() ? "," : "") << endl; } cerr << "]" << endl;


void solve(std::string s){
  string S = "";
  for(const auto& c : s) {
    if (c == '0') {
      S.push_back('0');
    } else
    if (c == '1') {
      S.push_back('1');
    } else 
    if (c == 'B') {
      if (S.size() != 0) {
        S.pop_back();
      }
    }
  }
  cout << S << endl;
}

signed main(){
  std::string s;
  std::cin >> s;
  solve(s);
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<functional>
#include<string>
using namespace std;
int main(void)
{
	int n,i,cnt;
	string a[100000];
	long long sum;
	scanf("%d",&n);
	for(i=0;i<n;i++)	cin >>a[i];
	for(i=0;i<n;i++)	sort(a[i].begin(),a[i].end());
	sort(a,a+n);
	cnt=1;
	sum=0;
	for(i=1;i<n;i++)	{
		if(a[i]==a[i-1])	{
			cnt++;
		}
		else {
			sum+=(long long)cnt*(cnt-1)/2;
			cnt=1;
		}
//		printf("cnt=%d\n",cnt);
	}
	sum+=(long long)cnt*(cnt-1)/2;
	printf("%lld\n",sum);
	return 0;
}

Measured memory_bytes: 7296
#include "bits/stdc++.h"
#define ll long long
#define fr first
#define sc second
using namespace std;

const int mnx = 2e6 + 9;
const int mod = 1e9 + 7;

ll n, a[mnx], sum;

void solve(){
    cin >> n;

    for(int i = 1; i <= n; i++){
        cin >> a[i];
        sum += a[i];
    }

    if(sum % 10 != 0){
        cout << sum << '\n';
        return;
    }

    sort(a + 1, a + n + 1);

    for(int i = 1; i <= n; i++){
        if(a[i] % 10 != 0){
            cout << sum - a[i] << '\n';
            return;
        }
    }

    cout << 0 << '\n';
}


int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    ll tt = 1;
//    scanf("%d", &tt);

    while(tt--){
        solve();
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, m, n) for (int i = m; i < n; ++i)
#define rem(i, m, n) for (int i = m; i > n; --i)
const int MOD = 1000000007;

int main() {
  int N; cin >> N;
  vector<int> d(N);
  rep(i, 0, N) cin >> d[i];
  int mx = *max_element(d.begin(), d.end());
  sort(d.begin(), d.end());
  int ans = 0;
  rep(i, 0, mx + 2) {
    int n = lower_bound(d.begin(), d.end(), i) - d.begin();
    if(2 * n == N) ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 640
#include <string.h>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
// #include <unordered_map>
// #include <unordered_set>
#include <utility>
#include <vector>

#define pb push_back
#define mp make_pair

#ifdef ONLINE_JUDGE
#define link renamelink
#define next renamenext
#define prev renameprev
#endif

using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
typedef long double ld;

inline void EnableFileIO(const string& fileName, bool local = 0) {
  if (fileName.empty()) return;
  if (local) {
    freopen((fileName + ".in").c_str(), "r", stdin);
    freopen((fileName + ".out").c_str(), "w", stdout);
    return;
  }
#ifdef ONLINE_JUDGE
  freopen((fileName + ".in").c_str(), "r", stdin);
  freopen((fileName + ".out").c_str(), "w", stdout);
#endif
}

const int INF = (1 << 30) - 1;
const LL LINF = (1LL << 61) - 1;
const double EPS = 1e-10, PI = acos(-1);

string s;
int main() {
  // srand((int)time(0));
  // printf("Hello, world!\n");
  // EnableFileIO("");
  
  cin>>s;
  if(s.substr(0,4)=="YAKI") {
    puts("Yes");
  } else {
    puts("No");
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define forsn(i,x,y) for(int i = (x) ; i < int(y) ; ++i)
typedef long long ll;
typedef long double ld;

int main() {
  int n,m;
  cin >> n >> m;
  vector<pair<int,bool>> box;
  box.push_back(make_pair(1,true));
  forsn(i,1,n) {
    box.push_back(make_pair(1,false));
  }
  forn(i,m) {
    int x,y;
    cin >> x >> y;
    x--, y--;
    box[y].first++, box[x].first--;
    if(box[x].second) {
      box[y].second = true;
    }
    if(box[x].first == 0) {
      box[x].second = false;
    }
  }
  int t = 0;
  for(pair<int,bool> b : box) {
    if(b.second) {
      t++;
    }
  }
  cout << t << endl;
  return 0;
}

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

using namespace std;

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

  int n;
  string s;
  cin >> n >> s;

  int sum = 0;
  for (int i = 1; i < n; i++) {
    if (s[i] == 'E') sum++;
  }
  int mins = sum;
  for (int i = 1; i < n; i++) {
    if (s[i - 1] == 'W') {
      sum++;
    }
    if (s[i] == 'E') {
      sum--;
      mins = min(mins, sum);
    }
  }

  cout << mins << '\n';

  return 0;
}


Measured memory_bytes: 720
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<int,pair<int,int> > pipii;
typedef priority_queue<pii,vector<pii>,greater<pii>> minpq;
typedef priority_queue<pii> maxpq;
//const double PI = acos(-1);
const int mod = 1000000007;

// ----------------------DEBUG TEMPLATE--------------------------
void __print(int x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
// ----------------------DEBUG TEMPLATE--------------------------



int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int x,k,d;
    cin>>x>>k>>d;
    
    if(abs(x)/d >= k){
        cout<<abs(x) - k*d<<endl;
        return 0;
    }
    int r = abs(x) - ((int)abs(x)/d)*d;
    int  l = r - d;
    int left = k - (abs(x)/d);
    if(left&1){
        cout<<abs(l)<<endl;
    }
    else{
        cout<<abs(r)<<endl;
    }







	
	
	
}

Measured memory_bytes: 3692
// think twice code once
// Start:[]
// End  :[]
/*{{{*/
#include <bits/stdc++.h>
using namespace std;

#define rep(i, x, y) for(int i = (x), _ = (y); i <= _; ++ i)
#define per(i, x, y) for(int i = (x), _ = (y); i >= _; -- i)
#define dprintf(...) fprintf(stderr, __VA_ARGS__)
#define disp(x) cout << #x << " = " << x << "; "
#ifdef __linux__
#define getchar getchar_unlocked
#define LLFORMAT "%lld"
#else
#define LLFORMAT "%I64d"
#endif

typedef long long LL;

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

template <class T> void read(T& a) {
	char c = getchar(); T f = 1; a = 0;
	for(; !isdigit(c); c = getchar()) if(c == '-') f = -1;
	for(; isdigit(c); c = getchar()) a = a * 10 + c - '0';
	a *= f;
}
/*}}}*/

const int maxN = 505;
const int oo = 0x3f3f3f3f;

int dp[maxN][maxN];
int N, a[maxN], b[maxN], c[maxN];
int M1, M2;

int main()
{
#ifdef Leeson
	freopen("tmp.in", "r", stdin);
	freopen("tmp.out", "w", stdout);
#endif

	read(N); read(M1); read(M2);
	rep(i, 1, N)
		read(a[i]), read(b[i]), read(c[i]);

	memset(dp, +oo, sizeof(dp));
	dp[0][0] = 0;
	rep(i, 1, N)
	{
		per(x, 400, 0) per(y, 400, 0)
			chkmin(dp[x + a[i]][y + b[i]], dp[x][y] + c[i]);
	}

	int ans = +oo;
	for(int d1 = M1, d2 = M2; d1 <= 400 && d2 <= 400; d1 += M1, d2 += M2)
		chkmin(ans, dp[d1][d2]);

	printf("%d\n", ans == +oo ? -1 : ans);

	return 0;
}


Measured memory_bytes: 1280
#include <iostream>
#include <string>
using namespace std;
 
int main(){
  string s,a;
  a="";
  cin >> s;
  for(int i=0;i<s.size();i++){
    if(i%2==0){
      a+=s.at(i);
    }
  }
  cout << a << endl;
}

Measured memory_bytes: 512
#include<iostream>
#include<bits/stdc++.h>
#include<climits>
#include<math.h>

#define forn(x,n,s) for(int i = x; i < n; i += s )
#define forr(x,n,s) for(int i = x; i>=n; i -= s)
#define PI 3.14159265358979323846264338327950L

using namespace std;

void go(){
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  #ifndef ONLINE_JUDGE
       freopen("input.txt","r",stdin);
       freopen("output.txt","w",stdout);
  #endif
} 
long long int mod = 1e9+7;
int helper(int n){
    int cnt = 0,round = 1;
    while(n>0){
        if(n-round>=0) cnt++;
        n -= round;
        round++;
    }
    return cnt;
}

int main(){
    go(); 

    // code here
    long long int n;cin>>n;
    unordered_map<int,int> mp;
    long long int temp = n;
    int ans = 0;
    for(int i = 2;(long long int)i*i<=temp;i++){
        int cnt = 0;
        while(n>1 and n%i==0){
            cnt++;
            n = n/i;
        }
        ans += helper(cnt); 
    }
    if(n>1) ans++;
    cout<<ans;
}





Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
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; }
typedef long long ll;
using namespace std;
int main(void){
    string s;cin>>s;
    int k;cin>>k;
    priority_queue<string, vector<string>, greater<string> > que;
    vector<vector<int>> v(26);
    rep(i,s.size()){
        v[s[i]-'a'].push_back(i);
    }
    int dk=k;
    map<string,int> mp;
    rep(i,26){
        priority_queue<pair<string,int>, vector<pair<string,int>>, greater<pair<string,int>> > que2;
        rep(j,v[i].size()){
            int l=v[i][j];
            string now="";
            now+=s[l];
            que2.push({now,l});
        }
        while(que2.size()){
            string now=que2.top().first;int id=que2.top().second;
            que2.pop();
            if(mp[now]==0)dk--;
            if(dk==0){
                cout<<now<<endl;
                return 0;
            }
            if(id==s.size()-1)continue;
            mp[now]++;
            id++;
            now+=s[id];
            que2.push({now,id});
        }
    }
}


Measured memory_bytes: 640
'use strict'
function main(inp) {
  inp = inp.trim()
  const days = ['SUN','MON','TUE','WED','THU','FRI','SAT']
  let idx = days.indexOf(inp)
  console.log(7 - idx)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 21956
type t = {
  id : int;
  ch : char;
  num : int;
}

let a = Array.make 100001 { id = 0; ch = '\000'; num = 0 }

let rec partitoin r = function
  | (i, j) when j = r ->
    let tmp = a.(i) in
    a.(i) <- a.(j);
    a.(j) <- tmp;
    i
  | (i, j) when a.(j).num <= a.(r).num ->
    let tmp = a.(i) in
    a.(i) <- a.(j);
    a.(j) <- tmp;
    partitoin r (i + 1, j + 1)
  | (i, j) ->
    partitoin r (i, j + 1)

let rec quick_sort p r =
  if p < r then begin
    let q = partitoin r (p, p) in
    quick_sort p (q - 1);
    quick_sort q r
  end

let rec stable_str n i =
  if i = n then "Stable"
  else if a.(i-1).num = a.(i).num && a.(i-1).id > a.(i).id then "Not stable"
  else stable_str n (i + 1)

let rec split str delim acc =
  let open String in
  match
    try Some (rindex str delim) with _ -> None
  with
  | None -> str :: acc
  | Some i -> split (sub str 0 i) delim (sub str (i + 1) (length str - i - 1) :: acc)

let rec read i n =
  if i < n then begin
    begin match split (read_line ()) ' ' [] with
    | [c; d] -> a.(i) <- { id = i; ch = c.[0]; num = int_of_string d }
    | _ -> exit 1
    end;
    read (i + 1) n
  end

let rec print i n =
  if i < n then begin
    print_char a.(i).ch;
    print_string " ";
    print_int a.(i).num;
    print_string "\n";
    print (i + 1) n
  end

let () =
  let n = read_int () in
  read 0 n;
  quick_sort 0 (n - 1);
  print_endline (stable_str n 1);
  print 0 n

Measured memory_bytes: 8764
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cmath>
#include <complex>
#include <cctype>
#include <cassert>
#include <sstream>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <deque>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second

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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;

const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS = 1e-10;

int main() {
	int sum = 0;
	REP(i, 10) {
		int s; cin >> s;
		sum += s;
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 3068
#include<bits/stdc++.h>
using namespace std;
#define IO {ios_base::sync_with_stdio(false); cin.tie(0);}
#define ll   long long
#define pi pair<ll,ll>

ll a[300000];

int main()
{
    IO;
    ll i, j, k = 0, n, g, r, mod=1e9+7, l, t, mn;
        cin>>n;cout<<1-n<<endl;

        return 0;
}


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

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;

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

const ll mod = (ll)1e9 + 7;
const ll mxN = 200200;

string red(string s) {
	stack<char> st;
	for(auto i: s)
		if(i=='(')
			st.push('(');
		else if(i==')' && (st.size()==0 || st.top()==')'))
			st.push(')');
		else
			st.pop();
	string ans="";
	while(st.size())
		ans+=st.top(),st.pop();
	reverse(all(ans));
	return ans;
}


int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.precision(20);
	cout << fixed;
	
	char a;
	cin>>a;
	cout<<char(a+1)<<"\n";


}


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

namespace AtCoderWorkspace
{
    public class Solver
    {
        public void Solve()
        {
            var cin = new Scanner();
            var a = cin.ArrayLong(5).ToList();
            
            Console.WriteLine(a.IndexOf(0)+1);
        }
    }

    class Scanner
    {
        string[] s;
        int i;

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

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

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

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

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

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

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

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

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


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

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


Measured memory_bytes: 28216
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define mod 1000000007
#define mo 1000000007
#define mod2 1000000000
#define mod1 998244353
#define lol ios_base::sync_with_stdio(false);cin.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define F(i, n) for (ll (i) = 0; (i) < (n); (i)++)
#define pb push_back
#define pf push_front
#define mp make_pair
#define f first
#define ss second

int main()
{
    lol;
    ll k;cin >> k;
    ll st = 7;
    for(ll i=1;i<=pow(10,6);i++)
    {
        if(st%k==0)
        {
            cout << i << endl;
            exit(0);
        }
        st = st*10 + 7;
        st = st%k;
    }
    cout << -1 << endl;
}

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

using namespace std;
using ll = long long;

const int INF = INT_MAX;

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

    int n, k;
    cin >> n >> k;
    vector<int> w(n);
    for(int i = 0; i < n; ++i) cin >> w[i];

    int ng = 0, ok = 100000 * 10000, mid, k_nec, wt;
    while(ok - ng != 1) {
        mid = (ok + ng) / 2;
        k_nec = 1;
        wt = 0;
        for(int wi: w) {
            if(wi > mid) {
                k_nec = INF;
                break;
            }
            else if(wt + wi <= mid) wt += wi;
            else {
                wt = wi;
                k_nec++;
            }
        }
        if(k_nec <= k) ok = mid;
        else ng = mid;
    }

    printf("%d\n", ok);

    return 0;
}


Measured memory_bytes: 3328