akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < (int)n;i++)
#define repb(i,n) for(int i = (int)n;i >= 0;i--)
#define reps(i,m,n) for(int i = (int)m;i < (int)n;i++)
#define repsb(i,m,n) for(int i = (int)m;i >= (int)n;i--)
#define SORT(v,n) sort(v,v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define INF 999999999999999999
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
using namespace std;
int main(int argc, char const *argv[]) {
    int a,b,N;
    cin>>N;
    if(N==1)  {
      cout<<"Hello World"<<endl;
      return  0;
    }
    cin>>a>>b;
    cout<<a+b<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long int ll;
typedef vector<pair<ll,ll> > Q;
typedef pair<int,int> P;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
const ll inf=1e9+7;
ll gcd(ll a, ll b) { return (b ? gcd(b, a % b) : a); }
ll lcm(ll a, ll b) { return a / (gcd(a, b)) * b; }

const int MAX = 3000000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

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



int main(){
  int x,y;
  cin>>x>>y;

  if((x+y)%3==0){
    int n=(2*y-x)/3;
    int m=(2*x-y)/3;
    if(n<0 || m<0) cout<<0;
    else{
      COMinit();

      cout<<COM(n+m,n);
    }
  }
  else cout<<0;
}

Measured memory_bytes: 70528
b = [[1,2,3,4],[2,-1,4,-3],[3,-4,-1,2],[4,3,-2,-1]]
while 1:
    n = int(input())
    if n == 0:break
    for _ in range(n):
        x = tuple(map(int, input().split()))
        x1, x2 = x[:4], x[4:]
        a = [0,0,0,0]
        for i in range(4):
            for j in range(4):
                if b[i][j] > 0:a[b[i][j] - 1] += x1[i] * x2[j]
                else:a[-b[i][j] - 1] -= x1[i] * x2[j]
        print(*a)


Measured memory_bytes: 5600
#include<iostream>
using namespace std;
int main(){
  int h,w;
  cin >> h >> w;
  while(h!=0){
    int i,j;
    for(i=0;i<h;i++){
      for(j=0;j<w;j++){
	cout << "#";
      }
      cout << endl;
    }
    cout << endl;
    cin >> h >> w;
  }
  return 0;
}



Measured memory_bytes: 3084
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define SZ(x) ((int)(x).size())
#define rep(i,n) for(int i=0;i<(n);++i)
#define fore(i,a) for(auto &i:a)
#define min(...) min({__VA_ARGS__})
#define max(...) max({__VA_ARGS__})
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define ALL(x) (x).begin(),(x).end()
signed _main(); signed main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> using v = vector<T>;
template<class T> using vv = vector<v<T>>;
const int MOD=1e9+7;
const long long INF = 1LL << 60;
using P=pair<int,int>;

signed _main(){
  int N; cin >> N;
  v<int> num(N);
  int ans=0;
  rep(i,N){
    int a,b; cin >> a >> b;
    num[i]=a+b;
    ans-=b;
  }
  sort(ALL(num));
  reverse(ALL(num));
  rep(i,N){
    if(i%2==0) ans+=num[i];
  }
  cout << ans << endl;
  return 0;
}


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

using namespace std;

int main()
{
  int K, T;
  cin >> K >> T;
  vector<int> a(T);
  for (int i = 0; i < T; i++)
    cin >> a[i];
  cout << max(0, *max_element(a.begin(), a.end()) * 2 - K - 1) << endl;

  return 0;
}


Measured memory_bytes: 256
from collections import defaultdict

def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    acca = [0]
    for _a in a:
        acca.append(acca[-1] + _a)
    
    ans = 0
    cnt = defaultdict(lambda : 0)
    for i, ac in enumerate(acca):
        ans += cnt[(ac - i) % k]
        cnt[(ac - i) % k] += 1
        if i >= k - 1:
            cnt[(acca[i - k + 1] - (i - k + 1)) % k] -= 1
    print(ans)


if __name__ == '__main__':
    main()


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

int main(){
  int a,b,c,key,i;
  cin>>a>>b>>c;
  key=a%b;
  i=1;
  while(true){
    if(a*i%b==c){
      cout<<"YES";
      break;
    }
    i+=1;
    if(a*i%b==key){
      cout<<"NO"<<endl;
      break;
    }
  }
  
}

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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define repr(i,a,b) for(int i=(int)(a-1);i>=b;i--)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout << #x" = " << x << endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define INF INT_MAX/3

int main(){
    cin.sync_with_stdio(false);
    int a, b, c, ans;
    cin >> a >> b >> c;
    if (a == b) ans = c;
    else if (a == c) ans = b;
    else ans = a;
    cout << ans << endl;
    return 0;
}

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

int main(){
  int b=1000;
  string a;
  cin >> a;
  for(int i=0;i<a.size()-2;i++){
    string s;
    for(int j=i;j<i+3;j++)s.push_back(a[j]);
    int k=753-stoi(s);
    if(abs(k)<b)b=abs(k);
  }
  cout << b << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>
#include<set>

#define DIV 998244353
#define TE 2e5
using namespace std;
using ll = long long;
using ldb = long double;

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

	sort(A.begin(), A.end(), greater<ll>());
	ll cnt = 2, ans = A[0];
	if (N <= 2) cout << A[0] << endl;
	else {
		for (int i = 1; i < N; i++) {
			ans += A[i];
			cnt++;
			if (cnt >= N)break;
			ans += A[i];
			cnt++;
			if (cnt >= N)break;
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 4836
#include <algorithm>
#include <iostream>
#include <vector>
#include <numeric>
using namespace std;

template<typename T>
struct WeightedQuickFind {
    vector<int> par;
    vector<T> weight;
    vector<vector<int>> groups;
    WeightedQuickFind(int sz) : par(sz), weight(sz) {
        iota(begin(par), end(par), 0);
        for (int i = 0; i < sz; i++) groups.emplace_back(1, i);
    }
    void merge(int x, int y, T w) {
        if (par[x] == par[y]) return ;
        if (groups[par[x]].size() > groups[par[y]].size()) swap(x, y), w = -w;
        int p = par[x];
        w += weight[x] - weight[y];
        for (int i: groups[par[x]]) {
            weight[i] -= w, par[i] = par[y], groups[par[y]].emplace_back(i);
        }
        groups[p].clear();
    }
    bool is_same(int x, int y) { return par[x] == par[y]; }
    T diff(int x, int y) { return weight[y] - weight[x]; }
    void update(int x, int y, T w) {
        weight[x] += w, weight[y] += w;
        if (par[x] != par[y]) merge(x, y, w);
    }
};

int main() {
    int n, q; cin >> n >> q;
    WeightedQuickFind<int> wqf(n);
    while (q--) {
        string s; cin >> s;
        int a, b; cin >> a >> b; a--, b--;
        if (s[0] == 'I') {
            int c; cin >> c;
            wqf.update(a, b, c);
        }
        if (s[0] == 'C') {
            if (wqf.is_same(a, b)) {
                cout << wqf.diff(a, b) << endl;
            } else {
                cout << "WARNING" << endl;
            }
        }
    }
    return 0;
}



Measured memory_bytes: 9480
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
using namespace std;
using ll = long long;

int main(){
    ll b=0,c=0,d=0,e,m,n,k,o=0,p,q,x1,y1,z,max1=0,s=0,ans,r,i1=-1;
    string t,u;
    double x,w,h,y,a;
    cin>>w>>h>>x>>y;
    a=w*h/2;
    cout<<setprecision(10)<<a<<endl;
    if(x==w/2&&y==h/2)cout<<1<<endl;
    else cout<<0<<endl;
}

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

int main(){
  int N;
  cin >> N;
  
  vector<int> p(N);
  for(int i=0; i<N; i++)
    cin >> p.at(i);

  int count = 0;
  for(int i=1; i<N-1; i++){
      if ( (p.at(i-1) < p.at(i) && p.at(i) < p.at(i+1)) || (p.at(i-1) > p.at(i) && p.at(i) > p.at(i+1)) )
        count++;
  }
  
  cout << count << endl;
}

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

#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
#define uniq(x) (x).erase(unique(all(x)), end(x))
#define bit(n) (1LL << (n))
#define cdiv(a, b) (((a) - 1) / (b) + 1)
#define dump(x) cerr << #x " = " << (x) << endl
using vint = vector<int>;
using vvint = vector<vint>;
using pint = pair<int, int>;
using vpint = vector<pint>;
template<typename T> using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>;
constexpr double PI = 3.1415926535897932384626433832795028;
constexpr int DY[8] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr int DX[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b) {
    while (b) { swap(a %= b, b); }
    return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
template<typename T> void fin(T mes) {
    cout << mes << endl;
    exit(0);
}
template<typename T, typename U> bool chmax(T &a, const U &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T, typename U> bool chmin(T &a, const U &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template<typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &rhs) {
    os << "(" << rhs.first << ", " << rhs.second << ")";
    return os;
}
template<typename T> ostream &operator<<(ostream &os, const vector<T> &rhs) {
    os << "{";
    for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
        os << *itr << (next(itr) != rhs.end() ? ", " : "");
    }
    os << "}";
    return os;
}
struct setup {
    static constexpr int PREC = 20;
    setup() {
        cout << fixed << setprecision(PREC);
        cerr << fixed << setprecision(PREC);
    };
} setup;

signed main() {
    int N;
    cin >> N;
    vint A(N);
    int k = 1;
    double K = 1;
    rep(i, N) {
        cin >> A[i];
        k *= A[i], K *= A[i];
    }
    int b = 1e18;
    if (k > b || K > b) { cout << -1 << endl; }
    else { cout << k << endl; }
}

Measured memory_bytes: 3964
using System;
using System.Linq;
using System.Collections.Generic;

class Test
{
    static void Main()
    {
        const int END = -1;
        int q = int.Parse(Console.ReadLine());
        LinkedList<int> L = new LinkedList<int>();
        var node = L.AddLast(END);

        for (int i = 0; i < q; i++)
        {
            int[] array = Console.ReadLine().Split().Select(int.Parse).ToArray();
            switch (array[0])
            {
                case 0:
                    L.AddBefore(node, array[1]);
                    node = node.Previous;
                    break;
                case 1:
                    if (array[1] > 0)
                    {
                        for (int n = 0; n < array[1]; n++) node = node.Next;
                    }
                    else if (array[1] < 0)
                    {
                        for (int n = 0; n < -array[1]; n++) node = node.Previous;
                    }
                    break;
                case 2:
                    node = node.Next;
                    L.Remove(node.Previous);
                    break;
            }
        }
        L.RemoveLast();

        foreach (var x in L)
        {
            Console.WriteLine(x);
        }
    }
}



Measured memory_bytes: 42036
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i=0; i<(n); ++i)
#define REP(i, d, n) for(long long i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
int main() {//---------------------------------------------------------
 
string s; cin>>s;
  cout<<s.at(0)<<s.at(1)<<s.at(2)<<endl;
  
    
return 0; }


Measured memory_bytes: 3628
#include<stdio.h>
int main(void){
	long n,m;
	long x[200200],y[200200],z[200200];
	long i,j,h,tmp,flg;
	long max,a[200200],sum;
	scanf("%ld%ld",&n,&m);
	for(i=0;i<n;i++){
		scanf("%ld%ld%ld",&x[i],&y[i],&z[i]);
	}
	max=0;
	for(i=0;i<8;i++){
		for(j=0;j<n;j++){
			if(i&1){
				a[j]=-x[j];
			}else{
				a[j]=x[j];
			}
			if(i&2){
				a[j]-=y[j];
			}else{
				a[j]+=y[j];
			}
			if(i&4){
				a[j]-=z[j];
			}else{
				a[j]+=z[j];
			}
		}
		h=n;flg=1;
		while(h>1||flg){
			if(h>1) h=h/1.3;
			if(h==10||h==9) h=11;
			flg=0;
			for(j=0;j<n-h;j++){
				if(a[j]<a[j+h]){
					tmp=a[j];
					a[j]=a[j+h];
					a[j+h]=tmp;
					flg=1;
				}
			}
		}
		sum=0;
		for(j=0;j<m;j++){
			sum+=a[j];
		}
		if(max<sum) max=sum;
	}
	printf("%ld\n",max);
	return 0;
}


Measured memory_bytes: 1748
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


#define NUM 200005

int N;
int POW[31];
int A[NUM],B[NUM];
int table[30];


int main(){

	POW[0] = 1;
	for(int i = 1; i <= 30; i++){

		POW[i] = POW[i-1]*2;
	}

	scanf("%d",&N);

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

		scanf("%d",&A[i]);
	}

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

		scanf("%d",&B[i]);
	}

	for(int i = 0; i <= 29; i++){

		table[i] = 0;
	}

	int left,right,mid,L1,R1,L2,R2,L,R;
	int tmp;

	for(int i = 30; i >= 1; i--){ //2の何乗で余りを求めるか

		for(int k = 0; k < N; k++){
			A[k] %= POW[i];
			B[k] %= POW[i];
		}

		sort(B,B+N);

		//第i-1桁目のビット数を数える
		for(int k = 0; k < N; k++){ //Aを走査

			tmp = 0;

			L1 = POW[i-1]-A[k];
			R1 = 2*POW[i-1]-A[k];

			//2分探索で、L1 <= b[] < R1となるbの範囲を求める
			left = N;
			L = 0,R = N-1,mid = (L+R)/2;

			while(L <= R){

				if(B[mid] >= L1){

					left = mid;
					R = mid-1;

				}else{

					L = mid+1;
				}
				mid = (L+R)/2;
			}

			right = -1;
			L = 0,R = N-1,mid = (L+R)/2;

			while(L <= R){

				if(B[mid] < R1){

					right  = mid;
					L = mid+1;

				}else{

					R = mid-1;
				}
				mid = (L+R)/2;
			}

			tmp += max(0,right-left+1);

			L2 = 3*POW[i-1]-A[k];
			R2 = 4*POW[i-1]-A[k];


			//2分探索で、L2 <= b[] < R2となるbの範囲を求める
			left = N;
			L = 0,R = N-1,mid = (L+R)/2;

			while(L <= R){

				if(B[mid] >= L2){

					left = mid;
					R = mid-1;

				}else{

					L = mid+1;
				}
				mid = (L+R)/2;
			}

			right = -1;
			L = 0,R = N-1,mid = (L+R)/2;

			while(L <= R){

				if(B[mid] < R2){

					right  = mid;
					L = mid+1;

				}else{

					R = mid-1;
				}
				mid = (L+R)/2;
			}

			tmp += max(0,right-left+1);

			table[i-1] += tmp%2;
			table[i-1] %= 2;
		}
	}

	int ans = 0;

	for(int i = 0; i <= 29; i++){

		if(table[i]%2 == 1){

			ans += POW[i];
		}
	}

	printf("%d\n",ans);

	return 0;
}


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

ll solve() {
    ll N;
    cin >> N;
    vector<ll> L(N);
    for ( int i = 0; i < N; i++ ) {
        cin >> L[i];
    }
    sort(L.begin(), L.end());
    ll ans = 0;
    for ( int i = 2; i < N; i++ ) {
        for ( int j = i-1; j >= 1; j-- ) {
            int k = upper_bound(L.begin(), L.end(), L[i]-L[j]) - L.begin();
            if ( k < j ) ans += j - k;
        }
    }
    return ans;
}

int main() {
    auto ans = solve();
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 256
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println(sc.next().substring(0,1).toUpperCase() + sc.next().substring(0,1).toUpperCase() + sc.next().substring(0,1).toUpperCase());
    }
}


Measured memory_bytes: 22612
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <queue>
#include <map>
#include <stack>
#include <bitset>
#include <numeric> //lcm
#include <iomanip> //double精度 setprecision

using namespace std;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = n-1; i >= 0; --i)
#define rep1(i,n) for(int i = 1; i <= (n); ++i)
#define rrep1(i,n) for(int i = (n); i >= 1; --i)
#define all(vec) (vec).begin(),(vec).end()

