akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <array>
#include <assert.h>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using PII = pair<int, int>;
using PLL = pair<ll, ll>;

template <typename T1, typename T2>
ostream& operator<<(ostream& s, const pair<T1, T2>& p) {
    return s << "(" << p.first << ", " << p.second << ")";
}
template <typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
    s << "[";
    for (int i = 0; i < v.size(); i++)
        s << (i == 0 ? "" : ", ") << v[i];
    s << "]";
    return s;
}

#define ALL(a) (a).begin(), (a).end()

vector<int> tree[100010];

int dfs(int v, int p) {
    // set<int> set;
    int res = 0;
    for (int to : tree[v]) {
        if (p == to) continue;
        res ^= (dfs(to, v) + 1);
        // set.insert(dfs(to, v));
    }
    /*
    while (set.count(res) != 0) {
        res++;
    }
    */
    return res;
}

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

    for (int i = 0; i < N - 1; i++) {
        int x, y;
        cin >> x >> y;
        x--;
        y--;
        tree[x].push_back(y);
        tree[y].push_back(x);
    }
    int res = dfs(0, -1);
    if (res == 0) {
        cout << "Bob" << endl;
    } else {
        cout << "Alice" << endl;
    }

    return 0;
}


Measured memory_bytes: 10368
/*input
5 6
1 4 5 9 8
3 1
3 2
5 4
1 5
2 4 5
1 2 9
2 3 4
1 5 1
2 2 1
2 5 5


*/
 
/*
                                                    ______________
                                                          |       )
                                                          |   )   /
                                                          |______/
                                                    |     |      \
                                                    |     |   )   \
                                                    |_____|_______)
 
*/
 
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <iomanip>
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll, ll> PLL;
typedef long double ld;
 
#define pb push_back
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
int mod = 1000000007;
const int inf = 1034567891;
const ll LL_INF = 1234567890123456789ll;
#define PI 3.14159265
#define endl '\n'
#define F first
#define S second
#define debug(x) cout << #x << " = " << x << endl;
#define TRACE
 
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
 
#define out(container) for (auto it : container) cout << it << " "; cout << endl;
 
 
template < typename T > T GCD(T a, T b)            { ll t; while(a) { t = a; a = b % a; b = t; } return b; }
template < typename T > string toString(T a)       { return to_string(a); }
template < typename T > void toInt(string s, T &x) { stringstream str(s); str >> x;}
inline int add(int x, int y){ x += y; if(x >= mod) x -= mod; return x;}
inline int sub(int x, int y){ x -= y; if(x < 0) x += mod; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % mod;}
inline int powr(int a, ll b){
  int x = 1 % mod;
  while(b){
    if(b & 1) x = mul(x, a);
    a = mul(a, a);
    b >>= 1;
  }
  return x;
}
inline int inv(int a){ return powr(a, mod - 2);}

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  
  string str1, str2;
  cin >> str1 >> str2;
  int ans = 0;
  for (int i = 0; i < str1.size(); i++) {
    ans += (str1[i] == str2[i]);
  }
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair < int, int >;
 
