akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
typedef long long int ll;
typedef unsigned long long int sll;
typedef  double ld;
#define A 1000000007ll
#define D 1000000000ll
#define B 998244353ll
#define C 1000000000000000000ll
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define oset tree<pair<ll,ll>, null_type,less<pair<ll,ll>>, rb_tree_tag,tree_order_statistics_node_update> 
#define pb push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define br break
#define PI 3.14159265358979323
#define subt cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n"

int main() 
{
    FAST;
    ll k,n;
    cin>>k>>n;
    ll a[n];
    ll ans=0;
    for(int i=0;i<n;i++)
        cin>>a[i];
    for(int i=1;i<n;i++)
        ans=max(ans,a[i]-a[i-1]);
    ans=max(k-a[n-1]+a[0],ans);
    cout<<k-ans;
    subt;   
    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <complex>

using namespace std;

typedef complex<double> Point;
#define rep(i, n) for(int i=0; i<(n); ++i)
const double eps = 1e-8;

template<typename T> inline T sqr(T x){return x * x;}
template<typename T> inline void chmax(T& t, T f){if(t < f)t = f;}

struct Circle : Point {
    double r;
    int c;
    Circle(const Point &a, double r, int c):Point(a), r(r), c(c){}
};

int overlap(Circle &c1, Circle &c2){
    if(sqr(c1.r + c2.r) < norm(c1 - c2))return 0;
    if(abs(c1 - c2) + c1.r < c2.r + eps)return -1;
    if(c2.r < c1.r && abs(c1 - c2) + c2.r < c1.r + eps)return 1;
    if(abs(abs(c1 - c2) - c1.r - c2.r) < eps)return -2;
    return 2;
}

int n;
vector<Circle> disc;
vector<bool> vis;

void dfs(vector<int>& indeg, int table, int& maxi){
    if(vis[table])return; else vis[table] = true;
    chmax(maxi, n - __builtin_popcount(table));
    rep(i, n){
        if(!(table >> i & 1) || indeg[i])continue;
        for(int j=i+1; j<n; ++j){
            if(!(table >> j & 1) || indeg[j] || disc[i].c != disc[j].c)continue;
            vector<int> nxt(indeg);
            rep(k, n)nxt[k] &= ~(1 << i | 1 << j);
            dfs(nxt, table ^ 1 << i ^ 1 << j, maxi);
        }
    }
}

int solve(){
    vector<int> indeg(n, 0);
    rep(i, n)rep(j, i){
        int chk = overlap(disc[i], disc[j]);
        if(chk == 0 || chk == -2)continue;
        rep(k, j)if(indeg[i] >> k & 1 && indeg[j] >> k & 1)indeg[i] ^= 1 << k;
        indeg[i] |= 1 << j;
    }
    vis.assign(1<<n, false);
    int res = 0;
    dfs(indeg, (1 << n) - 1, res);
    return res;
}

int main(){
    while(cin >> n, n){
        disc.clear();
        rep(i, n){
            int x, y, r, c;
            cin >> x >> y >> r >> c;
            disc.emplace_back(Point(x, y), r, c);
        }
        cout << solve() << '\n';
    }
    return 0;
}

Measured memory_bytes: 3112
#include <bits/stdc++.h>
#define whlie while
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define rep(i,N) for(int i = 0; i < (N); i++)
#define repr(i,N) for(auto i = (N) - 1; i >= 0; i -= 1)
#define each(x,v) for(auto& x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define vrep(v,it) for(auto it = v.begin(); it != v.end(); it++)
#define vrepr(v,it) for(auto it = v.rbegin(); it != v.rend(); it++)
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) ll __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define rand mtrand
#ifdef NyaanDebug
  #include "NyaanDebug.h"
  #define trc(...) do { cout << #__VA_ARGS__ << " = "; dbg_out(__VA_ARGS__);} while(0)
  #define trca(v,...) do { cout << #v << " = "; array_out(v , ##__VA_ARGS__);cout << endl;} while(0)
#else
  #define trc(...)
  #define trca(...)
