akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define sz(x) ((int)x.size())
#define pb push_back
#define ii pair<int,int>
#define iii pair<ii,int>
#define ppb pop_back
#define st first
#define nd second
#define ll long long
#define N 500005
#define inf 2000000005
#define MOD 1000000007
#define LOG 14
#define EPS 0.000000001
using namespace std;

int n;
int mod[2];
int f[N];
int p[2][N], s[2];
string S;

int main() {

	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);

	for(int i = 1; i < N; i++) {
		int cnt = __builtin_popcount(i);
		f[i] = f[i % cnt] + 1;
	}
	cin >> n;
	cin >> S;
	int cnt = 0;
	for(int i = 0; i < n; i++)
		cnt += (S[i] == '1');
	if(cnt == 1) {
		for(int i = 0; i < n; i++) {
			if(S[i] == '1') 
				cout << "0\n";
			else {
				if(i == n - 1 or S[n - 1] == '1') {
					cout << "2\n";
				}
				else {
					cout << "1\n";
				}
			}
		}
		return 0;
	}
	mod[0] = cnt - 1;
	mod[1] = cnt + 1;
	for(int i = 0; i < 2; i++){
		p[i][0] = 1; 
		for(int j = 1; j <= n; j++) {
			p[i][j] = (ll) p[i][j - 1] * 2 % mod[i];
		}
	}
	for(int i = 0; i < 2; i++) {
		for(int j = 0; j < n; j++) {
			int bit = n - j - 1;
			if(S[j] == '1')
				s[i] = ((ll) s[i] + p[i][bit]) % mod[i];
		}
	}
	for(int i = 0; i < n; i++) {
		int bit = n - i - 1;
		int sum;
		if(S[i] == '1') {
			sum = s[0];
			sum = (((ll) sum - p[0][bit]) % mod[0] + mod[0]) % mod[0];
		}
		else {
			sum = s[1];
			sum = (((ll) sum + p[1][bit]) % mod[1] + mod[1]) % mod[1];
		}
		cout << f[sum] + 1 << "\n";
	}

}

Measured memory_bytes: 7260
n,m = list(map(int, input().split()))
lsta = [0 for i in range(n+1)]
lstb = [0 for i in range(n+1)]

for i in range(m):
    a,b = list(map(int, input().split()))
    if a==1:
        lsta[b]=1
    if b==n:
        lstb[a]=1

for i in range(n+1):
    if lsta[i]==1 and lstb[i]==1:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")


Measured memory_bytes: 6296
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <utility>
using namespace std;
//_____
#define pb push_back
#define fi first
#define se second
#define mkp make_pair
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0; i<(n); ++i)
#define reps(i,f,n) for(int i=(f); i<=(n); ++i)
#define err(...) fprintf(stderr, __VA_ARGS__)
#define show(x) cerr << #x << ':' << x << endl
#define outl(x) cout << (x) << '\n'
#define FAST() cin.tie(0), ios::sync_with_stdio(false)
typedef long long ll;
typedef pair<int,int> pii;
template<class A, class B>inline bool chmax(A &a, B b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, B b){return b<a ? a=b,1 : 0;}
inline bool inside(int y, int x, int H, int W){return(y>=0 && x>=0 && y<H && x<W);}
const int dx[] = {1, 0, -1, 0,  1, 1, -1, -1};
const int dy[] = {0, 1, 0, -1,  -1, 1, 1, -1};
#define INF 0x3f3f3f3f
#define LEN 1000011
#define NIL -1
//_______

int N;
vector <pii> G[101];
int mcos[101];

void dijkstra(int s)
{
   priority_queue < pii, vector<pii>, greater<pii> > pq;
   pq.push( mkp(0, s) );
   memset( mcos, INF, sizeof(mcos) );
   mcos[s] = 0;

   while( !pq.empty() ){
      const pii tmp = pq.top(); pq.pop();
      if( mcos[tmp.se] < tmp.fi )continue;

      for( const auto& v : G[tmp.se] ){
         const int nc = v.fi + tmp.fi;
         if( chmin( mcos[v.se], nc )) pq.push( mkp(nc, v.se) );
      }
   }
   return ;
}

signed main()
{
   FAST();
   cin >> N;
   rep(i, N){
      int u, k, to, c;
      cin >> u >> k;
      while(k--){
         cin >> to >> c;
         G[i].pb( mkp(c,to) );
      }
   }
   dijkstra(0);
   rep(i, N){
      cout << i << ' ' << mcos[i] << '\n';
   }
}




Measured memory_bytes: 3252
#include<bits/stdc++.h>
using namespace std;
vector <long> dp(100001,-1);
long fun(long ar[],long n)
{
	long cost;
	if(n==1)
	return 0;
	else if(n==2)
	return abs(ar[2]-ar[1]);
	else if(dp[n]!=-1)
	return dp[n];
	else
	{
		return dp[n]=min(fun(ar,n-1)+abs(ar[n]-ar[n-1]),fun(ar,n-2)+abs(ar[n]-ar[n-2]));
	}
}
int main()
{
	long n;
	cin>>n;
	long ar[n+1];
	for(long i=1;i<=n;i++)
	cin>>ar[i];
	cout<<fun(ar,n);
}

Measured memory_bytes: 4992
import math
from functools import reduce
import fractions
import sys


def gcd(*numbers):
    return reduce(fractions.gcd,numbers)


n, x = list(map(lambda x : int(x),input().split()))

zahyo = list(map(lambda x : int(x),input().split()))

zahyo.append(x)
zahyo.sort()

min = zahyo[1] - zahyo[0]

is_odd = False
is_even = False

odds = list()

for i in range(n):
    diff = zahyo[i+1] - zahyo[i]

    if diff % 2 == 0:
        is_even == True
    else:
        is_odd = True
        odds.append(diff)

    if diff < min:
        min = zahyo[i+1] - zahyo[i]

# print(is_odd)
# print(is_even)
if is_odd == True and is_even == True:
    print(1)
    sys.exit()

elif is_odd == True:
    print(gcd(*odds))
else:

    print(min)


Measured memory_bytes: 16296
from itertools import accumulate