int main() {
	int m = 3, x, n;
	map < int, pii > mp;
	for (int i = 0; i < m; i++) {
		for (int j = 0; j < m; j++) {
			cin >> x;
			mp[x] = make_pair (i, j);
		}
	}
	vector < int > rows (m), cols(m), diag(2);
	cin >> n;
	while (n--) {
		cin >> x;
		if (mp.find (x) == mp.end()) continue;
		pii p = mp[x];
		rows[p.first]++;
		cols[p.second]++;
		if (p.first == p.second) diag[0]++;
		if (p.first + p.second == m - 1) diag[1]++;
	}
	for (int row : rows) {
		if (row >= m) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	for (int col : cols) {
		if (col >= m) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	for (int d: diag) {
		if (d >= m) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
	return 0;	
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

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

ll gcd(ll n, ll m)
{
	ll tmp;
	while (m != 0)
	{
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m)
{
	return abs(n) / gcd(n, m) * abs(m); //gl=xy
}

using namespace std;

void solve()
{
  ll n;
	cin>>n;
	string s="";
	while(n>0){
		ll x=(n-1)%26;
		s+=char('a'+x);
		n--;
		n/=26;
	}
	reverse(all(s));
	cout<<s;
}

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


Measured memory_bytes: 3652
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<stack>
#include<queue>
#include<sstream>
#include<string>
#include<set>
#include<array>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i);
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())

using namespace std;


int main(){

  string str;
  cin >> str;
  
  bool f1=false,f2=false;
  rep(i,str.size()){
    if(str[i] == 'C') f1 = true;
    if(f1) if(str[i] == 'F') f2 =true;
  }
  
  if(f1 && f2) cout << "Yes" << endl;
  else cout << "No" << endl;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define all(x)    (x).begin(),(x).end()
typedef long long ll;
const int MOD = (int)1e9 + 7;

ll solve(string prefix, string s){
  ll ans = 0;

  if(s.size()==0){
    ll digit = 1;
    rep(i,prefix.size()){
      if(prefix[prefix.size()-i-1]=='+') digit = 1;
      else{
        ans += (int)(prefix[prefix.size()-i-1]-'0')*digit;
        digit *= 10;
      }
    }
    return ans;
  }
  
  string prefix_n = prefix;
  prefix_n.push_back(s[0]);
  ans += solve(prefix_n,s.substr(1));
  
  if(prefix.size() > 0){
    prefix_n = prefix;
    prefix_n.push_back('+');
    prefix_n.push_back(s[0]);
    ans += solve(prefix_n,s.substr(1));
  }
  return ans;
}

int main(){
  string s;
  cin >> s;
  cout << solve("",s) << endl;
}



Measured memory_bytes: 256
N,A,B=map(int,input().split())
S=list(input())

p=0
q=0

for i in S:
    if p<A+B and i=="a":
        print("Yes")
        p+=1
    
    elif p<A+B and  i=="b" and q+1<=B:
        print("Yes")
        p+=1
        q+=1
    else:
        print("No")

Measured memory_bytes: 9956
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    System.out.println(800*n-200*(n/15));
  }
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;

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

#define M (1000000007)

int main() {
    ios::sync_with_stdio(false);

    int a, b, c, d;
    cin >> a >> b >> c >> d;

    while (true) {
        c -= b;
        if (c <= 0) {
            cout << "Yes" << endl;
            break;
        }

        a -= d;
        if (a <= 0) {
            cout << "No" << endl;
            break;
        }
    }
    return 0;
}


Measured memory_bytes: 3652
#入力
N = int(input())
S = input()
#s1,s2は分割した文字列,kはどちらにもある文字,rはkの要素数（どちらにもある文字の種類）
k = []
r = []

for i in range(len(S)):
    #分割
    s1 = S[0:i]
    s2 = S[i:len(S)]
    #s1の各文字がs2にあるか
    for j in range(len(s1)):
        if s2.find(s1[j:j+1]) != -1:
            #kに既に入っていなければ追加
            if (s1[j:j+1] in k) == False:
                k.append(s1[j:j+1])
                
    r.append(len(k))
    k.clear()

#rの最大の要素を返す
r.sort()
r.reverse()
print(r[0])

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

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

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

int main(){
  int n;
  cin >> n;
  vector<int> d(n, 0);
  map<int, int> mp;
  for (int i = 0; i < n; i++)
  {
    cin >> d[i];
    mp[d[i]]++;
  }
  int m;
  cin >> m;
  vector<int> t(m, 0);
  bool flag = true;
  for (int i = 0; i < m; i++)
  {
    cin >> t[i];
    if(mp[t[i]] > 0) mp[t[i]]--;
    else flag = false;
  }

  if(flag) cout << "YES" << endl;
  else cout << "NO" << endl;



}


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

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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 (b < a) { a = b; return true; } return false; }

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

int dp[110][410];

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

	int N, W;
	cin >> N >> W;
	int w, v;
	int w1 = -INF;

	rep(i, 0, 110)rep(j, 0, 410)dp[i][j] = -INF;
	dp[0][0] = 0;

	rep(i, 0, N)
	{
		cin >> w >> v;
		if (w1 == -INF)w1 = w;
		w -= w1;
		rrep(k, 0, i + 1)
		{
			rrep(j, 0, 400)
			{
				if (j - w >= 0 && dp[k][j - w] != -INF)
				{
					chmax(dp[k + 1][j], dp[k][j - w] + v);
				}
			}
		}
	}

	int ans = 0;
	rep(i, 0, N + 1)
	{
		rep(j, 0, 400)
		{
			if (i*w1 + j <= W)
			{
				chmax(ans, dp[i][j]);
			}
		}
	}

	cout << ans << endl;

	return 0;
}

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

using namespace std;

int main()
{
    int s;
    scanf("%d",&s);
    char a[s];
    scanf("%s",a);
    int b[s],c[s];
    memset(b,0,sizeof(b));
    memset(c,0,sizeof(c));
    int t=1e6;
    if(a[0]=='W')
        b[0]=1;
    if(a[s-1]=='E')
        c[s-1]=1;
    for(int i=1; i<s;i++)
    {
        if(a[i]=='W')
            b[i]=b[i-1]+1;
        else b[i]=b[i-1];
    }
    for(int i=s-2; i>=0;i--)
    {
        if(a[i]=='E')
            c[i]=c[i+1]+1;
        else c[i]=c[i+1];
    }
    for(int i=0;i<s;i++)
    {
        t=min(t,b[i]+c[i]);
    }
    t-=1;
    printf("%d\n",t);
    return 0;
}


Measured memory_bytes: 2944
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using ll = long long;
using P = pair<ll,ll>;

int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
ll max_element = 0;
ll n;
cin >> n;
vector<ll> a(n);
rep(i,n)
cin >> a[i];
vector<vector<ll>> binaries(n);
rep(i,n){
    while(a[i] > 1){
        binaries[i].emplace_back(a[i] % 2);
        a[i] /= 2;
    }
    binaries[i].emplace_back(a[i]);
    max_element = max<ll>(binaries[i].size(), max_element);
}
rep(i,n){
    while(binaries[i].size() < max_element)
        binaries[i].emplace_back(0);
}
rep(i,n){
    reverse(binaries[i].begin(),binaries[i].end());
}
vector<ll> one(max_element);
rep(i,n){
    rep(j,max_element){
        one[j] += (binaries[i][j] == 1 ? 1 : 0);
    }
}
rep(i,n){
    ll ans = 0;
    ll tmp = pow(2,max_element - 1);
    rep(j,max_element){
        if(j < max_element - 1){
            ans += (one[j] - binaries[i][j]) % 2 * tmp;
        }else{
            ans += (one[j] - binaries[i][j]) % 2;
        }
        tmp /= 2;
    }
    cout << ans << (i == n - 1 ? "\n" : " ");
}

}

Measured memory_bytes: 62596
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<cstdlib>
#define cmax(a,b) (a<(b)?a=(b),1:0)
#define cmin(a,b) (a>(b)?a=(b),1:0)
#define dmin(a,b) ((a)<(b)?(a):(b))
#define dmax(a,b) ((a)>(b)?(a):(b))
#define regsiter register
#define CL fclose(stdin),fclose(stdout)
namespace io
{
	int F()
	{
		int n=0,F=1;
		char ch;
		while((ch=getchar())!='-'&&(ch<'0'||ch>'9'));
		ch=='-'?F=0:n=ch-'0';
		while((ch=getchar())>='0'&&ch<='9')n=(n<<1)+(n<<3)+ch-'0';
		return F?n:-n;
	}
	long long G()
	{
		long long n=0,F=1;
		char ch;
		while((ch=getchar())!='-'&&(ch<'0'||ch>'9'));
		ch=='-'?F=0:n=ch-'0';
		while((ch=getchar())>='0'&&ch<='9')n=(n<<1)+(n<<3)+ch-'0';
		return F?n:-n;
	}
}
int c[111111];
int vis[111111];
struct edg
{
	int x,y,v;
}ed[222222];
int pe;
bool operator <(const edg &x,const edg &y)
{
	return x.v<y.v;
}
int fa[111111];
int gf(int u)
{
	if(fa[u]==u)return u;
	return fa[u]=gf(fa[u]);
}
int la[111111];
int main()
{
	int n=io::F(),m=io::F(),k=io::F();
	for(register int i=1;i<=n;++i)vis[c[i]=io::F()]=1,la[c[i]]=i;
	int cnt=0;
	for(register int i=1;i<=n;++i)if(c[i]==0)++cnt;
	int cv=0;
	for(register int i=1;i<=k;++i)if(vis[i]==0)++cv;
	if(cv>cnt)
	{
		puts("-1");
		return 0;
	}
	int cc=cnt-cv;
	for(register int i=1;i<=m;++i)
		ed[i]=(edg){io::F(),io::F(),io::F()};
	pe=m;
	for(register int i=1;i<=n;++i)
		if(c[i]&&la[c[i]]!=i)ed[++pe]=(edg){i,la[c[i]],0};
	std::sort(ed+1,ed+pe+1);
	for(register int i=1;i<=n;++i)fa[i]=i;
	long long ans=0;
	for(register int i=1;cc!=n-1&&i<=pe;++i)
	{
		int t1=gf(ed[i].x),t2=gf(ed[i].y);
		if(t1==t2)continue;
		fa[t1]=t2;
		ans+=ed[i].v;
		++cc;
	}
	if(cc!=n-1){puts("-1");return 0;}
	printf("%lld\n",ans);
	return 0;
}




Measured memory_bytes: 4352
#include <stdio.h>
int main (void)
{
    int N=0,A=0;
    
	scanf("%d", &N); //円
	scanf("%d", &A); //1円の枚数
    
    if(N%500<=A)
    {
        printf("Yes\n");
    }
    else
    {
        printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
#define FASTIO  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ll long long int
#define ld long double
#define vll vector<ll>
#define pll pair<ll,ll>
#define vl(p) vector<p>
#define W while
#define For(i,s,x) for(i=s;i<x;i++)
#define Fore(i,s,x) For(i,s,x+1)
#define FoR(i,s,x) for(i=s-1;i>=x;i--)
#define ForE(i,s,x) FoR(i,s+1,x)
#define fi(i,s,x) for(int i=s;i<x;i++)
#define all(v) v.begin(),v.end()
#define pb push_back
#define in insert
#define sz size()
#define F first
#define S second
#define nl cout<<"\n"
#define pr(a) cout<<a<<" "
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
#define pr3(a,b,c) cout<<a<<" "<<b<<" "<<c<<"\n"
#define trace2(x, y)             cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)          cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)       cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define trace5(a, b, c, d, e)    cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<endl;
#define mod 1000000007
#define MAX 100005

vll E[MAX], F[MAX];
ll dp[MAX]={};
ll e[MAX]={}, f[MAX]={}, g[MAX]={};

void dop(ll i) {
    for(auto r:E[i]) {
        dp[r]=max(dp[r],dp[i]+1);
        g[r]++;
        if(g[r]==f[r]) dop(r);
    }
}

int main() {
    FASTIO;
    ll t=1, i, j, k;
    W(t--) {
        ll n, m;
        cin>>n>>m;
        Fore(i,1,m) cin>>j>>k, E[k].pb(j), F[j].pb(k), e[k]++, f[j]++;
        Fore(i,1,n) if(!f[i]) dop(i);
        // nl; Fore(i,1,n) pr(dp[i]); nl;
        cout<<*max_element(dp+1,dp+1+n);
    }
    return 0;
}

Measured memory_bytes: 23844
from collections import Counter
n = int(input())
s = [input() for i in range(n)]

a = Counter(s)

b = a.most_common()[0][1]

s = list(set(s)) #sの重複した要素を消す
s.sort()

for i in s:
    if a[i] == b:
        print(i)


Measured memory_bytes: 45036
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, B = map(int, readline().split())

print('Even' if N * B % 2 == 0 else 'Odd')


Measured memory_bytes: 3060
#include <iostream>
#include <iomanip>
#include <cmath>
#define MAX_N 20
using namespace std;

int main(){
	int r,n; //r:??????????????????n:?????????????????¨??????????????°
	while(1){
		int xl[MAX_N],xr[MAX_N],h[MAX_N];
		cin>>r>>n;
		if(r==0 && n==0) break;
		
		for(int ni=0;ni<n;ni++){
			cin>>xl[ni]>>xr[ni]>>h[ni];
		}
		
		double sunCY;
		double time=0.0000;
		bool check; //???????????????????????°true
		while(1){
			time+=0.0001;
			sunCY=time-(double)r;
			for(int j=-r;j<r;j++){
				double sunX;
				check=true;
				if(j<0) sunX=(double)j+0.99999;
				else    sunX=(double)j+0.00001;
				double sunY=sunCY + sqrt((double)(r*r) - sunX*sunX);
				if(sunY<=0) check=false;
				for(int ni=0;ni<n;ni++){
					if(sunX>=xl[ni] && sunX<=xr[ni] && sunY<=h[ni]) check=false;
				}
				if(check) break;
			}
			if(check) break;
		}
		time-=0.0001;
		cout<<fixed<<setprecision(4)<<time<<endl;
	}
}

Measured memory_bytes: 1236
'use strict';
(function(stdin) { 
	var inputs = stdin.toString();
	var cols = inputs.split('\n')[0].split(' ').map(Number)
	var a = cols[0];
	var b = cols[1];

	if(a < b){
		console.log('a < b')
	}
	 else if(a > b){
		console.log('a > b')
	}
	 else if(a == b){
		console.log('a == b')
	}

}(require('fs').readFileSync('/dev/stdin', 'utf8')));

Measured memory_bytes: 7376
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
#include<climits>
#include<map>
#include<string>
#include<functional>
#include<iomanip>
#include<deque>
#include<random>
#include<set>

using namespace std;
typedef long long ll;
typedef double lldo;
#define mp make_pair
#define pub push_back
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
ll gcd(ll a, ll b) { if (a % b == 0) { return b; } else  return gcd(b, a % b); }
ll lcm(ll a, ll b) { if (a == 0) { return b; }return a / gcd(a, b) * b; }
template<class T>ll LBI(vector<T>& ar, T in) { return lower_bound(ar.begin(), ar.end(), in) - ar.begin(); }
template<class T>ll UBI(vector<T>& ar, T in) { return upper_bound(ar.begin(), ar.end(), in) - ar.begin(); }

ll h, w, ans = 0;
char s[30][30] = {};

const int INF = 7 + (1e+9);
typedef int Weight;
struct Edge {  //src:辺の始点,dst:辺の終点,weight:辺の重さ
	int src, dst;
	Weight weight;
	Edge(int src, int dst, Weight weight) :
		src(src), dst(dst), weight(weight) { }
};
bool operator < (const Edge& e, const Edge& f) {
	return e.weight != f.weight ? e.weight > f.weight : //辺は重さが重いものを"小さい"と定義する
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

//引数 Graph:隣接リスト,dist:各頂点から各頂点までの距離が入る,inter:最短路木の親頂点が入る
//戻値 負閉路が存在しない場合:true,そうでないとき:false
bool shortestPath(const Graph& g, vector<vector<Weight> >& dist, vector<vector<int> >& inter) {
	int n = g.size();
	dist.assign(n, vector<Weight>(n, INF));
	for (int i = 0; i < n; i++) {
		dist[i][i] = 0;
	}
	for (int i = 0; i < n; i++) {
		for (auto f = g[i].begin(); f != g[i].end(); f++) {
			dist[i][f->dst] = f->weight;
		}
	}
	inter.assign(n, vector<int>(n, -1));
	for (int k = 0; k < n; k++) {
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (dist[i][k] < INF && dist[k][j]<INF && dist[i][j]>dist[i][k] + dist[k][j]) {
					dist[i][j] = dist[i][k] + dist[k][j];
					inter[i][j] = k;
				}
			}
		}
	}
	for (int i = 0; i < n; i++) {
		if (dist[i][i] < 0) {
			return false;
		}
	}
	return true;
}

void buildPath(const vector<vector<int> >& inter, int s, int t, vector<int>& path) {
	int u = inter[s][t];
	if (u < 0) path.push_back(s);
	else buildPath(inter, s, u, path), buildPath(inter, u, t, path);
}

int main() {
	cin >> h >> w;
	rep(i, h) {
		rep(j, w)cin >> s[i][j];
	}
	Graph g(h* w);
	rep(i, h) {
		rep(j, w) {
			if (i < h - 1 && s[i][j] == '.' && s[i + 1][j] == '.') {
				g[i * w + j].push_back(Edge(i * w + j, (i + 1) * w + j, 1));
				g[(i + 1) * w + j].push_back(Edge((i + 1) * w + j, i * w + j, 1));
			}
			if (j < w - 1 && s[i][j] == '.' && s[i][j + 1] == '.') {
				g[i * w + j].push_back(Edge(i * w + j, i * w + j + 1, 1));
				g[i * w + j + 1].push_back(Edge(i * w + j + 1, i * w + j, 1));
			}
		}
	}
	vector<vector<Weight> >dist;
	vector<vector<int> > inter;
	bool negative_cycle = shortestPath(g, dist, inter);
	rep(i, h* w) {
		rep(j, h * w) {
			if (dist[i][j] != INF)ans = max(ans, (ll)dist[i][j]);
		}
	}
	cout << ans << endl;
	return 0;
}

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

int main()
{
    int X, N;
    cin >> X >> N;
    vector<int> d(102, 0);
    for (int i = 0; i < N; i++)
    {
        int p;
        cin >> p;
        d[p] = 1;
    }
    pair<int, int> ans(99999, -1);
    for (int i = 0; i <= 101; i++)
    {
        if (d[i] == 1)
            continue;
        int diff = abs(X - i);
        ans = min(ans, pair<int, int>(diff, i));
    }
    cout << ans.second << endl;
    return 0;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
#define INF 1e9
#define MOD 1000000007
#define ll long long
using namespace std;
typedef unsigned long long ull;
typedef pair<ll,ll> pr;

ll h[100001];
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,k;
    cin>>n>>k;
    for(int i=0;i<n;i++){
        cin>>h[i];
    }
    sort(h,h+n);
    ll ans=INF;
    for(ll i=0;i<n-k+1;i++){
        ll x=h[i+k-1]-h[i];
//        cout<<h[i+k]<<" "<<h[i]<<" "<<x<<endl;
        if(x<ans){
            ans=x;
        }
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<map>
#include<unordered_map>
#include<queue>
#include<algorithm>
#include<iomanip>
#include<typeinfo>
#include<complex>
using namespace std;
using ll = long long int;
const int mod = 1e9 + 7;
#define rep(i, a, b) for(ll i = a;i < b; i++)
const long double PI = (acos(-1));


int main() {

	int n, m;
	cin >> n >> m;

	vector<pair<ll, ll>> p(n);
	rep(i, 0, n) {
		ll a, b;
		cin >> a >> b;
		p[i] = make_pair(a, b);
	}

	sort(p.begin(), p.end());

	ll ans = 0;

	rep(i, 0, n) {
		if (p[i].second <= m) {
			ans += p[i].first * p[i].second;
			m -= p[i].second;
		}
		else {
			ans += p[i].first * m;
			m -= p[i].second;
			break;
		}
	}

	cout << ans << endl;

	return 0;
}

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

int main(){
	int n;
	if(scanf("%d%*c", &n)==EOF){return 0;}
	double p = 0.0;
	
	// 引用元　http://web.wakayama-u.ac.jp/~tokoi/lecture/kiso2/h10.html
	char inputline[400];
    int x[n];
    int j = 0;
    if (fgets(inputline, sizeof(inputline), stdin) != NULL) {
        static char separator[] = " \t\n";
        char *token;
        if ((token = strtok(inputline, separator)) != NULL) {
            do {x[j] = atoi(token); p += (double)x[j];}
            while (++j < n && (token = strtok(NULL, separator)) != NULL);
        }
	}
	
	p = p/n;
	int p1 = (int)floor(p);
	int p2 = p1 + 1;
	int sum1 = 0;
	int sum2 = 0;
	for(int i = 0; i<n; i++){
		sum1 += (p1 - x[i])*(p1 - x[i]);
		sum2 += (p2 - x[i])*(p2 - x[i]);
	}
	
	if(sum1 < sum2){printf("%d\n", sum1);}else{printf("%d\n",sum2);}
	return 0;
} 


Measured memory_bytes: 128
/**
*    created: 01.07.2020 23:24:49
**/
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
#define int long long
#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 all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pcnt(bit) __builtin_popcountll(bit)
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;}
const int MOD = 1000000007;
// const int MOD = 998244353;
const long double pi = acos(-1.0);
const int INF = 1LL << 60;

signed main() {

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

    int n;
    cin >> n;
    vector<int> u(n);
    vector<int> d(n);
    rep(i,n) cin >> u[i];
    rep(i,n) cin >> d[i];
    rep(i,n) {
        if (i == 0) continue;
        u[i] += u[i-1];
        d[i] += d[i-1];
    }
    int ans = -1;
    rep(i,n) {
        // iで下に降りる
        if (i == 0) chmax(ans,u[0]+d[n-1]);
        else chmax(ans, u[i] + d[n-1]- d[i-1]);
    }
    cout << ans << endl;
    return 0;
}

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

struct Card { char suit, value; };

void bubble(struct Card A[], int N) {
	for (int i = 0; i < N; i++) {
		for (int j = N - 1; j >= i; j--) {
			if (A[j].value < A[j - 1].value) {
				Card t = A[j];
				A[j] = A[j - 1];
				A[j - 1] = t;
			}
		}
	}
}

void selection(struct Card A[], int N) {
	for (int i = 0; i < N; i++) {
		int minj = i;
		for (int j = i; j < N; j++) {
			if (A[j].value < A[minj].value)minj = j;
		}
		Card t = A[i];
		A[i] = A[minj];
		A[minj] = t;
	}
}

void print(struct Card A[], int N) {
	for (int i = 0; i < N; i++) {
		if (i > 0)cout << " ";
		cout << A[i].suit << A[i].value;
	}
	cout << endl;
}

bool isStable(struct Card C1[], struct Card C2[], int N) {
	for (int i = 0; i < N; i++) {
		if (C1[i].suit != C2[i].suit)return false;
	}
	return true;
}

int main() {
	Card C1[100], C2[100];
	int N;
	char ch;

	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> C1[i].suit >> C1[i].value;
	}

	for (int i = 0; i < N; i++)C2[i] = C1[i];

	bubble(C1, N);
	selection(C2, N);

	print(C1, N);
	cout << "Stable" << endl;
	print(C2, N);
	if (isStable(C1, C2, N)) {
		cout << "Stable" << endl;
	}
	else {
		cout << "Not stable" << endl;
	}

	return 0;
}

Measured memory_bytes: 3096
import operator
import sys
A, B, C, D = [int(x) for x in input()]
ops = ((operator.add, "+"), (operator.sub, "-"),)
for op1, op1s in ops:
    for op2, op2s in ops:
        for op3, op3s in ops:
            s = op3(op2(op1(A, B), C), D)
            if s == 7:
                result = "".join(map(str, (A, op1s, B, op2s, C, op3s, D, "=7")))
                print(result)
                sys.exit()

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

#define debug(s) cout << s << endl
#define debug1(s, t) cout << s << " " << t << endl
#define debug2(s, t, u) cout << s << " " << t << " " << u << endl
#define printvec(v)       \
    for (auto &&i : v)    \
        cout << i << " "; \
    cout << endl
#define rep(n, i) for (int i = 0; i < n; i++)

using namespace std;
using i64 = long long;
using Graph = vector<vector<int>>;

int N, M, Q;
vector<int> a(50), b(50), c(50), d(50);

// 重複順列
vector<int> ar(10);
int mx = 0;

void DFS(int now, int curnum)
{
    if (now == N)
    {
        int sum = 0;
        rep(Q, i)
        {
            if (ar[b[i]] - ar[a[i]] == c[i])
                sum += d[i];
        }
        mx = max(mx, sum);
        return;
    }

    for (size_t i = curnum; i <= M; i++)
    {
        ar[now] = i;
        DFS(now + 1, i);
    }
}

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

    for (size_t i = 0; i < Q; i++)
    {
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        a[i]--;
        b[i]--;
    }

    for (size_t i = 1; i <= M; i++)
    {
        DFS(0, i);
    }

    cout << mx << endl;

    return 0;
}

Measured memory_bytes: 3492
#include<iostream>

using namespace std;

int main()
{
	int i;
	double n,v,y;
	
	for(;cin >> n;)
	{
		v=n/9.8;
		y=4.9*v*v;
		for(i=1;5*(i-1)<y;i++)
		{}
		cout << i << endl;
	}
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	string s, k = "keyence";
	cin >> s;
	
	int p = 0, q = k.size() - 1;
	for(int i = 0; i < s.size(); i++){
		if(s[i] == k[p]) p++;
		else break;
	}
	for(int i = s.size() - 1; i >= 0; i--){
		if(s[i] == k[q]) q--;
		else break;
	}
	
	cout << (p > q ? "YES" : "NO") << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <iomanip>
#include <cmath>
using namespace std;
const int MOD = 1e9+7;
using ll = long long;
using vi = vector<int>;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(x) x.begin(), x.end()
int main() {
  
	int h, w;
    cin >> h >> w;
    vector<string> s(h);
    for(int i = 0; i < h; i++) cin >> s[i];
 
    vector<string> ans = s;
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if(s[i][j] == '#') ans[i][j] = '#';
            else{
                int count = 0;
                for(int ii = -1; ii <= 1; ii++){
                    for(int jj = -1; jj <= 1; jj++){
                        if(ii+i >= 0 && ii+i < h && jj+j >= 0 && jj+j < w && s[ii+i][jj+j] == '#') count++;
                    }
                }
                ans[i][j] = (char)(count+'0');
            }
        }
    }
 
    for(int i = 0; i < h; i++){
        cout << ans[i] << endl;
    }
    return 0;
}

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

