akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {
	ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
	vector <int> f(26, INT_MAX);
	int n; cin >> n;
	for(int i = 0; i < n; i++) { 
		string str; cin >> str; vector <int> a(26, 0);
		for(auto ch: str) {
			a[ch - 'a']++;
		}
		for(int j = 0; j < 26; j++) {
			f[j] = min(f[j], a[j]);
		}
	}
	string ans;
	for(char ch = 'a'; ch <= 'z'; ++ch) {
		ans += string(f[ch - 'a'], ch);
	}
	cout << ans << endl;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
using i64 = int64_t;
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> L(N), R(N);
    for(int i = 0; i < N; i++) {
        if(i == 0) {
            L[i] = 0, R[N - 1 - i] = 0;
        } else {
            L[i] = max(L[i - 1], A[i - 1]);
            R[N - 1 - i] = max(R[N - i], A[N - i]);
        }
    }
    for(int i = 0; i < N; i++) {
        cout << max(L[i], R[i]) << endl;
    }
    return 0;
}

Measured memory_bytes: 3968
import collections
import math
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
c=collections.Counter(a)
ans=0
for i in a:
  j=int(math.log2(i))+1
  k=2**j-i
  if k in c.keys():
    if i==k and c[i]>1:
      c[i]-=2
      ans+=1
    elif i!=k and c[i]>0 and c[k]>0:
      c[i]-=1
      c[k]-=1
      ans+=1
print(ans)

Measured memory_bytes: 33296
/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2019-12-22 18:02:02
**/

#include <iostream>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <complex>
#include <numeric>
#include <bitset>
#include <cassert>
#include <cctype>
#include <iomanip>
#include <random>
#include <utility>
#include <chrono>

using namespace std;

using int64 = long long;
template<class T> ostream& operator<<(ostream& os, vector<T>& _) { os << '{'; for (T& x : _) { os << x; if (&x != &_.back()) os << ','; } os << '}'; return os; }
template<class T, class U> ostream& operator<<(ostream& os, pair<T, U>& p) { return os << '{' << p.first << " " << p.second << '}'; }

#ifdef LOCAL
#define debug(_) cerr << #_ << ": " << (_) << '\n'
#else
#define debug(_) 1728
#endif

