akhauriyash/Code-Regression huggingface dataset:
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#define INF          1e9
#define INFLL        1e18
#define EPS          1e-9
#define MOD          1000000007
#define REP(i,n)     for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)    for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)    for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)   for(ll i=(n);i>0;--i)
#define REPC(i,obj)  for(auto i:obj)
#define ALL(obj)     (obj).begin(),(obj).end()
#define SETP(n)      cout<<fixed<<setprecision(n)
#define VV(T,h,w)    vector<vector<T>>(h,vector<T>(w))
#define VVI(T,h,w,i) vector<vector<T>>(h,vector<T>(w,i))
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

ll mygcd(ll a, ll b)
{
    return b == 0 ? a : mygcd(b, a % b);
}
int main()
{
    ll n = in(); vector<ll>a(n); REP(i, n)a[i] = in();

    vector<ll>lgcd(n), rgcd(n);
    lgcd[0] = a[0]; rgcd[n - 1] = a[n - 1];
    REP(i, n) {
        lgcd[i] = mygcd(lgcd[i], a[i]);
        if (i != n - 1) lgcd[i + 1] = lgcd[i];
    }
    REPR(i, n) {
        rgcd[i] = mygcd(rgcd[i], a[i]);
        if (i != 0)rgcd[i - 1] = rgcd[i];
    }

    //REP(i, n)cout << lgcd[i] << ' '; cout << endl;
    //REP(i, n)cout << rgcd[i] << ' '; cout << endl;

    ll ans = max(lgcd[n - 2], rgcd[1]);
    REP1(i, n - 2) ans = max(ans, mygcd(lgcd[i - 1], rgcd[i + 1]));
    cout << ans << endl;
}

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

using namespace std;

int main() {
    list<int> q;
    auto it = q.end();
    int T;
    cin >> T;
    while (T--) {
        int x;
        cin >> x;
        if (x == 0) {
            int t;
            cin >> t;
            it = q.insert(it, t);
        }
        if (x == 1) {
            int d;
            cin >> d;
            if (d > 0) for (int i = 0; i < d; i++) ++it;
            else for (int i = 0; i < -d; i++) --it;
        }
        if (x == 2) {
            it = q.erase(it);
        }
    }
    it = q.begin();
    while (it!=q.end()) {
        cout << *it << endl;
        it++;
    }
    return 0;
}


Measured memory_bytes: 18556
import java.io.BufferedReader;
import java.util.*;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
import java.util.StringTokenizer;

 
public class Main {
	public static void main(String[] args) {
		FastScanner fs=new FastScanner();
		String s,t;
		s = fs.next();
		t = fs.next();
		int n = s.length();
		int m = t.length();
		int ans = Integer.MAX_VALUE;
		for(int i=0;i+m-1<n;i++) {
			int chn =0;
			for(int j=0;j<m;j++) {
				chn += (s.charAt(i+j)!=t.charAt(j))?1:0;
			}
			ans = Math.min(ans,chn);
		}
		System.out.println(ans);
		
	}
	static final Random random=new Random();
	static void ruffleSort(int[] a) {
		int n=a.length;//shuffle, then sort 
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
	
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}
 
	
}

Measured memory_bytes: 25788
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <math.h> // sqrt
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <iomanip> // setprecision
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vb = vector<bool>;
using vll = vector<long long>;
using pii = pair<int, int>;
using psi = pair<string, int>;

ll mod = 1000000007;

ll modpow(ll x, ll n) {
    x %= mod;
    if (n == 0) {
        return 1;
    }
    if (n % 2 == 1) {
        return (x * modpow(x, n - 1)) % mod;
    }
    else {
        return modpow((x * x) % mod, n / 2) % mod;
    }
}

ll comb(ll n, ll k) {
    ll x = 1;
    for (ll i = n - k + 1; i <= n; i++) {
        x = (x * i) % mod; 
    }
    ll y = 1;
    for (ll i = 1; i <= k; i++) {
        y = (y * i) % mod;
    }
    y = modpow(y, mod - 2);
    return (x * y) % mod;
}