#endif
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector< vector<int> >;
constexpr int inf = 1001001001;
constexpr ll infLL = 0x1FFFFFFFFFFFFFFFLL;
struct IoSetupNya {IoSetupNya() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(15);} } iosetupnya;
template<typename T, typename U> inline bool amin(T &x, U y) { return (y < x) ? (x = y, true) : false; }
template<typename T, typename U> inline bool amax(T &x, U y) { return (x < y) ? (x = y, true) : false; }
template<typename T, typename U> ostream& operator <<(ostream& os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<typename T, typename U> istream& operator >>(istream& is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator <<(ostream& os, const vector<T> &v) { int s = (int)v.size(); rep(i,s) os << (i ? " " : "") << v[i]; return os; }
template<typename T> istream& operator >>(istream& is, vector<T> &v) { for(auto &x : v) is >> x; return is; }
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
template<typename T>void die(T x){out(x); exit(0);}

random_device seed_gen; mt19937_64 mtrand(seed_gen());
constexpr int MOD = 1000000007;
//////////////////////////////////////////

int main(){
  map<ll,ll> m;
  ini(N);
  ll a = 0; m[a]++;
  rep(i,N){
    inl(b); a+=b;
    m[a]++;
  }
  ll ans = 0;
  each(x , m){
    trc(x.fi , x.se);
    ans += (x.se) * (x.se - 1) / 2;
  }
  out(ans);
}

Measured memory_bytes: 12800
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <map>
using namespace std;
char r[1000000];
int main(){
	int n,k;
	cin>>n>>k;
	cin>>r;
	int xf=0,j2=0;
	for(int i=1;i<n;i++){
		if(r[i]==r[i-1]){
			xf++;
		}
	}
	xf=min(n-1,xf+2*k);
	cout<<xf<<endl;
	return 0;
}

Measured memory_bytes: 632
import java.io.{InputStream, OutputStream, PrintStream}
import java.util.Scanner

object Main {

  def main(args: Array[String]): Unit = {
    val solver = new Solver(System.in, System.out)
    solver.solve()
  }

  class Solver(in: InputStream, out: OutputStream) {
    lazy val input = new Scanner(in)

    lazy val output = new PrintStream(out)

    def solve(): Unit = {
      val n = input.nextLine().toInt
      val rs = Iterator.continually(input.nextLine().toInt).take(n)

      var min = Integer.MAX_VALUE
      var max = Integer.MIN_VALUE
      var maxDiff = Integer.MIN_VALUE
      rs.foreach { r =>
        val diff = r - min
        if (diff > maxDiff){
          maxDiff = diff
        }

        if (r < min) {
          min = r
        }
      }

      output.println(maxDiff)
    }

  }

}



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

#define FOR(i,N) for(int i=0;i<N;i++)
#define ROF(i,N) for(int i=N-1;i>=0;i--)
#define ROF1(i,a,b) for(int i=(b);i>=(a);i--)
#define FOR1(i,a,b) for(int i=(a);i<=(b);i++)
#define FORi(i,a,b,c) for(int i=(a);i<=(b);i+=(c))

#define read freopen("IN.txt","r",stdin)
#define write freopen("OT.txt","w",stdout)
#define fastread {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define mem(a,b)          memset(a,b,sizeof(a))
#define EPS 1e-9
#define PI              acos(-1.0)
#define INF             2e16

#define ll              long long
#define ull             unsigned long long
#define ft              first
#define sd              second
#define bn              begin
#define en              end
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define pll             pair<LL,LL>
#define all(x) x.begin(), x.end()


#define dbg(args...) {cerr<<"-->";debugger::call(#args,args);cerr<<"\n";}
struct debugger {
    static void call(const char* it) {}
    template<typename T, typename ... aT>
    static void call(const char* it, T a, aT... rest) {
        string b;
        for (; *it&&*it != ','; ++it) if (*it != ' ')b += *it;
        cerr << b << "=" << a << " ";
        call(++it, rest...);
    }
};

int main()
{
#ifdef SunWalker
    //read;
   //write;
#endif

     int n,ar[100010],lst=0;
     cin>>n;
     FOR(i,n){cin>>ar[i];if(ar[i]<lst)ar[i]++;if(ar[i]<lst){cout<<"No\n";return 0;}lst=ar[i];}
     cout<<"Yes\n";


return 0;
}



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

bool LinearSearch(int x, int S[], int N){
  S[N] = x;
  for(int i=0; ; i++){
    if(S[i]==x)
      if(i<N)
       return true;
      else
       return false;
  }
}

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

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

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

  sort(S, S+n);
  int cnt=0;
  for(int i=0; i<n; i++){
   if(S[i]!=S[i+1]){
    if(LinearSearch(S[i], T, q)==true){
      cnt++;
    }
   }
  }
      cout << cnt << endl;
  return 0;
}



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

using namespace std;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "Yes" : "No") << endl;
typedef long long ll;

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
  cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5 + 1;

int main()
{
  int N;
  scanf("%d", &N);
  vector< double > t(N);
  vector< double > v(N);
  REP(i, N) {
    scanf("%lf", &t[i]);
  }
  REP(i, N) {
    scanf("%lf", &v[i]);
  }

  // 全体のT秒を求める
  int T = 0;
  REP(i, N) {
    T += t[i];
  }
  
  vector< double > maxV(2 * T + 1, (double)INF);

  // maxのスピードをv[i]で初期化
  int nowT = 0;
  REP(i, N) {
    REP(ti, t[i]) {
      int t1 = nowT + ti * 2;
      int t2 = nowT + ti * 2 + 1;
      maxV[t1] = min(maxV[t1], v[i]);
      maxV[t2] = min(maxV[t2], v[i]);
    }
    nowT += t[i] * 2;
    maxV[nowT] = min(maxV[nowT], v[i]);
  }

  // 0秒とT秒は0(静止)
  maxV[0] = maxV[T * 2] = 0.0;
  
  // 前から比較
  REP(ti, 2 * T + 1) {
    maxV[ti + 1] = min(maxV[ti + 1], maxV[ti] + 0.5);
  } 
  
  // 後ろから比較
  RREP(ti, 2 * T + 1) {
    maxV[ti] = min(maxV[ti], maxV[ti + 1] + 0.5);
  }
  
  double ans = 0.0;
  REP(i, 2 * T + 1) {
    // (上底 + 下底) * 高さ / 2
    ans += (maxV[i] + maxV[i + 1]) * 0.5 / 2.0;
  }

  printf("%.4f\n", ans);

  return 0;
}



Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;

