akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
 
//long long
using ll = long long;
 
// pair<int, int>
using PII = pair<int, int>;
 
//最大値、mod
const int MOD = 1000000007;
const int INF = 1000000000;
const long long LINF = 1e18;
const int MAX = 510000;
 
//出力系
#define print(x) cout << x << endl
#define prints(x) cout << fixed << setprecision(10) << x << endl
#define printc(x) cout << setw(2) << setfill('0') << x << endl;
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()
 
//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
 
//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
 
// 最小公倍数
unsigned lcm(unsigned a, unsigned b){
    return a / gcd(a, b) * b; 
}
 
// a = max(a, b), a = min(a, b)
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; }
 
// 階乗(MODをとる)
ll pow_mod(ll num, ll pow, ll mod) {
    ll prod = 1;
    num %= mod;
    while (pow > 0) {
        if (pow & 1) prod = prod * num % mod;
        num = num * num % mod;
        pow >>= 1;
    }
    return prod;
}
 
 
 
// 二項係数(MODとる、1 ≦ k ≦ n ≦ 10^7 程度)
// COMinit()
// COM(x, y)
// とコンビで使う
 
// テーブルを作る前処理
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 dx[4] = {0, 0, 1, -1}, dy[4] = {1, -1, 0, 0};


struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};


int main(){
    string S;
    cin >> S;
    int len = S.length();
    for(int i = 0; i < len; i += 2){
        string t = S.substr(i, 2);
        if(t != "hi"){
            no;
            return 0;
        }
    }
yes;
return 0;
}

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

using ll = long long;
using vll = std::vector<ll>;

template<class T>
T pp(T p)
{
	return p * (p - 1) / 2;
}


size_t count_le(const vll& plus, const vll& minus, ll T)
{
	size_t m = minus.size();
	size_t count = 0;
	for (size_t p = 0; p < plus.size(); p++)
	{
		for (; m > 0; m--)
		{
			if (plus[p] * minus[m-1] <= T) break;
 		}
		count += m;
	}
	return count;
}

size_t count_le(const vll& plus, ll T)
{
	size_t m = plus.size();
	size_t count = 0;
	for (size_t p = 0; p < plus.size(); p++)
	{
		for (; m > p + 1; m--)
		{
			if (plus[p] * plus[m-1] <= T) break;
 		}
		if (p == m) m++;
		count += (m - p - 1);
	}
	return count;
}

ll search_min_minus(const vll& plus, const vll& minus, size_t K)
{
	if (K == 1)
	{
		return plus[0] * minus[0];
	}
	else if (plus.size() <= 1)
	{
		return plus[0] * minus[K - 1];
	}
	else if (minus.size() <= 1)
	{
		return plus[K - 1] * minus[0];
	}

	ll left = (ll)-1e18, right = 0;
	while (left + 1 < right)
	{
		ll center = (left + right) / 2;
		ll c = count_le(plus, minus, center);
		if (c < K)
		{
			left = center;
		}
		else
		{
			right = center;
		}
	}
	return right;
}

ll search_min_plus(const vll& plus, const vll& minus, size_t K)
{
	if (K == 1)
	{
		if (plus.size() <= 1)
		{
			return minus[0] * minus[1];
		}
		else if (minus.size() <= 1)
		{
			return plus[0] * plus[1];
		}
		else
		{
			return std::min(plus[0] * plus[1], minus[0] * minus[1]);
		}
	}

	ll left = 0, right = (ll)1e18;
	while (left + 1 < right)
	{
		ll center = (left + right) / 2;
		size_t c = count_le(plus, center) + count_le(minus, center);
		if (c < K)
		{
			left = center;
		}
		else
		{
			right = center;
		}
	}
	return right;
}


ll f(const std::vector<ll>& A, int N, size_t K)
{
	std::vector<ll> plus, minus;
	size_t zero = 0;
	plus.reserve(N);
	minus.reserve(N);

	for (int i = 0; i < N; i++)
	{
		if (A[i] > 0ll)
		{
			plus.push_back(A[i]);
		}
		else if (A[i] < 0ll)
		{
			minus.push_back(A[i]);
		}
		else
		{
			zero++;
		}
	}

	std::sort(begin(plus), end(plus), std::greater<ll>());
	std::sort(begin(minus), end(minus), std::less<ll>());

	size_t pp_minus = plus.size() * minus.size();
	size_t pp_zero = pp(zero) + zero * (plus.size() + minus.size());

	if (K <= pp_minus)
	{
		return search_min_minus(plus, minus, K);
	}
	K -= pp_minus;
	if (K <= pp_zero)
	{
		return 0ll;
	}
	K -= pp_zero;

	std::reverse(begin(plus), end(plus));
	std::reverse(begin(minus), end(minus));
	return search_min_plus(plus, minus, K);
}

