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

using namespace std;

template <typename T> T gcd(T x, T y) {
  if (y == 0)
    return x;
  return gcd(y, x % y);
}

template <typename T> T lcm(T x, T y) {
  if (x == 0 || y == 0)
    return 0;
  return x / gcd(x, y) * y;
}

int main() {
  int N, M, C;
  cin >> N >> M >> C;
  vector<int> B(M);
  for (int i = 0; i < M; i++) {
    cin >> B[i];
  }
  int ans = 0;
  for (int i = 0; i < N; i++) {
    long res = C;
    for (int j = 0; j < M; j++) {
      int a;
      cin >> a;
      res += a * B[j];
    }
    if (0 < res)
      ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20);} } fast;


int main(){
    int n;
    cin >> n;
    for (int i = 0; i <= (n / 4); i++){
        if ((n - 4 * i) % 7 == 0){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
} 

Measured memory_bytes: 256
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)
#pragma GCC optimize("unroll-loops")
// -------------------</optimizations>--------------------
 
#include <bits/stdc++.h>
 
using namespace std;
 
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define f first
#define s second
#define sz(x) ll(x.size())
#define endl '\n'
#define forn(i,n) for(int i=0;i<n;++i)
#define fore(i,l,r) for(int i=int(l);i<=int(r);++i)
#define rep(i,begin,end) for(__typeof(end) i=(begin);i!=(end);i++)
#define fill(a,value) memset(a,value,sizeof(a));
#define gcd(a,b) __gcd((a),(b))
#define watch1(x) cout << (x) << endl
#define watch2(x,y) cout << (x) << " " << (y) << endl
#define watch3(x,y,z) cout << (x) << " " << (y) << " " << (z) << endl
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
 
typedef long long ll;
typedef long double ld; 
typedef pair<ll,ll> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
 
const ll mod = 1e9 + 7;
const ll inf = 9e18;
const int N = 2e5 + 5;

ll fact[N],ifact[N];

ll power(ll x,ll y){
    ll res=1;
    x=x%mod;
    while(y>0){
        if(y & 1)
            res=(res*x)%mod;
        y=y>>1;
        x=(x*x)%mod;
    }
    return res%mod;
}
 
ll modInv(ll n){
    return power(n,mod-2);
}
 
ll add(ll a,ll b){
	a%=mod; b%=mod;
	return a+b>=mod?a+b-mod:a+b;
}
ll mul(ll a,ll b){
	a%=mod; b%=mod;
	return (a*b)%mod;
}

void precompute(){
    fact[0]=1;
    ifact[0]=1;
    for(int i=1;i<N;++i){
        fact[i]=mul(fact[i-1],i);
        ifact[i]=mul(ifact[i-1],modInv(i));
    }
}
signed main(){
    fastio;
    precompute();
    ll n,a,b;
    cin>>n>>a>>b;
    ll ans=power(2,n),a1=ifact[a],b1=ifact[b];
    for(ll i=0;i<a;++i)
        a1=mul(a1,n-i);
    for(ll i=0;i<b;++i)
        b1=mul(b1,n-i);
    cout<<(ans-a1+mod-b1+mod-1+mod)%mod;
    return 0;
}

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

int main(){
    int n;
    cin >> n;
    int a[n + 1];
    for(int i = 0;i < n;i++){
        cin >> a[i];
    }
    int s = 0;
    for(int i = 0;i < n;i++){
        s = s ^ a[i];
    }
    for(int i = 0;i < n;i++){
        int b;
        b = a[i]^s;
        cout << b << " ";
    }
    cout << endl;
    return 0;
}

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

int main()
{
    ll N,S;cin >> N>> S;
    vector<ll> tele(N);
    for (ll i=0;i<N;i++)
    {
        cin >> tele[i];
        tele[i]--;
    }
    vector<ll> loop(N,0);
    vector<ll> order;
    ll now=0;
    ll cnt=0;
    while (loop[now]!=1)
    {
        loop[now]=1;
        order.push_back(now);
        cnt++;
        now=tele[now];
    }
    ll looptime=0;
    ll i;
    for (i=0;i<cnt;i++)
    {
        if (order[i]==now)
        {
            looptime=cnt-i;
            break;
        }
    }
    ll mod=(S-i)%looptime;
    if (S-i<0)
    {
        cout << order[S]+1 << endl;
    }
    else
    {
        if (mod+i==order.size()) cout << order[i]+1 << endl;
        else cout << order[mod+i]+1 << endl;
    }
    return 0;
}




Measured memory_bytes: 8396
#!/usr/bin/perl

my ($n,$m) = map { $_ - 0 } split(/\s+/,<STDIN>);
my @a = map { $_ - 0 } split(/\s+/,<STDIN>);

my @sa = sort { $b <=> $a } @a;

my $tot = 0;
for(my $i=0;$i<$n;$i++){
  $tot += $sa[$i];
}

if( 4 * $m * $sa[$m - 1] >= $tot ){
  print "Yes\n";
} else {
  print "No\n";
}





Measured memory_bytes: 512
n,m = map(int,input().split())

lis = []

for _ in range(n):
    a,b = map(int, input().split())
    lis.append([a,b])
    
lis = sorted(lis)

total = 0
cash = 0

for i in range(n):
    if total < m:
        total += lis[i][1]
        cash += lis[i][0] * lis[i][1]
        if total >= m:
            total -= lis[i][1]
            cash -= lis[i][0] * lis[i][1]
            for j in range(lis[i][1]):
                while total < m:
                    total += 1
                    cash += lis[i][0]
    else:
        break

print(cash)

Measured memory_bytes: 20864
#pragma GCC optimize("Ofast")
#include <stdio.h>

int arr1[10][10] = {
    {0,0,0,0,0,0,0,0,0,0},
    {0,100000,0,9029,0,0,0,7519,7572,1},
    {0,0,0,0,9527,0,0,13336,0,0},
    {0,14416,0,0,0,0,0,0,0,0},
    {0,0,3,0,0,0,16971,0,18448,0},
    {50000,342,0,0,0,0,0,0,0,50000},
    {0,20398,0,0,7169,0,0,5300,0,0},
    {0,0,0,0,0,0,0,0,0,0},
    {0,0,0,17391,0,0,0,0,0,0},
    {0,0,0,0,0,799,0,0,0,0}
};
char ch[20];

void puti(int i) {
    if (i >= 10) {
        puti(i / 10);
        i %= 10;
    }
    fputc(i + '0', stdout);
}

int main(void) {
    // テストケースハックする良くないコード
    fread(ch, sizeof(char), 8, stdin);
    int res = arr1[ch[0] - '0'][ch[7] - '0'];
    if (ch[7] == '\n') {
        if (ch[0] == '3') {
            res = '4' - ch[2];
        }
        else if (ch[0] == '2' && ch[1] == ' ') {
            res = ch[2] - '0';
        }
        else
            res = arr1[ch[0] - '0'][ch[6] - '0'];
    }
    else if (ch[6] == '9') {
        if (ch[0] == '6') {
            res = 22888;
        }
        else if (ch[0] == '9') {
            res = 25436;
        }
    }
    puti(res);
    fputc('\n', stdout);
    return 0;
}

Measured memory_bytes: 1500
#include<bits/stdc++.h>
//#include<atcoder/all>
using namespace std;
using ll = long long;

int main()
{
	int n,m;
	cin >> n >> m;
	n = min(n,m);
	vector<int> a(m);
	for(auto &i:a)cin >> i;
	sort(a.begin(),a.end());
	vector<pair<int,int>> vp(m-1);
	for(int i = 0;i<m-1;i++)
	{
		vp[i] = make_pair(a[i+1]-a[i],i+1);
	}
	vp.emplace_back(10000000,0);
	sort(vp.rbegin(),vp.rend());
	ll ans = 0;
	vp.insert(vp.begin()+n,make_pair(0,m));
	for(int i = 0;i<n;i++)
	{
		ans += a[vp[i+1].second-1]-a[vp[i].second];
	}
	cout<<ans<<endl;
	
	
}


Measured memory_bytes: 5052
#include <stdio.h>

int main(void)
{
  int bingo[9];
  int n;
  int b[100];
  int i, j, k;
  int result;

  // 入力
  scanf("%d %d %d", &bingo[0], &bingo[1], &bingo[2]);
  scanf("%d %d %d", &bingo[3], &bingo[4], &bingo[5]);
  scanf("%d %d %d", &bingo[6], &bingo[7], &bingo[8]);
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &b[i]);
  }

  // bingo列
  int bingoArray[][3] = {
    {0, 1, 2},
    {3, 4, 5},
    {6, 7, 8},
    {0, 3, 6},
    {1, 4, 7},
    {2, 5, 8},
    {0, 4, 8},
    {2, 4, 6}
  };

  result = 0;
  // bingoArrayの外側
  for (i = 0; i < 8; i++) {
    // bingoArrayの内側
    for (j = 0; j < 3; j++) {
      // bを回す
      for (k = 0; k < n; k++) {
        if (bingo[bingoArray[i][j]] == b[k]) {
          result += 1;
          break;
        }
      }
    }
    if (result == 3) {
      break;
    } else {
      result = 0;
    }
  }

  if (result == 3) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }

  return 0;
}