int main(void) {
	ll n; 
	cin >> n;
	
	vector<ll> x(5);
	for(int i = 0; i < 5; ++i) {
		cin >> x[i];
	}
	
	ll r = *min_element(x.begin(), x.end());
	ll ans = n / r;
	
	if( n % r != 0 ) ans++;
	
	ans += 4LL;
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 256
n=int(input())
inp=input().split()
ok=True
for k in range(n):
  a=int(inp[k])
  if a%2==0:
    if (a%3!=0) and (a%5!=0):
      print('DENIED')
      ok=False
      break
if ok==True:
  print('APPROVED')
  

Measured memory_bytes: 3060
function main()
  
  S = collect(chomp(readline()))
  
  check_A = false
  check_C = false
  count = 0
  
  if S[1] == 'A'
    check_A = true
  end
  
  for i in 3:length(S)-1
    if S[i] == 'C'
      check_C = true
      break
    end
  end
  
  for i in 1:length(S)
    if S[i] <= 'Z'
      count += 1
    end
  end
  
  if check_A && check_C && count == 2
    println("AC")
  else
    println("WA")
  end
  
end

main()

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

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

    double ans;
    ans = v[0];
    for(int i=1; i<n; i++){
        ans = (ans+v[i])/2;
    }

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

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

using namespace std;

typedef pair<int, int> ii;

int main() {
  ios::sync_with_stdio(false); cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n), l(n, -1), l1(n, -1), r(n, n), r1(n, n);
  for (int i = 0; i < n; i++) cin >> a[i];
  stack<int> s;
  priority_queue<ii, vector<ii>, greater<ii> > pq;
  for (int i = 0; i < n; i++) {
    while (!pq.empty() && a[i] > pq.top().first) {
      r1[pq.top().second] = i;
      pq.pop();
    }
    while (!s.empty() && a[i] > a[s.top()]) {
      r[s.top()] = i;
      pq.emplace(a[s.top()], s.top());
      s.pop();
    }
    s.push(i);
  }
  while (!s.empty()) s.pop();
  while (!pq.empty()) pq.pop();
  for (int i = n - 1; i >= 0; i--) {
    while (!pq.empty() && a[i] > pq.top().first) {
      l1[pq.top().second] = i;
      pq.pop();
    }
    while (!s.empty() && a[i] > a[s.top()]) {
      l[s.top()] = i;
      pq.emplace(a[s.top()], s.top());
      s.pop();
    }
    s.push(i);
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    if (l[i] != -1) ans += a[i] * 1LL * (l[i] - l1[i]) * (r[i] - i);
    if (r[i] != n) ans += a[i] * 1LL * (r1[i] - r[i]) * (i - l[i]);
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 2560
// minpro2019_B
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator>  // std::back_inserter()
#include <tuple>  // std::tuple std::get
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>  // std::copy()
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <bitset>  // static_cast<std::bitset<8>>
#include <sstream>  // std::stringstream
#include <cmath>
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
#include <iomanip>  // std::setprecision()
using namespace std;

#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1
#define REPN(i, n) for (int i=1; i <= (int)(n); i++)  // 1 ~ n
#define MIN(vec) min_element(ALL((vec)))  // イテレータのため、値を取り出すときは * を先頭につける
#define MAX(vec) max_element(ALL((vec)))
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define SUM(vec) accumulate(ALL((vec)), 0)  // 0 は初期値
#define COPY(vec1, vec2) copy(ALL(vec1), back_inserter(vec2))  // vec1をvec2にコピーする vec2は空にしておく必要あり
typedef long long ll;

const int MOD = 1000000007;  // 1 000 000 007


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

    // input
    vector<pair<int , int> > vec(3);
    REP(i, 3) cin >> vec[i].first >> vec[i].second;
    
    // calculation
    vector<int> road(4, 0);
    REP(i, 3) {
        road[vec[i].first-1]++;
        road[vec[i].second-1]++;
    }
    int one = 0, two = 0;
    REP(i, 4) {
        if (road[i] == 1) {
            one++;
        } else if (road[i] == 2) {
            two++;
        }
    }
    if (one == 2 && two == 2) {
        cout << "YES" << "\n";
    } else {
        cout << "NO" << "\n";
    }
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y);
#define chmin(x,y) x = min(x,y);
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};
const int INF = 1001001001;

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};
istream& operator>>(istream&i,mint&a){i>>a.x;return i;}
ostream& operator<<(ostream&o,const mint&a){o<<a.x;return o;}

int main() {
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];
    mint ans;
    rep(i,60) {
        ll x = 0;
        rep(j,n) if (a[j]>>i&1) x++;
        mint now = x*(n-x);
        now *= mint(2).pow(i);
        ans += now;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5560
#include<stdio.h>
#include<string.h>
main(){
  char a[1000];
  int i;
  scanf("%s",a);
  for(i=0;a[i]!=NULL;i++){
    if(a[i]=='A'||a[i]=='B'||a[i]=='C'){
      a[i]=a[i]+23;
    }
    else{
      a[i]=a[i]-3;
    }
  }
  printf("%s\n",a);
  return 0;
}

Measured memory_bytes: 520
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL long long

using namespace std;

int main(void)
{
    int n;
    while(scanf("%d",&n)==1)
    {
        if(n < 1200)
            printf("ABC\n");
        else
            printf("ARC\n");
    }
    return 0;
}


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

using namespace std;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    long long a, b;
    cin >> a >> b;
    if(a*b <= 0) {
        cout << "Zero\n";
    } else {
        if((a > 0 && b > 0)) cout << "Positive\n";
        else {
            if((a-b+1)%2) cout << "Negative\n";
            else cout << "Positive\n";
        }
    }
    return 0;
}


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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define forn(i, a, n) for (int i = (int)(a); i < (int)(n); ++i)
#define ford(i, a, n) for (int i = (int)(n - 1); i >= (int)(a); --i)
#define fore(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define all(a) (a).begin(), (a).end()
#define fs first
#define sn second
#define trace(a)\
    for (auto i : a) cerr << i << ' ';\
    cerr << '\n'
#define eb emplace_back

#ifndef M_PI
const ld M_PI = acos(-1.0);
#endif

template<typename T>
inline void setmax(T& a, T b) {
    if (a < b) a = b;
}

template<typename T>
inline void setmin(T& a, T b) {
    if (a > b) a = b;
}

const ld eps = 1e-9;
const int INF = 2000000000;
const ll LINF = 1ll * INF * INF;
const ll MOD = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, p;
    cin >> n >> p;
    int o = 0, e = 0;
    forn(i, 0, n) {
        int x;
        cin >> x;
        if (x % 2) ++o;
        else ++e;
    }
    ll ans = 1ll << e;
    if (o) ans *= (1ll << (o - 1));
    else {
        if (p == 1) ans = 0;
    }
    cout << ans << '\n';
}


