akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
signed main(){
  string a;
  cin>>a;
  int b=0;
  rep(i,a.size()){
  rep(j,a.size()){
    if(a.at(i)==a.at(j))
      b++;
  }
  }
  bool c=true;
  if(b>a.size())
    c=false;
  if(c)
    cout<<"yes";
  else
    cout<<"no";
  }

Measured memory_bytes: 256
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_C main
#include "bits/stdc++.h"
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LLONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
using psi = pair<string, int>;
// functions

#endif


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

    int N; cin >> N;
    vi A(N); REP(i, N) cin >> A[i];

    sort(A.begin(), A.end());
    stack<int> plus, minus;
    plus.push(A[N - 1]);
    minus.push(A[0]);
    FOR(i,1,N-1) {
        if (A[i] >= 0) plus.push(A[i]);
        else minus.push(A[i]);
    }
    vi vx, vy;
    REP(i,N-1) {
        if (plus.size()>1) {
            int x = minus.top(); minus.pop();
            int y = plus.top(); plus.pop();
            vx.push_back(x); vy.push_back(y);
            minus.push(x - y);
        } else if (minus.size()>0) {
            int x = plus.top(); plus.pop();
            int y = minus.top(); minus.pop();
            vx.push_back(x); vy.push_back(y);
            plus.push(x - y);
        }
    }

    int ans = plus.top();
    cout << ans << endl;
    for(int i=0; i<vx.size(); i++) {
        cout << vx[i] << " " << vy[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 3524
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vector<VecP>;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m); (i) > (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define R cin>>
#define repr(i, n) REPR(i, n, 0)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define in(a) insert(a)
#define P(p) cout<<(p)<<endl;
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SORT(a) sort((a).begin(), (a).end())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ld PI = acos(-1);
const ld EPS = 1e-11;
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
template<typename T> void co(T e){cout << e << "\n";}
template<typename T> void co(const vector<T>& v){for(const auto& e : v)
    { cout << e << " "; } cout << "\n";}
ll gcd(ll a, ll b) {
    if (a < b)swap(a, b);
    if (b == 0) return a;
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}
ll lcm(ll a, ll b) {
    ll g = gcd(a, b);
    return a * b / g;
}
bool prime(ll n) {
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n%i == 0)return false;
    }
    return n != 1;
}

Vec fac, finv;

ll PowMod(ll a, ll n){
    if(n == 1) return a;
    if(n%2 == 0) return PowMod(a*a%MOD, n/2);
    return a*PowMod(a*a%MOD, n/2)%MOD;
}

ll combi(ll n, ll k){
    if(k>n) return 0;
    return fac[n]*finv[k]%MOD*finv[n-k]%MOD;
}

int main(){
    sonic();
    int n, m;
    R n;
    map<int,int> A;
    rep(i, n){
        int d;
        R d;
        A[d]++;
    }
    R m;
    rep(i, m){
        int t;
        R t;
        A[t]--;
        if(A[t] < 0){
            co("NO");
            return 0;
        }
    }
    co ("YES");
}


Measured memory_bytes: 9600
#include <iostream>
#include <cstdio>
#include <string.h>
#include <math.h>
#include <algorithm>
using namespace std;
typedef long long ll;
#define mem(a,b) memset(a,b,sizeof(a))
#define rep(i,a,b) for(int i = a;i < b;i++)
#define rep_(i,a,b) for(int i = a;i <= b;i++)

const int maxn = 100010;
const ll mod = 1000000007;
ll a[maxn];

ll quick_pow(ll x,ll tms) {
	ll ret = 1;
	while(tms) {
		if(tms&1) (ret *= x) %= mod;
		(x *= x) %= mod;
		tms >>= 1;
	}
	return ret;
}

ll inv(ll x) {
	return quick_pow(x,mod-2);
}

int main() {
	int n;
	scanf("%d",&n);
	rep(i,0,n) scanf("%d",&a[i]);
	ll ans = 0;
	ll multi = 0;
	ll stair = 1;
	rep_(i,1,n) (stair *= i) %= mod;
	rep_(i,1,n) (multi += stair*inv(i)) %= mod;
	(ans += a[0]*multi) %= mod;
	ll l = 1,r = n;
	rep(i,1,n) {
		(multi -= stair*inv(r--)) %= mod;
		(multi += stair*inv(++l)) %= mod;
		ans += a[i]*multi;
		ans %= mod;
	}
	if(ans < 0) ans += mod;
	printf("%lld\n",ans);
	return 0;
}


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

int main(){
 int n,k;
 cin >> n >> k;
 vector<int64_t> h(n);
 rep(i,n){
     cin >> h[i];
 }
 
sort(h.begin(),h.end(),greater<int>());

int64_t ans = 0;
 for(int i = k; i < n; ++i){
     ans += h[i];
 }
cout << ans << endl;
}

Measured memory_bytes: 1792
// template
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<long long, long long> LP;
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define REP_AB(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort(ALL(v))
#define UNIQUE(v) sort(ALL(v));v.erase(unique(ALL(v)), v.end());
#define SIZE(x) ((ll)(x).size())
#define REVERSE(v) reverse(ALL(v))
// true / false
#define BIN_SEARCH(v, a) binary_search(ALL(v), a)
// index
#define BIN_LEFT(v, a) (lower_bound(ALL(v), a) - v.begin())
#define BIN_RIGHT(v, a) (upper_bound(ALL(v), a) - v.begin())
#define BIN_INSERT(v, a) (v.insert(v.begin() + BIN_LEFT(v, a), a))
#define DEL(v, i) v.erase(v.begin() + i)
#define INSERT(v, i, a) v.insert(v.begin() + i, a)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a / gcd(a, b)) * b;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
#define out cout
#define in cin
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; }
// template end
 
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    ll N;
    string s;
    in >> N;
    in >> s;

    if(N >= 3200){
        out << s << endl;
    }else{
        out << "red" << endl;
    }
 

 

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i = 0; i < (N); i++)
#define repo(i,N) for(int i = 1; i < (N); i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
//#define num 1000000007
#define pi acos(-1.0)
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//#define int long long