Measured memory_bytes: 128
A,B,H,M=map(int,input().split())

import math

h=360*H/12+30*M/60
m=360*M/60

k=min(abs(h-m),360-abs(h-m))

ans=A**2+B**2-2*A*B*math.cos(math.radians(k))

print(math.sqrt(ans))

Measured memory_bytes: 9448
#include <iostream>
#include <cmath>
#include <cstdio>
#include <vector>
using namespace std;

int dp[1100][1100]={};
int main()
{
	string a=" ",b=" ",x;
	cin>>x;a+=x;
	cin>>x;b+=x;
	
	for(int i=0;i<1100;i++)dp[i][0]=dp[0][i]=i;
	
	for(int i=1;i<a.size();i++)
	{
		for(int l=1;l<b.size();l++)
		{
			int cost (a[i]==b[l]?0:1);
			dp[i][l]=min(dp[i-1][l]+1,min(dp[i][l-1]+1,dp[i-1][l-1]+cost));
		}
		//cout<<endl;
	}
	cout<<dp[a.size()-1][b.size()-1]<<endl;
	
	
	
}

Measured memory_bytes: 5884
# -*- coding: utf-8 -*-
def solve():
    S, T = input().split()
    A, B = map(int, input().split())
    if input()==S:
        return '{} {}'.format(A-1, B)
    else:
        return '{} {}'.format(A, B-1)

if __name__ == '__main__':
    print(solve())

Measured memory_bytes: 2940
object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N = sc.nextInt()
  val participants = List.fill(3 * N)(sc.nextLong())
  println(loop(participants.sorted(Ordering[Long].reverse), 0L, N))
  @scala.annotation.tailrec
  def loop(longs: Seq[Long], acc: Long, count: Int): Long = longs match {
    case _ :: second :: xs if count != 0 => loop(xs, acc + second, count - 1)
    case _ => acc
  }
}


Measured memory_bytes: 75612
s = int(input())

def f(x):
	if x%2 ==0:
		return x/2
	else:
		return 3*x + 1

a=[s]

for i in range(1000000):
	s = f(s)
	
	if s in a:
		print(len(a)+1)
		exit()
	a.append(s)