Measured memory_bytes: 256
s = input()
ans = "AKIHABARA"
if s.count("K")*s.count("I")*s.count("H")*s.count("B")*s.count("R") != 1:
    print("NO")
    exit()
now = 0
for i in s:
    while now < len(ans) and ans[now] != i:
        now += 1
    now += 1
if 8 <= now <= 9:
    print("YES")
else:
    print("NO")


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

int main() {
    int64_t a, b, c, ans=0;
    cin >> a >> b;
    for(int i=1; i<=min(a,b); i++) {
        if(a%i==0 && b%i==0) c=i;
    }
    ans =a*b/c;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;

void solve() {
  int n, a, b;
  cin >> n >> a >> b;
  int maxRet = min(a, b);
  int minRet = 0;
  while(a + b + minRet > n) {
    a--;
    b--;
    minRet++;
  }
  cout << maxRet << " " << minRet << endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
  /*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
  */
}


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

#define llint long long int
#define P 998244353

using namespace std;

class bit{
    private:
        vector<int> values;
        int length;
    
    public:
        bit(int length){
            values = vector<int>(length + 1, 0);
            this -> length = length;
        }
        void add(int index, int value){
            for(int i = index; i <= length; i += i & -i){
                values[i] += value;
            }
        }
        int sum(int n){
            int ret = 0;

            for(int i = n; i > 0; i -= i & -i){
                ret += values[i];
            }
            return ret;
        }
};

llint mod_pow(llint a, llint n, llint p){
    if (n == 0) {
        return 1;
    } else if (n % 2 == 0) {
        llint d = mod_pow(a, n / 2, p);

        return (d * d) % p;
    } else {
        return (a * mod_pow(a, n - 1, p)) % p;
    }
}
int main(){
    int N;

    cin >> N;

    vector<pair<int, int>> xy(N);

    for(int i = 0; i < N; i ++){
        int x, y;

        cin >> x >> y;

        xy[i] = make_pair(x, y);
    }
    sort(xy.begin(), xy.end());

    vector<pair<int, int>> yi(N);

    for(int i = 0; i < N; i ++){
        yi[i] = make_pair(xy[i].second, i + 1);
    }
    sort(yi.begin(), yi.end(), greater<pair<int, int>>());

    vector<llint> A(N), B(N), C(N), D(N);
    bit b(N), c(N);

    for(int i = 0; i < N; i ++){
        b.add(yi[i].second, 1);
        
        A[i] = mod_pow(2, b.sum(N) - b.sum(yi[i].second), P);
        B[i] = mod_pow(2, b.sum(yi[i].second) - 1, P);
    }
    for(int i = N - 1; i >= 0; i --){
        c.add(yi[i].second, 1);

        C[i] = mod_pow(2, c.sum(yi[i].second) - 1, P);
        D[i] = mod_pow(2, c.sum(N) - c.sum(yi[i].second), P);
    }
    llint ans = 0;

    for(int i = 0; i < N; i ++){
        llint temp;

        temp = A[i];
        temp = (temp * B[i]) % P;
        temp = (temp * C[i]) % P;
        temp = (temp * D[i]) % P;
        ans = (ans + temp) % P;

        temp = A[i] - 1;
        temp = (temp * (B[i] - 1)) % P;
        temp = (temp * (C[i] - 1)) % P;
        temp = (temp * (D[i] - 1)) % P;
        ans = (ans + temp) % P;

        temp = A[i] - 1;
        temp = (temp * (C[i] - 1)) % P;
        temp = (temp * (B[i] + D[i] - 1)) % P;
        ans = (ans + temp) % P;

        temp = B[i] - 1;
        temp = (temp * (D[i] - 1)) % P;
        temp = (temp * (A[i] + C[i] - 1)) % P;
        ans = (ans + temp) % P;
    }
    cout << ans << endl;
}

Measured memory_bytes: 13184
#include<stdio.h>
#include<stdlib.h>

#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

void run(void){
  int n;
  scanf("%d",&n);
  int *h=(int *)calloc(n,sizeof(int));
  int i;
  for(i=0;i<n;i++) scanf("%d",h+i);
  int *dp=(int *)calloc(n,sizeof(int));
  dp[1]=ABS(h[1]-h[0]);
  for(i=2;i<n;i++){
    dp[i]=MIN(ABS(dp[i-1]+ABS(h[i]-h[i-1])),dp[i-2]+ABS(h[i]-h[i-2]));
  }
  printf("%d\n",dp[n-1]);
}

int main(void){
  run();
  return 0;
}


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

int main() {
  int n,i;
  cin>>n;
  long long int ans=1;
  long long int p=pow(10,9) +7;
  for(i=1;i<=n;i++)
    ans=(ans*i)  % p;
  cout<<ans;
}

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

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); i > (b); i--)
#define ALL(a) (a).begin(), (a).end()