int dp[3030][3030];

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

  string s, t; cin >> s >> t;

  int n = s.size(), m = t.size();

  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (s[i] == t[j]) {
        dp[i + 1][j + 1] = dp[i][j] + 1;
      } else {
        dp[i + 1][j + 1] = max({dp[i][j], dp[i + 1][j], dp[i][j + 1]});
      }
    }
  }

  int cur_s = n, cur_t = m;

  string res = "";

  while (cur_s > 0 && cur_t > 0) {
    if (s[cur_s - 1] == t[cur_t - 1]) {
      res += s[cur_s - 1];
      --cur_s; --cur_t;
    } else {
      if (dp[cur_s][cur_t] == dp[cur_s - 1][cur_t]) {
        --cur_s;
      } else {
        --cur_t;
      }
    }
  }

  reverse(res.begin(), res.end());
  cout << res << endl;

  return 0;
}

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  if (A+B>C+D) {
    cout << "Left" << endl;
  }
    else if (A+B==C+D) {
      cout << "Balanced" << endl;
    }
  else {
      cout << "Right" << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <utility>
#include <queue>
#include <functional>
#define N 101
#define INF 200000000
using namespace std;

int main(void){
	int a,b,c,d;
	int n,m;
	while(cin>>n>>m,n||m){
		int dp[m+1][m+1];
		int dp1[m+1][m+1];
		for(int i=1;i<=m;i++){
			for(int j=1;j<=m;j++){
				if(i==j)dp[i][j]=dp1[i][j]=0;
				else dp[i][j]=dp1[i][j]=INF;
			}
		}

		for(int i=0;i<n;i++){
			cin>>a>>b>>c>>d;
			dp[b][a]=c;
			dp[a][b]=c;
			dp1[b][a]=d;
			dp1[a][b]=d;
		}

		for(int k=1;k<=m;k++){
			for(int u=1;u<=m;u++){
				for(int v=1;v<=m;v++){
					dp[u][v]=min(dp[u][v],dp[u][k]+dp[k][v]);
					dp1[u][v]=min(dp1[u][v],dp1[u][k]+dp1[k][v]);
				}
			}
		}

		int k;
		cin>>k;
		while(k--){
			cin>>a>>b>>c;
			if(c) cout<<dp1[a][b]<<endl;
			else cout<<dp[a][b]<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3084
//
//  main.cpp
//

#include <algorithm>
#include <array>
#include <assert.h>
#include <iomanip>
#include <iostream>
#include <limits>
#include <math.h>
#include <memory>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = int64_t;
using ull = uint64_t;

template<typename T>
vector<T> make_vec_nd(T init, ll size) {
    return vector<T>(size, init);
}
template<typename T, typename... Args>
auto make_vec_nd(T init, ll size, Args... rest) {
    auto inner = make_vec_nd(init, rest...);
    return vector<decltype(inner)>(size, inner);
}

#define rep(i,a,b) for(ll i=(a);i<(b);i++)
#define rrep(i,a,b) for(ll i=(a)-1;i>=(b);i--)

int main() {
    ll N, K;
    cin >> N >> K;
    vector<ll> As(N);
    rep(i,0,N) {
        cin >> As[i];
    }
    vector<ll> Fs(N);
    rep(i,0,N) {
        cin >> Fs[i];
    }
    ll As_sum = 0;
    rep(i,0,N) {
        As_sum += As[i];
    }
    if (As_sum <= K) {
        cout << 0 << endl;
        return 0;
    }
    sort(As.begin(), As.end());
    sort(Fs.rbegin(), Fs.rend());
    ll bad = 0;
    ll good = 0;
    rep(i,0,N) {
        good += As[i] * Fs[i];
    }
    while (good - bad >= 2) {
        ll mid = (bad + good) / 2;
        ll k = 0;
        rep(i,0,N) {
            k += max(As[i]-mid/Fs[i], (ll)0);
        }
        if (k <= K) {
            good = mid;
        } else {
            bad = mid;
        }
    }
    cout << good << endl;
}



Measured memory_bytes: 3456
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <cmath>
#include <cstring>
#include <assert.h>
#include <utility>
#include <tuple>
#include <array>
#include <bitset>
#include <cstdlib>

using int64 = long long;

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

    int64 K, A, B;
    std::cin >> K >> A >> B;
    
    if (A >= K) {
        std::cout << 1 << std::endl;
        return 0;
    }

    if (A <= B) {
        std::cout << -1 << std::endl;
        return 0;
    }

    std::cout << 2 * (((K - A) + (A - B) - 1) / (A - B)) + 1 << std::endl;

    return 0;
}


Measured memory_bytes: 256
n=int(input())
listP=list(map(int,input().split()))
ans=0
for i in range(1,n-1):
  if listP[i-1]<listP[i]<listP[i+1] or listP[i-1]>listP[i]>listP[i+1]:
    ans+=1
print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<unordered_map>
#include<bitset>
#include<math.h>
#include<vector>
#include<set>
#include<algorithm>
#include<ctype.h>
#include<unordered_set>
#include<string>
#include<iomanip>
#include<queue>
#include<limits>
#include<map>
#include<stack>
#include<iterator>
#include<cstring>

#include<deque>
#define pi 3.141592653589793238
#include<chrono>

#define MOD 1000000007
#define INF 999999999999999999 
#define pb push_back
#define ff first
#define ss second
#define mt make_tuple
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define f0 get<0>
#define f1 get<1>
#define f2 get<2>
#define db double
using namespace std;

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

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    fast;
    ll T = 1, i, j;
    
    //cin >> T;
    while (T--) {
        ll a;
        double b;
        cin >> a >> b;
        ll c = b*100 + 0.1;

        //cout << c << endl;
        cout << a*c/100 << endl;
    
    }
    
    return 0;
}


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

int n,m;
char a[110][110];

int main()
{int i,j,x,y,f1,f2,s;
 
 scanf("%d%d",&n,&m);
 s=0;
 for(i=1;i<=n;i++)
 {	scanf("%s",a[i]+1);
 	for(j=1;j<=m;j++)
 		s+=a[i][j]=='#';
 }
 x=1;
 y=1;
 if(a[1][1]!='#')
 {	printf("Impossible\n");
 	return 0;
 }
 else
 	s--;
 while(x!=n || y!=m)
 {	f1=0;
 	if(y<m && a[x][y+1]=='#') f1=1;
 	f2=0;
 	if(x<n && a[x+1][y]=='#') f2=1;
 	if(f1^f2)
 	{	s--;
	 	if(f1)
 			y++;
 		else
 			x++;
 	}
 	else
 		break;
 }
 if(!s)
 	printf("Possible\n");
 else
 	printf("Impossible\n");
 return 0;
}

Measured memory_bytes: 256
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#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=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define D()
#define INF 1000000000000
#define MOD 10000007
#define MAXR 100000
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define INITA(a,i,j,v) for(ll k=i;k<=j;k++){a[k]=v;}

ll f(ll n) {
    ll res = 1;
    FORD(i, n, 1) {
        res = (res * i) % 1000000007;
    }
    return res;
}

int main() {
    ll n, m; cin >> n >> m;
    // 犬猫の差の絶対値が1を超えるとNG
    if (abs(n - m) > 1) {
        cout << 0 << endl;
    } else {
        if (n == m) {
            // 同数であれば C/D/C/D, D/C/D/C
            // 2 * Cの順列数 * Dの順列数
            cout << (2 * f(n) * f(m)) % 1000000007 << endl;
        } else if (n > m) {
            // C/D/C/D/C
            // Cの順列数 * Dの順列数
            cout << (f(n) * f(m)) % 1000000007 << endl;
        } else {
            // D/C/D/C/D
            // Cの順列数 * Dの順列数
            cout << (f(n) * f(m)) % 1000000007 << endl;
        }
    }
    return 0;
}

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

struct node{
    int key;
    struct node *next;
    struct node *prev;
};
 
typedef struct node * NodePointer;
NodePointer finditem(int);
void listprint(void);
NodePointer make_1node(int,NodePointer);
void deleteFirst(void);
void deleteLast(void);
void deleteNode(NodePointer);
NodePointer head;

NodePointer finditem(int key){
  NodePointer x;
  x = head->next;
  while(x != head && x->key != key){
    x = x->next;
  }
  return x;
}
 
void insert(int key){
  NodePointer y;
  y = malloc(sizeof(struct node));
  y->key = key;
  y->next = head->next;
  head->next->prev = y;
  head->next = y;
  y->prev = head;
    
}
 
void listprint(){
  NodePointer cur = head->next;
  int isf = 1;
  while(1){
    if ( cur == head ) break;
    if ( isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}
 
void deleteNode(NodePointer t){
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}
  
void deleteFirst(){
  NodePointer t = head->next;
  if ( t == head ) return;
  deleteNode(t);
}
  
void deleteLast(){
  NodePointer t = head->prev;
  if ( t == head ) return;
  deleteNode(t);
}
  
void delete(int key){
  NodePointer k;
  k=finditem(key);
  if(k == head) return;
    
  deleteNode(k);
    
}
void init(){
  head = malloc(sizeof(struct node));
  head->next = head;
  head->prev = head;
}
 
int main(void){
    int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ){
    scanf("%s%d", com, &key);
    if ( com[0] == 'i' ) {insert(key); np++; size++;}
    else if ( com[0] == 'd' ) {
      if (strlen(com) > 6){
    if ( com[6] == 'F' ) deleteFirst();
    else if ( com[6] == 'L' ) deleteLast();
      } else {
    delete(key); nd++;
      }
      size--;
    }
  }
    
  listprint();
  return 0;
}
 

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

#define INF 1001001001
#define LINF 1001001001001001001
#define MOD 1000000007
#define MOD2 998244353

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

#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define rep1(i,a,b) for(int a_=(a),b_=(b),i=a_;i<b_;++i)
#define repr(i,n) for(int _i=(n),i=_i;i>0;--i)

#define db(x) cerr<<#x<<" = "<<x<<" ";
#define db2(x,y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<") ";
#define db3(x,y,z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = ("<<x<<", "<<y<<", "<<z<<") ";
#define ln cout<<endl;

#define all(a)  (a).begin(),(a).end()
#define dig(n)  to_string(n).length()

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define se second
#define fi first

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

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

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

int main(){
    bool flag=false;
    long double ans=0,sum=0,mx=-1.0;

    int n,k;
    cin >>n>>k;
    vector<int> a(n);

    rep(i,n){
        cin>>a[i];
    }

    
    rep(i,k)sum+=(long double)(a[i]+1)/2;
    mx = sum;

    rep1(i,k,n){
        sum -=(long double)(a[i-k]+1)/2;
        sum +=(long double)(a[i]+1)/2;

        if(mx < sum)mx=sum;
    }

    cout <<fixed<<setprecision(16)<< mx << endl;
    //cout<<mx<<endl;
    //if(flag)cout << "Yes" <<endl;
    //else cout << "No" <<endl;
    
    return 0;
}


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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}

int nextInt() { int x; scanf("%d", &x); return x;}
ll nextLong() { ll x; scanf("%lld", &x); return x;}

int main2() {
  int N = nextInt();

  for (int x = 1; x <= N; x++) {
    if ((int)(x * 1.08) == N) {
      cout << x << endl;
      return 0;
    }
  }
  cout << ":(" << endl;

  return 0;
}

int main() {

#ifdef LOCAL
  for (;!cin.eof();cin>>ws)
#endif
    main2();
  return 0;
}


Measured memory_bytes: 256
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
from queue import PriorityQueue
from fractions import gcd
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)
def gcd(*numbers):
    return functools.reduce(math.gcd, numbers)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort(reverse=True)
    return divisors

K = _I()

ans = 0
d = {}
vals = []
for i in range(1, K+1):
    for j in range(1, K+1):
        nums = [i,j]
        nums.sort()
        key = str(i) + '-' + str(j)
        if key in d:
            vals.append(d[key])
        else:
            val = gcd(i,j)
            d[key] = val
            vals.append(val)
#  print(vals)
#  print(d)
for val in vals:
    for k in range(1, K+1):
        #  print(val, k)
        nums = [i,j]
        nums.sort()
        key = str(val) + '-' + str(k)
        if key in d:
            ans += d[key]
        else:
            val = gcd(val, k)
            ans += val
            d[key] = val
print(ans)
exit()


Measured memory_bytes: 93740
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<math.h>
using namespace std;
#define mod (1000000000+7)
#define N (10007)
#define INF 1e16
typedef long long ll;
typedef pair<ll,ll> P;


 
int main(void){
    string s,t;
    cin>>s>>t;
    int a,b;
    cin>>a>>b;
    string u;
    cin>>u;
    if(u==s)cout<<a-1<<" "<<b<<endl;
    else{
        if(u==t)cout<<a<<" "<<b-1<<endl;
        else cout<<a<<" "<<b<<endl;
    }
	return 0; 
}

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

const double PI = 3.14159265358979323846;
//using namespace boost::multiprecision;
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 1e15;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

std::istream &operator>>(std::istream &in, set<int> &o) {
    ll a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
const int mod = 1000000007;
//const ll mod = 1e10;
typedef priority_queue<string, vector<string>, greater<string> > PQ_ASK;

struct Reach {
    int x, y, time;
};

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

    vector<vector<char>> grid(h, vector<char>(w));
    rep(y, h) rep(x, w) cin >> grid[y][x];

    vector<vector<int>> distances(h, vector<int>(w, INT_MAX));
    rep(y, h) rep(x, w) if (grid[y][x] == '#') distances[y][x] = 0;

    queue<Reach> q;
    rep(y, h) rep(x, w) if (grid[y][x] == '#') q.push({x, y, 0});

    auto set = [&](int x, int y, int time) {
        if (x == -1)return;;
        if (x == w)return;;
        if (y == -1)return;;
        if (y == h)return;;
        if (distances[y][x] <= time) return;
        distances[y][x] = time;
        q.push({x, y, time});
    };

    while (!q.empty()) {
        auto f = q.front();
        q.pop();
        set(f.x - 1, f.y, f.time + 1);
        set(f.x + 1, f.y, f.time + 1);
        set(f.x, f.y - 1, f.time + 1);
        set(f.x, f.y + 1, f.time + 1);
    }
    int ans = 0;
    rep(y, h) rep(x, w) cmax(ans, distances[y][x]);
    cout << ans << endl;

}

Measured memory_bytes: 17296
#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string S;
    cin>>S;
    if(S[5]=='0'){
        if(S[6]-'0'<=4)cout <<"Heisei"<<"\n";
        else cout <<"TBD"<<"\n";
    }
    else cout <<"TBD"<<"\n";
}