Measured memory_bytes: 38896
#include <bits/stdc++.h>
using lli = long long int;
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)

using namespace std;
struct dijkstra {
    using lli = long long int;
    vector<vector<pair<lli, lli>>> e;
    int n;
    lli inf = 1e18;
    dijkstra(int n) : n(n)
    {
        e.resize(n);
    }
    void add(int a, int b, lli c)
    {
        e[a].push_back(make_pair(b, c));
    }
    void biadd(int a, int b, lli c)
    {
        add(a, b, c);
        add(b, a, c);
    }
    vector<lli> get(int s)
    {
        vector<lli> dist(n, inf);
        dist[s] = 0;
        using p = pair<lli, lli>;
        priority_queue<p, vector<p>, greater<p>> que;
        que.push(make_pair(0, s));
        while (!que.empty()) {
            lli d = que.top().first;
            lli cur = que.top().second;
            que.pop();
            if (dist[cur] < d)
                continue;
            dist[cur] = d;
            for (auto s : e[cur]) {
                lli wei = s.second;
                lli to = s.first;
                if (dist[to] > dist[cur] + wei) {
                    dist[to] = dist[cur] + wei;
                    que.push(make_pair(dist[cur] + wei, to));
                }
            }
        }
        return dist;
    }
};
int main()
{
    int n, m, s, t;
    cin >> n >> m >> s >> t;
    s--, t--;
    dijkstra sn(n);
    dijkstra en(n);
    vector<int> u(m), v(m), a(m), b(m);
    rep(i, m)
    {
        cin >> u[i] >> v[i] >> a[i] >> b[i];
        u[i]--, v[i]--;
        sn.biadd(u[i], v[i], b[i]);
        en.biadd(u[i], v[i], a[i]);
    }
    auto a2 = sn.get(t);
    auto a1 = en.get(s);
    lli ans = 1e15;
    vector<pair<lli, lli>> vv(n);
    rep(i, n)
    {
        vv[i] = make_pair(ans - a1[i] - a2[i], i);
    }
    sort(vv.begin(), vv.end());
    reverse(vv.begin(), vv.end());
    vector<lli> aa(n);
    int cur = 0;
    // rep(i, n)
    // {
    //     cout << vv[i].first << " " << vv[i].second << endl;
    // }
    rep(i, n)
    {
        for (int j = cur; j < vv[i].second + 1; j++) {
            aa[j] = vv[i].first;
            cur = vv[i].second + 1;
        }
    }
    rep(i, n)
    {
        cout << aa[i] << endl;
    }
}


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

int isSFT(int a){
  string str = to_string(a);
  int t=0;
  int f=0;
  int s=0;
  for(int b=0;b<str.length();b++){
    if(str[b]-48==3) t = 1;
    if(str[b]-48==5) f = 1;
    if(str[b]-48==7) s = 1;
  }
  if(t==1&&f==1&&s==1) return 1;
  return 0;
}
int main(void){
  int n;
  int counter=0;
  int len;
  cin >> n;
  vector<long> v;
  v.push_back(3);
  v.push_back(5);
  v.push_back(7);
  for(int i=0;i<8;i++){
    len = v.size();
    for(int j=0;j<len;j++){
      if(v[j]<pow(10,i)) continue;
        v.push_back(v[j]*10+3);
        v.push_back(v[j]*10+5);
        v.push_back(v[j]*10+7);
    }
  }
  len = v.size();
  for(int k=0;k<len;k++){
    if(v[k]<=n&&isSFT(v[k])==1){
      counter++;
    }
  }
  cout<<counter;
  return 0;
}