int main() {
    string A, B, C;
    cin >> A >> B >> C;
    if (A[A.size() - 1] == B[0] && B[B.size() - 1] == C[0]) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;
typedef tuple<ll, ll, ll> T;

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin>>n;
    ll sum=0,ans=0;
    map<ll,ll> mp;
    mp[0]=1;
    REP(i,n){
        int a;cin>>a;
        sum += a;
        ans += mp[sum];
        mp[sum]++;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 12800
#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
  cin>>N;
  vector<int64_t>A(N);
  for(int i=0;i<N;i++)
    cin>>A.at(i);
  if(A.at(0)!=0)
    cout<<-1<<endl;
  else{
  bool x=true;
    for(int i=1;i<N;i++){
    if(2<=A.at(i)-A.at(i-1)){
      x=false; break;
    }
      }if(!x)
      cout<<-1<<endl;
    else{
     A.push_back(0);
      int64_t ans=0;
      int64_t sum=0;
      for(int i=1;i<=N;i++){
      if(A.at(i)-A.at(i-1)==1)
        sum++;
        else{ans+=sum; sum=A.at(i);}
      } cout<<ans<<endl;
    
    }
  
 }
   return 0;
}

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

// int/long:		-2,147,483,648 - 2,147,483,647 (-2^31 <= int < 2^31)
// long/long long:	-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

// lower_bound(A.begin(), A.end(), N)
// upper_bound(...

// A.erase(unique(A.begin(), A.end()), A.end())

// bit: &/and, |/or, ^/xor, ~/not

// getline(cin, String)
// while (getline(cin, S)) {}

// #include <cstdio>
// int a;
// scanf("%d", &a);
// printf("%d\n", a);
//
// for (int i=0; i<n; ++i)
// 	scanf("%d", &a[i]);
//
// char c;
// scanf(" %c", &c);
//
// cout << "\n";

// cout <<fixed <<setprecision(10)

// priority_queue<int> q;
// priority_queue<int, vector<int>, less<int>> q; // Default: vector, less
// priority_queue<vector<int>, vector<vector<int>>, greater<vector<int>>> q;

// Graph
// Warshall-Floyd: Distance between each node, N^3
// Dijkstra: Distance from the start node, N^2
// DFS(Depth-First Search)

//
// Notes
//
// When specified less than N, try full scan.
// RE: empty vector
// Check Qs
// long/int
// xor -> count each bit
// Check values
// 	1,000,000 -> Loop
// 	100,000	-> vector(int:400KB, long:800KB) 

#define	INF (1<<30)
//1,073,741,824
//= 536,870,912 *2

#define	MOD 1000000007

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

#define	Rep0(i, n)	for (int i=0; i<n; i++)
#define	Rep1(i, n)	for (int i=1; i<=n; i++)
#define Sort(P)	sort(P.begin(), P.end())
#define Rev(P)	reverse(P.begin(), P.end())

int	main() {
	string S;
	cin >>S;
	int N=S.size();
	bool F=true;
	int NN=(N-1)/2;
	Rep0(i, NN)
		if (S.at(i)!=S.at(N-1-i))
			F=false;
	int NNN=NN/2;
	Rep0(i, NNN)
		if (S.at(i)!=S.at(NN-1-i))
			F=false;
	if (F)
		cout <<"Yes" <<endl;
	else
		cout <<"No" <<endl;
	return 0;
}



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

int main(){
    int N,K;
    cin >> N >> K;
    vector<int> P(N);
    for(int i=0; i<N; i++){
        cin >> P.at(i);
    }
    sort(P.begin(), P.end());
    int ans = 0;
    for(int i=0; i<K; i++){
        ans += P.at(i);
    }
    cout << ans << endl;
}


Measured memory_bytes: 3624
import Data.List
import Data.Char

main::IO ()
main = do
    [a,b,t] <- map read . words <$> getLine
    let line = zip [a,a*2..] [b,b*2..]
    let ans = snd $ head $ dropWhile (\(x,y) -> x<=t) line 
    print (ans-b)

Measured memory_bytes: 508
#include <iostream>
#include <sstream>
#include <cstring>

using namespace std;

int main()
{
	int a, b;
	
	while (cin >> a >> b){
		int sum = a + b;
		stringstream ss;
		ss << sum;
		cout << ss.str().size() << endl;
	}
	return (0);
}

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

/* メモリ食い過ぎ注意 */
#define int long long

typedef long long ll;

/* define const */
const ll INF = (1ll << 60);
const ll MOD = (ll)1e9 + 7;
/* end defineing */

signed main()
{
    int n;
    ll a[100000];
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> a[i];
    sort(a, a + n);

    ll cnt = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] % 2 == 0)
        {
            int tmp = 0;
            int ttp = a[i];
            while (ttp % 2 == 0)
            {
                ttp /= 2;
                tmp++;
            }
            cnt += tmp;
        }
    }
    cout << cnt << endl;
}


Measured memory_bytes: 384
#include <stdio.h>
#include <ctype.h>

int main(){
    char ch;
    int i;
    int num[26]={};
    
    while(scanf("%c",&ch)!=EOF){
        if (isupper(ch)){
            ch=tolower(ch);
        }
        num[ch-'a']++;
            }
    for (i=0; i<26; i++) {
        printf("%c : %d\n",i+'a',num[i]);
    }
    return(0);
    
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)
#define REPi(i, a, b) for(int i=int(a); i<int(b); i++)
#define MEMS(a,b) memset(a,b,sizeof(a))
#define mp make_pair
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll MOD = 1e9+7;

ll A, B, K;

void print(){
    printf("%lld %lld\n", A, B);
}

int main(){
    cin >> A >> B >> K;

    if(K >= A){
        K -= A;
        A = 0;
    }
    else{
        A -= K;
        print();
        return 0;
    }

    if(K >= B){
        K -= B;
        B = 0;
    }
    else{
        B -= K;
        print();
        return 0;
    }

    print();

    return 0;
}


Measured memory_bytes: 256
#include <iostream>

 

using namespace std;

 

int main()
{
    int w, h, x, y, r;
    cin >> w >> h >> x >> y >> r;
    
    if (x-r >= 0 && y-r >= 0 && w >= x+r  && h >= y+r )
       cout << "Yes" << endl;
    else
       cout << "No" << endl;
    
}


Measured memory_bytes: 3116
n = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"  # x番目がほしいときにchars[x-1]としたくないので、chars[0]は使わないことにします

n_rem = n  # 入力を直接操作すると、もし後々必要になったときに面倒なので
res = ""

while True:
    x = n_rem % 26
    # 余りが0、つまりzの場合は、26にします
    if x == 0:
        x = 26
    res += chars[x]

    # xを引いて、26で割ります
    n_rem -= x

    # 0なら終了します
    if n_rem == 0:
        break

    n_rem //= 26

# 0桁目が先頭で、最後の桁が末尾になっているので、反転させます
print(res[::-1])