int main()
{
  ll h, w, ans; 
  cin >> h >> w;

  if(h == 1 || w == 1){
    ans = 1;
  }
  else{
    ans = (h * w + 1) / 2;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
INFTY = 100 * 100 * 100 + 1  # 1 ≤ r,c ≤ 100


n = int(input())

p = [None for _ in range(n + 1)]
m = [[None] * (n + 1) for _ in range(n + 1)]

for i in range(n):
    r, c = map(int, input().split())

    if i == 0:
        p[0] = r

    p[i + 1] = c

def matrix_chain_multiplication():
    for i in range(1, n + 1):
        m[i][i] = 0

    for l in range(2, n + 1):
        for i in range(1, n - l + 1 + 1):
            j = i + l - 1
            m[i][j] = INFTY
            for k in range(i, j - 1 + 1):
                m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + p[i - 1] * p[k] * p[j])


matrix_chain_multiplication()
print(m[1][n])



Measured memory_bytes: 5676
import java.util.*;
 
public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	List<Integer> bi = Arrays.asList(2, 4, 8, 16, 32, 64);
    	for (int i = N; 1 < i; i--) {
    		if (bi.contains(i)) {
    			System.out.println(i);
    			System.exit(0);
    		}
    	}
    	System.out.println(1);
    }
}

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

