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

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

int main() {
	int cnt[40] = {};
	string str;
	cin >> str;
	REP(i, str.size()) cnt[str[i]-'a']++;
	
	bool flag = true;
	REP(i, 40) if (cnt[i] % 2 == 1) flag = false;
	puts(flag ? "Yes" : "No");
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int CM = 1 << 17, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
	tmp = tmp << dig & ma1;
	tmp = tmp * 10 + (tmp >> 8) & ma2;
	tmp = tmp * 100 + (tmp >> 16) & ma3;
	tmp = tmp * 10000 + (tmp >> 32) & ma4;
	ci += 72 - dig >> 3;
	return tmp;
}

//がんばってputintつくるかぁ
const int MAX = 10000;
const int dm = 1 << 17;
char dn[dm], * di = dn, * owad = dn + dm - 20;
class shuturyoku_unko {
public:
	char C[MAX * 4];
	shuturyoku_unko() : C() {
		rep(i, MAX) {
			int X = i;
			rep(j, 4) {
				C[i * 4 + 3 - j] = '0' + X % 10;
				X /= 10;
			}
		}
	}
	void putint(ll A) {
		if (owad < di) {
			fwrite(dn, 1, di - dn, stdout);
			di = dn;
		}
		int dig = 1;
		if (A >= 100000000) {
			if (A >= 10000000000) dig = 3;
			else if (A >= 1000000000) dig = 2;
			memcpy(di + 4 + dig, C + A % 10000 * 4, 4);
			A /= 10000;
			memcpy(di + dig, C + A % 10000 * 4, 4);
			A /= 10000;
			memcpy(di, C + A * 4 + 4 - dig, dig);
			di += 8 + dig;
		}
		else if (A >= 10000) {
			if (A >= 10000000) dig = 4;
			else if (A >= 1000000) dig = 3;
			else if (A >= 100000) dig = 2;
			memcpy(di + dig, C + A % 10000 * 4, 4);
			A /= 10000;
			memcpy(di, C + A * 4 + 4 - dig, dig);
			di += 4 + dig;
		}
		else {
			if (A >= 1000) dig = 4;
			else if (A >= 100) dig = 3;
			else if (A >= 10) dig = 2;
			memcpy(di, C + A * 4 + 4 - dig, dig);
			di += dig;
		}
		*di++ = '\n';
	}
} f;



int A[100001];
int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);


	int N = getint();
	ll kotae = 0;
	rep(i, N) {
		int kari = getint();
		A[kari]++;
		kotae += kari;
	}

	int Q = getint();
	rep(i, Q) {
		int b = getint();
		int c = getint();

		A[c] += A[b];
		kotae += A[b] * ll(c - b);
		A[b] = 0;

		f.putint(kotae);
	}


	fwrite(dn, 1, di - dn, stdout);

	Would you please return 0;
}

Measured memory_bytes: 2220
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include<time.h>
using namespace std;
typedef long long int llint;
typedef pair<int, int> pint;
typedef vector<bool> vbool;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<llint> vllint;
typedef vector<vllint> vvllint;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<llint, llint>> vpllint;
#define rep(i,n) for(int i=0;i<n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define yes(ans) if(ans)cout<<"yes"<<endl;else cout<<"no"<<endl;
#define Yes(ans) if(ans)cout<<"Yes"<<endl;else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl;else cout<<"NO"<<endl;
#define POSSIBLE(ans) if(ans)cout<<"POSSIBLE"<<endl;else cout<<"IMPOSSIBLE"<<endl;
#define Pi 3.1415926535897932384626
#define coutans rep(i, ans.size())cout << ans[i] << endl;

class UnionFind {
public:
	//親の番号を格納する。親だった場合は-(その集合のサイズ)
	vector<int> Parent;

	//作るときはParentの値を全て-1にする
	//こうすると全てバラバラになる
	UnionFind(int N) {
		Parent = vector<int>(N, -1);
	}

	//Aがどのグループに属しているか調べる
	int root(int A) {
		if (Parent[A] < 0) return A;
		return Parent[A] = root(Parent[A]);
	}

	//自分のいるグループの頂点数を調べる
	int size(int A) {
		return -Parent[root(A)];//親をとってきたい
	}

	//AとBをくっ付ける
	bool connect(int A, int B) {
		//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
		A = root(A);
		B = root(B);
		if (A == B) {
			//すでにくっついてるからくっ付けない
			return false;
		}

		//大きい方(A)に小さいほう(B)をくっ付けたい
		//大小が逆だったらひっくり返しちゃう。
		if (size(A) < size(B)) swap(A, B);

		//Aのサイズを更新する
		Parent[A] += Parent[B];
		//Bの親をAに変更する
		Parent[B] = A;

		return true;
	}
};

//aとbの最大公約数を求めるよ
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

// 返り値: a と b の最大公約数
// ax + by = gcd(a, b) を満たす (x, y) が格納される
long long extGCD(long long a, long long b, long long& x, long long& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}

bool check(int a, int b) {
	return a > b;
}

// mod. m での a の逆元 a^{-1} を計算する
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

//aCbを1000000007で割った余りを求める
llint convination(llint a, llint b) {
	llint ans = 1;
	for (llint i = 0; i < b; i++) {
		ans *= a - i;
		ans %= 1000000007;
	}
	for (llint i = 1; i <= b; i++) {
		ans *= modinv(i, 1000000007);
		ans %= 1000000007;
	}
	return ans;
}

int main() {
	double x1, y1, x2, y2;
	cin >> x1 >> y1 >> x2 >> y2;
	double tmp = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
	printf("%.15f\n", sqrt(tmp));
	return 0;
}


Measured memory_bytes: 3284
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
  int N ;
  cin >> N ;
  string S[N] ;
  int c0=0 , c1=0 , c2=0 , c3=0 ;
  for (int i=0 ; i<N ; i++)
  {
    cin >> S[i] ;
    if (S[i]=="AC")
        c0++;
    else if (S[i]=="WA")
        c1++;
    else if (S[i]=="TLE")
        c2++;
    else if (S[i]=="RE")
        c3++;

  }

  cout << "AC x " << c0 << endl;
  cout << "WA x " << c1 << endl;
  cout << "TLE x " << c2 << endl;
  cout << "RE x " << c3 << endl;

    return 0;
}

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