Measured memory_bytes: 256
import sys
import math
import collections
import bisect
import itertools
import decimal
import copy
import heapq

# import numpy as np

# sys.setrecursionlimit(10 ** 6)
INF = 10 ** 20
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: map(int, sys.stdin.readline().rstrip().split())
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))
flush = lambda: sys.stdout.flush()


# ===CODE===
def main():
    n = ni()

    ans = 0

    for i in range(1, n + 1):
        b = n // i
        tmp = 1 if i * b == n else 0

        ans += n // i - tmp
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 10016
#include<bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
typedef long long ll;
#define pb push_back
#define fi first
#define se second
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
template <class T, class U> ostream &operator<<(ostream &os, const pair<T, U> &p){os<<"("<<p.first<<","<< p.second<<")";return os;}
template <class T> ostream &operator<<(ostream &os, const vector<T> &v){os<<"{";REP(i,(int)v.size()){if(i)os<<",";os<<v[i];}os<<"}";return os;}
template <typename T, size_t S> void printArray(const T (&array)[S]){for(auto val : array)std::cout << val << ", ";std::cout << "\n";}
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}
const double PI=acos(-1);
const ll MOD = 1000000007;
using Graph = vector<vector<int>>;
template<class T>inline bool chmax(T& a, T b){if(a < b){a = b; return 1;}return 0;}
template<class T>inline bool chmin(T& a, T b){if(a > b){a = b; return 1;}return 0;}
const ll INF = 1LL<<60;
//const int dx[4] = {1, 0, -1, 0};
//const int dy[4] = {0, 1, 0, -1};
//const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
//const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

