akhauriyash/Code-Regression huggingface dataset:
n = int(input())

S = set()
H = set()
C = set()
D = set()

for i in range(1, 14):
    S.add(i)
    H.add(i)
    C.add(i)
    D.add(i)

for i in range(n):
    sp = input()
    spSpl = sp.split()

    tp = spSpl[0]
    num = int(spSpl[1])

    if(tp == 'S'):
        S.remove(num)
    elif(tp == 'H'):
        H.remove(num)
    elif(tp == 'C'):
        C.remove(num)
    else:
        D.remove(num)

for s in S:
    print('S', s)

for s in H:
    print('H', s)

for s in C:
    print('C', s)

for s in D:
    print('D', s)



Measured memory_bytes: 5608
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

bool solve(string& s) {
  REP(i, (int)s.size() - 1) {
    if (s[i] == 'A' && s[i + 1] == 'C')
      return true;
  }
  return false;
}

int main() {
  string s;
  cin >> s;
  if (solve(s))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


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

int main() {
	string s, t;
	cin >> s;
	cin >> t;
	for (int i = s.length() - t.length(); i >= 0; i--) {
		string ss = s.substr(i, t.length());
		bool ac = true;
		for (int j = 0; j < t.length(); j++) {
			if (ss.at(j) != t.at(j)) {
				if (ss.at(j) != '?')ac = false;
			}
		}
		if (ac) {
			s = s.substr(0, i) + t + s.substr(i + t.length());
			for (int j = 0; j < s.length(); j++) {
				if (s.at(j) == '?')s.at(j) = 'a';
			}
			cout << s << endl;
			return 0;
		}
	}
	cout << "UNRESTORABLE" << endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void){
    int a, b, c;

    scanf("%d", &a);
    scanf("%d", &b);
    scanf("%d", &c);
    
    int w, d;
    
    w = (c-1) / (7*a+b);
    c -= w*(7*a+b);
    d = 0;
    
    while(c>0){
        d++;
        c -= a;
    }
    if(d>7) d=7;

    printf("%d\n", d + 7*w);
    return 0;
    
}



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

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string>vst;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
#define all(ct) ct.begin() , ct.end()
#define endl "\n"
#define fr(i,a) for(auto i:a)
#define f(i,a,b) for(int i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>=b;--i)
#define pb push_back
#define in(d,v) d.find(v)!=d.end()
#define mp make_pair
#define size(a) int(a.size())

const ll mod = 1e9 + 7;
const ll inf = ll(1e18);
const double PI = acos(-1);

ll modexp(ll x, ll n, int md) {
    if (n == 0)return 1;
    if (n % 2 == 0)return modexp((x * x) % md, n / 2, md);
    return (x * modexp((x * x) % md, n / 2, md)) % md;
}


int main() {
    fastio;
    // clock_t tm = clock();
    ll n;
    cin>>n;
    if(n%1000==0)cout<<0<<endl;
    else cout<<1000-n%1000<<endl;
    //cout<<((clock()-tm)*1.0)/CLOCKS_PER_SEC<<endl;
}


Measured memory_bytes: 3608
#define ENABLE_DEBUG 1
// Kana's kitchen {{{
#include<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
#define LOOP(k) for(i64 ngtkana_is_a_genius=0; ngtkana_is_a_genius<(i64)k; ngtkana_is_a_genius++)

using i32 = std::int_least32_t;
using i64 = std::int_least64_t;
using u32 = std::uint_least32_t;
using u64 = std::uint_least64_t;
using usize = std::size_t;

template <class T> using vec = std::vector<T>;
template <class T> using numr = std::numeric_limits<T>;

#ifdef NGTKANA
#include<debug.hpp>
#else
#define DEBUG(...)(void)0
#endif
/*}}}*/

int main(){
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::setprecision(15) << std::fixed;

    i64 h0, m0, h1, m1, k;
    std::cin >> h0 >> m0 >> h1 >> m1 >> k;
    std::cout << -h0*60 -m0 +h1*60 + m1 - k << '\n';
}


Measured memory_bytes: 3640
#pypyは内包表記使わない
def main():
    import sys
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    s = input().rstrip()
    for i in s:
        if i=='9':
            print('Yes')
            exit()
    print('No')
    
if __name__ == '__main__':
    main()

Measured memory_bytes: 3316
N = str(input())
a = int(N[-1])
if a == 2 or a == 4 or a == 5 or a == 7 or a == 9 :
    print("hon")
elif a == 0 or a == 1 or a == 6 or a == 8 :
    print("pon")
else:
    print("bon")

Measured memory_bytes: 9176
#include<stdio.h>
int main(){
	char cha;
	int str[26] = {}, i = 0;
	while ((cha=getchar())!= EOF)
	{
		if ( 'A'<=cha&&cha <= 'Z')str[cha - 'A']++;
		if ( 'a'<=cha&&cha <= 'z')str[cha - 'a']++;
		i++;
	}
	for (i=0; i < 26; i++){
		printf("%c : %d\n", i + 'a', str[i]);
	}
		return 0;
}

Measured memory_bytes: 524
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
using namespace std;
typedef long long int ll;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<ll> a(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    map<ll,ll> mp;
    ll res=0;
    for(int i=0;i<n;i++){
        res+=mp[-(a[i]-i)];
        mp[(a[i]+i)]++;
    }
    printf("%lld\n",res);
}


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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define SORTG(v) sort(v.begin(),v.end(),greater<>())
#define SORT(v) sort(v.begin(),v.end())
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/3

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<string> Vs;

template<class T> void chmax(T& a, T b) {if(a<b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a>b){a=b;}}
void YesNo(int a) {if(a){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}}
void YESNO(int a) {if(a){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}}
void AorB(int a,string b,string c) {if(a){cout<<b<<endl;}else{cout<<c<<endl;}}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
void start(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);}