int main() {
  int a, b;
  cin >> a>>b;
  
  int ans = max(a+b,a-b);
  
  ans = max(ans, a*b);
  
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<cstdio>
#include<string.h>
#include<cstdlib>

class Stack{
    public:
        Stack()
            :top(0)
        {
        };
        
        void push(int a){
            v.push_back(a);
            top++;
        };
        int pop(){
            int a = v[--top];
            v.pop_back();
            return(a);
        };
    private:
        int top;
        std::vector<int> v;
};
/*
void culcurate(Stack S, char* operata){
    if(strcmp(operata, "+")){
        int a = S.pop();
        int b = S.pop();
        S.push(a + b);
    }else if(strcmp(operata, "-")){
        int a = S.pop();
        int b = S.pop();
        S.push(a - b);
    }else if(strcmp(operata, "*")){
        int a = S.pop();
        int b = S.pop();
        S.push(a * b);
    }
}
*/
int main(){
    Stack S = Stack();
    char buf[100];
    while(scanf("%s", buf) != EOF){
        if(buf[0] == '+'){
            int a = S.pop();
            int b = S.pop();
            S.push(b + a);
        }else if(buf[0] == '-'){
            int a = S.pop();
            int b = S.pop();
            S.push(b - a);
        }else if(buf[0] == '*'){
            int a = S.pop();
            int b = S.pop();
            S.push(b * a);
        }else{
            int a = std::atoi(buf);
            S.push(a);
        }
    }
    
    printf("%d\n", S.pop());
    return 0;
}


Measured memory_bytes: 3244
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1167&lang=jp

#include<iostream>
#include<fstream>

#define Max_Len 1000000

using namespace std;

int triCalc(int num){
	static int count[Max_Len];
	static int triangle[Max_Len];
	static bool f = true;
	if (f){//初期化
		for (int i = 0; i < Max_Len; i++)
			count[i] = triangle[i] = Max_Len;
		f = false;
	}
	int triNum;

	int i = 1;
	while (i * (i + 1) * (i + 2) / 6 <= num)i++;
	i--;
	triNum = i * (i + 1) * (i + 2) / 6;

	if (triNum == num)return 1;
	while (num / 5 < triNum){
		if (triangle[num - triNum] == Max_Len){
			if (count[num] > triCalc(num - triNum) + 1)
				count[num] = triCalc(num - triNum) + 1;
		}
		else if (count[num] > triangle[num - triNum] + 1)
			count[num] = triangle[num - triNum] + 1;

		i--;
		triNum = i * (i + 1) * (i + 2) / 6;
	}
	return triangle[num] = count[num];
}

int oddCalc(int num){
	static int count[Max_Len];
	static int triangle[Max_Len];
	static bool f = true;
	if (f){//初期化
		for (int i = 0; i < Max_Len; i++)
			count[i] = triangle[i] = Max_Len;
		f = false;
	}

	int triNum;

	int i = 1;
	while (i * (i + 1) * (i + 2) / 6 <= num)i++;
	i--;
	while ((i * (i + 1) * (i + 2) / 6 )% 2 == 0)i--;
	triNum = i * (i + 1) * (i + 2) / 6;

	if (triNum == num)return 1;
	while (i > 0){
		if (triangle[num - triNum] == Max_Len){
			if (count[num] > oddCalc(num - triNum) + 1)
				count[num] = oddCalc(num - triNum) + 1;
		}
		else if (count[num] > triangle[num - triNum] + 1)
			count[num] = triangle[num - triNum] + 1;

		i--;
		while ((i * (i + 1) * (i + 2) / 6) % 2 == 0)i--;
		triNum = i * (i + 1) * (i + 2) / 6;
	}
	return triangle[num] = count[num];
}

int main(){
	int n;

	while (true){
		cin >> n;
		if (n == 0)break;

		cout << triCalc(n) << " " << oddCalc(n) << endl;
	}

	return 0;
}

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

int main() {
	// your code goes here
	string x,y;
	cin>>x>>y;
	if(x==y)
	{
		cout<<"=";
	}
	else if(x>y)
    {
    	cout<<">";
    }
    else
    {
    	cout<<"<";
    }
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int INF = 1000000001;
int main(){
  while (1){
    int N;
    cin >> N;
    if (N == 0){
      break;
    }
    vector<pair<int, int>> L;
    L.push_back(make_pair(-1, INF));
    for (int i = 0; i < N; i++){
      char c;
      cin >> c;
      if (c == 'W'){
        int l, S;
        cin >> l >> S;
        vector<pair<int, int>> L2;
        for (auto R : L){
          if (R.first == -1){
            if (S >= R.second){
              L2.push_back(make_pair(l, R.second));
              S -= R.second;
            } else if (S > 0){
              L2.push_back(make_pair(l, S));
              L2.push_back(make_pair(-1, R.second - S));
              S = 0;
            } else {
              L2.push_back(R);
            }
          } else {
            L2.push_back(R);
          }
        }
        swap(L, L2);
      }
      if (c == 'D'){
        int l;
        cin >> l;
        vector<pair<int, int>> L2;
        for (auto R : L){
          if (R.first == l){
            L2.push_back(make_pair(-1, R.second));
          } else {
            L2.push_back(R);
          }
        }
        swap(L, L2);
      }
      if (c == 'R'){
        int P;
        cin >> P;
        for (auto R : L){
          if (P >= R.second){
            P -= R.second;
          } else {
            cout << R.first << endl;
            break;
          }
        }
      }
    }
    cout << endl;
  }
}


Measured memory_bytes: 3244
/*input
10
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
*/
#include <bits/stdc++.h>  
#define fastIo ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)  
#define all(v) (v).begin(), (v).end()  
#define rall(v) (v).rbegin(), (v).rend()  
#define fi first  
#define se second  
#define sz size  
#define pb push_back  
#define mp make_pair  
using namespace std;  
  
//#define LOCAL  
#ifdef LOCAL  
    #define DEBUG(x) do { cout << #x << ": " << x << '\n'; } while (0)  
#else  
    #define DEBUG(x)   
#endif  
  
const double EPS = 1e-9;  
const double PI = 3.141592653589793238462;  
 
typedef long long ll;
ll arr[3005], dp[3005][3005];  
  
ll solve(int st, int end){  
    if(st > end) return 0;  
    if(dp[st][end] != -1) return dp[st][end];  
    ll a = arr[st] + min(solve(st + 2, end), solve(st + 1, end - 1));  
    ll b = arr[end] + min(solve(st + 1, end - 1), solve(st, end - 2));  
    return dp[st][end] = max(a, b);  
}  
  
int main(){  
    fastIo;  
      
    int n;  
    cin >> n;  
  
    ll sum = 0;  
    for(int i = 0; i < n; i++){   
        cin >> arr[i];  
        sum += arr[i];  
    }  
  	memset(dp, -1LL, sizeof(dp));
    cout << 2 * solve(0, n - 1) - sum << '\n';  
      
  
    return 0;  
} 

Measured memory_bytes: 70912
import std.algorithm;
import std.array;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void scan(T...)(ref T a) {
    string[] ss = readln.split;
    foreach (i, t; T) a[i] = ss[i].to!t;
}
T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    int p, q, r; scan(p, q, r);

    int ans = min(p + q, q + r, r + p);
    writeln(ans);
}


Measured memory_bytes: 256
#include <iostream>
#include <utility>
#include <queue>
#include <vector>
#include <map>

using namespace std;

typedef pair<int, int> P;

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

    map<int, vector<int>> m;
    for (int i = 0; i < N; i++) {
        int a, b;
        cin >> a >> b;
        m[M - a].push_back(b);
    }

    priority_queue<int> que;

    int ret = 0;

    for (int i = M; i >= 0; i--) {
        if (m.find(i) != m.end()) {
            for (int b : m[i]) que.push(b);
        }

        if (!que.empty()) {
            ret += que.top();
            que.pop();
        }
    }

    cout << ret << endl;
}

