akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <stdlib.h>
#define MAX 10000
#define NIL -1

struct Node
{
  /*
  p is parent
  l is left
  r is right
  */
  int p, l, r;
};

struct Node T[MAX];
int n;

void preOrder(int);
void inOrder(int);
void postOrder(int);

void preOrder(int u)
{
  if (u == NIL)
    return;
  printf(" %d", u);
  preOrder(T[u].l);
  preOrder(T[u].r);
}

void inOrder(int u)
{
  if (u == NIL)
    return;
  inOrder(T[u].l);
  printf(" %d", u);
  inOrder(T[u].r);
}

void postOrder(int u)
{
  if (u == NIL)
    return;
  postOrder(T[u].l);
  postOrder(T[u].r);
  printf(" %d", u);
}

int main()
{
  int i, d, v, l, r;
  scanf("%d", &n);
  for (i = 0; i < n; i++)
    T[i].p = NIL;

  for (i = 0; i < n; i++)
  {
    scanf("%d", &v);
    scanf("%d", &l);
    scanf("%d", &r);
    T[v].l = l;
    T[v].r = r;
    //親の設定
    if (l != NIL)
      T[l].p = v;
    if (r != NIL)
      T[r].p = v;
  }
  for (i = 0; i < n; i++)
  {
    if (T[i].p == NIL)
      d = i;
  }
  printf("Preorder\n");
  preOrder(d);
  printf("\n");
  printf("Inorder\n");
  inOrder(d);
  printf("\n");
  printf("Postorder\n");
  postOrder(d);
  printf("\n");

  return 0;
}



Measured memory_bytes: 2004
n,k,q = gets.chomp.split.map(&:to_i)
as = q.times.map{gets.to_i}
persons = Array.new(n,-q)
as.each do|a|
  persons[a-1] += 1
end

persons.each do |p|
  if k + p > 0
    puts "Yes"
  else
    puts "No"
  end
end


Measured memory_bytes: 5756
N = int(input())
S = input()

alphabets = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
result = []

for char in S:
  idx = alphabets.index(char)
  idx += N
  if idx < len(alphabets):
    result.append(alphabets[idx])
  else:
    result.append(alphabets[idx - len(alphabets)])

print(''.join(result))

Measured memory_bytes: 3060
#include<iostream>
using namespace std;
int main(){
  int s[3],hi=0,tyo=0;
  char c[2];
  while(cin>>s[0]>>c[0]>>s[1]>>c[1]>>s[2]){
    if(s[0]!=s[1]&&s[2]*s[2]==s[0]*s[0]+s[1]*s[1]) tyo++;
    else if(s[0]==s[1]) hi++;
  }
  cout << tyo << endl << hi << endl;
  return 0;
}

Measured memory_bytes: 1160
package main
 
import (
  "fmt"
)

func main() {
  var n,k,q int
  fmt.Scan(&n,&k,&q)
  
  cor := make([]int ,q)
  for i := 0; i < q; i++ {
    fmt.Scan(&cor[i])
  }
  
  //各参加者の正解数を配列に持たせる
  m := make([]int ,n)
  for i := 0; i < q; i++ {
    m[cor[i]-1] += 1
  }
  
  //一人ずつ判定
  for i := 0; i < n; i++ {
    //持ち点-自分以外の正解数>0ならば勝ち抜け
    if k - (q - m[i]) > 0 {
      fmt.Println("Yes")
    } else {
      fmt.Println("No")
    }
  }
}


Measured memory_bytes: 5888
#include <iostream>
#include <queue>
#include <utility>
#include <vector>

#define MAX_NODE 10000
#define INF 1000000000

using namespace std;

struct Edge {
	int to, w;
};
typedef pair<int, int> P;

vector<Edge> adj[MAX_NODE];
int minW[MAX_NODE];
bool flag[MAX_NODE];

int prim(int n, int start) {
	priority_queue<P, vector<P>, greater<P>> que;
	fill(minW, minW + n, INF);
	fill(flag, flag + n, false);

	int sum = 0;
	minW[start] = 0;
	que.push({0, start});
	while (!que.empty()) {
		P p = que.top();
		que.pop();
		int from = p.second;

		if (flag[from])
			continue;

		flag[from] = true;
		sum += p.first;

		for (Edge& e : adj[from])
			if (e.w < minW[e.to]) {
				minW[e.to] = e.w;
				que.push({minW[e.to], e.to});
			}
	}

	return sum;
}

int main() {
	int n;

	cin >> n;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			int x;
			cin >> x;
			if (x != -1) {
				adj[i].push_back({j, x});
			}
		}
	}

	printf("%d\n", prim(n, 0));

	return 0;
}

Measured memory_bytes: 1544
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def MAP1()  : return map(lambda x:int(x)-1,input().split())
def LIST()  : return list(MAP())
def LIST1() : return list(MAP1())

#####segfunc#####
def segfunc(x, y):
    return gcd(x, y)
#################

#####ide_ele#####
ide_ele = 0
#################

class SegTree:
    """
    init(init_val, ide_ele): 配列init_valで初期化 O(N)
    update(k, x): k番目の値をxに更新 O(logN)
    query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN)
    """
    def __init__(self, init_val, segfunc, ide_ele):
        """
        init_val: 配列の初期値
        segfunc: 区間にしたい操作
        ide_ele: 単位元
        n: 要素数
        num: n以上の最小の2のべき乗
        tree: セグメント木(1-index)
        """
        n = len(init_val)
        self.segfunc = segfunc
        self.ide_ele = ide_ele
        self.num = 1 << (n - 1).bit_length()
        self.tree = [ide_ele] * 2 * self.num
        # 配列の値を葉にセット
        for i in range(n):
            self.tree[self.num + i] = init_val[i]
        # 構築していく
        for i in range(self.num - 1, 0, -1):
            self.tree[i] = self.segfunc(self.tree[2 * i], self.tree[2 * i + 1])

    def update(self, k, x):
        """
        k番目の値をxに更新
        k: index(0-index)
        x: update value
        """
        k += self.num
        self.tree[k] = x
        while k > 1:
            self.tree[k >> 1] = self.segfunc(self.tree[k], self.tree[k ^ 1])
            k >>= 1

    def query(self, l, r):
        """
        [l, r)のsegfuncしたものを得る
        l: index(0-index)
        r: index(0-index)
        """
        res = self.ide_ele

        l += self.num
        r += self.num
        while l < r:
            if l & 1:
                res = self.segfunc(res, self.tree[l])
                l += 1
            if r & 1:
                res = self.segfunc(res, self.tree[r - 1])
            l >>= 1
            r >>= 1
        return res