#define debug(vec) for(auto v : vec) cerr << v << " "; cerr << endl;
#define debug2D(vec2D) for(auto vec : vec2D) { for (auto v : vec) cerr << v << " "; cerr << endl; } 
#define debugP(vec) for(auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl;
#define debug2DP(vec2D) for(auto vec : vec2D) { for (auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl; } 

typedef long long ll;

constexpr ll INF = 1000000000; //10^10
//const ll MOD = 998244353;
constexpr ll MOD = 1000000007;

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

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

	int n, m; cin >> n >> m;

	vector<vector<ll>> graph(n, vector<ll>());
	rep(i, m) {
	  int a, b;
		cin >> a >> b;
		a--; b--;
		graph[a].push_back(b);
		graph[b].push_back(a);
	}

	vector<int> prePos(n);
	vector<bool> done(n, false);
	queue<pair<int,int>> que;
	que.push({-1,0});
	while (!que.empty()) {
		pair<int,int> _v = que.front();
		int par = _v.first, v = _v.second;
		que.pop();

		if (done[v]) continue;
		done[v] = true;

		prePos[v] = par; 

		for (int w : graph[v]) {
		  que.push({v,w});
		}
	}

	cout << "Yes" << endl;
	rep1(i,n-1) cout << prePos[i]+1 << endl;
}

