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

#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,b,a) for(int i = (b) - 1; i >= (a); i--)
#define ITER(it, a) for(typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a, value) memset(a, value, sizeof(a))

#define SZ(a) (int) a.size()
#define ALL(a) a.begin(),a.end()
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const LL INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL)INF;

const int MOD = 1000 * 1000 * 1000 + 7;
const int MAX = 200200;

struct Fen
{
	int A[MAX];
	int n;

	void init(int n)
	{
		this->n = n;
		FILL(A, 0);
	}

	void add(int x, int val)
	{
		for (; x < n; x = x | (x+1))
		{
			A[x] += val;
			if (A[x] >= MOD) A[x] -= MOD;
		}
	}

	int get(int x)
	{
		int res = 0;
		for (; x >= 0; x = (x & (x+1)) - 1)
		{
			res += A[x];
			if (res >= MOD) res -= MOD;
		}
		return res;
	}

	int get(int l, int r)
	{
		int res = get(r) - get(l-1);
		if (res >= MOD) res -= MOD;
		if (res < 0) res += MOD;
		return res;
	}
} F;

struct T
{
	int x;
	int v;
	int ind;

	T(int x, int v, int ind)
	{
		this->x = x;
		this->v = v;
		this->ind = ind;
	}

	T(){}
} A[MAX];

int P[MAX];
int Q[MAX];

PII B[MAX];

bool cmpX(const T& a, const T& b)
{
	return a.x < b.x;
}

bool cmpV(const T& a, const T& b)
{
	return a.v < b.v;
}

bool cmp(const PII& a, const PII& b)
{
	if (a.second != b.second) return a.second < b.second;
	return a.first < b.first;
}

int main()
{
	//freopen("in.txt", "r", stdin);
	//ios::sync_with_stdio(false); cin.tie(0);

	int n;
	scanf("%d", &n);
	FOR (i, 0, n)
	{
		int x, v;
		scanf("%d%d", &x, &v);
		A[i] = T(x, v, -1);
	}

	sort(A, A+n, cmpX);

	FOR (i, 0, n)
	{
		A[i].ind = i;
	}

	sort(A, A+n, cmpV);

	FOR (i, 0, n)
	{
		P[i] = A[i].ind;
		Q[P[i]] = i;
	}


	int mn = INF;

	RFOR (i, n, 0)
	{
		int pos = Q[i];
		mn = min(mn, pos);
		B[i].first = mn;
	}

	int mx = -INF;
	FOR(i, 0, n)
	{
		int pos = Q[i];
		mx = max(mx, pos);
		B[i].second = mx;
	}

/*	FOR (i, 0, n)
	{
		cout<<B[i].first<<' '<<B[i].second<<endl;
	}
	cout<<endl;*/

	F.init(n);
	FOR (i, 0, n)
	{
		int sum = F.get(B[i].first - 1, B[i].second);
		if (B[i].first == 0) sum++;
		if (sum >= MOD) sum -= MOD;
		F.add(B[i].second, sum);
	}

	int res = F.get(n-1, n-1);
	printf("%d\n", res);



}


