akhauriyash/Code-Regression huggingface dataset:
#include <complex>
#include <stdio.h>
#include <math.h>
using namespace std;

// _ÀWð^Æ·é
typedef complex<double> P;
// ÎÌè`
#define PI 3.1415926535898

// e·éë·Ã
#define EPS (1e-10)
//XYÀW
#define X real()
#define Y imag()
	
// Op`NX
class Triangle{

private:
	//Op`ÌR_ÌÀW
	P a, b, c;
	//Op`ÌRÓÌ·³
	double edgeA,edgeB,edgeC;
	//Op`ÌRpÌå«³(WA)
	double angleA,angleB,angleC;
	//]·è©çRÂÌpxðßéÖ
	double LawOfCosines(double a,double b, double c){
		return acos( (b*b+c*c-a*a) / (2.0*b*c) );
	}
	//QÂÌdouble^Ìlªµ¢©Ç¤©
	bool equal(double a, double b){
		return (fabs( a-b ) < EPS)? true : false ;
	}

public:
	//RXgN^(RÂÌ_ÆÓÆpxðú»)
	Triangle(P p1, P p2, P p3){
		a = p1;
		b = p2;
		c = p3;
		edgeB = abs(c-a);
		edgeA = abs(b-c);
		edgeC = abs(a-b);
		angleA = LawOfCosines(edgeA,edgeB,edgeC);
		angleB = LawOfCosines(edgeB,edgeC,edgeA);
		angleC = LawOfCosines(edgeC,edgeA,edgeB);
	}
	
	double circumscribedCircleRadius(){//OÚ~Ì¼aðÔ·
		return ( edgeA / sin(angleA) / 2.0 );
	}
	double circumscribedCircleX(){//OS(OÚ~ÌS)ÌXÀWðÔ·
		double A = sin(2.0*angleA);
		double B = sin(2.0*angleB);
		double C = sin(2.0*angleC);
		return ( (a.X * A + b.X * B + c.X * C) / (A+B+C) );
	}
	double circumscribedCircleY(){//OS(OÚ~ÌS)ÌYÀWðÔ·
		double A = sin(2.0*angleA);
		double B = sin(2.0*angleB);
		double C = sin(2.0*angleC);
		return ( (a.Y * A + b.Y * B + c.Y * C) / (A+B+C) );
	}
};

int main(){
	int n;
	double x1, x2, x3, y1, y2, y3;
	double r, xp, yp;

	scanf("%d", &n);
	for (int i=0 ; i<n ; i++){
		scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);
		P a( x1 , y1 );
		P b( x2 , y2 );
		P c( x3 , y3 );
		Triangle Tr(a,b,c);
		r  = Tr.circumscribedCircleRadius();
		xp = Tr.circumscribedCircleX();
		yp = Tr.circumscribedCircleY();
		printf("%.3f %.3f %.3f\n", xp,yp,r);
	}

	return 0;
}

Measured memory_bytes: 0
#include <stdio.h>

#define MILLENNIUM 1000
#define y_days(year) ((year)%3? 195: 200)
#define m_days(year, month) ((year)%3? (month)%2? 20: 19: 20)

int main(void)
{
    int year, month, day, n, i, res;

    scanf("%d", &n);

    while(n--)
    {
        /* init, input */
        res = 0;
        scanf("%d %d %d", &year, &month, &day);

        /* count */
        for(i=year+1; i<MILLENNIUM; i++) res += y_days(i);
        for(i=month+1; i<=10; i++) res += m_days(year, i);
        res += m_days(year, month) - day + 1;

        /* print */
        printf("%d\n", res);
    }

    return 0;
}

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

#define int long long

using namespace std;

const long long N = 1e6;
const long long INF = 1e9;

vector<char> a;
vector<int> cnt;
vector<int> foc;
int len;
int q = 850;

int query(string s)
{
    q--;
    if (q < 0) exit(0);
    cout << "? " << s << endl;
    int x;
    cin >> x;
    return x;
}

string Merge(string a, string b)
{
    //cout << "merging " << a << " " << b << endl;
    vector<string> before(a.size() + 1);
    int j = 0;
    for (int i = 0; i < b.size();)
    {
        string s = "";
        for (int k = 0; k < a.size(); k++)
        {
            s += before[k];
            if (j == k) s += b[i];
            s += a[k];
        }
        s += before.back();
        if (j == a.size()) s += b[i];
        int x = query(s);
        if (x == len - s.size())
        {
            before[j] += b[i];
            i++;
        }
        else
        {
            j++;
        }
    }
    string res = "";
    for (int i = 0; i < a.size(); i++) res += before[i], res += a[i];
    res += before.back();
    //cout << "Merge of " << a << " " << b << " = " << res << endl;
    return res;
}

signed main()
{
    for (char c = 'a'; c <= 'z'; c++) a.push_back(c);
    for (char c = 'A'; c <= 'Z'; c++) a.push_back(c);
    for (char c = '0'; c <= '9'; c++) a.push_back(c);

    #ifdef LOCAL
    a = {'a', 'b', 'c'};
    #endif // LOCAL

    for (int i = 0; i < a.size(); i++)
    {
        string s(128, a[i]);
        int x = query(s);
        foc.push_back(x);
    }
    for (int len = 1; len <= 128; len++)
    {
        vector<int> cc;
        int x = 0;
        for (int j = 0; j < a.size(); j++)
        {
            int alpha = foc[j];
            alpha -= 128 - len;
            cc.push_back(len - alpha);
            x += len - alpha;
        }
        if (x == len) cnt = cc;
    }
    for (int i = 0; i < cnt.size(); i++) len += cnt[i];

    //cout << "cnts = ";
    //for (int i = 0; i < cnt.size(); i++) cout << cnt[i] << " "; cout << endl;

    set<pair<int, string> > ss;
    for (int i = 0; i < cnt.size(); i++)
    {
        string g = "";
        for (int j = 0; j < cnt[i]; j++) g += a[i];
        if (g.size()) ss.insert({g.size(), g});
    }
    while (ss.size() > 1)
    {
        pair<int, string> x = *(ss.begin()); ss.erase(ss.begin());
        pair<int, string> y = *(ss.begin()); ss.erase(ss.begin());
        string z = Merge(x.second, y.second);
        ss.insert({z.size(), z});
    }
    auto it = ss.begin();
    cout << "! " << (*it).second << endl;
}


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