Measured memory_bytes: 14048
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N = scanner.nextInt();
    int A[] = new int[N];
    A[0] = 0;
    for(int i = 1;i < N;i++){
      A[i] = scanner.nextInt();
    }
    int B[] = new int[N];
    for(int i = 1;i < N;i++){
      B[A[i] - 1]++;
    }
    for(int i = 0;i < N;i++){
      System.out.println(B[i] +  "\n");
    }
  }
}

Measured memory_bytes: 61884
N, X, Y = map(int, input().split())
X -= 1
Y -= 1

from collections import deque, defaultdict
INF = 10**9
d = defaultdict(int)
def bfs(n):
    reached = [INF] * N
    reached[n] = 0
    q = deque()
    q.append(n)
    while q:
        x = q.popleft()
        dx = [-1, 1]
        for i in dx:
            nx = x + i
            if nx < 0 or nx > N - 1 or reached[nx] != INF:
                continue
            reached[nx] = reached[x] + 1
            q.append(nx)
        if x == X and reached[Y] == INF:
            reached[Y] = reached[x] + 1
            q.append(Y)
        if x == Y and reached[X] == INF:
            reached[X] = reached[x] + 1
            q.append(X)
    for i in range(N):
        k = reached[i]
        d[k] += 1

for i in range(N):
    bfs(i)