Measured memory_bytes: 10880
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<int> &o) {
    int a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
//const ll mod = 1e10;

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

int main() {
    double n, m, d;
    cin >> n >> m >> d;

    double ans = [&]() -> double {

        if (d == 0) {
            return 1.0 / n * (m - 1);
        } else {
            return 2.0 * (n - d) / n / n * (m - 1);
        }
    }();

    cout << setprecision(20) << ans << endl;
}


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

int main() {
  int n;
  cin >> n;
  int MAX = 1010100;
  vector<bool> is_prime(MAX, true);
  vector<bool> a(MAX, false);
  vector<int> cnt(MAX, 0);
  rep(i, n) {
    int c;
    cin >> c;
    a[c] = true;
    cnt[c]++;
  }
  for (int i = 1; i < MAX; ++i) {
    if (a[i] == false) continue;
    if (!is_prime[i]) continue;
    for (int j = i * 2; j < MAX; j += i) is_prime[j] = 0;
  }
  int ans = 0;
  rep(i, MAX) {
    if (a[i] == true && is_prime[i] == true && cnt[i] <= 1) {
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 7484
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define INF         1e9
#define REP(i,n)    for(lint i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)   for(lint i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)   for(lint i=(n)-1;i>=0;--i)
#define REPR1(i,n)  for(lint i=(n);i>0;--i)
#define REPC(i,obj) for(auto i:obj)
#define R_UP(a,b)   (((a)+(b)-1)/(b))
#define ALL(obj)    (obj).begin(),(obj).end()
#define SETP        std::cout << fixed << std::setprecision(8)
using namespace std;
using lint = long long;
template<typename T = lint>inline T in() { T x; cin >> x; return x; }

struct vec2d
{
	double x, y;
	vec2d(double x_, double y_) :x(x_), y(y_) {}
	vec2d operator+(const vec2d&v) { return vec2d(x + v.x, y + v.y); }
	vec2d operator-(const vec2d&v) { return vec2d(x - v.x, y - v.y); }
	vec2d operator*(double k) { return vec2d(x * k, y * k); }
	vec2d operator/(double k) { return vec2d(x / k, y / k); }
	double norm() { return hypot(x, y); }
};
list<vec2d>vertex{ vec2d(0, 0),vec2d(100, 0) };
void Koch_curve(const list<vec2d>::iterator&p1, const list<vec2d>::iterator&p2, const int depth_max)
{
	const static double sqrt_3 = sqrt(3);
	static int depth = 0;
	if (++depth <= depth_max)
	{
		const auto s = vertex.insert(next(p1), (*p1 * 2 + *p2) / 3);
		const auto u = vertex.insert(next(s),
			abs(p1->y - p2->y) < 0.00000001  ? vec2d((p1->x + p2->x) / 2, p1->y + (p2->x - p1->x) / 2 / sqrt_3)
			: p1->x < p2->x && p1->y < p2->y ? vec2d(p1->x, p1->y + (*p2 - *p1).norm() / sqrt_3)
			: p1->x < p2->x && p1->y > p2->y ? vec2d(p2->x, p2->y + (*p2 - *p1).norm() / sqrt_3)
			: p1->x > p2->x && p1->y < p2->y ? vec2d(p2->x, p2->y - (*p2 - *p1).norm() / sqrt_3)
			:                                  vec2d(p1->x, p1->y - (*p2 - *p1).norm() / sqrt_3)
		);
		const auto t = vertex.insert(next(u), (*p1 + *p2 * 2) / 3);
		Koch_curve(p1, s, depth_max);
		Koch_curve(s, u, depth_max);
		Koch_curve(u, t, depth_max);
		Koch_curve(t, p2, depth_max);
	}
	--depth;
}
signed main()
{
	int n = in();
	Koch_curve(vertex.begin(), prev(vertex.end()), n);
	SETP;
	REPC(i, vertex)cout << i.x << ' ' << i.y << endl;
}


Measured memory_bytes: 3536
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.Map.Entry;
import java.util.TreeMap;

public class Main {

	/* several useful subroutines */
	private static BufferedReader brStdin = new BufferedReader(new InputStreamReader(System.in));
	private static String[] readBuf = null;
	private static int readPtr = 0;
	private static String getString() throws IOException {
		while ( readBuf == null || readPtr >= readBuf.length ) {
			readBuf = brStdin.readLine().split(" ");
			readPtr = 0;
		}
		return readBuf[readPtr++];
	}
	private static int getInt() throws IOException {
		return Integer.parseInt(getString());
	}
	private static long getLong() throws IOException {
		return Long.parseLong(getString());
	}
	private static BigDecimal getBD() throws IOException {
		return new BigDecimal(getString());
	}
	@SuppressWarnings("unused")
	private static String[] getStringArray(int size) throws IOException {
		String stringArray[] = new String[size];
		for (int i = 0; i < stringArray.length; i++) {
			stringArray[i] = getString();
		}
		return stringArray;
	}
	@SuppressWarnings("unused")
	private static int[] getIntArray(int size) throws IOException {
		int intArray[] = new int[size];
		for (int i = 0; i < intArray.length; i++) {
			intArray[i] = getInt();
		}
		return intArray;
	}
	@SuppressWarnings("unused")
	private static long[] getLongArray(int size) throws IOException {
		long longArray[] = new long[size];
		for (int i = 0; i < longArray.length; i++) {
			longArray[i] = getLong();
		}
		return longArray;
	}
	@SuppressWarnings("unused")
	private static BigDecimal[] getBDArray(int size) throws IOException {
		BigDecimal bdArray[] = new BigDecimal[size];
		for (int i = 0; i < bdArray.length; i++) {
			bdArray[i] = getBD();
		}
		return bdArray;
	}

	
	/* main routine */
	public static void main(String args[]) throws IOException {
		int n = getInt();
		double d = n;
		System.out.println( 1d - (n/2 / d) );
	}
}


Measured memory_bytes: 21204
#include <bits/stdc++.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

typedef long long int lli;

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

#ifdef LOCAL
	#define eprintf(...) printf(__VA_ARGS__)
#else 
	#define eprintf(...) 1
#endif

#define ROUNDUP(a, b) 		( ((a) + ((b) - 1) ) / b)
#define SET_ZERO(a)	 		( memset((a), 0, sizeof(a)))
#define SET_NUM_ARRAY(a,b)	( memset((a), b, sizeof(a)))
//#define int long long int //dont forget to change int to signed

int main() {
	char S[51], T[51];
	scanf("%s", S);
	scanf("%s", T);
	int lS = strlen(S);
	int lT = strlen(T);

	int tans = -1;
	for (int i = lS-1; i >= 0 && tans < 0; i--) {
		int cnt = 0;
		while (T[lT-1-cnt] == S[i-cnt] || S[i-cnt] == '?') {
			cnt++;
			if (cnt >= lT) {
				tans = i - cnt + 1;
				break;
			}
			if (i - cnt < 0)
				break;
		}
	}

	if (tans < 0) {
		printf("UNRESTORABLE\n");
		return 0;
	}
	
	for (int i = tans; 0 <= i && i-tans < lT; i++) {
		S[i] = T[i-tans];
	}

	for (int i = 0; i < lS; i++) {
		if (S[i] == '?') S[i] = 'a';
	}

	printf("%s\n", S);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using pii = pair<int, int>;

//const ll INF = 1e18L + 5;
//const int INF = 1e9 + 5;
//const double pi = 3.14159265358979323846;

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

	int a, b;
	cin >> a >> b;

	a--;
	int i = 1;
	int ans = 0;
	while (i < b) {
		i += a;
		ans++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.Arrays;

public class Main {

  private static void solve() {
    int H = ni();
    int W = ni();
    int h = ni();
    int w = ni();
    
    int x = 1000;
    int[][] map = new int[H][W];
    for (int[] v : map) Arrays.fill(v, x);
    for (int i = h - 1; i < H; i += h) {
      for (int j = w - 1; j < W; j += w) {
        map[i][j] = -(w * h - 1) * x - 1;
      }
    }

    long sum = 0;
    for (int i = 0; i < H; i ++) {
      for (int j = 0; j < W; j ++) {
        sum += map[i][j];
      }
    }
    
    if (sum > 0) {
      System.out.println("Yes");
      for (int i = 0; i < H; i ++) {
        for (int j = 0; j < W; j ++) {
          out.print(map[i][j] + " ");
        }
        out.println();
      }
    } else {
      System.out.println("No");
    }
    
  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = System.getProperty("debug");
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}


Measured memory_bytes: 47344
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

	return i
}
func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	list := make([]int, n)
	m := map[int]int{}

	for i := 0; i < n; i++ {
		list[i] = nextInt()

		_, ok := m[list[i]]
		if ok == true {
			fmt.Println("NO")
			return
		}
		m[list[i]] = list[i]
	}
	fmt.Println("YES")

}


Measured memory_bytes: 13440
n,l = map(int,input().split())

if l <= 0 <= n+l-1:
  print((n+l)*(n+l-1)//2 - (-l)*(-l+1)//2)
elif n+l-1 < 0:
  print((n-1)*(n+2*l-2)//2)
else:
  print((n-1)*(n+2*l)//2)
  

Measured memory_bytes: 2940
a,b=map(int,input().split())
if a==1 and b!=1:
    print("Alice")
elif a!=1 and b==1:
    print("Bob")
elif a==1 and b==1:
    print("Draw")
else:
    if a>b:
        print("Alice")
    elif a<b:
        print("Bob")
    else:
        print("Draw")

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

using namespace std;

int const NMAX = 1e5 + 10;
int const PTWO = 30;
int const BITS = sizeof(int) * 8;

int _succ[NMAX][PTWO];

int succ(int u, int k)
{
    if (k == 0)
        return u;
    do
    {
        int i = BITS - __builtin_clz(k) - 1;
        u     = _succ[u][i];
        k ^= 1 << i;
    } while (k > 0);

    return u;
}

int main(void)
{
    int    n;
    string s;
    cin >> s;
    n = s.size();

    for (int u = 1; u <= n; ++u)
        _succ[u][0] = (s[u - 1] == 'R' ? u + 1 : u - 1);

    for (int p = 1; p < PTWO; ++p)
        for (int u = 1; u <= n; ++u)
            _succ[u][p] = _succ[_succ[u][p - 1]][p - 1];

    vector<int> ans(n, 0);
    for (int u = 1; u <= n; ++u)
        ans[succ(u, NMAX) - 1]++;

    for (auto x : ans)
        cout << x << " ";

    cout << endl;
    return 0;
}


Measured memory_bytes: 15652
#include <iostream>
#include <string.h>
#include <string>
using namespace std;
const int MAXN = 510;
int uN,vN;//u,v的数目，使用前面必须赋值
int g[MAXN][MAXN];//邻接矩阵
int linker[MAXN];
bool used[MAXN];
int temp;
struct node1{
	int x,y;
}a[105];
struct node2{
	int x,y;
}b[105];
bool dfs(int u)
{
    //if (u!=temp) printf("重新给点%d寻找匹配\n",u);
    for(int v = 0; v < vN; v++)
        if(g[u][v] && !used[v])
        {
            used[v] = true;
            if(linker[v] == -1 || dfs(linker[v]))
            {
                //printf("给点%d匹配到了点%d\n",u,v);
                linker[v] = u;
                return true;
            }
        }
        //printf("失败，没有再找到%d的匹配\n",u);
    return false;
}
int hungary()
{
    int res = 0;
    memset(linker,-1,sizeof(linker));
    for(int u = 0; u < uN; u++)
    {
       // printf("开始给点%d进行匹配\n",u);
        //temp=u;
        memset(used,false,sizeof(used));
        if(dfs(u))res++;
    }
    return res;
}
int main()
{
	int n; 
    while (~scanf("%d",&n))
    {
    	vN=n;
    	uN=n;
        memset(g,0,sizeof(g));
        for (int i=0;i<n;i++)
        {
            scanf("%d%d",&a[i].x,&a[i].y);
        }
        for (int i=0;i<n;i++)
        {
            scanf("%d%d",&b[i].x,&b[i].y);
        }
        for(int i=0;i<n;i++){
        	for(int j=0;j<n;j++){
        		if(a[i].x<b[j].x&&a[i].y<b[j].y)
        		g[i][j]=1;
			}
		}
        printf("%d\n",hungary());
    }
}

Measured memory_bytes: 1280
#include<stdio.h>
#include<ctype.h>
#include<string.h>

int main()
{
	char str[1200];
	int length;
	int i;
	fgets(str,sizeof(str),stdin);
	length=strlen(str);
	for(i=0;i<length;i++)
	{
		if(!isalpha(str[i]))printf("%c",str[i]);
		else
		{
			if islower(str[i])printf("%c",toupper(str[i]));
			else printf("%c",tolower(str[i]));
		}
	}

	return 0;
}

Measured memory_bytes: 524
N, W = [int(i) for i in input().split(" ")]

vw = []
for i in range(N):
    vw.append([int(i) for i in input().split(" ")])
value = [i[0] for i in vw]
weight = [i[1] for i in vw]

dp = [[0 for j in range(W+1)] for i in range(N+1)]

for i in range(N):
    for j in range(W+1):
        if j - weight[i] >= 0:
            dp[i+1][j] = max(dp[i][j], dp[i][j - weight[i]] + value[i])
        else :
            dp[i+1][j] = dp[i][j]
print(dp[N][W])


Measured memory_bytes: 25948
#include <iostream>

using namespace std;

int main()
{
	string S,T;
	cin >> S >> T;

	int s, t;
	cin >> s >> t;

	string U;
	cin >> U;
	
	if (S == U) 
	{
		cout << s - 1 << ' ' << t << endl;
	}
	if (T == U) 
	{
		cout << s << ' ' << t - 1 << endl;
	}
	return 0;
}

Measured memory_bytes: 256
import math
N = int(input())
x = [0] * N
y = [0] * N
for i in range(N):
    x[i], y[i] = map(int,input().split())
nkai = 1
#N!の値を求める
for i in range(1,N+1):
    nkai *= i
sum_dict = 0

#同じ辺が登場する回数N!*(N-1)/(len(branch))
#全ての返間の距離 全ての辺の数はNC2(len(branch))

branch = list()
for i in range(N):
    for j in range(i+1,N):
        a = (x[i] - x[j])**2 + (y[i]-y[j])**2
        a = math.sqrt(a)
        branch.append(a)
#普遍性なし?
count = (nkai*(N-1))/(len(branch))
for i in range(len(branch)):
    sum_dict += branch[i]*(count)


#平均を求める
ave = sum_dict / nkai
print(ave)

Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>
#include<queue>
#include<stack>
#include<numeric>
#include<set>
#include<iomanip>
#include<map>
#include<type_traits>
#include<tuple>
using namespace std;


typedef long long ll;
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)

const int mod = 1000000007;

int main(){
    int n, m;
    cin >> n >> m;
    if(n == m)  cout << "Yes" << endl;
    else    cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 9999999999999999;
using ll = long long;
int main(){
  ll A,B,C;
  cin>>A>>B>>C;
  if(A>C){
    cout << A-C << " " << B << endl;
  }
  else if((A+B)>C){
    cout << 0 << " " << A+B-C << endl;
  }
  else{
    cout << 0 << " " << 0 << endl;
  }
  return 0;
}

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

int main() {
    int n, k;
    cin >> n >> k;
    int cnt = n;
    map<int, int> a;
    rep(i, k) {
        int d;
        cin >> d;
        rep(j, d) {
            int s;
            cin >> s;
            if(a[s] == 0) {
                a[s]++;
                cnt--;
            }
        }
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int A,B,C,tot,a,b,c;
int main(){
	scanf("%d%d%d",&A,&B,&C);
	while(!((A&1)||(B&1)||(C&1))){
		if(A==B&&B==C){
			puts("-1");
			return 0;
		}
		
		tot++,a=(B+C)>>1,b=(A+C)>>1,c=(B+A)>>1;
		A=a,B=b,C=c; 
	}
	
	printf("%d\n",tot);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
#define int ll
using Weight = int;
using Capacity = int;
struct Edge {
    int src, dst;
    Weight weight;
    Edge(int s, int d, Weight w) : src(s), dst(d), weight(w) {}
};
using Edges = std::vector<Edge>;
using Graph = std::vector<Edges>;
using Array = std::vector<Weight>;
using Matrix = std::vector<Array>;

void add_edge(Graph &g, int a, int b, Weight w = 1) {
    g[a].emplace_back(a, b, w);
    g[b].emplace_back(b, a, w);
}

void add_arc(Graph &g, int a, int b, Weight w = 1) {
    g[a].emplace_back(a, b, w);
}

using namespace std;

Graph to_rooted_tree(const Graph &g, int root = 0) {
    int n = g.size();
    Graph res(n);
    constexpr Weight INF = std::numeric_limits<Weight>::max() / 2;
    std::vector<int> dist(n, INF);
    std::deque<std::pair<int, int>> to_visit; // fixme
    dist[root] = 0;
    to_visit.emplace_back(0, root);
    while (to_visit.size()) {
        Weight d; int v;
        std::tie(d, v) = to_visit.back(); // fixme
        to_visit.pop_back(); // fixme
        d = -d;
        for(auto &e : g[v]){
            if (dist[e.dst] > dist[v] + e.weight) {
                dist[e.dst] = dist[v] + e.weight;
                to_visit.emplace_back(dist[e.dst], e.dst); // fixme
                res[e.src].emplace_back(e);
            }
        }
    }
    return res;
}

int n;
int a[100010];
Graph g;

// 親への辺は何回通るか
int dp[100010];
int dfs(int v) {
    if (g[v].size() == 0) {
        return a[v];
    } else if (g[v].size() == 1) {
        int c = g[v][0].dst;
        return dfs(c) == a[v] ? a[v] : -1;
    } else {
        int sum = 0;
        for (auto &e : g[v]) {
            int x = dfs(e.dst);
            dp[e.dst] = x;
            sum += x;
        }
        bool ok = true;
        for (auto &e : g[v]) {
            int c = e.dst;
            if (dp[c] < 0 || a[v] < dp[c]) {
                ok = false;
                break;
            }
        }
        int res = 2 * a[v] - sum;
        if (res < 0 || a[v] < res) {
            ok = false;
        }
        return ok ? res : -1;
    }
}

bool solve() {
    int r = -1;
    for (int i = 0; i < n; i++) {
        if (g[i].size() != 1) {
            r = i;
            break;
        }
    }
    if (n == 2) return a[0] == a[1];
    g = to_rooted_tree(g, r);
    return dfs(r) == 0;
}

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cin >> n;
    g.assign(n, {});
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < n - 1; i++) {
        int a, b;
        cin >> a >> b;
        --a; --b;
        add_edge(g, a, b);
    }
    cout << (solve() ? "YES" : "NO") << endl;
}

Measured memory_bytes: 16712
def main():
    N, K, S = map(int, input().split())
    if S == 1:
        print(' '.join(['1'] * K + ['2'] * (N - K)))
    else:
        if S == 10**9:
            print(' '.join([str(S)] * K + ['1'] * max(0, N - K)))
        else:
            if K < N:
                print(' '.join([str(S)] * K + ['1'] + [str(10**9)] * max(0, N - K - 1)))
            else:
                print(' '.join([str(S)] * K))
main()


Measured memory_bytes: 6252
import java.util.LinkedList;
import java.util.Scanner;

class Task {
	public String name;
	public int time;
	
	Task(String name, int time) {
		this.name = name;
		this.time = time;
	}
}
public class Main{
	static LinkedList<Task> queue = new LinkedList<>();
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int sumTime = 0;
		
		int taskNum = sc.nextInt();
		int levelTime = sc.nextInt();
		
		if(taskNum < 1 || taskNum > 100000)
			return;
		if(levelTime < 1 || levelTime > 1000)
			return;
		
		for (int i = 0; i < taskNum; i++) {
			 queue.offer(new Task(sc.next(), sc.nextInt()));
		}
		
		
		while(!queue.isEmpty()) {
			Task task = queue.poll();
			
			if(task.time <= levelTime) {
				sumTime += task.time;
				System.out.println(task.name + " " + sumTime);
			} else {
				task.time -= levelTime;
				sumTime += levelTime;
				queue.offer(task);
			}
		}
	}
}

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

int main() {
    int a, b;
    scanf("%d%d", &a, &b);
    int res = max(a + b, a + a - 1);
    res = max(res, b + b - 1);
    printf("%d\n", res);
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll a[405];
ll prefix[405];
ll dp[405][405];
ll solve(ll i, ll j){
    if(i == j){
        return 0;
    }
    if(dp[i][j] != -1){
        return dp[i][j];
    }
    ll ans = 1e18;
    for(ll k=i;k<j;k++){
        ans = min(ans, solve(i,k) + solve(k+1,j) + prefix[j] - prefix[i-1]);
        dp[i][j] = ans;
    }
return dp[i][j];
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    memset(dp,-1,sizeof(dp));
    ll n;
    cin>>n;
    for(ll i=1;i<=n;i++){
        cin>>a[i];
        prefix[i] = prefix[i-1] + a[i];
    }
    cout<<solve(1,n)<<"\n";
}

Measured memory_bytes: 1664
S=int(input())
cnt=0
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
if S<3:
  print(0)
else:
  syou=S//3
  amari=S%3
  while syou>0:
    cnt=cnt+combinations_count(syou+amari-1, amari)
    syou=syou-1
    amari=amari+3
  print(cnt%((10**9)+7))

Measured memory_bytes: 9136
#include <bits/stdc++.h>
using namespace std;
int a,b,c;

int main(){
cin >> a >> b >> c;
vector<int> vec, ba, ans;

for(int i = 1; i <= c; i++){
  if(c%i == 0){
    vec.push_back(i);
  }
}


  while(a <= b){
    ba.push_back(a);
    a++;
  }

int n,j = 0;
while(j < ba.size()){
  n = ba[j];
  for(int i;i < vec.size();i++){
    if(n == vec[i]){
      ans.push_back(n);
      break;
    }else if(n <= vec[i]){
      break;
    }else{
    }
  }
  j++;
}
int count = ans.size();
cout << count << endl;

return 0;
}




Measured memory_bytes: 3244
n=int(input())
a=list(map(int,input().split()))
count={i+1:0 for i in range(n)}
for i in a:
    count[i]+=1
ans=0
for i in range(1,n+1):
    ans+=count[i]*(count[i]-1)//2
for i in a:
    print(ans-count[i]*(count[i]-1)//2+(count[i]-1)*(count[i]-2)//2)

Measured memory_bytes: 38100
#include <bits/stdc++.h>
using namespace std;
#define M 1000000007
#define U 998244353
#define N 1000005
#define int long long
#define sz(c) (int)c.size()
#define fr first
#define ll long long 
#define sc second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a ; i<n ; i++)
#define r0 return 0;
#define endl '\n'
#define INF (int)1e15
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	std::cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
signed main()
{
	ios_base::sync_with_stdio(0);
	int TESTS=1;
	// cin>>TESTS;
	while(TESTS--)
	{   
		int n,k;
		cin >> n >> k;
		int win[k+1]={};
		rep(i,0,k+1) win[i] = 2;
		vector<int> s;
		rep(i,0,n){
			int t;
			cin >> t;
			s.pb(t);
		}
		for(int j=1; j<=k; j++){
			bool f=0;
			for(int i=0; i<n; i++){
				if(j-s[i]>=0 && win[j-s[i]]==2){
					win[j] = 1;
					f=1;
					break;
				}
			}
			win[j]=2;
			if(f) win[j] = 1;
			// trace(win[j]);
		}
		if(win[k]==1) cout<<"First";
		else cout<<"Second";
	}
}

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


int main() {
	
	int N, cnt=0;
	cin >> N;
	for(int i=1; i<=N; i+=2){
		int dcnt=0;
		for(int j=1; j<=i; j++){
			if(i%j==0) dcnt++;
		}
		if(dcnt==8) cnt++;
	}
	cout << cnt << endl;
	
	return 0;
}

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

int main(){
    int h, m, s;
    cin >> s;
    h = s / 3600;
    s = s % 3600;
    m = s / 60;
    s = s % 60;

    cout << h << ":" << m << ":" << s << endl;
    return 0;    
}


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

using namespace std;

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

#define int ll

const ll mod = 1e9 + 7;


main(){
	int n;
	ll l[100];

	cin >> n;
	for(int i=0;i<n;i++) cin >> l[i];

	sort(l,l+n);

	int ans  = 0;

	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			for(int k=j+1;k<n;k++){
				if(l[i]!=l[j] && l[j]!=l[k]){
					if(l[i]+l[j]>l[k]) ans++;
				}
			}
		}
	}

	cout << ans << endl;


	return 0;
}


Measured memory_bytes: 3620
#include<stdio.h>

int main(void){
	int a,n,i;
	
	long int min=1000000 , max=-1000000 ;
	long long sum=0;
	a=0;
	
	scanf("%d",&n);
	
	for(a=1;a<=n;a++){
		scanf("%d",&i);
		if(i < min ){
		min = i;
		}
		
		if(i > max) {
		max = i;
	}
		sum += i;
	}
	printf("%d %d %ld\n",min,max,sum);
	return 0;
}

Measured memory_bytes: 600
import math


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

def c_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
if n > 1 and m > 1:
    print(c_count(n, 2) + c_count(m, 2))
else:
    if n <= 1 and m > 1:
        print(c_count(m, 2))
    elif n > 1 and m <= 1:
        print(c_count(n, 2))
    else:
        print(0)



Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <tuple>
#include <stack>
#include <bitset>
#include <utility>
// #include <numeric>
using namespace std;



typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vint;
typedef vector<vector<ll>> vvint;
typedef pair<ll,ll> pint;
typedef vector<pint> vpint;

#define rep(i,n) for(ll i=0;i<n;i++)
#define repf(i,f,n) for(ll i=f;i<n;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define INT_MAX 2147483647
#define LLONG_MAX 9223372036854775807
#define vmax(vec) *max_element(vec.begin(), vec.end())
#define vmin(vec) *min_element(vec.begin(), vec.end())
#define vsort(vec) sort(vec.begin(), vec.end())
#define vsortgr(vec) sort(vec.begin(), vec.end(), greater<ll>())


typedef struct{
  ll pos;
  ll depth;
} data;
//
// struct Node{
//
// }



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

// ll X,Y,Z,K;
// ll pmax = 30000000000;
// vint A,B,C;




// int binary_search(int key){
//  //isOKを満たす要素のうち最小のインデックスを返す。（要ソート）
//   int left = -1;
//   int right = N;
//
//   while(right - left > 1){
//     int mid = left + (right - left)/2;
//
//     if(isOK(mid, key)) right=mid;
//     else left=mid;
//   }
//
//   return right;
// }

// ll gcd(ll m, ll n){
//   if(m<n) swap(m,n);
//   if(n==0) return m;
//   return gcd(n, m%n);
// }





int main() {

  ll N;
  cin >> N;
  vint a(N),b(N),c(N);

  rep(i,N)cin>>a[i]>>b[i]>>c[i];

  vvint dp(N, vint(3));

  dp[0][0] = a[0];
  dp[0][1] = b[0];
  dp[0][2] = c[0];

  rep(i,N-1){

    dp[i+1][0] = max(dp[i][1], dp[i][2]) + a[i+1];
    dp[i+1][1] = max(dp[i][0], dp[i][2]) + b[i+1];
    dp[i+1][2] = max(dp[i][0], dp[i][1]) + c[i+1];

  }

  cout << vmax(dp[N-1]) << endl;

}

















//


Measured memory_bytes: 8064
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
    int n;
    cin>>n;
    for(int i=0;i<n*2;i++){
        if(i*(i-1)/2+1<=n&&n<=i*(i+1)/2){
            cout<<i<<endl;
            return 0;
        }
    }
}


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

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define REP(i, n)  FOR(i, 0, n)
#define ASC(c) sort((c).begin(), (c).end())
#define DESC(c) sort((c).begin(), (c).end(), greater<int>())

#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

typedef long long ll;
typedef unsigned long long ull;
struct edge { int u, v; ll w; };
 
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
  int a, b, c; cin >> a >> b >> c;
  int k; cin >> k;
  REP(i, k) {
    if (a >= b && a >= c) {
      a *= 2;
    } else if (b > a && b >= c) {
      b *= 2;
    } else if (c > a && c > b) {
      c *= 2;
    }
  }
  cout << a + b + c << endl;
}


Measured memory_bytes: 888
#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
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; }
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)

int g[15][15];
const int INF = 1001001001;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

//素因数分解
vector<pair<ll, int>>factorize(ll n) {
	vector<pair<ll, int>>res;
	for (ll i = 2;i * i <= n;++i) {
		if (n % i)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.emplace_back(n, 1);
	return res;
}

int bingo[3][3];
int cnt[2][105];
int h, w;
bool flag[110][110];

int main() {
	string s;
	cin >> s;
	string ans;
	int n = s.length();
	rep(i, n) {
		if (s[i] == '0') {
			ans += s[i];
		}
		else if (s[i] == '1') {
			ans += s[i];
		}
		else {
			int res = ans.length();
			if (res > 0)ans.erase(res - 1, 1);
		}
	}
	cout << ans << endl;
	return 0;
}


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int v[5];
int k;

int main(){
    int H,W,h,w;

    cin >> H>> W>> h>> w;
    H-=h;
    W-=w;

    cout << H*W;


//    REP(i,5)cin>>v[i];
//    cin>>k;
//    bool ok = true;
//    REP(i,5){
//        REP(j,i){
//            int d = v[i]-v[j];
//            if(d>k)ok=false;
//        }
//    }
//    puts(ok ? "Yay!" : ":(");
//    return 0;
}

Measured memory_bytes: 256