akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cmath>
#include <complex>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cassert>
#include <iomanip>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(v) push_back(v)
#define uniq(v) (v).erase(unique(all(v)),(v).end())
#define bitcnt(x) __builtin_popcount(x)
#define fst first
#define snd second
#define Pqaz(T) priority_queue<T,vector<T>,greater<T>>
#define Pqza(T) priority_queue<T>
#define put(x) cout << x;
#define putsp(x) cout << x << ' ';
#define putbd cout << "---------------------------------------------" << endl;
#define putln(x) cout << x << endl;
#define debug(x) cerr << #x << "=" << x << endl;
#define ENJYU std::ios::sync_with_stdio(false);std::cin.tie(0);

typedef long long ll;
typedef pair<ll, ll> llP;
typedef pair<int, int> intP;
typedef complex<double> comp;
typedef vector <int> vec;
typedef vector <ll> vecll;
typedef vector <double> vecd;
typedef vector <vec> mat;
typedef vector <vecll> matll;
typedef vector <vecd> matd;

//vector の中身を出力
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

const int MAX = 200020;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const ll INFL = 1e18;
const ll MOD = 1000000007;

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

//********************************template END****************************************//

//階乗とその逆元
ll fac[MAX+1],facInv[MAX+1];

ll power(ll e, ll x){ //e^x % MOD
	if (x == 0) return 1LL;
	if (x % 2 != 0) return ((power(e, x-1) * e) % MOD);
	ll temp = power(e, x / 2);
	return (temp * temp) % MOD;
}

ll nck(ll n, ll k){
	if (!(n >= k && k >= 0)) return 0;
	ll temp = (fac[n] * facInv[n-k]) % MOD;
	return ((temp * facInv[k]) % MOD);
}

void fact(void)
{
	//階乗とその逆元
	fac[0] = facInv[0] = 1; //0! = 1
	//(x!)^(-1) ≡ (x!)^(p-2) (mod p)
	Rep(1, MAX, i) fac[i] = (fac[i-1] * i) % MOD;
	facInv[MAX] = power(fac[MAX], MOD-2);
	Rep(1, MAX-1, i) facInv[MAX-i] = (facInv[MAX-i+1] * (MAX-i+1)) % MOD;
}


void solve(void)
{
	int N, d = -1;
	cin >> N;
	vecll xs(N+1), cnt(N, 0);
	rep(N+1, i)
	{
		cin >> xs[i];
		cnt[xs[i]-1]++;
		if (cnt[xs[i]-1] > 1) d = xs[i];
	}

	vecll as(3, 0);

	int f = 0;

	rep(N+1, i)
	{
		if (xs[i] == d)
		{
			f++;
			continue;
		}
		as[f]++;
	}

	fact();

	Rep(1, N+1, k)
	{
		ll ans = nck(N+1, k) - nck(as[0]+as[2], k-1) + MOD;
		ans %= MOD;
		cout << ans << endl;
	}

}

int main(void)
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


Measured memory_bytes: 5888
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <vector>
#include <cstring>
#include <queue>
#include <map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
using namespace std;
//typedef long long ll;
//typedef long double ld;
//typedef unsigned long long ull;
//typedef unsigned long double uld;
typedef pair<int,int> P;
const int dx[4] = {0,1,0,-1};
const int dy[4] = {1,0,-1,0};
template<class T> inline bool chmax(T &a,T& b){if(a < b){a = b; return true;} else return false;}
template<class T> inline bool chmin(T &a,T& b){if(a > b){a = b; return true;} else return false;}
//struct area

//function area

//main area
int main(){
    string odd, even;
    cin >> odd >> even;
    if(odd.size()==even.size()){
        rep(i, odd.size()){
            cout << odd[i] << even[i];
        }
    }
    else{
        rep(i, even.size()){
            cout << odd[i] << even[i];
        }
        cout << odd[odd.size()-1];
    }
    cout << endl;
}
/*

cout << odd[0] << even[0] << odd[1] << even[1] << ... << odd[n-1]

*/

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

using namespace std;
#define taskname "A"
#define pb  push_back
#define mp  make_pair
#ifndef LOCAL
#define cerr if(0)cout
#endif

typedef long double ld;
typedef long long ll;
typedef pair<int,int> ii;
const int maxn = 4005;

int n, a[maxn] , x;
int dp[maxn][maxn];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    if(fopen(taskname".INP","r")){
        freopen(taskname".INP", "r",stdin);
        freopen(taskname".OUT", "w",stdout);
    }
    cin >> n >> x;
    for(int i = 0 ; i < n ; ++i){
        cin >> a[i];
        a[i + n] = a[i];
    }
    for(int i = 0 ; i < n * 2 ; ++i){
        dp[i][i] = a[i];
        for(int j = i + 1 ; j < n * 2 ; ++j){
            dp[i][j] = min(dp[i][j - 1] , a[j]);
        }
    }
    ll ans = 1e18;
    for(int i = 0 ; i < n ; ++i){
        ll res = (ll)x * i;
        for(int j = n ; j < n * 2 ; ++j){
            res += dp[j - i][j];
        }
//        cout << i << " " << res << endl;
        ans = min(ans,res);
    }
    cout << ans;
}


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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

using ll=long long;
using R=long double;
const R EPS=1e-9; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max<R>(x,0.0));}

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

// Problem Specific Parameter:

int main(void){
	int n,a,b;
	cin >> n >> a >> b;

	int ans=n;
	rep(i,n){
		int t;
		cin >> t;
		if(a<=t and t<b) ans--;
	}

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

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

using namespace std;

#define all(v)				((v).begin()), ((v).end())
#define allr(v)				((v).rbegin()), ((v).rend())
#define sz(v)				((int)((v).size()))
#define ll long long
#define pb					push_back
#define fIO ios_base::sync_with_stdio(0);cin.tie(0);

const ll oo = 1e8;
const double pi = 3.1415926535897;


const double EPS = (1e-7);
int dcmp(double x, double y) {	return fabs(x-y) <= EPS ? 0 : x < y ? -1 : 1;	}


typedef vector<int>                vi;
typedef vector<pair<int,int>>      vii;
typedef vector<ll>                 vll;
typedef vector<double>             vd;
typedef vector< vi >               vvi;
typedef vector< vd >               vvd;
typedef vector<string>             vs;
typedef pair<int, int>             pii;

/**
    * PLEASEEE READDD PROBLEEEM CARFULLY ****
    * Always check for OVERFLOW ll vs int
    * Always check for array bounds
    * Check for function return
    * READ OUTPUT SECTION AGAIN!!!
**/

struct edge{
    int from, to, w;

    edge(){}
    edge(int x, int y, int we): from(x), to(y), w(we){}

    bool operator < (const edge &rhs) const{
        return w > rhs.w;
    }

};

const int N = 1e5 + 5, K = 100 + 5;

int dp[N][K];
int h[N];
int n, k = 2;

int sol(int idx, int prv) {
    if(idx == n - 1) return 0;

    int &ret = dp[idx][prv];

    if(ret != -1) return ret;

    ret = 1e9 + 5;
    for(int i = 1; i <= k && (i + idx) < n; i++) {
        ret = min(ret, sol(idx + i, i) + abs(h[idx] - h[idx + i]));
    }

    return ret;
}

int main(){
    fIO

//    freopen("", "r", stdin);
//    freopen("", "w", stdout);

    memset(dp, -1, sizeof(dp));
    cin >> n;

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

    cout << sol(0, 0) << "\n";

}








Measured memory_bytes: 46336
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for (int i = a; i < b; i++)
using namespace std;

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <tuple>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <stack>
#include <bitset>

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

	if (a * b % 2 == 0) {
		cout << "Even" << endl;	
	}
	else {
		cout << "Odd" << endl;	
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>

using namespace std;

#define F(i , a , b) for(int (i) = (a) ; (i) <= (b) ; (i)++)
#define pb push_back
#define ll long long
#define E(a) cerr << #a << " = " << a << '\n'
#define X first
#define Y second
#define INF 10000000000000

const int MAX_N = 100000 + 10 , mod = 1000000007;

ll a,b,x;

int32_t main(){

    //    freopen("input.txt" , "r" , stdin);
    //    freopen("output.txt" , "w" , stdout);
    //    cout << setprecision(10) << fixed;
    cin >> a >> b >> x;

    ll p = a/x;
    ll q = b/x;
    ll t = q-p;
    if(a%x == 0) t++;
    cout << t;



    return 0;
}


Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define ll long long
int main(){
  int N;
  cin>>N;
  vector<int> B(N);
  int b;
  rep(i,N) cin>>B[i];
  vector<int> ans;
  int f;
  rep(j,N){
    f=1;
    rep(i,N-j){
      if(B[N-j-1-i]==N-j-i){
        ans.push_back(B[N-j-1-i]);
        B.erase(B.begin()+N-j-1-i);
        f=0;
        break;
      }
    }
    if(f) break;
  }
  reverse(all(ans));
  if(f||B.size()) cout<<"-1"<<endl;
  else rep(i,ans.size()) cout<<ans[i]<<endl;
}

Measured memory_bytes: 256
import java.util.Objects;
import java.util.Scanner;

public class Main {
    public static void main(final String[] args) {
        final int p = 2;
        switch (p) {
        case 1:
            P1.p1();
            break;
        case 2:
            P2.answer();
            break;
//        case 3:
//            P3.answer();
//            break;
        }
    }
}

//class P3 {
//    static void answer() {
//        final Scanner sc = new Scanner(System.in);
//        final int a = sc.nextInt();
//        final int b = sc.nextInt();
//        final int res = calc(a, b);
//        System.out.println(res);
//    }
//
//}

class P2 {
    static void answer() {
        final Scanner sc = new Scanner(System.in);
        final int a = sc.nextInt();
        final int b = sc.nextInt();
        final int res = calc(a, b);
        System.out.println(res);
    }

    static int calc(final int a, final int b) {
        final int per = a - 1;
        final int remain = b - 1;
        final int x = remain / per;
        if (remain - (per * x) > 0) {
            return x + 1;
        }
        return x;
    }
}

class P1 {

    static void p1() {
        final Scanner sc = new Scanner(System.in);
        final String yohou = sc.nextLine();
        final String jissai = sc.nextLine();

        final int res = calc(yohou, jissai);
        System.out.println(res);
    }

    static int calc(final String yohou, final String kekka) {
        int res = 0;
        for (int i = 0; i < 3; i++) {
            if (Objects.equals(yohou.charAt(i), kekka.charAt(i))) {
                res++;
            }
        }
        return res;
    }
}

Measured memory_bytes: 21716
#include<bits/stdc++.h>                          
using namespace std;
bool cmp(int x,int y)
{
	return x>y;
}
long long n,k,a[200005],ans,h;
int main(){
    cin>>n>>k;
    for(int i=1;i<=n;i++)
        cin>>a[i],ans+=a[i];
    sort(a+1,a+1+n,cmp);
    h=min(k,n);
    for(int i=1;i<=h;i++) ans-=a[i];
    cout<<ans;
	return 0;
}

Measured memory_bytes: 1792
import bisect
import sys
import math
import itertools
sys.setrecursionlimit(10000)
 
# input macro
def i():
    return int(raw_input())
def ii():
    return map(int,raw_input().split(" "))
def s():
    return raw_input()
def ss():
    return raw_input().split(" ")
def slist():
    return list(raw_input())
#
 
def join(s):
    return ''.join(s)
 
#memoize macro
def memoize(f):
    cache = {}
    def helper(*args):
        if args not in cache:
            cache[(args)] = f(*args)
        return cache[args]
    return helper
 
nh=zip([1,0,-1,0],[0,1,0,-1])
INF = float('inf')
mod=1000000007
 
###########

n,l=ii()
a=ii()
p=-1
for j in range(n-1):
    if a[j]+a[j+1]>=l:
        p=j

if p==-1:
    print "Impossible"
else:
    print "Possible"
    x=[p+1]
    for j in range(p+2,n):
        x.append(j)
    for j in reversed(range(1,p+1)):
        x.append(j)
    x.reverse()
    for j in x:
        print j


Measured memory_bytes: 11432
n = gets.chomp.to_i
a_arr = gets.chomp.split(" ").map(&:to_i)

hash = {}
a_arr.each do |a|
  hash[a] ||= 0
  hash[a] += 1
end
sum = a_arr.sum

q = gets.chomp.to_i
bc_arr = q.times.map{gets.chomp.split(" ").map(&:to_i)}

bc_arr.each do |(b, c)|
  diff = c - b
  count = hash[b].to_i

  sum = sum + diff * count
  puts sum

  hash.delete(b)
  hash[c] ||= 0
  hash[c] += count
end


Measured memory_bytes: 27000
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>

using namespace std;
typedef long long ll;

int main(){

  int a, b, c, d;
  cin >> a >> b >> c >> d;
  if ((abs(a - c) <= d)){
    cout << "Yes" << endl;
  }
  else if ((abs(a - b) <= d) && (abs(b - c) <= d)){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
c11,c12,c13 = map(int,input().split())
c21,c22,c23 = map(int,input().split())
c31,c32,c33 = map(int,input().split())
if c13 + c22 + c31 == c12 + c21 + c33 and c13 + c22 + c31 == c11 + c23 + c32:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define endl '\n'
#define mod 1000000007
#define ll long long
#define trace(x) cerr << #x << " = " << x << endl
using namespace std;

int main()
{
   /* #ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("ouput.txt","w",stdout);
    #endif 
   */
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t=1; 
    while(t--){
	    int x;
	    cin>>x;
          if(x>=400 and x<=599)
		  cout<<8<<endl;
	  else if(x>=600 and x<=799)
		  cout<<7<<endl;
         else if(x>=800 and x<=999)
		  cout<<6<<endl;
	else if(x>=1000 and x<=1199)
		  cout<<5<<endl;
 	else if(x>=1200 and x<=1399)
		  cout<<4<<endl;
        else if(x>=1400 and x<=1599)
		  cout<<3<<endl;
	else if(x>=1600 and x<=1799)
		  cout<<2<<endl;
	else if(x>=1800 and x<=1999)
		  cout<<1<<endl;


    }
    return 0;
} 


Measured memory_bytes: 3636
#include <stdlib.h>
#include <iostream>
using namespace std;


int main(){
	string s;
	cin >> s;
	string result = "First";
	bool is_even = s.size()%2==0;
	bool is_head_tail_same = s[0]==s[s.size()-1];

	bool win_sec = is_even^is_head_tail_same;
	if(s.size() == 2) win_sec = true;
	if(win_sec) result = "Second";
	cout << result << endl;
	return 0;
}


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

#define pb push_back
#define ll long long
#define maxn 300005
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define ms(i) memset(i,0,sizeof(i));
#define ms1(i) memset(i,-1,sizeof(i));
#define bg begin()
#define ed end()
#define pii pair<int,int>

int main(){
	int a,b,c,n;
	while(cin >> a >> b >> c >> n){
		int dp[n+5] = {1};
		for(int i=a;i<=n;i+=a){
			dp[i] = 1;
		}
		for(int j=n;j>=b;j--){
			for(int k=j-b;k>=0;k-=b){
				dp[j] += dp[k];
			}
		}
		int ans = 0;
		for(int i=0;i<=n;i+=c){
			ans += dp[n-i];
		}
		cout << ans <<endl;
		//cout << ans[n] << endl;
	}
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
int f(int n){
    if(n==0) return 1;
    return n*f(n-1);
}
int main(){
    int n,i,a=0,b=0,c,d;
    scanf("%d",&n);
    int p[n],q[n];
    for(i=0;i<n;i++)
        scanf("%d",&p[i]);
    for(i=0;i<n;i++)
        scanf("%d",&q[i]);
    for(i=0;i<n;i++){
        c=0;d=0;
        for(int k=0;k<i;k++){
            if(p[k]<p[i]) c++;
            if(q[k]<q[i]) d++;
        }
        if(p[i]-c-1<=0) a=a;
        else{
            a+=(p[i]-c-1)*f(n-i-1);
        }
        if(q[i]-d-1<=0) b=b;
        else{
            b+=(q[i]-d-1)*f(n-1-i);
        }
    }
    printf("%d\n",abs(a-b));
    return 0;
}

Measured memory_bytes: 128
N = int(input())
S = []
for i in range(N):
    S.append(input())



www = "YYY"
for i in range(N-1):
    if S[i][-1] != S[i+1][0]:
        www = "fuck"

qqq = "ZZZ"
S.sort()
for i in range(N-1):
    if S[i] == S[i+1]:
        qqq = "bich"

if www == "YYY" and qqq == "ZZZ":
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3064
#include"bits/stdc++.h"
using namespace std;
#define REP(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define rep(i,n) REP((i),0,(n))
using ll = long long;

int main()
{
	ll N;
	cin >> N;
	vector<ll>A(N + 1), B(N);
	rep(i, N + 1)cin >> A[i];
	rep(i, N)cin >> B[i];

	ll before = accumulate(A.begin(), A.end(), 0ll);
	rep(i, N) {
		if (A[i] >= B[i]) {
			A[i] -= B[i];
		}
		else {
			B[i] -= A[i];
			A[i] = 0;
			A[i + 1] = max(0ll, A[i + 1] - B[i]);
		}
	}
	ll after = accumulate(A.begin(), A.end(), 0ll);

	cout << before - after << endl;
	return 0;
}


Measured memory_bytes: 1792
import sys, math
from functools import lru_cache
from collections import defaultdict
from decimal import Decimal
sys.setrecursionlimit(10**9)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    N = ii()
    F = [list(mi()) for i in range(N)]
    P = [list(mi()) for i in range(N)]

    m = -math.inf

    for ptn in range(1, 2**10):
        r = 0
        for i in range(N):
            cnt = 0
            for j in range(10):
                if F[i][j] and (ptn>>j)&1:
                    cnt += 1
            r += P[i][cnt]
        m = max(m, r)

    print(m)


if __name__ == '__main__':
    main()


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

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


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

using namespace std;

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

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> P;

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

int main() {
	int g[13] = {0,1,3,1,2,1,2,1,1,2,1,2,1};
	int x, y;
	cin >> x >> y;
	
	if (g[x] == g[y]) puts("Yes");
	else puts("No");
	return 0;
}


Measured memory_bytes: 256
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <iomanip>
#include <map>
#include <stack>
#include <queue>
#include <sstream>
#include <bitset>

using namespace std;

typedef long long ll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    
    string s;
    cin>>s;
    int w=0,l=0;
    for(int i=0;i<s.size();i++) {
        if(s[i]=='o') w++;
        else l++;
    }
    
    if(15-s.size()+w>=8) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Buffer(make([]byte, 500000), 500000)
	sc.Split(bufio.ScanWords)

	n := nextInt()
	k := nextInt()
	q := nextInt()

	b := make([]int, n+1)
	for i := 0; i < q; i++ {
		b[nextInt()]++
	}
	for j := 1; j <= n; j++ {
		if k-q+b[j] > 0 {
			fmt.Println("Yes")
		} else {
			fmt.Println("No")
		}
	}
}

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

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextInt64() int64 {
	sc.Scan()
	i, _ := strconv.ParseInt(sc.Text(), 10, 64)
	return i
}


Measured memory_bytes: 4480
datas = gets.split.map{|nn|nn.to_i}
n = datas[0]
k = datas[1]
hs = []
n.times do
  hs << gets.to_i
end

hs.sort!

def min a,b
  if a < b
    return a
  else
    return b
  end
end
ans = 1000001000
0.upto(n-k) do|first|
  ans = min(hs[first+k-1] - hs[first],ans)
end
puts ans.to_s

Measured memory_bytes: 4016
n, s, q, t = input(), list(set(map(int, input().split()))), input(), set(map(int, input().split()))

# print(sum(i in s for i in t))
s.sort()


def binary_search(i):
    global s
    l, r = 0, len(s)
    while l < r:
        m = (l + r) // 2
        sm = s[m]
        if sm == i:
            return 1
        elif i < sm:
            r = m
        else:
            l = m + 1
    return 0


print(sum(binary_search(i) for i in t))

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

using namespace std;

#define ll long long
#define ld long double
#define P pair<ll, ll>

#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

#define all(v) v.begin(), v.end()

#define sortAl(v) sort(all(v))
#define sortAlr(v)          \
  sort(v.begin(), v.end()); \
  reverse(v.begin(), v.end())

#define cout(n) cout << fixed << setprecision(n)

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

template <class T>
inline void chmax(T &a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T &a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
#define INF LLONG_MAX

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

  ll n;
  cin >> n;

  vector<ll> d(n);
  rep(i, n) {
    cin >> d[i];
  }

  sort(all(d));

  cout << (d[n / 2] - d[n / 2 - 1]) << endl;

  return 0;
}


Measured memory_bytes: 1152
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
#include<set>
#include<map>
#include<random>
#include<functional>

#define rep(i,n) for(int i=0; i<n; i++)
#define pb push_back
#define pint pair<int, int>
#define mp make_pair

using namespace std;

typedef long long ll;


int main() {
	ll a, b;
	cin >> a >> b;
	int tmp = a + b;
	int tmp2 = tmp / 2;

	if (tmp == 2 * tmp2) {
		cout << tmp2 << endl;
	}
	else {
		cout << "IMPOSSIBLE" << endl;
	}


	return 0;
}


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

#define rep(i,N) for(int i=0;i<N;i++)
#define rep2(i,N) for(int i=1;i<=N;i++)
using namespace std;
long long  INF=1e18;
long long mod=1e9+7;

//status unsolved

int main(){
    long long n,m,k;
    cin>>n>>m>>k;
    vector<long long> Av(n);
    vector<long long> Bv(m);
    vector<long long> Aw(n);
    vector<long long> Bw(m);
    cin>>Aw[0];
    Av[0]=1;    
    rep2(i,n-1){
        long long a;
        cin>>a;
        Aw[i]=a+Aw[i-1];
        Av[i]=i+1;
    }
    cin>>Bw[0];
    Bv[0]=1;
    rep2(i,m-1){
        long long b;
        cin>>b;
        Bw[i]=b+Bw[i-1];
        Bv[i]=i+1;
    }
    long long ans=0;
    rep(i,m){
        long long res=k-Bw[i];
        if(res<0)continue;
        ans=max(Bv[i],ans);
        int t=upper_bound(Aw.begin(),Aw.end(),res)-Aw.begin();
        if(t==0)continue;
        t--;
        ans=max(Bv[i]+Av[t],ans);
    }
    rep(i,n){
        long long res=k-Aw[i];
        if(res<0)continue;
        ans=max(Av[i],ans);
        int t=upper_bound(Bw.begin(),Bw.end(),res)-Bw.begin();
        if(t==0)continue;
        t--;
        ans=max(Av[i]+Bv[t],ans);
    }
    cout<<ans<<endl;
    /*
    long long now=0;
    long long ans=0;
    long long i=0,l=0;
    long long A=a[0];
    long long B=b[0];
    while(now<=k && ans<(n+m)){
        long long ne=min(A,B);
        if(ne+now<=k){
            if(A<=B){

            }
        }
        else{
            break;
        }
    }
    */
    return 0;

}
/*


*/


Measured memory_bytes: 9596
# -*- coding: utf-8 -*-
import heapq
import math
import sys

MOD = 1000000000 + 7

binary = input()
digit_num = len(binary)

all_one = 1
along = 1

for i in range(0, digit_num):
    d = binary[digit_num - i - 1]
    if d == '0':
        pass
    else:
        assert d == '1'
        along = (all_one + 2 * along) % MOD
    all_one = (all_one * 3) % MOD

print(along)


Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<int> a(N);
  for(int i=0;i<N;i++){
    cin>>a.at(i);
  }
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  int ans = 0;
  for(int i=0;i<N;i++){
    if(i%2==0){
      ans+=a.at(i);
    }
    else{
      ans-=a.at(i);
    }
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int ans = 642;

    for(int i = 0 ; i < s.length()-2 ; ++i){
      int num = Integer.parseInt(s.substring(i,i+3));
      int num2 = Math.abs(Math.subtractExact(753, num));

      ans = Math.min(ans, num2);
      
    }

    System.out.println(ans);
    
  }
}

Measured memory_bytes: 35624
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};

const MOD : usize = 1e9 as usize + 7;

fn mod_fact(n: usize) -> usize {
    let mut ret = 1;
    for i in 1..n+1 {
        ret = ret * i % MOD;
    }
    ret
}

fn main() {
    input!{
      n: i64,
      m: i64,
    }
    if (n-m).abs() >=2 {
        println!("{}", 0);
        return;
    }
    if n != m {
        println!("{}", ((mod_fact(n as usize) * mod_fact(m as usize)) % MOD));
    } else {
        println!("{}", ((mod_fact(n as usize) * mod_fact(m as usize)) % MOD) * 2 % MOD);
    }
}


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

int main(){
  int A,B,C,D;
  
  cin >> A >> B >> C >> D;
  
  if((A+B) > (C+D)){
    cout << "Left" << endl;
  }
  
  if((A+B) == (C+D)){
    cout << "Balanced" << endl;
  }
  
  if((A+B) < (C+D)){
    cout << "Right" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false), cin.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'

using namespace std;

main()
{
    fast;
    int d,g,i;
    cin>>d>>g;
    int p[d],c[d];
    for (i=0;i<d;i++)
        cin>>p[i]>>c[i];
    int ans=INT_MAX,mask;
    for (mask=0;mask<(1<<d);mask++)
    {
        int s=0,cnt=0,left=-1;
        for (i=0;i<d;i++)
        {
            if ((mask>>i)&1)
            {
                s+=p[i]*100*(i+1)+c[i];
                cnt+=p[i];
            }
            else
                left=i;
        }
        if (s<g)
        {
            int rem=g-s,c1=(left+1)*100;
            int need;
            if (rem%c1==0)
                need=rem/c1;
            else
                need=rem/c1+1;
            if (need<p[left])
                cnt+=need;
            else
                continue;
        }
        ans=min(ans,cnt);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
N = int(input())
count = []
for i in range(1, N+1):
    if ((i % 3) == 0) and ((i % 5) == 0):
        pass
    elif (i % 3) == 0:
        pass
    elif (i % 5) == 0:
        pass
    else:
        count.append(i)
print(sum(count))

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

int mod = 1e9 + 7;

long long modpow(long long x, long long y){
    if (y == 0) return 1;
    if (y % 2) return x * modpow(x, y - 1) % mod;
    long long res = modpow(x, y / 2);
    return res * res % mod;
}

long long calc_cmb(int n, int a){
    vector<long long> inv(a + 1, 1);
    for (int i = 2; i <= a; i++) inv[i] = (mod - (mod / i) * inv[mod % i] % mod) % mod;
    vector<long long> cmb(a + 1, 1);
    for (int i = 1; i <= a; i++) cmb[i] = (cmb[i - 1] * (n - i + 1) % mod) * inv[i] % mod;
    return (cmb[a]);
}

int main()
{
    int n, a, b;
    cin >> n >> a >> b;
    long long all = modpow(2, n);
    all += mod - 1;
    all %= mod;
    all += mod - calc_cmb(n, a);
    all %= mod;
    all += mod - calc_cmb(n, b);
    all %= mod;
    cout << all << endl;
}

Measured memory_bytes: 3400
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define mp make_pair
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
template<typename T> inline T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }




int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    
    int sum = 0;
    rep(i, n) rep3(j, i + 1, n) {
        sum += a[i] * a[j];
        
    }
    cout << sum << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,m,t,tt;
int a[32];
int main(){
	cin>>n>>m;
	for(int i=0;i<n;i++){
		cin>>t;
		for(int j=0;j<t;j++){
			cin>>tt;
			a[tt]++;
		}
	}
	int ans=0;
	for(int i=1;i<=m;i++){
		if(a[i]==n){
			ans++;
		}
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include<set>
#include<map>
#include<cmath>
#include<ctime>
#include<queue>
#include<cstdio>
#include<string>
#include<vector>
#include<cstdlib>
#include<cstring>
#include<iomanip>
#include<iostream>
#include<algorithm>
#define fi first
#define se second
#define pb push_back
#define lowbit(x) x&(-x)
#define PII  pair<int, int> 
#define FAST ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef long long ll;
const int inf = 0x3f3f3f3f;
const int mod = (int)1e9 + 7;
const int maxn = (int)1e5 + 5;
using namespace std;

int n, R;


int Mod(int a, int b){
	if(a < 0 && a % b != 0){
		n = a / b + 1;
		return a - (a / b + 1) * b;
	}
	n = a / b;
	return a % b;
}

int main()
{
	char a[20] = "0123456789ABCDEF";
	vector<int> v;
	cin >> n;
	R = -2;
	if(n == 0) return 0 * puts("0");
	while(n != 0)
		v.pb(Mod(n, R));
	for(int i = v.size() - 1; i >= 0; i--)
		cout << a[v[i]];
	cout << endl;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){

int N;
scanf("%d",&N);

int k,l,count = 0; //N = 4k+7l,count:割り切れる回数
for(l = 0; N - 7 * l >= 0; l++){
for(k = 0; N - 7 * l - 4 * k >= 0; k++){
if((N - 7 * l) % 4 == 0){
count++;
}
}
}

if(count > 0){
printf("Yes");
}else{
printf("No");
}

return 0;
}



Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define endl '\n'
#define D(x) cerr << #x << " = " << (x) << '\n'
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
typedef long long ll;

const int N = 2e5 + 5;

int n, m;
int par[N], siz[N];

int fs(int a) {
  return par[a] == a ? a : par[a] = fs(par[a]);
}

int main()
{
  cin >> n >> m;
  for(int i = 0; i < n; i++) {
    par[i] = i;
    siz[i] = 1;
  }
  int best = 1;
  while(m--) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    a = fs(a), b = fs(b);
    if(a != b) {
      par[a] = b;
      siz[b] += siz[a];
      best = max(best, siz[b]);
    }
  }
  cout << best << endl;
  return 0;
}


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

int main() {
  char op;
  int a, b;

  cin >> a >> op >> b;
  
  if(op == '+'){
    cout << a + b << endl;
  }
  if(op == '-'){
    cout << a - b << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a,b,c,x,i,j,k,ans;
int main(){
	cin>>a>>b>>c>>x;
	for(i=0;i<=a&&500*i<=x;i++)
		for(j=0;j<=b&&100*j+500*i<=x;j++)
			for(k=0;k<=c&&50*k+100*j+500*i<=x;k++)
				if(500*i+100*j+50*k==x) ans++;
	cout<<ans;
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder_20190707_1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');

            int M = int.Parse(input[0]);
            int D = int.Parse(input[1]); ;

            int count = 0;

            for(int i = 1; i <= M; i++)
            {
                for(int j = 1; j <= D; j++)
                {
                    if((j % 10) < 2 || (j / 10) < 2)
                    {
                        continue;
                    }
                    else
                    {
                        if(i == (j % 10) * (j / 10))
                        {
                            count++;
                        }
                    }
                }
            }

            Console.WriteLine(count);
        }
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
int main(){
    int64_t n, k;
    cin >> n >> k;
    int64_t ans = k;
    for(int i=0; i<n-1; i++){
        ans *= k-1;
    }
    cout << ans << endl;
    return 0;
}

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

int main(){
    while(1){
        int n, x, cnt=0;
        cin >> n >> x;
        if(n==0 && x==0) break;

        for(int i=1; i<=n-2; i++){
            for(int j=i+1; j<=n-1; j++){
                for(int k=j+1; k<=n;k++){
                    if(i + j + k == x) cnt++;
                }
            }
        }
        cout << cnt << endl;
    }

    return 0;
}


Measured memory_bytes: 3072
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define ll long long
#define P pair<int,int>
int N;
struct edge{int to,cost;};
vector<edge> G[100010];
ll D[100010];
void dijkstra(int s){
  priority_queue<P,vector<P>,greater<P>> Q;
  rep(i,N) D[i]=1000000000000000000;
  D[s]=0;
  Q.push(P(0,s));
  while(!Q.empty()){
    P p=Q.top();
    Q.pop();
    int x=p.second;
    if(D[x]<p.first) continue;
    rep(i,G[x].size()){
      edge e=G[x][i];
      if(D[e.to]>D[x]+e.cost){
        D[e.to]=D[x]+e.cost;
        Q.push(P(D[e.to],e.to));
      }
    }
  }
}
int main(){
  int M,S,T;
  cin>>N>>M>>S>>T;
  int U[M],V[M],A[M],B[M];
  rep(i,M) cin>>U[i]>>V[i]>>A[i]>>B[i];
  rep(i,M){
    edge e1={V[i]-1,A[i]};
    edge e2={U[i]-1,A[i]};
    G[U[i]-1].push_back(e1);
    G[V[i]-1].push_back(e2);
  }
  dijkstra(S-1);
  ll X[N];
  rep(i,N) X[i]=D[i];
  rep(i,N) G[i].clear();
  rep(i,M){
    edge e1={V[i]-1,B[i]};
    edge e2={U[i]-1,B[i]};
    G[U[i]-1].push_back(e1);
    G[V[i]-1].push_back(e2);
  }
  dijkstra(T-1);
  ll ans[N];
  ans[N-1]=1000000000000000-X[N-1]-D[N-1];
  rep(i,N-1) ans[N-2-i]=max(ans[N-1-i],1000000000000000-X[N-2-i]-D[N-2-i]);
  rep(i,N) cout<<ans[i]<<endl;
}

Measured memory_bytes: 11832
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0; i<(n); i++)
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; }
int main(){
    ll n,k; cin>>n>>k;
    vector<ll> a(n);
    map<ll,ll> m;
    ll cnt=0;
    rep(i,n){
        cin>>a[i];
        if(m[a[i]]==0) cnt++;
        m[a[i]]++;
    }
    if(cnt<=k) cout<<0<<endl;
    else{
        vector<ll> c={};
        rep(i,n){
            if(m[a[i]]==0) continue;
            c.push_back(m[a[i]]);
            m[a[i]]=0;
        }
        sort(c.begin(),c.end());
        ll res=0;
        rep(i,cnt-k) res+=c[i];
        cout<<res<<endl;
    }
    return 0;
}

Measured memory_bytes: 16500
#pragma GCC optimize("Ofast,inline,unroll-loops,fast-math")
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#define N 100020
using namespace std;

vector<long long> a;
long long f[N], g[N];

void Solve(long long x, long long v)
{
    int p;

    if(!x)
        return;

    p = (int)(upper_bound(a.begin(), a.end(), x) - a.begin()) - 1;
    // printf("fet %d len %lld val %lld\n", p, x, v);
    if(p == -1)
    {
        f[1] += v;
        f[x + 1] -= v;
    }
    else
    {
        g[p] += v * (x / a[p]);
        Solve(x % a[p], v);
    }

    return;
}

int main(void)
{
    int n, m;
    long long x;
    int i;

    scanf("%d %d", &n, &m);
    a.push_back(n);
    for(i = 0; i < m; i ++)
    {
        scanf("%lld", &x);
        while(!a.empty() && a.back() >= x)
            a.pop_back();
        a.push_back(x);
    }
    m = a.size();

    // for(i=0;i<=m-1;i++)cout<<a[i]<<' ';cout<<endl;

    g[m - 1] = 1;
    for(i = m - 1; i > -1; i --)
    {
        x = a[i];
        a.pop_back();
        Solve(x, g[i]);
    }

    for(i = 1; i <= n; i ++)
        printf("%lld\n", f[i] += f[i - 1]);

    return 0;
}


Measured memory_bytes: 4212
#include <iostream>
#include <string>

using namespace std;

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

    string s;

    const string keywords[4] = {"eraser", "erase", "dreamer", "dream"};

    cin >> s;

    int pos = string::npos;
    int i;

    for (i = 0; i < 4; i++) {
        pos = s.find(keywords[i]);

        while (pos != string::npos) {
            s.erase(pos, keywords[i].size());
            
            pos = s.find(keywords[i]);
        }
    }

    if (s == "") cout << "YES" << endl;
    else cout << "NO" << endl;

    return 0;
}


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

int main(){
  int s;
  cin >>s;
  int ans=0;
  int k=0;



  for(int i=1;i<=s;i++){
    if(to_string(i).length() %2==1){
      ans +=1;
    }
  }

cout << ans <<endl;




}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int main(void)
{
	char order[100];
	int cnt = 0;

	scanf("%s", order);

	for (int i = 0; i < 3; i++) {
		if (order[i] == 'o') {
			cnt++;
		}
	}

	printf("%d\n", 700 + 100 * cnt);
	return 0;
}






Measured memory_bytes: 128
#include<iostream>
#include<string>

using namespace std;

int main() {

	string A, B;

	cin >> A >> B;

	if (A.size() > B.size())cout << "GREATER\n";
	else if (A.size() < B.size()) cout << "LESS\n";
	else {
		for (int i = 0; i < A.size(); i++) {
			if (A[i] > B[i]) {
				cout << "GREATER\n";
				return 0;
			}
			else if(A[i] < B[i]) {
				cout << "LESS\n";
				return 0;
			}
		}
		cout << "EQUAL\n";
	}

	return 0;
}


Measured memory_bytes: 256
{-# LANGUAGE OverloadedLists     #-}
{-# LANGUAGE OverloadedStrings   #-}
{-# LANGUAGE ScopedTypeVariables #-}

import           Control.Monad
import           Data.IORef
import           Data.Maybe
import qualified Data.Text     as T
import qualified Data.Text.IO  as T
import           GHC.Base
import           System.IO

import qualified Data.Array    as A
import qualified Data.IntMap   as I
import qualified Data.Map      as M
import qualified Data.Set      as S
import qualified Data.Vector   as V

readT :: Read a => T.Text -> a
readT = read . T.unpack

getLineSpc :: Read a => IO [a]
getLineSpc = do
  t <- T.getLine
  let xs = map readT $ T.split (== ' ') t
  return xs

getLineSpcVec :: Read a => IO (V.Vector a)
getLineSpcVec = do
  t <- T.getLine
  let xs = V.fromList $ map readT $ T.split (== ' ') t
  return xs

main :: IO ()
main = twoColorsCardGame

twoColorsCardGame :: IO ()
twoColorsCardGame = do
  n :: Int             <- readLn
  s :: V.Vector T.Text <- V.replicateM n T.getLine
  m :: Int             <- readLn
  t :: V.Vector T.Text <- V.replicateM m T.getLine
  vec <- newIORef [0]
  forM_ s $ \si -> do
    let diff = same si s - same si t
    modifyIORef vec (`V.snoc` diff)
  print =<< V.maximum <$> readIORef vec
  where
    same e vec = V.length $ V.filter (== e) vec

Measured memory_bytes: 764
//おまじない
//#include <bits/stdc++.h>
#include <iostream>
#include<iomanip>
#include <set>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#define INF 1e9+7
#define rep(i,n) for(int i=0;i<n;i++)
#define NO cout<<"NO"<<endl;
#define YES cout << "YES"<<endl;
#define No cout << "No"<<endl;
#define Yes cout << "Yes"<<endl;
#define all(a) a.begin(),a.end()
#define P pair<int,int>
#define space ' '
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

//(int)'a'は97 (int)'A'は65 (int)'1'は49
//おまじない

int main(){
    
    int n;
    int ans = 0;
    cin >> n;
    for(int i=1;i<=n/2;i++){
        if(i!=n-i){
            ans++;
        }
    }
   
    cout << ans<<endl;
    
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	private final static int OUT = 3; //1???????????°????????¢????????°
	private final static int BASE = 3; //????????°
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		//?????°??????
		int out = 0; //??¢???????????°
		int ining = sc.nextInt();
		int base = 0; //????????????????????°
		String how; //??\?????????????????????
		int point = 0; //??????

		for(int count = 0; count < ining; count++) { //???????????°?????°????????°?????????
			while(out < OUT) { //3??¢?????????????????§??°?????????
				how = sc.next();

				if(how.equals("OUT")) { //??¢???????????¨???
					out++;
				} else if(how.equals("HIT")) { //??????????????¨???
					base++;
					if(base > BASE) { //3????????????????????¨???
						base--;
						point++;
					}
				} else { //????????????????????¨???
					point += ++base;
					base = 0;
				}
			}

			System.out.println(point);
			out = 0; //??¢???????????°???0?????????
			point = 0; //???????????°???0?????????
			base = 0; //????????????????????°???0?????????
		}
	}
}

Measured memory_bytes: 25960
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s; cin >> s;
    int len = s.length();
    if (s[len - 1] == '1' || s[0] == '0') {
        cout << -1 << endl;
        return 0;
    }
    rep(i, (len - 1)/2) {
        if (s[i] != s[len - 2 - i]) {
            cout << -1 << endl;
            return 0;
        }
    }
    int v = 1;
    rep(i, len - 1)  {
        while (i < len && s[i] != '1') {
            cout << v << " " << i + 2 << endl;
            i++;
        }
        cout << v << " " << i + 2 << endl;
        v = i + 2;
    }


    return 0;
}


Measured memory_bytes: 1616
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, n) for(int i = 1; i <= (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef int64_t ll;
typedef long double ld;
const ll INF=pow(10,18);
const double inf=pow(10,10);
const ld pi=acosl(1);
const ll mod = 1000000007;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};

map< int64_t, int > prime_factor(int64_t n) {
  map< int64_t, int > ret;
  for(int64_t i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}

bool solve(){
  map<ll,ll>mp;
  ll n;cin>>n;
  for(ll i=1;i<=n;i++){
    for(auto&&p:prime_factor(i)){
      mp[p.first]+=p.second;
    }
  }
  ll ans=1;
  for(auto&&i:mp){
    ans*=(i.second+1);
    ans%=mod;
  }
  cout<<ans<<endl;
  return false;
}

signed main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout<<fixed;
  cout<<setprecision(30);
  return solve();
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] as = new int[n];
        for(int i=0; i<n; i++){
            int t = sc.nextInt();

            if(t % 2 == 0){
                if (t % 3 != 0 && t % 5 != 0) {
                    System.out.println("DENIED");
                    return;
                }

            }
        }
        System.out.println("APPROVED");
    }
}


Measured memory_bytes: 22740
#include<stdio.h>

int main(void)
{
    int a,b;

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

    return 0;
}

Measured memory_bytes: 1812