for i in range(1, N):
    print(d[i]//2)

Measured memory_bytes: 53468
#include "bits/stdc++.h"
using namespace std;

// 定義
typedef long long         ll;
typedef pair<ll, ll>      P;
#define ALL(x)            (x).begin(),(x).end()
#define REP(i, n)         for(ll i = 0 ; i < (ll)n ; ++i)
#define REPN(i, m, n)     for(ll i = m ; i < (ll)n ; ++i)
#define VL                vector<ll>
#define VVL               vector<vector<ll>>
#define VVVL              vector<vector<vector<ll>>>
#define VC                vector<char>
#define VVC               vector<vector<char>>
#define INF               (ll)2e9
#define INF_LL            1LL<<60
//#define MOD             998244353
#define MOD               1000000007

ll Ceil(ll val, ll div)   { return (val + div - 1) / div; }
ll CeilN(ll val, ll div)  { return Ceil(val, div) * div; }
ll FloorN(ll x, ll n)     { return (x - x % n); }
bool IsOdd(ll x)          { return ((x & 1) == 1); }
bool IsEven(ll x)         { return ((x & 1) == 0); }
template<class T> bool chmax(T& a, T b) { if (a <= b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T& a, T b) { if (a >= b) { a = b; return 1; } return 0; }

void Solve()
{
	ll N;
	cin >> N;

	ll ans = N == 0 ? 1 : 0;
	cout << ans << endl;
}

// メイン
int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Solve();
	return 0;
}


Measured memory_bytes: 3616
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <vector>

using namespace std;

bool check(char ch) { return ch == 'A' || ch == 'C' || ch == 'G' || ch == 'T'; }

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

    int count = 0;
    int max_count = 0;
    for (auto ch : s)
    {
        if (check(ch))
        {
            count++;
        }
        else
        {
            max_count = max<int>(max_count, count);
            count = 0;
        }
    }
    max_count = max<int>(max_count, count);
    cout << max_count << endl;
}


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