using namespace std;

using ll = long long;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, q;
  string s;
  cin >> n >> q >> s;
  vector<int> cnt(n);
  for (int i = 1; i < n; i++) {
    cnt[i] = cnt[i - 1] + (s[i - 1] == 'A' && s[i] == 'C');
  }
  while (q--) {
    int l, r;
    cin >> l >> r;
    l--, r--;
    cout << cnt[r] - cnt[l] << '\n';
  }
  return 0;
}


Measured memory_bytes: 3864
/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        fozubaoyou    pass System Test!
        from:https://codeforces.com/contest/472/submission/7996840
*/
 
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define fin(ans) cout<<(ans)<<endl
#define STI(s) atoi(s.c_str())
#define mp(p,q) make_pair(p,q)
#define pb(n) push_back(n)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define Sort(a) sort(a.begin(),a.end())
#define Rort(a) sort(a.rbegin(),a.rend())
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;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);};};
const int MOD = 1000000007;
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;

vector<ll> enum_div(ll n){
	vector<ll> ret;
	for(ll i = 1 ; i*i <= n ; ++i){
		if(n%i == 0){
			ret.push_back(i);
			if(i != 1 && i*i != n){
				ret.push_back(n/i);
			}
		}
	}
	return ret;
}

int main(void){
    
	ll n,m;
	cin>>n>>m;
	vll yakusu=enum_div(m);
	yakusu.push_back(m);

	ll ans=1;

	for(ll i=0;i<yakusu.size();i++){
		if(n*yakusu[i]<=m)ans=max(ans,yakusu[i]);
	}

	fin(ans);
	
}