def solve(n, rev):
    def existence_right(rev_c):
        n2 = n * 2
        acc = [[0] * n2]
        row = [0] * n2
        for x in rev_c:
            row[n2 - x - 1] += 1
            acc.append(list(reversed(list(accumulate(row)))))
        return acc

    # How many white/black ball lower than 'k' righter than index x? (0<=x<=2N-1)
    # cost[color][k][x]
    cost = list(map(existence_right, rev))

    dp = [0] + list(accumulate(c[y] for y, c in zip(rev[1], cost[1])))
    for x, cw0, cw1 in zip(rev[0], cost[0], cost[0][1:]):
        ndp = [0] * (n + 1)
        cw0x = cw0[x]
        ndp[0] = prev = dp[0] + cw0x
        for b, (y, cb0, cb1) in enumerate(zip(rev[1], cost[1], cost[1][1:])):
            ndp[b + 1] = prev = min(dp[b + 1] + cw0x + cb1[x], prev + cw1[y] + cb0[y])
        dp = ndp
    return dp[n]


n = int(input())
# White/Black 'k' ball is what-th in whole row?
rev = [[0] * n, [0] * n]
for i in range(n * 2):
    c, a = input().split()
    a = int(a) - 1
    rev[int(c == 'B')][a] = i
print(solve(n, rev))


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

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    ll a, b, c; cin >> a >> b >> c;
    ld t = a + b - c + 2*sqrtl(a*b);
    cout << (signbit(t) ? "Yes" : "No") << endl;
}



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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using ll = long long;

const int MAX_N = 100000000;
ll memo[100000000];

ll calc(ll h) {
    if (h >= MAX_N) return calc(h / 2) * 2 + 1;
    if (memo[h]) return memo[h];
    return memo[h] = calc(h / 2) * 2 + 1;
}

int main() {
    memo[1] = 1;
    ll H;
    cin >> H;
    cout << calc(H) << endl;
}

Measured memory_bytes: 18688
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using datas=pair<ll,ll>;
using ddatas=pair<double,double>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
#define For(i,a,b) for(i=a;i<(ll)b;i++)
#define bFor(i,a,b) for(i=a;i>=(ll)b;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N-1,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define endl "\n"
#define pb push_back
#define output(v) do{bool f=0;for(auto outi:v){cout<<(f?" ":"")<<outi;f=1;}cout<<endl;}while(0)
const ll mod=1000000007;
const ll inf=1LL<<60;
const double PI = acos(-1);
const double eps = 1e-9;
template<class T> inline bool chmax(T& a,T b){bool x=a<b;if(x)a=b;return x;} 
template<class T> inline bool chmin(T& a,T b){bool x=a>b;if(x)a=b;return x;} 

void startupcpp(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
}

double distance(ddatas& x,ddatas& y){
  double a=x.first-y.first,b=x.second-y.second;
  return sqrt(a*a+b*b);
}

ll modinv(ll a) {
  ll b=mod,u=1,v=0,t;
  while(b){
    t=a/b;
    a-=t*b; swap(a,b);
    u-=t*v; swap(u,v);
  }
  return (u+mod)%mod;
}

ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}

vec modncrlistp,modncrlistm;

ll modncr(ll n,ll r){
  ll i,size=modncrlistp.size();
  if(size<=n){
    modncrlistp.resize(n+1);
    modncrlistm.resize(n+1);
    if(!size){
      modncrlistp[0]=modncrlistm[0]=1;
      size++;
    }
    For(i,size,n+1){
      modncrlistp[i]=modncrlistp[i-1]*i%mod;
      modncrlistm[i]=modinv(modncrlistp[i]);
    }
  }
  return modncrlistp[n]*modncrlistm[r]%mod*modncrlistm[n-r]%mod;
}