std::vector<int> enum_div(int n)//nの約数を列挙
{
    std::vector<int> ret;
    for(int i=1 ; i*i<=n ; ++i)
    {
        if(n%i == 0)
        {
            ret.push_back(i);
            if(i!=1 && i*i!=n)
            {
                ret.push_back(n/i);
            }
        }
    }
    ret.pb(n);
    return ret;
}

signed main(){start();
    int n,ans=0;
    cin>>n;
    if(n==1) {cout<<0<<endl;return 0;}
    Vi a=enum_div(n);
    SORT(a);
    
    REP(i,0,a.size()-1){
        int m=n/a[i]-1;
        if(n%m==a[i]) ans+=m;
    }
    
//    REP(i,0,a.size()) cout<<a[i]<<endl;
    cout<<ans<<endl;
    return 0;
}

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

int main(){
  int N;
  string S;
  cin >> N >> S;
  
  string T;
  T = S.substr(0,N/2);
  
  if(S == T+T){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

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

int main()
{
  int x,y,z,tmp;

  cin >> x >> y >> z;

  if ( x > y )
    {
      tmp = x;
      x = y;
      y = tmp;
    }
  if ( y > z )
    {
      tmp = y;
      y = z;
      z = tmp;
    }
  if ( x > y )
    {
      tmp = x;
      x = y;
      y = tmp;
    }
  cout << x <<" "<< y <<" "<< z <<endl;

  return 0;
}



Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
#define rep(i,n) for(lint (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(lint (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(lint (i)=(n-1);(i)>=0;(i)--)
#define INF (1ll<<60)
#define all(x) (x).begin(),(x).end()
const lint MOD =1000000007;
const lint MAX = 1000000;
using Graph =vector<vector<lint>>;
typedef pair<lint,lint> P;
 
 
lint fac[MAX], finv[MAX], inv[MAX];
 
void COMinit() 
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (lint 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(lint n, lint k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
lint primary(lint num)
{
    if (num < 2) return 0;
    else if (num == 2) return 1;
    else if (num % 2 == 0) return 0;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return 0;
        }
    }
 
    return 1;
}
   long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
    lint lcm(lint a,lint b){
        return a/__gcd(a,b)*b;
    }
     lint gcd(lint a,lint b){
        return __gcd(a,b);
    } 
  
  int main(){      
      lint n;
      cin >>n; vector<lint> a(n);
      rep(i,n)cin >> a[i];
      sort(all(a));
      lint ans=0;
      rep(i,n){
          repp(j,i+1,n){
           auto x=upper_bound(all(a),a[j]-a[i]);
            auto y=lower_bound(all(a),a[j]+a[i]);
           lint f=a[j]-a[i];
           lint g=a[i]+a[j];
            if(f<a[i]&&a[i]<g)--ans;
            if(f<a[j]&&a[j]<g)--ans;
            lint c=a.end()-y;
            lint d=a.end()-x;
            ans+=(d-c);
          }
      }
        cout<<ans/3<<endl;
  }
          
  

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define f first
#define s second
#define int long long int

main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	multiset<int>se;
	int n;
	cin>>n;
	vector<int>v;
	for(int i=0; i<n; i++){
		int x;
		cin>>x;
		v.pb(x);
	}
	sort(v.begin(), v.end());
	reverse(v.begin(), v.end());
	int ans=0;
	
	for(int i=0; i<v.size(); i++){
		int val=v[i];
		if(se.size()==0){
			se.insert(val);
			continue;
		}
		auto it=se.end();
		it--;
		int num=(*it);
		ans+=num;
		se.erase(se.find(num));
		se.insert(val);
		se.insert(val);
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 14260
#include <bits/stdc++.h>
#ifdef BUG
    #include "debug.hpp"
#else
    #define DEBUG(var)
#endif

using namespace std;
template< class T1, class T2 > inline istream &
operator>>( istream & fin, pair< T1, T2 > & pr )
{ fin >> pr.first >> pr.second; return fin; }
template< class T0, class T1, class T2 > inline istream &
operator>>( istream & fin, tuple< T0, T1, T2 > & t )
{ fin >> get<0>(t) >> get<1>(t) >> get<2>(t); return fin; }
template< class T > inline istream &
operator>>( istream & fin, vector< T > & a ) {
for(auto & u: a) fin >> u; return fin; }
template<class T, size_t n> inline istream &
operator>>( istream & fin, array<T, n> & a ) {
for(auto & u: a) fin >> u; return fin; }
template<class FwdIter> inline auto
dump(FwdIter first, FwdIter last, const char * dlm = " ") -> void {
typedef typename iterator_traits<FwdIter>::value_type value_type;
copy(first, last, ostream_iterator<value_type>(cout, dlm)); }
template<typename T> vector<T> & operator--(vector<T> & a)
{ for(auto & i: a) --i; return a; }
/* @@@ ----------------------------------- */

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

    int buf = 0, out = 0;
    for(const auto i: s)
        if(i == 'g')
        {
            if(0 < buf)
                ++ out, -- buf;
            else
                ++ buf;
        }
        else
        {
            if(0 < buf)
                -- buf;
            else
                -- out, ++ buf;
        }

    return out;
}

int main(const int argc, char * argv [])
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cout << arc062b();

    return EXIT_SUCCESS;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define _rep(i,n) _repl(i,0,n)
#define rep(...) GET_MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream &o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream &o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 1120000000

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

  const string s="RYGB";

  rep(i,h){
    rep(j,w){
      int x = (i+j)/d;
      int y = (i-j+10000*d)/d;
      printf("%c", s[(x%2)+(y%2)*2]);
    }
    printf("\n");
  }

  return 0;
}


Measured memory_bytes: 512
#define __USE_MINGW_ANSI_STDIO 0
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <set>
#include <numeric>
#include <bitset>
#include <map>
#include <limits.h>

using namespace std;

/// 各桁の和
int sumdigit(int x){
   int sum = 0;
    while(x != 0){
        sum += x % 10;
        x /= 10;    
    }
    return sum;
}
/// 最小公倍数 
int gcd(int x, int y){
      if(x<y){
          int temp = x;
          x = y;
          y = temp;
      }
      int r = x % y;
       while(r!=0){
           x = y;
           y = r;
           r = x % y;
       }
      return y;
   }



int main(){
int n;
cin >> n;
vector<long double> x(n);
vector<string> u(n);
for(int i = 0; i < n; i++){
    cin >> x[i] >> u[i];
}
long double sum = 0;
for(int i = 0; i< n; i++){
if(u[i] == "JPY" ){
    sum += x[i]; 
}
else{
    sum += x[i] * 380000.0;
}
}
cout << sum << endl;
}

Measured memory_bytes: 256
N = int(input())

alphabets = [chr(ord('a') + x) for x in range(26)]

ans = []


def dfs(d, i_max, S):
    if d == N-1:
        ans.append(S)
        return
    for i in range(i_max+2):
        dfs(d+1, max(i_max, i), S + alphabets[i])


dfs(0, 0, "a")
print(*ans, sep='\n')


Measured memory_bytes: 14464
#include <bits/stdc++.h>
 
using namespace std;
#define repr(i,a,b) for (int i=a; i<b; i++)
#define rep(i,n) for (int i=0; i< (int) n; i++)
#define PI  3.14159265358979323846264338327950
 
 
int main () {
    int W,H,N;
    cin >> W >> H >> N;

    int xmin=0, xmax=W, ymin=0, ymax =H;

    rep(i,N){
        int x,y,a;
        cin >>x >> y >> a;

        switch(a){
            case 1:
                xmin= max(x,xmin);
                break;
            
            case 2:
                xmax = min(x,xmax);
                break;

            case 3:
                ymin = max(y,ymin);
                break;
            
            case 4:
                ymax = min(y,ymax);
                break;
        }
    }
    if(xmin >= xmax || ymin >= ymax)cout << 0 << endl;
    else cout << (xmax-xmin)*(ymax-ymin) << endl;



}


Measured memory_bytes: 256
'''
N人を円周上に配置し、M本の線分で結ぶ。
このとき、線分を回転させていっても同じ人のペアが生まれないようにする。

基本的には、上から順に結べばよい。
'''

from collections import deque

def main():
    N, M = map(int, input().split())
    if N&1:
        '''
        ・Nが奇数の場合
        
        上から順に結ぶだけ。
        dequeに 1,2,3,...,M*2 を突っ込んで、両端から取り出してペアにする。
        '''
        q = deque(range(M*2))
        while q:
            print(q.popleft()+1, q.pop()+1)
    else:
        '''
        [Nが偶数の場合]
        
        上から順に結ぶと、上下の線対称になり、同じ間隔のペアが生まれるためNG。
        → 半分以降は、1つずらしてペアを作っていく

        簡単に解決するため、
        ・上から順に奇数間隔ペアを作る
        ・下から順に偶数間隔ペアを作る
        この2つから、M個を順に、交互に取り出す。
        '''
        q1 = deque(range(N))
        q2 = deque(range(N-1))
        p1 = []
        while q1:
            p1.append((q1.popleft()+1, q1.pop()+1))
        p2 = []
        while len(q2)>=2:
            p2.append((q2.popleft()+1, q2.pop()+1))
        p2.reverse()
        for _ in range(M):
            print(*p1.pop())
            p1, p2 = p2, p1


main()



Measured memory_bytes: 29584
#include<stdio.h>

int main(void){

 int a,i,F[45];

  scanf("%d",&a);
  F[0] = 1;
  F[1] = 1;

   for(i=2;i<=44;i++){
    F[i] = F[i-2] + F[i-1];
   }
  printf("%d\n",F[a]); 
  return 0;
}

Measured memory_bytes: 1820
def gcd(x, y):
  b = max(x, y)
  s = min(x, y)
  r = b % s
  while r != 0:
    b = s
    s = r
    r = b % s
  return s

N = int(input())
A = list(map(int, input().split()))
A.sort()

ma = 0
L = [[]] * N
all = gcd(A[0], A[1])
L[1] = [A[0], A[1]]

for i in range(2, N):
  t = [all]
  all = gcd(all, A[i])
  for j in L[i - 1]:
    k = gcd(j, A[i])
    if k not in t:
      t.append(k)
  L[i] = t

Ans = max(L[-1])

print(Ans)

Measured memory_bytes: 17732
#include <stdio.h>

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

Measured memory_bytes: 128
#include <iostream>
using namespace std;
int n;
int main(){
	cin>>n;
	if((n%10==n/10%10&&n%10==n/100%10)||(n/100%10==n/10%10&&n/10%10==n/1000%10)){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);
static const int INF = 1e9+7;
#define REP(i,n) for (int i = 0; i <(n); ++i)
//debug 
#ifdef _DEBUG
#define debug(var)  do{cout << #var << " :";view(var);}while(0)
#else
#define debug(...)
#endif
template<typename T> void view(T e){cout << e << endl;}
template<typename T> void view(const vector<T>& v){for(const auto& e : v){ cout << e << " "; } cout << endl;}
template<typename T> void view(const vector<vector<T> >& vv){ for(const auto& v : vv){ view(v); } }


int main(){
  int n, k, s;
  cin >> n >> k >> s;
  REP(i,k){
    cout << s << " ";
  }
  if(s == 1000000000){
    REP(i,n-k) cout << 1 << endl;
  }
  else{
    REP(i,n-k) cout << 1000000000 << endl;
  }
  return 0;
}

Measured memory_bytes: 3556
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        a: u64,
        b: u64
    }
    let f_check: u64 = if format!("{}{}", a % 10_000 / 1_000, (a / 10_000))
        .parse::<u64>()
        .unwrap()
        >= a % 100
    {
        1
    } else {
        0
    };
    let l_check: u64 = if format!("{}{}", b % 10_000 / 1_000, (b / 10_000))
        .parse::<u64>()
        .unwrap()
        <= b % 100
    {
        1
    } else {
        0
    };

    println!("{}", (b / 100) - (a / 100) - 1 + f_check + l_check)
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int tt=1;
    long long MOD = 998244353;
    while(tt--)
    {
        int n,k;
        cin >> n >> k;
        pair<int,int> s[k];
        for(int i=0;i<k;i++)
        {
            cin >> s[i].first >> s[i].second;
        }
        long long dp[n+1];
        long long pre[n+1];
        for(int i=0;i<=n;i++)
        {
            dp[i]=0;
            pre[i]=0;
        }
        dp[1]=1;
        pre[0]=0;
        pre[1]=1;
        for(int i=2;i<=n;i++)
        {
            for(int j=0;j<k;j++)
            {
                if(s[j].second<i)
                {
                    dp[i]=(((dp[i]-pre[i-s[j].second-1]+pre[i-s[j].first])%MOD)+MOD)%MOD;
                }
                else if(s[j].first<=i)
                {
                    dp[i]=(dp[i]+pre[i-s[j].first]+MOD)%MOD;
                }
            }
            pre[i]=(pre[i-1]+dp[i])%MOD;
        }
        cout << dp[n] << endl;
    }
    return 0;
}


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