Measured memory_bytes: 6528
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
#define EPS (1e-5)
#define bit(n,k) ((n>>k)&1)
const ll Mod = 1000000007;
const ll mod = 998244353;
struct H {
	ll x, y;
	bool operator<(const H &b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H &b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H &b) const { return x == b.x&&y == b.y; }
	bool operator!=(const H &b) const { return (*this) != b; }
};
struct P {
	ll pos, cost;
	bool operator<(const P &b) const { return cost < b.cost; }
	bool operator>(const P &b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E &b) const { return cost < b.cost; }
	bool operator>(const E &b) const { return cost > b.cost; }
};
template<typename T, typename U>
void chmin(T &a, U b) {
	if (a > b) a = b;
}
template<typename T, typename U>
void chmax(T &a, U b) {
	if (a < b) a = b;
}
template<typename T>
T max_0(T a) {
	if (a < 0) return 0;
	return a;
}
template<typename T>
T min_0(T a) {
	if (a > 0) return 0;
	return a;
}
ll read() {
	ll u;
	ll k = scanf("%lld", &u);
	return u;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j%i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
vector<string>split(string s, char c = ' ') {
	vector<string>vec;
	string h = "";
	for (int i = 0; i < s.size();) {
		int j = i;
		while (j < s.size() && s[j] != ' ') {
			h += s[j++];
		}
		if (h.size() > 0) vec.push_back(h);
		h = "";
		i = j + 1;
	}
	return vec;
}
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
int n;
string s;
int dp[3200][3200];
/*
必要な情報は今何番目の文字を見ているか、最後の文字よりも大きい文字が何個残っているか
ここから今何個最後の文字よりも小さい文字が残っているかを特定できる
*/
signed main() {
	cin >> n >> s;
	for (int i = 0; i < n; i++) dp[1][i] = 1;
	for (int i = 1; i < n; i++) {
		int b[3010] = {};
		if (s[i - 1] == '<') {
			for (int j = 0; j < n - i + 1; j++) {
				b[0] += dp[i][j]; b[j] -= dp[i][j];
				b[0] %= Mod; b[j] %= Mod;
			}
		}
		else {
			for (int j = 0; j < n - i + 1; j++) {
				b[j] += dp[i][j]; b[n - i + 1] -= dp[i][j];
				b[j] %= Mod; b[n - i + 1] %= Mod;
			}
		}
		dp[i + 1][0] = b[0];
		for (int j = 1; j < n - i + 1; j++) {
			dp[i + 1][j] = (dp[i + 1][j - 1] + b[j]) % Mod;
		}
	}
	cout << (dp[n][0] + Mod) % Mod << endl;
}

Measured memory_bytes: 76032
#include<cstdio>
#include<iostream>
#include<vector> 
#include<algorithm>
#define mk make_pair
#define pk push_back 
using namespace std;
typedef long long LL;
typedef pair<int,int> pi;
const int mod=1e9+7;
int n,f[2005],g[2005];
int main(){
	ios::sync_with_stdio(false);
	cin>>n;
	int ans=0;
	f[0]=1;
	for(int i=1;i<=n;++i){
		memcpy(g,f,sizeof f);
		for(int j=3;j<=n;++j) if(i>=j) (f[i]+=g[i-j])%=mod;
	}
	cout<<f[n]<<endl;
	return 0;
}

Measured memory_bytes: 3188
// inputに入力データ全体が入る
    function Main(inputString: string) {
        // 1行目がinput[0], 2行目がinput[1], …に入る
        const arrInputString = inputString.trim().split(" ");
    	//文字列から10進数に変換するときはparseIntを使います
    	const SHORT_LENGTH = parseInt(arrInputString[0], 10);
    	const LONG_LENGTH = parseInt(arrInputString[1], 10);
    	const NOW_HOUR = parseInt(arrInputString[2], 10);
		const NOW_MINUTES = parseInt(arrInputString[3], 10);
		
		// 長針の角度
		const LONG_RADIAN = NOW_MINUTES / 60 * 2 * Math.PI

		// 短針の角度
		const SHORT_RADIAN = (NOW_HOUR + NOW_MINUTES / 60) / 12 * 2 * Math.PI

		// 長針の座標
		const LONG_COORDINATE_X = LONG_LENGTH * Math.cos(LONG_RADIAN)
		const LONG_COORDINATE_Y = LONG_LENGTH * Math.sin(LONG_RADIAN)
		const SHORT_COORDINATE_X = SHORT_LENGTH * Math.cos(SHORT_RADIAN)
		const SHORT_COORDINATE_Y = SHORT_LENGTH * Math.sin(SHORT_RADIAN)
		let dx = LONG_COORDINATE_X - SHORT_COORDINATE_X
		let dy = LONG_COORDINATE_Y - SHORT_COORDINATE_Y
		let resultLength = Math.sqrt(dx * dx + dy * dy)
    	//出力
    	console.log('%d', resultLength);
    }
    //*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
	Main(require("fs").readFileSync("/dev/stdin", "utf8"));
	// Main("3 4 9 0")

Measured memory_bytes: 29848
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <ctype.h>
#include <vector>
using namespace std;

#define ll long long int
#define rep(i, a, n) for (int i = a; i < n; i++)
#define INF 1e9
#define LINF 1e17
#define MOD (int)(1e9 + 7)
#define pi 3.141592653589
#define pii pair<int, int>
#define vi vector<int>
#define sort_v(a) sort(a.begin(), a.end())

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

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

    if (n % k == 0)
        cout << 0 << endl;
    else
        cout << 1 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
   string a;
   cin>>a;
    if(a[0]==a[2])
   {
       cout<<"Yes";
   }
   else if(a[0]==a[1]==a[2])
   {
       cout<<"Yes";
   }
   else

   {
       cout<<"No";
   }




    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
#define Mid ((l+r)/2)
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define drep(i,a,b) for(int i=(a);i>=(b);--i)
#define file(a) freopen(#a".in","r",stdin),freopen(#a".out","w",stdout);
const int maxn=2e5+5,mod=1e9+7,inf=0x3f3f3f3f;
int n,m,Q,K,T;
int read(){
    int x=0,f=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    return x*f;
}int a[maxn];
int dsum[maxn];

signed main(){
    //file(a);
    n=read();
    rep(i,1,n)a[i]=read();
    dsum[n]=a[n];
    drep(i,n-1,1)dsum[i]=(dsum[i+1]+a[i])%mod;
    int ans=0;
    rep(i,1,n-1){
        ans=(ans+1ll*a[i]*dsum[i+1]%mod)%mod;
    }printf("%lld\n",ans);


    return 0;
}


Measured memory_bytes: 6860
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define INF LLONG_MAX - 100
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
#define lowb lower_bound
#define upb upper_bound
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> pque;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
int month[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
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;};



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

	int a, b;
	cin >> a >> b;
	string s = "", t = "";
	rep(i, a) s += to_string(b);
	rep(i, b) t += to_string(a);
	cout << min(s, t) << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][][] house = new int[4][3][10];
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            house[b - 1][f - 1][r - 1] += v;
        }

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.printf(" %d", house[i][j][k]);
                }
                System.out.println();
            }
            if (i <= 2) {
                System.out.println("####################");
            }
        }
        sc.close();
    }
}


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

//using namespace boost::multiprecision;
using namespace std;
typedef long long ll;
//typedef unsigned long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define sz(x) ll(x.size())
typedef pair<int, int> P;
//typedef pair<ll, int> P;
//typedef pair<ll, ll> P;
//const double INF = 1e10;
//const ll INF = LONG_LONG_MAX / 100;
//const ll INF = (1ll << 31) - 1;
//const ll INF = 1e15;
const ll MINF = LONG_LONG_MIN;
//const int INF = INT_MAX / 10;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
//typedef pair<int, int> P;
//typedef pair<double, double> P;

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

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

struct Insert {
    ll number, count;
};

int main() {
    ll n, k;
    cin >> n >> k;

    vector<Insert> numbers(n);
    rep(i, n) cin >> numbers[i].number >> numbers[i].count;

    sort(numbers.begin(), numbers.end(), [](Insert i, Insert j) {
        return i.number < j.number;
    });

    ll sum = 0;
    for (Insert i : numbers) {
        sum += i.count;
        if (sum >= k) {
            cout << i.number << endl;
            return 0;
        }
    }

}



