akhauriyash/Code-Regression huggingface dataset:
import java.util.*;

public class Main {
    public static void main( String args[] ) {
        Scanner scan = new Scanner( System.in );
        char[] charaArray = scan.nextLine().toCharArray();
        scan.close();
        
        for( char chara: charaArray ) {
            char result;
            if( Character.isUpperCase(chara) ) {
                result = Character.toLowerCase(chara);
                
            } else {
                result = Character.toUpperCase(chara);
                
            }
            System.out.print( String.valueOf( result ) );
            
        }
        System.out.println();
        
        
        
    }
}

Measured memory_bytes: 17280
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
int main(){
    int n,A[60];
    cin>>n;
    rep(i,n) cin>>A[i];
    int a=0,b;
    rep(i,n) if(a<=abs(A[i])) a=abs(A[i]),b=i;
    if(A[b]==0){
        cout<<0;
        return 0;
    }
    if(A[b]>0){
        cout<<2*n-2<<"\n";
        rep(i,n) if(i!=b) cout<<b+1<<" "<<i+1<<"\n";
        rep(i,n-1) cout<<i+1<<" "<<i+2<<"\n";
        return 0;
    }
    if(A[b]<0){
        cout<<2*n-2<<"\n";
        rep(i,n) if(i!=b) cout<<b+1<<" "<<i+1<<"\n";
        rep(i,n-1) cout<<n-i<<" "<<n-i-1<<"\n";
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
 #define ll long long int
 ll dp[3010][3030];
using namespace std;
int main()
{
   ll n;
   cin>>n;
   ll a[n];
   for(ll i=0;i<n;i++)
    cin>>a[i];
    for(int i=n-1;i>=0;i--)
        for(int j=i;j<n;j++)
            if(i==j)
                dp[i][j]=a[i];
            else
                dp[i][j]=max((a[i]-dp[i+1][j]),(a[j]-dp[i][j-1]));
    cout<<dp[0][n-1]<<endl;
}

Measured memory_bytes: 70144
#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,f,s;
	cin>>a>>b>>c;
	f=0;
	s=0;
	if(a==5){
		f++;
	}
	else if(a==7){
		s++;
	}
	if(b==5){
		f++;
	}
	else if(b==7){
		s++;
	}
	if(c==5){
	f++;
	}
	else if(c==7){
		s++;
	}
	if(f==2&&s==1){
		cout<<"YES"<<endl;
	}
	else{
		cout<<"NO"<<endl;
	}
		
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long int ll;
#define rep(i,n) for (int i = 0; i< (n); i++)
#define Rep(i,n,m) for (int i = (n); i< (m); i++)
#define Sort(a) sort(a.begin(), a.end())
#define Reverse(a) reverse(a.begin(), a.end())
const int INF = 1e9;
const ll MOD = 1000000007;
const ll LINF = 1e18;
using namespace std;



int main() {
    int n, count=1;
    
    cin>>n;
    
    vector<string> s(n);
    
    rep(i, n) cin>>s[i];
    
    Sort(s);
    
    Rep(i, 0, n-1){
        if(s[i] == s[i+1]){
            
        }
        else{
            count++;
        }
    }
    
    
    cout<<count<<endl;
    
    return 0;
}



Measured memory_bytes: 9596
import sys


def input():
    return sys.stdin.readline().strip()


def main():
    K, N = map(int, input().split())
    A = list(map(int, input().split()))
    A.append(K + A[0])
    Diff = [y - x for x, y in zip(A, A[1:])]
    answer = K - max(Diff)
    return answer


answer = main()
print(answer)


Measured memory_bytes: 26444
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;

typedef long long ll;

int main() {
    vector<int> v(3), u(3);
    cin >> v[0] >> v[1] >> v[2];
    sort(v.begin(), v.end());
    u[2] = v[2] - v[0];
    u[1] = v[2] - v[1];
    u[0] = 0;
    int a = u[0], b = u[1], c = u[2];
    if ((a + b + c) % 2 == 1) {
        a += 1;
        b += 1;
        c += 1;
    }
    int ans = 0;
    while (a > 0) {
        a--;
        b--;
        ans++;
    }
    while (b > 0) {
        b--;
        c--;
        ans++;
    }
    while (c > 0) {
        c -= 2;
        ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,ans;
    cin>>a>>b;
    if((a+b)%2==0)
    {
    	ans=(a+b)/2;	
	}
    else ans=(a+b)/2+1;
    
	cout<<ans;
    return 0;
}

Measured memory_bytes: 256
N = int(input())
S = input()
x = 0
cnt = 0
for i in range(N):
    if S[i] == "(":
        cnt += 1
    else:
        cnt -= 1
    x = min(x, cnt)

    if i == N-1:
        d = cnt

S = "("*(-x) + S + ")"*(d+(-x))
print(S)

Measured memory_bytes: 3060
n, mod = int(input()), 10 ** 9 + 7
memo = [{} for i in range(n+1)]
def check(l):
    for i in range(4):
        t = list(l)
        if i >= 1:
            t[i-1], t[i] = t[i], t[i-1] # 順序の入れ替え
        if ''.join(t).count('AGC') >= 1:
            return False
    return True

def dfs(cur, last3):
    if last3 in memo[cur]:
        return memo[cur][last3]
    if cur == n:
        return 1
    ret = 0
    for c in 'ACGT':
        if check(last3 + c):
            ret = (ret + dfs(cur + 1, last3[1:] + c)) % mod
    memo[cur][last3] = ret
    return ret

print(dfs(0, 'TTT'))


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

#define MP make_pair
#define PB push_back
#define ALL(x)      (x).begin(),(x).end()
#define REP(i,n)    for(int i=0;i<(n);i++)
#define REP1(i,n)   for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n)   for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

const string YES = "Yes";
const string NO = "No";

void solve(long long A, long long B, std::string S){
    if(S.length() != A + B + 1) {
        cout << NO << endl;
        return;
    }

    REP(i, A) {
        if(S[i] < '0' || '9' < S[i]){
            cout << NO << endl;
            return;
        }
    }

    if(S[A] != '-') {
        cout << NO << endl;
        return;
    }

    REP2(i, A+1, A+B+1) {
        if(S[i] < '0' || '9' < S[i]){
            cout << NO << endl;
            return;
        }
    }

    cout << YES << endl;
}

int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    std::string S;
    std::cin >> S;
    solve(A, B, S);
    return 0;
}



Measured memory_bytes: 256
#include <numeric>
#include <iostream>
#include <array>
#include <string>
#include <vector>
#include <cassert>
#include <algorithm>
#include <math.h> 
#include <set>
#include <map>
#include <utility>
#include <deque>
#include <queue>


using namespace std;

#define ll long long int
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repp(i, n) for(ll i = 1; i <= n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define riverse(v) reverse((v).begin(), (v).end())
#define pb push_back
#define mp make_pair
#define all(a)  (a).begin(),(a).end()
using vi = vector<int>;
using vs = vector<string>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
const ll MOD = 1e9 + 7;
vi alphabet = { 'a','b','c','d','e','f','g','h','i','j','k','l','m',
               'n','o','p','q','r','s','t','u','v','w','x','y','z' };

int main() {
    int N;
    cin >> N;
    vi odd(N / 2);
    vi even(N / 2);
    rep(i, N/2) {
        cin >> odd[i];
        cin >> even[i];
    }
    map<int, int> o;
    map<int, int> e;
    rep(i, N / 2) {
        if (o.count(odd[i])) o[odd[i]]++;
        else o[odd[i]] = 1;
        if (e.count(even[i])) e[even[i]]++;
        else e[even[i]] = 1;
    }
    int co = 0;
    int ce = 0;
    int oind = 0;
    int eind = 0;
    for (auto x : o) {
        int i = x.second;
        if (i >= co) {
            co = i;
            oind = x.first;
        }
    }
    for (auto x : e) {
        int i = x.second;
        if (i >= ce) {
            ce = i;
            eind = x.first;
        }
    }
    if (oind != eind) {
        int ao = N / 2 - co;
        int ae = N / 2 - ce;
        cout << ao + ae << endl;
    }
    else {
        if (co > ce) {
            e[eind] = 0;
            ce = 0;
            for (auto x : e) {
                int i = x.second;
                if (i >= ce) {
                    ce = i;
                    eind = x.first;
                }
            }
            cout << N - ce - co << endl;
        }
        else if (co < ce) {
            o[oind] = 0;
            co = 0;
            for (auto x : o) {
                int i = x.second;
                if (i >= co) {
                    co = i;
                    oind = x.first;
                }
            }
            cout << N - ce - co << endl;
        }
        else {
            int coo = co;
            int cee = ce;
            
            e[eind] = 0;
            ce = 0;
            for (auto x : e) {
                int i = x.second;
                if (i >= ce) {
                    ce = i;
                    eind = x.first;
                }
            }
            o[oind] = 0;
            co = 0;
            for (auto x : o) {
                int i = x.second;
                if (i >= co) {
                    co = i;
                    oind = x.first;
                }
            }
            if (co >= ce)cout << N - cee - co << endl;
            else cout << N - coo - ce << endl;
        }
    }
}


Measured memory_bytes: 5376
n, m = map(int, input().split())
a = list(map(int, input().split()))

d = []
color = [0] * n
nxt = 1
for i in range(m):
    if color[nxt-1] == 3:
        loop = len(d)
        rest = m - i
        q = rest % loop
        print(d[q])
        exit()
    elif color[nxt-1] == 2:
        d.append(nxt)
        color[nxt-1] += 1
        nxt = a[nxt-1]
    else:
        color[nxt-1] += 1
        nxt = a[nxt-1]
print(nxt)


Measured memory_bytes: 32372
#include<stdio.h>
#include<math.h>
int main() {
	int a,b;
	scanf("%d %d", &a,&b);
	if (a > b)
		puts("a > b");
	else if (a < b)
		puts("a < b");
	else
		puts("a == b");
	return 0;
}

Measured memory_bytes: 2612
INTEGER N,M,ANS
INTEGER,ALLOCATABLE,DIMENSION(:)::E
INTEGER K(30)
INTEGER A(30,30)
READ*,N,M
ALLOCATE(E(M))
E=0
DO I=1,N
  READ*,K(I),(A(I,J),J=1,K(I))
  DO J=1,K(I)
    E(A(I,J))=E(A(I,J))+1
  END DO
END DO
ANS=0
DO I=1,M
  IF(E(I)==N)ANS=ANS+1
END DO
PRINT"(I0)",ANS
END

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

using namespace std;

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

  int ans;
  int ab = a + b;
  int s = 0;
  int g = c;

  while(1){
    if(s <= g && g <= s + a){
      ans = g; 
      break;
    }
    else{
      if(s % 60 == 0 && s != 0){
        ans = -1;
        break;
      }

      if(g < s + ab){
        g = g + 60;
      }
    s += ab;
    }
  }

  cout<<ans<<endl;

  return 0;
}


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

int main() {

  int n;
  while( cin >> n, n ) {
    map<char,char> data;

    for(int i=0; i<n; i++) {
      char c1, c2;
      cin >> c1 >> c2;
      data[c1] = c2;
    }

    int m;
    char c;
    string s = "";
    cin >> m;
    for(int i=0; i<m; i++) {
      cin >> c;
      if (data.find(c) != data.end()) {
	s += data[c];
      }
      else {
	s += c;
      }
    }
  
    cout << s << endl;
  }
}

Measured memory_bytes: 1340
N,M = map(int,input().split())
A = [0]
C = [0] 
for i in range(M):
    a,b = map(int,input().split())
    A.append(a)
    c = list(map(int,input().split()))
    x = 0
    for j in range(1,N+1):
        if j in c:
            x += 2**(j-1)
    C.append(x)
inf = 10**9
dp = [inf for i in range(2**N)]
dp[0] = 0
for i in range(1,M+1):
    dp[C[i]] = min(dp[C[i]],A[i])
    for j in range(2**N):
        k =  j|C[i]
        dp[k] = min(dp[k],dp[j]+A[i])
if dp[2**N-1] == inf:
    dp[2**N-1] = -1
print(dp[2**N-1])


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

int main()
{
    int n, k, maiord = 0;
    cin >> k >> n;
    int dcasas[n];

    for(int i = 0; i < n; ++i)
    {
        cin >> dcasas[i];
    }

    for (int i = 0; i < n; ++i)
    {
        if(i != n - 1 && dcasas[i + 1] - dcasas[i] > maiord) maiord = dcasas[i + 1] - dcasas[i];

        if(i == (n - 1) && k - dcasas[i] + dcasas[0] > maiord) maiord = k - dcasas[i] + dcasas[0];
    }

    cout << k - maiord;
}

Measured memory_bytes: 1024
/*Q-4---ATCODER-BEGINNER-#ROUND_177
*/

#include <bits/stdc++.h>
#define M 1000000007
#define endl '\n'
#define ll long long
using namespace std;

ll find(vector<ll> adj_list[],ll nodes){
	bool visited[nodes+1];
	for(ll i=1;i<=nodes;i++)
		visited[i]=false;

	ll maxi=INT_MIN;
	for(ll i=1;i<=nodes;i++){
		if(visited[i]==false){
			ll cnt{0};

			stack<ll> q;
			q.push(i);
			visited[i]=true;

			while(!q.empty()){
				ll temp=q.top();
				cnt++;
				q.pop();

				ll siz=adj_list[temp].size();
				for(ll j=0;j<siz;j++){
					if(visited[adj_list[temp][j]]==false){
						q.push(adj_list[temp][j]);
						visited[adj_list[temp][j]]=true;
					}
				}

			}

			if(cnt>maxi)
				maxi=cnt;	
		}
	}

	return maxi;

}

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
	ll nodes{0};
	ll edges{0};
	cin>>nodes>>edges;

	vector<ll> adj_list[nodes+1];

	map<pair<ll,ll>,ll> occur;
	while(edges--){
		ll u{0};
		ll v{0};
		cin>>u>>v;
 
		if(u>v)
			swap(u,v);
 
		pair<ll,ll> temp;
		temp.first=u;
		temp.second=v;
 
		if(occur[temp]==0){
			adj_list[u].push_back(v);
			adj_list[v].push_back(u);
		}
		occur[temp]=1;
	}

	cout<<find(adj_list,nodes)<<endl;

	return 0;
}



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

#define ll long long
#define all(x) (x).begin(), (x).end()
const long long INF = 1LL << 60;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)  //(i, 10) i=0～i=9まで
#define repr(i, n) for (int i = n; i >= 0; i--)   // (i, 10) i=10～i=0まで
#define FOR(i, m, n) for (int i = m; i < n; i++)  // (i, 3, 10) i=3～i=9まで