int main() {
    int X, Y;
    cin >> X >> Y;
    ll ans = 0;
    int a = min(int(floor(X / 2)), Y);
    for (int i = a; i >= 0; i--) {
        if (2 * (X - (2 * i)) == Y - i) {
            int b = X - (2 * i);
            int k = min(i, b);
            ans = (ans + comb(ll(i + b), ll(k))) % mod;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 3552
#include <stdio.h>

int main(){
	int a,b,c=2000,d=2000,i,j;
	for(i=0;i<3;i++){
		scanf("%d",&a);
		if(a<=c){
			c=a;
		}
	}
	for(i=0;i<2;i++){
		scanf("%d",&b);
		if(b<=d){
			d=b;
		}
	}
	printf("%d\n",c+d-50);
	return 0;
}
			

Measured memory_bytes: 592
#include <iostream>
#include <cstdlib>

using namespace std;

int main() {
  int w;
  int prevcost = 4280, cost;
  while( 1 ) {
    cin >> w;
    if( w == -1 ) { break; }
    if( w <= 10 ) {
      cost = 1150;
    } else if( w <= 20 ) {
      cost = 1150 + 125 * ( w - 10 );
    } else if( w <= 30 ) {
      cost = 1150 + 1250 + 140 * ( w - 20 );
    } else {
      cost = 1150 + 1250 + 1400 + 160 * ( w - 30 ) ;
    }
    cout << ( prevcost - cost ) << endl;
  }

  return EXIT_SUCCESS;
}

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

int main()
{
    int n, x;
    while (true) {
        std::cin >> n >> x;
        if (n == 0 && x == 0) {
            break;
        }

        int ret = 0;
        for (int i = 1; i <= n - 2; ++i) {
            for (int j = i + 1; j <= n - 1; ++j) {
                for (int k = j + 1; k <= n; ++k) {
                    if ((i + j + k) == x) {
                        ++ret;
                    }
                }
            }
        }
        std::cout << ret << std::endl;
    }

    return 0;
}


Measured memory_bytes: 3084
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>  // sort, 二分探索, etc
#include <iomanip>  // setprecision (浮動小数点の出力の誤差)
#include <map>
#include <queue>
#include <set>
#include <stack>

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=a,i##_len=(b);i<i##_len;++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define cauto const auto&
#define UNIQUE(v) (v).erase( unique(all(v), (v).end() );
#define SZ(x) ((ll)(x).size()) // sizeをsize_tからllに直しておく
#define MAX(x) *max_element(all(x))
#define MIN(x) *min_element(all(x))
#define INF 1000000000000
#define MOD 1000000007
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

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

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

const char newl = '\n';

ll qp(ll a,ull b){ll ans=1;do{if(b&1u)ans*=a;a*=a;}while(b>>=1u);return ans;}
ll qp(ll a,ull b,ll mod){ll ans=1;do{if(b&1u)ans=ans*a%mod;a=a*a%mod;}while(b>>=1u);return ans;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll comb(int n, int r) {
    vector<vector<ll> > v(n+1, vector<ll>(r+1, 0));
    for(int i=0;i<n+1;i++) {v[i][0]=1; if(i < r+1)v[i][i]=1; }
    for(int i=1;i<n+1;i++) {for(int j=1;j<min(i,r+1);j++) {v[i][j]=v[i-1][j-1]+v[i-1][j];}}
    return v[n][r];
}

// INT_MAX   = 2.1e+09 (2147483647)
// LONG_MAX  = 9.2e+18 (9223372036854775807)
// LLONG_MAX = 9.2e+18 (9223372036854775807)


int main() {
    ll k; cin >> k;
    string s; cin >> s;

    if (s.size() <= k) {
        cout << s;
    } else {
        cout << s.substr(0, k) + "...";
    }


    return 0;
}


Measured memory_bytes: 3128
#include<iostream>
#include<string>
using namespace std;
int main(){
    for(;;){
		int h,w;
		cin>>h>>w;
		if(h==0&&w==0){
			break;
		}
		for(int i=0;h>i;i++){
			for(int j=0;w>j;j++){
				cout<<"#";
	}
	cout<<endl;
}
cout<<endl;
}
}



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


int main() {
    int N;
    cin >> N;
    vector<ll> A(N);
    ll S = 0;
    rep(i, N) {
        cin >> A[i];
        S += A[i];
    }
    vector<ll> X(N, 0);

    ll tmp = 0;
    for (int i=1; i<N; i+=2) tmp += A[i];
    X[0] = S - 2 * tmp;

    for (int i=0; i<N-1; ++i) {
        X[i+1] = 2*A[i] - X[i];
    }

    rep(i, N) {
        if (i) cout << " ";
        cout << X[i];
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 2944
#include<bits/stdc++.h>
using namespace std;
int main(void){
  int k; cin>>k;
  long long res=0;
  for(int a=1; a<=k; ++a) for(int b=1; b<=k; ++b) for(int c=1; c<=k; ++c) res+=gcd(gcd(a,b),c);
  cout<<res;
  return 0;
}

Measured memory_bytes: 3640
#!/usr/bin/env php
<?php
// Use ACGT strings.
const STRS = ['A','C','G','T'];
// AGC is NG, allow 1 exchange.
const NG_PATTERN = [
    'AGC',
    'ACG',
    'GAC',
    'A.GC',
    'AG.C',
];
const MOD = 1000000007;  # type: int

function is_ok($tail4string) {
    static $ok_cache = [];
    if (array_key_exists($tail4string, $ok_cache)) {
        return $ok_cache[$tail4string];
    }
    foreach (NG_PATTERN as $ng) {
        if (preg_match('/'.$ng.'/', $tail4string)) {
            $ok_cache[$tail4string] = false;
            return false;
        }
    }
    $ok_cache[$tail4string] = true;
    return true;
};

function sch($current, $last3string) {
    global $N;
    static $sch_cache = [];
    if (isset($sch_cache[$current][$last3string])) {
        return $sch_cache[$current][$last3string];
    }
    if ($current == $N) {
        return 1;
    }
    $ret = 0;
    foreach (STRS as $next) {
        if (is_ok($last3string . $next)) {
            $ret += sch($current + 1, substr($last3string, 1) . $next);
        }
    }
    $ret = $ret % MOD;
    $sch_cache[$current][$last3string] = $ret;
    return $ret;
};

fscanf(STDIN, '%d', $N);
echo sch(0, 'TTT').PHP_EOL;



Measured memory_bytes: 4984
import sys

def setLine(tempH, line):
    for i in range(0, len(line)):
        geo[tempH][i] = line[i:i+1]

def solve():
    person = 0
    for i in range(0,H):
        for j in range(0,W):
            if geo[i][j] is not "_":
                search(i,j)
                person += 1
    print(person)

def search(i,j):
    temp = geo[i][j]
    geo[i][j] = "_"
    dx = [-1,0,1,0]
    dy = [0,-1,0,1]
    for a in range(0,4):
        idx, jdy = i + dx[a], j + dy[a]
        if(isOnMap(idx, jdy)):
            if(isNeededToSolve(temp, idx, jdy)):
                search(idx,jdy)

def isOnMap(i,j):
    return (0<=i and 0<=j and i<H and j<W)

def isNeededToSolve(temp,i,j):
    target = geo[i][j]
    return (target is not "_" and temp is target)

limit = 10**7
sys.setrecursionlimit(limit)
H, W, tempH = -1, -1, 0
geo = [[0 for i in range(1)]for j in range(1)]
while True:
    line = input()
    if H is -1 and W is -1:
        p = line.split(" ")
        H, W = int(p[0]), int(p[1])
        geo = [[0 for i in range(W)] for j in range(H)]
    else:
        setLine(tempH, line)
        tempH+=1

    #break
    if H is 0 and W is 0:
        break

    #solve
    if tempH is H:
        solve()
        H, W, tempH = -1, -1, 0

Measured memory_bytes: 19076
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++){
    cin >> A[i];
  }
  vector<int> B(N), C(N);
  for (int i = 0; i < N; i++){
    B[i] = A[i] + i + 1;
    C[i] = i + 1 - A[i];
  }
  map<int, int> M;
  for (int i = 0; i < N; i++){
    M[B[i]]++;
  }
  long long ans = 0;
  for (int i = 0; i < N; i++){
    ans += M[C[i]];
  }
  cout << ans << endl;
}

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

int main() {
	int n, p;
    cin >> n >> p;
    vector<int> even, odd;
    for (int i = 0; i < n; i++){
        int tmp;
        cin >> tmp;
        tmp % 2 == 0 ? even.push_back(tmp) : odd.push_back(tmp);
    }

    int64_t ret = 0;
    if (odd.size() == 0){
        ret = (p == 0 ? round(pow(2, n)) : 0);
    }
    else{
        ret = round(pow(2, n - 1));
    }

    cout << ret << endl;
}

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

using namespace std;

int main()
{
  int N;
  cin >> N;
  vector<long long> A(N), B(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i] >> B[i];
  }
  reverse(A.begin(), A.end());
  reverse(B.begin(), B.end());
  long long sum = 0;
  for (int i = 0; i < N; i++) {
    sum += (B[i] - (sum + A[i]) % B[i]) % B[i];
  }
  cout << sum << endl;

  return 0;
}


Measured memory_bytes: 1792
def Partition(A,p,r):
    x = A[r]
    i = p-1
    for j in range(p,r):
        if (A[j] <= x):
            i += 1
            A[i],A[j] = A[j],A[i]
    A[i+1],A[r] = A[r],A[i+1]
    return i+1

n = int(input())
st = input()
data = list(map(int,st.split()))

mid = Partition(data,0,len(data)-1)
for i in range(0,mid):
    print(data[i],end=" ")
print("[{0}] ".format(data[mid]),end="")
for i in range(mid+1,len(data)-1):
    print(data[i],end=" ")
print(data[len(data)-1])

Measured memory_bytes: 18768
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vll = vector<vector<ll>>;
using pii = pair<int,int>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define eb(val) emplace_back(val)
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9+7;
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}
int main(){
  ll n;
  cin >> n;//偶数
  vl odd(1e5+1,0),end(1e5+1,0);//1~1e5までのindexに頻度を入れる
                               //ここでoddは奇数番目,endは偶数番目のtableである。
  REP(i,n/2){
    ll tmp;
    cin >> tmp;
    odd[tmp]++;
    cin >> tmp;
    end[tmp]++;
  }
  auto om = max_element(ALL(odd));//最頻値のイテレータ
  auto em = max_element(ALL(end));
  auto omi = distance(odd.begin(),om);//最頻値の値
  auto emi = distance(end.begin(),em);
  ll ans = 0;
  if(emi==omi){//oddとendで最頻値が同じ時
    ll om1 = *om;
    ll em1 = *em;
    *om = 0;
    *em = 0;
    om = max_element(ALL(odd));
    em = max_element(ALL(end));
    ans = n - max(om1+(*em),em1+(*om));
  }else{
    ans = n - *om - *em;
  }
  cout << ans << endl;//(n/2-*om)+(n/2-*em):oddとendの最頻値頻度をn/2から引く
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define LL long long
#define INF 0x3f3f3f3f
#define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const int N=2e5+100;
using namespace std;
int main()
{
	io;
	string str;
	while(cin>>str)
	{
		int len=str.length();
		int f=0;
		for(int i=0;i<=len-1;i++)
		{
			if(str[i]==str[i+1]&&i+1<len)
			{
				f=1;
				cout<<i+1<<" "<<i+2<<endl;
				break;
			}
			else if(str[i]==str[i+2]&&i+2<len)
			{
				cout<<i+1<<" "<<i+3<<endl;
				f=1;
				break;
			}
		}
		if(f==0)cout<<-1<<" "<<-1<<endl;
	}
	return 0;
}

Measured memory_bytes: 764
// C++ program to find if a number is divisible by
// 9 or not
#include<bits/stdc++.h>
using namespace std;

// Function to find that number divisible by 9 or not
int check(string str)
{
	// Compute sum of digits
	int n = str.length();
	int digitSum = 0;
	for (int i = 0; i < n; i++)
		digitSum += (str[i] - '0');

	// Check if sum of digits is divisible by 9.
	return (digitSum % 9 == 0);
}

// Driver code
int main()
{
	string str ;
	cin >> str;
	check(str) ? cout << "Yes" : cout << "No ";
	return 0;
}


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

int main(void){
char W[10];
char T[1000];
int i,sum=0;
	
	scanf("%s", W);
	
	while(1){
		scanf("%s", T);
		
		if(strcmp(T, "END_OF_TEXT") ==0){
		break;
		}

		for(i=0;T[i] != '\0'; i++){
			if('A'<=T[i] && T[i]<='Z'){
				T[i]+=32;
			}
		}
		if(strcmp(T,W) ==0){
		sum++;
		}
	}
	printf("%d\n", sum);
return 0;
}



Measured memory_bytes: 2104
#include<iostream>

using namespace std;

int main()
{
	int N,K;
	int cnt = 0;

	cin >> N >> K;

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

	if(cnt >= K)
	{
		cout << "YES" << endl;
	}
	else
	{
		cout << "NO" << endl;
	}

	return 0;
}

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

using namespace std;

int main(){
  int N;
  cin >> N;
  int px,py,pt;
  pt = 0;
  px = 0;
  py = 0;
  
  int f = 0;
  for(int i = 0; i < N; i++){
    int ct, cx, cy;
    cin >> ct >> cx >> cy;
    if((long long int)(abs(cx - px) + abs(cy - py)) > (long long int)(ct - pt) || (long long int)((abs(cx - px) + abs(cy - py)) - (long long int)(ct - pt))% 2 != 0){
      f = 1;
      break;
    }
    pt = ct;
    px = cx;
    py = cy;
  }
    if(f) cout << "No";
    else cout << "Yes";
}


Measured memory_bytes: 256
import java.util.Scanner;
//
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
		int n=sc.nextInt();
		int ans =0;
		for (int i=1;2*i-1<=n;i++) {
			if(divisorCount(2*i-1)==8) {
				ans++;
			}
		}
		System.out.println(ans);
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
	}
	//----------------------------------------
	//置き場
	static int divisorCount(int n) {
		int res=0;
		for (int i=1;i<=n;i++) {
			if (n%i==0) {
				res++;
			}
		}
		return res;
	}
	//----------------------------------------
}

Measured memory_bytes: 21844
// https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_a

#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define rep1(i, to) for (ll i = 1; i <= (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
#define repr(i, from) for (ll i = from - 1; i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define unless(cond) if (!(cond))
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
using VVL = V<VL>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;

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

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

template <typename T>
inline ll len(V<T> arr) {
  return arr.size();
}

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}