def solve():
    N = INT()
    a = LIST()
    seg = SegTree(a, segfunc, ide_ele)

    ans = 1
    for i in range(N):
        seg.update(i, 0)
        ans = max(ans, seg.query(0, N))
        seg.update(i, a[i])
    print(ans)

if __name__ == '__main__':
    solve()

Measured memory_bytes: 22144
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <climits>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <cctype>
#include <complex>
#include <regex>

using namespace std;

#define C_MAX(a, b) ((a)>(b)?(a):(b))
#define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOW_MAP(v){std::cerr << #v << endl; for(const auto& xxx: v){std::cerr << xxx.first << " " << xxx.second << "\n";}}

typedef vector<vector<int>> matrix;

matrix mul_matrix(matrix A, matrix B, int MOD) {

    matrix C(A.size(), vector<int>(B[0].size(), 0));

    for (int i = 0; i < A.size(); i++) {
        for (int j = 0; j < B[0].size(); j++) {
            for (int k = 0; k < B.size(); k++) {
                C[i][j] += A[i][k] * B[k][j];
                C[i][j] %= MOD;
            }
        }
    }

    return C;
}

matrix pow_matrix(matrix X, int p, int MOD) {
    matrix ans(X.size(), vector<int>(X.size(), 0));
    for (int i = 0; i < X.size(); i++) ans[i][i] = 1;

    while (p > 0) {
        if ((p & 1) == 1) ans = mul_matrix(ans, X, MOD);
        X = mul_matrix(X, X, MOD);
        p >>= 1;
    }

    return ans;

}

int main() {

    while (true) {

        int N, M, A, B, C, T;
        cin >> N >> M >> A >> B >> C >> T;

        if (!(N | M | A | B | C | T)) break;

        vector<int> s(N);
        for (int i = 0; i < N; i++) cin >> s[i];

        matrix matA(N, vector<int>(N, 0));
        for (int i = 1; i < N; i++) matA[i][i - 1] = A;
        for (int i = 0; i < N; i++) matA[i][i] = B;
        for (int i = 1; i < N; i++) matA[i - 1][i] = C;

        matrix matB(N, vector<int>(1));
        for (int i = 0; i < N; i++) matB[i][0] = s[i];

        matA = pow_matrix(matA, T, M);
        auto ans = mul_matrix(matA, matB, M);

        for (int i = 0; i < ans.size(); i++) {
            if (i != ans.size() - 1) cout << ans[i][0] << " ";
            else cout << ans[i][0] << endl;
        }

    }

}












































Measured memory_bytes: 3232
#include <bits/stdc++.h>
#define REP(i,n) for(int64_t i=0;i<(n);i++)
#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define REV(c) reverse((c).begin(),(c).end())
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define COUTDOUBLE(d,i) cout << setprecision((i)) << (d) << endl;
#define VIN(v) for(int64_t i=0;i<(v).size();i++){cin >> (v).at(i);}
#define MREP(i,m) for(auto i=(m).begin(); i != (m).end(); ++i) // auto key = i->first;auto value = i->second;

using namespace std;
typedef int64_t I;
typedef pair<I,I> P;
typedef vector<I> V;

I MOD = pow(10,9)+7;
I MAX = LONG_MAX;
I MIN = LONG_MIN;

// 最大公約数
I gcd(I a, I b) {
  return b != 0 ? gcd(b, a % b) : a;
}

// 最小公倍数
I lcm(I a, I b) {
  return a * b / gcd(a, b);
}

int ctoi(char c){
  return c - '0';
}

int main(){
  I a,b;
  cin >> a >> b;
  I t=0;
  I c=1;
  while (true){
    if (c >= b) break;
    t++;
    c = c + a -1;
  }
  cout << t << endl;
  return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int a,b,c;
  int t=0,h=0;
  while(scanf("%d,%d,%d",&a,&b,&c)+1){
    // if(a==0)break;
    if(a==b)h++;
    if(c*c==a*a+b*b)t++;
  }
  cout<<t<<endl<<h<<endl;
}
    

Measured memory_bytes: 1208
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_ll.hpp>
//typedef boost::multiprecision::cpp_ll ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
string alp="abcdefghijklmnopqrstuvwxyz";
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main(){fastio
    ll a[3];rep(i,0,2)cin>>a[i];
    sort(a,a+3);
    ll sum=2*a[2]-a[1]-a[0];
    if(sum%2==0){
        cout<<sum/2<<endl;
    }else{
        cout<<(sum+3)/2<<endl;
    }
    
    
    
    return 0;
}




Measured memory_bytes: 256
//C - Tsundoku
//Hiia
#include <stdio.h>
#include <stdlib.h>//rannsuu, zettaichi(absolute)
#include <time.h>
//srand((unsigned int) time(0));
#include <math.h>//koudona keisann
#include <string.h>//hairetsu
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define N 998244353

int gcd(int m,int n){if((0==m)||(0==n))return 0;while(m!=n)if(m>n)m=m-n;else n=n-m;return m;}
int lcm(int m,int n){if((0==m)||(0==n))return 0;return(m*n/gcd(m, n));}
int fact(int x){if(x==1) return(x);else return(x*fact(x-1));}//Kaijou x!
int ruijou(int base,int exponent){int i,answer=1;i=exponent;while(i!=0){answer=answer*base;--i;}return answer;}//ruijou base^exponent