// 総数を1000000007で割った余り
const long long mod = 1e9 + 7;

int main() {
    // cin.tie(0);
    // ios::sync_with_stdio(false);
    // cout << fixed << setprecision(5);

    // 入力
    int x, a, b;
    cin >> x >> a >> b;

    // 処理
    // 出力
    if ((b - a) <= 0) {
        cout << "delicious" << endl;
    } else if ((b - a) <= x) {
        cout << "safe" << endl;
    } else if ((b - a) > x) {
        cout << "dangerous" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll mod=998244353;
ll mul(ll a, ll b)
{
	return ((a%mod)*(b%mod))%mod;
}
ll add(ll a, ll b)
{
	return ((a%mod)+(b%mod))%mod;
}
ll sub(ll a, ll b)
{
	return ((a%mod)-(b%mod)+mod)%mod;
}
int main() 
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll n;
	cin>>n;
	ll u=100;
	ll out=0;
	while(u<n)
	{
		u+=(u/100);
		out++;
	}
	cout<<out;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=ll(1e18)+ll(7);
const ll MOD=1000000007LL;
#define out(a) cout<<fixed<<setprecision((a))


int main(){
	ll N,mod=998244353,ans=1;
	cin >> N;
	int d1;
	cin >> d1;
	if(d1){
		cout << 0 << endl;
		return 0;
	}
	vector<ll> D(N-1);
	FOR(i,0,N-1)cin >> D[i];
	SORT(D);
	vector<ll> cnt(N-1,0);
	cnt[0] = 1;
	FOR(i,0,N-1)cnt[D[i]]++;
	for(auto x:D){
		if(x==0){
			ans = 0;
			break;
		}
		(ans*=cnt[x-1])%=mod;
	}
	cout << ans << endl;
}


Measured memory_bytes: 1792
N = int(input())
a = []
AC = 0
WA = 0
TLE = 0
RE = 0
for i in range(N):
    b = input()
    a.append(b)
for ty in range(N):
    if a[ty] == "AC":
        AC += 1
    if a[ty] == "WA":
        WA += 1
    if a[ty] == "TLE":
        TLE += 1
    if a[ty] == "RE":
        RE += 1
print("AC x " + str(AC))
print("WA x " + str(WA))
print("TLE x " + str(TLE))
print("RE x " + str(RE))

Measured memory_bytes: 16208
n,k = map(int,input().split())

mod = 10**9+7

all_num = pow(k,n,mod)
#all_num = k**n


ans = 0

dp = [0]*(k+1)

for i in range(k):
    tmp = k-i
    #print(tmp)
    #print(tmp,tmp,tmp)
    kazu = 1
    kakeru = 2
    heru = 0
    
    if tmp == 1:
        ans += all_num
        ans %= mod
        break
    
    #print(tmp,k)
    for i in range(k//tmp-1):
        #print(i)
        heru += dp[tmp*kakeru]
        kazu += 1
        kakeru += 1
    """
    while tmp * kakeru <= k:
        heru += dp[tmp*kakeru]
        kazu += 1
        kakeru += 1
        #print(tmp*kakeru,k)
    """ 
    
    kazu = pow(kazu,n,mod)-heru
    #kazu = kazu**n-heru
    ans += tmp*(kazu)
    all_num -= (kazu)
    #print(tmp,kazu,n,heru)
    dp[tmp] = kazu
    ans %= mod
    #print(ans,tmp,kazu)
    
print(ans)

Measured memory_bytes: 11216
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define MOD 998244353
#define MAX 510000

ll fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++){
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

long long COM(int n, int k){
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

signed main(){
  ll n,a,b,k,ans=0,res;
  COMinit();
  cin >> n >> a >> b >> k;
  for(ll i=0;i<=n;i++){
    res = k-a*i;
    if(res<0) break;
    if(res%b == 0){
      ans += (COM(n,i)*COM(n,res/b))%MOD;
      ans %= MOD;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 12160
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int> ans(n);
  for(int i=0; i<n; i++){
    int a;//a(i+1)のこと
    cin>>a;
    ans.at(a-1)=i+1;//
  }
  for(int i=0; i<n;i++){
    cout<<ans.at(i);
    if(i!=n-1)
      cout<<" ";
  }
  cout<<endl;
  return 0;
}

Measured memory_bytes: 1152
import sys
readline = sys.stdin.readline
from operator import itemgetter

def main():
    N, M = map(int, readline().rstrip().split())
    AB = [tuple(map(int, readline().rstrip().split())) for _ in range(M)]
    AB.sort(key=itemgetter(1))
    res = 1
    x = AB[0][1] - 2
    for a, b in AB[1:]:
        if a - 1 <= x:
            continue
        res += 1
        x = b - 2
    
    print(res)


if __name__ == '__main__':
    main()

Measured memory_bytes: 18196
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>
#include <queue>
#include <string>

#define reps(i,s,n) for(int (i) = (s); (i) < (n); (i)++)
#define rep(i,n) reps(i,0,n)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using vi = vector<int> ;
using vl = vector<ll>;

int main(){
    int x,y;
    cin >> x >> y;
    int ans = 2e9+10;
    int tx = x,ty = y;

    if(tx <= ty){
        ans = min(ans,ty-tx);
    }
    tx = -x;
    if(tx <= ty){
        ans = min(ans,ty-tx+1);
    }
    tx = x;
    ty = -y;
    if(tx <= ty){
        ans = min(ans,ty-tx+1);
    }
    tx = -x;
    ty = -y;
    if(tx <= ty){
        ans = min(ans,ty-tx+2);
    }

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

Measured memory_bytes: 3620
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		if(n%500 > a) {
			System.out.println("No");
		} else {
			System.out.println("Yes");
		}
	}
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef pair<ll, int> PILL;
typedef pair<ll, ll> PLL;

const int MAX_N = 1e5+5;
const int M = 1e6;
const ll INF = (ll)(1e18);
const int inf = 1e9;
const ll MOD = 1000000007LL;

void solve() {

}

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

    int h;
    int n;
    cin >> h >> n;
    int sum = 0;

    for (int i = 0; i < n; i++) {
        int x; cin >> x;
        sum += x;
    }

    if (sum >= h) {
        cout << "Yes";
        return 0;
    }

    cout << "No";








    return 0;
}


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

int main()
{
  int n;
  int64_t d;
  cin >> n >> d;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int64_t x, y;
    cin >> x >> y;
    if (x * x + y * y <= d * d) ans++;
  }
  cout << ans << endl;
}


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


int main() {
    uint64_t N, K;
    cin >> N >> K;
    uint64_t A[N];

    for (uint64_t i = 0; i < N; i++) {
        cin >> A[i];
    }

    cout << (N - 1) / (K - 1) + (0 < ((N - 1)% (K - 1)) ?  1 : 0) <<endl;
    return 0;    
}

Measured memory_bytes: 1024
import java.util.*;

public class Main {
	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

          	if(N==0){
				System.out.println(1);
			}else{
				System.out.println(0);
			}

		
		return;
	}

}


Measured memory_bytes: 35644
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;

int main() {
    int a, b, k;
    cin >> k >> a >> b;
    for (int i = a; i <= b; i++) {
        if (i % k == 0) {
            cout << "OK" << endl;
            exit(0);
        }
    }
    cout << "NG" << endl;
    return 0;
}

Measured memory_bytes: 3624
#include <iostream>

using namespace std;

int main(){
    char s[300000];
    int cnt[300000];
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> s[i];
    }
    cnt[0]=0;
    for(int i=1;i<n;i++){
        if(s[i]=='E')cnt[0]++;
    }
    for(int i = 1; i < n; i++){
        if(s[i-1] == 'W' && s[i] == 'E')cnt[i]=cnt[i-1];
        if(s[i-1] == 'E' && s[i] == 'W')cnt[i]=cnt[i-1];
        if(s[i-1] == 'E' && s[i] == 'E')cnt[i]=cnt[i-1] - 1;
        if(s[i-1] == 'W' && s[i] == 'W')cnt[i]=cnt[i-1]+1;
    }
    int res=400000;
    for(int i=0;i<n;i++){
        res = min(res,cnt[i]);
    }
    cout << res << endl;
    return 0;
}

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

int main()
{
	ll n,i,j,k;
	cin>>n;
	ll a[n];
	for(i=0;i<n;i++)cin >> a[i];
	sort(a,a+n);
	ll ans=0LL;
	for(i=0;i<n-2;i++)
	{
		for(j=i+1;j<n-1;j++)
		{
			for(k=j+1;k<n;k++)
			{
				if((a[i]+a[j])>a[k] && a[i]!=a[j] && a[j]!=a[k] && a[k]!=a[i])
				{
					//cout << a[i] << " " << a[j] << " " << a[k] << endl;
					ans++;
				}
			}
		}
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; ++i)
#define REPP(i, n) for(int i = 1; i <= n; ++i)
#define REPR(i, n) for(int i = n-1; i >= 0; --i)
#define FOR(i, m, n) for(int i = m; i < n; ++i)
#define ALL(v) v.begin(), v.end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1000000007;
const ll INF = 1000000000;

template<typename T1,typename T2> inline void chmin(T1 &a,T2 b) {if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b) {if(a<b) a=b;}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<ll> a(n), s(n+1);
    s[0] = 0;
    REP(i,n) {
        cin >> a[i];
        s[i+1]=s[i]+a[i];
    }
    ll ans = 0;
    sort(ALL(s));
    ll cnt = 0;
    REP(i,n) {
        if(s[i]==s[i+1]) {
            ++cnt;
            ans += cnt;
        }
        else cnt = 0;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3456
#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;

struct edge{int to, cap, rev;};
vector<edge> G[101];
bool used[101];
int dfs(int v, int t, int f){
	if(v == t)return f;
	used[v] = true;
	for(int i = 0;i < G[v].size();i++){
		edge &e = G[v][i];
		if(!used[e.to] && e.cap > 0){
			int d = dfs(e.to, t, min(f, e.cap));
			if(d > 0){
				e.cap -= d;
				G[e.to][e.rev].cap += d;
				return d;
			}
		}
	}
	return 0;
}

int main(){
	int n, m, v, u, c;
	scanf("%d%d", &n, &m);
	for(int i = 0;i < m;i++){
		scanf("%d%d%d", &v, &u, &c);
		G[v].push_back((edge){u, c, G[u].size()});
		G[u].push_back((edge){v, 0, G[v].size()-1});
	}
	
	int flow = 0;
	while(1){
		fill(used, used+101, 0);
		int f = dfs(0, n-1, inf);
		if(f == 0)break;
		flow += f;
	}
	
	printf("%d\n", flow);
	return 0;
}


Measured memory_bytes: 3304
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin >> s;
    int ans = 0;
    for (int l = 0, r = s.size()-1; l < r; ++l, --r)
        ans += s[l] != s[r];
    cout << ans << endl;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
sw = 0
for i in range(N-1):
    for j in range(N-1,i,-1):
        if A[j] < A[j-1]:
            A[j], A[j-1] = A[j-1], A[j]
            sw += 1
print(" ".join(map(str, A)))
print(sw)


Measured memory_bytes: 5596
/* ---------- STL Libraries ---------- */

// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>

/* ---------- Namespace ---------- */

using namespace std;

/* ---------- Type Abbreviation ---------- */

template <typename T>
using PQ = priority_queue<T>;
template <typename T>
using GPQ = priority_queue<T, vector<T>, greater<T>>;

using ll = long long;

#define fst first
#define snd second
#define mp make_pair
#define mt make_tuple

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


/* ---------- conversion ---------- */

#define INT(c) static_cast<int>(c)
#define CHAR(n) static_cast<char>(n)
#define LL(n) static_cast<ll>(n)
#define DOUBLE(n) static_cast<double>(n)

/* ---------- container ---------- */

#define ALL(v) (v).begin(), (v).end()
#define SIZE(v) (LL((v).size()))
#define each(itr,v) for(auto (itr):(v))

#define FIND(v, k) (v).find(k) != (v).end()
#define VFIND(v, k) find(ALL(v), k) != (v).end()

#define gsort(b, e) sort(b, e, greater<decltype(*b)>())

/* ----------- debug ---------- */

template <class T>
ostream& operator<<(ostream& os, vector<T> v) {
	os << "[";
	for (auto vv : v)
		os << vv << ",";
	return os << "]";
}

template <class T>
ostream& operator<<(ostream& os, set<T> v) {
	os << "[";
	for (auto vv : v)
		os << vv << ",";
	return os << "]";
}

template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> p) {
	return os << "(" << p.fst << "," << p.snd << ")";
}

/* ---------- Constants ---------- */

// const ll MOD = 1e9 + 7;
// const int INF = 1 << 25;
// const ll INF = 1LL << 50;
// const double PI = acos(-1);
// const double EPS = 1e-10;
// mt19937 mert(LL(time(0)));

/* ---------- Short Functions ---------- */

template <typename T>
T sq(T a) {
	return a * a;
}

template <typename T>
T gcd(T a, T b) {
	if (a > b) return gcd(b, a);
	return a == 0 ? b : gcd(b % a, a);
}

template <typename T, typename U>
T mypow(T b, U n) {
	if (n == 0) return 1;
	if (n == 1) return b /* % MOD */;
	if (n % 2 == 0) {
		return mypow(b * b /* % MOD */, n / 2);
	}
	else {
		return mypow(b, n - 1) * b /* % MOD */;
	}
}

ll pcnt(ll b) {
	return __builtin_popcountll(b);
}



// const ll dx[4] = {0, -1, 1, 0};
// const ll dy[4] = {-1, 0, 0, 1};
// const ll dx[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
// const ll dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1};

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll N, M;
	cin >> N >> M;
	if (2 * N >= M) cout << M / 2 << endl;
	else cout << (N*2+M)/4 << endl;
	return 0;
}


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

using namespace std;

#define ll long long

int main(){
    int n;
    cin >> n;
    int countAC = 0; int countWA = 0; int countTLE = 0; int countRE = 0;
    while (n--){
        string s;
        cin >> s;
        if (s == "AC"){
            countAC++;
        }
        else if (s == "WA"){
            countWA++;
        }
        else if(s == "TLE"){
            countTLE++;
        }
        else if (s == "RE"){
            countRE++;
        }
    }
    cout << "AC x " << countAC << "\n" << "WA x " << countWA << "\n" << "TLE x " << countTLE << "\n" << "RE x " << countRE << "\n";
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#include <cstdlib>  // abs() for integer 絶対値求めやつ
#include <cmath>    // abs() for float, and fabs()
#include <algorithm>
#include <vector>
#include <string>
#include<iomanip>//浮動小数点数を出力する制度の指定
//使い方　数値をnumとして　cout<<setprecision(n)<<num ;nは桁数
#define rep(i,n) for(int i = 0; i < (n);i++)
#define SORT(a) sort((a).begin(),(a).end())
#define REV(a) reverse((a).begin(),(a).end())
using namespace std;
using ll =long long;
#define INF 2000000000
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; }
#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
/*覚えてないことメa
  数値型から文字列に変換　to_string(number);これは簡単
  文字列から数値型に変換　stoi(number)
  文字列からllに変換　stoll(number)*/

//ここから書き始める
int main(){

	int n; 
	cin >> n;//モンスターはn+1の町を襲っている 勇者はn人
	vector<int> A(n+1);
	vector<int> B(n);
	rep(i,n+1) cin>>A[i];
	rep(i,n) cin>>B[i];
	int x;

	ll ans = 0;
	rep(i,n){
		x =min(A[i],B[i]);
		B[i]-=x;
		A[i]-=x;
		ans += x;

		if(B[i]!=0){
			x = min(A[i+1],B[i]);
			A[i+1] -=x;
			ans += x;
		}
	}
	cout<<ans<<endl;
		

}




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

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

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

const int MAX = 1e5 + 5;
const int INF = 1001001001;
const int MOD = 1e9 + 7;

int main(){
    int X, Y;
    cin >> X >> Y;

    int ans = 0;

    if (X == 1) ans += 300000;
    else if (X == 2) ans += 200000;
    else if (X == 3) ans += 100000;

    if (Y == 1) ans += 300000;
    else if (Y == 2) ans += 200000;
    else if (Y == 3) ans += 100000;

    if (X == 1 && Y == 1) ans += 400000;

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp>
//#include <functional> // for less
#define PI acos(-1.0)
#define eps 1e-9
#define ll long long
#define ull unsigned long long
#define nl printf("\n")
#define sf scanf
#define pf printf
#define INF (ll)1e15
#define mod 1000000007

///#define isValid(n,m,nx,ny)nx>=0&&nx<n&&ny>=0&&ny<m
///int kx[]={1, 1, -1, -1, 2, 2, -2, -2}; //knight moves
///int ky[]={2,-2,  2, -2, 1,-1,  1, -1}; //knight moves
///int dx[]={1,-1,0,0,1,-1,1,-1};//eight direction
///int dy[]={0,0,1,-1,1,-1,-1,1};//eight direction
 
///using namespace __gnu_pbds;
using namespace std;
 
///inline double toRad(double deg){return deg*PI/180;}
///inline double toDeg(double rad){return rad*180/PI;}
///typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> new_data_set;
 
const int S=123456;
int main()
{
    #ifndef ONLINE_JUDGE
    //freopen("input.txt","r",stdin);
    #endif
    int n;
    while(cin>>n)
    {
        int ara[n+5];
        for(int i=0;i<n;i++)cin>>ara[i];

        sort(ara,ara+n);
        pf("%d\n",ara[n/2]-ara[n/2-1]);
    }
    return 0;
}
 









 




























Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <cctype>

using namespace std;

int main()
{
	string w, t;
	int cnt = 0;

	cin >> w;

	while (cin >> t)
	{
		if (t == "END_OF_TEXT") break;
		for(string::size_type i = 0; i < t.size(); ++i) t[i] = tolower(t[i]);
		if (t == w) cnt++;
	}

	cout << cnt << endl;

	return 0;
}

Measured memory_bytes: 1192
#include<bits/stdc++.h>
 #define pb push_back
 #define ll long long
 using namespace std;


 const int maxn = 1e6+5;
 int main(){
     ll n; cin >> n;
     for(int i = sqrt(n); i >= 1; i--) {
        if(n%i==0) {
            cout << i-1+n/i-1 << endl;
            return 0;
        }
     }
 }


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<stdlib.h>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=500000004;
int a[6];
int main(){
	for(int i=0;i<6;i++){
		scanf("%d",a+i);
	}
	printf("%d\n",a[0]+a[1]+a[2]+a[3]+max(a[4],a[5])-min(min(a[0],a[1]),min(a[2],a[3])));
}

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

#define PI acos(-1)
#define pb push_back
#define int long long int
#define mp make_pair
#define pi pair<int, int>
#define pii pair<pi, int>
#define fir first
#define sec second
#define MAXN 300001
#define MAXL 20
#define mod 1000000009

signed main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; i++)
  {
    int k;
    cin >> k;
    if (k & 1 && !(i & 1))
      ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3608
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>

using namespace std;

int main(){
	map<char, char> iwi;
	iwi['i'] =  'i';
	iwi['('] =  ')';
	iwi[')'] =  '(';
	iwi['{'] =  '}';
	iwi['}'] =  '{';
	iwi['['] =  ']';
	iwi[']'] =  '[';
	string in;
	cin >> in;
	int w = 0;
	for(int i = 0; i < in.size(); i++){
		if(in[i]=='w') w = i;
	}
	int count = 1;
	int index = w+1;
	bool iflag = false;
	for(int i = w-1; i >= 0; i--){
		if(iflag&&in[i]!='i') continue;
		else if(iflag&&in[i]=='i') iflag = false;
		for(int j = index; j < in.size(); j++){
			if(iwi[in[i]] == in[j]){
				count += 2;
				index = j+1;
				break;
			}
			else if(in[j]=='i'){
				iflag = true;
				break;
			}
		}
	}
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 1188
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A[] =new int[N];
        int num=1;
        int count=0;
        
        for(int i=0;i<N;i++){
            A[i]=sc.nextInt();
            
        }
        
        for(int j=0;j<N;j++){
            if(num==2){
                System.out.println(count);
                return;
            }
            num=A[num-1];
            count++;
            
        }
        
        System.out.println(-1);
        
        
        
    }
}


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

vector< int > connections;

void addConnection(int a, int b) {
  if (connections[a] == a && connections[b] == b)
    a < b ? connections[b] = a : connections[a] = b;
  else if (connections[a] == a)
    addConnection(a, connections[b]);
  else if (connections[b] == b)
    addConnection(connections[a], b);
  else
    addConnection(connections[a], connections[b]);
}

bool checkConnection(int a, int b) {
  if (connections[a] == a && connections[b] == b) {
    if (a == b)
      return true;
    else
      return false;
  } else if (connections[a] == a) {
    return checkConnection(a, connections[b]);
  } else if (connections[b] == b) {
    return checkConnection(connections[a], b);
  } else
    return checkConnection(connections[a], connections[b]);
}

int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  connections = vector< int > (n, -1);
  for (int i = 0; i < n; i++)
    connections[i] = i;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    addConnection(a, b);
  }
  int q;
  cin >> q;
  // for (int i = 0; i < n; i++)
  //   cout << connections[i] << ' ';
  // cout << endl;
  for (int i = 0; i < q; i++) {
    int a, b;
    cin >> a >> b;
    // cout << a << ' ' << b << endl;
    if (checkConnection(a, b))
      cout << "yes" << endl;
    else
      cout << "no" << endl;
  }
  return 0;
}