void solve(){
    ll x; cin >> x;
    vector<ll> a;
    a.pb(1);
    for(ll i=2; i<=31; i++){
        ll j = 2, num = pow(i, j); 
        //cout << num << endl;
        while(true){
            a.pb(num);
            j++;
            num = pow(i, j);
            if(num > 1000) break;
        }
    }
    sort(ALL(a));
    if(x == 1) cout << 1 << endl;
    else if(x == 1000) cout << a[a.size()-1] << endl;
    else{
        REP(i, a.size()){
            if(a[i] > x){
                cout << a[i-1] << endl;
                break;
            }
        }
    }
}

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

Measured memory_bytes: 640
#include<cstdio>
#include<vector>
#include<algorithm>

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

using namespace std;

template<class T>
struct interval{
	T a,b;
	interval(const T &a,const T &b):a(a),b(b){}
};

const int N_MAX=600000;

template<class T>
class Fenwick_tree_dual{
	int n;
	T a[N_MAX];

public:
	void build(int n){
		this->n=n;
		rep(i,n) a[i]=0;
	}

	void add(int i,int j,T v){
		if(i==0){
			for(;j>=0;j=(j&(j+1))-1) a[j]+=v;
			return;
		}
		add(0,j,v);
		add(0,i-1,-v);
	}

	T sum(int i){
		T s=0;
		for(;i<n;i|=i+1) s+=a[i];
		return s;
	}
};

template<class T>
struct point{ T x,y; };

int parse(char *s){
	if(s[0]!='-'){
		int a,b; sscanf(s,"%d.%d",&a,&b);
		return 1000*a+b;
	}
	else{
		int a,b; sscanf(s+1,"%d.%d",&a,&b);
		return -(1000*a+b);
	}
}

struct event{
	int type,i,x,y;
	interval<int> I;
	event(int type,int i,int x,int y,interval<int> I):type(type),i(i),x(x),y(y),I(I){}
	bool operator<(const event &e)const{
		if(x!=e.x) return x<e.x;
		if(type!=e.type) return type<e.type;
		return false;
	}
};

int main(){
	int n;
	char sr[32]; scanf("%d%s",&n,sr);
	int R=parse(sr);

	static point<int> p[200000];
	rep(i,n){
		char sx[32],sy[32]; scanf("%s%s",sx,sy);
		p[i].x=parse(sx);
		p[i].y=parse(sy);
	}

	int m=0;
	static int Y[600000];
	rep(i,n){
		Y[m++]=p[i].y;
		Y[m++]=p[i].y-R;
		Y[m++]=p[i].y+R;
	}
	sort(Y,Y+m);
	m=unique(Y,Y+m)-Y;

	vector<event> E;
	rep(i,n){
		int c=lower_bound(Y,Y+m,p[i].y  )-Y;
		int u=lower_bound(Y,Y+m,p[i].y-R)-Y;
		int b=lower_bound(Y,Y+m,p[i].y+R)-Y;
		E.push_back(event(0,i,p[i].x  ,c,interval<int>(u,b)));
		E.push_back(event(1,i,p[i].x+R,c,interval<int>(u,b)));
	}
	sort(E.begin(),E.end());

	int ans=0;
	static bool added[N_MAX];
	static Fenwick_tree_dual<int> F;
	F.build(m);
	rep(i,E.size()){
		event e=E[i];
		if(e.type==0){ // in
			if(F.sum(e.y)>0) continue;
			F.add(e.I.a,e.I.b,1);
			added[e.i]=true;
			ans++;
		}
		else{ // out
			if(added[e.i]){
				F.add(e.I.a,e.I.b,-1);
			}
		}
	}
	printf("%d\n",ans);

	return 0;
}

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

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

int main(int argc, char **argv)
{
	ll k; cin >> k;
	ll sum{0};
	for (int i = 1; i <= k; ++i)
	{
		for (int i2 = 1; i2 <= k; ++i2)
		{
			for (int i3 = 1; i3 <= k; ++i3)
			{
				ll tmp = GCD(i, i2);
				tmp = GCD(tmp, i3);
				sum += tmp;
			}
		}
	}
	std::cout << sum << std::endl;
}


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

using namespace std;
#define ll long long
#define ld long double
#define PI 3.141592653L
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const ll INF = (ll)1e18;
const int N = 2e5 + 5;
const ll MOD = 1e9 + 7;

int parent[N];

int gcd(int a, int b) { 
    if (a == 0) 
        return b;  
    return gcd(b%a, a);  
} 
   
int lcm(int a, int b) {  
    return (a*b)/gcd(a,b);  
} 

ll pow(ll x, ll y, ll p) {
    if(y == 0) return 1;
    ll res = 1;
    x %= p;
    if(x == 0) return 0LL;
    while(y > 0) {
        if(y & 1) res = (res*x) % p;
        y >>= 1;
        x = (x*x) % p;
    }
    return res;
}

int find(int x) {
    return x == parent[x] ? x : parent[x] = find(parent[x]);
}

void Union(int x, int y) {
    int xPar = find(x), yPar = find(y);
    if(xPar != yPar) parent[xPar] = yPar;
}

int main()
{
    IOS
    ld a, b;
    cin >> a >> b;
    ll res = (a * round(b * 100)) / 100;
    cout << res << endl;
    return 0;
}