int main(void) {

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

}


Measured memory_bytes: 3116
#include<stdio.h>
#include<string.h>
int main()
{
    char o[50]= {'\0'},f[50]= {'\0'};
    int i,a=0,b=0,u,p;
    while(~scanf("%s",o))
    {
        getchar();
        scanf("%s",f);
        getchar();
        u=strlen(o);
        p=strlen(f);
        if(u==p||u-p==1)
        {
            for(i=0; i<50; i++)
            {
                if(f[i]=='\0')
                {
                    if(o[i]!='\0')
                        printf("%c",o[i]);
                    break;
                }
                printf("%c%c",o[i],f[i]);
            }
            printf("\n");
        }
        for(i=0; i<50; i++)
        {
            o[i]='\0';
            f[i]='\0';
        }
    }
}

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

int power(int b, int e, int mod) {
    if (e == 0) return 1;
    int x = power(b, e >> 1, mod);
    x = 1LL * x * x % mod;
    if (e & 1)
        x = 1LL * x * b % mod;

    return x;
}


long long modInverse(long long a, int m)
{
    return power(a, m-2, m);
}


int n, a, b, m;
long long ans, mod = 1e9 + 7, fact[200005], ifact[200005];
long long solve(int N, int r){
    if (N < r)
        return 0;
//    cout << N << ' ' << r << endl;
    long long denum = (ifact[N-r] * ifact[r])%mod;
    return (fact[N]*denum)%mod;
}

int main(){
    cin >> n >> m >> a >> b;
    fact[0] = 1;
    ifact[0] = modInverse(1, mod);
    for(int i = 1; i<=200000; i++) {
        fact[i] = fact[i - 1] * i % mod;
        ifact[i] = modInverse(fact[i], mod);
    }
    int js = b, je = m - 1, ie = n - 1;
    for(int i = 0; i < n-a; i++){
        ans+=(solve(js - 1 + i, js - 1) * solve(je - js + ie - i, je - js)) % mod;
        ans%=mod;
//        cout << je - js + ie - i << ' ' <<  je - js << ' ' << solve(je - js + ie - i, je - js) << endl;
    }
    cout << ans;
}

Measured memory_bytes: 3328
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define rep(i, n) for (int i = 0; i < n; i++)

string S;

// startからendまでに２個連続の岩がないときtrue
int check1(int start, int end) {
  for (int i = start; i < end; i++) {
    if (S[i] == '#' && S[i + 1] == '#') {
      return false;
    }
  }
  return true;
}

// startからendまでにBがAに乗り越えられることのできる点があればtrue
int check2(int start, int end) {
  for (int i = start; i <= end; i++) {
    if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.') {
      return true;
    }
  }
  return false;
}

int main() {
  int n, a, b, c, d;
  cin >> n >> a >> b >> c >> d;
  cin >> S;

  S = "#" + S;

  bool flag1 = true;
  bool flag2 = true;

  flag1 = check1(a, c) && check1(b, d);

  if (d < c) {
    flag2 = check2(b, d);
  }

  string result;

  if (flag1 && flag2) {
    result = "Yes";
  } else {
    result = "No";
  }

  cout << result << endl;

  return 0;
}


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

int main_()
{
    int64_t A, B, C, K;
    cin >> A >> B >> C >> K;

    if (K % 2 == 0)
    {
        cout << (A - B) << endl;
    }
    else
    {
        cout << (B - A) << endl;
    }
}
int main()
{
    cin.tie(nullptr);
    cout.tie(nullptr);
    ios_base::sync_with_stdio(false);
    main_();
    return 0;
}


Measured memory_bytes: 256
"use strict";
    