int main(){
  int a, b,c,d;
  cin >> a >> b >> c >> d;
  int s,t,u;
  s = a - c ;
  t = a - b;
  u = c - b;
  string ans = "No";
  if(abs(s) <= d){
    ans = "Yes";
  }
  if((abs(u) <= d) && (abs(t) <= d) ){
    ans = "Yes";
  }
  cout << ans <<endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N, D;
  cin >> N >> D;
  vector<int64_t> A(N);
  vector<int64_t> B(N);
  for (int i = 0; i < N; i++){
    cin >> A.at(i) >> B.at(i);
  }
  
  int ans = 0;
  for(int i = 0; i < N; i++){
    double d = sqrt(A.at(i) * A.at(i) + B.at(i) * B.at(i));
    if(d <= D){
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 6424
# coding: utf-8
# Your code here!
import sys
import math

m, d = map(int, input().split())
ans = 0
for i in range(d+1):
    d_10 = math.floor(i/10)
    d_1 = i-(d_10*10)
    #print(d_10, d_1)
    if d_10<2 or d_1<2:
        continue
    #print(d_1*d_10)
    if m >= d_1*d_10:
        #print(d_10,d_1)
        ans += 1

print(ans)

Measured memory_bytes: 3060
#include <stdio.h>
#include <ctype.h>
int main(void){
	char ch;
	while(1){
		scanf("%c",&ch);
		if(islower(ch)){
			printf("%c",toupper(ch));
		}
		else{
			printf("%c",tolower(ch));
		}
		if(ch == '\n'){
			break;
		}
	}
	return 0;
}		

Measured memory_bytes: 524
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define erep(i,a,b) for(int i=a;i<=(int)(b);++i)
#define per(i,a,b) for(int i=(a);i>(b);--i)
#define eper(i,a,b) for(int i=(a);i>=b;--i)
#define fore(i, x, a) for(auto &&x:a) 
#define ITR(i,b,e) for(auto i=(b);i!=(e);++i)
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define ALL(x) begin(x),end(x)
#define F first
#define S second
const int inf=1001001001;
const long long INF=1001001001001001001;
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using vii = vector<int>;
using vll = vector<ll>;
using priority_queue_small = priority_queue<int, vector<int>, greater<int> >;
template<class T>using vv = vector<T>;
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; }
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    ITR(i,begin(v),end(v))os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    ITR(i,begin(v),end(v)) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T>T gcd(T a, T b){ return b ? gcd(b, a % b) : a; }
template<class T>T lcm(T a, T b){ return a / gcd(a, b) * b; }
int dy[]={0, 1, -1, 0};
int dx[]={1, 0, 0, -1};

int n;
int main() {
 cin.tie(0);
 ios::sync_with_stdio(false);
  cin >> n;
  vii a(n), b(n), c(n);
  cin >> a;
  sort(ALL(a));
  ll ans = 0;
  if (n % 2 == 0) {
    rep(i, 0, n/2) {
      b[i*2+1] = a[i];
      b[i*2] = a[i + n/2];
    }
    rep(i, 0, n-1) ans += abs(b[i+1] - b[i]);
  } else {
    rep(i, 0, n/2) b[i*2+1] = a[i];
    b[n-1] = a[n/2];
    rep(i, 0, n/2) b[i*2] = a[i+n/2+1];
    ll sum = 0;
    rep(i, 0, n-1) sum += abs(b[i+1] - b[i]);
    chmax(ans, sum);

    sum = 0;
    c[0] = a[n/2];
    rep(i, 0, n/2) {
      c[i*2 + 2] = a[i];
      c[i*2 + 1] = a[i + n/2 + 1];
    }
    rep(i, 0, n-1) sum += abs(c[i+1] - c[i]);
    chmax(ans, sum);
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 1408
#include <stdio.h>

int main(void)
{
  int num;
  int sx, sy;
  int tx, ty;
  int i, j;
  int x, y;
  
  scanf("%d %d %d %d", &sx, &sy, &tx, &ty);
  x = tx - sx;
  y = ty - sy;
  
  for( num = 0; num < 2; num++ ){
    if( !num ){
      for( i = 0; i < y; i++ ){
        printf("U");
      }
      
      for( i = 0; i < x; i++ ){
        printf("R");
      }
      
      for( i = 0; i < y; i++ ){
        printf("D");
      }
      
      for( i = 0; i < x; i++ ){
        printf("L");
      }
      
    }
    
    else{
      printf("L");
      
      for( i = 0; i <= y; i++ ){
        printf("U");
      }
      
      for( i = 0; i <= x; i++ ){
        printf("R");
      }
      
      printf("D");
      
      printf("R");
      
      for( i = 0; i <= y; i++ ){
        printf("D");
      }
      
      for( i = 0; i <= x; i++ ){
        printf("L");
      }
      
      printf("U");
    }
  
  }
  
  puts("");
  
  return 0;
 
}       
       

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

#define loop(s, e, i) for (int i = s; i < e; ++i)
#define print(s) cout << s << endl;
using namespace std;
using ll = long long;
using lld = long long;

/*
浮動小数点の入力
cout << fixed << setprecision(9) << endl;
*/

ll gcd(ll a, ll b)
{
  if (a < b)
  {
    return gcd(b, a);
  }
  while (b != 0)
  {
    ll tmp = b;
    b = a % b;
    a = tmp;
  }
  return a;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
  ll H, W, M;
  cin >> H >> W >> M;

  vector<ll> HA(H);
  vector<ll> WA(W);
  set<pair<int, int>> MA;

  loop(0, M, i){
    ll x, y;
    cin >> y >> x;
    x--;
    y--;
    HA[y] +=1;
    WA[x] +=1;
    MA.insert(make_pair(y, x));
  }

  ll sw = *max_element(WA.begin(), WA.end());
  ll sh = *max_element(HA.begin(), HA.end());
  vector<int> wls;
  vector<int> hls;
  ll score = 0;

  loop(0, H, i) {
    if (HA[i] == sh) {
      hls.push_back(i);
    }
  }

  loop(0, W, i) {
    if (WA[i] == sw) {
      wls.push_back(i);
    }
  }

  for(auto y : hls) {
    for(auto x : wls) {
      if (MA.count(make_pair(y, x)) == 0) {
        print(sw + sh);
        return 0;
      }
    }
  }
  score = sw + sh -1;
  print(score);
}

Measured memory_bytes: 26152
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args){
		FastScanner sc = new FastScanner();
		String n = sc.next();
		n = n.substring(n.length()-1 ,n.length());
		
		switch (n) {
			case "2":
			case "4":
			case "5":
			case "7":
			case "9":
				System.out.println("hon");
				return;
			case "0":
			case "1":
			case "6":
			case "8":
				System.out.println("pon");
				return;
			default:
				System.out.println("bon");
				return;
		}
	}

}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}

Measured memory_bytes: 25228
from sys import exit
N = int(input())
A = map(int,input().split())
B = [0]*N
for i in A:
  B[i] += 1
if N%2 == 1:
  if B[0] != 1:
    print(0)
    exit()
  for i in range(1,N):
    if i%2 == 1 and B[i] != 0:
      print(0)
      exit()
    elif i%2 == 0 and B[i] != 2:
      print(0)
      exit()
else:
  for i in range(N):
    if i%2 == 1 and B[i] != 2:
      print(0)
      exit()
    elif i%2 == 0 and B[i] != 0:
      print(0)
      exit()
print(pow(2,N//2,1000000007))

Measured memory_bytes: 51312
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n = read::<usize>();
    let mut a = (0..n).map(|_| read::<i64>()).collect::<Vec<i64>>();

    let mut cnt = 0;
    let mut m = 100_100_100_0;
    for i in 0..n {
        m = std::cmp::min(m, a[i].abs());
        if a[i] < 0 {
            cnt+=1;
        }
    }

    println!("{}", a.iter().fold(0, |sum, a| sum + a.abs()) - if cnt % 2 == 0 { 0 } else { 2*m });
}

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

int main()
{
    int N, K;
    cin >> N >> K;
    vector<int> sum(N+1, 0);
    int pi;
    for(int i=0;i<N;i++){
        cin >> pi;
        sum[i+1] = sum[i] + pi;
    }
    int vmax = 0;
    for(int i=0;i<N-K+1;i++){
        auto v = sum[i+K] - sum[i];
        vmax = max(vmax, v);
    }
    cout<<fixed<<(vmax+K)/2.<<endl;

    return 0;
}

Measured memory_bytes: 1024
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define inf 20021225
#define ll long long
using namespace std;

int a,b,c;
int main()
{
	scanf("%d%d%d",&a,&b,&c);
	if(c<a+b+1)
	{
		printf("%d\n",c+b);
		return 0;
	}
	else
	{
		printf("%lld\n",(ll)b+(a+b)+1);
		return 0;
	}
	return 0;
}

Measured memory_bytes: 128
def dfs(l, r):
    if l == r:
        return 0
    if (l, r) in cache:
        return cache[(l, r)]
    cache[(l, r)] = min(dfs(l, m) + dfs(m + 1, r) + L[l][0] * L[m][1] * L[m + 1][0] * L[r][1] for m in xrange(l, r))
    return cache[(l, r)]

cache = {}
L = [map(int, raw_input().split()) for _ in xrange(input())]
print dfs(0, len(L) - 1)

Measured memory_bytes: 4492
// In the name of god
#include <bits/stdc++.h>
#pragma GCC optimize("02")
#define F first
#define S second 
#define pb push_back
#define all(x) x.begin(),x.end()
#define fileoi freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
using namespace std;
using ll = long long;
const int maxn=2e5+5,inf=1e18+18,mod=1e9+7;
ll n,m,t;
int main(){
	ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	cin>>n>>m>>t;
	if((n+t-1)/t<=m){
		cout<<"Yes";
	}
	else cout<<"No";
}


Measured memory_bytes: 3644
#include<bits/stdc++.h>
#define reg register int
#define il inline
#define fi first
#define se second
#define mk(a,b) make_pair(a,b)
#define numb (ch^'0')
#define pb push_back
#define solid const auto &
#define enter cout<<endl
#define pii pair<int,int>
using namespace std;
typedef long long ll;
template<class T>il void rd(T &x){
    char ch;x=0;bool fl=false;while(!isdigit(ch=getchar()))(ch=='-')&&(fl=true);
    for(x=numb;isdigit(ch=getchar());x=x*10+numb);(fl==true)&&(x=-x);}
template<class T>il void output(T x){if(x/10)output(x/10);putchar(x%10+'0');}
template<class T>il void ot(T x){if(x<0) putchar('-'),x=-x;output(x);putchar(' ');}
template<class T>il void prt(T a[],int st,int nd){for(reg i=st;i<=nd;++i) ot(a[i]);putchar('\n');}
namespace Modulo{
const int mod=1e9+7;
int ad(int x,int y){return (x+y)>=mod?x+y-mod:x+y;}
void inc(int &x,int y){x=ad(x,y);}
int mul(int x,int y){return (ll)x*y%mod;}
void inc2(int &x,int y){x=mul(x,y);}
int qm(int x,int y=mod-2){int ret=1;while(y){if(y&1) ret=mul(x,ret);x=mul(x,x);y>>=1;}return ret;}
}
using namespace Modulo;
namespace Miracle{
const int N=1e5+5;
int n,m;
int x[N];
struct tr{
    int a[3][3];
    tr(){memset(a,0,sizeof a);}
    void init(){
        for(reg i=0;i<3;++i) a[i][i]=1;
    }
    tr friend operator *(tr a,tr b){
        tr c;
        for(reg i=0;i<3;++i){
            for(reg k=0;k<3;++k){
                for(reg j=0;j<3;++j){
                    c.a[i][j]=ad(c.a[i][j],mul(a.a[i][k],b.a[k][j]));
                }
            }
        }
        return c;
    }
}S,A,B;
tr qm(tr A,int y){
    tr ret;ret.init();
    while(y){
        if(y&1) ret=ret*A;
        A=A*A;
        y>>=1;
    }
    return ret;
}
int main(){
    rd(n);rd(m);
    tr ans;
    S.a[0][0]=S.a[0][1]=S.a[0][2]=1;
    A.a[0][0]=A.a[0][1]=A.a[0][2]=A.a[1][1]=A.a[2][0]=A.a[2][1]=1;
    A.a[1][2]=A.a[2][2]=2;
    B=A;
    B.a[2][0]=B.a[2][1]=0;B.a[2][2]=1;
    for(reg i=1;i<=m;++i){
        rd(x[i]);
    }
    ans=S;
    for(reg i=1;i<=m;++i){
        ans=ans*qm(A,x[i]-x[i-1]-1)*B;
    }
    ans=ans*qm(A,n-1-x[m]);
    ot(ans.a[0][2]);
    return 0;
}

}
signed main(){
    Miracle::main();
    return 0;
}

/*
   Author: *Miracle*
*/

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

const int N_MAX = 1e5+10;
int S[N_MAX];
bool prime[N_MAX];

vector<int> eratosthenes(int n){
  list<int> l(1,2);
  for(int i = 3; i<=n; i+=2) l.push_back(i);
  for(auto it1 = l.begin(); *it1<=sqrt(n); ++it1){
    auto tmp = it1;
    tmp++;
    for(auto it2 = tmp, l_end = l.end(); it2 != l_end; ++it2){
      if(*it2 % *it1 == 0){
        l.erase(it2);
        --it2;
      }
    }
  }
  vector<int> v(l.size());
  int i = 0;
  for(auto it = l.begin(),l_end = l.end(); it != l_end;++it){
    v[i] = *it;
    ++i;
  }
  return v;
}

int main(void){
  SPEEDUP
  cout << setprecision(15);
  int Q;cin >> Q;
  vector<int> v = eratosthenes(N_MAX-1);
  //rep(i,v.size()) cout << v[i] << endl;
  rep(i,v.size()) prime[v[i]] = true;
  repp(x,1,N_MAX){
    S[x] += S[x-1];
    if(prime[x] && prime[(x+1)/2]) S[x] += 1;
  }
  while(Q--){
    int l,r;cin >> l >> r;
    cout << S[r] - S[l-1] << endl;
  }
  return 0;
}


Measured memory_bytes: 2816
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric> 
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
    int x;
    cin >> x;
    if(x >= 1200) cout << "ARC" << endl;
    else cout << "ABC" << endl;
	return 0;
}



Measured memory_bytes: 256
import heapq as h

N,Q=map(int,input().split())
a=[0 for i in range(0,N-1)]
b=[0 for i in range(0,N-1)]
for i in range(0,N-1):
    a[i],b[i]=map(int,input().split())
p=[0 for i in range(0,Q)]
x=[0 for i in range(0,Q)]
for i in range(0,Q):
    p[i],x[i]=map(int,input().split())
hen=[[] for i in range(0,N+1)]
for i in range(0,N-1):
    hen[a[i]].append(b[i])
    hen[b[i]].append(a[i])
subscore=[0 for i in range(0,N+1)]
for i in range(0,Q):
    subscore[p[i]]+=x[i]

ans=[0 for i in range(0,N+1)]
flag=[0 for i in range(0,N+1)]
q=[]
q.append(1)
h.heapify(q)
sub=[]
h.heapify(sub)
while q!=[]:
    while q!=[]:
        x=h.heappop(q)
        ans[x]+=subscore[x]
        flag[x]=1
        for p in hen[x]:
            if flag[p]==0:
                h.heappush(sub,p)
                ans[p]=ans[x]
        if q==[]:
            q=sub
            sub=[]
            h.heapify(sub)
            break
ans[0]=-1
ans.remove(-1)
print(*ans)


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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define MOD 1000000007
typedef long long ll;
typedef unsigned long long ull;

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

  float pi = 3.1415926535;
  cout << setprecision(12) << 2 * r * pi;
}