Measured memory_bytes: 1792
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <utility>
#include <memory>
#include <functional>
#include <deque>
#include <cctype>
#include <ctime>
#include <numeric>
#include <list>
#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


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

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll;
typedef vector<vector<long long> > vvll;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _rep(i,n) _rep2((i),0,(n))
#define _rep2(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) GET_MACRO(__VA_ARGS__, _rep2, _rep)(__VA_ARGS__)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define fi first
#define se second
#define mkp make_pair
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

void mainmain(){
	int a,b;
	cin>>a>>b;
	if(a+b==15){
		cout<<"+"<<endl;
	}
	else if(a*b==15){
		cout<<"*"<<endl;
	}
	else{
		cout<<"x"<<endl;
	}
}


signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(20);
    mainmain();
}

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

signed main(){
  int N,H;
  cin>>N>>H;
  std::vector<int> a(N),b(N);
  for(int i=0;i<N;i++)cin>>a[i]>>b[i];
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  int i;
  int out=0;
  for(i=0;i<N&&out==0;i++){
    if(b[N-i-1]<a[N-1])break;
    H-=b[N-i-1];
    if(H<=0)out++;
  }
  if(out)cout<<i<<endl;
  else cout<<i+(H-1)/a[N-1]+1<<endl;
}


Measured memory_bytes: 1024
#include<stdio.h>

int main (void)
{
        int n, a;

        scanf("%d", &n);
        a=n/100;
        if(n<a*111) printf("%d\n", a*111);
        else if (n>a*111) printf("%d\n", (a+1)*111);
        else if(n==a*111) printf("%d\n", a*111);
        return 0;
}

Measured memory_bytes: 128
var input = require('fs').readFileSync('/dev/stdin', 'utf8').trim();
var n = +input;

process.stdout.write(n + ': ');

var primes = [];

while (n % 2 == 0) {
    primes.push(2);
    n /= 2;
}
while (n % 3 == 0) {
    primes.push(3);
    n /= 3;
}
for (var i = 1; n > 1; i++) {
    var low = i * 6 - 1;
    var high = i * 6 + 1;
    while (n % low == 0) {
        primes.push(low);
        n /= low;
    }
    while (n % high == 0) {
        primes.push(high);
        n /= high;
    }
}

console.log(primes.join(' '));

Measured memory_bytes: 8444
#include<iostream>

using namespace std;

int N;
int a[100002],L[100002],R[100002],GCD_L_AND_R[100001];
int answer = 1;

int gcd(int a,int b)
{

    if (a < b) swap(a,b);
    if (b == 0) return a;
    else return gcd(a%b , b);

}

void enter()
{
    cin >> N;
    for (int i = 1 ; i <= N ; i++)
        cin >> a[i];
}

void solve()
{

    for (int i = 1; i <= N; i ++)
    {
        L[i] = gcd(L[i-1],a[i-1]);
        R[N - i + 1] = gcd(R[N-i+2],a[N-i+2]);
    }
    for (int i = 1 ; i <= N ; i++)
    {
        GCD_L_AND_R[i] = gcd(L[i],R[i]);
        answer = max(answer,GCD_L_AND_R[i]);
    }
}

void printresult()
{
    cout << answer;
}

int main()
{
    enter();
    solve();
    printresult();
    return 0;
}


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

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 
using vs = vector<string>;
using vvs = vector<vs>; 
using vc = vector<char>;
using vvc = vector<vc>; 
using vb = vector<bool>;
using vvb = vector<vb>; 

#define rep(i,n) ;for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define f(i,a,b) for(int i=a;i<b;i++)
#define pri(a)  printf("%.14lf\n",a);
#define sz(a) ((int)a.size())
#define MOD 1000000007
bool is_int_lround(double x){
  return std::lround(x)==x;
}
ll keta(ll x){
  ll n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}

ll conbi(int n,int m){
  
  cin>>n>>m;
  vector<ll> a(100);
  a[0] =1;
  for(int i=0;i<14;i++){
    a[i+1]=a[i]*(i+1);
  }
  return a[n] /(a[m] *a[n-m]);
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;//繰り返し二乗法
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
ll kaijoMOD(ll x){
  ll z=1;
  if(x==0){
    return 1;
  }
  while(x>0){
    z *=x;
    z %=MOD;
    x--;
  }
  return z;
}
ll yakusu_num(ll n){
  vl yakusu(n+1,1);
  for(ll i=2;i*i<=n;i++){ 
    while(n%i==0){
      n /=i;
      yakusu[i]++;
    }
  }
  if(n!=1)yakusu[n]++;
  ll num=1;
  for(ll i=0;i<=n;i++){
    num*=yakusu[i];
  }
  return num;
}

int H,W;
vs s(50);
vi dv ={-1,0,1,0};vi du={0,-1,0,1};
int cnt=1;
int dfs(int u,int v){
  s[u][v]='.';
  
  rep(i,4){
   
      int nu =u +du[i],nv=v+dv[i];
      if(nu<0||nu>=H||nv<0||nv>=W)continue;
      if(s[nu][nv]=='.')continue;
      cnt ++;
      dfs(nu,nv);
    
  }
  return cnt;

}
int keta_wa(int x){
  int tot=0;
  while(x>0){
    tot +=x%10;
    x/=10;
  }
  return tot;
}

//vc alp ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
//vc Alp ={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
//cout<<""<<endl;
int main(){
  int a,b,c;cin>>a>>b>>c;
  set<int> s;
  s.insert(a);
  s.insert(b);
  s.insert(c);
  cout<<s.size()<<endl;
}





Measured memory_bytes: 256
#include<stdio.h>
#define MAX 500000
int n;
void maxHeapify(int *A,int i){
	int l,r;
	int largest;
	int change;
	l = i*2;
	r = i*2+1;
	if(l<=n &&A[l] > A[i]) largest = l;
	else largest = i;
	if(r<=n && A[r] > A[largest]) largest = r;
	if(largest != i){
		change = A[i];
		A[i] = A[largest];
		A[largest] = change;
		maxHeapify(A,largest);
	}
}

void buildMaxHeap(int *A){
	int i;
	for(i=n/2;i>0;i--) maxHeapify(A,i);
}

int main(){
	int i;
	int H[MAX];
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",&H[i]);
	}
	buildMaxHeap(H);
	for(i=1;i<=n;i++){
 printf(" %d",H[i]);	
	}
	printf("\n");
	return 0;
}


