akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){

	int n;
	cin >> n;

	vector<int> vec;

	for(int i=0;i<n;i++){
		int t;
		vector<int>::iterator itr;
		cin >> t;

		itr = find(vec.begin(), vec.end(), t);

		if(itr == vec.end()) vec.push_back(t);
		else continue;
	}

	cout << vec.size() << endl;

	return 0;
}



Measured memory_bytes: 384
#include <bits/stdc++.h>
 
#define pb push_back
#define fst first
#define snd second
#define INF 0x7fffffff
#define INFLL 0x7FFFFFFFFFFFFFFF
#define lenA(ar) sizeof(ar)/sizeof(*ar)
#define fill(a,c) memset(&a, c, sizeof(a))
#define fore(i,x,y) for(int i=x;i<y;i++)
#define foreI(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define FIN ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sl "\n";
#define ii pair<ll,ll>
#define mk make_pair
 
 
typedef long long ll;
typedef unsigned long long ull;
 
using namespace std;
string a,b;
const int MAXN = 3005;
ll dp[MAXN][MAXN];
int n,m;
string ans;
ll solve(int i,int j){
    if(i==n)return 0;
    if(j==m)return 0;
    ll &r = dp[i][j];
    if(r!=-1)return r;
    if(a[i]==b[j]){r=solve(i+1,j+1)+1;}
    else r=max(solve(i+1,j),solve(i,j+1));
    return r;
}
void build(int i,int j){
    if(i==n)return;
    if(j==m)return;
    ll answer = solve(i,j);
    if(a[i]==b[j]&&answer==solve(i+1,j+1)+1){ans.pb(a[i]);build(i+1,j+1);}
    else if(answer==solve(i+1,j)){build(i+1,j);}
    else if(answer==solve(i,j+1)){build(i,j+1);}
    return;
}
int main() {FIN;
   
    cin>>a>>b;
    n=a.size();
    m=b.size();
    memset(dp,-1,sizeof(dp));
    solve(0,0);
    build(0,0);
    cout<<ans<<sl;
    return 0;
}
 


Measured memory_bytes: 74444
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7 # 998244353
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    n,q=map(int,input().split())
    E=[[] for _ in range(n)]
    for _ in range(n-1):
        u,v=map(int,input().split())
        u-=1; v-=1
        E[u].append(v)
        E[v].append(u)

    # Euler tour
    Q=[(~0,-1),(0,-1)]
    begin=[None]*n
    end=[None]*n
    cnt=-1
    while(Q):
        v,p=Q.pop()
        cnt+=1
        if(v>=0):
            if(begin[v] is None): begin[v]=cnt
            for nv in E[v][::-1]:
                if(nv==p): continue
                Q.append((~nv,v))
                Q.append((nv,v))
        else:
            end[~v]=cnt

    # imos
    imos=[0]*(2*n)
    for _ in range(q):
        p,x=map(int,input().split())
        p-=1
        imos[begin[p]]+=x
        imos[end[p]]-=x

    for i in range(2*n-1):
        imos[i+1]+=imos[i]

    # output
    print(*(imos[begin[v]] for v in range(n)))
resolve()

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

#define REP(i, n) for(int64_t i = 0; i < n; i++)
#define REPR(i, n) for(int64_t i = n; i >= 0; i--)
#define FOR(i, m, n) for(int64_t i = m; i < n; i++)
#define FORR(i, m, n) for(int64_t i = m; i >= n; i--)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill( (T*)array, (T*)(array+N), val );
}
template<class T>
inline bool chmax(T &a, T b) {if(a < b) {a = b;return true;}return false;}
template<class T>
inline bool chmin(T &a, T b) {if(a > b) {a = b;return true;}return false;}
const ll INF= 1ll << 60;
const ll MOD = 1000000007;
double EPS = 1e-10;
//----------------------------------------------------------

ll x;

int main(){
    cin >> x;
    int64_t a,b=0,b_s=0;
    while(true)
    {
        a=pow(x+pow(b_s,5),0.2);
        b=b_s;
        if(pow(a,5)-pow(b,5)==x){break;}
        else
        {
            if(x-pow(b_s,5)<0){a=pow(pow(b_s,5)-x,0.2);}
            else {a=pow(x-pow(b_s,5),0.2);}
            b=-1*b_s;
            if(pow(a,5)-pow(b,5)==x){break;}
        }
        b_s++;
    }
    /*
    double a = pow(x,0.2);
    ll a_r = round(a);
    bool minus = false;
    if(a_r-a<0)minus=true;
    ll b=0;
    cout << a << a_r << " " << b << endl;
    return 0;
    if(minus){
        while(true){
            if(pow(a_r,5)-pow(b,5)==x)
            {
                break;
            }
            else
            {
                b--;
            }
        }
    }
    else
    {
        while(true){
            if(pow(a_r,5)-pow(b,5)==x)
            {
                break;
            }
            else
            {
                b++;
            }
        }
    }
    cout << a_r << " " << b << endl;
    */
   cout << a << " " << b << endl;
    return 0;
}

Measured memory_bytes: 4068
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}

int main(){
    ll X;
    string S;
    cin >> X;
    ll tmpi=-1;
    ll tmpj=0;
    bool flag= false;
    REP(i,-1000,1001){
        REP(j,-1000,1001){
            if(i*i*i*i*i - j*j*j*j*j == X){
                tmpi=i;
                tmpj=j;
                flag = true;
                break;
            }
        }
        if(flag)break;
    }
    cout << tmpi << " "<< tmpj <<endl;
}

Measured memory_bytes: 3628
n,m=map(int,input().split())
#a=[[0]*2 for ii in range(m)]
for ii in range(m):
  #a[ii][:]=map(int,input().split())
  a,b=map(int,input().split())
  if ii==0:
    #r=[a[ii][0],a[ii][1]]
    r=[a,b]
  else:
    #r=[max(a[ii][0],r[0]),min(a[ii][1],r[1])]
    r=[max(a,r[0]),min(b,r[1])]