Measured memory_bytes: 3628
#include <iostream>
#include <climits>
const long MAX_H = 500000;

void swap(long A[], long i, long j) {
  long tmp = A[i];
  A[i] = A[j];
  A[j] = tmp;
}

void maxHeapify(long A[], long i, long H) {
  long leftIndex = 2 * i;
  long rightIndex = 2 * i + 1;

  long largest = i;
    
  if ((leftIndex <= H) && (A[leftIndex] > A[i])) {
    largest = leftIndex;
  }

  if ((rightIndex <= H) && (A[rightIndex] > A[largest])) {
    largest = rightIndex;
  }

  if (largest != i) {
    swap(A, i, largest);
    maxHeapify(A, largest, H);
  }
}

void buildMaxHeap(long A[], long H) {
  for (long i = H / 2; i >= 1; i--) {
    maxHeapify(A, i, H);
  }
}

int main(void) {
  long H = 0;
  long A[MAX_H + 1];

  std::cin >> H;

  for (long i = 1; i <= MAX_H; i++) {
    std::cin >> A[i];
  }

  buildMaxHeap(A, H);

  for (long i = 1; i <= H; i++) {
    std::cout << " " << A[i];
  }

  std::cout << std::endl;
  
  return 0;
}

Measured memory_bytes: 5064
// 基本テンプレート

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long int