int main() {

  for(int i = 0; i < 9; i++) {
    string name;
    int a, b;
    cin >> name >> a >> b;
    cout << name << " " << a+b << " " << a*200 + b*300 << endl;
  }

	return 0;
}

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

typedef long long ll;
const int INF = 1e9;
const ll LINF = 1e18;
const int mod = 1e9+7;

#define pi pair<int,int>
#define pl pair<lld,lld>

#define dump(x) cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl

#define mem0(x) memset(x,0,sizeof(x))
#define fillnum(x,n) fill(begin(x),end(x),n)
#define asort(x) sort(x.begin(),x.end())
#define dsort(x,t) sort(x.begin(),x.end(),greater<t>())
#define vuniq(x) x.erase(unique(x.begin(), x.end()), x.end())

#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)

int main() {
    ll N; cin >> N;
    string S[100001];
    vector<char> V[100001];
    map<string, ll> flg;
    ll cnt = 0;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < 10; j++) {
            char c; cin >> c;
            V[i].pb(c);
        }
        asort(V[i]);
        S[i] = "";
        for (int j = 0; j < 10; j++) {
            S[i] += V[i][j];
        }
        if(flg[S[i]] != 0){
            cnt += flg[S[i]];
        }
        flg[S[i]]++;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 19880
#include <bits/stdc++.h>
#define int int64_t
#define pb push_back
#define pii pair<int, int>
#define F first
#define S second
#define vecsort(x) sort(x.begin(), x.end())
#define vecrsort(x) sort(x.rbegin(), x.rend())
#define massort(x, n) sort(x, x + n)
#define FOR(i, n) for(int i = 0; i < n; i ++)
using namespace std;
int max(int32_t a, int b){
   return max((int)a, b);
}

const int INF = 1e12;

int bin_search(vector<int> &v, int elem){
   int l = 0;
   int r = v.size();
   while(l < r){
      int m = (l + r) / 2;
      if(v[m] < elem)
         r = m;
      else
         l = m + 1;
   }
   if(r == v.size())
      return INF;
   return l;
}

int32_t main(){
   ios_base::sync_with_stdio(0);
   cin.tie(0);
   int n; cin >> n;
   vector<int> ar(n);
   for(int i = 0; i < n; i ++)
      cin >> ar[i];
   vector<int> ans;
   for(int i = 0; i < n; i ++){
      int x = bin_search(ans, ar[i]);
      if(x == INF){
         ans.pb(ar[i]);
      }else{
         ans[x] = ar[i];
      }
   }
   cout << ans.size();
}


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

long sumFormulas(string s) {
  
  int size = s.size();
  if (!size) {
    return 0;
  }
  
 // cout << s << endl;
  long sum = stol(s);
  long duplicate = 1;
  for (int i = size - 1; i > 0; i--) {
    string former = s.substr(0, i);
   // cout << former << endl;
    string later = s.substr(i);
    sum += (stol(former) * duplicate + sumFormulas(later));
    duplicate *= 2;
  }
  return sum;
}

int main() {
  string S;
  cin >> S;
  
  cout << sumFormulas(S);
}

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

int main(){
     int a,b;
     cin>>a>>b;
     if(a==b){
          cout<< "Draw";
     }else if(a>b){
          if(b==1)cout<<"Bob";
          else{
               cout<<"Alice";
          }
     }else if(b>a){
          if(a==1)cout<<"Alice";
          else{
               cout<<"Bob";
          }
     }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <iomanip> // cout<<setprecision(n)
#include <functional> // std::function<void(ll)>
using namespace std;
#define All(v) (v).begin(),(v).end()
typedef long long ll;
const ll mod = 1000000007;
const ll inf = mod*mod;
const ll d5 = 114514;
const double EPS = 1e-10;
const double INF = 1e+10;
const double PI = acos(-1.0);
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s,t;
    cin>>s>>t;
    ll n = s.size();
    unordered_map<char,vector<ll>> d;
    for(ll i=0;i<n;i++){
        d[s[i]].push_back(i+1);
    }
    for(char c:t){
        if(d[c].empty()){
            cout<<-1<<endl;
            return 0;
        }
    }
    ll res = 0;
    ll now = 0;
    for(char c:t){
        ll p = distance(d[c].begin(),upper_bound(All(d[c]),now));
        if(p>=d[c].size()){
            res+=n-now+d[c][0];
            now=d[c][0];
        }
        else{
            res+=d[c][p]-now;
            now=d[c][p];
        }
    }
    cout<<res<<endl;
}

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

#define ll long long
#define re register
#define il inline
#define gc getchar
#define pc putchar

template <class T>
void read(T &x) {
  re bool f = 0;
  re char c = gc();
  while ((c < '0' || c > '9') && c != '-') c = gc();
  if (c == '-') f = 1, c = gc();
  x = 0;
  while (c >= '0' && c <= '9') x = x * 10 + (c ^ 48), c = gc();
  f && (x = -x);
}

template <class T>
void print(T x) {
  if (x < 0) pc('-'), x = -x;
  if (x >= 10) print(x / 10);
  pc((x % 10) ^ 48);
}

#define priln(x) do{print(x);pc('\n');}while(0)
#define prisp(x) do{print(x);pc(' ');}while(0)



int main() {
  int a, b;
  read(a);
  read(b);
  if (a > b) a ^= b ^= a ^= b;
  for (int i = 1; i <= b; i++) print(a);
  puts("");
}


Measured memory_bytes: 256
#include <stdio.h>
int main(){
 
  char n;
  int i,m;
  int s[26]={};
 
  for(;;){
    m=scanf("%c",&n);
     
    if(m==EOF){
      break;
    }
 
   
    for(i=0;i<=25;i++){
      if(n=='a'+i){
    s[i]++;
      }
      if(n=='A'+i){
      s[i]++;
      }
    }
    
  }
      for(i=0;i<=25;i++){
    printf("%c : %d\n",'a'+i,s[i]);
      }
 
      return 0;
 
    }