q=r[1]-r[0]+1
if q<0:
  print(0)
else:
  print(q)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define ll long long int
#define endl "\n"
#define mod 1000000007
using namespace std;

vector<ll> g[100001];
ll dp[100001];

ll dfs(ll node)
{
    ll depth=0;
    ll ans=0;
    if(dp[node] != -1)
    {
        return dp[node];
    }
    for(ll child: g[node])
    {
        depth=1;
        ans=max(ans, 1+dfs(child));
    }
    return dp[node] = (depth==0)? 0 : ans;
}

int main()
{
    ll n, m;
    cin>>n>>m;
    memset(dp, -1, sizeof dp);
    while(m--)
    {
        ll u, v;
        cin>>u>>v;
        g[u].push_back(v);
    }
    ll ans=0;
    for(ll i=1; i<=n; i++)
    {
        ans=max(ans, dfs(i));
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 11912
n, m, x, y = map(int, input().split())
ls_x = list(map(int, input().split()))
ls_y = list(map(int, input().split()))

if max(ls_x) < y and min(ls_y) > x and max(ls_x) < min(ls_y):
    print('No War')
else:
    print('War')


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

int main(){
	vector<int> p;
	int i, n;
	int input, difference = 0;
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> input;
		p.push_back(input);
	}
	for(int i = 0; i < n; i++){
		if(p[i] != i+1){
			difference++;
		}
		if(difference > 2){
			break;
		}
	}
	if(difference <= 2){
		cout << "YES" << endl;
	}else{
		cout << "NO" << endl;
	}
 
}


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

int main()
{
   int a,b,c ,d;
   cin>>a>>b>>c>>d;
   bool flag  = true;
   while(a>0)
   {
       
       
       a = a-d;
       c = c-b;
       
       
       if(c<=0&&a>0)
       {
           flag =true;
           break;
       }
       else if(c>0&&a<=0)
       {
           flag =false;
           break;
       }
       
   }
   
   if(flag)
        cout<<"Yes"<<endl;
        else
        cout<<"No"<<endl;
   
   
}


Measured memory_bytes: 3560
N=int(input())
ans=0
for a in range(1,pow(10,3)+1):
    for b in range(a,pow(10,6)+1):
        if a*b>=N:
            break
        if N-a*b>0:
            if a==b:
                ans+=1
            else:
                ans+=2
print(ans)


Measured memory_bytes: 67660
N = int(input())
point = [tuple(map(int, input().split())) for i in range(N)]
point_farthest = max(point, key=lambda p: abs(p[0]) + abs(p[1]))
mod = sum(point_farthest) % 2
D = [1, 1] if mod == 0 else [1]
while sum(D) < abs(point_farthest[0]) + abs(point_farthest[1]):
    D.append(D[-1] * 2)
D.reverse()
W = []
for x, y in point:
    if (x + y) % 2 != mod:
        print(-1)
        exit()
    w = ''
    for d in D:
        if abs(x) >= abs(y):
            if x > 0:
                w += 'R'
                x -= d
            else:
                w += 'L'
                x += d
        else:
            if y > 0:
                w += 'U'
                y -= d
            else:
                w += 'D'
                y += d
    W.append(w)
print(len(D))
print(*D)
print(*W, sep='\n')

Measured memory_bytes: 3316
h,w,m = map(int,input().split())
p = []
hlist = [0 for i in range(h)]
wlist = [0 for i in range(w)]
for i in range(m):
    a,b = map(int,input().split())
    hlist[a-1] += 1
    wlist[b-1] += 1
    p.append([a-1,b-1])
q = 0
for i in range(h):
    q = max(q,hlist[i])
s = []
for i in range(h):
    if hlist[i] == q:
        s.append(i)
r = 0
for i in range(w):
    r = max(r,wlist[i])
t = []
for i in range(w):
    if wlist[i] == r:
        t.append(i)
z = 0
for i in range(m):
    if hlist[p[i][0]] == q and wlist[p[i][1]] == r:
        z += 1
if z == len(s)*len(t):
    print(q+r-1)
else:
    print(q+r)

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

using namespace std;

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ll h, w, x, y;
  cin >> w >> h >> x >> y;
  if (x * 2 == w && y * 2 == h)
    printf("%.9lf 1\n", (double) h * w / 2);
  else
    printf("%.9lf 0\n", (double) h * w / 2);

  return 0;
}


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

#define ll long long int
#define watch(x) cout << (#x) << " is " << (x) << endl
#define f(i,x,n)  for(int i=x;i<n;i++)
#define FASTIO cin.tie(0); cout.tie(0);
#define eb(x) emplace_back(x)
#define mp(a,b) make_pair(a,b)
#define sz(a) int((a).size())
#define mod 1000000007

//MIN-MAX
#define max3(a, b, c) max(a, max(b, c))
#define min3(a, b, c) min(a, min(b, c))

//LCM
int lcm(int a, int b) {  return a * (b / __gcd(a, b)); }

//For sort by second
bool cmp(const pair<int,int> &a)
{ return a.first<a.second; }

//Tree
/* const int MAXN = 1e5 + 5;
vector<ll> adj[MAXN];*/

//ModPower
ll modpower(ll a,ll b,ll c)
{
	ll res=1;
	while(b)
	{
		if(b&1LL)
			res=(res*a)%c;
		a=(a*a)%c;
		b>>=1;
	}
	return res;
}

template<typename T> void print(T n)
{
   cout<<n;

    putchar('\n');
}