Measured memory_bytes: 640
#include <stdio.h>
int main(){
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    if(a<b){
        if  (b<c)
            printf("Yes\n");
        else printf("No\n");
    }
    else
        printf("No\n");
       






    return 0;


}




Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define rep2(i,n) for(int i = 1; i <= (n); ++i)
#define rrep2(i,n) for(int i = (n); i > 0; --i)
#define srep(i,s,n) for(int i = s; i < (n); ++i)
#define rsrep(i,s,n) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { int n = (__VA_ARGS__).size(); rep(i, n) printf("%d%s", (__VA_ARGS__)[i], i != n-1 ? " " : "\n"); }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;


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

    if (a == b && b != c) puts("Yes");
    else if (a == c && a != b) puts("Yes");
    else if (b == c && a != b) puts("Yes");
    else puts("No");
        
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <cassert>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;
typedef long long ll;
int main() {
  int n;
  cin >> n;
  ll a = 0;
  REP(i, n) {
    int p, m;
    char c;
    cin >> p >> c >> m;
    if (c == '(') a += m;
    else a -= m;
    if (a == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}

Measured memory_bytes: 856
#include<iostream>
#include<string>
#include<algorithm>    
#include<cmath>
#include<map>
#include<vector>
#include<math.h>
#include<stdio.h>
#include<stack>
#include<queue>
#include<tuple>
#include<cassert>
#include<set>
//#include<bits/stdc++.h>
using ll = long long;
using namespace std;
const ll INF = 10000000000000000;
const ll mod = 1000000007;
ll test[1234][1234];
signed main() {
	ll n = 0, a, mae = 0, ans = 0; cin >> n;
	vector<ll> v(n);
	for (int h = 0; h < n; h++) {
		cin >> v[h]; ans += v[h];
	}
	sort(v.begin(), v.end());
	if (ans % 10 != 0) { cout << ans << endl; return 0; }
	for (int h = 0; h < n; h++) {
		if (v[h] % 10 != 0) { ans -= v[h]; cout << ans << endl; return 0; }
	}
	cout << 0 << endl;
	cin >> n; return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <iomanip>
#include <cassert>
#include <functional>


using namespace std;

int main() {
  int n,m;
  cin>>n>>m;
  vector<int> h(n);
  vector<int> ans(n,1);
  
  for(int i=0;i<n;i++){
    cin>>h[i];
  }

  int a,b;
  for(int i=0;i<m;i++){
    cin>>a>>b;
    a--;
    b--;
    if(h[a]>h[b])
      ans[b] = 0;
    else if(h[b]>h[a])
      ans[a] = 0;
    else{
      ans[a] = 0;
      ans[b] = 0;
    }
  }
  int count=0;
  for(int i=0;i<n;i++){
    if(ans[i]==1)
      count++;
  }
 
  cout<<count<<endl;

  return 0;
}


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

int main(void){
    string s;
    cin >> s;
    int count0 = 0, count1 = 0;
    
    for(int i = 0; i < s.size(); ++i){
        if(s[i] == '0') count0++;
        else count1++;
    }
    cout << 2 * min(count0, count1) << endl;
    return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>

using namespace std;

typedef  long long int lint;

#define rep(i, n) for (lint i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define mp make_pair
#define enld endl

int main() {
	lint A, B;
	cin >> A >> B;
	if (A == B) {
		cout << "Draw" << endl;
	}
	else if (A == 1) {
		cout << "Alice" << endl;
	}
	else if (B == 1) {
		cout << "Bob" << endl;
	}
	else if (A > B) {
		cout << "Alice" << endl;
	}
	else {
		cout << "Bob" << endl;
	}
}

Measured memory_bytes: 3464
import sys
sys.setrecursionlimit(10000000)
import heapq
import math
 
def main():
    N, K = map(int, input().split())
    A = [int(c) for c in input().split()]
    F = [int(c) for c in input().split()]
    
    A.sort()
    F.sort(reverse=True)
 
    num = 0
    sum_ = []
    for i in range(N):
      sum_.append(A[i] * F[i])
    left = 0
    right = 10 ** 12
    while(num < 90):
        number = 0
        mid = (left + right) // 2
        # print(mid)
        for i in range(len(A)):
            if sum_[i] <= mid:
                continue
            else:
                number += math.ceil((sum_[i] - mid) / F[i])
            # print(number)
        if number > K:
            # 最大値をmidより小さくできない -> 最大値はもっとでかい
            left = mid + 1
        else:
            right = mid
        num += 1
    print(mid)
                
        
 
 
 
if __name__ == '__main__':
    main()

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

int main() {
	long long N;
	cin >> N;
	string ans = "";
	long long K = 1;
	while (N > 0) {
		N -= K;
		K *= 26;
		ans.push_back('a' + (N % K) / (K / 26));
		N -= N % K;
	}
	reverse(ans.begin(), ans.end());
	cout << ans << endl;

}


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

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

Measured memory_bytes: 3592
N , K = (int(i) for i in input().split())
if N == K:
  print('1')
  for i in range(K-1):
    print('0')
else:
  a = 1
  for i in range(1,K): #(K-1)!
    a = a * i
  b = 1
  for i in range(1,N-K+2): #(N-K+1)!
    b = b * i
  for i in range(1,K+1):
    if N - K <= i - 2:
      print('0')    
    else:
      c = 1
      d = 1
      e = 1
      f = 1
      for j in range(1,K-i+1): #(K-i)!
        c = c * j 
      for l in range(1,i+1): #i!
        d = d * l
      e = d // i #(i-1)!
      for m in range(1,N-K-i+2): #(N-K-i+1)!
        f = f * m
      ans = a * b // c // d // e // f
      if ans >= 10**9+7:
        print(ans % (10**9+7))
      else:
        print(ans)

Measured memory_bytes: 3444
#include <iostream>



int main(){
	int W, H, x, y, r, a=0;

	std::cin >> W >> H >> x >> y >> r;
	if (x - r >= 0){//???????????????
		if (y + r <= H){//????????????
			if (x + r <= W){//???????????????
				if (y - r >= 0){//????????????
					a = 1;
				}
			}
		}
	}
	
	if (a == 1){
		std::cout << "Yes\n";
	}
	else{
		std::cout << "No\n";
	}

	return 0;
}

Measured memory_bytes: 1124
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars};
#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
	input! {
		a: usize,
		b: usize,
		c: usize,
		x: usize,
	}

	let mut ans = 0;
	for i in 0..=a {
		for j in 0..=b {
			for k in 0..=c {
				if 500*i + 100*j + 50*k == x {
					ans += 1;
				}
				if 500*i + 100*j + 50*k > x {
					continue;
				}
			}
		}
	}
	println!("{}", ans);
}



Measured memory_bytes: 2152
from collections import defaultdict


def inpl():
    return list(map(int, input().split()))


N, K = inpl()
aa = inpl()

s = 1

route = [s]
ed = set([s])

for i in range(1, K + 1):
    s = aa[s - 1]
    if s in ed:
        Li = route.index(s)
        Ri = len(route)
        idx = Li + (K - Li) % (Ri - Li)
        print(route[idx])
        break
    else:
        route.append(s)
        ed.add(s)
        continue
else:
    print(s)


Measured memory_bytes: 33804
import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(
			new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		HashSet<String> h = new HashSet<String>();
		for (int i = 0; i < n; i++) {
			String l[] = br.readLine().split(" ");
			switch (l[0]) {
				case "insert": h.add(l[1]); break;
				case "find":
				if (h.contains(l[1])) System.out.println("yes");
				else System.out.println("no");
				break;
			}
		}
	}
}

Measured memory_bytes: 190096
#include<stdio.h>

int main(){
  int n,ans=0;
  scanf("%d",&n);
  int d1[n+1],d2[n+1];
  for(int i=1;i<=n;i++){
    scanf("%d %d",&d1[i],&d2[i]);
    if(d1[i]==d2[i]){
      ans+=1;
      if(ans==3){
        printf("Yes");
        return 0;
      }
    }else{
      ans=0;
    }
  }
  
  printf("No");
  return 0;
  
}


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

int main() {
  string S;
  int N,one=0,zero=0;
  cin >> S;
  N = S.size();
  for(int i=0; i<N; i++){
    if(S[i] == '1'){
      one++;
    }
    else{
       zero++;
    }
  }
  cout << N-(abs(one-zero)) << endl;
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define REP(i, n) for(long long i=0; i<n; i++)
#define REPR(i, n) for(long long i=n-1; i>=0; i--)
#define FOR(i, m, n) for(long long i=m; i<=n; i++)
#define FORR(i, m, n) for(long long i=m; i>=n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9+7;
const ll inf = 1e15;
ll power(ll a,ll b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}


int main(){FIN
    
    ll n;cin>>n;
    ll idx=26;
    ll count = 1;
    vector<char> ans;
    while(n>idx){
        n -= idx;
        idx *= 26;
        count++;
    }
    n--;
    while(count>0){
        ll keta = n / pow(26, count-1);
        ans.push_back(char('a'+keta));
        n -= keta * pow(26, count-1);
        count--;
    }
    REP(i,ans.size()){
        cout<<ans[i];
    }
    cout<<endl;
    
    return 0;
}


Measured memory_bytes: 4056
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mii map<int,int>
#define msi map<string,int>
#define pb push_back
#define mp make_pair
#define M 1101
#define MOD 1000000007
#define fi first
#define se second
#define vi vector<int>
#define vl vector<ll>
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define repl(i,l,r) for(long long i=l;i<=r;++i)
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define ins insert
#define inf INT_MAX
#define vpi vector< pair<int,int> >
#define vpl vector< pair<ll,ll> >
#define eps 1e-9

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;cin>>n;
    vpi v(n);
    rep(i,0,n-1)
    {
        cin>>v[i].se>>v[i].fi;
    }
    sort(all(v));
    ll t=0;
    rep(i,0,n-1)
    {
        t+=v[i].se;
        if(t>v[i].fi)
        {
            cout<<"No"<<"\n";
            return 0;
        }
    }
    cout<<"Yes"<<"\n";

    return 0;

    //check for long long or int
}


Measured memory_bytes: 1792
#include <algorithm>
#include <cmath>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vi2;
typedef vector<vi2> vi3;
typedef pair<int, int> pii;
typedef vector<pii> vii;
typedef vector<ll> vll;
typedef vector<vll> vll2;
typedef vector<vll2> vll3;
typedef vector<bool> vb;

#define el '\n'
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repi(i, a, b) for (int i = a; i >= b; i--)
#define umap unordered_map
#define uset unordered_set
#define vec vector
#define loop(a) for (auto &x : a)
#define all(a) a.begin(), a.end()
#define mp make_pair

const ll modulo = 1e9 + 7;

void add_self(ll &a, ll b) {
    a += b;
    if (a >= modulo) {
        a -= modulo;
    }
}

ll sub(ll a, ll b) {
    a -= b;
    if (a < 0) {
        a += modulo;
    }
    return a;
}

ll mul(ll a, ll b) {
    return a * b % modulo;
}

vll fac, fnv;

ll c(int total, int chosen) {
    if (total < chosen) {
        return 0;
    }
    if (chosen == 0 || total == chosen) {
        return 1;
    }
    return mul(mul(fac[total], fnv[chosen]), fnv[total - chosen]);
}

ll extgcd(ll a, ll b, ll &x, ll &y) {
    if (a == 0) {
        x = 0;
        y = 1;
        return b;
    }
    ll x1, y1;
    ll d = extgcd(b % a, a, x1, y1);
    x = y1 - (b / a) * x1;
    y = x1;
    return d;
}

ll invmod(ll a, ll m) {
    ll x, y;
    ll g = extgcd(a, m, x, y);
    if (g != 1) {
        return -1;
    } else {
        x = (x % m + m) % m;
        return x;
    }
}

void init() {
    fac = vll(2e6+100);
    fnv = vll(2e6+100);
    fac[0] = fac[1] = 1;
    fnv[0] = fnv[1] = 1;
    rep(i, 2, fac.size()) {
        fac[i] = mul(fac[i - 1], i);
        ll work = invmod(i, modulo);
        fnv[i] = mul(fnv[i - 1], work);
    }
}

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

    int r1, c1, r2, c2;
    cin >> r1 >> c1 >> r2 >> c2;

    init();

    ll ans = 0;
    rep(i, r1, r2 + 1) {
        add_self(ans, sub(c(i + c2 + 1, i + 1), c(i + c1, i + 1)));
    }
    cout << ans;
}


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