Measured memory_bytes: 2716
#include<iostream>
#include<string>
using namespace std;
int main(){
	int n,h,c;
	while(cin>>n){
		h=1;
		c=0;
	for(int i=0;i<10;i++){
		if(n%(h*2)!=0){
			n-=h;
			if(c==0)
			    cout<<h;
			else
				cout<<" "<<h;
			c=1;
		}
		h*=2;
	}
	cout<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  int a,b;
  cin>>a>>b;
  vector<int>c(3);
  c[a-1]++;c[b-1]++;
  rep(i,3){
    if(c[i]==0)
      cout<<i+1<<endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define cs const 
#define fr first 
#define se second
#define ls (now<<1)
#define rs (now<<1|1)
#define mid ((l+r)>>1)
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define low(i) (i&(-i))
#define par pair<int,int>
#define cn(x) memset(x, 0, sizeof(x))
#define rep(i, x, y) for(int i=x; i<=y; ++i)
#define sep(i, x, y) for(int i=x; i>=y; --i)
#define fore(i, x) for(int i=fir[x]; i; i=nex[i])

cs int G = 3;
cs int ff = 2e6 + 1;
cs int inf = 1e9 + 1;
cs int base = 2333;
cs int mod = 1e9 + 7;

char s[ff], t[ff];
int Ans = inf;
signed main()
{
	cin >> s; cin >> t;
	int l1 = strlen(s), l2 = strlen(t);
	rep(i, 0, l1 - 1)
	{
		int st = i, ed = i + l2 - 1, S = 0;
		if(ed > l1 - 1) break;
		rep(j, st, ed)
			S += (s[j] != t[j - st]);
		Ans = min(Ans, S);
	}
	cout << Ans;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define REP(i, m, n) for(int (i) = (m); (i) < (n); ++i)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
using namespace std;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1e9+7;
const ll LINF = 1LL<<60;

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int n;
    ll c;
    cin >> n >> c;
    vector<ll> x(n+1), v(n+1), vc(n+1);
    x[0] = 0;
    v[0] = 0;
    REP(i, 1, n+1) cin >> x[i] >> v[i];
    
    vc[0] = v[0];
    REP(i, 1, n+1) {
        vc[i] = vc[i-1] + v[i];
    }

    vector<ll> r(n+1);
    r[0] = 0;
    REP(i, 1, n+1) {
        r[i] = max(r[i-1], vc[i]-x[i]);
    }

    vector<ll> l(n+1);
    l[n] = vc[n] - vc[n-1] - (c - x[n]);
    for (int i = n - 1; i >= 1; --i) {
        l[i] = max(l[i+1], vc[n]-vc[i-1]-(c-x[i]));
    }

    ll ans = 0;
    rep(i, n+1) {
        ll tmp = vc[i] - x[i];
        chmax(ans, tmp);

        if (i < n) {
            tmp = vc[i] - 2 * x[i] + l[i+1];
            chmax(ans, tmp);
        }
    }
    for (int i = n; i >= 1; --i) {
        ll tmp = vc[n] - vc[i-1] - (c-x[i]);
        chmax(ans, tmp);

        tmp = vc[n] - vc[i-1] - 2 * (c - x[i]) + r[i-1];
        chmax(ans, tmp);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 4224
import java.util.*;

public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int S = sc.nextInt();
    int W = sc.nextInt();
 
     if(S<=W){
    System.out.println("unsafe");
      }else{
	System.out.println("safe");
      }
      }
}


Measured memory_bytes: 35568
import heapq
import sys
input = sys.stdin.readline


def main():
    N, M = map(int, input().split())
    X = []
    Y = []
    Z = []
    for _ in range(N):
        x, y, z = map(int, input().split())
        X.append(x)
        Y.append(y)
        Z.append(z)
    
    ans = 0
    for i in range(-1, 2, 2):
        for j in range(-1, 2, 2):
            for k in range(-1, 2, 2):
                Q = [(X[_]*i + Y[_]*j + Z[_]*k)*(-1) for _ in range(N)]
                heapq.heapify(Q)
                tmp = 0
                for _ in range(M):
                    tmp += heapq.heappop(Q)*(-1)
                ans = max(ans, tmp)

    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 3316
# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-


def main():
    N = int(input())
    H = list(map(int, input().split()))
    result = H[0]
    count = 0
    for h in H:
        if result <= h:
            count += 1
            result = h
    print(count)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3064
#include "bits/stdc++.h"
using namespace std;
using ll = long long;

template <typename T>
void print_vec(const vector<T>& v, bool is_reverse=false, ll num=0){
  if(num == 0) num = (ll)v.size();
  cout << endl; cout << "i=  ";for(ll i=0; i<num; i++) cout << i << "   ";cout << endl;  
  cout << "    ";
  if(is_reverse) for(ll i=num-1; i>=0; i--){ cout<<v[i]; if(i!=0) cout<<"   ";}
  else for(ll i=0; i<num; i++){ cout<<v[i]; if(i!=num-1) cout<<"   ";}
  cout << endl;
}

// template <typename T>
// void print_pairvec(const vector<T> &v, ll num=0){
//   if(num == 0) num = (ll)v.size();
//   cout << endl; for(ll i=0; i<num; i++){ cout << v[i].first << " " << v[i].second << endl;}
// }
template <typename T>
void print_pairvec(const T &_pair, ll num=0){
  cout << endl; for(pair<ll, int> x: _pair){ cout << x.first << " " << x.second << endl;}
}

template <typename T>
void print_vec2(const vector<vector<T>>& v){
  cout << endl; cout << "       ";
  for(ll i=0; i<v[0].size(); i++) cout << i << "   "; 
  cout << endl;
	for(ll i=0; i<v.size(); i++){
		cout << "i=" << i << ":   ";
		for(ll j=0; j<v[i].size(); j++){
			if(v[i][j] == 0) cout << "\x1B[0m" << v[i][j] << "   ";
      else cout << "\x1B[31m" << v[i][j] << "   ";//https://stackoverrun.com/ja/q/12618775
		}
		cout << "\x1B[0m" << endl;
	}
}

struct Eratosthenes{
  vector<ll> sieve;// sieve[i]: 数字iがエラトステネスで篩落とされた時の素数

  Eratosthenes(ll n): sieve(n+1){
    for(int i=0; i<=n; i++) sieve[i] = i;
    for(ll i=2; i*i<=n; i++){
      if(sieve[i] < i) continue;
      for(ll j=i*i; j<=n; j+=i) sieve[j] = min(sieve[j], i);
    } 
  }

  vector<ll> prime_divisors(ll x, bool tmp=false){
    vector<ll> res(1,1);//back()のところで ひっかかるので1を入れとかないとダメ
    while(x > 1){
      if(res.back() != sieve[x]) res.push_back(sieve[x]);
      x /= sieve[x];
    }
    return res;
  }

  map<ll, int> prime_divisors(ll x, int tmp=0){
    map<ll, int> mp;
    while(x > 1){
      mp[sieve[x]]++;
      x /= sieve[x];
    }
    return mp;
  }
};

int main(){
  int N;
  cin >> N;
  
  // 解2 調和級数
  const int INF = 1e7+1;
  vector<int> vec(INF, 0);
  for(int i=1; i<=INF; i++){
    for(int j=1; j*i<=INF; j++) vec[i*j]++;
  }
  // cout << " vec: "; print_vec(vec, false, 5);
  ll ans = 0;
  for(int k=0; k<=N; k++) ans += (ll)k * vec[k];
  cout << ans << endl;
  return 0;
  
  // 解1 高速な素因数分解 (cf. ABC177 E)
  // const int INF = 1e7;
  // Eratosthenes era(INF);
  // ll ans = 0;
  // for(int k=1; k<=N; k++){
  //   map<ll, int> mp = era.prime_divisors(k, 0);
  //   int num = 1;//約数の個数を数える
  //   for(pair<ll, int> x : mp) num *= x.second+1;
  //   ans += (ll)k * num;
  // }
  // cout << ans << endl;
  // return 0;
}


Measured memory_bytes: 42328
a,b = tuple(map(int,input().split()))

if a<=0 and b>=0:
  print("Zero")
elif a<0 and b<0:
  if (b-a+1)%2==0:
  	print("Positive")
  else:
    print("Negative")
elif a>0 and b>0:
  print("Positive")

Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define F first
#define S second
#define P pair<int,int>
#define PI pair<P,int>
#define all(v) v.begin(),v.end()


void f(int n,int l){
  vector<char> d(n);
  vector<int> p(n);
  rep(i,n){
    cin>>d[i]>>p[i];
  }

  vector<int> sec(n);
  int m=n;
  int s=0;
  while(m){
    //cout<<m<<endl;
    vector<int> next(n);
    rep(i,n){
      if(p[i]==-1||p[i]==0||p[i]==l){
        next[i]=-1;
      }else{
        if(d[i]=='L'){
          next[i]=p[i]-1;
        }else{
          next[i]=p[i]+1;
        }
        if(next[i]==0||next[i]==l){
          m--;
          sec[i]=s+1;
        }
      }
    }
    rep(i,n){
     //cout<<next[i]<<' ';
      FOR(j,i+1,n){
        if(next[i]==-1||next[j]==-1) continue;
        if(next[i]==next[j]){
          d[i]=(d[i]=='L'?'R':'L');
          d[j]=(d[j]=='L'?'R':'L');
        }
      }
    }
    //cout<<endl;
    p=next;
    s++;
  }

  vector<PI> ans(n);
  rep(i,n){
    PI p;
    p.F.F=sec[i];
    p.F.S=(d[i]=='L'?1:0);
    p.S=i;
    ans[i]=p;
    //cout<<p.F.F<<' '<<p.F.S<<' '<<p.S<<endl;
  }
  
  sort(all(ans));
  reverse(all(ans));
  

  cout<<ans[0].F.F<<' '<<ans[0].S+1<<endl;
}



signed main(){

  int n,l;
  while(true){
    cin>>n>>l;
    if(n==0) break;
    f(n,l);
  }
}


Measured memory_bytes: 3012
#include <iostream>
using namespace std;
int main()
{
	int n,t,mn=(1<<30),mx=0,cnt=0;
	scanf("%d%d",&n,&t);
	for (int i=0;i<n;i++)
	{
		int a;
		scanf("%d",&a);
		mn=min(mn,a);
		if (a-mn>mx)
		{
			mx=a-mn;
			cnt=0;
		}
		if (a-mn==mx)
		cnt++;
	}
	printf("%d",cnt);
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main(){
	var a, b, n, k int
	fmt.Scan(&n, &k)
	a = n/k
	if n%k >= k/2{
		b = a+1
	} else {
		b = a
	}
	ans := a + 3*a*(a-1) + a*(a-1)*(a-2)
	if k%2 == 0{
		fmt.Println(ans + b + 3*b*(b-1) + b*(b-1)*(b-2))
	} else {
		fmt.Println(ans)
	}
}

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

typedef ostringstream OSS; typedef istringstream ISS;
typedef long long LL;
typedef pair<int, int> PII;  typedef pair<LL, LL> PLL;
typedef vector<int>    VI;   typedef vector<VI>   VVI;   typedef vector<VVI>   VVVI;
typedef vector<LL>     VLL;  typedef vector<VLL>  VVLL;  typedef vector<VVLL>  VVVLL;
typedef vector<double> VD;   typedef vector<VD>   VVD;   typedef vector<VVD>   VVVD;
typedef vector<string> VS;   typedef vector<VS>   VVS;   typedef vector<VVS>   VVVS;
typedef vector<bool>   VB;   typedef vector<VB>   VVB;   typedef vector<VVB>   VVVB;
typedef vector<PII>    VPII; typedef vector<VPII> VVPII; typedef vector<VVPII> VVVPII;
typedef vector<PLL>    VPLL; typedef vector<VPLL> VVPLL; typedef vector<VVPLL> VVVPLL;

typedef unsigned int  UI;
typedef vector<UI>    VUI;
typedef vector<VUI>   VVUI;

#define fst first
#define snd second
// #define Y first
// #define X second
#define MP make_pair
#define PB push_back
#define EB emplace_back 
#define ALL(x)  (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define RANGEBOX(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
#define RANGE(x, l, r) ((l) <= (x) && (x) <= (r))
#define rep(i, N)  for (int i = 0; i < (int)(N); i++)
#define rrep(i, N) for (int i = N - 1; i >= 0; i--)
#define REP(i, init, N)  for (int i = (init); i < (int)(N); i++)
#define RREP(i, N, last) for (int i = (init - 1); i >= last; i--)
#define MAXUD(orig, target) orig = max(orig, target)
#define MINUD(orig, target) orig = min(orig, target)
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl

template < typename T > inline T fromString(const string &s) { T res; ISS iss(s); iss >> res; return res; };
template < typename T > inline string toString(const T &a)   { OSS oss; oss << a; return oss.str(); };

template<typename T=int> inline void dump(vector<T> vs, bool ent=false) { rep(i, vs.size()) cout << vs[i] << (i+1==vs.size() ? '\n' : ' '); if (ent) cout << endl; }
template<typename T = int> inline void dump(vector<vector<T>> vs, bool ent = false) { rep(i, vs.size()) dump<T>(vs[i]); if (ent) cout << endl; }

const int    INF  = 0x3f3f3f3f;
const LL     INFL = 0x3f3f3f3f3f3f3f3fLL;
const double DINF = 0x3f3f3f3f;
const int    DX[] = {-1,  0, 1, 0};
const int    DY[] = {0, -1,  0, 1};
const double EPS  = 1e-12;
// const double PI   = acos(-1.0);
// lambda: [](T1 x)->T2{return y;}
// simple lambda: [](T x){return x;}

pair<int, int> solve(int N) {
    VI ns(N), ds(N);
    REP(i, 1, N) {
        cin >> ns[i] >> ds[i];
    }

    VI xs(N), ys(N);

    REP(i, 1, N) {
        int x = xs[ns[i]] + DX[ds[i]];
        int y = ys[ns[i]] + DY[ds[i]];
        xs[i] = x;
        ys[i] = y;
    }

    int l = *min_element(ALL(xs));
    int r = *max_element(ALL(xs));
    int t = *max_element(ALL(ys));
    int b = *min_element(ALL(ys));
    
    return make_pair(r - l + 1, t - b + 1);
}

int main(void) {
    int N;
    while (cin >> N, N) {
        pair<int, int> ans = solve(N);
        cout << ans.first << " " << ans.second << endl;
    }

    return 0;
}

Measured memory_bytes: 3108
N = int(input())
S = {}

for _ in range(N):
    s = input()

    if s in S.keys():
        S[s] += 1
    else:
        S[s] = 1

m = max(S.values())
for s in sorted(map(lambda x: x[0], filter(lambda x: x[1] == m, S.items()))):
    print(s)


Measured memory_bytes: 32096
import java.util.Scanner;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a, b, c;
    a = sc.nextInt();
    b = sc.nextInt();
    c = sc.nextInt();
    if (a > c || a + b < c) {
      System.out.println("NO");
    } else {
      System.out.println("YES");
    }
  }
}


Measured memory_bytes: 22484
#include <cstdio>
#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <deque>
#include <map>

using namespace std;

const int CMax = 100002;
const int CInf = 2000000001;
const long long CMod = 1000000007;

int n, p, q, r;

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

string baseConverter(int base, int num) {
    string tNum = "";
    while (num > 0) {
        tNum = (char)('0' + num%base) + tNum;
        num /= base;
    }
}

bool isPalindrom(string tS) {
    int sn = (int)tS.length();
    for (int i = 0; i < sn / 2; i++) {
        if (tS[i] != tS[sn - i - 1]) return false;
    }
    return true;
}

int dist(int i, int j) {
    return  (j < i ? n + j : j) - i;
}

int main()
{
    scanf("%d %d %d", &p, &q, &r);

    printf("%d", min(p + q, min(p + r, q + r)));

    return 0;
}


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int n;
int x[125252],y[125252];


set<int> S;
set<pii> xx, yy;
set<pair<int,int>> mmm[4]; // ph -> (cost, id)

void po(int id){
  // remove id & insert near 4
  S.erase(id);
  xx.erase(pii(x[id],id));
  yy.erase(pii(y[id],id));
  // right & left
  {
    auto it = xx.lower_bound(pii(x[id],-1));
    if(it != xx.end()){
      int cost = abs(it->first - x[id]);
      int nid = it->second;
      mmm[0].insert(pii(cost,nid));
    }
    if(it!=xx.begin()){
      it--;
      int cost = abs(it->first - x[id]);
      int nid = it->second;
      mmm[1].insert(pii(cost,nid));
    }
  }
  {
    auto it = yy.lower_bound(pii(y[id],-1));
    if(it != yy.end()){
      int cost = abs(it->first - y[id]);
      int nid = it->second;
      mmm[2].insert(pii(cost,nid));
    }
    if(it!=yy.begin()){
      it--;
      int cost = abs(it->first - y[id]);
      int nid = it->second;
      mmm[3].insert(pii(cost,nid));
    }
  }
}

int main(){
  scanf("%d",&n);
  REP(i,n)scanf("%d%d",x+i,y+i);
  ll ans = 0;
  REP(i,n)xx.insert(pii(x[i],i)), yy.insert(pii(y[i],i));
  REP(i,n)S.insert(i);
  po(0);
  REP(_,n-1){
    int id=-1, cost=1025283025;
    REP(i,4){
      while(mmm[i].size()){
        int yo = mmm[i].begin()->second;
        if(S.count(yo)){
          if(mmm[i].begin()->first < cost){
            cost = mmm[i].begin()->first;
            id = yo;
          }
          break;
        }
        mmm[i].erase(mmm[i].begin());
      }
    }
    assert(id!=-1);
    ans += cost;
    po(id);
  }
  printf("%lld\n",ans);
  return 0;
}


Measured memory_bytes: 15104
#include <bits/stdc++.h>
#define REP(i,n) for (long long i=0;i<(n);i++)
#define FOR(i,a,b) for (long long i=(a);i<(b);i++)
#define RREP(i,n) for(long long i=n;i>=0;i--)
#define RFOR(i,a,b) for(long long i=(a);i>(b);i--)
#define dump1d_arr(array) REP(i,array.size()) cerr << #array << "[" << (i) << "] ==> " << (array[i]) << endl
#define dump2d_arr(array) REP(i,array.size()) REP(j,array[i].size()) cerr << #array << "[" << (i) << "]" << "[" << (j) << "] ==> " << (array[i][j]) << endl
#define dump(x)  cerr << #x << " => " << (x) << endl
#define dumpP(p) cerr << "( " << p.first << " , " << p.second << " )" << ends
#define SORT(c) sort((c).begin(),(c).end())
#define MIN(vec) *min_element(vec.begin(), vec.end())
#define MAX(vec) *max_element(vec.begin(), vec.end())
#define UNIQ(vec) vec.erase(unique(vec.begin(), vec.end()),vec.end()) //ソートの必要あり
#define IN(n,m)  (!(m.find(n) == m.end()))
#define ENUM(m) for (auto itr = m.begin(); itr != m.end(); ++itr)
#define dump_MAP(m) for(auto itr = m.begin(); itr != m.end(); ++itr) { cerr << itr->first << " --> "  << itr->second << endl; }
#define FINDL(vec,x) (lower_bound(vec.begin(),vec.end(),x) - vec.begin())
#define FINDU(vec,x) (upper_bound(vec.begin(),vec.end(),x) - vec.begin())
#define ROUND(N) setprecision(N)
#define ROUND_PRINT(N,val) cout << fixed;cout << setprecision(N) << val << endl
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define INARR(h,w,x,y) (0 <= y && y < h && 0 <= x && x < w)

using namespace std;
constexpr int dx[4] = {0,1,0,-1};
constexpr int dy[4] = {1,0,-1,0};
constexpr long double pi = M_PI;
constexpr double eps = 1e-10;
constexpr long mod = 1000000007;
constexpr short shINF = 32767;
constexpr long loINF = 2147483647;
constexpr long long llINF = 9223372036854775807;
typedef long long LL;
typedef vector<LL> VL;
typedef vector<long> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<LL,LL> pr;
typedef vector<bool> VB;
typedef vector<pr> VP;
struct Order {
	bool operator() (pr const& a,pr const& b) const {
		return a.first > b.first || ((a.first == b.first) && (a.second > b.second));
	}
};


int main(void) {
	long lim = 400;
	VL seq1(400),seq2;
	REP(i,400) {
		seq1[i] = (i * (i+1) * (i+2) / 6);
		if (seq1[i]%2) seq2.push_back((i * (i+1) * (i+2) / 6));
	}
	VI dp(1000000,loINF),dp2(1000000,loINF);
	dp[0] = dp2[0] = 0;
	REP(i,400) FOR(j,seq1[i],1000000) {
		dp[j] = min(dp[j],dp[j-seq1[i]]+1);
	}
	REP(i,seq2.size()) {
		FOR(j,seq2[i],1000000) {
			dp2[j] = min(dp2[j],dp2[j-seq2[i]]+1);
		}
	}
	long n;
	while (1) {
		cin >> n;
		if (n == 0) break;
		cout << dp[n] << " " << dp2[n] << endl;
	}
}



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

#define show(x) cerr << #x << " = " << x << endl

using namespace std;
using ll = long long;
using P = pair<ll, ll>;

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "sz:" << v.size() << "\n[";
    for (const auto& p : v) {
        os << p << ",";
    }
    os << "]\n";
    return os;
}

template <typename S, typename T>
ostream& operator<<(ostream& os, const pair<S, T>& p)
{
    os << "(" << p.first << "," << p.second
       << ")";
    return os;
}


bool parallel(const pair<P, P>& l1, const pair<P, P>& l2)
{
    const ll dx1 = l1.first.first - l1.second.first;
    const ll dx2 = l2.first.first - l2.second.first;
    const ll dy1 = l1.first.second - l1.second.second;
    const ll dy2 = l2.first.second - l2.second.second;
    return dx2 * dy1 == dx1 * dy2;
}

int m;
ll rec(const ll used, const vector<ll>& x, const vector<ll>& y, vector<pair<P, P>>& pairs)
{
    if (pairs.size() == m / 2) {
        ll sum = 0;
        //        show(pairs);
        const int size = pairs.size();
        for (int i = 0; i < size; i++) {
            for (int j = i + 1; j < size; j++) {
                if (parallel(pairs[i], pairs[j])) {
                    sum++;
                }
            }
        }
        return sum;
    } else {
        int head = 0;
        for (head = 0; head < m; head++) {
            if ((used & (1LL << head)) == 0) {
                break;
            }
        }
        ll maxi = 0;
        for (int i = head + 1; i < m; i++) {
            vector<pair<P, P>> p = pairs;
            if ((used & (1LL << i)) == 0) {
                p.push_back(make_pair(make_pair(x[head], y[head]), make_pair(x[i], y[i])));
                maxi = max(maxi, rec(used | (1LL << head) | (1LL << i), x, y, p));
            }
        }
        return maxi;
    }
}

int main()
{
    cin >> m;
    vector<ll> x(m);
    vector<ll> y(m);
    for (int i = 0; i < m; i++) {
        cin >> x[i] >> y[i];
    }
    vector<pair<P, P>> pairs;
    cout << rec(0, x, y, pairs) << endl;

    return 0;
}

Measured memory_bytes: 3128
#include<iostream>
#include<vector>
#include<bits/stdc++.h>
#define lli long long int
#define mod 1000000007
#define pb push_back
#define mk make_pair
#define fastio ios_base::sync_with_stdio(false); cout.tie(NULL);
using namespace std;

int main()
{
	fastio;
	lli a,b,c,d,f=0;
	cin>>a>>b>>c>>d;
	while(1)
	{
		if(f==0)
		{
			c-=b;
			f=1;
		}
		else
		{
			a-=d;
			f=0;
		}
		if(a<=0)
		{
			cout<<"No";
			return 0;
		}
		if(c<=0)
		{
			cout<<"Yes";
			return 0;
		}
	}
//	if(a<=0)
//		cout<<"No";
//	else
//		cout<<"Yes";
	return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define space putchar(' ')
#define enter putchar('\n')
#define eps 1e-10
#define MAXN 200005
//#define ivorysi
using namespace std;
typedef long long int64;
typedef unsigned int u32;
typedef double db;
template<class T>
void read(T &res) {
    res = 0;T f = 1;char c = getchar();
    while(c < '0' || c > '9') {
        if(c == '-') f = -1;
        c = getchar();
    }
    while(c >= '0' && c <= '9') {
        res = res * 10 +c - '0';
        c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {x = -x;putchar('-');}
    if(x >= 10) {
        out(x / 10);
    }
    putchar('0' + x % 10);
}
const int MOD = 1000000007;
int B,W;
int fac[MAXN],invfac[MAXN],pw[MAXN];
int r[MAXN],c[MAXN];
int inc(int a,int b) {
    return a + b >= MOD ? a + b - MOD : a + b;
}
int mul(int a,int b) {
    return 1LL * a * b % MOD;
}
int C(int n,int m) {
    if(n < m) return 0;
    return mul(fac[n],mul(invfac[m],invfac[n - m]));
}

int fpow(int x,int c) {
    int res = 1,t = x;
    while(c) {
        if(c & 1) res = mul(res,t);
        t = mul(t,t);
        c >>= 1;
    }
    return res;
}
void Solve() {
    read(B);read(W);
    fac[0] = 1;
    for(int i = 1 ; i <= B + W ; ++i) fac[i] = mul(fac[i - 1],i);
    invfac[B + W] = fpow(fac[B + W],MOD - 2);
    for(int i = B + W - 1 ; i >= 0 ; --i) invfac[i] = mul(invfac[i + 1],i + 1);
    pw[0] = 1;pw[1] = invfac[2];
    for(int i = 2 ; i <= B + W ; ++i) pw[i] = mul(pw[i - 1],pw[1]);
    r[0] = pw[W];
    for(int i = 1; i <= B ; ++i) {
        r[i] = inc(r[i - 1],mul(pw[1],mul(pw[i + W - 1],C(i + W - 1,i))));
    }
    c[0] = pw[B];
    for(int i = 1 ; i <= W ; ++i) {
        c[i] = inc(c[i - 1],mul(pw[1],mul(pw[B - 1 + i],C(B - 1 + i,i))));
    }
    for(int i = 0 ; i < B + W ; ++i) {
        int res = (MOD + 1) / 2;
        if(i >= B) {
            res = inc(res,MOD - mul((MOD + 1) / 2,c[i - B]));
        }
        if(i >= W) {
            res = inc(res,mul((MOD + 1) / 2,r[i - W]));
        }
        out(res);enter;
    }

}
int main() {
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
    return 0;
}


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

int main() {

  int N, K;
  cin >> N;
  cin >> K;
  
  int d = 1;  
 
//  while (i < N) {
  
//    cout << i << "  " << f << endl;
    
  for (int i = 0; i < N; i++) {
    
    if (d  > K)
      d += K;
    
    else 
      d *= 2;
    
//    cout << d << endl;
    
  }
  

    cout << d << endl;
  
}


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

using namespace std;

const int N = 13;
const int M = 1001;
bool visited[N];
int dp[M][1 << N];
int n, m, c[M], b[M][N];

int solve(int kkey, int mask) {
    if (kkey == m) {
        if (mask == (1 << n) - 1) {
            return 0;
        } else {
            return 1e9;
        }
    }
    int& ans = dp[kkey][mask];
    if (ans != -1) {
        return ans;
    }
    int newMask = mask;
    for (int i = 0; i < n; i++) {
        if (b[kkey][i]) {
            newMask |= (1 << i);
        }
    }
    ans = min(solve(kkey + 1, mask), solve(kkey + 1, newMask) + c[kkey]);
    return ans;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        cin >> c[i];
        int k;
        cin >> k;
        for (int j = 0; j < k; j++) {
            int x;
            cin >> x;
            b[i][x - 1] = true;
            visited[x - 1] = true;
        }
    }
    bool flag = true;
    for (int i = 0; i < n; i++) {
        if (!visited[i]) {
            flag = false;
        }
    }
    if (!flag) {
        cout << -1;
        return 0;
    }
    memset(dp, -1, sizeof dp);
    cout << solve(0, 0);
    return 0;
}


Measured memory_bytes: 32384
#include <iostream>

int sumOf2_upTo18(int sum);
int sumOf2_upTo9(int sum);

int main()
{
    int sum;
    while (std::cin >> sum) {
        int cnt = sumOf2_upTo18(sum);
        std::cout << cnt << std::endl;
    }

    return 0;
}

int sumOf2_upTo18(int sum)
{
    int cnt = 0;
    for (int k = 0; k <= 18; k++) {
        int l = sum - k;
        if (l >= 0 && l <= 18) {
            int cnt_k = sumOf2_upTo9(k);
            int cnt_l = sumOf2_upTo9(l);
            cnt += cnt_k * cnt_l;
        }
    }

    return cnt;
}

int sumOf2_upTo9(int sum)
{
    int cnt = 0;
    for (int a = 0; a <= 9; a++) {
        int b = sum - a;
        if (b >= 0 && b <= 9) {
            cnt++;
        }
    }

    return cnt;
}

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

int main(){

    string s;
    cin >> s;
    int mi=1e+4;
    for(int i=0;i<s.size()-2;i++){
        int t=atoi(s.substr(i,3).c_str());
        t=abs(753-t);
        mi=min(mi,t);
    }

    cout << mi << endl;

    return 0;
}

Measured memory_bytes: 256
import sys
from math import ceil, floor
h, w  =[int(i) for i in sys.stdin.readline().split()]
if h == 1 or w == 1:
    print(1)
else:
    print(ceil(h / 2) * ceil(w / 2) + (h - ceil(h / 2)) * (w - ceil(w / 2)))

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

int main() {
	int n;
	while (cin >> n, n) {
		int a[10]{};
		rep(i, n) {
			int t; cin >> t;
			a[t]++;
		}
		rep(i, 10) {
			if (a[i] == 0) puts("-");
			else { rep(j, a[i]) cout << '*'; cout << endl; }
		}
	}
	return 0;
}

Measured memory_bytes: 3104
#include<bits/stdc++.h>
#include<cctype>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
#define all(v) (v).begin(),(v).end()
typedef long long int ll;
#define pi 3.1415926535897932384
#define E9 1000000000
#define eps 1e-4

int main(){
  string S; cin >> S;
  rep(i,S.size()) cout << "x";
  cout << endl;
  
  return 0;
}

Measured memory_bytes: 256
//~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
//~ #pragma GCC target ("avx2")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define shandom_ruffle random_shuffle

using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;
const int nax=1000*1007;

int n;
char wcz[nax];
int tab[nax];

int main()
{
	scanf("%d", &n);
	scanf("%s", wcz);
	n--;
	int s=0;
	for (int i=0; i<=n; i++)
	{
		tab[i]=wcz[i]-'0'-1;
		if ((n&i)==i)
			s+=tab[i]+1;
	}
	if (s&1)
	{
		printf("1\n");
	}
	else
	{
		int tylko=1;
		int rozne=0;
		for (int i=0; i<=n; i++)
		{
			if (wcz[i]=='2')
				tylko=0;
			if (tab[i] && (i&n)==i)
				rozne++;
		}
		rozne&=1;
		printf("%d\n", (tylko&rozne)*2);
	}
	return 0;
}


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


int main(){
    int a,b;
    cin >>a>>b;
    int d,r;
    double f;
    d =a/b;
    r = a%b;
    f = (double)a/(double)b;
    printf("%d %d %.9lf",d,r,f);

}



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

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

int main() {
        ll N;
        vector<char> v;
        int mod;
        cin >> N;
        N--;
        while(1){
                v.insert(v.begin(),'a'+N%26);
                if(N<26) break;
                N=(N/26)-1;
        }
        rep(i,v.size()){
                cout << v.at(i);
        }
        cout << endl;
}

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

int main()
{
     string s;
     cin>>s;
    ll len=s.size();
//    cout<<len<<endl;
    if(s[len-1]=='s') {cout<<s<<"es"<<endl;}
    else cout<<s<<"s"<<endl;

     return 0;

}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    for(int i=1; i<=9;) {
        if(n%i == 0 && n/i<=9) {
            cout << "Yes";
            return 0;
        } else {
            i++;
        }
    }
    cout << "No";
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstring>
using namespace std;
int main(){
	string a;
	int len;
	cin>>a;
	len=a.length()-1;
	if(a[len]=='2'||a[len]=='4'||a[len]=='5'||a[len]=='7'||a[len]=='9'){
		cout<<"hon"<<endl;
	}else if(a[len]=='0'||a[len]=='1'||a[len]=='6'||a[len]=='8'){
		cout<<"pon"<<endl;
	}else if(a[len]=='3'){
		cout<<"bon"<<endl;
	}
	return 0;
}

Measured memory_bytes: 3592
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int n;
        cin >> n;
        if(n == 0)
            return 0;

        vector<bool> taro(2*n+1, false);
        for(int i=0; i<n; ++i){
            int a;
            cin >> a;
            taro[a] = true;
        }
        vector<bool> hanako(2*n+1, false);
        for(int i=1; i<=2*n; ++i){
            if(!taro[i])
                hanako[i] = true;
        }

        int i = 0;
        int ret1 = n;
        int ret2 = n;
        for(;;){
            while(i <= 2*n && !taro[i])
                ++ i;
            if(i <= 2*n){
                taro[i] = false;
                -- ret1;
                if(ret1 == 0)
                    break;
            }else
                i = 0;

            while(i <= 2*n && !hanako[i])
                ++ i;
            if(i <= 2*n){
                hanako[i] = false;
                -- ret2;
                if(ret2 == 0)
                    break;
            }else
                i = 0;

        }
        cout << ret2 << endl << ret1 << endl;
    }
}