Measured memory_bytes: 3768
#include<bits/stdc++.h>
#define lt long long
using namespace std;
const int N=1e5+5;
const int mod=1e9+7;
const int inf=0x3f3f3f;
int main()
{
	int l,r,n,cnt=0;
	cin>>l>>r>>n;
	for (int i=l;i<=r;i++) if (i%n==0) cnt++;
	cout<<cnt<<endl;
}

Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;
#define rep(i,n) for (int i=0;i<n;++i)
#define REP(i,n) for (int i=1;i<=n;++i)
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define read(x) scanf("%d",&x)
int n,Q;
vector<pii> G[100005];
int col[100005],len[100005];
int dep[100005];
int anc[100005][20];
inline void dfs(int u,int pa=0){
	dep[u]=dep[pa]+1;
	anc[u][0]=pa;
	for (int i=0;i<G[u].size();++i){
		int v=G[u][i].F;
		if (v!=pa) dfs(v,u);
	}
}
inline int LCA(int x,int y){
	if (dep[x]<dep[y]) swap(x,y);
	int d=dep[x]-dep[y];
	rep(j,19) if (d&(1<<j)) x=anc[x][j];
	if (x==y) return x;
	for (int j=18;j>=0;--j) if (anc[x][j]!=anc[y][j]) x=anc[x][j],y=anc[y][j];
	return anc[x][0];
}
ll ans[100005];
vector<pair<int,pii> > contrib[100005];// F:query id    S: F:col(-:double minus) S: y
ll cnt[100005],sum[100005],dist;
inline void calc(int u,int pa){
	for (int i=0;i<contrib[u].size();++i){
		int id=contrib[u][i].F,c=contrib[u][i].S.F,y=contrib[u][i].S.S;
		if (c>0) ans[id]+= cnt[c]*y-sum[c]+dist;
		else c=-c, ans[id]-= 2*(cnt[c]*y-sum[c]+dist);
	}
	for (int i=0;i<G[u].size();++i){
		int v=G[u][i].F,id=G[u][i].S;
		if (v!=pa){
			++cnt[col[id]];sum[col[id]]+=len[id];dist+=len[id];
			calc(v,u);
			--cnt[col[id]];sum[col[id]]-=len[id];dist-=len[id];
		}
	}
}

int main(){
	ios::sync_with_stdio(false);
	cin>>n>>Q;
	REP(i,n-1){
		int x,y,c,d;cin>>x>>y>>col[i]>>len[i];
		G[x].pb(mp(y,i));G[y].pb(mp(x,i));
	}
	dfs(1,0);
	for (int j=0;j<18;++j) REP(i,n) anc[i][j+1]=anc[anc[i][j]][j];
	REP(i,Q){
		int x,y,u,v;cin>>x>>y>>u>>v;
		int lca=LCA(u,v);
		contrib[lca].pb(mp(i,mp(-x,y)));
		contrib[u].pb(mp(i,mp(x,y)));contrib[v].pb(mp(i,mp(x,y)));
	}
	calc(1,0);
	REP(i,Q) cout<<ans[i]<<endl;
	return 0;
}

Measured memory_bytes: 33192
#include<stdio.h>
int main(void){
	int i,jugde=0,N,A[200],count;
	scanf("%d",&N);
	for(i=0;i<N;i++){
		scanf("%d",&A[i]);
	}
	for(count=0;;count++){
		for(i=0;i<N;i++){
			if(A[i]%2!=0){
				jugde=1;
				break;
			}
		}
		if(jugde==0){
			for(i=0;i<N;i++){
				A[i]/=2;
			}
		}else{
			break;
		}
	}
	printf("%d\n",count);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>

using namespace std;

typedef long long ll;

ll k,a,b,ans;

int main (){
	cin >>k>>a>>b;
	if (a>=b-2||k<=a){
		cout<<k+1;
		return 0;
	}
	else {
		k-=(a-1);
		ans=a+(b-a)*(k/2);
		k%=2;
		ans+=k;
		cout<<ans;
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int number_n, number_d, count = 0;
    number_n = Integer.parseInt(sc.next());
    number_d = Integer.parseInt(sc.next());
    count = number_n / (2 * number_d + 1);
    if(number_n % (2 * number_d + 1) != 0) count++;
    System.out.println(count);
  }
}


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

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

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

    int g = as[0];
    for (int i = 1; i < n; i++) {
        g = __gcd(g, as[i]);
    }
    cout << g << endl;
}


Measured memory_bytes: 3728
#include <bits/stdc++.h>
using namespace std;
//Author: Ezio Sam
/* Shorthands */
#define ll long long
#define pb push_back 
#define mp make_pair
#define sp ": "
#define cs "Case "
#define fi first
#define sn second 
#define po(x) x*x
/* STL */
#define vi vector<int>v
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mem(a,n) memset(a, n, sizeof(a));
#define all(x) x.begin(),x.end()
#define sz(x)  (int)x.size()
#define mx(v)  *max_element(v.begin(),v.end())
#define mxa(a) *max_element(a, a.size())
#define r(a) reverse(a.begin(),a.end())
/* loops */
#define fr(i,n)   for(__typeof(n) i=0;i<(n);i++)
#define fn(i,n)   for(__typeof(n)i=1;i<=(n);i++)
#define fa(i,a,n) for(__typeof(a)i=(a);i<=(b);i++)
/*Special*/
#define Ezio ios::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
#define db(something)   cerr<<#something<<" - "<<something<<"\n";         
int main()
{
  
   Ezio
   /*Variables*/
   /*Code*/
   string s;
   int k;
   cin>>k>>s;
   if(k>sz(s))k=sz(s);
   fr(i,k)cout<<s[i];
   cout<<((sz(s)>k)?"...\n":"\n");
   
   return 0;
}
    

Measured memory_bytes: 3612
M,K = map(int, input().split())
if M==1:
  if K==0:
    print(0,0,1,1)
  else:
    print(-1)
elif K>=2**M:
  print(-1)
else:
  ls = list(range(2**M))
  ls.remove(K)
  ans = [K]+ls+[K]+ls[::-1]
  print(' '.join(map(str,ans)))

Measured memory_bytes: 29420
n,m=map(int,input().split())
info=[]
for i in range(m):
    info.append(list(map(int,input().split())))
light=list(map(int,input().split()))
ans=0 