template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

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

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

int N, X, Y, Z;
int dp[41][1<<17];

signed main() {
    cin >> N >> X >> Y >> Z;
    int ngbit = 1 << (X-1);
    ngbit = (ngbit << Y) | (1 << (Y-1));
    ngbit = (ngbit << Z) | (1 << (Z-1));
    int sum = X+Y+Z;
    int mask = (1 << sum) - 1;

    int ans = 1;
    rep(i,0,N) (ans *= 10) %= MOD;

    dp[0][0] = 1;
    rep(i,0,N) rep(j,0,1<<sum) repq(k,1,10) {
        int nbit = ((j << k) | (1 << (k-1))) & mask;
        if((nbit & ngbit) != ngbit) (dp[i+1][nbit] += dp[i][j]) %= MOD;
    }

    int sub = 0;
    rep(i,0,1<<sum) (sub += dp[N][i]) %= MOD;
    cout << (ans - sub + MOD) % MOD << endl;
    return 0;
}

Measured memory_bytes: 41216
X=int(input())

if X>=400 and X<=599:
    print('8')
elif X>=600 and X<=799:
    print('7')
elif X>=800 and X<=999:
    print('6')
elif X>=1000 and X<=1199:
    print('5')
elif X>=1200 and X<=1399:
    print('4')
