akhauriyash/Code-Regression huggingface dataset:
/*
				C++
				encoding: UTF-8
				Modified: <07/Sep/2019 05:37:17 PM>

				✪ H4WK3yE乡
				Mohd. Farhan Tahir
				Indian Institute Of Information Technology (IIIT), Gwalior
*/

#include <bits/stdc++.h>
#ifdef LOCAL_PROJECT
#	include <prettypr.hpp>
#endif

using namespace std;

// clang-format off

#define         ll                     long long
#define         ve                     vector
#define         pb                     push_back
#define         endl                   "\n";
#define         ff                     first
#define         ss                     second
#define         pii                    pair<int, int>
#define         len(v)                 int(v.size())
#define         all(v)                 v.begin(), v.end()
#define         reset(a, b)            memset(a, b, sizeof(a));
#define         fr(i, s, n)            for (int i = s ; i < n ; ++i)
#define         dfr(i, s, n)           for (int i = s ; i > n ; --i)

void pr () {
    cout << "\n";
}

template < typename T, typename... ARGS > void pr (const T& t, ARGS... args) {
    cout << t << " ";
    pr (args...);
}

// clang-format on

signed main () {
	ios_base::sync_with_stdio (false), cin.tie (nullptr);
	int n;
	cin >> n;
	int a[n + 1], b[n + 1], c[n + 1];
	a[0] = b[0] = c[0] = c[1] = 0;
	fr (i, 1, n + 1) cin >> a[i];
	fr (i, 1, n + 1) cin >> b[i];
	fr (i, 2, n + 1) cin >> c[i];

	int ans = 0;
	int prv = -1;
	fr (i, 1, n + 1) {
		int dish = a[i];
		ans += b[dish];
		if (dish == 1 + prv) {
			ans += c[dish];
		}
		prv = dish;
	}
	pr (ans);
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<sstream>
#include<string>
#include<vector>
#include <cmath>
#include <limits>
#include <queue>
#include<algorithm>
 
using namespace std;
 
#define rep(i,n) for (int (i)=0;(i)<(n);i++)
 
int main(){
    string s;
    cin >> s;
    rep(i,s.length()){
        cout << "x";
    }
 
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define ll long long
#define ull unsigned ll
#define all(x) x.begin(), x.end()


typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag,
        tree_order_statistics_node_update>
        ordered_set;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<int, int> pi;
const int N = 1e7 + 10, X = 1e6 + 100;
const ll M = 1e9 + 7;
const double eps = 1e-9;

ll ans[N];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin >> n;
    ll ans = 0;
    for (int i = 1; i <= n; ++i) {
        ll d = (ll) floor(log10(i)) + 1;
        if (d % 2 == 1)
            ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N = 1e5 + 5;

int32_t main()
{
	IOS;
	int n;
	cin >> n;
	int mx = 0;
	map<string, int> m;
	for(int i = 1; i <= n; i++)
	{
		string s;
		cin >> s;
		m[s]++;
		mx = max(mx, m[s]);
	}	
	for(auto &it:m)
		if(it.second == mx)
			cout << it.first << endl;
	return 0;
}

Measured memory_bytes: 23808
#include<stdio.h>
#include<stdlib.h>

int main(void){
  int i;
  int ans=0;
  int A,B;
  int *H;
  int *chk;
  int N,M;
  
  scanf("%d %d",&N,&M);
  H = malloc(sizeof(int)*(N+1));
  chk = calloc(sizeof(int),N+1);
  
  for(i=1; i<=N; i++)
    scanf("%d",&H[i]);
  
  for(i=1; i<=M; i++){
    scanf("%d %d",&A,&B);
    if(H[A]<=H[B])
      chk[A]=1;
    if(H[A]>=H[B])
      chk[B]=1;
  }
  
  for(i=1; i<=N; i++)
    if(chk[i]==0)
      ans++;
  printf("%d",ans);
  free(chk);
  free(H);
  return 0;
}


Measured memory_bytes: 2248
#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
using f80 = __float80;
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
static const int dy[4] = {0,1,0,-1}, dx[4] = {1,0,-1,0};
#define _overload3(_1,_2,_3,name,...) name
#define repi(i,start,end) for(i64 i=(start);i<(end);++i)
#define _rep(i,n) repi(i,0,n)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(i,start,end) for(i64 i=(start);i>end;--i)
#define pb push_back
#define rng(a) a.begin(),a.end()
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define sz(x) (i64)(x).size()
#define bit(n) (1LL<<(n))
#define fi first
#define se second
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define v(T) vector<T>
#define vv(T) v(v(T))
typedef v(i64) vi;
typedef v(vi) vvi;
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;}

i64 pow_mod(i64 n, i64 k, i64 m){
  i64 r = 1;
  for(;k;k>>=1){
    if(k&1) r=(r*n)%m;
    n=(n*n)%m;
  }
  return r;
}

struct uf{
  private:
    vi par, rank, size;
  public:
    uf(i64 n){ init(n); }
    void init(i64 n){
      par.resize(n);
      rank.resize(n,0);
      size.resize(n,1);
      rep(i,n) par[i] = i;
    }
    i64 root(i64 x){
      if(par[x] == x) return x;
      return par[x] = root(par[x]);
    }
    bool same(i64 x, i64 y){ return root(x) == root(y); }
    void unite(i64 x, i64 y){
      x = root(x), y = root(y);
      if(x==y) return;
      if(rank[x]==rank[y]) rank[x]++;
      if(rank[x]<rank[y]) swap(x,y);
      par[y] = x;
      size[x] += size[y];
    }
    i64 num(i64 x){ return size[root(x)]; }
};

void Main()
{
  i64 N,A,B;
  cin >> N >> A >> B;

  i64 t = N / (A+B);
  i64 s = N % (A+B);

  i64 ans = t * A;
  if(s<=A) ans += s;
  else ans += A;

  cout << ans << endl;

}

int main()
{
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	int n;cin>>n;
	vector<ll> a(n);
	bool flag = false;
	for(int i = 0; i < n; i++) {
		cin>>a[i];
		if (a[i] % 2 == 0)continue;
		else{
			flag = true;
		}
	}
	if(flag){
		cout << "first" << endl;
		return 0;
	}
	cout << "second" << endl;
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define int long long
#define FLASH cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false);
#define FILEIO freopen("/home/aman/Desktop/Kachda/input.txt", "r", stdin); //freopen("/home/aman/Desktop/Kachda/output.txt", "w", stdout);
using namespace std;


signed main()
{
    FLASH

    int n, x;
    vector <bool> in(101, 0);
    cin>>x>>n;
    for(int i = 1; i <= n; i++){
        int a;
        cin>>a;
        in[a] = 1;
    }

    int ans = 1001;
    for(int i = 0; i <= 101; i++){
        if(in[i]) continue;
        if(abs(ans - x) > abs(x - i)){
            ans = i;
        }
    }
    cout<<ans<<'\n';
}

Measured memory_bytes: 3656
from math import sqrt
def gcd(a,b):
  if a<b:
    a,b=b,a
  if b==0:
    return a
  else:
    return gcd(b,a%b)
a,b=map(int,input().split())
n=gcd(a,b)
#print(n)
ans=1
r=int(sqrt(n)+1)
#print(r)
for i in range(2,r):
  # print(i)
  if n%i==0:
    cnt=0
    while n%i==0:
      #print(n,end=" inside \n")
      n//=i
      cnt=1
    if cnt:
      ans+=1

if n>1:
  ans+=1
#print(n)
print(ans)



Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF2 1000000000000000
#define INF 2000000000
#define int long long int

int V, E, R;
int r[210];
int d[210][210];

void warshall_floyd() {
    for (int k = 1; k <= V; k++) {
        for (int i = 1; i <= V; i++) {
            for (int j = 1; j <= V; j++) {
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
            }
        }
    }
}
signed main(void)
{
    cin >> V >> E >> R;
    for (int i = 0; i < 210; i++) {
        for (int j = 0; j < 210; j++) {
            if(i != j){
                d[i][j] = INF;
            } else {
                d[i][j] = 0;
            }
        }
    }
    rep(i, R) cin >> r[i];
    sort(r, r+R);
    rep(i ,E){
        int s, t, c;
        cin >> s >> t >> c;
        d[s][t] = c; d[t][s] = c;
    }
    int m = INF2;
    warshall_floyd();
    do { 
        int tmp = 0;
        for (int i = 0; i < R-1; i++) {
            tmp += d[r[i]][r[i+1]];
        }
        m = min(m,tmp);
    } while( next_permutation(r, r+R) );    

    cout << m << endl;
    return 0;
}

Measured memory_bytes: 640
#include <stdio.h>
#include <string>
#include <algorithm>
#include <map>
#include <iostream>
using namespace std;

int main() {
	int A, B, C, X, Y;
	cin >> A >> B >> C >> X >> Y;
	int ans = 0;
	ans += min(X,Y)*min(A+B, 2 * C);
	if (X > Y)ans += min(A, 2 * C)*(X - Y);
	else ans += min(B, 2 * C)*(Y - X);
	cout << ans << endl;

}


Measured memory_bytes: 256
using System;
class ProgramC
    {
        static void Main(string[] args)
        {
            
            //入力
            string input = Console.ReadLine();
            int n = int.Parse(input);
            int[] x = new int[n];
            int[] y = new int[n];

            for(int i = 0;i < n;i++)
            {
                string[] input_2 = Console.ReadLine().Split();
                x[i] = int.Parse(input_2[0]);
                y[i] = int.Parse(input_2[1]);
            }

            double ans = 0;

            for(int i = 0;i < n;i++)
                for(int j = i + 1;j < n ;j++)
                {
                    ans += Math.Sqrt((x[i] -  x[j]) * (x[i] -  x[j]) + (y[i] -  y[j]) * (y[i] -  y[j]));
                }

            //答え出力
            Console.WriteLine(ans * 2.0 /(double)(n));
                
        }
    }

Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
int n,a[100005],s[100005];
char c[100005];
int main(){
	scanf("%s",c+1);
	int n=strlen(c+1);
	for(int i=1;i<n;++i){
		if(c[i]=='R'&&c[i+1]=='L'){
			s[i]++;
			s[i+1]++;
			int z=i-1,k=1;
			while(c[z]=='R'){
				s[i+k]++;
				k=!k;z--;
			}
			k=0;z=i+2;
			while(c[z]=='L'){
				s[i+k]++;
				k=!k;z++;
			}
		}
	}
	for(int i=1;i<=n;++i)printf("%d ",s[i]);
}

Measured memory_bytes: 896
from heapq import *
from numpy import array,inf


def djikstra(G,s):
    que = []
    d = [inf]*V
    d[s] = 0
    visited = [False] * V
    heappush(que,(0,s))
    while(len(que)!=0):
        p = heappop(que)
        v = p[1]
        if visited[v]:
            continue
        visited[v] = True
        for i in range(len(G[v])):
            e = G[v][i]
            if visited[e[0]]:
                continue
            if d[e[0]] > d[v] + e[1]:
                d[e[0]] = d[v] + e[1]
                heappush(que,(d[e[0]],e[0]))
    return d


n,m,s,t = map(int,input().split())
V = n
Ga = [[] for i in range(n)]
Gb = [[] for i in range(n)]
for i in range(m):
    u,v,a,b = map(int,input().split())
    Ga[u-1].append((v-1,a))
    Ga[v-1].append((u-1,a))
    Gb[u-1].append((v-1,b))
    Gb[v-1].append((u-1,b))

S = djikstra(Ga,s-1)

T = djikstra(Gb,t-1)

M = 10**15-(array(S)+array(T))
ans = [0]*n
ans[n-1] = M[n-1]
for i in range(n-2,-1,-1):
    ans[i] = max(ans[i+1],M[i])

for i in range(n):
    print(ans[i])


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

// clang-format on
int main() {
  int H, W;
  string s[100], ans[200];
  cin >> H >> W;
  rep(i, H) { cin >> s[i]; }
  rep(i, W + 2) {
    ans[0] += '#';
    ans[H + 1] += '#';
  }
  rep(i, H) { ans[i + 1] = '#' + s[i] + '#'; }
  rep(i, H + 2) { cout << ans[i] << endl; }
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
using namespace std;
typedef long long ll;

int main(void) {
  ll i, j, k, n, m, now, ans = 0, mi = 0, ma = 200001, sum, tmp, cnt = 0;
  scanf("%lld%lld", &n, &m);
  ll a[n];
  for(i = 0; i < n; ++i) scanf("%lld", &a[i]);
  sort(a, a + n);
  while(mi != ma - 1) {
    now = (mi + ma) / 2;
    sum = 0;
    for(i = 0; i < n; ++i) {
      tmp = lower_bound(a, a + n, now - a[i]) - a;
      if(tmp < i) tmp = i;
      if(tmp == i) sum++, tmp++;
      sum += (n - tmp) * 2;
    }
    if(sum < m) ma = now;
    else mi = now;
  }
  for(i = 0; i < n; ++i) {
    tmp = lower_bound(a, a + n, mi - a[i]) - a;
    ans += 2 * (n - tmp) * a[i];
    cnt += n - tmp;
  }
  printf("%lld", ans - (cnt - m) * mi);
  return 0;
}

Measured memory_bytes: 896
#include<stdio.h>

int main(){
	
	int ntc;
	
	int jumlah = 0;
	
	scanf("%d",&ntc);
	
	for(int i=1;i<=ntc;i++){
		
		jumlah+=i;			
		
	}
	
	printf("%d\n",jumlah);

	return 0;
}

Measured memory_bytes: 128
use std::io;
use std::str::FromStr;

fn input_vec() -> Vec<u64> {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.split_whitespace().map(|s| s.parse().unwrap()).collect()
}

fn input_tuple() -> (u64, u64, u64, u64) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<u64> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1], vec[2], vec[3])
}

fn main() {
    let (n, m, v, p) = input_tuple();
    let mut p_vec = input_vec();
    p_vec.sort_by(|a, b| b.cmp(&a));
    // println!("{:?}", p_vec);

    let mut scores: Vec<u64> = Vec::new();
    let mut orders: Vec<u64> = Vec::new();
    orders.push(0);
    scores.push(p_vec[0]);
    let mut pre = p_vec[0];
    let mut idx = 0usize;
    for p in p_vec {
        if p != pre {
            idx += 1;
            orders.push(1);
            scores.push(p);
        } else {
            orders[idx] += 1;            
        }
        pre = p;
    }
    // println!("orders = {:?}", orders);
    // println!("scores = {:?}", scores);

    let mut sum = 0;
    let mut count = 0;
    let mut border = 0usize;
    for i in 0..orders.len() {
        count += orders[i];
        if count >= p {
            // println!("border = {}", i);
            // println!("count = {}", count);
            border = i;
            break;
        }
    }

    let mut exclude = orders[border];
    let mut excluded_scores = scores[border] * orders[border];
    for i in (border+1)..orders.len() {
        if scores[border] - scores[i] <= m {
            // println!("i = {}", i);
            // 票を分散させる
            let voted_score = scores[i] + m;
            // println!("voted = {}", voted_score);
            
            let left_score = voted_score * exclude - excluded_scores;
            // println!("left_score = {}", left_score);

            let mut left_vote = 0;
            if v < n - exclude {
                left_vote = 0;
            } else {
                left_vote = v * m - (n - exclude) * m
            }
            // println!("left_vote = {}", left_vote);
            if left_vote <= left_score {
                count += orders[i];
                exclude += orders[i];
                excluded_scores += scores[i] * orders[i];
            } else {
                break;
            }
        } else {
            break;
        }
    }
    println!("{}", count);
}


Measured memory_bytes: 8444
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include "bits/stdc++.h"

#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
//#define int long long

using namespace std;

#define dump(x)  cout << #x << " = " << (x) << endl
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

typedef long long ll;

const ll MOD = 1e9 + 7;

class C {
    ll getSum(string const & s, int const l) const {
        if (l == s.size()) return 0;
        ll sum = 0;
        rep(i,l,s.size()) {
            // [l,i]
            sum += stoll(s.substr(l,i-l+1)) * max<ll>((ll)pow(2, s.size()-i-2),1);
            sum += getSum(s,i+1);
        }
        return sum;
    }

public:
    void solve(std::istream& in, std::ostream& out) {
        string S;
        in >> S;
        out << getSum(S, 0) << endl;
    }
};


signed main() {
    C solver;
    std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

using namespace std;

int main(){
    int A,B,K;
    cin >> A >> B >> K;
    int C;
    vector<int> divisor; 
    if(A > B){
        C = B;
    }else{
        C = A;
    }
    for(int i = C;i > 0;i--){
        if(A % i == 0 && B % i == 0){
            divisor.push_back(i);
        }
    }
    cout << divisor.at(K-1) << endl;
}

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

int main(){
    using namespace std;
    constexpr unsigned long MOD = 1000000007;
    unsigned long N, K;
    cin >> N >> K;
    const auto& modpow = [](unsigned long a, unsigned long n, unsigned long b = 1) -> unsigned long {
        unsigned long r{b % MOD};
        while(n){
            if(n & 1)(r *= a) %= MOD;
            (a *= a) %= MOD;
            n >>= 1;
        }
        return r;
    };
    vector<unsigned long> v(K + 1);
    for(unsigned long i{K}; i > 0; ){
        auto t = K / i;
        auto j = K / (t + 1);
        fill(v.begin() + j + 1, v.begin() + i + 1, modpow(t, N));
        i = j;
    }
    vector sieve(K + 1, 1UL);
    for(unsigned long p{2}; p <= K; ++p)if(sieve[p])for(unsigned long k{1}; k * p <= K; ++k){
        sieve[k * p] = 0;
        (v[k] += MOD - v[k * p]) %= MOD;
    }
    unsigned long ans{0};
    for(unsigned long i{0}; i <= K; ++i)ans += i * v[i];
    cout << ans % MOD << endl;
    return 0;
}

Measured memory_bytes: 4844
#include<iostream>
using namespace std;
int main() {
	int n, m, X, Y;
	int x;
	int y;
	cin >> n;
	cin >> m;
	cin >> X;
	cin >> Y;
	for (int i = 0;i < n;i++) {
		cin >> x;
		if (X < x) {
			X = x;
		}
	}
	for (int i = 0;i < m;i++) {
		cin >> y;
		if (y < Y) {
			Y = y;
		}
	}
	if (X < Y) {
		cout << "No War" << endl;
	}
	else {
		cout << "War" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
def to_k_base_num(n,k):
    bi = ""
    while n != 0:
        bi += str(n%abs(k))
        if k < 0:
            n = -(-n//k)
        else:
            n //= k
    return bi[::-1]

def main():
    N,K = map(int,input().split())
    print(len(str(to_k_base_num(N,K))))

if __name__ == '__main__':
    main()

Measured memory_bytes: 38256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<iostream>
using namespace std;

typedef long long LL;

int main(){
	LL a,b;
	scanf("%lld %lld",&a,&b);
	LL i=2;
	LL ans=0;
	while(a<=b){
		a*=i;
		ans++;
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")

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

using ll = long long;
using ull = unsigned long long;
using namespace std;

int main() {
  int K, X;
  cin >> K >> X;
  if (500 * K >= X) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


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

int main(void){
    int N;
    cin >> N;
    vector<pair<int,int>> section;
    rep(i,N){
        int x,l;
        cin >> x >> l;
        section.emplace_back(x+l, x-l);
    }
    sort(section.begin(),section.end());
    int ans = 0;
    int left_limit = -INT_MAX;
    rep(i,N){
        if(left_limit > section[i].second)continue;
        ans++;
        left_limit = section[i].first;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1400
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using vc = vector<char>;
using pll = pair<ll, ll>;
template<class T> void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T> void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
template<class T, class U> bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U> bool isin(T el, U container) { return find(all(container), el) != container.end(); }
template<class T> bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<class T> bool even(T n) { return ! (n & 1); }
template<class T> bool odd(T n) { return n & 1; }
template<class T> ll rup(T a, T b) { return a % b ? a / b + 1 : a / b; }
template<class T> ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T> ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;
ll intpow(ll a, ll n, ll _mod=numeric_limits<ll>::max()) { ll p=1; while (n) { if (n&1) p=p*a%_mod; a=a*a%_mod; n>>=1; } return p; } 
ll modc(ll a, char op, ll b, ll _mod=mod) { a %= _mod; b %= _mod; ll res = 1; switch(op) {
        case '+': res = (a + b) % _mod; break;
        case '-': res = (a - b) % _mod; break;
        case '*': res = a * b % _mod; break;
        case '/': res = modc(a, '*', modc(b, '^', _mod-2, _mod), _mod); break;
        case '^': res = intpow(a, b, _mod); break;
        case 'P': rep(i, a-b+1, a+1) res = modc(res, '*', i, _mod); break;
        case 'C': res = modc(modc(a, 'P', b, _mod), '/', modc(b, 'P', b, _mod)); break; } if (res < 0) res += _mod; return res; }


int main()
{
        ll N, K;
        cin >> N >> K;
        cout << N - K +1 << endl;
}


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


using namespace std;
int main()
{

int a,b,c;

cin>>a>>b>>c;

int max,min;

if(a>=b&&a>=c){
    max=a;
}
else if(b>=a&&b>=c){
    max = b;
}
else max=c;

if(a<=b&&a<=c){
    min=a;
}
else if(b<=a&&b<=c){
   min = b;
}
else min=c;

cout<<max-min<<endl;



    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
ll n,k;
cin>>n>>k;
ll ca=0;
ll q=0,w=0;
if(k%2==0){
q = k/2;
q = q*(k+1);
q%=MOD;
w = k/2;
w = w*(k-1);
w%=MOD;}
else{
q = (k+1)/2;
q = q*k;
q%=MOD;
w = (k-1)/2;
w = w*k;
w%=MOD;}
ll a[n]={},b[2005]={},c[n]={},d[n]={};
rep(i,n){
cin>>a[i];
b[a[i]]++;}
rep(i,n){
rep(k,n){
if(a[i]>a[k]){
if(i<k){
c[i]++;}
else{d[i]++;}
}
}}

for(ll i=0; i<n; i++){
if(k%2==0){
ca += q*c[i];
ca%=MOD;
ca += w*d[i];
ca%=MOD;
}
else{
ca += q*c[i];
ca%=MOD;
ca += w*d[i];
ca%=MOD;
}
}
cout << ca << endl;}


Measured memory_bytes: 3680
//#include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;


#include "boost/multiprecision/cpp_int.hpp"
#include "boost/multiprecision/cpp_dec_float.hpp"
namespace mp = boost::multiprecision;
typedef mp::cpp_int LL;
typedef mp::number<mp::cpp_dec_float<1024>> DD;// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)


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;
typedef pair<dd,dd> d_d;
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;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
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;
}

void mod_print(ll k){
    ll P=1000;
    rep(y,1,P){
        ll x=mod(y*k);
        if(x+P>=i_7){
            x-=i_7;
        }
        if(abs(x)<=P){
            cout<<x<<"/"<<y<<endl;
            return;
        }
    }
    cout<<"nun"<<endl;
}
#define all(c) c.begin(),c.end()
//////////////////////////





int main(){fastio
    ll n,k;cin>>n>>k;
    ll a[n];
    rep(i,0,n-1){
        cin>>a[i];
        a[i]=(a[i]-1)%k;
    }
    vector<l_l> s(n+1);
    s[0]={0,0};
    rep(i,1,n){
        s[i]={(s[i-1].fi+a[i-1])%k,i};
    }
    /*
    rep(i,0,n-1)cout<<a[i]<<" ";cout<<endl;
    rep(i,0,n)cout<<s[i]<<" ";cout<<endl;
    */
    sort(all(s));
    ll ans=0;
    ll r=0;
    rep(i,0,n){
        if(i==0||s[i].fi!=s[i-1].fi){
            r=i;
        }
        while(r<=n&&s[i].fi==s[r].fi&&s[r].se<s[i].se+k){
            r++;
        }
        ans+=r-i-1;
    }
    cout<<ans<<endl;
    
    return 0;
}



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

#define REP(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define ALL(c) c.begin(), c.end()
#define SZ(c) (int) c.size()
#define DBG1(x) cout<<#x<<" = "<<x<<"\n"
#if USE_CP_REDIR
#define CP \
    freopen("input.txt","r", stdin); \
    freopen("output.txt","w", stdout);
#endif

using ll = long long;
const ll MOD = 1'000'000'007;
const int MN = 1'000'000;

int main()
{
ios::sync_with_stdio(false);
#ifdef CP
    CP;
#endif
    int x;
    cin >> x;
    cout << 1 - x << endl;
}

Measured memory_bytes: 3600
#include <iostream>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <algorithm>

typedef long long ll;

using namespace std;

bool isPalindrome(string s) {
    bool palindrome = true;
    int n = s.length();
    for (int i = 0; i < n; i++) {
        if (s[i]  != s[n - i - 1]) {
            palindrome = false;
        }
    }
    return palindrome;
}

int main() {
    string S;
    cin >> S;
    int N = S.length();
    string Sa = S.substr(0, (N - 1) / 2);
    string Sb = S.substr((N + 3) / 2 - 1, N);
    if (isPalindrome(S) && isPalindrome(Sa) && isPalindrome(Sb)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}



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

int main()
{
    char S[12],i;
    scanf(" %[^\n]",S);
    for(i=0;i<strlen(S);i++){
        S[0]='2';
        S[1]='0';
        S[2]='1';
        S[3]='8';
    }
    printf("%s",S);




    return 0;
}

Measured memory_bytes: 128
#include <stdio.h>

int main(){
	int N, Q;
	int M, data;
	int canAttend[100];
	int i,j;
	int maxMember,maxMemberdata;
	while(1){
		//int canAttend[100]={0,};
		scanf("%d%d",&N,&Q);if(N==0&&Q==0) break;
		maxMember=Q-1;
		maxMemberdata=0;
		for(j=0;j<100;j++) canAttend[j]=0;
		for(i=0;i<N;i++){
			scanf("%d", &M);
			for(j=0;j<M;j++){
				scanf("%d", &data);
				canAttend[data]=canAttend[data]+1;
			}
		}
		for(i=0;i<100;i++){
			if(canAttend[i]>maxMember){
				maxMember=canAttend[i];
				maxMemberdata=i;
			}
		}
		printf("%d\n",maxMemberdata);
	}
	return 0;
}

Measured memory_bytes: 600
while 1:
    word = list(input().split())
    a = int( word[0] )
    op = word[1]
    b = int( word[2] )
    if op == "?":
        break
    elif op == "+":
        print ( a + b )
    elif op =="-":
        print( a - b )
    elif op == "*":
        print( a * b )
    elif op == "/":
        print( a // b )



Measured memory_bytes: 5592
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <valarray>
#include <unordered_map>
#include <unordered_set>
#include <vector>
// namespace
using namespace std;
// type
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll, ll>;
// input
#define INIT              ({ ios::sync_with_stdio(false); cin.tie(0); })
#define VAR(type, ...)    type __VA_ARGS__; var_scan(__VA_ARGS__);
template<typename T>
static void var_scan(T& t)
{
    cin >> t;
}
template<typename T, typename... R>
static void var_scan(T& t, R&... rest)
{
    cin >> t;
    var_scan(rest...);
}
// output
#define OUT(var)          cout << (var)
#define SPC               cout << ' '
#define TAB               cout << '\t'
#define BR                cout << '\n'
#define ENDL              cout << endl
#define FLUSH             cout << flush
// debug
#ifdef DEBUG
#define EPRINTF(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__)
#define DUMP(var)         cerr << #var << '\t' << (var) << '\n'
#define DUMPITERABLE(i) do {                            \
        cerr << #i << '\t';                             \
        for (const auto& it : i) { cerr << it << ' '; } \
        cerr << '\n';                                   \
} while (0)
#define DUMPITERABLE2(i2) do {                          \
        cerr << #i2 << '\t';                            \
        for (const auto& it : i2) {                     \
            for (const auto& it2: it) {                 \
                cerr << it2 << ' ';                     \
            }                                           \
        }                                               \
        cerr << '\n';                                   \
} while (0)
#else
#define EPRINTF(fmt, ...)
#define DUMP(var)
#define DUMPITERABLE(i)
#define DUMPITERABLE2(i)
#endif
// util
// [l, r)
#define REP(i, n)       for (int i = 0; i < (n); i++)
#define RREP(i, n)      for (int i = (n)-1; i >= 0; i--)
#define FOR(i, l, r)    for (int i = (l); i < (r); i++)
#define RFOR(i, r, l)   for (int i = (r)-1; i >= (l); i--)
#define REPLL(i, n)     for (ll i = 0; i < (n); i++)
#define RREPLL(i, n)    for (ll i = (n)-1; i >= 0; i--)
#define FORLL(i, l, r)  for (ll i = (l); i < (r); i++)
#define RFORLL(i, r, l) for (ll i = (r)-1; i >= (l); i--)

int main(void)
{
    INIT;
    VAR(int, n);
    ll sum=0;
    FOR(i, 1, n) {
        for (int j = 1; j*j <= i; j++) {
            if (i % j == 0) {
                sum++;
                if (j * j != i)
                    sum++;
            }
        }
    }
    OUT(sum);
    ENDL;
    return 0;
}


Measured memory_bytes: 3644
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <numeric>
#include <cmath>

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

int mx8[] = {0,0,1,-1,-1,1,-1,1};
int my8[] = {-1,1,0,0,-1,-1,1,1};
int mx4[] = {1,-1,0,0};
int my4[] = {0,0,-1,1};
const int MOD = 1000000007;

class UnionFind {
public:
    vector<int> RANK;
    vector<int> par;

public:
    UnionFind(int n)
    {
        RANK.resize(n);
        par.resize(n);
        rep(i, n) par[i] = i;
    }

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

    bool IsSame(int x, int y)
    {
        return FindRoot(x) == FindRoot(y);
    }

    void Union(int x, int y)
    {
        x = FindRoot(x);
        y = FindRoot(y);
        if (x == y) return;
        else {
            if(RANK[x] > RANK[y]){
                par[y] = x;
            }
            else{
                par[x] = y;
                if(RANK[x] == RANK[y]){
                    RANK[x]++;
                }
            }
        }
    }
};

int main(){
    int n,m;
    cin >> n >> m;
    UnionFind uf(n);

    rep(i,m){
        int a,b;
        cin >> a >> b;
        a--; b--;
        uf.Union(a,b);
    }
    int ans = 0;
    vector<int> t(n);
    rep(i,n){
        int v = uf.FindRoot(i);
        t[v]++;
    }
    rep(i,n) {
        ans = max(ans,t[i]);
        //cout << uf.par[i] << endl;
    }
    cout << ans << endl;

}

Measured memory_bytes: 11824
a = "keyence"
S = input().strip()
N = len(S)
flag = 0
for i in range(N):
    if flag==0 and i<len(a) and S[i]==a[i]:continue
    elif flag==0 and i<len(a) and S[i]!=a[i]:
        flag = 1
        cur = i
        break
if flag==0:
    print("YES")
else:
    if S[-(7-cur):]==a[cur:]:
        print("YES")
    else:
        print("NO")

Measured memory_bytes: 38384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef priority_queue<string, vector<string>, less<string> > QUE_string;
typedef priority_queue<double, vector<double>, less<double> > QUE_double;
typedef priority_queue<char, vector<char>, less<char> > QUE_char;
typedef priority_queue<int, vector<int>, less<int> > QUE_int;
const int MAX = pow(10, 5)+1;//+1しないとREになる(out of rangeになるんかな?? )
int main(){
  ll K, X;
  cin >> K >> X;
  string ans;
  if(K*500 >= X) ans = "Yes";
  else ans = "No";
  cout<< ans << endl;

}




Measured memory_bytes: 256
from operator import itemgetter

N = int(input())
entry = list(map(int, input().split()))

result =[]
for i in range(len(entry)):
    result.append([i+1, entry[i]])
result2 = sorted(result, key=itemgetter(1))
    
for i in range(len(result)):
    print(result2[i][0], " ", end="")

Measured memory_bytes: 23540
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}

int main() {
    ll x, y;
    cin >> x >> y;
    ll ret = 0;
    if (x > 0 && y > 0) {
        ret += abs(y - x);
        if (y < x) {
            ret += 2;
        }
    } else if (x < 0 && y < 0) {
        ret += abs(y - x);
        if (y < x) {
            ret += 2;
        }
    } else if (x < 0 && y > 0) {
        ret += 1 + abs(y + x);
    } else if (x > 0 && y < 0) {
        ret += 1 + abs(y + x);
    } else if (x == 0) {
        ret += abs(y);
        if (y < 0)
            ret++;
    } else if (y == 0) {
        ret += abs(x);
        if (x > 0)
            ret++;
    }

    cout << ret << "\n";
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long X = scan.nextLong();
		long cash = 100;
		int year = 0;

		while(cash < X) {
			cash = (long) Math.floor(cash * 1.01);
			year++;
		}

		System.out.println(year);
		scan.close();
	}
}


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

int main(){
	int a,b;
	bool f1,f2=true;
	
	while(1){
		f1=false;
		cin>>a>>b;
		if(a==0&&b==0)break;
		f2?f2=false:cout<<endl;
		for(int i=a;i<=b;i++){
			if(i%4==0){
				if(i%100==0){
					if(i%400==0){
						cout<<i<<endl;
						f1=true;
					}
				}
				else
				{
					cout << i << endl;
					f1=true;
				}
			}
		}
		f1?f1:cout <<"NA" << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;

bool dfs(const vector<vector<pair<int64_t, int64_t>>>& links,
         vector<bool>& visited, vector<bool>& used,
         vector<pair<int64_t, int64_t>>& out, int64_t current) {
    if (visited[current]) {
        return true;
    }

    visited[current] = true;

    int64_t c = 0;
    for (auto kv : links[current]) {
        auto next = kv.first;
        auto idx = kv.second;
        if (used[idx]) {
            continue;
        }

        used[idx] = true;
        if (dfs(links, visited, used, out, next)) {
            ++c;
            out.emplace_back(current, next);
        } else {
            out.emplace_back(next, current);
        }
    }

    return c % 2 == 0;
}

main() {
    int64_t n, m;
    cin >> n >> m;

    if (m % 2 > 0) {
        cout << -1 << endl;
        return 0;
    }

    vector<vector<pair<int64_t, int64_t>>> links(n);
    for (auto i : irange(0L, m)) {
        int64_t a, b;
        cin >> a >> b;
        --a;
        --b;
        links[a].emplace_back(b, i);
        links[b].emplace_back(a, i);
    }

    vector<bool> visited(n), used(m);
    vector<pair<int64_t, int64_t>> out;
    out.reserve(m);
    dfs(links, visited, used, out, 0);

    for (const auto& link : out) {
        cout << link.first + 1 << " " << link.second + 1 << "\n";
    }
}

Measured memory_bytes: 20992
import java.util.Scanner;

public class Main {

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

		int n = sc.nextInt();


		for (int i=n; i<=999; i++) {
			int a = i/100;
			int b = i%100 / 10;
			int c = i%100 % 10;
			if (a == b && a == c) {
				System.out.println(i);
				break;
			}
		}

		sc.close();
	}

}


Measured memory_bytes: 21972
//
//  Created by Henry Cafaro
//  Copyright © 2020 Henry Cafaro. All rights reserved.
//

# include <iostream>
# include <string>
# include <vector>
# include <algorithm>
# include <bitset>
# include <queue>
# include <cstring>


#define ll long long

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
        
    int a;
    cin >> a;
    a = 1000-(a%1000);
    if(a == 1000) a = 0;
    
    cout << a << endl;
   
    
    
    
    
    
    
    
    
    
    
}


Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
int n, a[22], b, ans, c;
bool d[22];
int main(){
	cin>>n;
	rep(i,n){
		cin>>a[i]; a[i]--;
		if(i && a[i-1]+1 == a[i]) d[a[i-1]] = true;
	}
	rep(i,n){
		cin>>b;
		ans += b;
	}
	rep(i,n-1){
		cin>>c;
		if(d[i]) ans += c;
	}
	cout<<ans<<'\n';
}

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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { cout << #a << " = " << a << endl; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T> void operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) cin >> e; }

typedef long long ll;
int const inf = 1<<29;

int main() {

  int M, N[2];
  for(; cin >> M >> N[0] >> N[1] && M;) {
    vector<int> vs(M); cin >> vs;
    int maxgap = 0;
    int maxnum = -1;
    REP(num, N[0], N[1] + 1) {
      if(maxgap <= vs[num - 1] - vs[num]) {
        maxgap = vs[num - 1] - vs[num];
        maxnum = num;
      }
    }

    cout << maxnum << endl;
  }
  
  return 0;
}

Measured memory_bytes: 3008
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define M 1000001
#define mod 10007

int main(void){
    double R;
    scanf("%lf",&R);
    printf("%lf\n",R*2*3.14);
    return 0;
}


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

int main() {
	// your code goes here
	int x;
	cin>>x;
	if(x<600)
	 cout<<8;
	else if(x<800)
	 cout<<7;
	 else if(x<1000)
	 cout<<6;
	 else	if(x<1200)
	 cout<<5;
	 else	if(x<1400)
	 cout<<4;
	 else	if(x<1600)
	 cout<<3;
	 else	if(x<1800)
	 cout<<2;
	 	else 
	 cout<<1;
	return 0;
}

Measured memory_bytes: 3596
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;

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

    vector<vector<int>> dist(10, vector<int>(10));
    rep(i, 10) {
        rep(j, 10) {
            cin >> dist[i][j];
        }
    }

    rep(k, 10) {
        rep(i, 10) {
            rep(j, 10) {
                dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
            }
        }
    }

    int ans = 0;
    rep(i, h) {
        rep(j, w) {
            int a;
            cin >> a;
            if(a >= 0) {
                ans += dist[a][1];
            }
        }
    }

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

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;

int main() {
	ll S;
	cin >> S;
	ll x1 = 1e9;
	ll x2 = 1;
	ll y2 = (S + x1 - 1) / x1;
	ll y1 = x1 * y2 - S;
	cout << "0 0 " << x1 << " " << y1 << " " << x2 << " " << y2 << endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		int x,y,b,p;
		cin>>x>>y>>b>>p;
		int sum=x*b+y*p;
		int num=(x*5+y*2+x*max(b-5,0)+y*max(p-2,0))*0.8;

		if(b>=5&&p>=2){
			cout<<sum*0.8<<endl;
		}
		else if(num<sum){
			cout<<num<<endl;
		}
		else{
			cout<<sum<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1240
#include <bits/stdc++.h>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <iostream>

#include <bitset>
#include <cassert>
#include <queue>
#include <random>
#include <stack>
#include <iomanip>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n;i++)
#define repf(i, a, b) for (int i = (int)a; i < (int)b;i++)
#define repv(x, arr) for (auto& x:arr)
#define all(v) (v).begin(), (v).end()
#define vec(name, num) vector<ll> name((num), 0);
#define mp(a,b) make_pair(a,b)
#define op(i) cout << (i) << endl;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;

const ll mod = 1e9 + 7;



int main(){
    int W, H, N;
    cin >> W >> H >> N;
    int x, y, a;
    int l, r, u, d;
    l = 0;
    r = W;
    u = H;
    d = 0;
    rep(i,N){
        cin>>x>>y>>a;
        if (a==1){
            l = max(l, x);
        }
        else if (a==2){
            r = min(r, x);
        }
        else if (a==3){
            d = max(d, y);
        }
        else if (a==4){
            u = min(u, y);
        }
    }
    cout << (max(0, r - l)) * max(0, (u - d)) << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<deque>
#include<queue>
using namespace std;

using ll = long long;
const int INF = 1001001001;
const ll LLINF = 1001001001001001001;
const int MOD = 1000000007;

#define rep(i,n) for (int i = 0; i < (n); ++i)

int main()
{
  int n = 5;
  rep(i,n) {
    int tmp;
    cin >> tmp;
    if (tmp == 0) {
      cout << i + 1 << endl;
    }
  }
}


Measured memory_bytes: 3544
main = do
 getLine
 a <- map read . words <$> getLine
 print $ solve (head a:head a:a) 0 0
 
solve :: [Integer] -> Integer -> Integer -> Integer
solve [a,b] x y = abs(a-b)
solve [a,b,c] x y = min(abs(a-c)+x) (abs(b-c)+y)
solve (a:b:c:cs) x y = solve (b:c:cs) y (min (abs(a-c)+x) (abs(b-c)+y))

Measured memory_bytes: 48508
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  int a,b,c,d;
  cin>>a;
  cin>>b;
  c=4;
  d=0;
  while(c>0){
    c=b-a;
    d=d+1;
    b=c;
  }
  cout<<d<<endl;
  return(0);
}

    



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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))

typedef long long LL;

int main(){
  int n,T;
  cin >> n >> T;
  int t;
  int mae;
  cin >> t;
  int ans=0;
  for(int i=1;i<n;i++){
    mae=t;
    cin >> t;
    ans+=min(t-mae,T);
  }
  ans+=T;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
struct Bri{
	int fn;
	int tn;
	int cost;
	bool operator <(const Bri &bBri)const{
		return cost>bBri.cost;
	}
};
int main(void){
	while (true){
		int citynum, brinum;
		cin >> citynum >> brinum;
		if (citynum == 0 && brinum == 0)break;
		int CostCol[100][100];
		for (int i = 0; i < 100; ++i){
			for (int j = 0; j < 100; ++j){
				CostCol[i][j] = 10000000;
			}
		}
		vector<int> IsSelected;
		for (int i = 0; i < citynum; ++i){
			IsSelected.push_back(0);
		}
		vector<Bri> BriQue;
		for (int i = 0; i < brinum; ++i){
			int a, b, cost;
			cin >> a >> b >> cost;
			BriQue.push_back({ a, b, cost });
		}
		sort(BriQue.begin(), BriQue.end());
		reverse(BriQue.begin(),BriQue.end());
		int CostSum=0;
		IsSelected[BriQue[0].fn] = 1; IsSelected[BriQue[0].tn] = 1;
		CostSum += BriQue[0].cost; 
		while (1){
			for (auto it = BriQue.begin(); it != BriQue.end(); ++it){
				if (IsSelected[(*it).fn] + IsSelected[(*it).tn] == 1){
					IsSelected[(*it).fn] = 1;
					IsSelected[(*it).tn] = 1;
					CostSum += (*it).cost;
					break;
				}
				else{

				}
			}
			if (all_of(IsSelected.begin(), IsSelected.end(), [](int x){return x == 1; })){
				cout << CostSum << endl;
				break;
			}
		}
	}
	return 0;
}

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

using namespace std;

const int N_MAX = 100007;
int main() {
  vector<bool> is_prime(N_MAX, true);
  vector<int> cumsum(N_MAX, 0);
  int Q;
  cin >> Q;

  is_prime[0] = is_prime[1] = false;
  for (int i = 2; i < N_MAX; i++) {
    if (is_prime[i]) {
      for (int k = 2; k*i < N_MAX; k++) {
        is_prime[k*i] = false;
      }
    }

    cumsum[i] = cumsum[i-1];
    if (i%2 && is_prime[i] && is_prime[(i+1)/2]) {
      cumsum[i]++;
    }
  }



  for (int i = 0; i < Q; i++) {
    int l, r;
    cin >> l >> r;
    cout << cumsum[r]-cumsum[l-1] << endl;
  }

  return 0;
}


Measured memory_bytes: 1656
def main():
    s = list(input())
    tmp = s[0]

    cnt = 1
    tmp2 = ""
    for i in range(1,len(s)):
        tmp2 += s[i]
        if tmp == tmp2:
            continue
        tmp = tmp2
        tmp2 = ""
        cnt += 1
    cnt2 = 1
    s = list(reversed(s))
    tmp = s[0]
    tmp2 = ""
    for i in range(1,len(s)):
        tmp2 += s[i]
        if tmp == tmp2:
            continue
        tmp = tmp2
        tmp2 = ""
        cnt2 += 1



    print(max(cnt,cnt2))

main()


Measured memory_bytes: 6308
while 1:
    s1 = input().split('"')
    if s1 == ['.']:
        break
    s2 = input().split('"')
    if len(s1) != len(s2):
        print("DIFFERENT")
        continue
    r = [0]*2
    for i in range(len(s1)):
        if s1[i] != s2[i]:
            r[i%2] += 1
    if [0,1]<r:
        print("DIFFERENT")
    else:
        print(["IDENTICAL","CLOSE"][r[1]])



Measured memory_bytes: 5580