for i in range(2**n): #スイッチの付き方全通り
    on=[]
    onlight=0
    for j in range(n): #何個目のスイッチがついてるかonに記憶
        if (i>>j)&1:
            on.append(j+1)
    for j in range(m): #j番目の電球はこの条件で付くか
        count=0 #ついているスイッチの数
        for k in range(info[j][0]): #j番目の電球とつながっているスイッチがこの条件ではついているか
            if info[j][k+1] in on:
                count+=1
        if count%2==light[j]:
            onlight+=1
    if onlight==m:
        ans+=1
        #print(on)
        
print(ans)

Measured memory_bytes: 3064
# debug
debugFlag = ( ARGV[0] != nil )
p "==== DEBUG MODE ====" if debugFlag

# util functions
def find_posmin(arr)
  m = arr.max
  arr.each do |e_i|
    m = e_i if e_i > 0 and m > e_i
  end
  return m
end

# input
inputs = []
lc = 0
while l = $stdin.gets do
  if true
    inputs << l.chomp.split(" ").map(&:to_s)
  else
    inputs << l.chomp.split(" ").map(&:to_i)
  end
  lc += 1
end

# input check
if debugFlag
  p "--- INPUT (begin) ---"
  inputs.each do |l_i|
    p l_i
  end
  p "--- INPUT (end) ---"
  print "\n"
end

# body
if debugFlag
end

wallet = 0.0
inputs.shift
p inputs if debugFlag
inputs.size.times do |i|
  if inputs[i][1] == "JPY"
    wallet += inputs[i][0].to_f
  else
    wallet += inputs[i][0].to_f * 380000.0
  end
end
puts wallet


Measured memory_bytes: 1788
N, M, K = map(int, input().split())


def is_ok():
    for i in range(0, N+1):
        for j in range(0, M+1):
            if (i*j) + ((N-i)*(M-j)) == K:
                return 1


if is_ok():
    print('Yes')
else:
    print('No')


Measured memory_bytes: 2940
/* ex_9_1
   seira3 */

#include <stdio.h>
#include <stdlib.h>
#define SIZE 11

typedef struct{ //stack型の構造体
    int size;
    int count;
    char data[SIZE];
    char *top;
} stack;

//プロトタイプ宣言
void initialize_stack(stack *stk);
void push(stack *stk, char chara);
int empty(stack *stk);
char pop(stack *stk);
void print_stack(stack *stk);

int main(void){
    char str[SIZE], *ptr; //しぐが押したキーを順番に記録した文字列を入れる配列とポインタを宣言
    stack stk; //stack型のstkを宣言
    scanf("%s",str); //入力
    initialize_stack(&stk); //stkを初期化
    ptr = str; //strの先頭のポインタを代入
    while(*(ptr)!='\0'){ //文字列の外に出るまで
        if(*(ptr)=='B' && empty(&stk)==0){ //その文字がBかつ空出なければ一つ取り出す
            pop(&stk);
        }
        else if(*(ptr)=='0' || *(ptr)=='1'){ //その文字が0か1ならば入れる
            push(&stk,*(ptr));
        }
        ptr++;
    }
    print_stack(&stk); //答えを出力する
    return 0;
}

void initialize_stack(stack *stk){ //stkを初期化
    stk->count = 0;
    stk->size = SIZE;
    stk->top = &(stk->data[0]);
}

void push(stack *stk, char chara){ //stkにcharaを入れる
    if(stk->count >= stk->size){ //オーバーフローしていたらエラーを返す
        printf("Error: stack overflow. (chara=%c)\n", chara);
        exit(1);
    }
    else{
        stk->top++; //topの位置を一つずらして
        *(stk->top) = chara; //topの位置にcharaを代入
        stk->count++; //countを一つ増やす
    }
}

int empty(stack *stk){ //stkが空かどうかを判定
    if(stk->count == 0){ //空なら0を返す
        return 1;
    }
    if(stk->count < 0){ //数がマイナスなら-1を返す
        return -1;
    }
    else{ //中身があれば0を返す
        return 0;
    }
}

char pop(stack *stk){ //stkから一つ取り出す
    char chara;
    if(stk->count <= 0){ //アンダーフローしていればエラーを返す
        printf("Error: stack underflow.\n");
        exit(1);
    }
    else{
        chara = *(stk->top); //今のtopの中身をcharaに代入し
        stk->top--; //topを一つずらし
        stk->count--; //countを一つ減らす
        return chara; //charaを返す
    }
}

void print_stack(stack *stk){
    int i;
    char *ptr;
    ptr = &(stk->data[1]); //一番古いのはdata[1]にある
    for(i=0;i<stk->count;i++){ //入っている分だけ出力
        printf("%c",*ptr++);
    }
    printf("\n"); //改行 
}

Measured memory_bytes: 1596
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(300000)


def solve(A: int, B: int, K: int):
    a = A - min(A, K)
    K -= min(A, K)
    if K:
        B -= min(B, K)
    print(a, B)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(A, B, K)

if __name__ == '__main__':
    main()


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

using namespace std;

typedef long long LL;

const int N = 1000010;

int a[N];
bool st[N];