Measured memory_bytes: 3644
#include<iostream>
using namespace std;
int main(){
	int n,a[100];
	cin>>n;
	for(int i = 0; i < n; i++){
		cin>>a[i];
	}
	for(int i = n-1; i >= 0; i--){
		if(i == 0){
			cout<<a[i];
		}
		if(i != 0){
			cout<<a[i]<<" ";
		}
	}
	cout<<endl;
	return 0;
}

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

int main(){
  int n,m;
  cin >> n >> m;
  cin.ignore();
  int spread[n][m];
  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      cin >> spread[i][j];
    }
    cin.ignore();
  }
  int sumh[n]; //sum of horizontal
  int sumv[m]; //sum of vertical
  int suma = 0; //sum of all
  for(int i=0;i<n;i++){
    sumh[i] = 0;
  }
  for(int j=0;j<m;j++){
    sumv[j] = 0;
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      sumh[i] += spread[i][j];
      sumv[j] += spread[i][j];
      suma += spread[i][j];
    }
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      cout << spread[i][j] << " ";
      
    }
    cout << sumh[i] << endl;
  }
  for(int j=0;j<m;j++){
    cout << sumv[j] << " ";
  }
  cout << suma << endl;
  return 0;
}     



Measured memory_bytes: 3112
#include<bits/stdc++.h>
#include<cctype>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
#define reps(i,n) for (int i=1;i<=(n);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rreps(i,n) for (int i=(n);i>0;i--)
#define all(v) (v).begin(),(v).end()
#define pi 3.1415926535897932384
#define E9 1000000000
#define eps 1e-4
#define pii pair<int,int>
template<class T> inline bool chmin(T &a, T b) {if (a>b) {a = b; return 1;} return 0;};
template<class T> inline bool chmax(T &a, T b) {if (a<b) {a = b; return 1;} return 0;};
typedef long long int ll;
const long long INF = 1LL << 60;

ll N;

void dfs(ll n, int check, int &cnt){
  if (n>N) return;
  if (check==0b111) cnt++;

  dfs(10*n+7, check|0b001, cnt);
  dfs(10*n+5, check|0b010, cnt);
  dfs(10*n+3, check|0b100, cnt);
}

int main(){
  cin >> N;
  int cnt = 0;

  dfs(0,0,cnt);
  cout << cnt << endl;



  // cout << fixed << setprecision(10);
  
  return 0;
}

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

// practice

int main(){
    int n;
    cin >> n;
    int keta = to_string(n).size();
    int ans = 0;
    int arr[3] = {3, 5, 7};
    rep(d, keta + 1){
        ll tot = ll(pow(3, d));
        rep(k, tot){
            int trits = k;
            int sum = 0;
            bitset<3> bit3;
            rep(i, d){
                sum = sum * 10 + arr[trits % 3];
                bit3[trits % 3] = true;
                trits /= 3;
            }
            if (sum <= n && bit3.all()) ans ++;
        }
    }
    cout << ans << endl;
}

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

#define TYPE long long
int cmp(const void *a, const void *b) { return *(TYPE *)a - *(TYPE *)b; }

int main() {
	long long N, C, K;
	long long b, c = 0, ans = 0;
	scanf("%lld%lld%lld", &N, &C, &K);
	long long *T = (long long *)malloc(sizeof(long long)*N);
	for (int i = 0; i < N; i++)
	{
		scanf("%lld", &T[i]);
		//printf("%lld ", T[i]);
	}

	qsort(T, N, sizeof(TYPE), cmp);
	//for (int i = 0; i < N; i++)
	//{
	//	printf("%lld ", T[i]);
	//}

	b = 1;//便
	int j = 0;//客の配列のイテレータ
	int dep = 0;//探索用この便の出発時間
	while (j < N)//便のシミュレーション（出発時間）
	{
		//if (T[j] <= T[dep] + K) {//時間的に乗れる
		//	if (c < C) {//定員的に乗れる
		if (T[j] <= T[dep] + K && c < C) {//時間的に乗れるまたは定員的に乗れる
			c++;//この便に乗れるので乗せる
		}
		else//この便に乗れないので次の便を設定し乗せる作業に取り掛かる
		{
			b++;//便を追加する
			dep = j;//追加した便の出発時間に変更
			c = 1;//追加した便の定員にカウントする
		}
		j++;//この客の処理は完了したので次の客の配列のイテレータへ移動する
	}
	ans = b;
	printf("%lld\n", ans);

	return 0;
}

Measured memory_bytes: 1788
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
using namespace std;
int main(void){
    int a , b ;
    cin >> a >> b;
    if(a <= 0 && b >= 0){
        cout << "Zero" << endl;
    } else if(a > 0 && b > 0) {
        cout << "Positive" << endl;
    } else {
        if( abs(b-a) % 2 == 0){
            cout << "Negative" <<endl;
        }else{
            cout << "Positive" <<endl;
        }
    }

    return 0;
}

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

using namespace std;

#define ll long long
#define ini(arr, val) memset(arr, (val), sizeof(arr))
#define loop(i,n)  for(ll i=0; i<n; i++)
#define loop1(i,n)  for(ll i=1; i<=n; i++)