const main = arg => {
    arg = arg.split("\n");
    //const k = parseInt(arg.slice(5, 6));
    const k = parseInt(arg[5]);
    const antennas = arg.slice(0, 5).map(n=>parseInt(n));
    
    console.log(antennas[4] - antennas[0] > k ? ":(" : "Yay!");
   
   /*
    for(let i=0; i<antennas.length; i++) {
        for(let j=i+1; j<antennas.length; j++) {
            if(antennas[j] - antennas[i] > k) {
                console.log(":(");
                return;
            }   
        }
    }
    
    console.log("Yay!");
    */
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 11468
#include <cstdio>


/* -----------------------------------------------------------------------------
	大域データ
----------------------------------------------------------------------------- */
int N;
double x;

int main () {

	double a;

	// 文字列数の読込み
	scanf("%d", &N);

	x = 0.0;
	for(int i = 0; i < N; i++) {
		scanf("%lf", &a);
		x += 1.0 / a;
	}

	printf("%.6lf\n", 1.0 / x);

	return 0;
}


Measured memory_bytes: 128
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author emli
 */


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

class AMultiplication1 {
public:
    void solve(std::istream& cin, std::ostream& cout) {
		ios::sync_with_stdio(false);
        cin.tie(nullptr);
        int a,b;
        cin >> a >> b;
        cout << a * b << endl;
	}
};


int main() {
	AMultiplication1 solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3608
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <math.h>
#include <iomanip>
#include <vector>
#include <queue>
#include <functional>
#include <random>
#include <time.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
#define rep(i,n) for(ll i=0;i<(n);i++)
int main() {
	string s;
	cin >> s;
	sort(s.begin(), s.end());
	cout << (s == "abc" ? "Yes" : "No" )<< endl;
	return 0;
}

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

struct Event {
	int x;
	char type;
};

int N, M;
int L[100004], R[100004];

int main()
{
	cin >> N >> M;
	for (int i = 0; i < M; ++i) {
		cin >> L[i] >> R[i];
	}
	vector<Event> events; //contiene todas las entradas y salidas en orden de aparicion.
	for (int i = 0; i < M; ++i) {
		events.push_back({ L[i],'E'}); //entrada
		events.push_back({ R[i], 'X'}); //salida
	}

	sort(events.begin(),events.end(),
		[&](Event a, Event b) -> bool {
		if (a.x != b.x) return a.x < b.x;
		return a.type < b.type;
	    });
//Para el caso en que exista una entrada y una salida al mismo tiempo, procesa la entrada primero.
	//Si quiero saber el momento durante una fiesta donde hubieron mas personas, si una persona llega cuando otro se va, quiero contar al que llegar y despues quitar al que
	//se va. Todo depende el problema.

	int cnt = 0;
	int best = 0;
	bool ok1 = 0;
	int little = 0, big = 0;
	for (Event e : events) {
		if (e.type == 'E') { //si es una entrada agregalo a la lista
			++cnt;
			best = max(best, cnt);
			little = e.x;
		}
		else { //si es una salida, quitalo de la lista.
			if(ok1){
				big = e.x;
				break;
			}
			--cnt;
		}
		if(cnt == M){
			ok1 = 1;
		}
	}
	if(!ok1){
		cout << 0;
		return 0;
	}
	//cout << little << " " << big << endl;
	cout << abs(big - little) + 1 << endl;
}

Measured memory_bytes: 3188
#include<stdio.h>
int main(void){
int a,n,i,min=1000000,max=-1000000;
long int sum=0;
scanf("%d",&n);
for(i=0;i<n;i++){
  scanf("%d",&a);
  sum+=a;
  if(min>a)
  min=a;
  if(max<a)
  max=a;
}
printf("%d %d %ld\n",min,max,sum);
  return 0;
}



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

#define NMAX 20

using namespace std;

int n;
int perm[NMAX];
int cntr;

int main()
{
    cin >> n;
    for(int i = 0; i < n; i++)
        cin >> perm[i];

    for(int i = 1; i < n - 1; i++)
    {
        int first = perm[i - 1];
        int second = perm[i];
        int third = perm[i + 1];

        if(first < second && second < third || first > second && second > third)
            cntr++;
    }
    cout << cntr << '\n';
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>
#include <deque>
using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;
#define LNF __LONG_LONG_MAX__;
const ll MOD = 1000000007;
const int MAX = 200000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//最大公約数
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
//最小公倍数
int lcm(int x, int y) { return x / gcd(x, y) * y; }
// nが大きく,kが10^7程度の時の二項係数
long long com[200005];
void combination(long long n,long long k){
    com[0] = 1;
    for(int i=1;i<=k;i++){
        com[i] = (com[i-1]*(n-i+1)%MOD)*modinv(i,MOD)%MOD;
    }
}

int main(){
    ll N,K; cin >> N >> K;
    ll x=N/K;
    ll y=N%K;
    ll a=N-K*x;
    ll b=abs(y-K);
    //cerr << N << " " << a << " " << b << endl;
    cout << min(N,min(a,b)) << endl;;
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
const int INF = 1000000000;
struct edge{int from,to,cost;};

int v,e,r;
vector<edge> E;

int main(){
  scanf("%d %d %d",&v,&e,&r);
  for(int i=0;i<e;i++){
    int s,t,d;
    scanf("%d %d %d",&s,&t,&d);
    edge tmp;
    tmp.from = s;
    tmp.to = t;
    tmp.cost = d;
    E.push_back(tmp);
  }
  int d[v];
  fill(d,d+v,INF);
  d[r] = 0;
  int times;
  for(times=0;times<=v;times++){
    bool flag = false;
    for(int i=0;i<E.size();i++){
      if(d[E[i].from]!=INF&&d[E[i].from]+E[i].cost<d[E[i].to]){
        flag = true;
        d[E[i].to] = d[E[i].from]+E[i].cost;
      }
    }
    if(flag==false) break;
  }
  if(times==v+1) printf("NEGATIVE CYCLE\n");
  else{
    for(int i=0;i<v;i++){
      if(d[i]==INF) printf("INF\n");
      else printf("%d\n",d[i]);
    }
  }
  return 0;
}

Measured memory_bytes: 1096
/* C++14 (Clang 3.8.0) for AtCoder */

#include <iostream>
#include <vector>
#include <string>
// #include <cmath>

using Input = std::vector<std::string>;
using Num = std::vector<int>;

Input input(void) {
	Input result;
	{
		std::string buf = "", row = "";
		std::getline(std::cin, buf);
		for (unsigned int i = 0; i < buf.size(); i++) {
			if (' ' == buf[i]) {
				result.push_back(row);
				row = "";
			} else {
				row += buf[i];
			}
		}
		result.push_back(row);
	}
	return result;
}

Num replaceToInteger(Input original = {""}) {
	Num result;
	for (unsigned int i = 0; i < original.size(); i++) {
		result.push_back(atoi(original[i].c_str()));
	}
	return result;
}

int main(void) {

	Num s = replaceToInteger(input());

	switch (s[0]) {
	case (0):
		printf("0\n");
		break;
	case (1):
	case (10):
	case (100):
		printf("1\n");
		break;
	case (11):
	case (101):
	case (110):
		printf("2\n");
		break;
	case (111):
		printf("3\n");
		break;
	default:
		break;
	}

	return 0;
}


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

int N, M, K;
vector<int> par, sz, fr;

int root(int x){
    return par[x] == x ? x : root(par[x]);
}

void unit(int x,int y){
    x = root(x), y = root(y);
    if(x == y)
        return;
    else
        if(x < y)
            par[y] = x, sz[x] += sz[y];
        else
            par[x] = y, sz[y] += sz[x];
}

int main(){
    cin >> N >> M >> K;
    par.resize(N);
    sz.resize(N,1);
    fr.resize(N,0);
    for (int i = 0; i < N;i++)
        par[i] = i;

    for (int i = 0; i < M;i++){
        int a, b;
        cin >> a >> b;
        a--, b--;
        fr[a]++, fr[b]++;
        unit(a, b);
    }
    vector<vector<int>> block(N, vector<int>(0));
    for (int i = 0; i < K;i++){
        int a, b;
        cin >> a >> b;
        a--, b--;
        block[a].emplace_back(b);
        block[b].emplace_back(a);
    }
    vector<int> ans(N, 0);
    for (int i = 0; i < N;i++){
        int x = root(i);
        ans[i] = sz[x] - 1 - fr[i];
        for (int y : block[i])
            if(root(y) == x)
                ans[i]--;
    }
    for (int i = 0; i < N; i++)
        cout << ans[i] << " ";
    cout << endl;
    return 0;
}

Measured memory_bytes: 7552
#include <bits/stdc++.h>
using namespace std;
#define int long long
using ll=long long;
using vi=vector<int>;
using vl=vector<long long>;
using pii=pair<int,int>;
using pll=pair<long long,long long>;
#define ITR(i,c) for(auto i=begin(c);i!=end(c);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define REPW(i,n) for(i=0;i<(int)(n);++i)
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)   // c++14
#define SZ(c) ((int)c.size())
#define EXIST(c,x) (c.find(x)!=end(c))
#define OUTOFRANGE(y,x,h,w) (y<0||x<0||y>=h||x>=w)
#define dump(...)
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
#define INF (1001001001)
#define INFLL (1001001001001001001ll)
template<class T> ostream& operator << (ostream &os,const vector<T> &v) {
    ITR(i,v) os << *i << (i==end(v)-1 ? "" : "\n"); return os; }
template<class T> istream& operator >> (istream &is,vector<T> &v) {
    ITR(i,v) is >> * i; return is; }
template<class T> istream& operator >> (istream &is, pair<T,T> &p) {
        is >> p.first >> p.second; return is; }
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
//------------------------------------------------------------------------------
struct before_main_function {
    before_main_function() {
        #ifdef int
            #undef INF
            #define INF INFLL
            #define stoi stoll
        #endif
        // cin.tie(0);ios::sync_with_stdio(false);
        cout<<setprecision(15)<<fixed;
    }
} before_main_function;
//------------------------------------------------------------------------------

signed main() {
    int H,W;
    cin>>H>>W;
    vector<string> a(H);
    cin>>a;
    REP(i,W+2) putchar('#'); putchar('\n');
    REP(i,H) cout<<'#'<<a[i]<<'#'<<endl;
    REP(i,W+2) putchar('#'); putchar('\n');
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#define LL long long
#define int long long
#define Set(s,v) memset(s,v,sizeof(s))
using namespace std;
inline LL read(){
    LL ans=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-'){f=-1;}ch=getchar();}
    while(ch>='0'&&ch<='9'){ans=(ans<<3)+(ans<<1)+(ch^48);ch=getchar();}
    return ans*f;
}
void write(LL x){
    if(x<0){putchar('-');x=-x;}
    if(x>9){write(x/10);}
    putchar(x%10|48);
}
const int MOD=1e9+7;
int n,k;
int jc[10000005],inv[10000005];

inline int ksm(int a,int b){
    int res=1,base=a;
    while(b){
        if(b&1){
            res=(res*base)%MOD;
        }
        base=(base*base)%MOD;
        b>>=1;
    }
    return res;
}
inline int C(int x,int y){
    return 1ll*jc[x]*inv[y]%MOD*inv[x-y]%MOD;
}

signed main(){
    n=read(),k=read();
    jc[0]=jc[1]=inv[0]=inv[1]=1;
    for (int i=2;i<=n;i++) jc[i]=(jc[i-1]*i)%MOD;
    inv[n]=ksm(jc[n],MOD-2);
    for (int i=n-1;i>1;i--) inv[i]=(inv[i+1]*(i+1))%MOD;
    for (register int i=1;i<=k;i++){
        write((C(k-1,i-1)*C(n-k+1,i))%MOD);
        putchar('\n');
    }
    return 0;
}

Measured memory_bytes: 2304
#include <stdlib.h>
#include <iostream>

using namespace std;

int main(){
	int N,K;
	cin >> N >> K;
	char* S = (char*)calloc(N+1, sizeof(char));
	cin >> S;
	
	for(int i = 0; i < N; i++){
		if(i+1 == K)
			S[i] += 32;
	}
	
	cout << S << endl;
	
}

Measured memory_bytes: 3636
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <deque>
#include <tuple>
using namespace std;
typedef long long ll;
#define for1(i,n) for (ll i=0;i<(n);(i)++)
#define for2(i,m,n) for (ll (i)=(m);(i)<(n);(i)++)
#define for3(i,m,n,d) for (ll (i)=(m);(i)<(n);(i)+=(d))
#define INF (1LL << 60)
#define STRING(str) #str
#define DEBUG 0
#if DEBUG
    #define dump(var) dump2(STRING(var), var)
#else
    #define dump(var)
#endif

template <typename T>
void dump2(const string& name, const T& value)
{
    cerr << name << ": " << value << endl;
}
void dump2(const string& name, const tuple<ll,ll,ll>& value)
{
    ll a,b,c;
    tie(a,b,c) = value;
    cerr << name << ": (" << a << ", " << b << ", " << c << ")" << endl;
}

void solve()
{
    ll ans = 0;
    ll N;
    map<string,ll> data;
    cin >> N;
    string olds;
    cin >> olds;
    data[olds] = 1;
    for1(i,N-1) {
        string s;
        cin >> s;
        if (data[s] == 1) {
            cout << "No" << endl;
            return;
        }
        data[s] = 1;
        if (olds.substr(olds.length()-1,1) != s.substr(0,1)) {
            cout << "No" << endl;
            return;
        }
        olds = s;
    }
    cout << "Yes" << endl;
}

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


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

int main(){
 int n;
  cin >> n;
  VI l(n);
  rep(i,n){
   cin >> l.at(i);
  }
  sort(l.begin(),l.end());
  int sum=0;
  rep(i,n){
    sum+=l.at(i);
  }
  if(sum>l.at(n-1)*2){
    cout <<"Yes" << endl;
  }
  else cout << "No"<< endl;
  
}


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

int t;
int arr[100000+100][4] ;
long long dp[100000+100][4];

long long solve(int r ,int col=4)
{
    if(r>=t)
        return 0;
    long long &ret=dp[r][col] ;
    if(ret)
        return ret;
    for(int i=0 ;i<3;i++)
    {
        if(i==col) continue;
        ret=max(ret,arr[r][i]+solve(r+1,i));
    }
     
    return  ret;
}
int main()
{
     //freopen("input.txt", "rt", stdin);
    // freopen("output.txt", "wt", stdout);
    
    cin>>t;
    for (int i=0 ;i<t ;i++)
        cin>>arr[i][0]>>arr[i][1]>>arr[i][2];
    printf("%lld\n",solve(0));
    return 0;
}

Measured memory_bytes: 12800
#include <cstdio>
#include <utility>
#include <vector>
#include <algorithm>
#include <tuple>
using namespace std;

#define gcu getchar_unlocked
int in(int c){int n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;} //&&c<='9'
int in() {return in(gcu());}
bool scan(int &n){int c=gcu();return c==EOF?false:(n=in(c),true);}
bool scan(char &c){c=gcu();gcu();return c!=EOF;}
//bool scan(string &s){int c;s="";
//	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
template <typename head, typename... tail>
bool scan(head &h, tail&&... t){return scan(h) && scan(t...);}
#define pcu putchar_unlocked
#define vo inline void out
template <typename T>
vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
vo(const char *s){while(*s)pcu(*s++);}
vo(char c){pcu(c);}
//vo(string &s){for (char c: s) pcu(c);}
template <typename head, typename... tail> vo(head&& h, tail&&... t){out(h);out(move(t)...);}
//template <typename T> vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
#undef vo

typedef tuple<int, int, int> P;
enum {D, H, W, N = 150};

int main() {
	vector<P> p;
	for (int i = 1; i < N; i++)
		for (int j = i + 1; j < N; j++)
			p.push_back(P{i * i + j * j, i, j});
	sort(p.begin(), p.end());
	for (int w, h; w = in(), h = in(), w || h;) {
		auto r = upper_bound(p.begin(), p.end(), P{w * w + h * h, w, h});
		out(get<H>(*r), ' ', get<W>(*r), '\n');
	}
}


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

using namespace std;

//using Matrix = vector< vector<int> >;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9 + 10;
//const ll INF = 1e18 + 10LL;
int dx[5] = {0, 0, 1, -1, 0}, dy[5] = {1, -1, 0, 0, 0};
const double EPS = 1e-10;
bool cmp(P a, P b) { return a.second < b.second; } //End sort (Interval scheduling problem)
ll MOD = 1e9 + 7;

int n, k, q;
int a[100010];
int cnt[100010];

int main(void){
	cin>>n>>k>>q;
	for (int i = 0; i < q; i++) cin>>a[i];

	for (int i = 0; i < q; i++) cnt[a[i] - 1]++;

	for (int i = 0; i < n; i++) {
		if (k - (q - cnt[i]) <= 0) cout<< "No" <<endl;
		else cout<< "Yes" <<endl;
	}
	
	return 0;
}

Measured memory_bytes: 1408
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
using namespace std;
using ll = long long;

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

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

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

    cout << r << endl;

    return 0;
}

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

// clang-format off
#define  range(i, l, r) for (int i = (int)(l); i < (int)(r); ++(i))
#define rrange(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); --(i))

#define  whole(f, x, ...) ([&](decltype((x)) container) { return (f)(  begin(container),  end(container), ## __VA_ARGS__); })(x)
#define rwhole(f, x, ...) ([&](decltype((x)) container) { return (f)( rbegin(container), rend(container), ## __VA_ARGS__); })(x)

#define endl '\n'
#define debug(x) cerr << "(" << __LINE__ << ")" << #x << ": " << (x) << endl

using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

// constexpr i32 mod   = 998244353;
constexpr i32 mod   = 1e9 + 7;
constexpr i32 inf   = 1001001001;
constexpr i64 infll = 1001001001001001001ll;

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

struct IoSetup { IoSetup(int x = 15){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(x); cerr << fixed << setprecision(x); } } iosetup;

template <typename T = i64> T input() { T x; cin >> x; return x; }

template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { range(i, 0, v.size()) { os << v[i] << (i + 1 != v.size() ? " " : ""); } return os; } 
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }

template <typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template <typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }

template <typename T> vector<T> make_vector(size_t a, T b) { return vector<T>(a, b); }
template <typename... Ts> auto make_vector(size_t a, Ts... ts) { return vector<decltype(make_vector(ts...))>(a, make_vector(ts...)); }

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// clang-format on

void solver() {
    int N = input(), W = input();
    vector< i64 > dp(W + 1);
    
    range(i, 0, N) {
        int w = input(), v = input();
        rrange(j, w, dp.size()) {
            chmax(dp[j], dp[j - w] + v);
        }
    }
    
    cout << *whole(max_element, dp) << endl;
}

signed main(int argc, char *argv[]) {
    solver();
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=100005,INF=1<<30;
int H,W;
int t;
bool DFS(vector<string> &S,vector<int> used,vector<pair<int,int>> p){
    
    if(p.size()*2>=W){
        vector<int> used2(H);
        for(int i=0;i<H;i++){
            if(used2[i]) continue;
            vector<int> ok(H,1);
            for(int j=i+1;j<H;j++){
                for(int k=0;k<p.size();k++){
                    int a=p[k].first,b=p[k].second;
                    if(b==-1){
                        if(S[i][a]!=S[j][a]) ok[j]=0;
                    }else{
                        if(S[i][a]!=S[j][b]) ok[j]=0;
                        if(S[i][b]!=S[j][a]) ok[j]=0;
                    }
                }
            }
            
            for(int j=i+1;j<H;j++){
                if(ok[j]&&used2[j]==0){
                    used2[i]=1;
                    used2[j]=1;
                    break;
                }
            }
        }
        
        int cnt2=0,wh=-1;
        
        for(int i=0;i<H;i++){
            if(used2[i]==0){
                cnt2++;
                wh=i;
            }
        }
        
        if(cnt2==0) return true;
        else if(cnt2==1){
            for(int k=0;k<p.size();k++){
                int a=p[k].first,b=p[k].second;
                if(b!=-1&&S[wh][a]!=S[wh][b]) return false;
            }
            //for(int k=0;k<p.size();k++) cout<<p[k].first<<" "<<p[k].second<<endl;
            return true;
        }else return false;
    }else if(W-int(p.size())*2==1){
        for(int i=0;i<W;i++){
            if(used[i]==0){
                used[i]=1;
                p.push_back({i,-1});
            }
        }
        return DFS(S,used,p);
    }else{
        int cn=0;
        for(int i=0;i<W;i++){
            if(used[i]) continue;
            for(int j=i+1;j<W;j++){
                if(used[j]) continue;
                
                used[i]=1;
                used[j]=1;
                p.push_back({i,j});
                
                if(DFS(S,used,p)) return true;
                
                used[i]=0;
                used[j]=0;
                p.pop_back();
            }
            cn++;
            if(cn==2) break;
        }
        
        return false;
    }
}

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin>>H>>W;
    vector<string> S(H);
    for(int i=0;i<H;i++) cin>>S[i];
    
    vector<int> used(W);
    vector<pair<int,int>> p;
    if(DFS(S,used,p)) cout<<"YES\n";
    else cout<<"NO\n";
}


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

int main() {
  int n;
  cin >> n;
  if(n % 2 != 0) {
    cout << "Hello World" << endl;
  }
  else {
    int a, b;
    cin >> a >> b;
    int ans = a + b;
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
#define endl '\n'
#define debug(X) cout << #X << " = " << X << endl

using namespace std;

const int MN = 200010;
const int MD = 1e9 + 7;

int a[MN], dp[MN];

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	#ifdef UTP
	freopen("input.txt", "r", stdin);
	#endif
	int n; cin >> n;
	for (int i = 1; i <= n; i++)
        cin >> a[i];
    map<int, int> last;
    dp[0] = 1;
    for (int i = 1; i <= n; i++) {
        dp[i] = dp[i - 1];
        if (last.count(a[i]) && last[a[i]] < i - 1)
            dp[i] = (dp[i] + dp[last[a[i]]]) % MD;
        last[a[i]] = i;
    }
    cout << dp[n] << endl;
	return 0;
}


Measured memory_bytes: 11264
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <stdlib.h>

#define ll long long
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
#define show(a) cerr << #a <<" -> "<< a <<"\n"

using namespace std;

const int N = 1e3 + 2;
const int M = 1e6 + 5;
const int MOD = 1e9 + 7;


int n,m;

ll  b[N][N], c[N], cnt, sum, ans;
map <ll, int> mp;
string s;
char a[N][N];


int main (){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen("king2.in", "r", stdin); freopen("king2.out", "w", stdout);
    cin >> n >> m;
    for (int i = 1; i <= n; i++){
        for (int j = 1; j <= m; j++){
            cin >> a[i][j];
        }
    }
    b[1][1] = 1;
    for (int i = 1; i <= n; i++){
        for (int j = 1; j <= m; j++){
            if (a[i - 1][j] != '#' && i - 1 >= 1){
                b[i][j] += b[i - 1][j];
            }
            if (a[i][j - 1] != '#' && j - 1 >= 1){
                b[i][j] += b[i][j - 1];
            }
            b[i][j] %= MOD;
        }
    }
    cout << b[n][m] % MOD;
    return 0;
}


Measured memory_bytes: 12432
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>

#define FASTIO
#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)

#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;


/*
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
*/

int n;

int W;
int w[120];
int v[120];
const int MX = 100100;

ll dp[MX];


int main() {
#ifdef FASTIO
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#endif
	cin >> n >> W;
	for (int i = 0; i < n; ++i) {
		cin >> w[i] >> v[i];
	}
	for (int i = 0; i < MX; ++i)
		dp[i] = W + 1;
	dp[0] = 0;
	for (int i = 0; i < n; ++i) {
		for (int j = MX - 1 - v[i]; j >= 0; --j)
			dp[j + v[i]] = min(dp[j + v[i]], dp[j] + w[i]);
	}
	int ans = 0;
	for (int i = 0; i < MX; ++i)
		if (dp[i] <= W)
			ans = i;
	cout << ans << "\n";
	return 0;
}




Measured memory_bytes: 1024
h,w = map(int,input().split())
a = []
for i in range(h):
    m = str(input())
    a.append(m)


ans = True

for i in range(h):
    for k in range(w):
        #上からi行目、左からk列目を見てる
        if a[i][k] == "#":
            if i != 0 and k != 0 and i != h-1 and k != w-1:
                if a[i][k-1] == "." and a[i][k+1] == "." and a[i-1][k] == "." and a[i+1][k] == ".":
                    ans = False
            elif i == 0 and k == 0 :
                if a[i][k+1] == "." and a[i+1][k] == ".":
                    ans = False
            elif i == 0 and k == w-1:
                if a[i][k-1] == "." and a[i+1][k] == ".":
                    ans = False
            elif i == h-1 and k == 0 :
                if a[i][k+1] == "." and a[i-1][k] == ".":
                    ans = False
            elif i == h-1 and k == w-1:
                if a[i][k-1] == "." and a[i-1][k] == ".":
                    ans = False

if (ans):
    print ("Yes")
else:
    print("No")
            
            
            

Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
#define re register
#define ll long long
#define in inline
#define get getchar()
#define db double
in int read()
{
	int t=0; char ch=get;
	while(ch<'0' || ch>'9') ch=get;
	while(ch<='9' && ch>='0') t=t*10+ch-'0', ch=get;
	return t;
}
const int _=666;
int n,m;
char ch[_][_],a[_][_],b[_][_];
int main()
{
	n=read(),m=read();
	for(re int i=1;i<=n;i++) scanf("%s",ch[i]+1);
	for(re int i=1;i<=n;i++)
	{
		for(re int j=2;j<=m-1;j++)
		{
			if(ch[i][j]=='#') a[i][j]=b[i][j]='#';
			else{
				if(i%2) a[i][j]='#',b[i][j]='.';
				else b[i][j]='#',a[i][j]='.';
			}
		}
		a[i][1]=b[i][m]='#';
		a[i][m]=b[i][1]='.';
	}
	for(re int i=1;i<=n;i++) {
		printf("%s\n",a[i]+1);
	}
	cout<<endl;
	for(re int i=1;i<=n;i++) {
		printf("%s\n",b[i]+1);
	}
}


Measured memory_bytes: 4724
#include<iostream>
#include<string>
#include <cmath>
#include <ctype.h>
using namespace std;
int a, b;
int main() {
    cin >> a >>b;
    if(((a > b)&&!(b==1&&a==13)) ||(a==1&&b==13)){
        cout << "Alice" << endl;
    }else if((a < b) || (b==1&&a==13)){
        cout << "Bob" << endl;
    }else{
        cout << "Draw" << endl;
    }
    return 0;
}

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

class Procon
{
    public Procon() { }
    static void Main(string[] agrs)
    {
        new Procon().Do();
    }

    Scanner cin;

    public void Do()
    {
        cin = new Scanner();
        long N = cin.nextInt();

        string S = "";
        long tmp = -2;
        while (true)
        {
            if (N == 0)
            {
                break;
            }
            if (N % tmp != 0)
            {
                S = "1" + S;
                N -= tmp / -2;
            }
            else
            {
                S = "0" + S;
            }
            tmp *= -2;
        }

        if (S == "")
        {
            S = "0";
        }
        Console.WriteLine(S);
    }
}

class Scanner
{
    string[] s;
    int i;
    int max_i;

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

    public string nextString()
    {
        if (i >= s.Length)
        {
            s = Console.ReadLine().Split(' ');
            max_i = s.Length;
            i = 0;
            if (max_i == 0)
            {
                return "";
            }
            return s[i++];
        }
        else
        {
            return s[i++];
        }
    }

    public int nextInt()
    {
        return int.Parse(nextString());
    }


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

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

    public string[] arrayString()
    {
        return Console.ReadLine().Split(' ');
    }

    public int[] arrayInt()
    {
        string[] str = Console.ReadLine().Split(' ');
        int[] array = new int[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = int.Parse(str[i]);
        }
        return array;
    }

    public long[] arrayLong()
    {
        string[] str = Console.ReadLine().Split(' ');
        long[] array = new long[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = long.Parse(str[i]);
        }
        return array;
    }

    public double[] arrayDouble()
    {
        string[] str = Console.ReadLine().Split(' ');
        double[] array = new double[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = double.Parse(str[i]);
        }
        return array;
    }
}

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

int main () {
  int N; cin >> N;
  int64_t a = 2, b = 1;
  if (N == 1) {
   cout << b;
   return 0;
  }
  for (int i=1;i<N;i++) {
    a += b;
    swap(a,b);
  }
  cout << b;
}


Measured memory_bytes: 256
#include <stdio.h>

int rec(int,int);
int array[2000];
int n;

int main()
{

  int i,m,a;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&array[i]);
  }
  scanf("%d",&m);
  for(i=0;i<m;i++){
    scanf("%d",&a);
    if(rec(0,a)) printf("yes\n");
    else printf("no\n");
  }
    return 0;
}