long long int llgcd(long long int m,long long int n){if((0==m)||(0==n))return 0;while(m!=n)if(m>n)m=m-n;else n=n-m;return m;}
long long int lllcm(long long int m,long long int n){if((0==m)||(0==n))return 0;return(m*n/llgcd(m, n));}
long long int llfact(long long int x){if(x==1) return(x);else return(x*llfact(x-1));}//Kaijou
int llruijou(long long int base,long long int exponent){long long int i,answer=1;i=exponent;while(i!=0){answer=answer*base;--i;}return answer;}//ruijou base^exponent

int main()
{
  long long int n,m,k,i,j,inin,num,num2=0,ans,aa,bb,a[200010]={},b[200010]={};
  scanf("%lld %lld %lld", &n, &m, &k);
  for(i = 1; i <= n; i++) {
    scanf("%lld", &aa);
    a[i]=a[i-1]+aa;
  }
  for(j = 1; j <= m; j++) {
    scanf("%lld", &bb);
    b[j]=b[j-1]+bb;
  }

  ans=0;
  inin=0;
  //long long int x[200010]={};
  for(i = 0; i <= n; i++) {
    for(j = m-num2; j >= 0; j--) {
      if(a[i]+b[j]<=k){
        ans=max(ans,i+j);
        break;
      }
      num2++;
    }
  }
/*
  ans=x[1];
  for(i = 1; i <= inin; i++) {
    //printf("%lld\n", x[i]);
    ans=max(ans,x[i]);
  }
*/
  printf("%lld\n", ans);

  return 0;
}




/*
int main()
{
  int n,m,k,i,j,aa,num,ans;
  scanf("%d %d %d", &n, &m, &k);
  long long int a[200010],b[200010];
  a[0] = b[0] = 0;
  for(i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  for(j = 1; j <= m; j++) {
    scanf("%lld", &b[j]);
  }
  aa=n+m;
  i=1;
  j=1;
  ans=0;
  while(1){
    if(a[i]<=b[j] && i<=n && j<=m){
      num+=a[i];
      if(num>k){
        break;
      }
      else{
        i++;
        ans++;
      }
    }
    else if(a[i]>=b[j] && i<=n && j<=m){
      num+=b[j];
      if(num>k){
        break;
      }
      else{
        j++;
        ans++;
      }
    }
    else if(i==n+1 && j<=m){
      num+=b[j];
      if(num>k){
        break;
      }
      else{
        j++;
        ans++;
      }
    }
    else if(i<=n && j==m+1){
      num+=a[i];
      if(num>k){
        break;
      }
      else{
        i++;
        ans++;
      }
    }
    else if(i==n+1 && j==m+1){
      break;
    }
    else{
      break;
    }


  }


  printf("%lld\n", ans);

  return 0;
}
*/


Measured memory_bytes: 4848
from operator import itemgetter

n, m = map(int, input().split())
ab = sorted([tuple(map(int, input().split())) for i in range(m)], key=itemgetter(1))
removed = -1
ans = 0
for a, b in ab:
    if a > removed:
        removed = b - 1
        ans += 1
print(ans)

Measured memory_bytes: 18972
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

typedef tuple<ll, ll, ll> T;

int main(int argc, char const *argv[]) {
    int n,q; cin>>n>>q;
    vector<T> a; a.reserve(n);
    vector<T> ev;
    rep(i,n) {
        ll s,t,x; cin>>s>>t>>x;
        a.emplace_back(s,t,x);
        ev.emplace_back(s-x,0,x);
        ev.emplace_back(t-x,1,x);
    }

    ev.emplace_back(-LINF,0,LINF);
    ev.emplace_back(LINF,1,LINF);
    sort(ev.begin(), ev.end());
    multiset<ll> st;

    vector<ll> d(q);
    rep(i,q) cin>>d[i];

    int idx = 0;
    for (auto &&e: ev) {
        ll p,t,x;
        tie(p,t,x) = e;
        while(idx < q && p > d[idx]) {
            if (*st.begin() == LINF) cout << -1 << '\n';
            else cout << *st.begin() << '\n';
            idx++;
        }
        if (t==0) st.insert(x);
        else {
            auto itr = st.find(x);
            st.erase(itr);
        }
    }
    return 0;
}

Measured memory_bytes: 26856
import kotlin.math.abs
import kotlin.math.min

fun main() {
    val (n, k) = readLine()!!.split(" ").map { it.toInt() }
    val h = readLine()!!.split(" ").map { it.toInt() }

    val dp = IntArray(n + 1) { Int.MAX_VALUE }
    dp[0] = 0
    dp[1] = 0
    for (i in 1..n) {
        for (j in 1..k) {
            if (i + j > n) break
            dp[i + j] = min(dp[i + j], dp[i] + abs(h[i + j - 1] - h[i - 1]))
        }
    }
    println(dp[n])
}

Measured memory_bytes: 51020
#include <bits/stdc++.h> //1
using namespace std; // 2
#define rep(a) for(int i=0;i<a;++i) // 3
int n; // 4
int cnt[101010];  //5
int main(void){ //1
    cin >> n; // 2
    rep(n)cin>>cnt[i]; // 3
    map<int,int> m; // 4
    rep(n) ++m[cnt[i]] ;  //5
    int sum=0; //1
    for(auto &&e : m) { // 2
        #define Would  // 3
        #define you // 4
        if(e.second>=2){    //5
            sum+=e.second-1; //1
        } // 2 
    } // 3
    if(sum % 2 == 0) // 4
        Would you cout<<m.size()<<endl;   //5
        Would you cerr << "ちゃろー！"; //1 
    if(sum % 2 != 0) // 2  
    { // 3
        Would you cout << m.size() - 1 << endl; // 4
        }    //5
    Would you cerr << "試合を終えて家路へ向かうサッカー部員達。"; //1
    Would you cerr << "疲れからか、不幸にも"; // 2
} // 3