const ll INF = 1e18;

void solve();

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

void solve() {
  ll X;
  cin >> X;

  if (400 <= X && X <= 599) drop(8);
  if (600 <= X && X <= 799) drop(7);
  if (800 <= X && X <= 999) drop(6);
  if (1000 <= X && X <= 1199) drop(5);
  if (1200 <= X && X <= 1399) drop(4);
  if (1400 <= X && X <= 1599) drop(3);
  if (1600 <= X && X <= 1799) drop(2);
  if (1800 <= X && X <= 1999) drop(1);
}


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

public class Main {
    public static void main(String args[]) throws Exception{
        BufferedReader stdR = new BufferedReader(new InputStreamReader(System.in));
        String str = stdR.readLine();
        int count = 0;
        int zero = 0;
        int one = 0;
        for(int i = 0 ; i < str.length() ; i++) {
            if(str.charAt(i) == '0')zero++;
            if(str.charAt(i) == '1')one++;
            int min = Math.min(zero, one);
            if(min > 0) {
                zero -= min;
                one -= min;
                count += min * 2;
            }
        }
        System.out.println(count);
    }
}


Measured memory_bytes: 24276
//参考：http://ehafib.hatenablog.com/entry/2015/12/23/164517
//インクルード
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000
#define NCK_MAX 510000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