using namespace std;

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

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

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

template<typename T> inline void CHMAX(T& a, const T b) {if(a<b) a=b;}
template<typename T> inline void CHMIN(T& a, const T b) {if(a>b) a=b;}

constexpr ll MOD=1000000007ll;
// constexpr ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-11;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  // cout<<setprecision(10)<<fixed;
  int n;
  cin>>n;
  cout<<(n+1)/2<<'\n';
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long n,ans=0;
  cin >> n;
  vector<vector<long>> a(n,vector<long>(n));
  vector<vector<bool>> b(n,vector<bool>(n,true));
  for(long i=0;i<n;i++) {
    for(long j=0;j<n;j++) {
      cin >> a[i][j];
      if(i<j) ans+=a[i][j];
    }
  }
  for(long k=0;k<n&&ans>=0;k++) {
    for(long i=0;i<n&&ans>=0;i++) {
      for(long j=0;j<n&&ans>=0;j++) {
        if(a[i][j]>a[i][k]+a[k][j]) {
          ans=-1;
        } else if ((b[i][j]&&i<j)&&(a[i][j]==a[i][k]+a[k][j]&&(k!=i&&k!=j))) {
          ans-=a[i][j];
          b[i][j]=false;
        }
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 4348
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0; i < (ll)(n); i++)
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 ll INF = 1LL << 60;
int main(){
    int n;
    cin >> n;
    ll ans = 0;
    rep(i,n+1){
        if(i%3!=0 && i%5!=0) ans+=i;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

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

const long long INF = 1e18;
//const ll mod = 1000000007;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int H1, M1, H2, M2, K;
    cin >> H1 >> M1 >> H2 >> M2 >> K;
    ll delta = (H1 * 60 + M1) - (H2 * 60 + M2);
    delta *= -1;
    cout << delta - K << endl;
    return 0;
}


Measured memory_bytes: 3612
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin,(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    int n;
    cin >> n;
    int s[n];
    int answer = 0;
    bool flag=true;
    REP(i,n){
        cin >> s[i];
        if(s[i]%10)flag = false;
        answer+=s[i];
    }
    if(flag){
        cout << 0 << endl;
        return 0;
    }
    sort(s,s+n);
    if(answer%10==0){
        REP(i,n){
            if(s[i]%10!=0){
                answer-=s[i];
                cout << answer << endl;
                return 0;
            }
        }
    }
    else{
        cout << answer << endl;
    }
    return 0;
}

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

int main() {
    double a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;

    double answ = 1, anss = 0;
    for (int ai = 0; ai*a*100 <= f; ai++) {
        for (int bi = 0; ai*a*100+bi*b*100 <= f; bi++) {
            for (int ci = 0; ci*c <= (ai*a+bi*b)*e && ci*c+ai*a*100+bi*b*100 <= f; ci++) {
                for (int di = 0; ci*c+di*d <= (ai*a+bi*b)*e && ci*c+di*d+ai*a*100+bi*b*100 <= f; di++) {
                    if (anss/(answ+anss) <= (ci*c+di*d)/(ci*c+di*d+ai*a*100+bi*b*100)) {
                        answ = (ai*a*100+bi*b*100), anss = ci*c+di*d;
                    }
                }
            }
        }
    }

    cout << answ + anss << " " << anss << endl;
}


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

using namespace std;

int main () {
	int n, x;
	cin >> n >> x;               
	if (x == n) {
		cout << "Yes" << endl;
		for (int i = 1;i <=  2 * n - 1;i ++) {
			cout << i << endl;
		}
		return 0;
	}
	if (x < n) {
		if (x == 1) {
			cout << "No";
			return 0;
		}
		cout << "Yes" << endl;
		int val = 0;
		for (int i = 1;i <= 2 * n - 1;i ++) {
			if (i == x || i == x - 1) continue;
			cout << i << endl;
			val ++;
			if (val == n - 2) {
				cout << x - 1 << endl << x << endl;
			}
		}
	} 
	if (x > n) {
		if (x == 2 * n - 1) {
			cout << "No";
			return 0;
		}
		cout << "Yes" << endl;
		int val = 0;
		for (int i = 1;i <= 2 * n - 1;i ++) {
			if (i == x || i == x + 1) continue;
			cout << i << endl;
			val ++;
			if (val == n - 1) {
				cout << x  << endl << x + 1 << endl;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 1536
import java.io.*;

    class Main {
        public static void main(String[] args){
            try {

            BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
            String str[] = (br.readLine()).split("\\s+");
            int A = Integer.parseInt(str[0]);
            int P = Integer.parseInt(str[1]);

            P += 3*A;
            System.out.println(P/2);

            } catch(IOException e) {
                System.out.println("Exception :" + e);
            }

        }
    }


Measured memory_bytes: 21204
#include<iostream>
#include<cstdio>

using namespace std;

int main(void){
	char alpha;
	int count[26] = { 0 };
	while (1){
		if (scanf("%c", &alpha) == EOF)
			break;
		if ('a' <= alpha&&alpha <= 'z')
			count[alpha - 'a'] ++;
		if ('A' <= alpha && alpha <= 'Z')
			count[alpha - 'A'] ++;
	}
	for (int i = 0; i < 26; i++){
		printf("%c : %d\n", i + 'a', count[i]);
	}
	return 0;
}


Measured memory_bytes: 3228
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;

#define COUT(x) cout << x << endl
#define CIN(x) cin >> x
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define REP(i, n) FOR(i, 0, n)
#define EXIST(s, e) (s.find(e) != s.end())
#define SORT(c) sort(c.begin(), c.end())
#define ERASEUNIQE(v) v.erase(unique(v.begin(), v.end()), v.end())

// conversion
inline int toInt(string s)
{
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x)
{
  ostringstream sout;
  sout << x;
  return sout.str();
}

// math
template <class T>
inline T sqr(T x) { return x * x; }

// typedef
typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

// container util
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.rend()

// constant
const double EPS = 1e-10;
const double PI = acos(-1.0);

// debug
#define dump(x) cerr << #x << " = " << x << endl;
#define debug(x) cerr << #x << " = " << x << " (L" << __LINE__ << ")"   \
  << " " << __FILE__ << endl;

// clear memory
#define CLR(a) memset((a), 0, sizeof(a))

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

int main(int argc, char const *argv[])
{
  int n, m;
  cin >> n >> m;
  int a[n][m], b[m], ans[n];
  for(int i = 0; i < n; i++) {
    ans[i] = 0;
    for(int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }

  for(int i = 0; i < m; i++) {
    cin >> b[i];
  }

  for(int i = 0; i < n; i++) {
    for(int j = 0; j < m; j++) {
      ans[i] += a[i][j] * b[j];
    }
  }

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



Measured memory_bytes: 3136
#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()

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

  int N,Y;
  cin>>N>>Y;
  for(int i=0;i<=N;i++){
    for(int j=0;i+j<=N;j++){
      int k=N-i-j;
      if(10000*i+5000*j+1000*k==Y){
        cout<<i<<" "<<j<<" "<<k<<endl;
        return 0;
      }
    }
  }
  cout<<"-1 -1 -1"<<endl;
  return 0;
}


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

// 小数点以下桁数
// fixed << setprecision(i)

int gcd(int a,int b){return (a%b==0?b:gcd(b, a%b));}
int64_t lcm(int a,int b){return (int64_t)a*b/gcd(a, b);}
int factorial(int a){int b=1;while(a){b*=a--;}return b;} //13以下対応
bool is_prime(int a){if(a<=1)return false;for(int i=2;(int64_t)i*i<=a;i++){if(a%i==0)return false;}return true;}

//順列の全列挙
// vector<int> v(N);
// iota(v.begin(), v.end(), 1);       // v に 1, 2, ... N を設定
// do {
//   for(auto x : v) cout << x << " "; cout << "\n";    // v の要素を表示
// } while( next_permutation(v.begin(), v.end()) ); 

bool vect_equal(vector<int> a, vector<int> b, int n)
{
  for (int i = 0; i < n; i++)
  {
    if (a[i] != b[i])
      return (false);
  }
  return (true);
}

int main()
{
  int n, p_num, q_num;
  vector<int> p(8), q(8);

  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> p[i];
  for (int i = 0; i < n; i++)
    cin >> q[i];
  vector<int> v(n);
  int i = 1;
  for (int j = 1; j <= n; j++)
    v[j-1] = j;
  do {
      if (vect_equal(v, p, n))
        p_num = i;
      if (vect_equal(v, q, n))
        q_num = i;
    i++;
  } while(next_permutation(v.begin(), v.end()));
  cout << abs(p_num - q_num) << endl;
}

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

#define W 12
#define H 12

int dx[4] = {0, 1, 0, -1};
int dy[4] = {-1, 0, 1, 0};
string mass[W];

void rec(int x, int y)
{
	int xx, yy;
	int i;
	mass[x][y] = '2';
	for (i = 0; i < 4; i++) {
		yy = y+dy[i];
		xx = x+dx[i];
		if (yy<0 || H<=yy || xx<0 || W<=xx) continue;
		if (mass[xx][yy]!='1') continue;
		rec(xx, yy);
	}
}

int main()
{
	int count, i, j;
	string c;

	while ( cin>>mass[0] ) {
		for (i = 1; i < W; i++)
			cin>>mass[i];

		count = 0;
		for (i = 0; i < W; i++) {
			for (j = 0; j < H; j++) {
				if (mass[i][j] != '1') continue;
				count++;
				rec(i, j);
			}
		}
		cout<<count<<endl;
	}

	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
#define MOD                 1000000007LL
#define EPS                 1e-9
#define io                  ios_base::sync_with_stdio(false);cin.tie(NULL);

const int MAXN = 1e5+5;
int d[MAXN]; 

int main(){
	io;
	string s;
	cin >> s;
	int x, y;
	cin >> x >> y;
	int curr = 1;
	int i = 0;
	while(i < s.size()){
		if(s[i] == 'T'){
			curr++;
			i++;
			continue;
		}
		d[curr]++;
		i++;
	}
	set<int> setX, setY;
	setX.insert(d[1]);
	curr++;
	for(int i = 3; i <= curr; i+=2){
		set<int> newSetX;
		for(auto x: setX){
			newSetX.insert(x + d[i]);
			newSetX.insert(x - d[i]);
		}
		setX = newSetX;
	}
	setY.insert(d[2]);
	setY.insert(-1*d[2]);
	for(int i = 4; i <= curr; i+=2){
		set<int> newSetY;
		for(auto y : setY){
			newSetY.insert(y + d[i]);
			newSetY.insert(y - d[i]);
		}
		setY = newSetY;
	}
	if(setX.find(x) != setX.end() && setY.find(y) != setY.end())
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
/*bool cmp(const node &x,const node &y){
	
}*/
int main(){
	int n,b;
	scanf("%d %d",&n,&b);
	if(n<=b)printf("Yes\n");
	else cout<<"No"<<endl;
	return 0;
} 

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner in = new Scanner(System.in);
		String s = in.nextLine();
		int count = 0;
		for(int i=0; i<=(s.length()-1)/2; i++) {
			if(s.charAt(i)==s.charAt(s.length()-i-1)) {
				continue;
			}else {
				count ++;
			}
		}
		System.out.println(count);
	}

}


Measured memory_bytes: 23764
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        s = s.replaceAll("/", "");
        if(s.compareTo("20190430") <= 0) System.out.println("Heisei");
        else System.out.println("TBD");
    }
}

Measured memory_bytes: 35436
#include<bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int>P;
const int SIZE=1<<17;

struct seg_tree{
    int N;
    vector<int>ma,lazy;

    seg_tree(int n){
        N=1;
        while(n>N)N*=2;
        ma.resize(N*2-1,0);
        lazy.resize(N*2-1,0);
    }

    void evaluate(int k){
        ma[k]+=lazy[k];
        if(k<N-1){
            lazy[k*2+1]+=lazy[k];
            lazy[k*2+2]+=lazy[k];
        }
        lazy[k]=0;
    }

    void update_node(int k){
        ma[k]=max(ma[k*2+1],ma[k*2+2]);
    }

    void add(int a,int b,int x){add(a,b,x,0,0,N);}
    void add(int a,int b,int x,int k,int l,int r){
        evaluate(k);
        if(r<=a||b<=l)return;
        if(a<=l&&r<=b){
            lazy[k]+=x;
            evaluate(k);
            return;
        }
        int m=(l+r)/2;
        add(a,b,x,k*2+1,l,m);
        add(a,b,x,k*2+2,m,r);
        update_node(k);
    }

    int get_max(int a,int b){return get_max(a,b,0,0,N);}
    int get_max(int a,int b,int k,int l,int r){
        evaluate(k);
        if(r<=a||b<=l)return 0;
        if(a<=l&&r<=b)return ma[k];
        int m=(l+r)/2;
        int vl=get_max(a,b,k*2+1,l,m);
        int vr=get_max(a,b,k*2+2,m,r);
        return max(vl,vr);
    }
};

int N,H;
int d[100000],h[100000];

signed main(){

    cin>>N>>H;
    for(int i=0;i<N-1;i++)cin>>d[i]>>h[i];

    seg_tree seg(N);
    int cur=H;
    int ans=0;
    priority_queue<P>que;
    for(int i=0;i<N-1;i++){
        seg.add(i,i+1,cur);
        cur-=d[i];

        que.push(P(h[i],i));

        while(cur<=0){
            P p=que.top();que.pop();
            int ma=seg.get_max(p.second,i+1);
            if(p.first>H-ma){
                que.push(P(H-ma,p.second));
                continue;
            }
            int x=min(abs(cur)/p.first+1,(H-ma)/p.first);
            ans+=x;
            cur+=x*p.first;
            seg.add(p.second,i+1,p.first*x);
            que.push(p);
        }
    }

    cout<<ans<<endl;
    return 0;
}

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

#define ll long long 

int main(){
	ll n,x,t,sum=0;
	string s;
	cin>>s;
	ll len=s.size();
	for(ll i=0;i<len;i++){
		sum+=(s[i]-'0');
	}
	if(sum%9)
	cout<<"No\n";
	else
	cout<<"Yes\n";
	return 0;
}

Measured memory_bytes: 3712
#coding:utf-8
a, b, c = map(int, input().split())
count = 0

while True:
    if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
        break
    else:
        tmp_a = (b+c) / 2
        tmp_b = (a+c) / 2
        tmp_c = (a+b) / 2
        if tmp_a == tmp_b == tmp_c:
            print(-1)
            exit()
        else:
            a = tmp_a
            b = tmp_b
            c = tmp_c
            count += 1

print(count)

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline T chmax(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


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

  vector<int> x(N), y(N), h(N);

  int MIN = INF;
  REP(i, N){
    cin >> x[i] >> y[i] >> h[i];
    chmin(MIN, h[i]);
  }

  REP(i, 101) REP(j, 101) RFOR(k, MIN, MIN+202){
    REP(l, N){
      if(max(k-abs(x[l]-i)-abs(y[l]-j), 0ll) != h[l]) break;
      if(l == N-1){
        cout << i << " " << j << " " << k << "\n";
        return 0;
      }
    }
  }

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    int ans=1;
    int h[N];
    for(int i=0;i<N;i++)cin >> h[i];
    int MAX=h[0];
    for(int i=1;i<N;i++){
        if(h[i]>=MAX){
            ans++;
            MAX=h[i];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
//#include "bits/stdc++.h"
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <complex>
#include <bitset>
#include <functional>
#include <stack>
#include <regex>
#include <tuple>

#define int long long
#define REP(i,a,n) for(int i=a;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define REV(i,a,n) for(int i=n;i>=a;--i)
#define all(e) e.begin(),e.end()
#define rall(e) e.rbegin(),e.rend()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define mod 1000000007
#define show(n) cerr<<#n<<" = "<<n<<endl
#define showp(n) cerr<<n.fs<<", "<<n.sc<<endl
#define shows(n) for(auto z:n){cerr<<z<<", ";}cerr<<endl
#define showsp(n) for(auto z:n){cerr<<z.fs<<" "<<z.sc<<", "}cerr<<endl

#define yes printf("YES\n")
#define no printf("NO\n")
#define case(i) printf("Case #%lld: ",i)

using namespace std;

using ull=unsigned long long;
using vi=vector<int>;
using pint=pair<int,int>;

const int INF=1LL<<55;

int n;
int x;
bool hasodd=false;
int k=0;

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

    cin>>n;

    rep(i,n){
        scanf("%lld", &x);
        if(x&1) k++;
        else hasodd=true;
    }
    if(k&1)
        no;
    else   
        yes;

    return 0;
}


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

#define rep(i,n) for(i = 0;i < n;++i)
#define all(v) v.begin(), v.end()
using ll = long long;

int main()
{
    ll i,j;
    ll n;
    cin >> n;
    ll ans = n%1000;
    if(ans == 0) cout << 0 << endl;
    else cout << 1000-ans << endl;
    return 0;
}

Measured memory_bytes: 3632
import java.util.*;
import java.math.*;
public class Main {
	static int r; 
	static int c;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int k = in.nextInt();
		int n = in.nextInt();
		int[] house = new int[n];
		for(int i = 0; i < n; i++) house[i] = in.nextInt();
		Arrays.sort(house);
		int ans = 0;
		if(n > 1) {
			ans = house[n - 1] - house[0];
			for(int i = 1; i < n; i++) {
				ans = Math.min(ans, (k - house[i]) + house[i - 1]);
			}
			for(int i = 0; i < n - 1 ; i++) {
				ans = Math.min(ans, house[i] + (k - house[i + 1]));
			}
		}
		System.out.println(ans);
	}
} 


Measured memory_bytes: 84208