using namespace std;
typedef long long ll;
const int N=2e5+100;
int a[20100];
int main()
{
   int n,x,y;
   cin>>n>>x>>y;
   for(int i=1;i<n;i++)
    for(int j=i+1;j<=n;j++){
     int k=min(j-i,(abs(x-i)+abs(y-j)+1));
     a[k]++;
   }
   for(int i=1;i<n;i++)cout<<a[i]<<endl;
  /* int l=x-1,r=n-y;
   for(int i=1;i<n;i++)
     a[i]=n-i;
   int mid=y-x;
   for(int i=0;i<=l;i++)
    for(int j=0;j<=r;j++)
      a[i+mid+j]--;
   for(int i=0;i<=l;i++)
    for(int j=0;j<=r;j++)
      a[i+1+j]++;
    for(int i=0;i<=mid-1;i++)
     for(int j=1;j<=mid-i-1;j++)
        a[i+j+1]++;
   for(int i=1;i<n;i++)
    cout<<a[i]<<endl;*/
   return 0;
}


Measured memory_bytes: 256
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
B = list(map(int, sys.stdin.readline().split()))
C = list(map(int, sys.stdin.readline().split()))

ans = 0
for i in A:
    ans += B[i - 1]

for i, j in zip(A, A[1:]):
    if i + 1 == j:
        ans += C[i - 1]