ll myPow(ll x, ll n, ll m){
  if(n == 0)
    return 1;
  if(n % 2 == 0)
    return myPow(x * x % m, n / 2, m);
  else
    return x * myPow(x, n - 1, m) % m;
}


ll fac[NCK_MAX], finv[NCK_MAX], inv[NCK_MAX], facn[NCK_MAX];

// テーブルを作る前処理
void COMinit(ll n) {
    fac[0] = fac[1] = 1;
    facn[1] = n;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < NCK_MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        facn[i] = facn[i-1] * (n-i+1) % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
ll modinv(ll a, ll mod){
  return myPow(a, mod - 2, mod);
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return facn[k] * finv[k] % MOD;
}

int main(int argc, char const *argv[]) {
  ll n, a, b, ans;
  std::cin >> n >> a >> b;
  COMinit(n);
  ans = (myPow(2,n,MOD)-1 + MOD) %MOD;
  ans = (ans - COM(n,a)+MOD)%MOD;
  ans = (ans -COM(n,b)+MOD)%MOD;
  std::cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 16128
#include<cstdio>

int main() {
  int operand1, operand2;
  char op;
  int result;
  bool end_input = false;

  while(true) {
    scanf("%d %c %d%", &operand1, &op, &operand2);

    if(op == '?') {
      break;
    }

    switch(op) {
      case '+':
        result = operand1 + operand2;
        break;
      case '-':
        result = operand1 - operand2;
        break;
      case '*':
        result = operand1 * operand2;
        break;
      case '/':
        result = operand1 / operand2;
        break;
      case '?':
        end_input = true;
    };

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



Measured memory_bytes: 2660
#[allow(dead_code)]
pub struct Scanner<'a> {
    _buf: &'a str,
    iter: ::std::str::SplitWhitespace<'a>,
}

#[allow(dead_code)]
impl<'a> Scanner<'a> {
    pub fn new(buf: &'a str) -> Self {
        Scanner {
            _buf: buf,
            iter: buf.split_whitespace(),
        }
    }

    pub fn array<T>(&mut self, n: usize) -> Vec<T>
        where T: ::std::str::FromStr,
              T::Err: ::std::fmt::Debug,
    {
        let mut res = Vec::with_capacity(n);
        for _ in 0..n {
            res.push(self.value());
        }
        res
    }

    pub fn value<T>(&mut self) -> T
        where T: ::std::str::FromStr,
              T::Err: ::std::fmt::Debug,
    {
        self.next().parse().unwrap()
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.next().chars().collect()
    }

    fn next(&mut self) -> &str {
        self.iter.next().unwrap()
    }
}

fn count_divisors(cnt: &mut [i64], mut x: i64) {
    for d in 2.. {
        if x == 1 { break; }
        while x % d == 0 {
            cnt[d as usize] += 1;
            x /= d;
        }
    }
}

fn main() {
    let mut _input = String::new();
    {
        use ::std::io::Read;
        ::std::io::stdin().read_to_string(&mut _input).unwrap();
    }
    let mut sc = Scanner::new(&_input);

    let n = sc.value::<i64>();

    let mut cnt = vec![0_i64; 100];
    for i in 2..n+1 {
        count_divisors(&mut cnt, i);
    }
    //eprintln!("{:?}", cnt);

    let mut ans = 0_i64;

    // a^74
    let m = cnt.iter().filter(|&&e| 74 <= e).count() as i64;
    ans += m;

    // a^24 * b^2
    let ma = cnt.iter().filter(|&&e| 24 <= e).count() as i64;
    let mb = cnt.iter().filter(|&&e|  2 <= e && e < 24).count() as i64;
    ans += ma * (ma-1);
    ans += ma * mb;

    // a^14 * b^4
    let ma = cnt.iter().filter(|&&e| 14 <= e).count() as i64;
    let mb = cnt.iter().filter(|&&e|  4 <= e && e < 14).count() as i64;
    ans += ma * (ma-1);
    ans += ma * mb;

    // a^4 * b^4 * c^2
    let ma = cnt.iter().filter(|&&e| 4 <= e).count() as i64;
    let mb = cnt.iter().filter(|&&e| 2 <= e && e < 4).count() as i64;
    ans += ma * (ma-1) * (ma-2) / 2;
    ans += ma * (ma-1) / 2 * mb;

    println!("{}", ans);
}


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

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);
	ll n;
	cin>>n;
	ll odd=0,two=0,four=0;
	for(int i=0;i<n;++i){
		ll x;
		cin>>x;
		odd+=x&1;
		if(x%2==0&&x%4!=0) two++;
		if(x%4==0) four++;
	}
	n-=two;
	if(!n||(!two&&four+1>=odd)||(two&&four==odd)) cout<<"Yes\n";
	else cout<<"No\n";
}



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

#define int long long

int l, r, ans;

int32_t main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> l >> r;
	if (r - l < 10) {
		for (int i = l; i <= r; i++)
			ans ^= i;
		cout << ans << endl;
		return 0;
	}
	
	while (l % 4)
		ans ^= l, l++;
	while (r % 4 != 3)
		ans ^= r, r--;
	cout << ans << endl;
}