int main()
{
    cin >> a[1];
    st[a[1]] = true;

    for(int i = 2; ; i++)
    {
        if(a[i - 1] & 1) a[i] = 3 * a[i - 1] + 1;
        else a[i] = a[i - 1] / 2;
        if(st[a[i]])
        {
            cout << i << endl;
            return 0;
        }
        else st[a[i]] = true;
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <unordered_map>
using namespace std;
const int N = 2e5 + 10;
int a[N] , n;
unordered_map <int,int> mp;
int main(){
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    long long ans = 0;
    for (int i = 1; i <= n; i++){
        if (i > a[i]) ans = ans + mp[i - a[i]]; // get result at [i]
        mp[a[i] + i]++; // update result at [i]
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 12840
import scala.io.StdIn.{readInt,readLine}

object Main {

  def exchange(a:Array[Int],i:Int,j:Int) = {
    val temp = a(i)
    a(i) = a(j)
    a(j) = temp
  }

  def partition(a:Array[Int],p:Int,r:Int) = {
    val x = a(r)
    var i = (p-1)
    for(j<-p until r) {
      if(a(j) <= x) {
        i+=1
        exchange(a,i,j)
      }
    }
    exchange(a,i+1,r)
    i+1
  }

  def main(args:Array[String]) = {
    val n = readInt
    val a = readLine.split(" ").map(_.toInt)
    val pivot = partition(a,0,n-1)
    val list = a.zipWithIndex.map{ e =>
      if(e._2==pivot) "["+e._1.toString + "]" else e._1.toString
    }.mkString(" ")
    println(list)
  }
}

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

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

void solve() {
    ll N, M;
    cin >> N >> M;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];

    ll ans = 0;
    ll mul = 1;
    bool ok = true;
    rep(i, N) {
        mul = lcm(A[i] / 2, mul);
    }
    ll x = 0;
    ll tmp = mul;
    while (tmp % 2 == 0) {
        tmp /= 2;
        x++;
    }
    rep(i, N) {
        ll a2 = A[i] / 2;
        ll c = 0;
        while (a2 % 2 == 0) {
            a2 /= 2;
            c++;
        }
        if (c != x) ok = false;
    }
    ans = ok ? M / mul : 0;
    cout << (ans + 1) / 2 << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    return 0;
}


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

int main()
{
    int n, k;
    cin >> n >> k;
    int m = n % k;
    if (m == 0) {
        cout << 0 << endl;
    } else {
        cout << 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
N = int(input())
r = float("inf")
for i in range(1, N):
    A = i
    B = N - i
    a = 0
    b = 0

    while A >= 1:
        a += A % 10
        A /= 10

    while B >= 1:
        b += B % 10
        B /= 10

    if a + b <= r:
        r = a + b

print(int(r))

Measured memory_bytes: 3064
x = input().split()
member = [int(x[1])] * int(x[0])

for l in range(int(x[2])):
  y = input()
  member[int(y) - 1] += 1
      
for z in member:
  if (z - int(x[2])) > 0:
    print("Yes")
  else:
    print("No")

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

const int MAX_N = 100;
int n, a[MAX_N];
int MAX = 0, MIN = 1000;

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

	for (int i = 0; i < n; i++) {
		if (a[i] > MAX) MAX = a[i];
		if (a[i] < MIN) MIN = a[i];
	}

	cout << MAX - MIN << endl;
	return 0;
}

Measured memory_bytes: 256
import collections
N = int(input())
S = input()
A = collections.Counter(S)
B = list("qwertyuiopasdfghjklzxcvbnm")
C = []
for i in B:
    C.append(A[i])
D = [i+1 for i in C if i != 0]
ans = 1
for i in range(len(D)):
    ans *= D[i]
print((ans-1)%(10**9 + 7))

Measured memory_bytes: 9580
import java.util.*;

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

        int health = Integer.parseInt(scan.next()); 
        int varN   = Integer.parseInt(scan.next());
        int attack = 0;

        boolean flag = false;

        for(int i=0; i<varN; i++){
            attack = Integer.parseInt(scan.next());
            health -= attack;

            if(health <= 0){
                flag = true;
                break;
            }
        }

        if(flag){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }

    }
}

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

using namespace std;

typedef long long int Int;

int main(void)
{
    Int n,x;
    vector<Int> a;

    cin>>n>>x;
    for(int i = 0;i < n;i++)
    {
	Int temp;
	cin>>temp;

	a.push_back(temp);
    }

    Int count = 0;
    for(int i = 0;i < n-1;i++)
    {
	if(a[i]+a[i+1] > x)
	{
	    Int temp = (a[i]+a[i+1]) - x;

	    a[i+1] = max(0LL,a[i+1]-temp);
	    count += temp;
	}
    }

    cout<<count<<endl;

    return 0;
}


Measured memory_bytes: 1400
#include<stdio.h>
int main(void)
{
	int n,m;
	int i,j;
	int max,c,cnt[1001];
	int a[1001],b[1001];
	max=0;
	
	scanf("%d %d",&n,&m);
	for(i=0;i<n;i++){
		cnt[i]=0;
		scanf("%d",&a[i]);
	}
	for(i=0;i<m;i++){
		scanf("%d",&b[i]);
	}
	for(i=0;i<m;i++){
		for(j=0;j<n;j++){
			if(b[i]>=a[j]){
				cnt[j]++;
				break;
			}
		}
	}
	for(i=0;i<n;i++){
		if(max<cnt[i]){
			max=cnt[i];
			c=i+1;
		}
	}
	printf("%d\n",c);
	return 0;
}

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

void fnInsertionSort(vector<int>&);
void fnTrace(vector<int>);

int main()
{
  vector<int> viSort;
  int iMaxSize;
  
  cin >> iMaxSize;
  for (int i = 0; i < iMaxSize; i++)
  {
    int iNum;
    cin >> iNum;
    viSort.push_back(iNum);
  }

  fnTrace(viSort);
  fnInsertionSort(viSort);

  return 0;
}

void fnInsertionSort(vector<int> &argviSort)
{
  for (int i = 1; i < argviSort.size(); i++)
  {
    int iTarget = argviSort[i];
    int j = i - 1;
    while (iTarget < argviSort[j] &&
           j       >= 0            )
    {
      argviSort[j + 1] = argviSort[j];
      j--;
    }
    argviSort[j + 1] = iTarget;
    fnTrace(argviSort);
  }
}

void fnTrace(vector<int> argviSort)
{
  for (int i = 0; i < argviSort.size(); i++)
  {
    if (i) cout << " ";
    cout << argviSort[i];
  }
  cout << endl;
}

Measured memory_bytes: 1220
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
 
 
ll N,K;
string S;
string ans="";
bool flag=false;
 
 
 
bool visited[2005][2005];
P mem[2005][2005];
 
P rec(int l,int r){
  if(visited[l][r])return mem[l][r];
  visited[l][r]=true;
 
  if(l==r){
    return mem[l][r]=P(1,1);
  }
 
  if(l-1==r){
    return mem[l][r]=P(0,1);
  }
   
  if(S[l]==S[r]){
    P tmp=rec(l+1,r-1);
    tmp.first+=2;
    return mem[l][r]=tmp;
  }
 
  P pa=rec(l+1,r);
  P pb=rec(l,r-1);
  if(pa.first<pb.first){
    pa.first+=2;
    return mem[l][r]=pa;
  }else if(pa.first>pb.first){
    pb.first+=2;
    return mem[l][r]=pb;
  }else if(pa.first==pb.first){
    pa.first+=2;
    pa.second+=pb.second;
    if(pa.second>K)pa.second=K+1;
    return mem[l][r]=pa;
  }
}
 
 
void dfs(int l,int r,ll k){
  if(l==r){
    if(k!=1)flag=true;
 
    ans+=S[l];
    return;
  }
 
  if(l-1==r){
    if(k!=1)flag=true;
 
    return;
  }
 
  if(S[l]==S[r]){
    ans+=S[l];
    dfs(l+1,r-1,k);
    return;
  }
 
  P lp=mem[l+1][r];
  P rp=mem[l][r-1];
 
  if(lp.first < rp.first){
    ans+=S[l];
    dfs(l+1,r,k);
    return;
  }
 
  if(lp.first > rp.first){
    ans+=S[r];
    dfs(l,r-1,k);
    return;
  }
 
  if(S[l]<S[r]){
    if(k<=lp.second){
      ans+=S[l];
      dfs(l+1,r,k);
      return;
    }
    k-=lp.second;
    if(k<=rp.second){
      ans+=S[r];
      dfs(l,r-1,k);
      return;
    }
    flag=true;
    return;
  }else if(S[l]>S[r]){
    if(k<=rp.second){
      ans+=S[r];
      dfs(l,r-1,k);
      return;
    }
    k-=rp.second;
    if(k<=lp.second){
      ans+=S[l];
      dfs(l+1,r,k);
      return;
    }
    flag=true;
    return;
  }
 
}
 
int main(){
  cin>>S>>K;
  N=S.size();
  P p=rec(0,N-1);
  dfs(0,N-1,K);
  if(flag){
    cout<<"NONE"<<endl;
  }else{
    int size=ans.size();
    if(p.first%2==1){
      for(int i=0;i+1<size;i++)cout<<ans[i];
      for(int i=size-1;i>=0;i--)cout<<ans[i];
      cout<<endl;
    }else{
      for(int i=0;i<size;i++)cout<<ans[i];
      for(int i=size-1;i>=0;i--)cout<<ans[i];
      cout<<endl;
    }
 
  }
  return 0;
}

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

using namespace std;

int main(void)
{
  char S[4];
  cin >> S;
  bool f = false;
  for(int i=0;i<3;i++){
    if(S[i]==S[i+1])
      f = true;
  }
  if(f==true)
    cout << "Bad";
  else
    cout << "Good";
  return 0;
}

Measured memory_bytes: 256
from sys import stdin
S = stdin.readline()
flag = 0
a_pos = 0
z_pos = 0
for c, s in enumerate(S):
    if (s == "A") & (flag == 0):
        flag = 1
        a_pos = c
    if s == "Z":
        z_pos = c
print(z_pos - a_pos + 1)

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

using namespace std;

#define ll long long

void solve() { 

  double d, t, s;
  cin >> d >> t >> s;
  double T = d / s;
  if(T <= t) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }

  return; 
}

int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  int t = 1;
  // cin >> t;
  while (t--) solve();
  return 0;
}