print(ans)


Measured memory_bytes: 23244
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringJoiner;
import java.util.StringTokenizer;
import java.util.function.IntUnaryOperator;
import java.util.function.LongUnaryOperator;

public class Main {
    static In in = new In();
    static Out out = new Out();
    static long mod = 1000000007;
    static long inf = 0xfffffffffffffffL;

    void solve() {
        int n = in.nextInt();
        int m = in.nextInt();
        out.println((n * (n - 1) + m * (m - 1)) / 2);
    }

    public static void main(String[]$) {
        new Main().solve();
        out.flush();
    }
}

class In {
    private BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 0x10000);
    private StringTokenizer tokenizer;

    String next() {
        try {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(reader.readLine());
            }
        } catch (IOException ignored) {
        }
        return tokenizer.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    char[][] nextCharArray(int n, int m) {
        char[][] a = new char[n][m];
        for (int i = 0; i < n; i++) {
            a[i] = next().toCharArray();
        }
        return a;
    }

    int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    int[] nextIntArray(int n, IntUnaryOperator op) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = op.applyAsInt(nextInt());
        }
        return a;
    }

    long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextLong();
        }
        return a;
    }

    long[] nextLongArray(int n, LongUnaryOperator op) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = op.applyAsLong(nextLong());
        }
        return a;
    }
}