Measured memory_bytes: 61888
Sa=input()+'A'
Sb=input()+'B'
Sc=input()+'C'
a=0
b=0
c=0
def f(tmp):
  if tmp=='a':
    global a
    out=Sa[a]
    a+=1
  elif tmp=='b':
    global b
    out=Sb[b]
    b+=1
  else:
    global c
    out=Sc[c]
    c+=1
  return out

tmp='a'
while tmp.isupper()==False:
  tmp=f(tmp)
print(tmp)

Measured memory_bytes: 3064
//**KEEP IT SHORT AND SIMPLE**
#include <bits/stdc++.h>
#define IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define FILES freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define REP(i,a,b) for (int i = a; i < b; i++)
#define NL '\n'
#define F first
#define S second
#define dot(a, b) (conj(a) * (b)).real()
#define cross(a, b) (conj(a)* (b)).imag()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef bool bl;
typedef vector < vector<long long> > vvl;
typedef vector <long long> vll;
typedef pair <long long, long long> pll;
typedef map <long long, long long> mll;
typedef map <long long, bool> mlb;
typedef priority_queue<long long, vector<long long>, greater<long long> > minPq;
typedef tuple<ll, ll, ll> line;
typedef complex<double> point;
const double pi = 2 * acos(0.0);
const int OO = 0x3f3f3f3f;
ll n, arr[100010], dp[100010][5];
ll solve(ll i, bl x)
{
    if(i == n)      return 0;
    if(~dp[i][x])   return dp[i][x];
    ll elem = arr[i] * (x ? -1 : 1);
    ll ans = solve(i + 1, 0) + elem;
    if(i < n - 1)   ans = max(ans, solve(i + 1, 1) + elem * -1);
    return dp[i][x] = ans;
}
int main()
{
    IO
    cin >> n;
    REP(i, 0, n)
        cin >> arr[i];
    memset(dp, -1, sizeof dp);
    cout << solve(0, 0);
    return 0;
}


Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T> >;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define repb(i, n) for(ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for(ll i = (a); i < (b); i++)
#define reprb(i, a, b) for(ll i = (a)-1; i >= (b); i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
const ll MOD = 1000000007;
const ll INF = 100000000000000000LL;
inline ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; }
inline ll LCM(ll a, ll b){ return a/GCD(a, b)*b; }
inline ll powint(unsigned long long x, ll y){ ll r=1; while(y){ if(y&1) r*=x; x*=x; y>>=1; } return r; }
inline ll powmod(ll x, ll y, ll m = MOD){ ll r=1; while(y){ if(y&1) r*=x; x*=x; r%=m; x%=m; y>>=1; } return r; }
template<class T>bool chmax(T &a, const T &b){ if(a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a) { a=b; return 1; } return 0; }
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif

void pr(bool f){
    cout << (f ? "Fennec" : "Snuke") << endl;
    exit(0);
}

const ll MAX_V = 100010;
vvll g(MAX_V, vll());
vi visited(MAX_V, 0);
vll path;
ll n;

ll dfs(ll node, ll depth){
    visited[node] = 1;
    if(node == n){
        path.emplace_back(n);
        return 1;
    }
    ll ret = 0;
    rep(i, SZ(g[node])){
        if(!visited[g[node][i]]){
            if(dfs(g[node][i], depth+1)){
                ret = 1;
            }
        }
    }
    if(ret) path.emplace_back(node);
    return ret;
}
void dfs2(ll node){
    visited[node] = 1;
    rep(i, SZ(g[node])){
        if(!visited[g[node][i]]){
            dfs2(g[node][i]);
        }
    }
}

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    cin >> n;
    vll a(n-1), b(n-1);
    rep(i, n-1){
        cin >> a[i] >> b[i];
        g[a[i]].emplace_back(b[i]);
        g[b[i]].emplace_back(a[i]);
    }
    dfs(1, 0);
    reverse(ALL(path));
    ll x = path[(SZ(path)-1)/2], y = path[(SZ(path)+1)/2];
    g[x].erase(find(ALL(g[x]), y));
    g[y].erase(find(ALL(g[y]), x));
    fill(ALL(visited), 0);
    dfs2(1);
    ll cnt = count(ALL(visited), 1);
    dump(cnt);
    pr(cnt > n - cnt);
    return 0;
}

Measured memory_bytes: 13560
#include<iostream>
#include<string>
using namespace std;
int main(){
  int hit=0;
  int ining=0;
  int ining2=0;
  int out=0;
  int team[100]={0};
  int a=0;
  string ivent;
  cin>> ining;
  ining2=ining;
  while(ining){
    cin>> ivent;
    if(ivent=="OUT"){
      out++;
    }
    else if(ivent=="HIT"){
      hit++;
    }
    else{
      team[a]+=hit+1;
      hit=0;
    }
    if(hit>3){
      team[a]++;
      hit--;
    }
    if(out>=3){
      out=0;
      hit=0;
      ining--;
      a++;
    }
  }
  for(int i=0;i<ining2;i++){
  cout<< team[i]<< endl;
  }
}

Measured memory_bytes: 1204
#include <iostream>
#include <functional>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <map>
#include <iomanip>
#include <complex>
#include <random>
#include <bitset>
#include <list>
#include <assert.h>
// #include <prettyprint.hpp>
using namespace std;
#define repi(i,n) for(int i=0;i<n;++i)
#define rep(i,n) for(ll i=0;i<n;++i)
#define repinvi(i,n) for(int i=n-1;i>=0;--i)
#define sll(n) scanf("%lld", &n);
#define sii(n) scanf("%d", &n);
#define slf(n) scanf("%lf", &n);
#define pll pair<ll,ll>
#define pii pair<int,int>
#define psi pair<si,si>
typedef long long ll;
typedef double lf;
typedef short int si;