#define all(a)      (a).begin(),(a).end()
#define exist(s,e)  (s.find(e)!=s.end())
#define dbg(x)  cout << #x << " = " << x << endl
#define pt(x) cout<<x<<"\n"
#define pts(x) cout<<x<<" "

#define mp make_pair
#define pb push_back
#define F first
#define S second


#define inf (int)1e9
#define infll 1e18
#define eps 1e-9
#define PI 3.1415926535897932384626433832795
#define mod 1000000007


#define fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define test   int t; cin>>t; while(t--)

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<vi> vvi;
typedef map<int,int> mii;
typedef set<int> si;

typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<pll> vpll;
typedef vector<vl> vvl;
typedef map<ll,ll> mll;
typedef set<ll> sl;


int dirx[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
int diry[] = { -1, 0, 1, -1, 1, -1, 0, 1 };



//===========================DEBUG======================//
#define XOX 1
vector<string> vec_splitter(string s) {
	s += ',';
	vector<string> res;
	while(!s.empty()) {
		res.push_back(s.substr(0, s.find(',')));
		s = s.substr(s.find(',') + 1);
	}
	return res;
}
void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx, 
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
	if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
	stringstream ss; ss << H;
	cerr << args[idx] << " = " << ss.str();
	debug_out(args, idx + 1, LINE_NUM, T...);
}
#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif

//================================================================//



//////////////////////////////////////////////////////////////////////////////////////////
//                      main starts
//////////////////////////////////////////////////////////////////////////////////////////
int const lmt=1e5+5;


int main(){
 //    #ifndef ONLINE_JUDGE
 //    freopen("../../input.txt", "r", stdin);
 //    freopen("../../output.txt", "w", stdout);
	// #endif
    fast

    ll x,a,b,n; cin>>a>>b>>n;
    if(n<b)x=n;
    else x=b-1;

    ll ans = (a*x/b)-a*(x/b);
    pt(ans);
}


/*



*/





Measured memory_bytes: 3660
import java.util.Scanner;
 
class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
        String s = sc.next();
        if(a >= 3200){
            System.out.println(s);
        }else{
            System.out.println("red");
        }
		
	}
}

Measured memory_bytes: 24020
s = input()
K = int(input())
N = len(s)
substring = []

for i in range(min(N,K)):
    for j in range(N-i+1):
        substring.append(s[j:j+i+1])

substring = list(set(substring))
substring.sort()
substring.pop(0)
##print(substring)
print(substring[K-1])

Measured memory_bytes: 5068
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn main() {
    let n: String = read();
    let d: usize = read();
    let mut dp = vec![vec![vec![0u64; d]; 2]; n.len() + 1];
    let big_int = 1000_000_000 + 7;
    dp[0][0][0] = 1;  // pos, less, d

    for (i, c) in n.chars().enumerate() {
        for j in 0..2 {
            for m in 0..d {
                let lim = if j == 1 { 9 } else { c.to_digit(10).unwrap() };
                for l in 0..lim + 1 {
                    let idx1 = if j == 1 || l < lim { 1 } else { 0 };
                    let idx2: usize = (m + l as usize) % d;
                    dp[i + 1][idx1][idx2] += dp[i][j][m];
                    dp[i + 1][idx1][idx2] %= big_int;
                }
            }
        }
    }
    // println!("{:?}", dp);

    let mut ans = 0u64;
    for j in 0..2 {
        ans += dp[n.len()][j][0];
        ans %= big_int;
    }
    println!("{:?}", (big_int + ans - 1) % big_int);
}


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

#define mxn 100005
int n,m;
char s[mxn],t[mxn];
map <int,char> x;
int main()
{
    while(cin>>n>>m)
    {
        scanf("%s%s",s,t);
        x.clear();
        int g=__gcd(n,m);
        for(int i=0;i<n;i++) {
            x[i*(m/g)]=s[i];
        }
        bool flag=0;
        for(int i=0;i<m;i++) {
            if(x.find(i*(n/g))!=x.end() && x[i*(n/g)]!=t[i]) {
                flag=1;
                break;
            }
        }
        if(flag) puts("-1");
        else printf("%lld\n",1LL*n*m/g);
    }
}


Measured memory_bytes: 4736
#include <cmath>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <vector>
#include <map>
#include<cstdio>
#include<functional>
#include <bitset>
#include <iomanip>
#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 repr(i, n) for(int i = n; i >= 0; i--)
#define ll long long
using namespace std;
template <typename T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }
template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
const ll INF = 1000000000000000000;
const ll MOD = 1e9 + 7;

int main()
{
	int n;
	cin >> n;
	vector<int> xl(n);
	vector<int> sxl(n);
	rep(i, n) {
		cin >> xl[i];
		sxl[i] = xl[i];
	}
	int ind = (n - 1) / 2 + 1;
	sort(sxl.begin(), sxl.end());
	int mid = sxl[n / 2];
	rep(i, n) {
		int ans = mid;
		if (xl[i] >= mid)
		{
			ans = sxl[n / 2 - 1];
		}
		cout << ans << endl;
	}

	//cout << fixed << setprecision(10) << ans << endl;
	system("pause");
}



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

#define PI 3.14159265359
#define INF 1e9
#define LINF 1e18
#define IMOD 1000000007 
#define irep(i,n) for(int i = 0; i < (int)(n); i++)
#define irep2(i,a,n) for(int i = (int)(a); i <= (int)(n); i++)
#define lrep(i,n) for(long long  i = 0; i < (long long)(n); i++)
#define lrep2(i,a,n) for(long long i = (long long)(a); i <= (long long)(n); i++)

#define irrep(i,n) for(int i = (int)(n); i > -1; i--)
#define irrep2(i,a,n) for(int i = (int)(n); i >= (int)(a); i--)