Measured memory_bytes: 256
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    import math
    a,b,c,x,y=map(int, input().split())
    cmax=max(x,y)*2
    l=[]
    for i in range(cmax+1):
        amai = math.ceil(x - 0.5 * i)
        bmai = math.ceil(y - 0.5 * i)
        if 0.5*i>=x and 0.5*i>=y:
            amai=0
            bmai=0
        elif 0.5*i>=x:
            amai=0
        elif 0.5*i>=y:
            bmai=0
        l.append(amai*a+bmai*b+i*c)
    print(min(l))
resolve()

Measured memory_bytes: 62432
function main(_stdin) {
    const stdin = _stdin.split('\n').filter(e => e.length);
    const [len, maxWeight] = stdin.shift().split(' ').map(Number);
    const items = stdin.map(e => {
        return e.split(' ').map(Number);
    });

    const maxVal = findMaxVal(items, maxWeight);
    console.log(maxVal[0]);
}



function findMaxVal(items, maxWeight) {
    const table = new Array(maxWeight + 1).fill([0, 0]);
    let lastTable = [];

    for (let i = 0, l = items.length; i < l; i++) {
        lastTable = table.slice();
        for (let j = 0; j <= maxWeight; j++) {
            if (j === 0) {
                table[j] = [0, 0];
            } else {

                // tableのインデックスjは仮の最大重量
                // table[j]はナップザックの最大重量がjのときに入る最大の価値のアイテム
                // table[j]に入るアイテムは以下のロジックで決定する
                //      1 . アイテムの重量がjを超える場合、table[j]のまま
                //      2 . アイテムの重量がjを超えない場合、table[j]とアイテムの価値が大きい方
                //      3 . lastTable[j - 現在のアイテムの重さ]がある場合、2の価値と比較して大きい方
                // アイテムごとに最大重量までチェックしたらそのテーブルをlastTableにコピーする
                const ref = lastTable[j - items[i][1]];
                table[j] = j >= items[i][1] && table[j][0] < items[i][0] ? items[i].slice() : table[j];
                if(ref !== undefined && j >= ref[1] + items[i][1]){
                    const newVal = [ref[0] + items[i][0], ref[1] + items[i][1]];
                    table[j] = table[j][0] < newVal[0] ? newVal.slice() : table[j];
                }
            }
        }
    }
    return table[maxWeight];
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));