void Main(){
    ll H, A;
    cin >> H >> A;
    ll num = 0;
    ll s = 0;
    while(s<H){
        s += A;
        ++ num;
    }
    cout << num <<endl;

}

int main(){
    Main();
}

Measured memory_bytes: 3104
/*
    User ID: qcw
       Time: 2017-10-14 03:45:12
*/
#include<bits/stdc++.h>
using namespace std;
using ll=long long;

int N,M,A[301][301],u[301],ans{301};
int main(){
    cin.tie(0),ios_base::sync_with_stdio(0);
    cin>>N>>M;
    for(int i{1};i<=N;++i)
        for(int j{1};j<=M;++j)
            cin>>A[i][j];
    for(int i{1};i<=M;++i){
        int a[301]{};
        for(int j{1};j<=N;++j)
            for(int k{1};k<=M;++k)
                if(!u[A[j][k]]){
                    ++a[A[j][k]];
                    break;
                }
        int m{},n{};
        for(int j{1};j<=M;++j)
            if(a[j]&&m<a[j])
                m=a[j],n=j;
        ans=min(ans,m);
        u[n]=1;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 640
s = int(input())
lst = [s]

for i in range(10**6):
    if int(lst[-1]) & 1 == 0:
        next_a = lst[-1]/2
        if next_a in lst:
            m = i + 1
            break
        lst.append(next_a)
    else:
        next_aa = 3*lst[-1] +1
        if next_aa in lst:
            m = i + 1
            break
        lst.append(next_aa)

print(m+1)

Measured memory_bytes: 9140
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#define rep(i,n) for (int i = 0; i < n; ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int A, B;
  cin >> A >> B;
  if ((A+B)%2 == 0) cout << (A+B)/2 << endl;
  else cout << "IMPOSSIBLE" << endl;
  return 0;
}

Measured memory_bytes: 3196
import sys,math,collections
from collections import defaultdict

#from itertools import permutations,combinations
    
def file():
    sys.stdin = open('input.py', 'r')
    sys.stdout = open('output.py', 'w') 
def get_array():
    l=list(map(int, input().split()))
    return l
def get_ints():   
    return map(int, input().split())
    #return a,b
def get_3_ints():   
    a,b,c=map(int, input().split())
    return a,b,c    
def sod(n):
    n,c=str(n),0
    for i in n: 
        c+=int(i)
    return c    
def isPrime(n):
    if (n <= 1):
        return False
    if (n <= 3):
        return True
    if (n % 2 == 0 or n % 3 == 0):
        return False
    i = 5
    while(i * i <= n):
        if (n % i == 0 or n % (i + 2) == 0):
            return False
        i = i + 6
  
    return True
def getFloor(A, x):

    (left, right) = (0, len(A) - 1)

    floor = -1
    while left <= right:
        mid = (left + right) // 2
        if A[mid] == x:
            return A[mid]
        elif x < A[mid]:
            right = mid - 1
        else:
            floor = A[mid]
            left = mid + 1
            
    return floor
def chk(aa,bb):
	f=0
	for i in aa:
		for j in bb:
			if(j[0]>=i[0] and j[1]<=i[1]):
				f+=1
			elif(j[0]<=i[0] and j[1]>=i[1]):	
				f+=1
			elif(i[0]==j[1] or i[1]==j[0]):
				f+=1
			else:
				continue
	return f			

#file()
def main():
	n=int(input())
	c=0
	for i in range(1,n+1):
		t=n/i
		#print(t,int(t))
		if(t==int(t)):
			c+=(int(t)-1)
		else:
			c+=int(t)
	print(c)			

		




				





		


	





        
            
        























    

    
    

        











        
        

        























































                

            







            
            
































        








if __name__ == '__main__':
    main()

Measured memory_bytes: 9492
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;

public class Program
{

    public void Proc() {
        int pointCount = int.Parse(Reader.ReadLine());
        for (int i = 0; i < pointCount; i++) {
            int[] inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a) - 1).Skip(2).ToArray();
            Path.Add(i, new List<int>());
            Path[i].AddRange(inpt);
        }

        Nullable<int>[] ans = new Nullable<int>[pointCount];
        ans[0] = 0;
        Queue<int> q = new Queue<int>();
        q.Enqueue(0);
        while(q.Count > 0) {
            int pos = q.Dequeue();

            if(!Path.ContainsKey(pos)) {
                continue;
            }
            int nextStep = ans[pos].Value + 1;
            foreach(int nextPos in Path[pos]) {
                if(ans[nextPos] == null || ans[nextPos] > nextStep) {
                    ans[nextPos] = nextStep;
                    q.Enqueue(nextPos);
                }
            }
        }
        for (int i = 0; i < pointCount; i++) {
            if(ans[i] == null) {
                Console.WriteLine((i+1) + " " + -1);
            } else {
                Console.WriteLine((i + 1) + " " + ans[i].Value);
            }
        }
    }
    private Dictionary<int, List<int>> Path = new Dictionary<int, List<int>>();


    public class Reader
    {
        private static StringReader sr;
        public static bool IsDebug = false;
        public static string ReadLine() {
            if(IsDebug) {
                if(sr == null) {
                    sr = new StringReader(InputText.Trim());
                }
                return sr.ReadLine();
            } else {
                return Console.ReadLine();
            }
        }
        private static string InputText = @"


4
1 2 2 4
2 1 4
3 0
4 1 3

";
    }

    public static void Main(string[] args)
    {
#if DEBUG
        Reader.IsDebug = true;
#endif
        Program prg = new Program();
        prg.Proc();
	}
}

Measured memory_bytes: 11136
#設定
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)

#ライブラリインポート
from collections import defaultdict

#入力受け取り
def getlist():
	return list(map(int, input().split()))

class Graph(object):
	def __init__(self):
		self.graph = defaultdict(list)

	def __len__(self):
		return len(self.graph)

	def add_edge(self, a, b):
		self.graph[a].append(b)

	def get_nodes(self):
		return self.graph.keys()