elif X>=1400 and X<=1599:
    print('3')
elif X>=1600 and X<=1799:
    print('2')
elif X>=1800 and X<=1999:
    print('1')

Measured memory_bytes: 9192
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#include <assert.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <bitset>
#include <vector>
using namespace std;

#define LL long long

#define fi first
#define se second
#define lson l,mid,id<<1
#define rson mid+1,r,id<<1|1
#define ls id<<1
#define rs id<<1|1
#define MID(a,b) (((a)+(b))>>1)
#define maxx(a,b) ((a)<(b)?(b):(a))
#define minx(a,b) ((a)<(b)?(a):(b))
#define absx(a) ((a)<0?-(a):(a))
#define mk(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define itr iterator
#define lowbit(x) ((x)&-(x))

typedef unsigned LL ULL;
typedef unsigned uint;
typedef map<int,int> mii;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<LL,LL> pLL;

template< typename T > inline void read(T &x) {
    bool f; char ch; f=0; x=0; ch=getchar();
    while(ch<'0' || ch>'9') {if(ch=='-') f=1; ch=getchar();}
    while(ch>='0' && ch<='9') {x=x*10+ch-'0'; ch=getchar();}
    if(f) x=-x;
}

template< typename T > inline void Max(T &a, T b) {if(a<b) a=b;}
template< typename T > inline void Min(T &a, T b) {if(b<a) a=b;}
template< typename T > inline T Abs(T a) {if(a<0) return -a; else return a;}