int main()
{
	int N;
	size_t K;
	std::cin >> N >> K;
	vll A(N);
	for (int i = 0; i < N; i++)
	{
		std::cin >> A[i];
	}

	std::cout << f(A, N, K);
	
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
using int32 = int_fast32_t;
using int64 = int_fast64_t;

#define INF (int32)1e9
#define INF_LL (int64)1e18
#define REP(i, n) for(int64 i = 0; i < (n); i++)

int main() {
  int32 n, m, k;
  cin >> n >> m >> k;
  vector<int64> a(n), b(m);
  for (auto&& x : a) cin >> x;
  for (auto&& x : b) cin >> x;
  a.insert(a.begin(), 0);
  b.insert(b.begin(), 0);
  REP(i, a.size()-1) a[i+1] += a[i];
  REP(i, b.size()-1) b[i+1] += b[i];
  int32 ia = 0, ib = m;
  int32 book = 0;
  while (ia <= n) {
    while (ib > 0 && a[ia] + b[ib] > k) {
      ib--;
    }
    if (a[ia] + b[ib] <= k) {
      book = max(book, ia + ib);
    }
    ia++;
  }
  cout << book << endl;
}


Measured memory_bytes: 8008
import java.util.*;

public class Main{
	public static void main(String[] $){
		var s=new Scanner(System.in);
		var n=s.nextInt();
		var a=new int[n];
		Arrays.setAll(a,i->s.nextInt());

		var p=new int[1000000];

		var pairwise=true;

		for(int v: a){
			for(int i=2;i<=v;++i){
				if((long)i*i>v){
					if(v>1&&++p[v] >= 2)
						pairwise=false;
					break;
				}
				if(v%i==0){
					if(++p[i] >= 2)
						pairwise=false;
					while(v%i==0)
						v/=i;
				}
			}
		}

		if(pairwise)
			System.out.println("pairwise coprime");
		else if(!Arrays.stream(p).anyMatch(i->i==n))
			System.out.println("setwise coprime");
		else
			System.out.println("not coprime");

	}
}


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

int main() {
  string st = "";
  string ans = "";
  cin >> st;
  //cout << st.size() << endl;
  for(int i = 1 ; i <= st.size(); i++){
    if(i%2 != 0){
     ans += st[i-1];
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#ifdef __DEBUG__
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const deque<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const set<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int N;
vector<map<char,int>> S;
void input(){
    fast_io();
    cin >> N;
    for (int i = 0; i < N; i++)
    {
        string s; cin >> s;
        map<char,int> cnt;
        for (int i = 0; i < s.length(); i++)
        {
            cnt[s[i]]++;
        }
        S.push_back(cnt);
    }
    
}

int solve(){
    map<char,int> cnt;
    string ans;
    for (char c = 'a'; c <= 'z'; c++)
    {
        cnt[c] = 1e6;
        for (int i = 0; i < S.size(); i++)
        {
            cnt[c] = min(cnt[c],S[i][c]);
        }
        ans += string(cnt[c],c);
    }
    cout << ans << endl;   

    return 0;
}   

int main()
{
    input();
    solve();
    return 0;
}

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

using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<(int)(n);i++)

ll mind(ll len, ll x, ll y, ll s, ll g){
    if(s>g)swap(s,g);
    ll ko1 = g-s;
    ll ko2 = abs(s-x) + abs(g-y) + 1;
    return min(ko1,ko2);
}

int main(){
    ll n,x,y;
    cin>>n>>x>>y;
    x--; y--;
    ll mindist[2005]={};
    for(int i=0; i<n; i++){
        for(int j=i+1; j<n; j++){
            //cout<<i<<" "<<j <<" "<<mind(n,x,y,i,j)<<endl;
            mindist[mind(n,x,y,i,j)]++;
        }
    }
    for(int i=1;i<n;i++)cout<<mindist[i]<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(x) (x).begin(),(x).end()
#define dup(x,y) (((x)+(y)-1)/(y))
#define sz(x) (int)(x).size()
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main(){
    vector<int> v(5);
    rep(i,5) cin >> v[i];
    int ans = 0;
    int m = 0;
    rep(i,5){
        ans += dup(v[i],10)*10;
        if(v[i]%10 != 0 && 10-v[i]%10 >= m){
            m = 10 - v[i]%10;
        }
    }
    cout << ans - m << endl;
    return 0;
}

Measured memory_bytes: 256
N = int(input())
H = map(int, input().split())

cnt = 0
ph = 0
ans = 0
for h in H:
    if ph >= h:
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
    ph = h
else:
    ans = max(ans, cnt)

print(ans)


Measured memory_bytes: 63984
#include <stdio.h>
#include <vector>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>

#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<double> vd;


int main() {
    ll a, b, k;
    cin >> a >> b >> k;
    cout << max(a - k, (ll)0) << " " << max((ll)0, min(b - (k - a), b)) << endl;
    
}


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

int main(void) {
	string S;
	cin >> S;
	int ans = 0;
	if (S=="SUN") ans = 7;
	if (S=="MON") ans = 6;
	if (S=="TUE") ans = 5;
	if (S=="WED") ans = 4;
	if (S=="THU") ans = 3;
	if (S=="FRI") ans = 2;
	if (S=="SAT") ans = 1;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast,no-stack-protector")
#include<bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define LL long long int
#define vi vector<int>
#define vl vector<LL>
#define pb push_back
#define all(V) V.begin(),V.end()
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%I64d",&x)
#define pii pair<int,int>
#define cmax(a,b) ((a) = (a) > (b) ? (a) : (b))
#define cmin(a,b) ((a) = (a) < (b) ? (a) : (b))
#define debug(x)  cerr << #x << " = " << x << endl
function<void(void)> ____ = [](){ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);};
const int MAXN = 1e5+7;
char s[MAXN];
int n;

void solve(){
    scanf("%s",s+1);
    n = strlen(s + 1);
    vector<vi> vec(26,vi());
    for(int i = 1; i <= n; i++) vec[s[i]-'a'].pb(i);
    for(int i = 0; i < 26; i++){
        if(vec[i].size()<=1) continue;
        for(int p = 1; p < vec[i].size(); p++){
            if(vec[i][p]-vec[i][p-1]<=2){
                cout << vec[i][p-1] << ' ' << vec[i][p] << endl;
                return;
            }
        }
    }
    cout << -1 << ' ' << -1 << endl;
}
int main(){
    #ifndef ONLINE_JUDGE
    freopen("Local.in","r",stdin);
    freopen("ans.out","w",stdout);
    #endif
    solve();
    return 0;
}

Measured memory_bytes: 4052
#include<bits/stdc++.h> 
using namespace std;
int main(){
	int t[10]={0},a,b,c;
		cin>>a>>b>>c;
		t[a]++,t[b]++,t[c]++;
		if(t[a]==2||t[b]==2||t[c]==2)	
			cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
		
	return 0;
}



Measured memory_bytes: 384
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>

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

using namespace std;
int main() {
	string s[3];
	rep(i, 3) cin >> s[i];
	rep(i, 3) printf("%c", s[i][0] - 32);
	cout << endl;

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int n;
  if(scanf("%d",&n)==1){}
  int a[n];int i;int b[n];
  for(i=0;i<n;i++){
    if(scanf("%d",&a[i])==1){}
    b[a[i]-1]=i+1;
  }
  for(i=0;i<n;i++){
    printf("%d ",b[i]);
  }
  return 0;
}

Measured memory_bytes: 1536
/*
    Author: aksayushx
*/
#include<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define all(a) a.begin(),a.end()
#define mp make_pair
#define mod 1000000007
using namespace std;
typedef long long ll;
typedef long double ld;
ll n;
vector<ll> a,pref;
vector<vector<ll>> dp;

void aksayushx()
{
    cin>>n;
    a.resize(n);
    pref.assign(n+1,0);
    dp.assign(n,vector<ll>(n,pow(10,18)));
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
        pref[i+1]=pref[i]+a[i];
        //cout<<pref[i+1]<<' ';
    }
    for(ll l=n-1;l>=0;l--)
    {
        for(ll r=l;r<=n-1;r++)
        {
            if(l==r)
            dp[l][r]=0;
            for(ll i=l;i<r;i++){
            if(l==r)
            dp[l][r]=0;
            else
            dp[l][r]=min(dp[l][r],dp[l][i]+dp[i+1][r]+pref[r+1]-pref[l]);}
        }
    }
    cout<<dp[0][n-1];
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int test=1;
    //cin>>test;
    while(test--)
        aksayushx();
    return 0;
}


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

using namespace std;

typedef short sho;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef double db;
typedef string str; 
 
typedef pair<int,int> pii;
typedef pair<ll,ll> pll; 
typedef pair<ld,ld> pld;
 
typedef vector<int> vi; 
typedef vector<ll> vl; 
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<pld> vpd;

#define mp make_pair 
#define FF first
#define SS second
#define sz(x) (int)x.size()
#define begin(x) (x).begin() 
#define end(x) (x).end()
#define rbegin(x) (x).rbegin()
#define rend(x) (x).rend()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front 
#define pb push_back
#define pp push
#define lb lower_bound 
#define ub upper_bound

const int MOD=1e9+7;

ll Ext_gcd(ll a, ll b, ll &x, ll &y) 
{
	if (b == 0) { x = 1, y = 0; return a; }
	ll ret = Ext_gcd(b, a%b, y, x);
	y -= a / b * x;
	return ret;
}
ll Inv(ll a, int m) 
{   
	ll d, x, y, t = (ll)m;
	d = Ext_gcd(a, t, x, y);
	if (d == 1) return (x%t + t) % t;
	return -1;
}
 
ll Cm(ll n, ll m, ll p)  
{
	ll a = 1, b = 1;
	if (m > n) return 0;
	while (m)
	{
		a = (a*n) % p;
		b = (b*m) % p;
		m--;
		n--;
	}
	return (ll)a*Inv(b, p) % p;  
}
 
int Lucas(ll n, ll m, ll p)  
{
	if (m == 0) return 1;
	return (ll)Cm(n%p, m%p, p)*(ll)Lucas(n / p, m / p, p) % p;
}

ull fast_mi(int p)
{
	if(p==0)
		return 1LL;
	ull tmp=fast_mi(p>>1);
	tmp*=tmp;
	tmp%=MOD;
	if(p&1)
		tmp*=2LL;
	tmp%=MOD;
	return tmp;
}

int n,a,b;

int main() {
//	freopen("in.txt","r",stdin);
//	freopen("out.txt","w",stdout);
	ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    /* start code */
    cin>>n>>a>>b;
    ull ans=fast_mi(n);
    ans=(ans-Lucas(n,a,MOD)+MOD)%MOD;
	ans=(ans-Lucas(n,b,MOD)+MOD)%MOD;
	ans=(ans-1LL+MOD)%MOD;
	cout<<ans<<endl; 
    /* end code */
	return 0;
}

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

bool compair(pair<string,int> a,pair<string,int> b){
    //first
    if(a.first != b.first){
        //ascending
        return a.first < b.first;
    }
    //next
    if(a.second != b.second){
        //descending
        return a.second > b.second;
    }else{
        return true;
    }
}

int main(){
    int r;
    int d;
    int x;
    cin >> r >> d >> x;
    int cur = x;
    int prev;
    for(int i = 0;i < 10;i++){
        prev = cur; 
        cur = r*prev-d;
        cout << cur << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation etc.
#include <cstdlib>	// require abs
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
//#include <fstream>	// require freopen

using namespace std;

bool do_lot (vector<string> path, int n, vector <int> c, vector <int> e )
{
	int size = path.size();
	int i, j;

	for (i = 0; i < size; ++i ){
		for (j = 0; j < n - 1; ++j ){
			if (path[i][j] == '1' ){
				swap (c[j], c[j+1] );
			} // end if
		} // end for
	} // end for

	return (c == e );
}

bool isinsert_one (string str, int n )
{
	int len = str.length();
	str = '0' + str + '0';
	
	return (str[n+1-1] == '0' && str[n+1+1] == '0' );
} 

string itos (int n )
{
	stringstream ss;
	ss << n;

	return ss.str();
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.dlII", "r", stdin );
	int n;

	while (cin >> n && n ){
		int m, h, d;
		cin >> m >> h >> d;
		vector <int> s(n, 0 ), e(n, 0 );
		string res = "";
	
		s[--m] = 1;
		e[--h] = 1;

		vector <string> path;
		int i, j;
		for (i = 0; i < d; ++i ) {
			string str = ""; 
			cin >> str;
			path.push_back (str );
		} // end for

		if (do_lot (path, n, s, e ) ){
			res += '0';
		}else{
			for (i = 0; i < d; ++i){
				for (j = 0; j < n - 1; ++j ){
					if (path[i][j] == '0' && isinsert_one (path[i], j ) ){
						path[i][j] = '1';
						if (do_lot (path, n, s, e ) ){
							res += itos (i+1);
							res += ' ';
							res += itos (j+1);
							goto result;
						}else{
							path[i][j] = '0';
						} // end if
					} // end if
				} // end for
			} // end for
		} // end if

result:
		if (res.empty() ){
			cout << '1' << endl;
		}else{
			cout << res << endl;
		} // end if
	} // end loop

	return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>

using namespace std;

int main()
{
    long long X,Y,r=0;
    cin>>X;
    Y=100;
    while(1){
        Y=Y+Y*0.01;
        r++;
        if(Y>=X){
            cout<<r<<endl;
            exit(0);
        }
    }
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}
 
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=std::sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}
 
long long gcd_(long long a, long long b){
  if(a<b){
    std::swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
//using namespace std;
//using namespace boost::multiprecision;
//using namespace __gnu_pbds;
 
int main(){
  using namespace std;
  long long n;
  cin>>n;
  long long ans = 0;
  for(long long i = 1; i <= n; i++){
    if(i % 3 == 0 || i % 5 == 0) continue;
    ans += i;
  }
  cout<<ans<<endl;
  return 0;
}



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

int main() {
    int n;
    cin>>n;
    if(n%2==0){
        cout<<n/2<<endl;

    }
    else{
        cout<<n/2+1<<endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<(int)(n);i++)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

const string possible = "POSSIBLE";
const string impossible = "IMPOSSIBLE";

int main(){
    ll N,M;cin>>N>>M;
    vector<int> a(M),b(M);
    set<pair<int,int>> st;
    rep(i,M){
        cin >> a[i] >> b[i];
        st.insert(make_pair(a[i],b[i]));
    }

    for(int i=2;i<N;i++){
        if(st.count(make_pair(1,i)) and st.count(make_pair(i,N))){
            cout << possible << endl;
            return 0;
        }
    }
    cout << impossible << endl;
}


Measured memory_bytes: 11136
#include<iostream>
using namespace std;
int main(){
int h,w;
char field[50][50];
int ans[50][50]={};

std::cin >> h>>w;
for (int i = 0; i < h; i++) {
  for (int i2 = 0; i2 < w; i2++) {
    std::cin >> field[i][i2];
    if(field[i][i2]=='#'){
      if(i>=1){
        ans[i-1][i2]++;
        if(i2>=1)ans[i-1][i2-1]++;
        if(i2<w-1)ans[i-1][i2+1]++;
      }
      if(i<h-1){
        ans[i+1][i2]++;
        if(i2>=1)ans[i+1][i2-1]++;
        if(i2<w-1)ans[i+1][i2+1]++;
      }
      if(i2>=1)ans[i][i2-1]++;
      if(i2<w-1)ans[i][i2+1]++;
    }
  }
}


for (int i = 0; i < h; i++) {
  for (int i2 = 0; i2 < w; i2++) {
    if(field[i][i2]=='.'){std::cout << ans[i][i2];}
    else {std::cout << "#";}
  }
  std::cout << '\n';
}

return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <utility>
using namespace std;

typedef long long ll;
ll MOD = 1e9+7;

int main()
{
	int n;
	string s;
	int ans=1e8-1;
	cin>>n;
	cin>>s;
	s+='.';//番兵
	int b=0;
	int w=0;
	for(int i=0;i<n;i++)
	{
		if(s[i]=='#')
			b++;
	}
	//区切る場所
	//i-1までが白、iからが黒
	for(int i=0;i<n+1;i++)
	{
		int cnt=(i-w)+(n-i-b);
		//cerr<<i-w<<" "<<n-i-b<<endl;
		ans=min(ans,cnt);
		//加算処理
		if(i!=n)
		{
			if(s[i]=='#')
				b--;
			else
				w++;
		}

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

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<int,P> PP;

vector<PP> v;
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;

int main()
{
	int n,k,q;
	cin >> n >> k >> q;
	int men[n+1] ={0};
	rep(i,q){
		int a;
		cin >> a;
		men[a-1]++;
	}
	rep(i,n){
		int ans = k - q + men[i];
		//cout << ans << " " << men[i] << endl;
		cout << (ans<=0?"No":"Yes") << endl;
	}
	
	
	return 0;
}


Measured memory_bytes: 1024
#include<stdio.h>

int main(void){
  int n,a;
  int nissu = 0;
  
  scanf("%d",&n);
  scanf("%d",&a);
  
  int kadai[a];
  
  for(int i=0; i<a; i++){
    scanf("%d",&kadai[i]);
    nissu += kadai[i];
  }
  if(n-nissu < 0)
    printf("-1");
  else
    printf("%d",n-nissu);
  return 0;
}

Measured memory_bytes: 1708
from sys import stdout
printn = lambda x: stdout.write(str(x))
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

a,b = inm()
c = [ ['#']*50 for i in range(45) ]
c.extend([ ['.']*50 for i in range(45) ])
for z in range(a-1):
    c[(z//25)*2][(z%25)*2] = '.'
for z in range(b-1):
    c[(z//25)*2+50][(z%25)*2] = '#'
print('90 50')
for i in range(90):
    print(''.join(c[i]))


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

#define int long long

#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,x,...) x
#define REP1(i, s, cond, cal) for (signed i = signed(s); i cond; i cal)
#define REP2(i, s, n) REP1(i, s, < signed(n), ++)
#define REP3(i, n) REP2(i, 0, n)
#define rep(...) CHOOSE((__VA_ARGS__,REP1,REP2,REP3))(__VA_ARGS__)
#define rrep(i, s) rep(i, s, >= 0, --)

#define all(c) begin(c), end(c)

#define X first
#define Y second

using VV = vector<vector<int>>;
using V = vector<int>;
using P = pair<int, int>;
using IP = pair<int, P>;

template<typename T>
inline void input(vector<T>& v) { for (auto& x : v) cin >> x; }

signed main() {
	int n; cin >> n;
	cout << n *(n + 1) / 2 << endl;
	system("pause");
}

Measured memory_bytes: 504
#include <bits/stdc++.h>
#include <sys/types.h>
#include <unistd.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

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

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

template<typename T> vector<T> make_vector(size_t sz){
	return vector<T>(sz);
}

template<typename T,typename... Ts> 
auto make_vector(size_t sz, Ts... ts){
	return vector<decltype(make_vector<T>(ts...))>(sz, make_vector<T>(ts...));
}

template<typename T,typename U,typename... V> 
typename enable_if<is_same<T, U>::value!=0>::type 
fill_value(U &u, const V... v){
	u=U(v...);
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_value(U &u, const V... v){
	for(auto &e:u){
		fill_value<T>(e,v...);
	}
}

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

const pid_t pid = getpid();
// Problem Specific Parameter:

int main(void){
	int n;
	cin >> n;
	vector<ll> a(n);
	rep(i, n) cin >> a[i];
	const ll total = accumulate(begin(a), end(a), 0LL);

	ll ans = 1LL << 60;

	ll cur = 0LL;
	rep(i, n) {
		cur += a[i];
		chmin(ans, abs(cur - (total - cur)));
	}

	cout << ans << endl;

	return 0;
}

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

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                // 読み込み
                int N;
                int.TryParse(Console.ReadLine(), out N);

                // 読み込み
                string hString = Console.ReadLine();
                List<int> h = hString.Split(' ').Select(n => int.Parse(n)).ToList();

                // DPテーブル宣言
                List<int> dpTable = Enumerable.Repeat(int.MaxValue, N).ToList();
                dpTable[0] = 0;
                dpTable[1] = Math.Abs(h[1] - h[0]);

                for (int i = 2; i < N; i++)
                {
                    // i-1からiに移る際のコスト加算
                    dpTable[i] = dpTable[i - 1] + Math.Abs(h[i] - h[i - 1]);
                    // i-2からiに移る際のコスト加算
                    //　比較してより低いほうを採用する
                    if (Calc.ChangeMin<int>(dpTable[i], dpTable[i - 2] + Math.Abs(h[i] - h[i - 2])))
                        dpTable[i] = dpTable[i - 2] + Math.Abs(h[i] - h[i - 2]);
                }
                Console.WriteLine(dpTable.Last());
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
    }

    public static class Calc
    {
        public static bool ChangeMin<T>(T a, T b) where T : IComparable
        {
            return a.CompareTo(b) > 0 ? true : false;
        }
    }
}

Measured memory_bytes: 24800
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	for (string r, a; cin >> r >> a&&r != "0";) {
		int hit = 0, blow = 0;
		rep(i, 0, 4) {
			if (r[i] == a[i])hit++;
			else {
				if (r.find(a[i]) != string::npos)blow++;
			}
		}
		cout << hit << " " << blow << endl;
	}
	return 0;
}

Measured memory_bytes: 3128
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cinttypes>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<string>
#include<stack>


#define FSCNd64 "%" SCNd64
#define FPRId64 "%" PRId64

using namespace std;

using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int,int>;
using vll=vector<ll>;
using vvll=vector<vll>;
using vpii=vector<pii>;

#define PI 3.1415926535897932384626433832795

template<typename X>
bool max_u(X&m, X v)
{
	if(m<v)
	{
		m=v;
		return true;
	}
	return false;
}


template<typename X>
bool min_u(X&m, X v)
{
	if(m>v)
	{
		m=v;
		return true;
	}
	return false;
}


struct solve
{
	solve(){}
	ll operator()() {
		return 0;
	}
};

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

	for(;;)
	{
		int d, t, s;
		cin >> d >> t >> s;
		if(cin.fail()) break;
		bool ans=(t*s>=d);
		cout << (ans?"Yes":"No") << "\n";
	}
	return 0;
}


Measured memory_bytes: 3644
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int> v(N);

    for (size_t i = 0; i < N; i++)
    {
        cin >> v[i];
    }

    sort(v.begin(), v.end());

    float ans = v[0];;
    for (size_t i = 1; i < N; i++)
    {
        ans += v[i];
        ans /= 2;
    }
    cout << ans << endl;
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n, a, b, c;
    cin >> n >> a >> b >> c;
    int l[n];
    rep(i, 0, n) cin >> l[i];

    int ans = 1000000000;
    for (int i = 1; i < (1 << n); i++) {
        int sum_a = 0;
        int mp_a = 0;
        bool used_a[n] = {};
        for (int j = 0; j < n; j++) {
            if (i & (1 << j)) {
                if (sum_a != 0) mp_a += 10;
                sum_a += l[j];
                used_a[j] = true;
            }
        }

        for (int k = 1; k < (1 << n); k++) {
            int sum_b = 0;
            int mp_b = 0;
            bool used_b[n] = {};
            for (int m = 0; m < n; m++) {
                if (k & (1 << m) && !used_a[m]) {
                    if (sum_b != 0) mp_b += 10;
                    sum_b += l[m];
                    used_b[m] = true;
                }
            }

            for (int p = 1; p < (1 << n); p++) {
                int sum_c = 0;
                int mp_c = 0;
                for (int q = 0; q < n; q++) {
                    if (p & (1 << q) && !used_a[q] && !used_b[q]) {
                        if (sum_c != 0) mp_c += 10;
                        sum_c += l[q];
                    }
                }

                if (!sum_b || !sum_c) continue;
                int mpsum = 0;
                mpsum += (mp_a + mp_b + mp_c);
                mpsum += (abs(sum_a - a) + abs(sum_b - b) + abs(sum_c -c));
                ans = min(ans, mpsum);
            }

        }


    }

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


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

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

  stack<int> sknCal;
  string sCal;
  
  while (cin >> sCal)
  {
    if (sCal == "+" || sCal == "-" || sCal == "*")
    {
      int nNum1 = sknCal.top(); sknCal.pop();
      int nNum2 = sknCal.top(); sknCal.pop();
      int nRes;
      if      (sCal == "+")
        nRes = nNum2 + nNum1;
      else if (sCal == "-")
        nRes = nNum2 - nNum1;
      else if (sCal == "*")
        nRes = nNum2 * nNum1;
      else;
      
      sknCal.push(nRes);
    }
    else
    {
      int nNum = stoi(sCal);
      sknCal.push(nNum);
    }
  }

  cout << sknCal.top() << endl;
  sknCal.pop();

  return 0;
}


Measured memory_bytes: 3228
#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll INF = 987654321;


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

  vector<ll> a;
  vector<ll> b;
  for(int i = 0 ; i < N ; i++) {
    ll x;
    cin >> x;
    a.pb(x);
  }
  for(int i = 0 ; i < M ; i++) {
    ll x;
    cin >> x;
    b.pb(x);
  }

  vector<ll> psum1;
  vector<ll> psum2;
  psum1.pb(0);
  psum1.pb(a[0]);
  psum2.pb(0);
  psum2.pb(b[0]);

  for(int i = 1 ; i < a.size() ; i++) {
    psum1.pb(psum1[i] + a[i]);
  }

  for(int i = 1 ; i < b.size() ; i++) {
    psum2.pb(psum2[i] + b[i]);
  }
  ll ans = 0;
  for(int i = 0 ; i < psum1.size() ; i++) {
    ll cur = psum1[i];
    if(K - cur < 0) continue;
    ll idx = upper_bound(psum2.begin(), psum2.end(), K - cur) - psum2.begin();
    ans = max(ans, (idx - 1) + i);
  }
  cout << ans << endl;
} 

Measured memory_bytes: 11024
using System;

namespace B_010_51
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            new Logic_A().Start();//

        }

        public class Logic_A
        {
            public void Start()
            {
                var str = Console.ReadLine().Replace(",", " ");
                Console.WriteLine(str);
            }
        }
    }
}

Measured memory_bytes: 11092
from sys import stdin
import math
import fractions
from collections import deque
import itertools

INF = 10 ** 10

# N個のスイッチとM個の電球
N, M = [int(x) for x in stdin.readline().rstrip().split()]
ks =  [list(map(int, stdin.readline().rstrip().split())) for _ in range(M)]
p = [int(x) for x in stdin.readline().rstrip().split()] # 0 or 1

# on:1 off;0
nums = [0, 1]
data = list(itertools.product(nums, repeat=N))

ans = 0

for d in data:
    result = True
    for i in range(M):
        k = ks[i][0]
        s = ks[i][1:]

        count = 0
        for ss in s:
            count += d[ss-1]

        if count % 2 != p[i]:
            result = False
            break
    
    if result:
        ans += 1
        
print(ans)

Measured memory_bytes: 67820
int main(void){
  int n,i,x;
  scanf("%d",&n);

  for(i=1;i<=n;i++){
    x=i;
    if ( x % 3 == 0 ){
      printf(" %d",i);
    }else{
      do{
        if ( x % 10 == 3 ){
          printf(" %d",i);
          x=0;
        }
        x /= 10;
      }while( x );
    }
  }
  printf("\n");
  return 0;
}


Measured memory_bytes: 2104
#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
#define rep(i, n) for(int i=0; i<n; i++)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define SORT(x) sort(x.begin(), x.end())
#define GSORT(x) sort(x.begin(), x.end(), greater<int>())
#define mk make_pair
#define fi first
#define se second
#define pb push_back
#define ALL(x) x.begin(), x.end()
#define V(T) vector<T>
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> vi;
typedef vector<vi> vvi;
int max(int a, int b) {if(b>a) return b; else return a;}
int min(int a, int b) {if(b<a) return b; else return a;}


signed main() {
    int x, a, b;
    cin >> x >> a >> b;

    int ad = abs(x-a), bd = abs(x-b);

    if(ad < bd) cout << "A";
    else cout << "B";

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
//#include <bits/stdc++.h>

#define ll unsigned long long int
#define pb push_back
#define llu unsigned long long int
#define fo(i,n) for(int i=0;i<n;i++)
#define eb emplace_back
#define M 1000000007
#define vi vector<int>
#define vlli vector<lli>
#define pi pair<int,int>
#define mp make_pair
#define mapi map<int,int>

using namespace std;
ll max(ll x,ll y)
{
	if(x>y)
		return x;
	return y;
}
ll min(ll x,ll y)
{
	if(x<y)
		return x;
	return y;
}
int main()
{
	ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //cin.ignore(numeric_limits<streamsize>::max(),'\n');
    //const unsigned ll M=1000000007;
	//cout << lol;
  	int n;
  	cin >> n;
  	ll count=0;
  	int a[n+1];
  a[0] = 0;
  	for(int i=1;i<=n;i++)
  	{
  		cin >> a[i];
		if(i%2 == 1 && a[i]%2 == 1) count++;	
	}
	cout << count;
    return 0;
}



Measured memory_bytes: 3604
// mod custom_lib;

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 r = read::<u32>();
  let d = read::<u32>();
  let x2000 = read::<u32>();

  let mut prev = x2000;
  for _ in 0..10 {
    prev = r * prev - d;
    println!("{}", prev);
  }
}


Measured memory_bytes: 4352
#include<cstdio>
#include<algorithm>
using namespace std;
int a[4][4];
bool p;
int main()
{
	for (int i=1;i<=3;i++)
		for (int j=1;j<=3;j++)
		{
			scanf("%d",&a[i][j]);
		}
	for (int j=2;j<=3;j++)
		if (a[1][j]-a[1][j-1]==a[2][j]-a[2][j-1]&&a[3][j]-a[3][j-1]==a[2][j]-a[2][j-1]&&a[j][2]-a[j-1][2]==a[j][3]-a[j-1][3]&&a[j][1]-a[j-1][1]==a[j][2]-a[j-1][2]) continue;
		else {printf("No");return 0;}
	printf("Yes");
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;

main() {
    int64_t n, m;
    cin >> n >> m;

    priority_queue<int64_t> q;
    for (auto _ : irange(0L, n)) {
        int64_t a;
        cin >> a;
        q.push(a);
    }

    for (auto _ : irange(0L, m)) {
        auto p = q.top();
        q.pop();

        q.push(p / 2);
    }

    int64_t ans = 0;
    while (!q.empty()) {
        ans += q.top();
        q.pop();
    }

    cout << ans << endl;
}

Measured memory_bytes: 1400
#include <cstdio>
#include <algorithm>

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

int d = 1;
bool D[10001];
int H[10001], topo[10001];
pair<int, int> E[20002];
void dfs(int A) {
	if (!D[A]) {
		D[A] = true;
		topo[A] = d;
		d++;
		for (int i = H[A]; i; i = E[i].second) {
			dfs(E[i].first);
		}
	}
}

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 8 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

int main() {


	int N = getint();
	for (int i = 2; i < 2 * N; i += 2) {
		int a = getint(), b = getint();
		E[i] = mp(a, H[b]);
		H[b] = i;
		E[i + 1] = mp(b, H[a]);
		H[a] = i + 1;
	}

	int C[10000];
	int goukei = 0;
	rep(i, N) {
		C[i] = getint();
		goukei += C[i];
	}
	sort(C, C + N);

	dfs(1);

	const int dm = 1 << 17;
	char dn[dm], * di = dn;
	int X = goukei - C[N - 1];
	int keta = 0;
	char c[10];
	while (X) {
		*(c + keta) = '0' + X % 10;
		X /= 10;
		keta++;
	}
	for (int i = keta - 1; i >= 0; i--)* di++ = (*(c + i));
	*di++ = '\n';
	rep1(i, N) {
		X = C[N - topo[i]];
		keta = 0;
		while (X) {
			*(c + keta) = '0' + X % 10;
			X /= 10;
			keta++;
		}
		for (int i = keta - 1; i >= 0; i--)* di++ = (*(c + i));
		*di++ = ' ';
	}

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

	Would you please return 0;
}

Measured memory_bytes: 896
#include<iostream>
#include<bits/stdc++.h>
#include<iomanip>
#include<math.h>
#include<vector>
#include<cctype>
#include<string>
#include<set>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
std::string line;
typedef long long ll;

int main(){

   int a,b;
   cin >> a >> b;

   if(a==b) cout << "Draw" << endl;
   else if( a == 1) cout << "Alice" << endl;
   else if( b == 1) cout << "Bob" << endl;
   else if( a > b) cout << "Alice" << endl;
   else cout << "Bob" << endl;


   return 0;
}

Measured memory_bytes: 256
(defun solver ()
  (let* ((N (read)) (Time (read))
         (array (make-array N :fill-pointer 0))
         (sum 0))
    (do ((i 0 (incf i))) ((= i N))
        (vector-push (read) array))
    (do ((j 1 (incf j))) ((= j N) (format t "~A~%" (+ sum Time)))
        (let ((diff (- (aref array j) (aref array (1- j)))))
          (if (> diff Time)
              (incf sum Time)
              (incf sum diff))))))

(solver)

Measured memory_bytes: 59752
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
 
int main() {
  ll d,n;
  cin >> d >> n;
  ll ans;
  if(n==100){
    ans=pow(100,d)*101;
  }
  else
  {
    ans=pow(100,d)*n;
  }
  

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

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

// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define INF         INT_MAX/3
#define LLINF       LLONG_MAX/3
#define MOD         (1000000007LL)
#define MODA(a, b)  a=((a)+(b))%MOD
#define MODP(a, b)  a=((a)*(b))%MOD
#define inc(i, l, r)   for(int i=(l);i<(r);i++)
#define dec(i, l, r)   for(int i=(r)-1;i>=(l);i--)
#define pb          push_back
#define se          second
#define fi          first
#define mset(a, b)  memset(a, b, sizeof(a))

using LL  = long long;
using G   = vector<vector<int>>;

int di[] = {0, -1, 0, 1};
int dj[] = {1, 0, -1, 0};
// }}}

int main() {
    cin.tie(0);ios::sync_with_stdio(false);
    int n;cin >> n;
    int k;cin >> k;
    vector<LL> a(n);
    inc(i, 0, n) cin >> a[i];
    vector<LL> v, aa(n+1);
    aa[0] = 0;
    inc(i, 0, n){
        aa[i+1] = aa[i] + a[i];
    }
    inc(i, 0, n){
        inc(j, i, n){
            v.pb(aa[j+1]-aa[i]);
        }
    }

    dec(i, 0, 64){
        vector<LL> tmp;
        for(auto vv : v) {
            if(vv & (1LL << i)){
                tmp.pb(vv);
            }
        }
        if(tmp.size() < k) continue;
        v = tmp;
    }

    LL ans = v[0];
    for(auto vv : v) {
        ans &= vv;
    }

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


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

int main(){
  
  char a, b, c;
  
  cin >> a >> b >> c;
  
  if (a == '7'){
    cout << "Yes" << endl;
  }
   else if (b == '7'){
    cout << "Yes" << endl;
  }
   else if (c == '7'){
    cout << "Yes" << endl;
  }
  
  else cout << "No" <<endl;
}

Measured memory_bytes: 3584