Measured memory_bytes: 256
S = list(map(int, input().strip()))

T = [(1 + (-1)**i) / 2 for i in range(len(S))]
U = [(1 + (-1)**(i-1)) / 2 for i in range(len(S))]

st = sum([abs(s-t) for s, t in zip(S, T)])
su = sum([abs(s-u) for s, u in zip(S, U)])

print(int(min(st, su)))

Measured memory_bytes: 13344
import sys
def check_ans(t,x,y,nt,nx,ny):
    if (x+y) > (nx+ny+t):
        print("No")
        sys.exit()    
    if (x >= nx):
        nt += (x-nx)
    elif(x <= nx):
        nt += (nx-x)
    if (y >= ny):
        nt += (y-ny)
    elif(y <= ny):
        nt += (ny-y)
    if (t-nt)%2 != 0:
        print("No")
        sys.exit()

N = int(input())
nt = 0
nx = 0
ny = 0
t = []
x = []
y = []
#入力
for i in range(N):
    temp = input().split(" ")
    t.append(temp[0])
    x.append(temp[1])
    y.append(temp[2])
for i in range(N):
    if i == 0:
        check_ans(int(t[i]), int(x[i]), int(y[i]), nt, nx, ny)
    else:
        nt = int(t[i-1])
        nx = int(x[i-1])
        ny = int(y[i-1])
    check_ans(int(t[i]), int(x[i]), int(y[i]), nt, nx, ny)
print("Yes")

Measured memory_bytes: 16756
// Created by ...
#include <bits/stdc++.h>

#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'

#define vll vector< ll >
#define M 100000
#define MD 1000000007
#define pb push_back
#define rep(i,a,b) for(ll i = a; i <= b; ++i)
#define fo(i,a,b) for(int i = a; i<= b; ++i)
#define pii pair<ll,ll> 
#define vec(a) vector<a >
#define all(a) a.begin(),a.end()
#define se second
#define fi first
#define inf 0xffffffff
#define inchar getchar_unlocked
#define outchar(x) putchar_unlocked(x)
#define int long long
#define endl '\n'
#define IOS ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

using namespace std;
using ll = long long;
ll md=MD;