const double pi=(double) acos(-1.0);
const int MOD=(int) 1e9+7;
const int INF=(int) 0x3f3f3f3f;
const LL  LINF=(LL) INF<<32|INF;
const int SINF=(uint) ~0>>1;
const LL  SLINF=(ULL) (-1)>>1;
const double DINF=(double) 1e50;
const double eps=(double) 1e-8;
const int maxn=(int) 4e3+20;
const int maxm=(int) 1e5+20;
const int maxk=(int) 5e2+20;

inline int sig(double x) {return x<-eps?-1:x>eps;}

//--------------start------------------


int A,B,C,D,E,F;
int dp[3005];

inline bool check(int x,int y,int u,int v)
{
    return v*x<u*y;
}

void work()
{
    read(A);
    read(B);
    read(C);
    read(D);
    read(E);
    read(F);

//    cout <<A <<" " <<B <<" " <<C <<" " <<D <<" " <<E <<" " <<F <<endl;

    for(int i=0;i<=F;i++) dp[i]=-1;

    dp[0]=0;

    for(int i=1;i<=F;i++)
    {
        if(i-A*100>=0 && dp[i-A*100]!=-1) Max(dp[i],dp[i-A*100]);
        if(i-B*100>=0 && dp[i-B*100]!=-1) Max(dp[i],dp[i-B*100]);

        if(i-C>=0 && dp[i-C]!=-1 && !check(E,100,dp[i-C]+C,i-C-dp[i-C])) Max(dp[i],dp[i-C]+C);
        if(i-D>=0 && dp[i-D]!=-1 && !check(E,100,dp[i-D]+D,i-D-dp[i-D])) Max(dp[i],dp[i-D]+D);
    }

    int a=-1, b=1;
    for(int i=1;i<=F;i++) if(dp[i]!=-1)
    {
        if(check(a,b,dp[i],i-dp[i])) a=dp[i], b=i-dp[i];
    }

    cout <<b+a <<" " <<a <<endl;
}