ll modpow(ll a,ll n){
  ll res=1;
  while(n){
    if(n&1)res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll gcd(ll a,ll b){if(!b)return a;return (a%b==0)?b:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

ll countdigits(ll n){
  ll ans=0;
  while(n){n/=10;ans++;}
  return ans;
}

ll sumdigits(ll n){
  ll ans=0;
  while(n){ans+=n%10;n/=10;}
  return ans;
}
void judgement(int a){
  if(a){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  if(a){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
}

int main(){
  ll i,j,N,cnt=0,ans=0;
  cin>>N;
  if(N&1){
    cout<<0<<endl;
    return 0;
  }
  N/=2;
  while(N){
    ans+=N/5;
    N/=5;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
/*||>>>> Praveen Ojha <<<<>>>> 23 June 2019 <<<<>>>> 18:47:59 <<<<||*/
// #pragma GCC optimize("Ofast") //(Very Fast but Inaccurate)
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") //(Small operations in many loops)
// #pragma GCC optimize("unroll-loops")
// #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define F first
#define S second
#define mod 1000000007
#define inf (int)1e18+5
#define sz(x) (int)x.size()
#define PI 3.141592653589793238510
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define __ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define vi vector<int>
#define vpii vector<pair<int,int> > 
#define vvi vector<vector<int> >
#define PRINT_TIME cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s." <<endl;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename   enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
typedef long double ld;
typedef pair<int,int> pii;
//Read Problems Carefully & Check for corner cases N=0,1 ?
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////

int32_t main(){__
	int n,k;
	cin>>n>>k;
	int val=((n-1)*(n-2))/2;
	if(k>val){
		return cout<<-1<<"\n",0;
	}
	vpii ans;
	for(int i=2;i<=n;i++)
		ans.push_back({1,i});
	for(int i=2;i<=n;i++){
		for(int j=i+1;j<=n;j++){
			if(val==k){
				cout<<sz(ans)<<"\n";
				for(int kk=0;kk<sz(ans);kk++){
					cout<<ans[kk].F<<" "<<ans[kk].S<<"\n";
				}
				return 0;
			}
			ans.push_back({i,j});
			val--;
		}
	}
	cout<<sz(ans)<<"\n";
				for(int kk=0;kk<sz(ans);kk++){
					cout<<ans[kk].F<<" "<<ans[kk].S<<"\n";
				}
return 0;
}

Measured memory_bytes: 512
#include <cstdio>
#include <bitset>

const int N=2e6+5;
std::bitset<N> f;

int main() {
	int n,sum=0;
	scanf("%d",&n);
	f[0]=1;
	for(int i=1;i<=n;++i) {
		int x;
		scanf("%d",&x);
		f|=f<<x,sum+=x;
	}
	for(int i=(sum+1)/2;i<=sum;++i) {
		if(f[i]) return printf("%d\n",i),0;
	}
	return 0;
}

Measured memory_bytes: 896
// inputに入力データ全体が入る
function Main(input) {
	var input = input.split("\n");
	var N = Number(input[0]);
	console.log(Math.floor(N/3));
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

int main() {
  int n;
  cin>>n;
  int cnt=0;
  
  for(int i=0;i<n;i++){
    int d1,d2;
    cin>>d1>>d2;
    
    if(d1!=d2){
      cnt=0;
    }
    
    if(d1==d2){
      cnt++;
      if(cnt==3){
        cout<<"Yes"<<endl;
        return 0;
      }
    }

  }
  cout<<"No"<<endl;
    
}

Measured memory_bytes: 3604
s = input()
a_z = [chr(i) for i in range(97, 97 + 26)]
ans = len(s)
for alp in a_z:
    cnt = 0
    step = 0
    for char in s:
        if char == alp:
            cnt = max(cnt, step)
            step = 0
        else:
            step += 1
    ans = min(max(cnt, step), ans)
print(ans)


Measured memory_bytes: 3060
#include <cstdio>
#include <climits>
#include <cassert>
#include <cmath>
#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
#include <functional>
#include <tuple>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define FOR(x,xs) for(auto &x: xs)

using namespace std;
typedef long long ll;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef vector<int> VI;
typedef vector<ll> VL;

int main() {
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  cout << S.substr(0, S.size() - 8) << endl;
  
  return 0;
}


Measured memory_bytes: 256
n=int(input())
#a,b=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
t_bef=0
x_bef=0
y_bef=0
flag='Yes'

for i in range(1,n+1):
    t,x,y=map(int,input().split())
    dt=t-t_bef
    dist=abs(x-x_bef)+abs(y-y_bef)
    if (dt%2 != dist%2) or dist>dt:
        flag='No'
        #break
    t_bef,x_bef,y_bef=t,x,y

print(flag)

Measured memory_bytes: 9104
n = int(input())
a = list(map(int,input().split()))
a_set = set(a)
if n%2==0:
  if n//2 != len(a_set) or 0 in a_set:
    print(0)
  else:
    print(2**len(a_set)%(10**9+7))
else:
  if n//2+1 != len(a_set) or a.count(0) != 1:
    print(0)
  else:
    print(2**(len(a_set)-1)%(10**9+7))
  

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

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> s(m);
  vector<char> c(m);
  rep(i,m){
    cin >> s.at(i) >> c.at(i);
  }
  
  rep(i,1000){
    bool flag = 1;
    string str = to_string(i);
    int l = str.size();
    if(l != n) flag = 0; //n=3, m=0に注意
    
    rep(j,m){
      if(l < s.at(j)) flag = 0;
      else{
        if(str.at(s.at(j)-1) != c.at(j)) flag = 0;
      }
    }
    if(flag == 1) {cout << i << endl; break;}
    if(i == 999) {cout << -1 << endl;}
  }
}

Measured memory_bytes: 256
package main

import (
	"fmt"
	"math"
)

func main() {
	var a, b, x float64
	fmt.Scan(&a)
	fmt.Scan(&b)
	fmt.Scan(&x)

	if (x >= a * a * b / 2.0) {
		y := (b - x / (a * a)) * 2
		fmt.Print(math.Atan(y / a) / math.Pi * 180.0)
	} else {
		y := x * 2 / (a * b)
		fmt.Print(math.Atan(b / y) / math.Pi * 180.0)
	}
}

Measured memory_bytes: 512
while True:

    inputCount = int(input())

    if inputCount == 0:
        break

    timeList = [int(input()) for item in range(inputCount)]
    timeList.sort()

    waitTimeList = [0]

    for lp in range(inputCount - 1):
        waitTime = waitTimeList[-1] + timeList[lp]
        waitTimeList.append(waitTime)

    print(str(sum(waitTimeList)))



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

using namespace std;

vector<vector<int>> to; int N,M;
vector<vector<int>> visited;

int BFS(int start, int goal){
  visited[start][0] = 0;
  queue<pair<int,int>> Q; Q.push(make_pair(start,0));
  
  while(!Q.empty()){
    int p = Q.front().first; int q = Q.front().second; Q.pop();
    
    for(auto next : to[p]){
      
      if( visited[next][( q + 1) % 3] != -1){ continue;}
      else{
        visited[next][(q+1) % 3] = visited[p][q] + 1;
        Q.push(make_pair(next, ( q + 1) % 3));}}}
    
    return visited[goal][0];}
    
  
  
  
  

int main(){
  
  cin >> N >> M; to.resize(N);
  visited = vector<vector<int>> (N, vector<int>(3,-1));

  for(int i = 0; i < M; i++){  int u, v;
    cin >> u >> v; u--; v--; to[u].push_back(v);}
  
  int S,T; cin >> S >> T; S--; T--;
  
 if( BFS(S,T) == -1){ cout << -1 << endl;}
else{ cout << BFS(S,T) / 3 << endl;} return 0;}    
  

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

using namespace std;

typedef long long ll;

const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = (ll)1e9 + 7;

int main()
{
  int N; scanf("%d", &N);
  const int upper = 1e5;
  vector<int> freqs(upper + 5, 0);
  int a = -1;
  for (int i = 0; i < N; ++i) {
    scanf("%d", &a);
    ++freqs[a];
  }

  vector<int> rest(upper + 5, 0);
  for (int i = 1; i <= upper; ++i) {
    int q = i / 3, r = i % 3, p = q + r;
    while (p >= 3) {
      q = p / 3;
      r = p % 3;
      p = q + r;
    }
    rest[i] = p;
  }

  int ans = 0;
  for (int i = 1; i <= upper; ++i) {
    ans += (freqs[i] > 0);
  }
  int cnt = 0;
  for (int i = 1; i <= upper; ++i) {
    if (freqs[i] > 0 and rest[freqs[i]] % 2 == 0) {
      ++cnt;
    }
  }
  ans -= (cnt % 2);
  printf("%d\n", ans);
  return 0;
}


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

#define ll long long

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

    int a,b;
    cin>>a>>b;
    if(a>b)
    {
    	while(a--)
    		cout<<b;
    }
    else
    {
    	while(b--)
    		cout<<a;
    }
}

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


#define MOD 1000000007
#define INTMAX 0x7fffffff
#define INTMIN 0x80000000
#define LLMAX 0x7fffffffffffffffLL
#define LLMIN 0x8000000000000000LL

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

using namespace std;
using ll = long long;

int main(){
    while (1) {
        int n[6];
        scanf("%d%d%d%d%d%d", n, n+1, n+2, n+3, n+4, n+5);
        if (n[0] + n[1] + n[2] + n[3] + n[4] + n[5] == 0) {
            break;
        }
        int a = n[0] + n[3];
        int b = n[1] + n[4];
        int c = n[2] + n[5];
        int d = min(a, min(b, c));
        
        int ans = 0;
        rep(count4, min(d+1, 3)) {
            ans = max(ans, count4 + (a - count4)/3 + (b - count4)/3 + (c - count4)/3);
        }
        printf("%d\n", ans);
    }
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
int main(void) {
    string s; cin >> s;
    int n = s.size();
    bool ok = true;
    rep(i, n/2) {
        if(s[i] != s[n-i-1]) ok = false;
    }
    rep(i, n/2/2) {
        if(s[i] != s[n/2-i-1]) ok = false;
    }
    rep(i, n/2/2) {
        if(s[i+n/2+1] != s[n-i-1]) ok = false;
    }
    if(ok) cout << "Yes";
    else cout << "No";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using LL = long long int;
#define incID(i, l, r) for(int i = (l)    ; i <  (r); ++i)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); ++i)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); --i)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); --i)
#define inc(i, n)  incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec(i, n)  decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))
#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
auto setmin   = [](auto & a, auto b) { return (b <  a ? a = b, true : false); };
auto setmax   = [](auto & a, auto b) { return (b >  a ? a = b, true : false); };
auto setmineq = [](auto & a, auto b) { return (b <= a ? a = b, true : false); };
auto setmaxeq = [](auto & a, auto b) { return (b >= a ? a = b, true : false); };
auto fl = [](auto a, auto b) { assert(b != 0); return a / b - (a % b != 0 && ((a >= 0) != (b >= 0)) ? 1 : 0); };
auto ce = [](auto a, auto b) { assert(b != 0); return a / b + (a % b != 0 && ((a >= 0) == (b >= 0)) ? 1 : 0); };
auto mo = [](auto a, auto b) { assert(b != 0); a %= b; if(a < 0) { a += abs(b); } return a; };
LL gcd(LL a, LL b) { return (b == 0 ? a : gcd(b, a % b)); }
LL lcm(LL a, LL b) { return a / gcd(a, b) * b; }
#define bit(b, i) (((b) >> (i)) & 1)
#define SI(v) static_cast<int>(v.size())
#define RF(e, v) for(auto & e: v)
#define until(e) while(! (e))
#define if_not(e) if(! (e))
#define ef else if
#define UR assert(false)

// ---- ----

#define T0(T) T
#define T1(T) vector<T0(T)>
#define T2(T) vector<T1(T)>
#define V0(v, T     ...) v
#define V1(v, T, n, ...) T1(T)(n, V0(v, T, __VA_ARGS__))
#define V2(v, T, n, ...) T2(T)(n, V1(v, T, __VA_ARGS__))

int main() {
	int n, k;
	vector<int> p(3);
	string t;
	cin >> n >> k;
	inc(i, 3) { cin >> p[i]; }
	cin >> t;
	
	auto f = [&](vector<int> & s) {
		int n = SI(s);
		auto dp = V2(0, int, n + 1, 3);
		
		inc(i, n) {
		inc(x, 3) {
		inc(y, 3) {
			if(x == y) { continue; }
			setmax(dp[i + 1][y], dp[i][x] + ((y + 1) % 3 == s[i] ? p[y] : 0));
		}
		}
		}
		int ans = 0;
		inc(i, 3) { setmax(ans, dp[n][i]); }
		
		return ans;
	};
	
	auto to_int = [](char c) {
		if(c == 'r') { return 0; }
		if(c == 's') { return 1; }
		if(c == 'p') { return 2; }
	};
	
	vector<vector<int>> s(k);
	inc(i, n) { s[i % k].PB(to_int(t[i])); }
	
	int ans = 0;
	inc(i, k) { ans += f(s[i]); }
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 6136
#include <stdio.h>
int main(){
  long long a,b,x,ans=0;
  scanf("%lld%lld%lld",&a,&b,&x);
  ans  = b/x;
  ans -= a/x;
  if( a%x==0 ){ ans++; }
  printf("%lld\n",ans);
  return 0;
}

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


int main(){
	ll q;
	string s,l="";
	cin>>s>>q;
	ll now=0;
	for(int i=0;i<q;i++){
		ll x;
		cin>>x;
		if(x==1)now^=1;
		else{
			ll f;
			char c;
			cin>>f>>c;
			if(now){
				if(f==2)l+=c;
				else s+=c;
			}else{
				if(f==1)l+=c;
				else s+=c;
			}
		}
	}
	reverse(l.begin(),l.end());
	s=l+s;

	if(now)reverse(s.begin(),s.end());
	cout<<s;
	return 0;
}


Measured memory_bytes: 1116
#include "bits/stdc++.h"
#include <boost/range/irange.hpp>
using namespace std;
using boost::irange;

// 定義
typedef long long           ll;
typedef pair<ll, ll>        P;
#define ALL(x)              (x).begin(),(x).end()
#define REP(i, n)           for (ll i = 0 ; i < (ll)n ; ++i)
#define REPN(i, m, n)       for (ll i = m ; i < (ll)n ; ++i)
const ll                    INF = 2e9;
const ll                    INF_LL = 1LL<<60;
const ll                    MOD = 1e9 + 7;
namespace {
	ll Ceil(ll val, ll div)   { return (val + div - 1) / div; }
	ll CeilN(ll val, ll div)  { return Ceil(val, div) * div; }
	ll FloorN(ll x, ll n)     { return (x - x % n); }
	bool IsOdd(ll x)          { return ((x & 1) == 1); }
	bool IsEven(ll x)         { return ((x & 1) == 0); }
	template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
	template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
};

// 処理
void Solve()
{
	string S, T;
	cin >> S >> T;
	
	string ans = "No";
	if (T.compare(0, S.size(), S) == 0) {
		ans = "Yes";
	}

	cout << ans << endl;
}

// メイン
int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Solve();
	return 0;
}


Measured memory_bytes: 3656
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a<b){
            System.out.println("a < b");
        }else if(a>b){
            System.out.println("a > b");
        }else if(a==b){
            System.out.println("a == b");
        }else{
            System.out.println("error");
        }
    }
}


Measured memory_bytes: 26108
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long double a,b,h,m;
    cin>>a>>b>>h>>m;
    long double h_angle=30*h + (30*m)/60;
    long double m_angle=6*m;
    long double temp=abs(h_angle-m_angle);
    long double angle=min(temp,360-temp);
    angle=(angle*M_PI)/180;
    long double ans;
    ans=sqrt(pow(a,2) + pow(b,2) - (2*a*b*(cos(angle))));
    std::cout << std::fixed;
    std::cout << std::setprecision(10);
    cout<<ans<<endl;
    
}

Measured memory_bytes: 4128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <unordered_map>

#define ll long long int
#define mod 1000000007

using namespace std;


int main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    ll n, p;
    cin >> n >> p;
    string s;
    cin >> s;
    unordered_map<ll, ll> um;
    
    if(p == 5 || p == 2){
        ll c = 0;
        for(ll i = n - 1; i >= 0; i--){
            if((s[i]-'0')% p == 0)
            c += i+1;
        }
        cout << c;
    }
    
    else{
    ll cnt = 0;
    ll t = 1;
    ll x = 0;
    for(ll i = n - 1; i >= 0; i--){
         x = (x + t*(s[i]- '0'))%p ;
        
        if(x % p == 0){
            cnt++;
        }
        um[x%p]++;
        
        t = (t * 10) % p ;
    }
    
    for(auto i : um){
        cnt += (i.second)*(i.second - 1)/2;
    }
    cout <<cnt;
    }
}









Measured memory_bytes: 916
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

#include<bits/stdc++.h>
#include <atcoder/convolution>
#include <atcoder/modint>

using namespace std;
using namespace atcoder;

int main(){
  int n,m;
  cin>>n>>m;
  
  vector<int> A(n),B(m),C;
  rep(i,n) cin>>A[i];
  rep(i,m) cin>>B[i];
  
  C=convolution<998244353>(A,B);
  rep(i,n+m-1){
    if(i) cout<<" ";
    cout<<C[i];
  }
  cout<<endl;
  
  return 0;
}

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

using namespace std;

//vector string deque break continue
#define forn(i, s, f) for (int i = (int)s; i < (int)f; i++)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define fs first
#define sc second
#define pf push_front
#define pb push_back
#define pop_f pop_front
#define pop_b pop_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()

template <typename T> istream& operator>>(istream& in, vector <T>& a) {for (auto& i : a) in >> i; return in;}
template <typename T> ostream& operator<<(ostream& out, vector <T>& a)  {for (auto& i : a) out << i << " "; return out;}
template <typename T, typename U> void chkmin(T& a, U b) {if (a > b) a = b;}
template <typename T, typename U> void chkmax(T& a, U b) {if (a < b) a = b;}

int MOD;

int bin_pow(int a, int p) {
    if (!p)
        return 1;
    if (p % 2)
        return (1LL * bin_pow(a, p - 1) * a) % MOD;
    return (1LL * bin_pow(a, p / 2) * bin_pow(a, p / 2)) % MOD;
}

int inv(int x) {
    return bin_pow(x, MOD - 2);
}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    int n;
    string s;
    cin >> n >> MOD >> s;
    forn (i, 0, n)
        s[i] -= '0';
    if (MOD == 2) {
        long long ans = 0;
        forn (i, 0, n)
            if (s[i] % MOD == 0)
                ans += (i + 1);
        cout << ans;
        return 0;
    }
    if (MOD == 5) {
        long long ans = 0;
        forn (i, 0, n)
            if (s[i] % MOD == 0)
                ans += (i + 1);
        cout << ans;
        return 0;
    }

    vector <int> get(MOD);
    forn (i, 0, MOD)
        get[i] = inv(i);

    int pref = 0;
    vector <int> cnt(MOD);
    cnt[0] = 1;
    int pow = 1;
    forn (i, 0, n) {
        pref = (pref * 10 + s[i]) % MOD;
        cnt[(1LL * pref * get[pow]) % MOD]++;
        pow = (pow * 10) % MOD;
    }
    long long ans = 0;
    for (int i : cnt)
        ans += 1LL * i * (i - 1) / 2;
    cout << ans;
    return 0;
}

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

template<typename T>
vector<T> compress(vector<T> A){
    sort(A.begin(), A.end());
    A.erase(unique(A.begin(), A.end()), A.end());
    return A;
}

template<typename T>
struct BIT {
    int n;
    vector<T> dat;

    BIT(int n=0){
        initialize(n);
    }

    void initialize(int nin){
        n = nin;
        dat.resize(n, 0);
    }

    T sum(int i){
        T s = 0;
        while(i >= 0){
            s += dat[i];
            i = (i & (i+1)) - 1;
        }
        return s;
    }

    T sum_between(int i, int j){
        return sum(j) - sum(i-1);
    }

    void plus(int i, T x){
        while(i < n){
            dat[i] += x;
            i |= i+1;
        }
    }

    // a[0]+...+a[ret] >= x
    int lower_bound(T x){
        int ret = -1;
        int k = 1;
        while(2*k <= n) k <<= 1;
        for( ;k>0; k>>=1){
            if(ret+k < n && dat[ret+k] < x){
                x -= dat[ret+k];
                ret += k;
            }
        }
        return ret + 1;
    }
};

int main(){
    int N, K;
    cin >> N >> K;
    vector<int64_t> A(N), S(N+1);
    for(int i=0; i<N; i++){
        cin >> A[i];
        A[i] -= K;
        S[i+1] = S[i] + A[i];
    }
    auto cmp = compress(S);
    BIT<int> bit(cmp.size());
    int64_t ans = 0;
    for(int64_t s : S){
        int idx = lower_bound(cmp.begin(), cmp.end(), s) - cmp.begin();
        ans += bit.sum_between(0, idx);
        bit.plus(idx, 1);
    }
    cout << ans << endl;
}


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



int main() {
    

    int A;
    int B;
    int K;
    cin >> A >> B >> K;
    int num = 0;
    vector<int> vec(max(A,B));
    for(int p =1; p<max(A,B)+1; p++){
    if(A%p == 0  &&  B%p == 0){
        vec.at(num) = p;
        num++;
    }}
    sort(vec.begin(), vec.end());
    reverse(vec.begin(), vec.end());
    cout << vec.at(K-1) << endl;

}


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

#define mod 1000000007

long long int inv(long long int n) {
    long long int ans = 1;
    while (n > 1) {
        ans = ans * (mod - mod / n) % mod;
        n = mod % n;
    }
    return ans;
}

int main() {
    int n = 0, a = 0, b = 0, c = 0;
    scanf("%d %d %d %d", &n, &a, &b, &c);
    long long int comb[n];
    comb[0] = 1;
    for (long long int i=1; i<n; i++) {
        comb[i] = comb[i-1] * (n-1+i) % mod * inv(i%mod) % mod;
        comb[i] = comb[i] % mod;
    }
    long long int a_n = 1;
    long long int b_n = 1;
    for (int i=0; i<n; i++) {
        a_n = a_n * a % mod;
        b_n = b_n * b % mod;
    }
    long long int a_buf = 1;
    long long int b_buf = 1;
    long long int ans = 0;
    long long int deno = inv(100 - c);
    long long int inv_ab = inv(a+b);
    for (int i=0; i<n; i++) {
        deno = deno * inv_ab % mod;
    }
    for (long long int i=n; i<=n*2-1; i++) {
        long long int buf1 = a_n * b_buf % mod;
        long long int buf2 = a_buf * b_n % mod;
        long long int buf3 = (buf1 + buf2) % mod;
        ans += comb[i-n] * buf3 % mod * i % mod * deno % mod * 100 % mod;
        b_buf = b_buf * b % mod;
        a_buf = a_buf * a % mod;
        deno = deno * inv_ab % mod;
        ans = ans % mod;
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 896
#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<algorithm>

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define pb(x) push_back(x)
#define eb(x,y) emplace_back(x,y)
#define MOD 1000000007
#define MAX 1000000001
#define INF 1410065408
#define EPS 1e-9
 
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
struct edge{int from, to; ll cost;};

signed main(){
        ll N, A, B;
        cin >> N >> A >> B;
        if(A > B ||(A != B && N == 1)){
                cout << 0;
        }else if(A == B){
                cout << 1;
        }else{
                ll summin = A * (N-1) + B;
                ll summax = A + B*(N-1);
                cout << summax - summin + 1;
        }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
#define FOR(i,a,n) for(ll i=(ll)a;i<(ll)n;i++)
#define RFOR(i,a,n) for(ll i=(ll)n-1;i >= (ll)a;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,0,n)
#define ALL(v) v.begin(), v.end()
#define bra(first,second) '(' << first << ',' << second << ')'
ll MOD = 1000000007;
//ll INF = 21474836470000000;
ll INF = 1000000000000000;
long double EPS = 1e-11;
long double PI = 3.141592653589793238;
template<typename T>
void remove(std::vector<T>& vector, unsigned int index){
    vector.erase(vector.begin() + index);
}

using Graph = vector<vector<ll>>;


ll N,A,B;
vector<ll> H(100010);

bool F(ll x){
    ll cnt = 0;
    rep(i,N){
        cnt += (max(H[i] - (B * x),(ll)0) + A-B-1) / (A-B);
    }
    return (x >= cnt);
}

int main(){
   cin >> N >> A >> B;
   rep(i,N) cin >> H[i];
   ll l = 0,r = 1000000010;
   while(r-l > 1){
       ll mid = (l+r)/2;
       if(F(mid)){
           r = mid;
       }else{
           l = mid;
       } 
   }
   cout << r << endl;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <vector>
#include <numeric>
#define PI 3.14159265358979323846
#define MAXINF 1e18L
#define INF 1e9L
#define EPS 1e-9
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define pb push_back
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
typedef long long ll;
typedef pair<int, int> pii;

int main(void)
{
    string s;
    cin >> s;
    int ans_odd = 0, ans_even = 0;
    REP(i, s.size()){
        if(i % 2){//偶数
            if(s[i] == '0')ans_odd++;
            if(s[i] == '1')ans_even++;
        }else{
            if(s[i] == '0')ans_even++;
            if(s[i] == '1')ans_odd++;
        }
    }
    pr(min(ans_odd, ans_even));
}

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

int main() {
  int N,K;
  cin >> N >> K;
  vector<int>vec(N);
  for (int i=0; i<N; i++) cin >> vec.at(i);
  
  for (int i=0; i<N-K; i++){
    if(vec.at(i) < vec.at(i+K)){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
}


Measured memory_bytes: 4032
INPUT = list(map(int, input().split()))

N = INPUT[0]
X = INPUT[1]

L = list(map(int, input().split()))
count = 0

vvv = 0
i = 0
while(vvv <= X):
    count += 1
    if(i >= N):
        break
    vvv += L[i]
    i += 1

print(count)

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

int main()
{
  int N;
  cin >> N;
  vector<int> _d(N);
  auto * const d = &_d[0];
  for (int i = 0; i < N; ++i)
    cin >> d[i];
  sort(d, d + N);
  auto min = d[N/2 - 1];
  auto max = d[N/2];
  cout << max - min;
  return 0;
}


Measured memory_bytes: 640
//g++ -std=c++14 test.cpp -o test.out
//問題URL
//https://atcoder.jp/contests/m-solutions2019/tasks/m_solutions2019_d

//参考：
//https://trsing.hatenablog.com/entry/2019/06/03/153201#f-b03a08e5

//取りうる最大値を考えた上で、それを達成できるのはどういう時か考える

#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (1LL<<60);
const int INF_INT = 2147483647-1e6-1;
const LL mod = 1000000007ll;
const int mod_int = 1000000007;

int N;
vector<vector<int>> adj;
priority_queue<int> C;
int A[10000],B[10000];

LL ans_score = 0;
vector<LL> ans;

void solve(){
	queue<int> q;
	q.push(1);
	ans[1] = C.top();C.pop();
	while(!q.empty()){
		int now = q.front();q.pop();
		for(int next : adj[now]){
			if(ans[next]==-1){
				ans[next] = C.top();C.pop();
				q.push(next);
			}
		}
	}
	for(int i=0;i<N-1;i++){
		ans_score += min(ans[A[i]],ans[B[i]]);
	}
}
 
int main(){
    cin >> N;
    ans = vector<LL>(N+1,-1);
    adj = vector<vector<int>>(N+1);
    for(int i=0;i<N-1;i++){
    	int a,b;cin >> a >> b;
    	adj[a].push_back(b);
    	adj[b].push_back(a);
    	A[i] = a;
    	B[i] = b;
    }
    for(int i=0;i<N;i++){
    	int c;cin >> c;
    	C.push(c);
    }
 
    solve();

    cout << ans_score << endl;
    for(int i=1;i<=N;i++)cout << ans[i] << " ";
    	cout << endl;
    return 0;
}

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

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

	int n, k;
	cin >> n >> k;
	int h[n], dp[n];
	for(int i=0; i<n; ++i) {
		cin >> h[i];
	}
	dp[0]=0;
	for(int i=1; i<n; ++i) {
		dp[i]=INT_MAX;
		for(int j=1; j<=k&&i-j>=0; ++j)
			dp[i]=min(dp[i-j]+abs(h[i]-h[i-j]), dp[i]);
	}
	cout << dp[n-1];
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define REP(i,a,b) for(int i=int(a);i<(int)b;++i)
#define Graph vector<vecctor<ll>>
#define pairs vector<pair<ll,ll>>
#define pb push_back



using namespace std;
using ll = long long;
const ll INF = 1e18;
const double PI = acos(-1);

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



int main(void)
{
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    int x;
    cin >> x;
    x /= 200;
    cout << 10-x << endl;

    
    
    



    return 0;
}


Measured memory_bytes: 3672
#include <stdio.h>

int main(void) {
	int n;
	int a[100];
	int i;
	
	scanf("%d", &n);
	
	for(i=0; i<n; i++) {
		scanf("%d", &a[i]);
	}
	
	for(i=n-1; i>=0; i--) {
		printf("%d", a[i]);
		if (i!=0) { printf(" "); }
	}
	printf("\n");
	
	return 0;
}

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

int main() {
	int n,d,a,b,c;
	cin >> n >> d;
	a = (d*2)+1;
	if (n%a== 0) {
		b = n/a;
	} else {
		b = (n/a)+1;
	}
	cout << b;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int i,j,n,m,k,l[51],a=0;
	scanf("%d %d",&n,&k);
	for(i=0;i<n;i++) scanf("%d",&l[i]);
	for(i=0;i<n;i++){
		for(j=i;j<n;j++){
			if(l[i]<l[j]){
				m=l[i];
				l[i]=l[j];
				l[j]=m;
			}
		}
	}
	for(i=0;i<k;i++) a+=l[i];
	printf("%d\n",a);
	return 0;
}

Measured memory_bytes: 128
q, h, s, d = [int(i) for i in input().split()]
n = int(input())

x2 = min([q*8, h*4, s*2, d])
x1 = min([q*4, h*2, s])
ret = (n // 2) * x2
n %= 2
ret += (n) * x1
print(int(ret))

Measured memory_bytes: 3064
import collections
def a():return input()#s
def ai():return int(input())#a,n or k
def ma():return map(int, input().split())#a,b,c,d or n,k
def ms():return map(str, input().split())#,a,b,c,d
def lma():return list(map(int, input().split()))#x or y
def lms():return list(map(str, input().split()))#x or y
k= []
l = []
f = 0
def say(i):return print("Yes" if i == 0 else "No")
def Say(i):return print("YES" if i == 0 else "NO")
#def rep(i):return for i in range()
def addarray(k,l):
    for i in range(n):
        a ,b = map(int,input().split())
        w.append(b)
        v.append(a)
        
a = ai()
for i in range(a):
    b = input()
    if b[0] in ["M","A","R","C","H"]:
        k.append(b[0])
q = collections.Counter(k)
p = list(q.values())
if len(p)==3:
    print(p[0]*p[1]*p[2])
elif len(p)==4:
    print(p[0]*p[1]*p[2]+p[0]*p[1]*p[3]+p[0]*p[3]*p[2]+p[3]*p[1]*p[2])
elif len(p)==5:
    print(p[0]*p[1]*p[2]+p[0]*p[1]*p[3]+p[0]*p[1]*p[4]+p[0]*p[2]*p[3]
          +p[3]*p[0]*p[4]+p[1]*p[2]*p[3]+p[4]*p[1]*p[2]+p[3]*p[1]*p[4]
          +p[2]*p[3]*p[4]+p[0]*p[2]*p[4])
else:print(0)

Measured memory_bytes: 4280
#include <cstdio>
#include <vector>

using namespace std;

const int N = 100010;

vector<int> adj[N];
int ball[N];
int red[N];

int main(){
	int n, m;
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++){
		ball[i]=1;
	}
	red[1]=1;
	for(int i = 0; i < m; i++){
		int a, b;
		scanf("%d%d", &a, &b);
		ball[b]++;
		ball[a]--;
		if(red[a]==1)red[b]=1;
		if(ball[a]==0)red[a]=0;
	}
	int ans=0;
	for(int i = 1; i <= n; i++){
		ans+=red[i];
	}
	printf("%d\n",ans);

}

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

#define for_(i,a,b) for(int i=(a);i<(b);++i)

void isyes() { puts("Possible"); exit(0); }
void isno() { puts("Impossible"); exit(0); }

int N, a[111];

void solve () {
	vector< int > cnt(N, 0);
	for_(i,0,N) cnt[a[i]]++;
	
	int max_a = *max_element(a, a + N);
	if (cnt[max_a] < 2) isno();	
	if (max_a == 1 && N > 2) isno();
		
	if (max_a % 2 == 0 && cnt[max_a / 2] != 1) isno();
	if (max_a % 2 && cnt[max_a / 2] > 0) isno();
	if (max_a % 2 && cnt[max_a / 2 + 1] > 2) isno();
	for_(x,max_a/2+1,max_a) if (cnt[x] < 2) isno();
	
	isyes();
}

int main() {
	cin >> N;
	for_(i,0,N) cin >> a[i];
	solve();
}

Measured memory_bytes: 256
import java.util.Scanner;

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

	int N = scan.nextInt();
	int[] H_ = new int[N];
	for(int i = 0; i < N; i++){
	    H_[i] = scan.nextInt();
	}

	int count = 1;
	for(int i = 1; i < N; i++){
	    int flag = 1;
	    for(int j = i-1; j >= 0; j--){
		if(H_[i] < H_[j]){
		    flag = 0;
		    break;
		}
	    }
	    if(flag == 1){
		count++;
	    }else{
	    }
	}

	System.out.println(count);
    }
}


Measured memory_bytes: 23764
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int[][] a = new int[7][7];
		for(int i = 0; i < 7; i++) {
			a[i][0] = stdIn.nextInt();
			a[i][1] = stdIn.nextInt();
		}
		
		int[] ans = new int[7];
		for(int i = 0; i < 7; i++) {
			if(a[i][0] < a[i][1]) {
				ans[i] = a[i][1]-a[i][0];
			}
			else {
				ans[i] = a[i][0]-a[i][1];
			}
		}
		
		for(int i = 0; i < 7; i++) {
			System.out.println(ans[i]);
		}
	}
		
}

Measured memory_bytes: 17368
N,Q = map(int,input().split())
class segTree:
    def __init__(self,n,identity):
        if bin(n).count("1") == 1:
            self.depth = n.bit_length()
        else:
            self.depth = n.bit_length()+1
        self.leaves = 2**(self.depth-1)
        self.identity = identity
        self.tree = [self.identity] * (2**self.depth)
    
    def merge(self,x,y):
        return min(x,y)
    
    def update(self,i,x):
        i += self.leaves
        self.tree[i] = x
        target = i//2
        while target > 0:
            self.tree[target] = min(self.tree[target*2],self.tree[target*2+1])
            target //= 2
    
    def find(self,l,r):
        ret = self.identity
        l += self.leaves
        r += self.leaves
        while r > l:
            if l&1:
                ret = min(ret,self.tree[l])
                l += 1
            if r&1:
                r -= 1
                ret = min(ret,self.tree[r])
            l //= 2
            r //= 2
        return ret

seg = segTree(N,2**31-1)
for _ in range(Q):
    com,x,y = map(int,input().split())
    if com:
        print(seg.find(x,y+1))
    else:
        seg.update(x,y)










Measured memory_bytes: 8692
#include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << (x) << '\n';
typedef int64_t Int;
Int mod = 1e9+7;
Int INF = 1e9+18;

int main() {
    ios::sync_with_stdio(false);
    Int n;
    cin >> n;
    Int dp[101][5][5][5] = {};
    // dp[0][0][0][0] = 1;
    for (Int a = 0; a < 4; a++) {
        for (Int b = 0; b < 4; b++) {
            for (Int c = 0; c < 4; c++) {
                if ((a == 0 && b == 1 && c == 2) ||
                    (a == 1 && b == 0 && c == 2) ||
                    (a == 0 && b == 2 && c == 1)) continue;
                dp[3][a][b][c]++;
            }
        }
    }
    Int res = 0;
    for (Int i = 4; i <= 100; i++) {
        for (Int d = 0; d < 4; d++) {
            for (Int a = 0; a < 4; a++) {
                for (Int b = 0; b < 4; b++) {
                    for (Int c = 0; c < 4; c++) {
                        if ((b == 0 && c == 1 && d == 2) ||
                            (b == 1 && c == 0 && d == 2) ||
                            (b == 0 && c == 2 && d == 1) ||
                            (a == 0 && c == 1 && d == 2) ||
                            (a == 0 && b == 1 && d == 2)) continue;
                            dp[i][b][c][d] += dp[i - 1][a][b][c];
                            dp[i][b][c][d] %= mod;
                    }
                }
            }
        }
    }
    for (Int a = 0; a < 4; a++) {
        for (Int b = 0; b < 4; b++) {
            for (Int c = 0; c < 4; c++) {
                res += dp[n][a][b][c];
            }
        }
    }
    dump(res % mod);
    return 0;
}

Measured memory_bytes: 384
#include<stdio.h>
#include<stdlib.h>
#include <string.h>

int main()
{
char a,b,c,d;
    scanf("%c%c%c%c",&a,&b,&c,&d);
    
    if(a==b && b==c && c==d && a==d)
        printf("No");
        
    else if(a==c && b==d)
        printf("Yes");
        
    else if(a==d && b==c)
        printf("Yes");
        
    else if(a==b && c==d)
    printf("Yes");
    
     else
        printf("No");
    return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
long long x[100010];
#define int long long
signed main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    int n,k,cnt=0;
    cin>>n>>k;

    for(int i=0; i<n;i ++){
        cin>>x[i];
        if(x[i]>=k) cnt++;
    }
    cout<<cnt<<'\n';
}

Measured memory_bytes: 1024
#include <stdio.h>

using namespace std;

class Dice{
public:
	void init(){
		setNumber(1,2,3,4,5,6);
	}

	int roll(char dst){
		switch(dst){
		case 'E':
			setNumber(number[3],number[1],number[0],number[5],number[4],number[2]);
			return number[0];
		case 'N':
			setNumber(number[1],number[5],number[2],number[3],number[0],number[4]);
			return number[0];
		case 'S':
			setNumber(number[4],number[0],number[2],number[3],number[5],number[1]);
			return number[0];
		case 'W':
			setNumber(number[2],number[1],number[5],number[0],number[4],number[3]);
			return number[0];
		case 'R':
			setNumber(number[0],number[2],number[4],number[1],number[3],number[5]);
			return number[0];
		case 'L':
			setNumber(number[0],number[3],number[1],number[4],number[2],number[5]);
			return number[0];
		}
		return -1;//must not reach here
	}

private:
	int number[6];

	void setNumber(int n0,int n1,int n2,int n3,int n4,int n5){
		number[0] = n0;
		number[1] = n1;
		number[2] = n2;
		number[3] = n3;
		number[4] = n4;
		number[5] = n5;
	}

};


int main(){
	int n,sum;
	char buf[7];
	Dice dice;
	scanf("%d",&n);

	while(n != 0){
		dice.init();
		sum=1;
		for(int i=0;i<n;i++){
			scanf("%s",buf);
			sum += dice.roll(buf[0]);
		}
		printf("%d\n",sum);
		scanf("%d",&n);
	}

    return 0;
}

Measured memory_bytes: 2656