Measured memory_bytes: 5376
S = input()

symbol = ['+', '']

solve = []
for i in range(1 << len(S)-1):
  equation = [S[0]]
  for j in range(len(S)-1):
    equation.extend([symbol[(i >> j) & 1], S[j+1]])
  solve.append(eval(''.join(equation)))

ans = sum(solve)
print(ans)

Measured memory_bytes: 3060
#include <string.h>

#include <algorithm>
#include <iostream>

using namespace std;

int main(void) {

	int N, X, T;
	cin >> N >> X >> T;

	int kaisuu = N / X;

	if (kaisuu * X == N) {
		cout << T*kaisuu << endl;
	}

	else {
		cout << T * (kaisuu + 1) << endl;
	}


	return 0;
}

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

int main(){
    unsigned long N;
    cin >> N;
    vector<long> prime, sieve(31622, 1);
    for(long i = 2; i < 31622; ++i)
        if(sieve[i] && (prime.push_back(i), 1))for(auto j = i * i; j < 31622; j += i)sieve[j] = 0;

    vector<long> a(N);
    long C;
    for(auto& i : a)cin >> i;
    cin >> C;
    long u{C};
    for(const auto i : a)u = __gcd(u, abs(i));

    for(const auto p : prime)
        if(u % p == 0 && cout << p << endl)
            while(u % p == 0)u /= p;
        else if(C % p == 0 && p <= N){
            vector<long> v(p);
            for(unsigned long j = 0, k = 0; j < N; ++j, k = k == p - 2 ? 0 : ++k)v[k] += a[j];
            if(none_of(v.begin(), v.end(), [&p](auto x){return x % p;}))cout << p << endl;
        }
    if(u ^ 1)cout << u << endl;
}

Measured memory_bytes: 768
#include <stdio.h>
#include <math.h>

int main(){
	int a1, a2, a3, n;
	if(scanf("%d", &a1)== 1);
	if(scanf("%d", &a2)== 1);
	if(scanf("%d", &a3)== 1);
	
	n = a1 + a2 + a3;
	if (n<=21){
		printf("win");
	}else{
		printf("bust");
	}
	
    return 0;
}


Measured memory_bytes: 128
fun main(args:Array<String>) {
  val (a,b,c,d) = readLine()!!.split(" ").map(String::toInt)
  
  when {
    Math.abs( a - c ) <= d || ( Math.abs( a - b ) <= d && Math.abs( b - c ) <= d ) -> "Yes"
    else -> "No"
  }.let(::println)
}

Measured memory_bytes: 36036
import java.io.BufferedReader;
import java.io.InputStreamReader;

class Main{

	public static boolean solve(int[] g,int x){
		int left = 0;
		int right = g.length;
		while(left < right){
			int mid = (left + right) / 2;
			if(g[mid] == x){
				return true;
			}else if(g[mid] > x){
				right = mid;
			}else{
				left = mid + 1;
			}
		}
		return false;
	}

	public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] input = br.readLine().split(" ");
        int x = Integer.parseInt(input[0]);
        int y = Integer.parseInt(input[1]);
        int[] g1 = {1,3,5,7,8,10,12};
        int[] g2 = {4,6,9,11};
        int[] g3 = {2};
        if((solve(g1,x) && solve(g1,y)) || (solve(g2,x) && solve(g2,y))||(solve(g3,x) && solve(g3,y))){
        	System.out.println("Yes");
        }else{
        	System.out.println("No");
        }

    }

}

Measured memory_bytes: 22228
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>

using namespace std;

typedef long long ll;

const ll inf = 1 << 30;
const ll mod = 1000000000 + 7;


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

	vector<int> a(n);

	int s = 0;
	for (int i = 0; i < n; i++)
	{
		a.at(i) = l + i;
		s += a.at(i);
	}


	int x = inf;
	int res = 0;
	for (int i = 0; i < n; i++)
	{
		int sum = 0;
		for (int j = 0; j < n; j++)
		{
			if (i != j)
			{
				sum += a.at(j);
			}
		}

		if (x > abs(sum - s))
		{
			x = abs(sum - s);
			res = sum;
		}
	}

	cout << res << endl;
}

Measured memory_bytes: 256
#include <iostream>

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

int H, W;
long long memo[MAX_HW][MAX_HW];
bool used[MAX_HW][MAX_HW];
long long black, white;
char map[MAX_HW][MAX_HW] = {};

void dfs(int h, int w, int count = 0);

int main(){

	std::cin >> H >> W;

	for(int i = 0; i < H; ++i){
		for(int j = 0; j < W; ++j){
			memo[i][j] = -1;
			std::cin >> map[i][j];
		}
	}

	long long ans = 0;
	for(int i = 0; i < H; ++i){
		for(int j = 0; j < W; ++j){

			char c = map[i][j];

			if(c == '#'){
				black = 0, white = 0;
				dfs(i, j);
				ans += black * white;
			}
		}
	}

	std::cout << ans << std::endl;

	return 0;
}

void dfs(int h, int w, int count){

	if(map[h][w] == '#'){
		++black;
	}
	else if(map[h][w] == '.'){
		++white;
	}

	map[h][w] = 'x';

	for(int i = 0; i < 4; ++i){

		int nh = h + dx[i];
		int nw = w + dy[i];

		if(nh >= H || nw >= W || nh < 0 || nw < 0){
			continue;
		}

		char next = (count % 2 == 0 ? '.' : '#');
		if(map[nh][nw] == next){
			dfs(nh, nw, count + 1);
		}
	}
}


Measured memory_bytes: 11648
#include <iostream>
#include <string>
#include <vector>