ll exp(ll a,ll b){ll r=1ll;while(b>0){if(b&1){r=r*(a%md);r=(r+md)%md;}b>>=1;a=(a%md)*(a%md);a=(a+md)%md;}return (r+md)%md;}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll Min(ll a,ll b){if(a<b)return a; return b;}
ll Max(ll a,ll b){if(a>b)return a; return b;}
int32_t main() {
    IOS;

        string s,t; cin>>s>>t;
        if(s.size()+1!=t.size())
        {
        	cout<<"No"; return 0;
        }
        //foo=false;
        rep(i,0,s.size()-1)if(s[i]!=t[i])
        {
        	cout<<"No"; return 0;
        }
        cout<<"Yes";


        cout<<'\n';
    return 0;
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep1(i,n) for(int i=1; i<=(n); ++i)
#define repi(i,a,b) for(int i=a; i<=(b); ++i)
#define rrep(i,n) for(int i=(n-1); i>=0; --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define pb push_back
#define mp make_pair
#define sz(v) (int)v.size()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define pr(x) cout<<(x)<<'\n'
#define debug(x) cout << #x << ": " << (x) << '\n'
#define yes "Yes"
#define no "No"
using ll = long long;
using namespace std;
typedef pair<int,int> P;
struct aaa{aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}aaaaaaa;
int MOD = 1e9 + 7;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int N,M,tp;
int ct = 0;
vector<string> strs;
string str = "";

void dfs(int num, string state){
    if(num == N){strs.pb(state); return;}
    dfs(num+1,state+'0');
    dfs(num+1,state+'1');
}

int main(){
    cin >> N >> M;
    vector<int> k(M),p(M);
    int s[N][M];
    rep(i,M){
        cin >> k[i];
        rep(j,k[i]) cin >> s[i][j];
    }
    rep(i,M) cin >> p[i];
    dfs(1,"0");
    dfs(1,"1");
    int ans = 0;
    rep(x,sz(strs)){
        bool flag = true;
        rep(i,M){
            int ct = 0;
            rep(j,k[i]) ct += strs[x][s[i][j]-1];
            if(ct % 2 != p[i]) flag = false;
        }
        if(flag) ans++;
    }
    pr(ans);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define INF 1000000
using namespace std;
typedef pair<int,int> P;
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
bool start_flag,color_flag;
char table[50][50];
char color;
bool flag_table[50][50];
int w,h;
queue<char> tmp;
queue<P> que;
void dfs(int y, int x){
    que.push(P(y,x));    
    flag_table[y][x] = true;
    if(start_flag == true) color = tmp.front();
    rep(i,4){
        int ny = y+dy[i];
        int nx = x+dx[i];
        if(ny < 0 || nx < 0 || ny >= h || nx >= w || flag_table[ny][nx] == true) continue;
        if(start_flag == false && table[ny][nx] != '.'){
            start_flag = true;
            color = table[ny][nx];
            tmp.push(color);
        }
        else if(start_flag == true && table[ny][nx] != color && table[ny][nx] != '.'){
            color_flag = true;
        }
        if(table[ny][nx] == '.')  dfs(ny,nx);
    }
}
int main(){
    while(cin >> w >> h){
        if(h == 0 && w == 0) break;
        rep(i,h) rep(j,w) cin >> table[i][j];
        int cnt_black = 0;
        int cnt_white = 0;
        rep(i,h) rep(j,w) flag_table[i][j] = false;
        while(!que.empty()) que.pop();
        while(!tmp.empty()) tmp.pop();
        rep(i,h){
            rep(j,w){
                start_flag = false;
                color_flag = false;
                color = '.';
                if(table[i][j] != '.' || flag_table[i][j] == true) continue;
                dfs(i,j);
                if(color_flag == false){
                    while(!que.empty()){
                        pair<int,int> pi = que.front();
                        que.pop();
                        table[pi.first][pi.second] = color;
                        if(color == 'B') cnt_black++;
                        if(color == 'W') cnt_white++;
                    }
                }
                while(!que.empty()) que.pop();
                while(!tmp.empty()) tmp.pop();
            }
        }
        cout << cnt_black << " " << cnt_white << endl;
    }
    return 0;
}



Measured memory_bytes: 3376
#include <iostream>
#include <vector>
#include <numeric>
#include <string>
#include <complex>
#include <iomanip>
using namespace std;
typedef complex<double> P;
const double EPS = 1e-10;

namespace std
{
bool operator<(P &a, P &b)
{
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
}
} // namespace std

double dot(P a, P b)
{
    return real(a) * real(b) + imag(a) * imag(b);
}

double cross(P a, P b)
{
    return real(a) * imag(b) - imag(a) * real(b);
}

int main(void)
{

    double a, b, c, d;
    cin >> a >> b >> c >> d;

    P p1(a, b);
    P p2(c, d);
    int q;
    cin >> q;
    for (int i = 0; i < q; ++i)
    {
        double a, b;
        cin >> a >> b;
        P p(a, b);

        P x;
        x = p1 + dot(p - p1, p2 - p1) * (p2 - p1) / pow(abs(p2 - p1), 2.0);

        P reflection;
        reflection = x + x - p;

        cout << fixed << setprecision(15) << reflection.real() << " " << reflection.imag() << endl;
    }
}


Measured memory_bytes: 3340
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let a: u32 = sc.read();
    let b: u32 = sc.read();
    let c: u32 = sc.read();
    let d: u32 = sc.read();
    let e: u32 = sc.read();
    let f: u32 = sc.read();
    let mut a_conc = 0.0;
    let mut a_ws: u32 = 0;
    let mut a_sugar: u32 = 0;
    for i in 0..f {
        for j in 0..f {
            let water = 100*a*i+100*b*j;
            if water > f {
                break;
            }
            for ii in 0..f {
                for jj in 0..f {
                    let sugar = c*ii+d*jj;
                    if water + sugar > f || sugar > water/100*e {
                        break;
                    } else {
                        let conc = 100.0 * sugar as f32 / (water as f32 + sugar as f32);
                        if conc >= a_conc {
                            a_conc = conc;
                            a_ws = water+sugar;
                            a_sugar = sugar;
                        }
                    }
                }
            }
        }
    }
    println!("{} {}", a_ws, a_sugar);
}

// Thanks, kenkoooo(https://kenkoooo.hatenablog.com/entry/2019/05/07/101033)
pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}

Measured memory_bytes: 4352
#include<iostream>

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

using namespace std;

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

    ll ans1 = 0;
    for(ll i = 0; s[i]; i++){
        if(i % 2 == 0){
            if(s[i] == '0') ans1++;
        }
        else{
            if(s[i] == '1') ans1++;
        }
    }

    ll ans2 = 0;
    for(ll i = 0; s[i]; i++){
        if(i % 2 == 0){
            if(s[i] == '1') ans2++;
        }
        else{
            if(s[i] == '0') ans2++;
        }
    }

    cout << min(ans1, ans2) << endl;
}

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

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

const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;

#define rep(i, a, b) for(ll (i) = (a); (i) < (b);++i)

ll gcd(ll x, ll y)
{
  if (x % y == 0)
  {
    return y;
  }
  return gcd(y, x % y);
}