typedef long long ll;
typedef std::vector<char> v_char;
typedef std::vector<v_char > v2_char;
typedef std::vector<double> v_double;
typedef std::vector<v_double > v2_double;
typedef std::vector<int> v_int;
typedef std::vector<v_int > v2_int;
typedef std::vector<ll> v_ll;
typedef std::vector<v_ll > v2_ll;
typedef std::vector<std::string> v_string;
typedef std::vector<v_string > v2_string;
typedef std::vector<bool> v_bool;
typedef std::vector<v_bool > v2_bool;
typedef std::pair<ll, ll> pll;
typedef std::pair<int, int> pii;

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

using namespace std; 

int main(void)
{
    set<char> c;
    c.insert('a');
    c.insert('i');
    c.insert('u');
    c.insert('e');
    c.insert('o');

    char tmp;
    cin >> tmp;
    if(c.find(tmp) == c.end()) {
        cout << "consonant" << endl;
        return 0;
    }

    cout << "vowel" << endl;
    
    return 0;
}   
/** atcoder **/


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
    string S,A = "yes";
    cin >> S;
    for(int i=0; i < S.size(); i++){
        for(int j=i+1; j < S.size(); j++){
            if(S[i] == S[j]){
                A = "no";
            }
        }
    }
    cout << A << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

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; }

string S;

int main(){
    cin>>S;
    S[5]=' ';
    S[13]=' ';
    out(S);
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
int main(void){
        long long int n,m;
        long long int ans;
        std::cin >> n >> m;
        if(n == 1 || m == 1){
                ans = n*m-2;
                if(n == 1 && m == 1){
                        ans = 1;
                }
        }else if(n == 2 || m == 2){
                ans = 0;
        }else{
                ans = n*m-(2*n+2*m)+4;
        }
        printf("%lld",ans);
        return 0;
}

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

bool palindrome(int n)
{
    string s1 = to_string(n);
    string s2 = s1;
    reverse(s2.begin(), s2.end());
    return s2 == s1;
}

int main() 
{
    int a,b;
    cin >> a >> b;
    int ans = 0;
    for (int i=a; i<=b; i++)
        if (palindrome(i))
            ans++;
    cout << ans;
    return 0;
}

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

// Author: Ashish
vector<int> g[2005];
int32_t main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n,x,y;
  cin>>n>>x>>y;
  for(int i=1;i<n;i++)
  {
  	g[i].push_back(i+1);
  	g[i+1].push_back(i);
  }
  g[x].push_back(y);
  vector<int> answer(n,0);
  for(int i=1;i<n;i++)
  {
		vector<int> dist(n+1,n+10);  	
  	queue<int> bfs;
  	dist[i]=0;
  	bfs.push(i);
  	while(bfs.size())
  	{
  		auto curr=bfs.front();
  		bfs.pop();
  		for(auto&itr:g[curr])
  		{
  			if(dist[itr]>dist[curr]+1)
  			{
  				dist[itr]=dist[curr]+1;
  				bfs.push(itr);
  			}
  		}
  	}
  	for(int j=i+1;j<=n;j++) answer[dist[j]]++;
  }
  for(int i=1;i<n;i++) cout<<answer[i]<<'\n';


  return 0;
}

Measured memory_bytes: 384
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.awt.geom.Point2D.Double;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.TreeSet;
import java.lang.Object;
 
public class Main {
    Scanner sc = new Scanner(System.in);
   
    public static void main(String[] args) {
        new Main(); 
    }
   
    public Main() {
        new A().doIt();
//        new D().doIt();
    }
    class D{
    	void doIt(){
    		int Max = 1000000009;
        	int all[] = new int[900003];
        	ArrayList<Par> array = new ArrayList<Par>();
    		all[0] = 1;
    		for(int i = 1;i < 900003;i++){
        		all[i] = (all[i-1] * 3) % Max;
        	}
    		int A = sc.nextInt();
    		int B = sc.nextInt();
    		int C = sc.nextInt();
    		int sum = 0;
    		array.add(new Par(A,B,C,A+B+C));
    		int length = 1;
    		while(length > 0){
    			Par p = array.remove(length - 1);
    			length--;
    			if(p.A== 0){
    				sum = (sum + all[p.cnt]) % Max;
    			}
    			if(p.A - 1 >= 0){
    				array.add(new Par(p.A-1,p.B,p.C,p.cnt-1));
    				length++;
    			}
    			if(p.B - 1 >= 0){
    				array.add(new Par(p.A,p.B-1,p.C,p.cnt-1));
    				length++;
    			}
    			if(p.C - 1 >= 0){
    				array.add(new Par(p.A,p.B,p.C - 1,p.cnt-1));
    			}
    		}
    		System.out.println(sum);
    	}		
    	class Par{
    		int A,B,C,cnt;
    		public Par(int A,int B,int C,int cnt){
    			this.A = A;
    			this.B = B;
    			this.C = C;
    			this.cnt = cnt;
    		}
    	}
    }
    class A{
    	long result = 0;
    	void dfs(String str,int num,int length,long cnt){
    		if(num == length){
    			result = result + cnt;
    		}
    		else{
    			for(int i = num;i < length;i++){
    				dfs(str,i+1,length,cnt + Long.parseLong(str.substring(num,i+1)));
    			}
    		}
    	}
    	void doIt(){
    		String str = sc.next();
    		int length = str.length();
    		dfs(str,0,length,0);
    		System.out.println(result);
    	}
    }
}

Measured memory_bytes: 8788
import static java.lang.System.*;

import java.util.Scanner;