Measured memory_bytes: 34376
#include <stdio.h>

int main(){
	int a,b;
	scanf("%d%d",&a,&b);
	if(a>b){
		printf("a > b");
	}
	else if(a<b){
		printf("a < b");
	}
	else {
		printf("a == b");
	}
	printf("\n");
	return 0;
}

Measured memory_bytes: 584
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <utility>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <assert.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <unordered_map>
using namespace std;

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

template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";}
template <typename T, typename... V>void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef HOME
#warning CHECK int:ll::INT_MAX:LLONG_MAX
#define maxn 20
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define maxn 2000006
#define gcd __gcd
#define debug(x...)
#endif

#define ff first
#define endl '\n'
#define ss second
#define inf 0x3f3f3f3f
#define MOD 1000000007
#define f(i,x,n) for(int i=x;i<=n;i++)
#define fr(i,x,n) for(int i=x;i>=n;i--)
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

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


int main() {

	long long n, m, x; cin >> n >> m >> x;
	vector<vector<long long>> mat(n, vector<long long>(m + 1, 0));

	long long min_cost = MOD;
	for (long long i = 0; i <= n - 1; i++) {
		cin >> mat[i][0];
		for (long long j = 1; j <= m; j++) cin >> mat[i][j];
	}

	for (long long mask = 0; mask < ((1ll << n)); mask++) {
		vector<long long> alg(m + 1, 0);
		long long cost = 0;
		for (long long j = 0; j <= n - 1; j++) {
			if ((mask & (1ll << j))) {
				cost += mat[j][0];
				for (long long k = 1; k <= m; k++) alg[k] += mat[j][k];
			}
		}

		bool flg = true;
		for (long long i = 1; i <= m; i++) {if (alg[i] < x) flg = false;}

		if (flg) min_cost = min(min_cost, cost);
	}
	if (min_cost == MOD) cout << -1;
	else cout << min_cost;

	return 0;
}

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