using namespace std;

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

    // 10^100回 動かす -> 文字列の最大の長さ分位あればOK
    int step = 100000;

    vector<vector<int>> dp(18, vector<int>(S.size()));

    for(int j = 0; j < S.size(); j++) {
        if (S[j] == 'L') {
            dp[0][j] = j - 1;
        } else {
            dp[0][j] = j + 1;
        }
    }

    for(int i = 0; i < 17; i++) {
        for(int j = 0; j < S.size(); j++) {
            dp[i + 1][j] = dp[i][dp[i][j]];
        }
    }

    vector<int> ans(S.size());
    for (int j = 0; j < S.size(); j++) {
        int now = j;
        for (int i = 0; i < 18; i++) {
            if (step >> i & 1) {
                now = dp[i][now];
            }
        }
        ans[now]++;
    }

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

    return 0;
}

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

#define DEG_120 (2.0 * M_PI / 3.0)
#define DEG_60 (M_PI / 3.0)


typedef struct point {
    float x, y;
    float a;
    int i;
    struct point* next;
} Point;

void koch_curve(Point *start, Point *end, const int n)
{
    if (end == NULL) return;

    if (start->i == n) {
        start = start->next;
        if (start == NULL) return;
        return koch_curve(start, start->next, n);
    }

//    printf("start %f %f %d, end %f %f %d\n", start->x, start->y, start->i, end->x, end->y, end->i);

    Point *p1 = new Point;
    Point *p2 = new Point;
    Point *p3 = new Point;

    float dx = end->x - start->x;
    float dy = end->y - start->y;
    float l = sqrt(dx * dx + dy * dy) / 3.0;

    start->next = p1;
    start->i++;
    p1->x = start->x + dx / 3.0;
    p1->y = start->y + dy / 3.0;
    p1->a = start->a + DEG_60;
    p1->i = start->i;
    p1->next = p2;
    p2->x = p1->x + l * cos(p1->a);
    p2->y = p1->y + l * sin(p1->a);
    p2->a = p1->a - DEG_120;
    p2->i = start->i;
    p2->next = p3;
    p3->x = start->x + 2.0 * dx / 3.0;
    p3->y = start->y + 2.0 * dy / 3.0;
    p3->a = start->a;
    p3->i = start->i;
    p3->next = end;

/*
    Point* curr = start;
    while (1) {
        if (curr == end) break;
        printf("  %f %f\n", curr->x, curr->y);
        curr = curr->next;
    }
*/

    return koch_curve(start, start->next, n);
}


int main (void) {

    int n;
    Point start;
    Point end;

    start.x = 0.0;
    start.y = 0.0;
    start.a = 0.0;
    start.i = 0;
    start.next = &end;
    end.x = 100.0;
    end.y = 0.0;
    end.a = 0.0;
    end.i = 0;
    end.next = NULL;

    scanf("%d", &n);

    koch_curve(&start, &end, n);

    Point* curr = &start;
    while (1) {
        if (curr == NULL) {
            break;
        }
        printf("%f %f\n", curr->x, curr->y);
        curr = curr->next;
    }
}



Measured memory_bytes: 3084
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
using ll = long long;
using ld = long double;
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
using pll = pair<long long,long long>;
#define cY cout<<"Yes"<<endl
#define cN cout<<"No"<<endl
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
const long double pi = (acos(-1));
#define pb push_back
#define vs vector<string>

//最大最小の入れ替え
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;
}

//約数列挙
vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}
//コンビネーション
ll nCr(ll n, ll r) {
    ll ans = 1;
    for (ll i = n; i > n - r; --i) {
        ans = ans*i;
    }
    for (ll i = 1 ; i < r + 1; ++i) {
        ans = ans / i;
    }
    return ans;
}
//素因数分解
map< ll, ll > prime_factor(ll n) {
  map< ll, ll > ret;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}

//切り上げの割り算は(a + b - 1) / bでできる

//ここから
int main(){
    ll N;
    cin>>N;
    vector<pll> v(N);
    rep(i,N){
        ll a,b;
        cin>>a>>b;
        v[i]=make_pair(a-b,a+b);
    }
    sort(v.begin(),v.end(),[](pll a,pll b){return a.second<b.second;});
    ll count=0;
    ll r=-1*INF;
    rep(i,N){
        if(r>v[i].first) continue;
        r=v[i].second;
        count++;
    }
    cout<<count<<endl;
}

Measured memory_bytes: 1792
using System;
using System.IO;
using System.Linq;

class Program
{
    static void Main()
    {
        string line;
        while((line = Console.ReadLine()) != null)
        {
            string[] tokens = line.Split(' ');
            int a = int.Parse(tokens[0]);
            int b = int.Parse(tokens[1]);
            Console.WriteLine((a + b).ToString().Length);
        }
    }
}

Measured memory_bytes: 9120
#include <iostream>
#include <math.h>
#include <limits>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <stdio.h>
#include <map>
#include <utility>
#include <queue>
using namespace std;
#define rep(i, n) for (int i =0; i < (int)(n); i++)
typedef pair<int, string> P;



int main() {
	long long n;
	cin >> n;
	rep(i, 10000) {
		if (i * 1000 >= n) {
			cout << i * 1000-n << endl;
			return 0;
		}
	}
}

Measured memory_bytes: 3648
//ABC148 D

#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for(int i = s; i < (int)(n); i++)
const lint mod = 1000000007;


lint ans = 0;
lint n;
lint a[200000];