Measured memory_bytes: 3752
#include<stdio.h>
int main()
{
    int a,b,x;
    scanf("%d %d %d",&a,&b,&x);
    if(a>x)
    {
        printf("NO\n");
    }
    else if(a+b>x)
    {
        printf("YES\n");

    }
    else if(x>a+b)
    {
        printf("NO\n");
    }
    return 0;
}


Measured memory_bytes: 128
from itertools import accumulate
from bisect import bisect_right
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N,M,K = map(int, readline().split())
    A = [int(i) for i in readline().split()]
    B = [int(i) for i in readline().split()]

    acc_A = list(accumulate(A))
    acc_B = list(accumulate(B))

    ans = 0
    for i, a in enumerate(acc_A):
        tmp = i + 1
        rest = K - a
        if rest < 0:
            ans = max(ans, bisect_right(acc_B, K))
            break
        b_ind = bisect_right(acc_B, rest)
        tmp += b_ind

        ans = max(ans, tmp)

    for i, b in enumerate(acc_B):
        tmp = i + 1
        rest = K - b
        if rest < 0:
            ans = max(ans, bisect_right(acc_A, K))
            break
        a_ind = bisect_right(acc_A, rest)
        tmp += a_ind

        ans = max(ans, tmp)
    
    print(ans)
       