#val = 0

def DFS(G, anstenna, edge_num, have, visit, node):
	cnt = 0
	for i in G.graph[node]:
		if visit[i] != "Yes":
			visit[i] = "Yes"
			DFS(G, anstenna, edge_num, have, visit, i)
			if have[i] == 1:
				cnt += 1
				anstenna[node] += anstenna[i]

	if cnt < edge_num[node] - 1:
		anstenna[node] += edge_num[node] - 1 - cnt
	if anstenna[node] >= 1:
		have[node] = 1

#処理内容
def main():
	N = int(input())
	G = Graph()
	for i in range(N - 1):
		a, b = getlist()
		G.add_edge(a, b)
		G.add_edge(b, a)

	if N == 2:
		print(1)
		return

	#DFS
	anstenna = [0] * (N + 1)
	have = [0] * (N + 1)
	edge_num = [len(G.graph[i]) - 1 for i in range(N + 1)]

	if max(edge_num) <= 1:
		print(1)
		return

	visit = ["No"] * (N + 1)
	visit[N] = "Yes"
	s = None
	for i in range(N):
		if edge_num[i] >= 1:
			s = i
			break
	G.add_edge(N, s)
	G.add_edge(s, N)
	edge_num[s] += 1

	DFS(G, anstenna, edge_num, have, visit, N)
	ans = anstenna[N]
	if edge_num[s] == 2:
		cnt = 0
		for i in G.graph[s]:
			if have[i] == 1:
				cnt += 1
		if cnt <= 2:
			ans += 1

	print(ans)

if __name__ == '__main__':
	main()

Measured memory_bytes: 88616
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = 998244353ll;

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

ll dp[3333][3333];
int a[3333];

int main(void){
	int n,s,i,j;
	ll ans = 0ll;
	cin >> n >> s;
	for(i=0; i<n; ++i){
		cin >> a[i];
	}
	dp[0][a[0]] = 1ll;
	if(a[0]==s){
		add_mod(ans,n);
	}
	for(i=1; i<n; ++i){
		for(j=0; j<=s; ++j){
			add_mod(dp[i][j],dp[i-1][j]);
			if(j+a[i]<=s){
				add_mod(dp[i][j+a[i]],dp[i-1][j]);
			}
			if(j+a[i]==s){
				add_mod(ans,dp[i-1][j]*(n-i)%MOD);
			}
		}
		add_mod(dp[i][a[i]],i+1);
		if(a[i]==s){
			add_mod(ans,(i+1)*(n-i)%MOD);
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 80128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(ll i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	
	ll n, q;
	cin >> n >> q;
	ll a[n], x[q];
	zep(i, 0, n){cin >> a[i];}
	zep(i, 0, q){cin >> x[i];}
	
	ll r = 0;
	zep(i, n/2, n){
		r += a[i];
	}
	
	map<ll, ll> mp;
	mp[0] = r;
	if(n%2 == 0){
		rep(i, 1, n/2-1){
			r -= a[n/2+i-1];
			r += a[2*i-1];
			ll mid = (a[n/2+i-1]+a[2*i-1])/2+1;
			mp[-mid] = r;
		}
	}
	else{
		rep(i, 1, n/2){
			r -= a[n/2+i-1];
			r += a[2*i-2];
			ll mid = (a[n/2+i-1]+a[2*i-2])/2+1;
			mp[-mid] = r;
		}
	}
	
	zep(i, 0, q){
		print((*mp.lower_bound(-x[i])).second)
	}
	
	/*for(auto it = mp.begin(); it != mp.end(); it++){
		cout << (*it).first << " " << (*it).second << endl;
	}*/
	return 0;
}

Measured memory_bytes: 6400
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <vector>

using namespace std;
typedef long long ll;

int main()
{
	int H, W, K;
	scanf("%d %d %d", &H, &W, &K);
	int B[10][1000];
	for(int i = 0; i < H; i++){
		char s[2000];
		scanf("%s", s);
		for(int j = 0; j < W; j++){
			B[i][j] = s[j] - 48;
		}
	}
	
	int finalAns = 100000;
	
	for(int bit = 0; bit < (1<<(H-1)); bit++){
		int HDiv[10];
		for(int i = 0; i < 10; i++){
			HDiv[i] = 0;
		}
		int count = 0;
		HDiv[0] = 1;
		for(int h = 0; h < H-1; h++){
			if(bit & (1 << h)){
				count++;
				HDiv[count]++;
			}else{
				HDiv[count]++;
			}
		}
		
		// printf("%d %d %d\n", HDiv[0], HDiv[1], HDiv[2]);
		
		int WCount[10];
		for(int i = 0; i < 10; i++){
			WCount[i] = 0;
		}
		
		int ans = 0;
		
		int now = 0;
		for(int w = 0; w < W; w++){
			int max = 0;
			int counter = 0;
			for(int h = 0; h < H; h++){
				if(B[h][w] == 1){
					WCount[now] ++;
					max = max < WCount[now] ? WCount[now] : max;
				}
				counter++;
				if(counter == HDiv[now]){
					now ++;
					counter = 0;
				}
			}
			
			if(max > K){
				// printf("%d max\n", max);
				ans++;
				w--;
				for(int i = 0; i < 10; i++){
					WCount[i] = 0;
				}
			}
			
			now = 0;
			counter = 0;
			
			if(ans > 10000){
				break;
			}
		}
		
		if(ans > 10000){
			continue;
		}
		else{
			// printf("%d\n", ans);
			for(int i = 0; i < H-1; i++){
				if(bit & (1 << i)){
					ans++;
				}
			}
		}
		// printf("%d\n", ans);
		if(ans < finalAns){
			finalAns = ans;
		}
	}
	printf("%d\n", finalAns);
	
	return 0;
}

Measured memory_bytes: 256