int main() {
  cin >> n;

  rep(i,n) scanf("%lld",&a[i]);
  
  lint cnt = 1;
  
  rep(i,n){
    if(a[i] != cnt){
      a[i] = 1000000;
      ans++;
    }
    else{
      cnt++;
    }
  }
  if(ans == n) ans = -1;

  printf("%lld\n",ans);
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


ll N;
ll A[200005];


ll calc(ll base){

	ll ret = 0;
	for(ll i = 1; i <= N; i++){

		ret += abs(A[i]-base);
	}
	return ret;
}


int main(){

	scanf("%lld",&N);

	ll sum = 0;

	for(int i = 1; i <= N; i++){

		scanf("%lld",&A[i]);
		A[i] -= i;
		sum += A[i];
	}

	ll L = -BIG_NUM,R = BIG_NUM;
	ll ans = HUGE_NUM;

	for(int loop = 0; loop < 100; loop++){

		ll mid1 = (2*L+R)/3;
		ll mid2 = (L+2*R)/3;

		ll value1 = calc(mid1);
		ll value2 = calc(mid2);
		ans = min(ans,min(value1,value2));

		if(value1 <= value2){

			R = mid2;

		}else{

			L = mid1;
		}
	}

	printf("%lld\n",ans);

	return 0;
}


Measured memory_bytes: 5264
#include <iostream>
#include <tuple>
#include <queue>

using namespace std;

using T3=tuple<int,int,int>;

int main(){
    int H,W;
    cin>>H>>W;
    char M[H][W];
    int dist[H][W];
    queue<T3> Q;
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            cin>>M[i][j];
            if(M[i][j]=='%'){
                dist[i][j]=0;
                Q.push(T3(i,j,0));
            }else{
                dist[i][j]=1000000;
            }
        }
    }
    int dist_p = 1000000, dist_s=1000000;
    while(!Q.empty()){
        int i,j,d;
        tie(i,j,d)=Q.front();
        Q.pop();
        if(M[i][j]=='@') dist_p=d;
        if(M[i][j]=='$') dist_s=min(dist_s,d);
        int diff[5]={0,-1,0,1,0};
        for(int k=0;k<4;k++){
            if(i+diff[k]<0||i+diff[k]>=H||j+diff[k+1]<0||j+diff[k+1]>=W) continue;
            if(M[i+diff[k]][j+diff[k+1]]!='#'&&dist[i+diff[k]][j+diff[k+1]]==1000000){
                dist[i+diff[k]][j+diff[k+1]]=d+1;
                Q.push(T3(i+diff[k],j+diff[k+1],d+1));
            }
        }
    }
    if(dist_p<dist_s){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }

    return 0;
}

Measured memory_bytes: 3316
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define IO(i, o) freopen(i, "r", stdin), freopen(o, "w", stdout)

using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

int a, b;

int main(){
	//IO("input.txt", "output.txt");
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> a >> b;
	cout << ((a + b >= 10) ? "error\n" : to_string(a + b));
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> P;
const ll MOD=1000000007;
const ll MAX_N=500010;
const ll INF=999999999999;

int main(){
    int x,y,z;
    cin>>x>>y>>z;
    int n=0;
    while(n*y+(n+1)*z<=x){
        n++;
    }
    cout<<n-1<<endl;
}

Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <cstring>
#define N 100005
using namespace std;

typedef long long ll;
ll w[5], n, m, ans, d[N][5], ta[N];
string a;
ll f(ll p, ll q) {
	ll i, mx = 0, bo;
	if (p >= n) return 0;
	if (d[p][q]!= -1) return d[p][q];

	for (i = 0; i < 3; i++) {
		if (i == q) continue;
		if (ta[p] == (i + 1) % 3) bo = w[i];
		else bo = 0;
		mx = max(mx, f(p + m, i) + bo);
	}
	return d[p][q] = mx;
}

int main()
{
	ll i;
	cin >> n >> m;
	cin >> w[0] >> w[1] >> w[2];
	cin >>a;
	n = a.size();
	memset(d, -1, sizeof(d));
	for (i = 0; i < a.size(); i++) {
		if (a[i] == 'r') ta[i] = 0;
		else if (a[i] == 's') ta[i] = 1;
		else ta[i] = 2;
	}
	for (i = 0; i < m; i++) {
		ans += f(i, 3);
	}
	cout << ans << endl;
    return 0;
}


Measured memory_bytes: 11392
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		for (int i = 3; i <= a; i++) {
			if (i % 3 == 0 || String.valueOf(i).contains("3"))
				System.out.print(" " + i);
		}
		System.out.println();
	}
}


Measured memory_bytes: 29268
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <iostream>
#include <set>
#include <map>
#include <string>
#include <algorithm>

using namespace std;

#define mod 1e9+7
#define ll long long int
#define epsilon 1e-7

ll mi(ll x, ll y){
    if(x<y)return x;
    return y;
}
int prime[] ={11,31,41,61,71,101,131,151,181,191,211,241,251,271,281,311,331,401,421,
431,461,491,521,541,571,601,631,641,661,691,701,751,761,811,821,881,911,941,971,
991,1021,1031,1051,1061,1091,1151,1171,1181,1201,1231,1291,1301,1321,1361,1381,1451,1471,1481,15111};
int main(void){
    int n;
    scanf("%d", &n);
    for(int i = 0;i < n;i++){
        printf("%d ", prime[i]);
    }
    return 0;
}


Measured memory_bytes: 256
from collections import defaultdict

s = input()
d = defaultdict(int)
tmp = 0
for i in range(len(s)):
    tmp += int(s[-i - 1]) * pow(10, i, 2019)
    tmp %= 2019
    d[tmp] += 1

ans = 0
for key, value in d.items():
    if key == 0:
        ans += value * (value + 1) // 2
    else:
        ans += value * (value - 1) // 2

print(ans)