Measured memory_bytes: 3732
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define int long long
#define INF 1000000000000000000
using namespace std;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int, int> Pii;

template<typename T>
void readvec(vector<T> &a);
void readindex(vector<int> &a);

vec binaryrep(int x, int n){
    vec b(n);
    REP(i, n){
        b[i] = x % 2;
        x /= 2;
    }
    return b;
}

signed main(){

    int N; cin >> N;
    vec X(N), Y(N);
    REP(i, N) cin >> X[i] >> Y[i];
    int p = (llabs(X[0]) + llabs(Y[0])) % 2;
    REP(i, N) if((llabs(X[i]) + llabs(Y[i])) % 2 != p){
        cout << -1;
        return 0;
    }

    int m = 31;
    cout << m + 1 - p << endl;
    if(p == 0) cout << 1 << " ";
    REP(i, m) cout << (1 << i) << " ";
    cout << endl;

    REP(i, N){
        string ans = "";
        if(p == 0){
            ans += 'R';
            X[i]--;
        }
        int u = X[i] + Y[i];
        int v = X[i] - Y[i];
        int mm = (1 << m) - 1;
        u = (u + mm) / 2;
        v = (v + mm) / 2;
        vec b_u = binaryrep(u, m);
        vec b_v = binaryrep(v, m);
        REP(i, m){
            if(b_u[i] == 0 && b_v[i] == 0) ans += 'L';
            else if(b_u[i] == 1 && b_v[i] == 0) ans += 'U';
            else if(b_u[i] == 0 && b_v[i] == 1) ans += 'D';
            else if(b_u[i] == 1 && b_v[i] == 1) ans += 'R';
        }
        cout << ans << endl;
    } 

    
    return 0;
}


template<typename T>
void readvec(vector<T> &a){
    REP(i, a.size()){
        cin >> a[i];
    }
}
void readindex(vector<int> &a){
    REP(i, a.size()){
        cin >> a[i];
        a[i]--;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int r, g, b;
  cin >> r >> g >> b;
  
  int sum = r * 100 + g * 10 + b;
  
  if(sum % 4 == 0){
    cout << "YES" << endl;
  }
  
  else{
    cout << "NO" << endl; 
  }
  
}

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

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	int count = 0;
	if (a == b)count++;
	if (b == c)count++;
	if (c == a)count++;
	if (count == 1)cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}


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

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

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

    multiset<int> tree(s.begin(), s.end());
    auto it = --tree.end();

    vector<int> state = {*it};
    tree.erase(it);

    for(int t = 0; t < n; t++) {
        for (int i = 0; i < (1 << t); i++) {
            int from = state[i];
            auto it = tree.lower_bound(from);
            if (it == tree.begin()) {
                cout << "No" << endl;
                return 0;
            }

            --it;
            state.push_back(*it);
            tree.erase(it);
        }
    }

    cout << "Yes" << endl;
}


Measured memory_bytes: 14716