int rec (int i,int a)
{
  int turn;
  if(a==0) return 1;
  if(i>=n) return 0;
  turn=rec(i+1,a)||rec(i+1,a-array[i]);
  return turn;
}

Measured memory_bytes: 584
def main():
	n,a,b,c,d = map(int,input().split())
	a-=1
	b-=1
	c-=1
	d-=1
	s = input()
	if '##' in s[a:c+1] or '##' in s[b:d+1]:
		print('No')
		return

	if c<d:
		print('Yes')
		return
	elif '...' in s[b-1:d+2]:
		print('Yes')
		return
	else:
		print('No')
main()


Measured memory_bytes: 3572
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {

	var s string
	count := 0
	var bb, cost, a, b int
	cost = 10000
	nocost := 1
	for {
		bool := sc.Scan()
		if bool {
			s = sc.Text()
			s2 := strings.Split(s, " ")
			if count == 0 {
				bb, _ = strconv.Atoi(s2[1])
			} else {
				a, _ = strconv.Atoi(s2[0])
				b, _ = strconv.Atoi(s2[1])

				if b <= bb && a < cost {
					cost = a
					nocost = 0
				}
			}
			count++
		} else {
			break
		}

	}
	if nocost == 1 {
		fmt.Println("TLE")
	} else {
		fmt.Println(cost)
	}

}

Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <cmath>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <math.h> //円周率はM_PI
using namespace std;