const int N = 2e5;

int n,m;
int li[N+5];

vector<int> com;

int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
		scanf("%d",&li[i]);
	}
	sort(li+1,li+n+1);
	int cnt = 1;
	com.clear();
	for(int i=2;i<=n;i++){
		if(li[i] == li[i-1]){
			cnt++;
		} else {
			com.push_back(cnt);
			cnt = 1;
		}
	}
	com.push_back(cnt);
	sort(com.begin(),com.end());
	reverse(com.begin(),com.end());
	int ans = n;
	for(int i=0;i<min(m,(int)com.size());i++){
		ans-=com[i];
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 2168
#include <iostream>
using namespace std;
int main( void )
{
	string characters[10] = 
	{
		"",
		"',.!?",
		"abcABC",
		"defDEF",
		"ghiGHI",
		"jklJKL",
		"mnoMNO",
		"pqrsPQRS",
		"tuvTUV",
		"wxyzWXYZ"
	};

	string input;
	while ( cin >> input )
	{
		int number;
		int prev_number = -1;
		int current = 0;
		for ( string::iterator it = input.begin(); it != input.end(); it++ )
		{
			number = (int)( *it - '0' );
			if ( prev_number == -1 ) current = 0;
			else if ( prev_number == number ) current++;
			else
			{
				if ( prev_number == 0 )
				{
					for ( int i = 0; i < current; i++ ) cout << ' ';
				}
				else
				{
					string& n = characters[prev_number];
					current %= n.size();
					cout << n[current];
				}
				current = 0;
			}
			prev_number = number;
		}
		string& last = characters[prev_number];
		current %= last.size();
		cout << last[current] << endl;
	}

	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
//typedef
typedef long long ll;
typedef pair<ll,ll> PLL;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<bool> VB;
typedef vector<VB> VVB;
typedef vector<string> VS;
//template
template<class T> inline bool chmin(T &a, T b) {if (a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b) {if (a < b){a = b; return true;} return false;}
//repetition
#define FOR(i,a,b) for(int i=int(a); i<int(b); ++i)
#define FORD(i,a,b) for(int i=int(a); i<int(b); --i)
#define REP(i,N) for(int i=0; i<int(N); ++i)
#define REPS(i,N) for(int i=0; i<=int(N); ++i)
#define REPD(i,N) for(int i=0; i<int(N); --i)
//container util
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//constant
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7
#define MAXR 100000 //配列の最大のrenge
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main() {
    int N; cin >> N;
    VVL G(N,VL(2));
    REP(i,N) {
        int a,b;
        cin >> a >> b;
        G.at(i).at(0) = a;
        G.at(i).at(1) = b; 
    }

    int cnt = 0;
    REP(i,N) {
        if (G[i].at(0) == G[i].at(1)) cnt++;
        else cnt = 0;
        if (cnt == 3) {
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;
}

Measured memory_bytes: 3628
package main

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

const (
	initialBufSize = 10000
	maxBufSize     = 100000000
)

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

// var sc = bufio.NewScanner(os.Stdin)
// var buff []byte
//
// func init() {
// 	sc.Split(bufio.ScanWords)
// 	sc.Buffer(buff, 100000000)
// 	log.SetFlags(log.Lshortfile)
// }

func main() {
	input := nextString()
	remSumArray := make([]int, 2019)
	remSumArray[0] = 1
	var num int
	digit := 1
	for i := len(input) - 1; i >= 0; i-- {
		num += int(input[i]-48) * digit
		digit *= 10
		digit %= 2019
		remSumArray[num%2019]++
	}
	var result int
	for _, num := range remSumArray {
		result += num * (num - 1) / 2
	}
	fmt.Println(result)
}

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

func nextFloat64() float64 {
	sc.Scan()
	f, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return f
}

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

func nextInts(n int) (r []int) {
	r = make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}

var dy = []int{0, 1, 0, -1}
var dx = []int{1, 0, -1, 0}
var MAX = math.MaxInt32

func pow(a, b int) int {
	return int(math.Pow(float64(a), float64(b)))
}

func lcm(a, b int) int {
	return a * b / gcd(a, b)
}
func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}
func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type Pair struct {
	a, b int
}

type Pairs []Pair

func (p Pairs) Len() int {
	return len(p)
}
func (p Pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p Pairs) Less(i, j int) bool {
	if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return p[i].a < p[j].a
}


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

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

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()
#define endl "\n"

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

  ll x;
  cin>>x;
  ll ans=2*(x/(6+5));
  if(x%(6+5)!=0)ans++;
  if(x%(6+5)>6)ans++;
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256