class Main {
    public static void main(String[]args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String str1 = "";
        
        for(int a = 1; a <= str.length(); a++) {
        	if(String.valueOf(str.charAt(a - 1)).equals(
        	     String.valueOf(str.charAt(a - 1)).toUpperCase())) {
        		 
        		str1 += String.valueOf(str.charAt(a - 1)).toLowerCase();
        	}else {
        		str1 += String.valueOf(str.charAt(a - 1)).toUpperCase();
        	}
        	
        }
        out.println(str1);
    }
}


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

int main(void)
{
	int d[2] = {0, 0};
	int c;

	for(int i = 0; i < 2; i++){
		for(int j = 0; j < 4; j++){
			cin >> c;
			d[i] += c;
		}
	}

	if(d[0] > d[1])
		cout << d[0];
	else
		cout << d[1];
	cout << endl;


	return 0;
}

Measured memory_bytes: 1160
/*****Be Name Khoda*****/
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define F first
#define S second
#define Size(x) ((int)x.size())
#define All(x) x.begin() , x.end()
#define int long long

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

const int N = 1e5 + 10 , INF = 1e18;

int n , q , k , d[N];
vector<pair<int , int>> adj[N];
set<pair<int , int>> st;
bool mark[N];

void dijkstra(int x)
{
	fill_n(d , N , INF);
	d[x] = 0 , mark[x] = 1;
	for(int i = 0; i < n; i++)
		st.insert({d[i] , i});
	while(!st.empty()){
		pair<int , int> fr = *st.begin();
		int v = fr.S;
		mark[v] = 1;
		st.erase(st.begin());
		for(auto u : adj[v])
			if(!mark[u.F] && d[u.F] > d[v] + u.S){
				st.erase({d[u.F] , u.F});
				d[u.F] = d[v] + u.S;
				st.insert({d[u.F] , u.F});
			}
	}
}

int32_t main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n;
	for(int i = 0; i < n - 1; i++){
		int u , v , w;
		cin >> u >> v >> w;
		adj[--u].push_back({--v , w}) , adj[v].push_back({u , w});
	}
	cin >> q >> k;
	dijkstra(--k);
	while(q--){
		int u , v;
		cin >> u >> v;
		cout << d[--u] + d[--v] << '\n';
	}
}

Measured memory_bytes: 16384
import math


def main():
    N, K = map(int, input().split())
    k = int(math.log2(K)) + 1
    print((max(0, N - K + 1) + sum(
        max(0, N - (math.ceil(K * (1 / 2) ** i)) + 1) * (1 / 2) ** i
        - max(0, N - (math.ceil(K * (1 / 2) ** (i - 1))) + 1) * (1 / 2) ** i
        for i in range(1, k + 1))) / N)
    return


main()


Measured memory_bytes: 3444
import sys
sys.setrecursionlimit(1000000000)
n, x = map(int, input().split())
b = [2**(i+2) - 3 for i in range(51)]
p = [2**(i+1) - 1 for i in range(51)]
def pate(m, k):
    if m == 0:
        return k
    else:
        if k == 0:
            return 0
        elif k <= b[m-1] + 1:
            return pate(m-1, k-1)
        elif k == b[m-1] + 2:
            return p[m-1] + 1
        elif k <= b[m] -1:
            return p[m-1] + 1 + pate(m-1, k-b[m-1]-2)
        else:
            return p[m]
print(pate(n, x))

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

int main(){

  int Num;
  int max_count = 0;
  cin >> Num;

  //2,4,8,16,32,64 の 2 の階数のどれかが回答になるので数の範囲を把握して
  //どれかを返す
  
  if(Num < 2){	//2 より小さいとき
    cout << 1 << endl;
  }else if( Num < 4){
    cout << 2 << endl;
  }else if( Num < 8){
    cout << 4 << endl;
  }else if( Num < 16){
    cout << 8 << endl;
  }else if( Num < 32){
    cout << 16 << endl;
  }else if( Num < 64){
    cout << 32 << endl;
  }else if( Num >= 64){
    cout << 64 << endl;
  }
  
}

Measured memory_bytes: 256
// 見せてやるぜ、奇跡ってやつをよぉ……
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
// using namespace std;

using ll=long long;
template<class T> using V = std::vector<T>;
template<class T, class U> using P = std::pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
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; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;

long long powmod(long long m, long long p) {
    if (p == 0) return 1;
    long long tmp = powmod(m, p / 2);
    tmp = tmp * tmp % MOD;
    if (p & 1) tmp = tmp * m % MOD;
    return tmp;
}

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    int n;
    std::cin >> n;
    V<int> x(n);
    for (int i = 0; i < n; i++) std::cin >> x[i];

    // 部分点
    // long long ans = 0;
    // for (int i = 0; i < n - 1; i++) {
    //     for (int j = 1; j < n - i; j++) {
    //         long long d = (ll)(x[i + j] - x[i + j - 1]);
    //         d = d * powmod(j, MOD - 2) % MOD;
    //         ans += d;
    //         if (ans >= MOD) ans -= MOD;
    //     }
    // }

    std::vector<long long> accinv(n, 0);
    for (int i = 1; i < n; i++) {
        accinv[i] = accinv[i - 1] + powmod(i, MOD - 2);
        if (accinv[i] >= MOD) accinv[i] -= MOD;
    }

    long long ans = 0;
    for (int i = 0; i < n - 1; i++) {
        ans += (x[i + 1] - x[i]) * accinv[i + 1] % MOD;
        if (ans >= MOD) ans -= MOD;
    }
    
    for (int i = 2; i < n; i++) ans = (ll)i * ans % MOD;
    std::cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h> 
#ifndef M_PI
    #define M_PI 3.14159265358979323846
#endif