int main() {

	int N;
	cin >> N;
	vector<string> s(N);

	for (int i = 0; i < N; i++) {
		cin >> s.at(i);
	}
	sort(s.begin(), s.end());

	int ans = 1;
	for (int i = 1; i < N; i++) {
		if (s.at(i - 1) == s.at(i))continue;
		ans++;
	}
	cout << ans << endl;



}


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

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
typedef pair<ll,ll> pll;
int dx[4] = {1,0,0,-1};
int dy[4] = {0,1,-1,0};
#define MOD 1000000007
#define ARRAY_MAX 200005

const int INF = 1e9+7;


int main(){

    ll n;
    cin >> n;
    vector<ll> a(ARRAY_MAX,0);
    for(int i = 0;i < n;i++){
        cin >> a[i];
    }
    deque<ll> dq;
    if(n % 2 == 0){
        for(int i = 0;i < n;i++){
            if(i%2 == 0){
                dq.push_back(a[i]);
            }else{
                dq.push_front(a[i]);
            }
        }
    }else{
        for(int i = 0;i < n;i++){
            if(i%2 == 0){
                dq.push_front(a[i]);
            }else{
                dq.push_back(a[i]);
            }
        }
    }

    cout << dq.front();
    dq.pop_front();
    while(!dq.empty()){
        cout << " " << dq.front();
        dq.pop_front();
    }
    cout << endl;




    return 0;
}

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

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define  rep(i, n)    for(ll (i)=0; (i)<(n);  (i)++)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T1, class T2> inline void minup(T1& m, T2 x){ if(m>x) m=static_cast<T2>(x); }
template<class T1, class T2> inline void maxup(T1& m, T2 x){ if(m<x) m=static_cast<T2>(x); }