int main()
{
  string A;
  cin >> A;
  if (A[0] == '9' || A[1] == '9')
  {
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}

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

using namespace std;
typedef long long ll;
const ll MOD=1e9+7;           /*******MOD***********超过long long 一点不要紧*****/

const int maxn = 12;
typedef pair<int,int> pii;

int res;
int p[maxn], c[maxn], v[maxn];
int n, m;
void dfs(int sum, int po){
    if(po <= 0){
        res = min(res, sum);
        return ;
    }
    for (int i = 0; i < n; ++i) {
        int t = p[i] * (i + 1) * 100;
        if(v[i])continue;
        if(p[i] * (i + 1) * 100 >= po){
            dfs(sum + (po % ((i + 1) * 100 ) == 0 ? po / (i + 1) / 100 : po / (i + 1) / 100  + 1), 0);
        } else if(t + c[i] >= po){
            dfs(sum + p[i], 0);
        } else {
            v[i] = 1;
//            cerr << "ca" << endl;
            dfs(sum + p[i], po - t - c[i]);
            v[i] = 0;
        }
    }
}

char a[maxn], b[maxn];
int main(){
    cin >> n >> m;
    memset(v, 0, sizeof(v));
    for (int i = 0; i < n; ++i) {
        cin >> p[i] >> c[i];
    }
    res = INT_MAX;
    dfs(0, m);
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <numeric>
#include <regex>
#include <tuple>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007 // 10^9 + 7
#define INF 1000000000 // 10^9
#define LLINF 1LL<<60

string S[10000];
int num[10000]; // S[i]に含まれるABの数
//bool topB[10000];
//bool lastA[10000];

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

	int N; cin >> N;
	int topB = 0;
	int lastA = 0;
	int BA = 0;
	for (int i = 0; i < N; i++) {
		cin >> S[i];
		for (int j = 0; j < S[i].size() - 1; j++) {
			if (S[i][j] == 'A' && S[i][j + 1] == 'B') num[i]++;
		}
		if (S[i][0] == 'B') {
			//topB[i] = true;
			topB++;
		}
		if (S[i][S[i].size() - 1] == 'A') {
			//lastA[i] = true;
			lastA++;
		}
		if (S[i][0] == 'B' && S[i][S[i].size() - 1] == 'A') BA++;
	}


	ll ans = 0;
	for (int i = 0; i < N; i++) {
		ans += num[i];
		//cout << num[i] << " ";
	}
	if (BA == topB && BA == lastA && BA != 0) ans += topB - 1;
	else ans += min(lastA, topB);
	cout << ans << endl;

	return 0;
}

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

int gcd(int a, int b){
  if(a % b == 0) return b;
  else return gcd(b, a % b);
}

int main(){
  int k;
  cin >> k;
  long long ans = 0;
  for(int i = 0; i < k; i++){
    for(int j = 0; j < k; j++){
      for(int l = 0; l < k; l++){
        ans += gcd(gcd(i + 1, j + 1), l + 1);
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3624
# ABC123B(t):

import numpy as np

def next_permutation(x):
    '''
    import numpy as np
    x = np.arange(3)+1
    while True:
        print(x)
        if next_permutation(x) == 0:
            break
    '''
    n = len(x)
    pos1 = -1
    for i in reversed(range(0, n-1)):
        if x[i] < x[i + 1]:
            pos1 = i
            break
    if pos1 == -1:
        return 0
    for i in reversed(range(pos1+1, n)):
        if x[pos1] < x[i]:
            pos2 = i
            break
    x[pos1], x[pos2] = x[pos2], x[pos1]
    for i in range(1, (n - 1 - pos1) // 2 + 1): # i = 1
        x[pos1 + i], x[n - i] = x[n - i], x[pos1 + i]
    return 1

t = [0] * 5
for i in range(5):
    t[i] = int(input())
t = sorted(t)
p = np.arange(len(t))
Min = np.inf
while True:
    time = t[p[4]]
    for i in range(4):
        time += np.ceil(t[p[i]] / 10)*10
    Min = min(Min, time)
    if next_permutation(p) == 0:
        break
print(int(Min))



Measured memory_bytes: 12504
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;

public class Main {

	static final int WHITE = 0;
	static final int GRAY = 1;
	static final int BLACK = 2;

	static int n;
	static int[][] v;
	static int[] color;
	static Queue<Integer> queue;
	static int[] d;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		v = new int[n][n];
		for (int i = 0; i < n; i++) {
			int u = sc.nextInt();
			u--;
			int k = sc.nextInt();
			for (int j = 0; j < k; j++) {
				int vv = sc.nextInt();
				vv--;
				v[u][vv] = 1;
			}
		}
		sc.close();

		color = new int[n];
		for (int i = 0; i < n; i++) {
			color[i] = WHITE;
		}

		d = new int[n];
		for (int i = 0; i < n; i++) {
			d[i] = -1;
		}

		bfs();

		for (int i = 0; i < n; i++) {
			System.out.print(i + 1);
			System.out.print(" ");
			System.out.println(d[i]);
		}
	}

	private static void bfs() {
		queue = new ArrayDeque<>();
		queue.offer(0);
		d[0] = 0;
		color[0] = GRAY;
		while (queue.peek() != null) {
			int visit = queue.poll();
			color[visit] = GRAY;
			for (int i = 0; i < n; i++) {
				if (v[visit][i] == 1 && color[i] == WHITE) {
					queue.offer(i);
					d[i] = d[visit] + 1;
					color[i] = GRAY;
				}
			}
			color[visit] = BLACK;
		}
	}

}

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

int main() {
  int N;
  int guest_number = 0;
  
  cin >> N;
  for(int i = 0; i < N; i++){
    int l, r;
    cin >> l >> r;
    guest_number += r - l + 1;
  }
  cout << guest_number << endl;
   
  
}



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

using ll = long long;
using pii = pair<ll, ll>;
using vi = vector<ll>;
using vvi = vector<vi>;

template <class T>
using max_heap = priority_queue<T>;
template <class T>
using min_heap = priority_queue<T, vector<T>, greater<T>>;

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

#define rep(i, j) for (int i = 0; i < j; i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define debug(x) cerr << #x << ": " << x << endl;
#define int ll

const ll mod = 1e9 + 7;
const ll inf = (1LL << 50);

void solve(long long N, long long K, long long C, std::string S) {
    vi vl(K), vr(K);
    int li = 0;
    rep(i, K) {
        while (S[li] == 'x' and li < N - 1) {
            li++;
            // cout << " li " << li << " " << S[li] << endl;
        }

        vl[i] = li;
        li += C + 1;
    }
    int lr = N - 1;
    rep(ii, K) {
        int i = K - ii - 1;
        while (S[lr] == 'x' and lr > 0) lr--;
        vr[i] = lr;
        lr -= C + 1;
    }
    rep(i, K) {
        if (vl[i] == vr[i]) {
            cout << vl[i] + 1 << endl;
        }
        // cout << vl[i] << " " << vr[i] << endl;
    }
    return;
}
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;

    long long N;
    long long K;
    long long C;
    std::string S;
    std::cin >> N >> K >> C >> S;
    solve(N, K, C, S);
    return 0;
}


Measured memory_bytes: 5140
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
#define INF 1000000007
#define fori for(int i=0;i<3;i++)

int main(){
	int tmp,t=5,k;
	while(t--){
		cin>>tmp;
		if(!tmp)k=5-t;
	}
	cout<<k;
	return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <set>
using namespace std;
typedef long long int ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define yes cout << "yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define no cout << "no" << endl

const int INF = 1001001001;
const int mod = 1000000007;
#define PI 3.14159265359;

void P(int x) {cout << x << endl;}
void P(long x) {cout << x << endl;}
void P(double x) {cout << x << endl;}
void P(ll x) {cout << x << endl;}
void P(string x) {cout << x << endl;}
void P(char x) {cout << x << endl;}

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

int main() {
  int n;
  cin >> n;
  if (n % 7 == 0 || n % 4 == 0) {
    Yes;
    return 0;
  }
  for (int i = 0; i * 4 < n; i++) {
    int total = 4 * i;
    if ((n - total) % 7 == 0) {
      Yes;
      return 0;
    }
  }
  No;
  return 0;
}



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

const ll p = 1e9+7;

ll tot[200005], dp[200005], n;
vector<int> c;

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

	cin >> n;
	for (int i = 0; i < n; ++i) {
		int k; cin >> k;
		if (c.empty())
			c.push_back(k);
		else if (k != c.back())
			c.push_back(k);
	}
	n = c.size();
	for (int i = 0; i < n; ++i) {
		if (i == 0)
			tot[c[0]] = dp[0] = 1;
		else
			dp[i] = tot[c[i]];
		if (i < n-1)
			tot[c[i+1]] = (tot[c[i+1]]+dp[i])%p;
		// cout << dp[i] << endl;
	}
	cout << dp[n-1] << endl;
}

Measured memory_bytes: 4340
#include <iostream>

using namespace std;

int main() {
    int n, d;
    cin >> n >> d;
    int scope = d * 2 + 1;
    int numPeople = 1;
    while (true) {
        if (scope * numPeople >= n) break;
        ++numPeople;
    }
    cout << numPeople << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define FOR(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
using namespace std;

void _main() {
    int N, K;
    cin >> N >> K;
    vector<int> cnt(N, 0);
    REP (i, K) {
        int d;
        cin >> d;
        REP (j, d) {
            int A;
            cin >> A;
            cnt[A - 1]++;
        }
    }
    int ans = 0;
    REP (i, N) {
        ans += (cnt[i] == 0);
    }
    cout << ans << endl;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    _main();
    return 0;
}

Measured memory_bytes: 3608
// ABC085C - Otoshidama
package main

import "fmt"

func main() {
	var N, sum int
	fmt.Scanf("%d %d", &N, &sum)
	sum /= 1000

	// 10, 5, 1
	var n10, n5, n1 int

	n1 = sum % 5
	N -= n1
	sum -= n1

	// n10 * 10 + n5 * 5 = sum
	// n10 + n5 = N
	// n10 = sum/5 - N
	// n5  = 2N - sum/5

	for N >= 0 {
		n10 = sum/5 - N
		n5 = 2*N - sum/5

		if n1 >= 0 && n5 >= 0 && n10 >= 0 {
			fmt.Printf("%d %d %d\n", n10, n5, n1)
			return
		}

		n1 += 5
		N -= 5
		sum -= 5
	}

	fmt.Println("-1 -1 -1")
}


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

int main() {
    int n, q;
    vector<int> s;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
        int t; scanf("%d", &t);
        s.push_back(t);
    }
    cin >> q; int c = 0;
    while (q--) {
        int t; scanf("%d", &t);
        int left = 0, right = n;
        bool flag = false;
        while (left < right) {
            int mid = (left + right) / 2;
            if (s[mid] == t) { flag = true; break; }
            else if (s[mid] < t) { left = mid + 1; }
            else { right = mid; }
        }
        if (flag) { c++; }
    }
    cout << c << endl;
}

Measured memory_bytes: 3520
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store") // to restrict undesirable precision
#pragma GCC optimize ("-fno-defer-pop")// to pop argument of function as soon as it returns
#define all(a) a.begin(),a.end()
#define ll long long int
#define ld long double
ll power(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=power(a,b/2,m)%m; t=(t*t)%m; if(b&1) t=((t%m)*(a%m))%m; return t;}
ll modInverse(ll a, ll m) { return power(a, m-2, m); }
#define ps push_back
#define fs first
#define takeline cin.ignore();
#define sc second
#define N 3000005
#define endl "\n"
#define mod 1000000007
//((1.0l)*BIG MULTIPLY MAGIC?)
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();
//-----------------------------------------------
int main(){
	
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	
	ll a,b;
	cin>>a>>b;
	ll ans=max((ll)0,a-2*b);
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256