using namespace std;
#define M 1000000001
#define rep(i,a,b) for(int i=a;i<b;++i)
#define repb(i,a,b) for(int i=a;i>=b;--i)
#define repv(arr)  for(auto it=arr[i].begin();it!=arr[i].end();++it)  
#define vi vector<int>
#define vb vector<bool>
#define vs vector<string>
#define vl vector<long long int>
#define vc vector<char>
#define sz(a) (int)a.size()
#define ssortA(arr)   stable_sort(arr.begin(),arr.end())
#define ssortB(arr)   stable_sort(arr.begin(),arr.end(),greater<int>());
#define pii pair<int,int>
#define pli pair<long long,int>
#define pll pair<long long,long long>
#define fi first
#define se second
#define search(arr,c)  binary_search(arr.begin(),arr.end(),c)
#define pb   push_back
#define ll long long
#define mp make_pair
#define endl "\n" 
#define LCM(a,b) boost::math::lcm(a,b)
#define cl_bf cin.ignore(numeric_limits<streamsize>::max(), '\n');
#define check(ds,x) (int)(ds.find(x)!=ds.end()?1:0)
int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n,d;
    cin>>n>>d;
    int count=0;
    double temp=1e-15;
    rep(i,0,n){
        int x,y;
        cin>>x>>y;
        double z=sqrtl(1LL*x*x+1LL*y*y);
        //cout<<z<<endl;
        if((z)<=d){
            ++count;
        }
    }
    cout<<count<<endl;
}

Measured memory_bytes: 3640
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC push_options
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC pop_options
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i, n) for (int i = 0; i < n; i++)
#define per(i, n) for (int i = n - 1; i > -1; i--)
#define rer(i, x, n) for (int i = x; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;













#define int long long

signed main(){
    int x;
    cin >> x;
    int t = x/500;
    t *= 1000;
    x = x%500;
    x = x / 5;
    t += x * 5;
    cout << t;




}


Measured memory_bytes: 256
n=int(input())
c0=0
c1=0
c2=0
c3=0
for i in range(n):
  s=input()
  if s=='AC':
    c0+=1
  elif s=='WA':
    c1+=1
  elif s=='TLE':
    c2+=1
  else:
    c3+=1
print("AC x",c0)
print("WA x",c1)
print("TLE x",c2)
print("RE x",c3)

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

int main() {
    int N; cin >> N;
    vector<int> id(N);
    rep(i, 0, N) {
        int a; cin >> a;
        id[a - 1] = i + 1;
    }
    multiset<long long> ms;
    ms.insert(0);
    ms.insert(0);
    ms.insert(N + 1);
    ms.insert(N + 1);
    long long ans = 0;
    for(int i = N - 1; i >= 0; --i) {
        long long v = id[i];
        auto c = ms.lower_bound(v);
        auto d = c; ++d;
        auto b = c; --b;
        auto a = b; --a;
        long long add = (*b - *a) * (*c - v) + (*d - *c) * (v - *b);
        ans += add * (i + 1);
        ms.insert(v);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 5376
#include <bits/stdc++.h>  // g++ -std=c++14 -o a a.cpp

using namespace std;

typedef pair<int, int> P;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define repto(i, n) for(int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end()) // ユニークなvectorにする。連続した値を除去して切り出す。
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int main() {
  int N;
  cin >> N;
  int x = N * 800;
  int y = (N / 15) * 200;
  cout << (x - y) << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=1LL<<60;
const double EPS = 1e-10;
const ll mod=1000000007;

class UnionFind {
  vector<ll> par, rank; // par > 0: number, par < 0: -par
public:
  void init(ll n) {
    par.resize(n); rank.resize(n);
    fill(par.begin(), par.end(), 1); fill(rank.begin(), rank.end(), 0);
  }
  ll getSize(ll x) {
    return par[find(x)];
  }
  ll find(ll x) {
    if (par[x] > 0) return x;
    return -(par[x] = -find(-par[x]));
  }
  void merge(ll x, ll y) {
    x = find(x);
    y = find(y);
    if (x == y) return;
    if (rank[x] < rank[y]) {
      par[y] += par[x];
      par[x] = -y;
    } else {
      par[x] += par[y];
      par[y] = -x;
      if (rank[x] == rank[y]) rank[x]++;
    }
  }
  bool isSame(ll x, ll y) {
    return find(x) == find(y);
  }
};
int main(void){
    ll n,m;
    cin>>n>>m;
    UnionFind uf;
    uf.init(n);
    for(int i=0;i<m;i++){
        ll x,y,z;
        cin>>x>>y>>z;
        x--,y--;
        uf.merge(x,y);
    }
    set<ll> s;
    for(int i=0;i<n;i++){
        s.insert(uf.find(i));
    }
    cout<<s.size()<<endl;
}


Measured memory_bytes: 9584
#include <cstdio>
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <memory>
#include <algorithm>
#include <cstring>

using namespace std;

int x, a;
int main() {
    cin >> x >> a;
    if (x < a)
        cout << "0";
    else cout << "10";

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;

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

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
const long long INF = 1LL << 60;

// --------write my code!!!!!----------//

int main(){
  int MAX = 101010;
  vector<int> is_prime(MAX, 1);
  is_prime[0], is_prime[1] = 0;
  for(int i=2; i<MAX; ++i) {
    if (!is_prime[i]) continue;
    for(int j=i*2; j<MAX; j+=i) is_prime[j] = 0;
  }
  
  vector<int> a(MAX,0);
  rep(i,MAX){
    if(i%2==0)continue;
    if(is_prime[i] && is_prime[(i+1)/2]) a[i] = 1;
  }
  
  vector<int> s(MAX+1, 0);
  rep(i,MAX) s[i+1] = s[i] + a[i];
  
  int Q; cin >> Q;
  rep(i,Q){
	int l,r;
    cin >> l >> r;
    ++r;
    
    cout << s[r] - s[l] << endl;
  }
}


Measured memory_bytes: 1792