if __name__ == "__main__":
    main()


Measured memory_bytes: 47420
#include <bits/stdc++.h>
#define rep(i,a) for(int i=0;i<int(a);++i)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
using ll = long long;
using itn = int;
using namespace std;
using Graph = vector<vector<int>>;
int GCD(int a, int b){
    return b ? GCD(b, a%b) : a;
}
int main() {
	int N;
    cin>>N;
    int ans=0;
    for(int i=1; i<N+1; i++){
        string tmp=to_string(i);
        if(tmp.size()%2) ans++; 
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  string S;
  cin>>S;
  string ans;
  for(int i=0;i<S.size();++i) {
    if(S[i]=='B') {
      if(ans.size()>0) ans.pop_back();
    }
    else {
      ans.push_back(S[i]);
    }
  }
  cout<<ans<<endl;
}



Measured memory_bytes: 3560
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1 {
    class Program {

        static void Main(string[] args) {

            string line = Console.ReadLine();
            int N = int.Parse(line);


            int c = 1;
            while(N>=2){
               N/=2;
               c*=2;
            }


            Console.WriteLine(c);


//            Console.Read();

        }




    }
}



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

using namespace std;

int main() {
	int a, b, c; cin >> a >> b >> c;
	int k ; cin >> k;
	while (b <= a) {
		b *= 2;
		--k;
	}
	while (c <= b) {
		c *= 2;
		--k;
	}
	if (k >= 0) cout << "Yes";
	else cout << "No";
}

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

typedef long long ll;
const ll INF = 1010000000000000017LL;
const ll MOD = 1000000007LL;

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

//#define DEBUG(fmt, ...)
#define DEBUG(fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)

int main(){
    std::cout<<std::fixed<<std::setprecision(10);
    ll N;
    cin >> N;
    vector<ll> d(N);
    REP(i,N){ cin >> d[i]; }

    ll total = 0;
    for(int i = 0 ; i < N; i++ ){
        for( int j = i+1; j < N; j++ ){
           total += d[i] * d[j];
        }
    }

    cout << total << endl;
}


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

int main()
{
  char c[3][3];
  
  for(int i=0;i<3;i++){
	for(int j=0;j<3;j++){
      	cin >> c[i][j];
    }
  }
  
  for(int i=0;i<3;i++){
    cout <<c[i][i];
  }

      //cout << s << endl;
    
    return 0;
}






Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iterator>
#pragma warning(disable:4996)
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define MOD 1000000007
using namespace std;



int main(int argc, char* argv[])
{
    long m;
    scanf("%ld", &m);

    printf("%ld\n", 48-m);

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define pp pair<ll,ll>
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
int inf=1000001000;
ll INF=1e18;
ll mod=1000000007;
ll MOD=INF;


int main() {
  int n;
  string x;
  cin >> n >> x;
  reverse(all(x));
  ll u=0;
  rep(i,n){
      if (x[i]=='1') u++;
  }
  ll p=u+1,o=u-1;
  if (o<=0) o=inf;
  vector<int> a(n);
  ll y=0,yy=0,t=1,tt=1;
  rep(i,n){
      if (x[i]=='1'){
          y=(y+t)%p;
          yy=(yy+tt)%o;
      }
      t=(t*2)%p;
      tt=(tt*2)%o;
  }
  ll e=1,ee=1;
  rep(i,n){
      int ans=1,m;
      if (u==1){
          if (x[i]=='1'){
              a[i]=0;
              e=(e*2)%o;
              ee=(ee*2)%p;
              continue;
          }
      }
      if (x[i]=='1'){
          m=(o+yy-e)%o;
          if (o==inf || m==0){
              e=(e*2)%o;
              ee=(ee*2)%p;
              a[i]=ans;
              continue;
          }
      }
      else {
          m=(y+ee)%p;
          if (m==0){
              e=(e*2)%o;
              ee=(ee*2)%p;
              a[i]=ans;
              continue;
          }
      }
      while(true){
          int w=m,g=0;
          ans++;
          while(true){
              if (w%2==1) g++;
              w/=2;
              if (w==0) break;
          }
          if (m%g==0){
              a[i]=ans;
              break;
          }
          m=m%g;
      }
      e=(e*2)%o;
      ee=(ee*2)%p;
  }
  rep(i,n){
      cout << a[n-i-1] << endl;
  }
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define ppb pop_back
#define INF 1e18
typedef long long ll;
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;
}

using namespace std;

int main(int argc, char *argv[])
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);

    string s;
    cin >> s;
    string choice[4] = {"dream", "dreamer", "erase", "eraser"};
    reverse(s.begin(), s.end());
    for (int i = 0; i < 4; i++)
        reverse(choice[i].begin(), choice[i].end());

    bool flag = false;
    for (int i = 0; i < s.size();)
    {
        if (s.size() - i < 5)
        {
            cout << "NO";
            return 0;
        }

        flag = false;

        for (int j = 0; j < 4; j++)
        {
            if (s.substr(i, choice[j].size()) == choice[j])
            {
                i += choice[j].size();
                flag = true;
            }
        }
        if (!flag)
        {
            cout << "NO";
            return 0;
        }
    }

    cout << "YES";
    return 0;
}