#define INF 1000000000
#define MOD 1000000009
#define EPS 1E-9

ll n;
ll res = 1LL;

int main()
{
  cin >> n;
  rep(i, n) res *= i + 1;

  cout << res << endl;

  return 0;
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define debug(x)  cout << #x << " = " << (x) << endl;
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;

int main() {
  string S; cin >> S;
  
  while(true) {
    S.pop_back();
    S.pop_back();
    string S_left = S.substr(0,S.size()/2);
    string S_right = S.substr(S.size()/2);
    if (S_left == S_right) {
      cout << S.size() << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define cout16 cout << setprecision(16) 
#define rep(i,n) for(int i=0;i<n;i++ )
#define rep2(i,f,n) for(int i=f;i<n;i++ )
#define SORT(A) sort(A.begin(),A.end())
#define REV(A) reverse(A.begin(),A.end())
typedef long long int ll;
using vi = std::vector<int>;
using vvi = std::vector<std::vector<int>>;
using vll = std::vector<ll>;
using vvll = std::vector<std::vector<ll>>;
using P = std::pair<int,int>;
using vp = std::vector<P>;
using namespace std;
#define INF 1001001001
#define LL_INF 1001001001001001001
#define fi first
#define se second
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
//const int mod = 1000000007;
const int mod = 998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
int main(void) {
	int n; cin >> n;
	vi d(n); rep(i,n) cin >> d[i];
	vi cnt(n,0);
	rep(i,n) cnt[d[i]]++;
	int mx = 0;
	rep(i,n) mx = max(mx,d[i]);
	if(mx==0){
		cout << 0 << endl;
		return 0;
	}
	if(cnt[0]!=1){
		cout << 0 << endl;
		return 0;
	}
	if(d[0]!=0){
		cout << 0 << endl;
		return 0;
	}
	mint ans = 1;
	rep2(i,1,mx+1){
		mint a = cnt[i-1];
		ll b = cnt[i];
		ans *= a.pow(b);
	}
/* 	
	cout << "max = " << mx << endl;
	rep(i,100){
		cout << i << " " << cnt[i] << endl;
	}
	 */
	cout << ans << endl;
}


Measured memory_bytes: 3992
#include <cstdio>

int main()
{
	int n;
	scanf("%d", &n);

	int i;
	unsigned long sum;
	sum = 0;

	for (i = 1; i <= n; i++) {
		if (i % 3 == 0 || i % 5 == 0)
			continue;
		else
			sum += i;
	}
	printf("%lu\n", sum);
	return 0;
}


Measured memory_bytes: 1712
#include<bits/stdc++.h>
using namespace std;
int a,b,c;
int s[105];
int ans=0;
int main()
{
	scanf("%d",&a);
	for(int i=1;i<=a;i++)
	{
		scanf("%d",&s[i]);
		ans+=s[i];
	}
	sort(s+1,s+a+1);
	if(s[a]*2<ans)
	{
		printf("Yes");
	}
	else
	{
		printf("No");
	}
}

Measured memory_bytes: 256