class Out {
    private PrintWriter out = new PrintWriter(System.out);
    boolean autoFlush = false;

    void println(Object... a) {
        StringJoiner joiner = new StringJoiner(" ");
        for (Object obj : a) {
            joiner.add(String.valueOf(obj));
        }
        out.println(joiner);
        if (autoFlush) {
            out.flush();
        }
    }

    void println(int[] a) {
        StringJoiner joiner = new StringJoiner(" ");
        for (int i : a) {
            joiner.add(Integer.toString(i));
        }
        out.println(joiner);
        if (autoFlush) {
            out.flush();
        }
    }

    void println(long[] a) {
        StringJoiner joiner = new StringJoiner(" ");
        for (long i : a) {
            joiner.add(Long.toString(i));
        }
        out.println(joiner);
        if (autoFlush) {
            out.flush();
        }
    }

    void flush() {
        out.flush();
    }
}


Measured memory_bytes: 21332
#include <stdio.h>
#include <stdlib.h>
int a[21], n;
int hant(int, int);

main(){
  int  m[201], q, i;

  scanf("%d", &n);

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

  scanf("%d", &q);

  for(i = 0;i < q;i++) scanf("%d", &m[i]);

  for(i = 0;i < q;i++){
    if(hant(0,m[i]) == 1) printf("yes\n");
    else printf("no\n");
  }
  return 0;
}
int hant(int i, int k){
  int res;
  if(k == 0) return 1;
  if(i >= n) return 0;
  res = hant(i + 1, k) || hant(i + 1,k - a[i]);
  return res;
}

Measured memory_bytes: 580
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int A = sc.nextInt();
		int B = sc.nextInt();
		
		int a = A+B;
		int b = A-B;
		int c = A*B;
		
		int[] i = new int[3];
		i[0] = a;
		i[1] = b;
		i[2] = c;
		
		Arrays.sort(i);
		System.out.println(i[2]);
		
		sc.close();	
	}
}

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

using namespace std;

bool is_viewable(vector<int> &H, int i);

int main() {
    int N;
    cin >> N;
    vector<int> H(N);
    for (int i = 0; i < N; ++i) {
        cin >> H[i];
    }
    int ans = 0;
    for (int i = 0; i < N; ++i) {
        if (is_viewable(H, i)) {ans += 1;}
    }
    cout << ans << endl;
    return 0;
}

bool is_viewable(vector<int> &H, int i) {
    for (int j = 0; j < i; ++j ) {
        if (H[j] > H[i]) {return false;}
    }
    return true;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<iomanip>
#define rip(i,n) for(int i=0;i<n;i++)
#define ll long long
#define lb long double
#define vec vector<int>
#define set setprecision
#define mod 1000000007
#include<numeric>
using namespace std;
int gcd(int a, int b)
{if (a % b == 0)	return(b);
	else return(gcd(b, a % b));}
int lcm(int a, int b)
{return a * b / gcd(a, b);}
ll pow(ll a, ll b) {
	ll k = b % 30000, h = b / 30000,s = 1;
	rip(i, 30000)s = (s * a) % mod;ll j = 1;
	if (h != 0)rip(i, h)j = j * s % mod;
	if (k != 0)rip(i, k)j = j * a % mod;
	return(j);
}
int oira(int n) {
	if (n == 0) return 0;
	int ans = n;
	for (int i = 2; i * i <= n; i++) {
		if (n % i == 0) {
			ans -= ans / i;
			while (n % i == 0) n /= i;
		}
	}
	if (n > 1) ans -= ans / n;
	return ans;
}
int main() {
	ll a;
	cin >> a;
	cout << a*a*a << endl;
}


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

using namespace std;
using ll = long long;

#define rep(i, a) for (int i = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int i = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int i = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int i = (int) (a)-1; (i) >= (int) (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x
#define TRUE__  "Yes"
#define FALSE__ "No"
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
#define RS(N) resize(N)
#define CINV(v, N) do {\
	v.RS(N);\
	rep(i, N) cin >> v[i];\
} while (0);
#define RCINV(v, N) do {\
	v.RS(N);\
	rrep(i, N) cin >> v[i];\
} while (0);

#define MOD 1000000007

void init();
void solve();

signed main()
{
	init();
	solve();
}

void init()
{
	int n;
	int ma = 0;
	cin >> n;
	int res = 0;
	rep(i, n) {
		int t;
		cin >> t;
		ma = max(t, ma);
		res += t;
	}
	cout << res - ma / 2 << endl;
}

void solve()
{
}


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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };


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

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