//--------------end--------------------

int main()
{
#ifdef yukihana0416
freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
#endif // yukihana0416
    work();
    return 0;
}


Measured memory_bytes: 256
// AOJ NTL_1 D (http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=NTL_1_D)
#include<iostream>
#include<map>
#define itr(it,a) for(auto it=(a).begin();it!=(a).end();++it)

std::map<int, int> prime_factor( int n )
{
	std::map<int, int> ret;

	for( int i = 2; i*i <= n; ++i ) while( n % i == 0 )
	{
		++ret[i];
		n /= i;
	}

	if( n != 1 )
		++ret[n];

	return ret;
}

int phi( int n )
{
	auto m = prime_factor(n);

	itr( it, m )
	{
		n /= it->first;
		n *= it->first-1;
	}

	return n;
}

int main()
{
	int n;
	std::cin >> n;

	std::cout << phi(n) << std::endl;

	return 0;
}

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

using namespace std;
const int maxn = 1e5 + 10;
int a[maxn], b[maxn];
int main()
{
    int n;
    cin >> n;
    int max1 = 0, k;
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
        if (a[i] > max1) {
            max1 = a[i];
            k = i;
        }
    }
    cout << a[k] + b[k] << endl;
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const ll MOD = 1000000007;
int main() {
  int H, W;
  cin >> H >> W;
  vector<string> S(H);
  REP(i, H) cin >> S[i];
  vector<vector<int>> A(H, vector<int>(W));
  vector<P> disjoint_list(0);
  REP(i, H) REP(j, W) {
    if (S[i][j] == '.') continue;
    if (A[i][j] != 0) continue;
    disjoint_list.push_back(P(i, j));
    int number = disjoint_list.size() + 1;
    queue<P> que;
    A[i][j] = number;
    que.push(P(i, j));
    while (!que.empty()) {
      P p = que.front();
      que.pop();
      int y = p.first, x = p.second;
      if (x > 0) {
        int ny = y, nx = x - 1;
        if (S[y][x] != S[ny][nx] && A[ny][nx] == 0) {
          A[ny][nx] = number;
          que.push(P(ny, nx));
        }
      }
      if (x < W - 1) {
        int ny = y, nx = x + 1;
        if (S[y][x] != S[ny][nx] && A[ny][nx] == 0) {
          A[ny][nx] = number;
          que.push(P(ny, nx));
        }
      }
      if (y > 0) {
        int ny = y - 1, nx = x;
        if (S[y][x] != S[ny][nx] && A[ny][nx] == 0) {
          A[ny][nx] = number;
          que.push(P(ny, nx));
        }
      }
      if (y < H - 1) {
        int ny = y + 1, nx = x;
        if (S[y][x] != S[ny][nx] && A[ny][nx] == 0) {
          A[ny][nx] = number;
          que.push(P(ny, nx));
        }
      }
    }
  }
  ll ans = 0;
  REP(i, disjoint_list.size()) {
    queue<P> que;
    que.push(P(disjoint_list[i].first, disjoint_list[i].second));
    ll tmp = 0, number = 1;
    A[disjoint_list[i].first][disjoint_list[i].second] = -1;
    while (!que.empty()) {
      P p = que.front();
      que.pop();
      int y = p.first, x = p.second;
      if (x > 0) {
        int ny = y, nx = x - 1;
        if (S[y][x] != S[ny][nx] && A[ny][nx] != -1) {
          if (S[ny][nx] == '#')
            number++;
          else
            tmp++;
          A[ny][nx] = -1;
          que.push(P(ny, nx));
        }
      }
      if (x < W - 1) {
        int ny = y, nx = x + 1;
        if (S[y][x] != S[ny][nx] && A[ny][nx] != -1) {
          if (S[ny][nx] == '#')
            number++;
          else
            tmp++;
          A[ny][nx] = -1;
          que.push(P(ny, nx));
        }
      }
      if (y > 0) {
        int ny = y - 1, nx = x;
        if (S[y][x] != S[ny][nx] && A[ny][nx] != -1) {
          if (S[ny][nx] == '#')
            number++;
          else
            tmp++;
          A[ny][nx] = -1;
          que.push(P(ny, nx));
        }
      }
      if (y < H - 1) {
        int ny = y + 1, nx = x;
        if (S[y][x] != S[ny][nx] && A[ny][nx] != -1) {
          if (S[ny][nx] == '#')
            number++;
          else
            tmp++;
          A[ny][nx] = -1;
          que.push(P(ny, nx));
        }
      }
    }
    ans += tmp * number;
  }
  cout << ans << endl;
}