Measured memory_bytes: 82988
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string.h>
using namespace std;
typedef long long int lli;
int main(void)
{
    int r,D,x;
    cin >> r >> D >> x;
    lli decade[11];
    decade[0] = x;
    for(int i=1;i<11;i++){
        decade[i] = r*decade[i-1] - D;  
    }
    for(int i=1;i<11;i++){
        cout << decade[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<cstdio>

#include<vector>
using namespace std;
bool flag=false;
vector<int> v[233333];
vector<int> way;
bool vis[233333];
bool visited[233333];
int n;
int m;
int l,r;
bool dfs_find_way(int a){
    vis[a]=true;
    way.push_back(a);
    if(a==n){
        return true;
    }
    for(int i=0;i<v[a].size();i++){
        if(!vis[v[a][i]]){
            if(dfs_find_way(v[a][i])){
                return true;//true说明走到了
            }
        }
    }
    way.pop_back();
    return false;//false说明没走到
}
int dfs_get_ans(int a,int num=0){//结点累计
    visited[a]=true;
    for(int i=0;i<v[a].size();i++){
        if(!visited[v[a][i]]){
            num=dfs_get_ans(v[a][i],num+1);
        }
    }
    return num;
}
int main(){
    cin>>n;
    m=n-1;
    for(int i=0;i<m;i++){
        int x,y;
        cin>>x>>y;
        v[x].push_back(y);
        v[y].push_back(x);
    }
    dfs_find_way(1);
///*
    for(int i=0;i<way.size();i++){
        visited[way[i]]=true;
//  cout<<way[i]<<" ";
    }
//*/
//puts("1");
    for(int i=0;i<(way.size()+1)/2;i++){
        l+=dfs_get_ans(way[i],0);
    }
    for(int i=(way.size()+1)/2;i<way.size();i++){
        r+=dfs_get_ans(way[i],0);
    }
    if(l>r){
        puts("Fennec");
        return 0;
    }
    else if(l<r){
        puts("Snuke");
        return 0;
    }
    else{
        if(way.size()%2==0){
            puts("Snuke");
            return 0;
        }
        else{
            puts("Fennec");
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 12664
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	static int MOD = 1000000007;

	public static void main(String[] args) {
		exec_1_3();

	}

	public static void exec_1_3() {

		try(var sc = new Scanner(System.in)) {


			int N = sc.nextInt();

			long ans =0;
			for(int i=1;i<N;i++) {

				int m =  (N-1)/i;
				ans += m;
			}
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 35728
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string>
#include <map>
#include <bitset>
#include <stack>
//#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define urept(soeji, start, n) for (int soeji = start; soeji < n; soeji++)
#define drept(soeji, start, n) for (int soeji = start; soeji > n; soeji--)

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

int main(void)
{
    int c[3][3];
    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            cin >> c[i][j];
        }
    }
    int a[3], b[3];
    a[0] = 0;
    for (int i = 0; i < 3; i++)
    {
        b[i] = c[0][i];
    }
    for (int i = 1; i < 3; i++)
    {
        a[i] = c[i][0] - b[0];
    }
    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            if (c[i][j] != a[i] + b[j])
            {
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 3636
N, x = map(int, input().split())
if x == 1 or x == 2 * N - 1:
    print("No")
    exit()

print("Yes")
if N == 2:
    print(1)
    print(2)
    print(3)
    exit()

ans = [-1] * (2 * N - 1)
if x == 2:
    ans[N - 2:N + 2] = [3, 2, 1, 4]
    tmp = 5
    for i in range(2 * N - 1):
        if ans[i] != -1:
            continue
        else:
            ans[i] = tmp
            tmp += 1


else:
    ans[N - 2:N + 2] = [x - 1, x, x + 1, x - 2]
    tmp = x + 2
    for i in range(2 * N - 1):
        if ans[i] != -1:
            continue
        else:
            if tmp >= 2 * N:
                tmp = 1
            ans[i] = tmp
            tmp += 1

for a in ans:
    print(a)


Measured memory_bytes: 12488
# include "iostream"
# include "cstdio"

using namespace std;

int N,A,B;
int Stack[4];

int main(){
	register int i,x,Ans;
	scanf("%d%d%d",&N,&A,&B);
	for(i=1;i<=N;i++){
		scanf("%d",&x);
		if(x<=A) Stack[1]++;
		else if(x>=A+1 && x<=B) Stack[2]++;
		else Stack[3]++;
	}
	Ans=min(Stack[1],min(Stack[2],Stack[3]));
	printf("%d",Ans);
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int a1,b1,a2,b2,x,y;
int main(){
	scanf("%d%d%d%d",&a1,&b1,&a2,&b2);
	x=a2-a1;y=b2-b1;
	printf("%d %d %d %d\n",a2-y,b2+x,a1-y,b1+x);
	return 0;
} 

Measured memory_bytes: 128
// m-solutions2020_a
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

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

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF (ll)(1e9)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
#define print_line(vec, n) {for(int i=0;i<(n-1);i++) cout << (vec)[i] << " "; cout << (vec)[(n)-1] << endl;}
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif

    int X;
    cin >> X;
    int m = X / 200;
    int ans = 10 - m;
    print(ans);

    return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
  int n,d,ans; cin>>n>>d; ans=0;
  vector<vector<int>> data(n, vector<int>(d));
  
for (int k = 0; k < n; k++) {
    for (int j = 0; j < d; j++) {
      cin >> data.at(k).at(j);
    }
  }
  int memo=0;
  
  rep(a,n-1){
    for(int b=a+1;b<n;b++){
      rep(c,d){
      memo=memo+(data.at(a).at(c)-data.at(b).at(c))*(data.at(a).at(c)-data.at(b).at(c));
      }
          rep(l,1000) {if(memo==l*l) {ans++;}}
          memo=0;          }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
using namespace std;
int N;

int factorial(int n) {
	if (n > 1) return n * factorial(n - 1);
	else return 1;
}
int main() {
	cin >> N;
	vector<int> x(10);
	vector<int> y(10);
	for (int i = 0; i < N; i++) {
		cin >> x[i] >> y[i];
	}
	double sum = 0;
	for (int i = 1; i < N + 1; i++) {
		for (int j = i + 1; j < N + 1; j++) {
			double s = sqrt(pow(x[i-1] - x[j-1], 2) + pow(y[i-1] - y[j-1], 2));
			sum += s * 2 * factorial(N - 1);
		}
	}
	cout << fixed << setprecision(6) << sum / factorial(N) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,s,t) for(int i = s;i <= t;i ++)
#define dow(i,t,s) for(int i = t;i >= s;i --)
#define REP(i,x) for(int i = 0;i < x.size();i ++)
#define DOW(i,x) for(int i = (int)s.size();i >= 0;i --)

#define fi first
#define se second

#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound


#define eps 1e-6
#define N
#define INF

#define SZ(x) ((int)(x).size())


using namespace std;

typedef vector<int> VI;
typedef long long LL;
typedef double db;
typedef pair<int,int> PII;


int n , num[100];
int main ()
{
    int a , b , c , d;
    //freopen("in.in","r",stdin);
    //freopen("out.out","w",stdout);
    scanf("%d",&n);
    a = n % 10;n /= 10;
    b = n % 10;n /= 10;
    c = n % 10;n /= 10;
    d = n % 10;n /= 10;
    if(a == b && b == c)return printf("Yes\n") , 0;
    if(b == c && c == d)return printf("Yes\n") , 0;
    printf("No\n");
    return 0;
}


Measured memory_bytes: 256
from collections import Counter
n = int(input())
s = []
for _ in range(n):
    s.append(str(input()))

s_c = Counter(s).most_common()
m = s_c[0][1]

ans = []

for j in range(len(s_c)):
    if s_c[j][1] != m:
        break
    else:
        ans.append(s_c[j][0])
        
ans.sort()

for k in ans:
    print(k)

Measured memory_bytes: 45032
#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
using namespace std;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if(a == b & b == c){
        cout << "Yes";

        return 0;
    }

    cout << "No";
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] array = new long[n];
        long sum = 0;
        for (int i = 0; i < n; i++) {
            long m = sc.nextInt();
            array[i] = m;
            sum += m;
        }
        long l = 0;
        long ans = Long.MAX_VALUE;
        for (int i = 0; i < n - 1; i++) {
            l += array[i];
            long o = Math.abs(2 * l - sum);
            if (o < ans) {
                ans = o;
            }
        }
        System.out.println(ans);
    }
}


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

int main() {
  long long N;
  cin >> N;
  
  vector <long long> d(N);
  for (int i = 0; i < N; i++) {
    cin >> d[i];
  }
  
  long long sum = 0;
  for (int i = 0; i < N; i++) {
    for (int j = i+1; j < N; j++) {
      sum += d[i] * d[j];
    }
  }
  
  cout << sum << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <cstring>
#include <string>
#include <queue>
#include <cmath>
#include <map>

#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define rev(v) (v).rbegin(), (v).rend()
#define MP make_pair
#define X first
#define Y second

using namespace std;

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

int main(){
	int n, a, b, c, x;
	while(cin >> n >> a >> b >> c >> x, n|a|b|c|x){
		vector<int> y(n);
		rep(i, n) cin >> y[i];		

		int r = x;
		int idx = 0;
		int ans = -1;
		rep(i, 10001){
			if(y[idx] == r) idx++;
			if(idx == n){
				ans = i;
				break;
			}
			r = (a*r+b)%c;
		}
		cout << ans << endl;
	}

	return 0;
}

Measured memory_bytes: 1196
def Fib(n):
    a,b = 1,1
    if n == 1:
        return 1
    elif n == 2:
        return 1
    else:
        for i in range(n-2):
            a,b = b,a+b
        return b
    
n,m = map(int,input().split())
start = []
for i in range(m):
    start.append(int(input()))

if start == []:
    print(Fib(n+1)%1000000007)
else:
    pstart = [-1]+start+[n+1] #スタートとゴールを追加
    newlist = [] #距離のリスト
    for j in range(len(pstart)-1):
        newlist.append(pstart[j+1]-pstart[j]) #障害物同士の距離を測る
    if 1 in newlist[1:len(newlist)-1]:
                 print(0)
    else: #ちゃんと距離が出そうなとき
        ans = 1
        #print(newlist)
        for w in newlist:
            #print(Fib(w-1))
            #print(ans)
            ans = (ans*Fib(w-1))%1000000007
        print(ans)         

Measured memory_bytes: 9248
#pragma GCC optimize "-O3"
#pragma GCC target ("avx")
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v),greater<int>())
#define SPEED ios::sync_with_stdio(false);cin.tie(0);cout<<fixed<<setprecision(12)
signed gcd(int a, int b){return b?gcd(b,a%b):a;}
signed lcm(int a, int b){return a*b/gcd(a,b);}
//priority_queue<int, vi, greater<int> > que;//昇順

using namespace std;

const int mod=1e9+7;

signed main(){
    SPEED;
    int x,a,b;
    cin >> x >> a >> b;
    x -= a;
    cout << x % b << endl;
}


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

int main(){
	int n,m,sum=0;
	cin>>n>>m;
	int A[n];
	for(int i=0;i<n;i++){cin>>A[i];sum+=A[i];}
	int x = ceil(sum/(4.0*m));
	sort(A,A+n,greater<int>());
	bool flag  = true;
	for(int i=0;i<m;i++){
		if(A[i]<x){
			flag = false;
			break;
		}
	}
	if(flag)cout<<"Yes";
	else cout<<"No";
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
	using namespace std;
	#define int long long int
	#define pb push_back
	const int mod=1e9+7;
	#define all(x) x.begin(),x.end()
	#define endl '\n'
	#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
	int32_t main(){
		IOS;
		int n;
		cin>>n;
		int arr[n];
		for(int i=0;i<n;i++){
			cin>>arr[i];
		}
		sort(arr,arr+n,greater<int>());
		int sum=arr[0];
		int x=(n-1)/2;
		int j=1;
		if(n%2==0){
			
			for(int i=0;i<x;i++){
				sum+=2*(arr[j++]);
			}
		}
		else{
			x--;
			for(int i=0;i<x;i++){
				sum+=2*arr[j++];
			}
			sum+=arr[j];
		}
		
		cout<<sum<<endl;
		return 0;
	}


Measured memory_bytes: 5216
from math import gcd

from math import factorial as f

from math import ceil, floor, sqrt
import math

import bisect
import re
import heapq

from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))

yes = "Yes"
no = "No"


def main():
    x = ii()
    if x >= 30:
        print(yes)
    else:
        print(no)


main()


Measured memory_bytes: 9760