Measured memory_bytes: 512
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define REP(var, a, b) for (int var = (a); var < (b); var++)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()
#define rALL(c) (c).rbegin(), (c).rend()
ll MOD = 1000000007;
ll INF = 1000000000;

int main() {
  //
  ll a, b, c, k;
  cin >> a >> b >> c >> k;
  ll x = a - b;
  if (k & 1) {
    cout << -x << endl;
  } else {
    cout << x << endl;
  }
  return 0;
}


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

#define Solved int main()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define forn(i, n) for(int i = 1; i <= n; i++)
#define rep(i, x, y) for(int i = x; i <= y; i++)
#define sz(x) (int)x.size()
#define pii pair<int, int>
#define ll long long
#define ull unsigned long long
#define ld long double
#define mii map<int, int>
#define all(x) x.begin(), x.end()
using namespace std;

inline ll bip(ll x,ll n,ll mod){ll res=1;while(n){if(n&1){res=(res*x)%mod;}x=(x*x)%mod;n>>=1;}return res;}

const int maxn = 1e9;
const ll inf = 1e18;
const int mod = 998244353;
//const int mod = 1e9 + 7;
const int N = 1e5 + 10;

int n, k;
ll a[N];
ll dp[N];

void solve() {
    cin >> n >> k;

    for (int i = 1; i <= n; i++)
        cin >> a[i];

    dp[2] = abs(a[2] - a[1]);
    for (int i = 3; i <= n; i++) {
        dp[i] = inf;
        for (int j = 1; j <= k; j++) {
            if (i > j) dp[i] = min(dp[i], dp[i - j] + abs(a[i] - a[i - j]));
        }
    }
    cout << dp[n];
}

Solved {
    SpeedForce;
	int tt = 1;
    //cin >> tt;
	while (tt--) {
		solve();
		cout << '\n';
	}

}


Measured memory_bytes: 1792