void solve() {
    int N; cin >> N;
    // ll g=1;
    vector<ll> v(N);
    rep(i, N){
        cin >> v[i];
    //     g = lcm(g, v[i]);
    }

    // ll res = 0;
    // rep(i, N){
    //     res += (g-1) % v[i];
    // }

    ll res=0;
    rep(i, N){
        res += v[i] - 1;
    }

    cout << res << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 4352
// Atcoder Grand Contest 023 A ver 2.0
#include <iostream>
//#define DEBUG
using namespace std;

#ifdef DEBUG
void print_array_i(int* a, int l)
{
  for (int i=0; i<l; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
void print_array_l(long long int* a, int l)
{
  for (int i=0; i<l; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
#endif

int main()
{
  // データ入力
  int n = 0;
  cin >> n;
  int array[n];
  for (int i=0; i<n; i++) {
    cin >> array[i];
  }

#ifdef DEBUG
print_array_i(array, n);
#endif

  // 累積和を作成
  long long int csum[n+1];
  csum[0]=0;
  for (int i=0; i<n; i++) {
    csum[i+1] = csum[i] + array[i];
  }

#ifdef DEBUG
print_array_l(csum, n+1);
#endif

  // 累積和をソート
  sort(csum, csum + n+1);

#ifdef DEBUG
print_array_l(csum, n+1);
#endif

  // 累積和の同じ値をカウント
  long long int count=0, flag=0;
  long long int before = csum[0];
  for (int i=1; i<n+1; i++) {
    if (before == csum[i]) {
      count++;
      if (flag !=0 ) {
        count += flag;
      }
      flag++;
    } else {
      flag = 0;
    }
    before = csum[i];
  }

  // 結果を表示
  cout << count << endl;
  return 0;
}

Measured memory_bytes: 2560
n,k = map(int,input().split())
R = []
Ro = []

if k%2 != 0:
  for i in range(1,n+1):
    if i%k == 0:
      R.append(i)
   
  print(len(R)**3)
else:
  for i in range(1,n+1):
    if i%k == 0:
      R.append(i)
    if i%k == k//2:
      Ro.append(i)
  print(len(R)**3 + len(Ro)**3)
  

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

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

int main(){
    int n;cin>>n;
    char s[n];
    bool y=false;
    REP(i,n){
        cin>>s[i];
        if (s[i]=='Y')
        {
            y=true;
        
    }
    }
    if (y)
    {
        /* code */
        cout<<"Four"<<endl;
    }
    else
    {
        cout<<"Three"<<endl;
    }

    }

Measured memory_bytes: 256
n = int(input())

arr = map(int,raw_input().split())

dic = [0 for i in range(10**5)]

for i in arr:
	dic[i] += 1

ans = 0
for i in range(10**5-2):
	ans = max(ans,dic[i]+dic[i+1]+dic[i+2])

print ans

Measured memory_bytes: 11316
#include <iostream>
#include <algorithm>

using namespace std;
typedef long long LL;

int main(){
  int N;
  cin >> N;
  int a[3010];
  for(int i=0; i<N; i++) cin >> a[i];
  LL dp[3010][3010];
  for(int i=1; i<=N; i++){
    for(int j=0; j<=N-i; j++){
      dp[i][j]=max(a[j+i-1]-dp[i-1][j],a[j]-dp[i-1][j+1]);
    }
  }
  cout << dp[N][0] << endl;
  
  return 0;
}

Measured memory_bytes: 70784
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>

typedef struct {
  int readidx;
  int writeidx;
  int size;
  int* buf;
  int bufsize;
} FIFO;

void fifo_init(FIFO* fifo, int bufsize) {
  if (fifo == NULL) return;
  fifo->readidx = 0;
  fifo->writeidx = 0;
  fifo->size = 0;
  fifo->buf = (int*)malloc(sizeof(int) * bufsize);
  fifo->bufsize = bufsize;
}

void fifo_destory(FIFO* fifo) {
  if (fifo == NULL) return;
  free(fifo->buf);
}

void fifo_enqueue(FIFO* fifo, int v) {
  if (fifo == NULL) return;
  if (fifo->size == fifo->bufsize) return;
  fifo->buf[fifo->writeidx] = v;
  ++fifo->size;
  if (++fifo->writeidx == fifo->bufsize) fifo->writeidx = 0;
}

void fifo_dequeue(FIFO* fifo, int* v) {
  if (fifo == NULL) return;
  if (fifo->size == 0) return;
  *v = fifo->buf[fifo->readidx];
  --fifo->size;
  if (++fifo->readidx == fifo->bufsize) fifo->readidx = 0;
}

int main() {
  int N, M, i, **graph, *ans, A, B, v, to;
  FIFO fifo;
  bool ok;
  scanf("%d %d", &N, &M);
  graph = (int**)malloc(sizeof(int*) * N);
  for (i = 0; i < N; ++i) {
    graph[i] = (int*)malloc(sizeof(int) * 2);
    graph[i][0] = 0;
    graph[i][1] = 2;
  }
  for (i = 0; i < M; ++i) {
    scanf("%d %d", &A, &B);
    --A, --B;
    if (graph[A][1] - 2 == graph[A][0]) {
      int size = graph[A][1];
      graph[A] = realloc(graph[A], sizeof(int) * size * 2);
      graph[A][1] = size * 2;
    }
    graph[A][graph[A][0] + 2] = B;
    graph[A][0]++;
    if (graph[B][1] - 2 == graph[B][0]) {
      int size = graph[B][1];
      graph[B] = realloc(graph[B], sizeof(int) * size * 2);
      graph[B][1] = size * 2;
    }
    graph[B][graph[B][0] + 2] = A;
    graph[B][0]++;
  }
  ans = (int*)calloc(N, sizeof(int));
  ans[0] = 1;
  fifo_init(&fifo, M);
  fifo_enqueue(&fifo, 0);
  while (fifo.size != 0) {
    fifo_dequeue(&fifo, &v);
    for (i = 0; i < graph[v][0]; ++i) {
      to = graph[v][i + 2];
      if (ans[to] != 0) continue;
      ans[to] = v + 1;
      fifo_enqueue(&fifo, to);
    }
  }
  fifo_destory(&fifo);

  ok = true;
  for (i = 0; i < N; ++i) {
    if (ans[i] != 0) continue;
    ok = false;
    break;
  }
  if (!ok)
    puts("No");
  else {
    puts("Yes");
    for (i = 1; i < N; ++i) printf("%d\n", ans[i]);
  }

  free(ans);
  for (i = 0; i < N; ++i) free(graph[i]);
  free(graph);
  return 0;
}


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

using namespace std;

typedef long long ll;

const int N(2e5 + 9);

int T, n, m, ans;

int main()
{
    cin >> n;
    multiset<int>dp;
    for (int i = 0; i < n; i++)
    {
        int x;
        scanf("%d", &x);
        auto pos = dp.lower_bound(x);
        if (pos == dp.begin()) dp.insert(x);
        else
        {
            pos--;
            dp.erase(pos);
            dp.insert(x);
        }
    }
    cout << dp.size() << endl;
}


Measured memory_bytes: 4992
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<climits>
#include<cfloat>
#define curr(P, i) P[(i) % P.size()]
#define next(P, i) P[(i+1) % P.size()]

using namespace std;

double EPS = 1e-10;

double add(double a, double b){
  if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
  return a+b;
}

struct point{
  double x, y;
  point(){}
  point(double x,double y) : x(x) , y(y){}

  point operator + (point p){
    return point(add(x,p.x), add(y,p.y));
  }

  point operator - (point p){
    return point(add(x,-p.x), add(y,-p.y));
  }

  point operator * (double d){
    return point(x*d,y*d);
  }
};

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

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

double norm(point a){
  return sqrt(a.x*a.x+a.y*a.y);
}

int ccw(point a, point b, point c) {
  b = b-a; c = c-a;
  if (cross(b, c) > 0)   return +1;
  if (cross(b, c) < 0)   return -1;   
  if (dot(b, c) < 0)     return +2;     
  if (norm(b) < norm(c)) return -2;      
  return 0;
}

point intersection_l(point a1, point a2, point b1, point b2) {
  return a1 + (a2 - a1) * (cross(b2 - b1,b1 - a1) / cross(b2 - b1,a2 - a1));
}

vector<point> covex_cut(vector<point>pol,point a,point b){
  vector<point>q;
  for (int i = 0; i < pol.size(); i++) {
    point A = curr(pol, i), B = next(pol, i);
    if (ccw(a, b, A) != -1) q.push_back(A);
    if (ccw(a, b, A)*ccw(a, b, B) < 0)
      q.push_back(intersection_l(A,B,a,b));
  }
  return q;
}

int main(void){
  int n;
  point in;
  vector<point>pol,ans;

  while(cin >> n,n){
    pol.clear();
    ans.clear();
    for(int i=0;i<n;i++){
      cin >> in.x >> in.y;
      pol.push_back(in);
    }

    ans.push_back(point(0,0));
    ans.push_back(point(10001,0));
    ans.push_back(point(10001,10001));
    ans.push_back(point(0,10001));

    for(int i=0;i<n;i++){
      ans=covex_cut(ans,curr(pol,i),next(pol,i));
    }

    if(ans.size())cout << 1 << endl;
    else cout << 0 << endl;

  }
  return 0;
}

Measured memory_bytes: 1236
o,x,b;
main(a){
  for(scanf("%d");~scanf("%s",&a);o=o==3?b=x=!printf("%d\n",x):o)
      for(a%=9,a-8?b=b*2+1,x+=b/8,b&=7:o++;a<7&b;b/=2)x+=b&1;
}

Measured memory_bytes: 0
#include <iostream>

using namespace std;

int calc(int a, int b, char op)
{
  int ret = a;
  
  if (op == '+') {
    ret = a + b;
  } else if (op == '-') {
    ret =  a - b;
  } else if (op == '*') {
    ret = a * b;
  } else if (op == '/') {
    ret = a / b;
  }
  
  return ret;
}
  
int main()
{
  int result;
  int n;
  char op;

  cin >> result;
  while (1) {
    cin >> op;
    if (op == '=') break;
    cin >> n;
    result = calc(result, n, op);
  }
  cout << result << endl;
}



Measured memory_bytes: 3092
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    n = INT()
    print((n+1)//2)


if __name__=='__main__':
    main()


Measured memory_bytes: 5148
#define _USE_MATH_DEFINES
#pragma region include

#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <bitset>

#include <queue>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <ctime>
////
//#include <random>//
#pragma endregion //#include
/////////

#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9 + 7;
const LL LINF = (LL)4e18 + 20;
const LD PI = acos(-1.0);
const double EPS = 1e-9; 
/////////
using namespace::std;
//////////////

void solve() {
	int A, B, M;
	cin >> A >> B >> M;
	int ans = INF;
	int Amin = INF;
	int Bmin = INF;
	vector<int> Ap(A);
	vector<int> Bp(B);
	for (int i = 0; i < A; ++i) {
		cin >> Ap[i];
		Amin = min(Amin, Ap[i]);
	}
	for (int i = 0; i < B; ++i) {
		cin >> Bp[i];
		Bmin = min(Bmin, Bp[i]);
	}
	ans = min(ans, Amin + Bmin);

	//割引
	for (int i = 0; i < M; ++i) {
		int x, y, z;
		cin >> x >> y >> z;
		x--; y--;
		int res = Ap[x] +Bp[y]-z;
		ans = min(ans, res);
	}
	cout << ans;
}

#pragma region main
signed main(void) {
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}
#pragma endregion //main()


Measured memory_bytes: 1024
#include <bits/stdc++.h>
//#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#include "boost/multiprecision/cpp_int.hpp"
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2

ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
//template<class T>void max(T a,T b){if(a<b)return b;else return a;}
//template<class T>void min(T a,T b){if(a>b)return b;else return a;}
//template<class T>bool Max(T&a, T b){if(a < b){a = b;return 1;}return 0;}
//template<class T>bool Min(T&a, T b){if(a > b){a = b;return 1;}return 0;}

//////////////////////////

int main(){fastio
    ll n;cin>>n;
    ll a[n];
    rep(i,0,n-1){
        cin>>a[i];a[i]--;
    }
    ll ans=0;
    rep(i,0,n-1){
        if(a[a[i]]==i)ans++;
    }
    cout<<ans/2<<endl;
    
    
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main()
{
	string str;
	cin >> str;
	if (str == "AAA" || str == "BBB")
	{
		cout << "No" << endl;
	}
	else
	{
		cout << "Yes" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
 
 
public class Main {
     
 
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int[][][] data = new int[4][3][10];
         
        for(int i = 0; i < n; i++) {
            int b = stdIn.nextInt();
            int f = stdIn.nextInt();
            int r = stdIn.nextInt();
            int v = stdIn.nextInt();
             
            data[b-1][f-1][r-1] += v;
        }
         
        for(int i = 0; i < 4; i++) {
            for(int j = 0; j < 3; j++) {
                for(int k = 0; k < 10; k++) {
                    System.out.print(" " + data[i][j][k]);
                }
                System.out.println();
            }
            if(i != 3) {
            System.out.println("####################");
            }
        }
    }
 
}



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



public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	
		int d = sc.nextInt();
		int t = sc.nextInt();
		int s = sc.nextInt();
		
		if(d > t * s) {
			System.out.println("No");
		}else {
			System.out.println("Yes");
		}
	}
}



Measured memory_bytes: 27088
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main(){
	string s;
	int q;
	
	cin >> s;
	cin >> q;
	
	for(int i=0; i<q; ++i){
		string od, p;
		int a, b;
		
		cin >> od >> a >> b;
		if(od=="replace"){
			cin >> p;
			s = s.replace(a, b-a+1, p);
		}
		else if(od=="print"){
			cout << s.substr(a, b-a+1) << endl;
		}
		else if(od=="reverse"){
			string tmp = s.substr(a, b-a+1);
			reverse(tmp.begin(), tmp.end());
			//cout <<"tmp=" << tmp <<endl;
			s = s.replace(a, b-a+1, tmp);	
		}
		
		//cout << s << endl;
		
	}
	return 0;
}


Measured memory_bytes: 3204
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    if(n<2){
        cout<<0<<'\n';
    }else if(n==2){
        cout<<2<<'\n';
    }else{
        int mod=1e9+7;
        int x=1,y=1,z=1;
        for(int i=0;i<n;i++){
            x*=10,x%=mod;
            y*=9,y%=mod;
            z*=8,z%=mod;
        }
        cout<<((x-2*y+z)+mod*2)%mod<<'\n';

    }

return 0;


}

//      *   *  *****  *   *  *   *   ****  ****    ****     **  ***
//     *   *  *      **  *  *   *  *      *   *  *        * *  *  *
//    *****  *****  * * *  *   *  *      ****   *       *  *    *
//   *   *      *  *  **  *   *  *      *  *   *       *****  *
//  *   *  *****  *   *   ***    ****  *   *   ****      *  ****

//     ****  *   *  *   *   ***   *   *  *****  *   *
//    *     *   *  *   *  *   *  *   *  *      *   *
//    ***  *****  *   *  *****  * * *  ****   *   *
//      *   *    *   *  *   *  * * *  *      *   *
//  ****   *     ***   *   *   * *   *****   ***

//        ********                                 . O .
//      *           *                               . .
//     *            * *       * ********
//    * ***********    *    *  *         *
//    *                 * *      *********
//                      *                 *
//                 *   *
//                   *  *
//                     **
//                   *  **  *
//              *  *    * **
//                *     ** * *
//            *   **   ** * *  * *
//           *    * * * * * *   **
//          **************************






Measured memory_bytes: 3608