int main()
{
	FASTIO;

	    ll n;
	     cin>>n;

	     if(n<=9)
            cout<<"Yes\n";
         else if(n%2==0 && n/2<=9)
            cout<<"Yes\n";
         else if(n%3==0 && n/3<=9)
            cout<<"Yes\n";
            else if(n%4==0 && n/4<=9)
            cout<<"Yes\n";
            else if(n%5==0 && n/5<=9)
            cout<<"Yes\n";
            else if(n%6==0 && n/6<=9)
            cout<<"Yes\n";
            else if(n%7==0 && n/7<=9)
            cout<<"Yes\n";
            else if(n%8==0 && n/8<=9)
            cout<<"Yes\n";
            else if(n%9==0 && n/9<=9)
            cout<<"Yes\n";
            else
                cout<<"No\n";

	return 0;
}













Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
//TODO add string to vector of integers macro or function
vector<int> str_to_vect(string s)
{
	vector<int> v;
	for(int i=0;i<s.size();++i)
	{
		v.push_back((int)s[i]-48);
	}
	return v;
}
int main()
{
	long long int n,k;
	cin>>n>>k;
	cout<<min(abs(k-n%k),n%k);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll= long long;
using vi= vector<int>;
using vvi= vector<vi>;
using vd= vector<double>;
using vc= vector<char>;
#define REP(i,x,n) for(int i=x; i<n; i++)
#define rep(i,n) REP(i,0,n)
#define all(x) x.begin(), x.end()

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

  cout << min(n*a,b) << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>

using namespace std;

int main()
{    
    vector<int> vec;
    int n;
    cin >> n;

    for(int i = 0;i < n;i++)
    {
        int a;
        cin >> a;
        vec.push_back(a);
    }

    for(vector<int>::reverse_iterator itr = vec.rbegin();itr != vec.rend();itr++)
    {
        cout << *itr;
        if(itr + 1 != vec.rend())
        {
            cout << " ";
        }
    }

    cout << endl;

     return 0;
}

Measured memory_bytes: 1216
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial, gcd, ceil, atan, pi
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')
import string
# string.ascii_lowercase
from bisect import bisect_left
MOD = int(1e9)+7
INF = float('inf')


def solve():
    # n, m = [int(x) for x in input().split()]
    n, m = [int(x) for x in input().split()]
    ans = []
    c = 0
    for i in range(n):
        r = [int(x) for x in input().split()]
        for j in range(m):
            if i + 1 == n and j + 1 == m: continue
            if i % 2:
                j = m - j - 1
            r[j] += c
            c = r[j] % 2
            if c:
                x = i + 1
                y = j + 1
                if i % 2:
                    if y == 1:
                        ans.append((x, y, x + 1, y))
                    else:
                        ans.append((x, y, x, y - 1))
                else:
                    if y == m:
                        ans.append((x, y, x + 1, y))
                    else:
                        ans.append((x, y, x, y + 1))
    print(len(ans))
    for r in ans:
        print(*r)


t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""

azyxwvutsrqponmlkjihgfedcb

"""


Measured memory_bytes: 26936
#include <bits/stdc++.h>
#define LOOP(n) for (int _i = 0; _i < (n); _i++)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, r, n) for (int i = (r); i < (n); ++i)
#define All(obj) begin(obj), end(obj)
using namespace std;
using ll = long long;
using ull = unsigned long long;

const int INF = 2100100100;
const int MOD = 1e9 + 7;

int N;
ll K;
vector<ll> P, M, Z;

bool judge_m(ll mid) {
    ll sum = 0;
    for (int i = 0; i < (int)P.size(); i++) {
        ll d = (mid - P[i] + 1) / P[i];
        sum += upper_bound(M.begin(), M.end(), d) - M.begin();
    }
    return sum >= K;
}

bool judge_p(ll mid) {
    ll sum = 0;
    for (int i = 0; i < (int)P.size(); i++) {  // 正と正の積
        ll d = mid / P[i];
        ll tmp = upper_bound(P.begin(), P.end(), d) - P.begin();
        if (i < tmp) tmp--;  // 自身を除く
        sum += tmp;
    }
    for (int i = 0; i < (int)M.size(); i++) {  // 負と負の積
        ll d = mid / M[i];
        ll tmp = upper_bound(M.begin(), M.end(), d) - M.begin();
        if (i < tmp) tmp--;  // 自身を除く
        sum += tmp;
    }
    sum /= 2;
    return sum >= K;
}

int main() {
    cin >> N >> K;
    vector<ll> A(N);
    REP(i, N) cin >> A.at(i);
    REP(i, N) {
        if (A[i] > 0) {
            P.push_back(A[i]);
        } else if (A[i] < 0) {
            M.push_back(A[i]);
        } else {
            Z.push_back(A[i]);
        }
    }

    ll p = P.size();
    ll m = M.size();
    ll z = Z.size();
    ll minus = p * m;
    ll zero = z * (z - 1) / 2 + z * p + z * m;
    ll plus = p * p + m * m;

    if (K <= minus) {  // X が負の時
        sort(All(M));
        ll l = -1e18 - 1, u = -1;  //(l,u]に答えがある
        while (u - l > 1) {
            ll mid = (u + l) / 2;
            if (judge_m(mid)) {
                u = mid;
            } else {
                l = mid;
            }
        }
        cout << u << endl;

    } else if (K <= minus + zero) {  // X が 0 の時
        cout << 0 << endl;

    } else if (K <= minus + zero + plus) {  // X が正の時
        K -= (minus + zero);
        REP(i, m) M[i] = abs(M[i]);
        sort(All(P));
        sort(All(M));
        ll l = -1, u = 1e18;  //(l,u]に答えがある
        while (u - l > 1) {
            ll mid = (u + l) / 2;
            if (judge_p(mid)) {
                u = mid;
            } else {
                l = mid;
            }
        }
        cout << u << endl;
    }
    return 0;
}


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

int main()
{
    int H, W, D;
    cin >> H >> W >> D;
    int A, Q, L, R;
    int px[H*W + 3], py[H*W + 3], d[H*W + 3];
    for(int i = 1; i <= H; ++i) {
        for(int j = 1; j <= W; ++j) {
            cin >> A;
            px[A] = i, py[A] = j;
        }
    }
    d[0] = 0;
    for(int i = D + 1; i <= H*W; ++i) 
        d[i] = d[i-D] + abs(px[i] - px[i-D]) + abs(py[i] - py[i-D]);
    
    cin >> Q;
    while(Q--) {
        cin >> L >> R;
        cout << d[R] - d[L] << endl;
    }

    return 0;
}

Measured memory_bytes: 2176
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <cmath>
#include <set>
#include <bitset>
#include <limits>

using namespace std;

#define ll long long

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

    vector<vector<int>> coef(n);
    for(int i = 0;i < m;++i){
        int a, b;
        cin >> a >> b;
        a -= 1;
        b -= 1;

        coef[a].push_back(b);
        coef[b].push_back(a);

    }

    vector<int> ans_flag(n, 0);

    for(int i = 0;i < n;++i){
        int good_flag = 1;
        for(int j = 0;j < coef[i].size();++j){
            if(h[i] <= h[coef[i][j]]){
                good_flag = 0;
                break;
            }
        }

        if(good_flag == 1){
            ans_flag[i] = 1;
        }
    }

    int ans = 0;
    for(int i = 0;i < n;++i){
        if(ans_flag[i]){
            ans += 1;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 9064
#ABC104a.py
s=str(input())
A=int(0)
C=int(0)
L=len(s)
ans='AC'
for i in range (L):
  if i==0:
    if not s[i]=='A':
      ans='WA'
      break
    continue
  if  2<=i<=L-2:
      if s[i]=='C':
          C=C+1
          continue
  if not 'a'<=s[i]<='z':
          ans='WA'
          break
if not C==1:
    ans='WA'

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool solve() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (auto &e: a) cin >> e;
    int lo = *min_element(a.begin(), a.end());
    int hi = *max_element(a.begin(), a.end());
   
    if (hi - lo > 1) return false;

    if (hi == lo) return hi == n-1 || hi <= n/2;
    

    int locnt = count(a.begin(), a.end(), lo);
    if (locnt > hi-1) return false;
    int r = hi - locnt;
    return (n-locnt)/r >= 2;
}

int main() {
    if (solve()) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 640
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
using namespace std;

// O(√n) で素数判定
bool is_prime(int n) {
    for (int i = 2; i * i <= n; i++) {
        if (n % i == 0) return false;
    }
    return n != 1;
}

// 約数のvectorを返す
vector<int> divisor(int n) {
    vector<int> ret;
    for (int i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i != n / i) ret.push_back(n / i);
        }
    }
    return ret;
}

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


// verified
//   https://onlinejudge.u-aizu.ac.jp/courses/library/6/NTL/1/NTL_1_A
void AOJ_NTL_1_A() {
    int n;
    cin >> n;
    cout << n << ':';
    auto mp = prime_factor(n);
    for (auto itr = mp.begin(); itr != mp.end(); itr++) {
        for (int i = 0; i < itr->second; i++) {
            cout << ' ' << itr->first;
        }
    }
    cout << endl;
}

int main() {
    AOJ_NTL_1_A();
    return 0;
}


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

#define ll long long
int main(){
	int n;
	cin >> n;
	ll a[n];
	for (int i = 0; i < n; i++){
		cin >> a[i];
	}
	ll ans = 0;
	ll cost = 1000; 
	for(int i = 0; i < (n-1); i++){
		if(a[i+1] > a[i]){
			ll num = cost/a[i];
			cost += (a[i+1] - a[i])*num;
		}
	}
	cout << cost << endl;
	return 0;
}

Measured memory_bytes: 3632
//shan61916
#include <bits/stdc++.h>
  using namespace std;
typedef   long long ll;
typedef   unsigned long long ull ;
typedef   double dll ;

#define   mp make_pair
#define   pb push_back
#define   ff first 
#define   ss second
#define   IOS ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define   endl "\n" 
#define   pll pair<ll, ll>
#define   all(x) x.begin(), x.end()
#define   vll vector<ll> 

const ll inf = (ll)(1e17 + 17);
const ll mod = (ll)(1e9 + 7);


int main(){
 IOS
#ifdef SHAN
    freopen("input.txt" , "r" , stdin);  
#endif
  ll n;
  cin >> n;
  ll ct = 0;
  ll curr = 100;
  while(curr < n) {
    curr+= (curr)/100;
    ct++;
  }
  cout << ct << endl;
  return 0;
} //good night.

Measured memory_bytes: 3652
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;
const int INF = 10000000;
const int MAX_N = 200;
const int MAX_R = 1000;
//struct edge {int };

int main() {
  // ifstream cin("../test.txt");
  while (true) {
    int N, M;
    cin >> N >> M;
    if (!(N | M)) break;
    // dl, dsの初期化
    int dl[MAX_N][MAX_N]; // 陸路の最短距離
    int ds[MAX_N][MAX_N]; // 海路の最短距離
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        if (i == j) {
          dl[i][i] = 0;
          ds[i][i] = 0;
        } else {
          dl[i][j] = INF;
          ds[i][j] = INF;
        }
      }
    }
    int x, y, t;
    char sl;
    while (M--) {
      cin >> x >> y >> t >> sl;
      x--; y--;
      if (sl == 'L') {
        dl[x][y] = t;
        dl[y][x] = t;
      } else if (sl == 'S') {
        ds[x][y] = t;
        ds[y][x] = t;
      }
    }
    // ワーシャルフロイド
    for (int k = 0; k < N; k++) {
      for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
          dl[i][j] = min(dl[i][j], dl[i][k] + dl[k][j]);
          ds[i][j] = min(ds[i][j], ds[i][k] + ds[k][j]);
        }
      }
    }
    // 表示
  //   cout << "dl----------" << endl;
  //   for (int k = 0 ; k < N; k++) {
  //    for (int i = 0; i < N; i++) {
  //      cout << k+1 << " " << i+1 << " ";
  //      cout << dl[k][i] << endl;
  //    }
  //  }
  //  cout << "ds----------" << endl;
  //  for (int k = 0 ; k < N; k++) {
  //   for (int i = 0; i < N; i++) {
  //     cout << k+1 << " " << i+1 << " ";
  //     cout << ds[k][i] << endl;
  //   }
  // }
  // cout << "------------" <<endl;
    // dp 初期化
    int dp[MAX_R][MAX_N];
    int z[MAX_R];
    int R;
    cin >> R;
    for (int i = 0; i < R; i++) {
      cin >> z[i];
      z[i]--;
    }
    for (int i = 0; i < R; i++) {
      for (int j = 0; j < N; j++) {
        dp[i][j] = INF;
      }
    }
    dp[0][z[0]] = 0;
    for (int j = 0; j < N; j++) {
      dp[0][j] = ds[z[0]][j];
    }
    // dp 計算
    int s, g;
    for (int i = 1; i < R; i++) {
      for (int j = 0; j < N; j++) {
        s = z[i-1];
        g = z[i];
        // dp[i-1][k] + dl[s][k] + ds[k][j] + dl[j][g] の最小値
        int min_s = INF;
        for (int k = 0; k < N; k++) {
          if (INF > dp[i-1][k] + dl[s][k] + ds[k][j])
            min_s = min(min_s, dp[i-1][k] + dl[s][k] + ds[k][j]);
        }
        min_s += dl[j][g];
        dp[i][j] = min(dp[i-1][j] + dl[s][g], min_s);
      }
    }
    // 出力
    int ans = INF;
    for (int i = 0; i < N; i++) {
      ans = min(ans, dp[R-1][i]);
    }
    cout << ans << endl;
  }
}

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

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

using namespace std;

vector<llong> divisors(llong n){
	vector<llong> res;
	for(llong i = 1; i * i <= n; ++i){
		if(n % i != 0) continue;
		res.push_back(i);
		if(n/i == i) continue;
			
		res.push_back(n/i);
		
	}
	return res;
}

signed main(){

	while(true){
		llong n;
		cin >> n;
		
		if(n == 0) break;
		
		vector<llong> v;
		v = divisors(n);
		llong ans = 0;
		for(auto itr = v.begin(); itr!=v.end(); ++itr){
			//
			//
			//cout << *itr << " ";
			if(*itr != n)
				ans += *itr;
		}
		//cout << endl;
		if(ans == n){
			cout << "perfect number" << endl;
		}else if(ans < n){
			cout << "deficient number" << endl;
		}else{
			cout << "abundant number" << endl;
		}
	}
	return 0;
}




Measured memory_bytes: 3140
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

typedef long long int ll;

#define FOR(i,n,m) for(ll i=(ll)(m);i<(ll)(n);++i)
#define REP(i,n) FOR(i,n,0)
#define IREP(i,n) for(ll i=(ll)(n);i>=0;--i)

const ll MOD = 1000000007;

int A[100005], B[100005];

using namespace std;

int main()
{
	int N;
	cin >> N;
	REP(i, N)
	{
		cin >> A[i] >> B[i];
	}

	ll ans = 0;
	IREP(i, N - 1)
	{
		if ((A[i] + ans) % B[i] == 0)
		{
			continue;
		}
		ans += (B[i] - (A[i] + ans) % B[i]);
	}

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

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define rrep(i, a, b) for (int i = (a); i < (b); ++i)
#define PI acos(-1)
#define pcnt __builtin_popcountll
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
#define fi first
#define se second

using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using LP = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using tl = tuple<ll, ll, ll>;

template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) {if (a > b) { a = b; return true; } return false; }

ll INF = 1001001001;
ll LINF = 1001001001001001001ll;

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

    ll n; cin>>n;
    cout<<(1000 - n % 1000) % 1000<<endl;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define pb push_back
#define SZ(x) ((int)(x.size()))
#define FOR(i,s,n) for (ll i = (s); (i) < (n); ++i)
#define FORD(i,s,l) for (ll i = (s); (i) >= l; --i)
#define F first
#define S second
#define TC int __tc; cin >> __tc; FOR(case_num,1,__tc+1)
#define TEST(x,i) ((x)&(1ll<<(i)))
#define SET(x,i) ((x)|(1ll<<(i)))
#define FLIP(x,i) ((x)^(1ll<<(i)))
#define CLEAR(x,i) ((x)&~(1ll<<(i)))

const double pi = 4 * atan(1);
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;
const int MAXN = 200005;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	map<char,string> f;
	cin >> f['a'];
	cin >> f['b'];
	cin >> f['c'];
	
	reverse(f['a'].begin(),f['a'].end());
	reverse(f['b'].begin(),f['b'].end());
	reverse(f['c'].begin(),f['c'].end());
	
	char c = 'a';
	while(f[c].length()) {
		char c2 = f[c].back();
		f[c].pop_back();
		c = c2;
	}
	
	cout << (char)toupper(c) << "\n";

}


Measured memory_bytes: 3624
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define N 110

void main()
{
    int k;
    char s[N], s_[N];

    if (scanf("%d", &k) < 1)
        exit(1);
    if (scanf("%s", s) < 1)
        exit(1);

    if (strlen(s) > k)
    {
        strncpy(s_, s, k);
        s_[k] = '\0';
        strcat(s_, "...");
        printf("%s", s_);
    }
    else
    {
        printf("%s", s);
    }
}

Measured memory_bytes: 1724
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <climits>
#include <iostream>
#include <string>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>

using namespace std;

#define ALL(g) (g).begin(), (g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define INF 1 << 30
#define pb push_back
#define mp make_pair

typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef long long ll;

class DisjointSet {
private:
    vector<int> par;
    vector<int> rank;

public:
    DisjointSet(int n) {
        for (int i = 0; i < n; i++) {
            par.push_back(i);
            rank.push_back(0);
        }
    }

    int find(int x) {
        if (par[x] == x) return x;
        return par[x] = find(par[x]);
    }

    void unite(int x, int y) {
        x = find(x);
        y = find(y);
        if (x == y) return;
        
        if (rank[x] < rank[y]) {
            par[x] = y;
        }
        else {
            par[y] = x;
            if (rank[x] == rank[y]) rank[x]++;
        }
    }

    bool same(int x, int y) {
        return find(x) == find(y);
    }
};


class Edge {
public:
    int source, target, cost;
    Edge(int source = 0, int target = 0, int cost = 0):
        source(source), target(target), cost(cost) {}
    bool operator < (const Edge &e) const {
        return cost < e.cost;
    }
};


int Kruskal(int N, vector<Edge> edges) {
    int totalCost = 0;
    sort(edges.begin(), edges.end());

    DisjointSet dset = DisjointSet(N);

    int source, target;
    rep(i, edges.size()) {
        Edge e = edges[i];
        if (!dset.same(e.source, e.target)) {
            totalCost += e.cost;
            dset.unite(e.source, e.target);
        }
    }

    return totalCost;
}


int main(void) {
    int n, m, s, t, c, ans;
    vector<Edge> edges;
    scanf("%d %d", &n, &m);
    rep(i, m) {
        scanf("%d %d %d", &s, &t, &c);
        edges.push_back(Edge(s, t, c));
    }

    ans = Kruskal(n, edges);

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

    return 0;
}

Measured memory_bytes: 3612
//#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"

#define rep(i,n) for(ll (i)=0;(i)<(ll)(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007LL
#define INF (1LL<<60LL)
#define int long long
typedef long long ll;

using namespace std;


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n; cin >> n;
	ll ans = 0;
	ll k = 1;
	rep(i, n) {
		ll a; cin >> a;
		if (a == k) {
			k++;
		}
		else {
			ans++;
		}
	}
	if (ans == n) cout << -1 << endl;
	else cout << ans << endl;
}

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

using namespace std;

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

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

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

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

const int MOD=1000000007;
#define FIX(a) ((a)%MOD+MOD)%MOD

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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, a[252525];
	cin>>n;
	REP(i, n){
		cin>>a[i];
	}
	ll ans=0;
	for(int l=0, r=0, bit=0; l<n; ++l){
		while(r<n && (bit&a[r])==0) bit|=a[r++];
		ans+=r-l;
		bit^=a[l];
	}
	cout<<ans<<'\n';
	return 0;
}


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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

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

int main()
{
    cout << fixed << setprecision(15);
    ll a, b;
    cin >> a >> b;

    if(a <= b){
        cout << a << endl;
    }
    else{
        cout << a-1 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <utility>
#include <map>
#include <bitset>
#include <numeric>
#define ll long long
using namespace std;
using p = pair<ll, ll>;
ll dx[8]={ 0, 1, 0,-1, 1, 1,-1,-1}; // x軸方向への変位
ll dy[8]={ 1, 0,-1, 0, 1,-1, 1,-1}; // y軸方向への変位

int main(void) {
    ll n;
    cin >> n;
    vector<vector<ll>> a(10, vector<ll>(10, 0));
    for(ll i = 1; i <= n; i++){
        string s = to_string(i);
        char c = s[0];
        char d = s[s.length()-1];
        a[c-48][d-48]++;
    }
    ll ans = 0;
    for(ll i = 1; i <= 9; i++){
        for(ll j = 1; j <= 9; j++){
            ans += a[i][j]*a[j][i];
        }
    }
    cout << ans << endl;
    return 0;
}


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

#define fi first
#define se second

typedef pair<int, int> pii;

const int MAXN = 1e5 + 5;
const int MOD = 1e9 + 7;

int mul(int a, int b) {
	return (long long) a * b % MOD;
}

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

int add(int a, int b) {
	a += b;
	if (a >= MOD) a -= MOD;
	return a;
}

int fastpow(int x, int y) {
	int ret = 1;
	while(y) {
		if (y&1) ret = mul(ret, x);
		x = mul(x, x);
		y /= 2;
	}
	return ret;
}

int sld[MAXN];
vector<int> divi[MAXN];

int main() {
	int n, k; scanf("%d%d", &n, &k);

	int ans = 0;
	for (int d = 1; d <= k; d++)
		for (int j = d; j <= k; j += d)
			divi[j].push_back(d);

	for (int d = k; d >= 1; d--) {
		int cur = fastpow(k/d, n);
		cur = sub(cur, sld[d]);
		ans = add(ans, mul(cur, d));

		for (int p : divi[d])
			sld[p] = add(sld[p], cur);
	}

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

Measured memory_bytes: 14544
#include <stdio.h>
int main () {
  double a, b, c, d, e, f, x, y;
  while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
    x=(b*f-e*c)/(b*d-a*e);
    y=(c-a*x)/b;
    if (x == -0) x = 0;
    if (y == -0) y = 0;
    printf("%.3f %.3f\n", x, y);
  }
  return 0;
}

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

using ll = int64_t;
#define int ll

#define FOR(i, a, b) for (int i = int(a); i < int(b); i++)
#define REP(i, b) FOR(i, 0, b)
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(x) x.begin(), x.end()

using pi = pair<int, int>;
using vi = vector<int>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  REP(i, (int)v.size()) {
    if (i) os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

ll read() {
  ll i;
  scanf("%" SCNd64, &i);
  return i;
}

void printSpace() { printf(" "); }

void printEoln() { printf("\n"); }

void print(ll x, int suc = 1) {
  printf("%" PRId64, x);
  if (suc == 1) printEoln();
  if (suc == 2) printSpace();
}

string readString() {
  static char buf[3341000];
  scanf("%s", buf);
  return string(buf);
}

char *readCharArray() {
  static char buf[3341000];
  static int bufUsed = 0;
  char *ret = buf + bufUsed;
  scanf("%s", ret);
  bufUsed += strlen(ret) + 1;
  return ret;
}

template <class T, class U>
void chmax(T &a, U b) {
  if (a < b) a = b;
}

template <class T, class U>
void chmin(T &a, U b) {
  if (b < a) a = b;
}

template <class T>
T Sq(const T &t) {
  return t * t;
}

signed main() {
  int N = read(), ans = 0, count;
  for (int i = 1; i <= N; i += 2) {
    count = 0;
    FOR(j, 1, i + 1) {
      if (i % j == 0) count++;
    }
    if (count == 8) ans++;
  }
  print(ans);
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
    int N;
    cin >> N;
    int dp[N+1];
    rep(i,N+1) dp[i] = INT_MAX;
    dp[0] = 0;
    for(int i=1;i<=N;i++){
        for(int j=1;j<=i;j*=6){
            dp[i] = min(dp[i],dp[i-j] + 1);
        }
        for(int j=1;j<=i;j*=9){
            dp[i] = min(dp[i],dp[i-j] + 1);
        }
    }

    cout << dp[N] << endl;

    return 0;
} 

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define log(x) cout<<x<<endl
#define pb push_back
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
using namespace std;
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; }
const long long INF = 1LL << 60;
using Graph=vector<vector<int>>;

int gcd(lint x, lint y){
  return y==0 ? x:gcd(y,x % y);
}

int digsum(int n) {
  int res = 0;
  while(n > 0) {
    res += n%10;
    n /= 10;
  }
  return res;
}

int dignum(int n) {
  int res = 0;
  while(n > 0) {
    res++;
    n /= 10;
  }
  return res;
}

int stringcount(string s, char c) {
  return count(s.cbegin(), s.cend(), c);
}

int lcm(lint x, lint y){
  return x/ gcd(x, y) * y;
}

int combi(int n, int r){
  int num = 1;
  for(int i = 1; i <= r; i++){
    num = num * (n - i + 1) / i;
  }
  return num;
}

int main(){
  lint n;
  cin>>n;
  map<lint,lint> d,t;
  rep(i,n){
    lint j;cin>>j;
    d[j]++;
  }
  lint m;
  cin>>m;
  bool is=true;
  rep(i,m){
    lint j;cin>>j;
    if(d[j]>0) d[j]--;
    else {
      is=false;
      break;
    }
  }
  if(is){
    cout<<"YES"<<endl;
  }
  else{
    cout<<"NO"<<endl;
  }

}

Measured memory_bytes: 12800
#include<stdio.h>
int main(void){
	int W, H, x, y, r;								//頂点の座標(W,H),円の中心の座標(x,y),半径
	scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);	//頂点の座標,円の中心の座標,半径を入力
	if((W >= x && H >= y) && (0 <= x && 0 <= y)){
		if(W >= (x + r) && H >= (y + r)){
			printf("Yes\n");
		}else{
			printf("No\n");
		}
	}else{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 584
n = int(input())
A = [0]
A.extend(list(map(int,input().split())))
B = {}
pair = 0

for i in range(1,n+1):
  if i+A[i] in B:
    B[i+A[i]] += 1
  else:
    B[i+A[i]] = 1
  
for j in range(2,n+1):
  if j-A[j] in B:
    pair += B[j-A[j]]

print(pair)

Measured memory_bytes: 40000
#include <bits/stdc++.h>
#define arep(a,i,n) for(int i=(a);i<(n);i++)
#define rep(i,n) for(int i=0;i<(n);i++)
#define cinf(x,n) for(int i=0;i<(n);i++)cin>>x[i];
#define coutf(x,n) for(int i=0;i<(n);i++)cout<<x[i]<<endl;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

using namespace std;

int i,j;
bool flagi,flagj;
int cnt;

int main(){
	ll n;
	cin >> n;
	string s;
	cin >> s;
	i = 0;
	j = n-1;
	while(i<j){
		if(s[i]=='R')
			i++;
		if(s[i]=='W')
			flagi=true;
		if(s[j]=='W')
			j--;
		if(s[j]=='R')
			flagj=true;
		if(flagj&&flagi){
			flagi=false;
			flagj=false;
			cnt++;
			i++;
			j--;
		}
	}
	cout << cnt << endl;
}


Measured memory_bytes: 3772
#include <stdio.h>
#include <cassert>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <functional>
using namespace std;
int main(void){
    // Your code here!
    int n;
    scanf("%d", &n);
    int w[n];
    int s=0;
    for(int i=0;i<n;i++){
        scanf("%d",&w[i]);
        s=s+w[i];
    }
    int min=s;
    for(int i=1;i<n;i++){
        int s1=0;
        for(int j=0;j<i;j++){
            s1=s1+w[j];
        }
        if(min>=abs(s-2*s1)){
            min=abs(s-2*s1);
        }
    }
    printf("%d",min);
}

Measured memory_bytes: 128
// lannisters don't act like fools
#include <bits/stdc++.h>

using namespace std;
#define yah_faster_baby ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MOD 1000000007







void solve() {
    int n;
    cin >> n;
    if (n >= 30)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}






int main() {
    yah_faster_baby
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output1.txt", "w", stdout);
#endif // ONLINE_JUDGE
    solve();
    return 0;
}

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

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

    int count = 0;
    for(int i = 0; i * 2 < N; i++){
        cin >> a;
        if(a % 2 != 0){
            count++;
        }
        cin >> a;
    }
    
    cout << count << endl;
}

Measured memory_bytes: 3580
n = int(input())
items = [input() for _ in range(n)]

counts = {}
for item in items:
  if item in counts.keys():
    counts[item] += 1
  else:
    counts[item] = 1

max_counts = max([item[1] for item in counts.items()])

rets = [item[0] for item in counts.items() if item[1] == max_counts]
rets = sorted(rets)
print('\n'.join(rets))
  

Measured memory_bytes: 37260
import sys
input = sys.stdin.readline
from collections import *
from bisect import *

def judge(x):
    aoki = N-x-bisect_left(A, 2*X-A[N-x])+1
    return x<=aoki
    
def binary_search():
    l, r = 1, N-bisect_left(A, X)
    
    while l<=r:
        m = (l+r)//2
        
        if judge(m):
            l = m+1
        else:
            r = m-1
    
    return r

N, Q = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
acc = [0]
acco = [0]

for i in range(N):
    acc.append(acc[-1]+A[i])
    
    if i%2==1:
        acco.append(acco[-1]+A[i])
    else:
        acco.append(acco[-1])

for _ in range(Q):
    X = int(input())
    x = binary_search()
    ans = acc[N]-acc[N-x]
    
    if N-2*x>0:
        if (N-2*x)%2==0:
            ans += acco[N-2*x]
        else:
            ans += acc[N-2*x]-acco[N-2*x]
        
    print(ans)

Measured memory_bytes: 102272
#include<stdio.h>
int main(){
  int a,b;
  scanf("%d %d",&a,&b);
  int c=b-a+1;
  int d=b+a-1;
  if(c<-1000000){
    c=-1000000;
  }
  if(d>1000000){
    d=1000000;
  }
  for(int i=c;i<=d;i++){
    printf("%d ",i);
  }
}

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

using namespace std;

typedef long long          ll;
typedef unsigned long long ull;
typedef vector<int>	       vi;
typedef vector<bool>       vb;
typedef map<int, int>      mii;
typedef pair<int, int>     ii;

#define INF                0x3f3f3f3f
#define INFLL              0x3f3f3f3f3f3f3f3f
#define each(x, s)         for(auto& x : s)
#define loop(x)	           for(int i = 0;i < x;i++)
#define vloop(v, x)        for(int v = 0;v < x;v++)
#define avg(l, r)          l + (r - l) / 2
#define iter(a)            a.begin(), a.end()
#define riter(a)           a.rbegin(), a.rend()
#define endl               "\n"

const ll mod = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

	int n;
	cin >> n;
	vi f(n + 1);
	for (int x = 1;x * x <= n;x++) {
		int sum = x * x;
		for (int y = 1;y * y <= n;y++) {
			int sum2 = sum + y * y + x * y;
			if (sum > n) break;
			for (int z = 1;z * z <= n;z++) {
				int sum3 = sum2 + z * z + x * z + y * z;
				if (sum3 <= n) f[sum3]++;
				else break;
			}
		}
	}
	for (int i = 1;i <= n;i++) cout << f[i] << endl;
	return 0;
}



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

int main() {
	int n , k;
	int ans = 0;

	cin >> n >> k;

	for (int i = 0; i < n; i++) {
		if (i == 0) {
			ans = k;
		} else {
			ans *= k - 1;
		}
	}

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

Measured memory_bytes: 256
N = int(input())
S = list(map(int,list(input().strip())))
cnt = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            cur = [i,j,k]
            ind = 0
            for n in range(N):
                if S[n]==cur[ind]:
                    ind += 1
                    if ind==3:
                        cnt += 1
                        break
print(cnt)

Measured memory_bytes: 42860
import java.util.Scanner;

public class Main {
	private static Scanner sc;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		System.out.println((a+b)*c/2);
	}

}


Measured memory_bytes: 8788
#include "stdio.h"


int main()
{
    
        int max, min, i, n, a[10000];
        long sum;

        sum = 0;

        scanf("%d", &n);

        for (i = 0; i<n; i++) {
            scanf("%d", &a[i]);
        }

        max = min = sum = a[0];

        for (i = 1; i<n; i++) {
            if (a[i]>max) { max = a[i]; }
            if (a[i]<min) { min = a[i]; }
            sum += a[i];
        }

        printf("%d %d %ld\n", min, max, sum);
    return 0;
}

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

int main()
{
    string s;
    cin >> s;
    int ans = 0;
    int l = 0, r = s.size()-1;
    while (l < r)
    {
        if (s[l] != s[r]) ans++;
        l++, r--;
    }
    
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
import java.io.InputStreamReader
import java.io.BufferedReader

fun main(args: Array<String>) {
  val br = BufferedReader(InputStreamReader(System.`in`))

  val ref = "abcdefghijklmnopqrstuvwxyz".toCharArray()
  val s = br.readLine().toSet()

  var ans = "None"
  for(i in ref.indices) {
    if(!s.contains(ref[i])) {
      ans = ref[i].toString()
      break
    }
  }

  println(ans)
}

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

using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;

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

constexpr llong mod = 1e9+7;
constexpr llong inf = mod * mod;

int main() {
  llong N;
  vector<llong> A;

  cin >> N;
  A.resize(N);
  for (auto &in: A) {
    cin >> in;
  }

  vector<llong> money(N + 1);
  vector<lpair> stock(N + 1);
  money[0] = 1000;
  stock[0] = lpair(0, 1000);
  for (int i = 0; i < N; ++i) {
    money[i + 1] = max(money[i], stock[i].second + stock[i].first * A[i]);
    stock[i + 1] = max({stock[i], lpair(stock[i].first + stock[i].second / A[i], stock[i].second % A[i]),
                        lpair(money[i] / A[i], money[i] % A[i])});
  }

  cout << money[N] << endl;

  return 0;
}

/*

金の最大
株の最大

*/

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

int N;
int a[100000];
int t[3];

int main() {
    cin >> N;
    int cnt;
    for(int i = 0; i < N; i++) cin >> a[i];

    for(int i = 0; i < N; i++){
        cnt = 0;
        while(a[i]%2 == 0){
            a[i] /= 2;
            cnt++;
            if(cnt > 1) break;
        }
        t[cnt]++;
    }
    if(t[1] != 0){
        cout << (t[0] <= t[2] ? "Yes":"No");
    }else{
        cout << (t[0] <= t[2]+1 ? "Yes":"No");
    }
    return 0;
}

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

#define pb push_back

const int N = 1e5+5;

vector<int> adj[N];
int n , m , mx , val[N] , vis[N];

void dfs(int u){
  vis[u] = 1;
  int valor = val[u];
  for(int i = 0 ; i < adj[u].size() ; i++){
    if(vis[adj[u][i]] == 0) dfs(adj[u][i]);
    val[u] = max(val[u],valor+val[adj[u][i]]);
  }
}

main(){
  cin >> n >> m;
  for(int i = 1 ; i <= n ; i++) val[i] = 1;
  for(int i = 0 ; i < m ; i++){int x , y; cin >> x >> y; adj[x].pb(y);}
  for(int i = 1 ; i <= n ; i++)
    if(vis[i] == 0) dfs(i);
  for(int i = 1 ; i <= n ; i++)mx = max(mx,val[i]);
  cout << mx-1 << "\n";
}


Measured memory_bytes: 8576