Measured memory_bytes: 5948
// Code by ajcxsu
// Problem: contain

#include<bits/stdc++.h>
using namespace std;

struct P {
    double x,y;
    P (double x=0.0, double y=0.0):x(x),y(y) {}

    P operator + (const P &b) { return P(x+b.x, y+b.y); }
    P operator - (const P &b) { return P(x-b.x, y-b.y); }

    double norm() { return x*x+y*y; }
    double abs() { return sqrt(norm()); }
} ;
typedef P Vector;

double dot(P x, P y) { return x.x*y.x+x.y*y.y; }
double cross(P a, P b) { return a.x*b.y-a.y*b.x; }

typedef vector<P> Polygon;

istream& operator >>(istream &in, P &a) {
    in>>a.x>>a.y;
    return in;
}

ostream& operator <<(ostream &out, P a) {
    out<<a.x<<' '<<a.y;
    return out;
}
#define EPS 1e-9

int contain(P x, Polygon &S) {
    bool res=0;
    for(int i=1, len=S.size(); i<len;i++) {
        Vector a=S[i-1]-x, b=S[i]-x;
        if(fabs(cross(a,b))<EPS && dot(a,b)<EPS) return 1;
        if(a.y>b.y) swap(a,b);
        if(a.y<EPS && b.y>EPS && cross(a,b)>EPS) res=!res;
    }
    return res?2:0;
}

Polygon S;
int n;

int main() {
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout<<setprecision(10);
    cin>>n;
    P na;
    for(int i=0;i<n;i++) cin>>na,S.push_back(na);
    S.push_back(S[0]);
    int q;
    cin>>q;
    while(q--) {
        cin>>na;
        cout<<contain(na,S)<<endl;
    }
    return 0;
}



Measured memory_bytes: 3292
n = int(input())
H = list(map(int,input().split()))
for i in range(n-2,-1,-1):
    if H[i] -1 > H[i+1]:
        print("No")
        exit()
    elif H[i] - 1 == H[i+1]:
        H[i] -= 1
print("Yes")

Measured memory_bytes: 14252