Measured memory_bytes: 0
n = gets.to_i
v = gets.split.map(&:to_i)

l = v.length

x = Hash.new(0)
y = Hash.new(0)
v.each_with_index do |a, i|
  if i.even?
    x[a] += 1
  else
    y[a] += 1
  end
end

if x.length == 1 && y.length == 1
  if x == y
    puts x.values[0]
  else
    puts 0
  end
  exit
end

x_sort = x.sort{ |a, b| a[1] <=> b[1] }
y_sort = y.sort{ |a, b| a[1] <=> b[1] }

if x_sort.length == 1
  if x_sort[0][0] == y_sort[-1][0]
    puts l / 2 - y_sort[-2][1]
  else
    puts l / 2 - y_sort[-1][1]
  end
elsif y_sort.length == 1
  if y_sort[0][0] == x_sort[-1][0]
    puts l / 2 - x_sort[-2][1]
  else
    puts l / 2 - x_sort[-1][1]
  end
else
  if x_sort[-1][0] == y_sort[-1][0]
    puts [l - x_sort[-1][1] - y_sort[-2][1],  l - y_sort[-1][1] - x_sort[-2][1]].min
  else
    puts l - x_sort[-1][1] - y_sort[-1][1]
  end
end


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

#define ll long long int
#define All(a) (a).begin(),(a).end()

// Remember v.shrink_to_fit() when erasing

void solve(){
  int n;
  ll a,b,c,cnt=0;
  scanf("%d",&n);
  for(int i=1; i < n; i++){
    for(int j=1; j < n; j++){
      if(i*j>=n)break;
      cnt++;
    }
  }

  



  printf("%lld\n",cnt);
}
int main(){
  /*
  int q;
  scanf("%d",&q);
  while(--q)solve();
  */
  solve();

  return 0;
}

Measured memory_bytes: 3740
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i+100*j+50*k==x:
        ans+=1
print(ans)

Measured memory_bytes: 9188
def main():
    n, a, b = map(int, input().split())
    mod = 10**9+7

    nn = n
    ans1 = 1
    while a > 0:
        ans1 = (ans1 * n * pow(a, mod-2, mod)) % mod
        n -= 1
        a -= 1

    ans2 = 1
    n = nn
    while b > 0:
        ans2 = (ans2 * n * pow(b, mod-2, mod)) % mod
        n -= 1
        b -= 1

    print((pow(2, nn, mod)-ans1-ans2-1) % mod)


main()


Measured memory_bytes: 3064