akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

#define MOD 1000000007
#define MOD2 998244353
#define int long long
#define EPS 1e-9
//#define PI 3.14159265358979

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

using namespace std;

template < typename T >
ostream &operator<<(ostream &os, const vector< T > &A) {
	for (int i = 0; i < A.size(); i++)
		os << A[i] << " ";
	os << endl;
	return os;
}
template <>
ostream &operator<<(ostream &os, const vector< vector< int > > &A) {
	int N = A.size();
	int M;
	if (N > 0)
		M = A[0].size();
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < M; j++)
			os << A[i][j] << " ";
		os << endl;
	}
	return os;
}

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

struct edge {
	int from, to, d, c;
	edge(int _from = 0, int _to = 0, int _d = 0, int _c = 0) {
		from = _from;
		to = _to;
		d = _d;
		c = _c;
	}
	bool operator<(const edge &rhs) const {
		return (d == rhs.d) ? (c < rhs.c) : (d < rhs.d);
	}
};
struct aabb {
	int x1, y1, x2, y2;
	aabb(int x1, int y1, int x2, int y2) : x1(x1), y1(y1), x2(x2), y2(y2) {}
};

typedef vector< edge > edges;
typedef vector< edges > graph;
struct flow {
	int to, cap, rev, cost;
	flow(int to = 0, int cap = 0, int rev = 0, int cost = 0) : to(to), cap(cap), rev(rev), cost(cost) {}
};
typedef vector< vector< flow > > flows;

const int di[4] = {0, -1, 0, 1};
const int dj[4] = {-1, 0, 1, 0};
const int ci[5] = {0, 0, -1, 0, 1};
const int cj[5] = {0, -1, 0, 1, 0};
const ll LINF = LLONG_MAX / 2;
const int INF = INT_MAX / 2;
const double PI = acos(-1);

int pow2(int n) { return 1LL << n; }
template < typename T, typename U >
bool chmin(T &x, const U &y) {
	if (x > y) {
		x = y;
		return true;
	}
	return false;
}
template < typename T, typename U >
bool chmax(T &x, const U &y) {
	if (x < y) {
		x = y;
		return true;
	}
	return false;
}

struct initializer {
	initializer() {
		cout << fixed << setprecision(20);
	}
};
initializer _____;

int N, M, K, T, Q, H, W;
int dfs(vector< vector< int > > &G, vector< int > &done, int x, int &h, int &w) {
	done[x] = 1;
	if (x >= 1e5 + 2) {
		h++;
	} else {
		w++;
	}
	int ret = 0;
	for (auto j : G[x]) {
		ret++;
		if (done[j])
			continue;
		ret += dfs(G, done, j, h, w);
	}
	return ret;
}
signed main() {
	cin >> N;
	vector< vector< int > > G(2e5 + 10);
	rep(i, N) {
		int x, y;
		cin >> x >> y;
		G[x].push_back(y + 1e5 + 2);
		G[y + 1e5 + 2].push_back(x);
	}
	int ans = 0;
	vector< int > done(2e5 + 10, 0);
	rep(i, done.size()) if (!done[i]) {
		int h = 0, w = 0;
		int c = dfs(G, done, i, h, w) / 2;
		if (h > 1 && w > 1) {
			ans += h * w - c;
		}
	}
	cout << ans << endl;
	return 0;
}

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


using namespace std;


typedef long long ll;

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

  char g[r+1][c+1];
  for(int i=1;i<=r;i++)
    for(int j=1;j<=c;j++)
      cin>>g[i][j];

  for(int i=1;i<=r;i++){
    for(int j=1;j<=c;j++){
      if(g[i][j]=='#') {

        int cnt=0;
        if(i-1>=1&&g[i-1][j]=='#') cnt++;
        if(i+1<=r&&g[i+1][j]=='#') cnt++;
        if(j-1>=1&&g[i][j-1]=='#') cnt++;
        if(j+1<=c&&g[i][j+1]=='#') cnt++;

        if(cnt==0){
          cout<<"No"<<endl;
          return 0;
        }

      }
    }
  }
  cout<<"Yes"<<endl;

  return 0;
}


Measured memory_bytes: 256
// warm heart, wagging tail,and a smile just for you!
//
//                            ▒█████▒▒
//                             ██████████▒
//                             ▒████████████▒
//                            ██████████████████
//                           ████████████████████▒
//                          ▒██████████████████████▒
//                          ▒███████████████████████
//                      ▒████▒▒▒▒▒▒█████████████████▒
//                    ███▒▒▒▒▒▒██████████████████████▒▒▒
//                  ▒██▒▒███████████████████████▒▒▒▒▒██████
//                 ▒█████████████████████████▒▒▒▒▒▒█████████▒
//                 ▒█████████████████████▒▒▒▒▒▒██████████████
//                  ▒████         ████▒▒▒▒▒████         ████▒
//              ▒█████▒    ████    ▒▒▒▒███████    ████    ██████▒
//            ▒██▒▒▒▒▒    ██████    █████████    ██████    ██▒▒▒██▒
//           █████████   ████████   █████████   ████████   ▒▒▒▒█████
//          ▒█████████    ██████    ████████▒    ██████    █████████
//          ▒██████████    ████    █████▒▒▒▒▒▒    ████    ██████████
//           ████████████        ▒▒▒▒▒▒▒████████        ███████████▒
//       ▒██████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒███████████████████████████████████▒
//     ███▒▒▒▒▒▒▒▒▒▒▒▒█████████████████████████████████████████▒▒████████▒
//   ▒▒▒▒▒▒▒▒▒██████████████                         ███████▒▒▒▒███████████
//   █████████████████████████                     ███████▒▒▒██████████████▒
//   █████████████████████████████             ███████▒▒▒██████████████████▒
//   ██████████████████████████████████████████████████████████████████████
//    ██████████████████████████████████████████████████████████████████▒
//      ▒█████████████████▒▒▒▒▒▒▒██████████████████████████████████▒▒▒
//
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
const double EPS = 1e-9;
#define INF (1LL<<60)
#define D double
#define fs first
#define sc second
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for(int i = (b-1);i>=(a);--i)
#define REP(i,n)  FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " << 
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

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

  int n;
  cin >> n;

  vector<D> a(n);
  REP(i,n) cin >> a[i];
  
  D tmp = 0;
  REP(i,n) tmp += (D)1/a[i];

  cout << fixed << setprecision(12) << (D)1/tmp << endl;

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)

int n,m,a[1000];

map<int,int> c;

int main() {
    while(true) {
        cin >> n >> m;
        if(n == 0)break;
        rep(i,n){
            cin >> a[i];
            c[a[i]] = 0;
        }
        rep(i,n) {
            c[a[i]]++;
        }
        sort(a,a+n);//aをソート

        int ans = -1;
        rep(i,n) {
            auto itr = upper_bound(a,a+n,m - a[i]);//m-a[i]<a[j] となる最小のjのa[j]へのポインタを取得
            if(itr - a == 0) {//m - a[i]>=a[j]を満たすjが存在しない時
                continue;
            }
            itr--;//ポインタを一つ減算してm-a[i]>=a[j]となる最大のjのa[j]へのポインタを取得
            if(*itr == a[i] && c[a[i]] < 2) {//境界のものがa[i]だった時
                if(itr - a == 0) {//a[i]未満のものがない時
                    continue;
                }
                itr--;//さらに一つ前に
            }
            ans = max(ans,*itr + a[i]);
        }
        if(ans == -1)cout << "NONE" << endl;
        else cout << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 3636
a,b,c = map(int,input().split())
num = 0
n = []
n.append(a)
n.append(b)
n.append(c)
n.sort()
mini = min(n)
n.remove(min(n))
num += (n[0] -mini)
num += (n[1] - n[0])
print(num)


Measured memory_bytes: 3060
#include <iostream>

int main() {
    int N;
    std::cin >> N;

    int odd = 0;
    for (int i = 0; i < N; ++i) {
        int A;
        std::cin >> A;
        odd += A % 2;
    }

    std::cout << (odd % 2 == 0 ? "YES" : "NO") << std::endl;
    return 0;
}


Measured memory_bytes: 256
N, M = map(int, input().split())
bs = [tuple(map(int, input().split())) for _ in range(M)]
bs.sort(key=lambda x: x[1])

rbs = []
for a, b in bs:
    if not rbs or a > rbs[-1]:
        rbs.append(b - 1)
ans = len(rbs)
print(ans)

Measured memory_bytes: 18244
#include <bits/stdc++.h>
#include <iostream>
#include <vector>

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

using namespace std;

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

template<class T>
bool chmix(T& a, const T& b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

#define ALL(x) (x).begin(), (x).end()
template<class T>
using vc = vector<T>;
using vi = vc<int>;
using vvi = vc<vi>;

using ll = long long;


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

    int p_taro   = 0;
    int p_hanako = 0;

    REP(i, n) {
        string s_taro, s_hanako;
        cin >> s_taro >> s_hanako;
        if (s_taro == s_hanako){
            p_taro += 1;
            p_hanako += 1;
        }
        else if (s_taro > s_hanako) p_taro += 3;
        else p_hanako += 3;
    }

    cout << p_taro << " " << p_hanako << "\n";

    return 0;
}



Measured memory_bytes: 3204
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define pb push_back
#define sz(x) ((int)x.size())

//https://github.com/kth-competitive-programming/kactl/blob/master/content/data-structures/LineContainer.h
struct Line {
	mutable int m, c, p;
	bool operator<(const Line& o) const { return m < o.m; }
	bool operator<(int x) const { return p < x; }
};

struct convexHullDynamic : multiset<Line, less<>> {
	// (for doubles, use inf = 1/.0, floorDivision(a,b) = a/b)
	const int inf = LLONG_MAX;
	int floorDivision(int a, int b) { // floored floorDivisionision
		return a / b - ((a ^ b) < 0 && a % b); }
	bool intersect(iterator x, iterator y) {
		if (y == end()) { x->p = inf; return false; }
		if (x->m == y->m) x->p = x->c > y->c ? inf : -inf;
		else x->p = floorDivision(y->c - x->c, x->m - y->m);
		return x->p >= y->p;
	}
	void addLine(int m, int c) {
		auto z = insert({m, c, 0}), y = z++, x = y;
		while (intersect(y, z)) z = erase(z);
		if (x != begin() && intersect(--x, y)) intersect(x, y = erase(y));
		while ((y = x) != begin() && (--x)->p >= y->p)
			intersect(x, erase(y));
	}
	int query(int x) {
		assert(!empty());
		auto l = *lower_bound(x);
		return l.m * x + l.c;
	}
};

int32_t main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    convexHullDynamic cht;
    cht.addLine(0, 0);
    int n, c;
    cin >> n >> c;
    for(int i = 0; i < n; i++)
    {
        int h;
        cin >> h;
        int mncost = (i==0) ? 0LL : (-(cht.query(h)) + c + h*h);
        if(i == n-1)
            cout << mncost << endl;
        else
            cht.addLine(2*h, -(mncost + h*h));
    }
}

Measured memory_bytes: 16000
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:https://atcoder.jp/contests/abc157/tasks/abc157_c>
 問題文============================================================
 C - Guess The Number
 =================================================================
 解説=============================================================
 
 
 https://atcoder.jp/contests/abc157/submissions/11575630
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    int N,M; cin >> N >> M;
    map<int,int> mp;
    for(int i = 0; i < M;i++){
        int s,c; cin >> s >> c;
        s--;
        if(mp.count(s)){
            if(mp[s] != c) return -1;
        }else{
            mp[s] = c;
        }
    }
    string ans(N,'0');
    if(N != 1) ans[0] = '1';
    
    for(int i = 0; i < N;i++){
        if(mp.count(i)){
            ans[i] = mp[i] + '0';
        }
    }
    
    res = atol(ans.c_str());
    
    if(to_string(res).length() != N) return -1;
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
#define Test(tt) cout << "Case #" << tt << ": "

using namespace std;

int cnt[100][100];

int main() {
#ifdef HOME
    ifstream cin("A.in");
    ofstream cout("A.out");
#endif
    int i, n;
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);

   	
    cin >> n;

    ll ans = 0;
    for(i = 0; i < n; i++) {
    	string str;
    	cin >> str;

    	int sz = (int)str.size();

    	ll value = 0;
    	int pos = 0;

    	while(pos < sz && str[pos] != '.') {
    		value = value * 10 + str[pos] - '0';
    		pos++;
    	}
    	pos++;
    	for(int j = 0; j < 9; j++) {
    		value = value * 10;
    		if(pos < sz) {
    			value += str[pos] - '0';
    		}
    		pos++;
    	}

    	if(value % (int)1e9 == 0) {
    		ans--;
    	}

    	int cnt2 = 0, cnt5 = 0;
    	while(value % 2 == 0) {
    		cnt2++;
    		value /= 2;
    	}
    	while(value % 5 == 0) {
    		cnt5++;
    		value /= 5;
    	}
    	cnt[cnt2][cnt5]++;
    }

    for(int a = 0; a < 100; a++) {
    	for(int b = 0; b < 100; b++) {
    		if(cnt[a][b] == 0) continue;

    		for(int c = 0; c < 100; c++) {
    			for(int d = 0; d < 100; d++) {
    				if(min(a + c, b + d) >= 18)
    					ans += 1LL * cnt[a][b] * cnt[c][d];
    			}
    		}
    	}
    }

    cout << ans / 2;
   	
    return 0;
}

Measured memory_bytes: 3588
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>

//#include <tuple>

//#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long
#define pb push_back

int main() {
  int N;
  cin >> N;
  vector<int> h(N);
  int max_n = 0, cnt = 0, next_max = 0;
  rep(i, N){
    cin >> h[i];
    if (h[i] >= max_n){
      next_max = max_n;
      max_n = h[i];
    } else if (h[i] >= next_max){
      next_max = h[i];
    }

  }
  // 要素が１個だった時
  if (next_max==0){
    next_max = h[0];
  }

  rep(i, N){
    if (max_n!= h[i]){
      cout << max_n << endl;
    } else {
      cout << next_max << endl;
    }
  }  

}


Measured memory_bytes: 2432
#include<stdio.h>
int main()
{
	int a,b=0;
	scanf("%d",&a);
	if(a/100==9){
		b+=100;
		a-=900;
	}
	else{
		b+=900;
		a-=100;
	}
	if(a/10==9){
		b+=10;
		a-=90;
	}
	else{
		b+=90;
		a-=10;
	}
	if(a==9) b+=1;
	else b+=9;
	printf("%d\n",b);
}

Measured memory_bytes: 128
import itertools


def sum_split_num(num, idxs):
    idxs.insert(0, 0)
    idxs.append(len(num))
    return sum(int(num[idxs[i]:idxs[i+1]]) for i in range(len(idxs)-1))


S = input()
ans = int(S)
all_idxs = list(range(1, len(S)))
for i in range(1, len(S)):
    for idxs in itertools.combinations(all_idxs, i):
        ans += sum_split_num(S, list(idxs))
print(ans)


Measured memory_bytes: 3064
<?php
  
$input = explode(" ", fgets(STDIN));
$A = (int)$input[0];
$B = (int)$input[1];
$C = (int)$input[2];

$remain;

if($C - ($A - $B) > 0){
  $remain = $C - ($A - $B);
}elseif($C - ($A - $B) <= 0){
  $remain = 0;
}

echo $remain;


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

#define REPI(i, n) for(int i = 0; i < n; i++)
#define REPJ(j, n) for(int j = 0; j < n; j++)

using ll = long long;
using namespace std;

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

    int n, k; cin >> n >> k;

    cout << k * (int)pow(k - 1, n - 1);
}


Measured memory_bytes: 512
n =int(input())
t,a =map(int ,input().split())
h =list(map(int ,input().split()))
old_k =100000
for i in range(n):
    k = abs(a-(t-h[i]*0.006))
    if old_k > k:
        old_k =k
        count =i+1
print(count)

Measured memory_bytes: 3060
#include <stdio.h> 
 int main(void){ 
     int i, n; 
     int arr[100]; 
     scanf("%d", &n); 
     for(i=0;i<n;i++){ 
         scanf(" %d", &arr[i]); 
     } 
     for(i=0;i<n;i++){ 
         if(i)printf(" "); 
         printf("%d", arr[n-i-1]); 
     } 
     printf("\n"); 
     return 0; 
 } 


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

using namespace std;

using ll = long long;



int main(){
  int N;
  cin >> N;
  vector<int> d(N);
    
  for(int i=0; i<N; i++) cin >> d[i];
  
  int ans = 0;
  for(int i=0; i<N-1; i++){
    for(int j=i+1; j<N; j++)
      ans += d[i]*d[j];
  }
  
  cout << ans << endl;
  
  
  return 0;
}

Measured memory_bytes: 3596
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = 1e9 + 7;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    int ans = 0;
    while(n)
    {
        n = (n>>1);
        ans++;
    }
    cout << ans << endl;
    return 0;
}




Measured memory_bytes: 3196
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
ll mod = 1000000007;
ll INF = 1000000099;



signed main(){
    ll n,k,ans=0;
    cin>>n>>k;
    vector<ll> v(n);
    for(int i=0;i < n;i++)
    {
        cin>>v.at(i);
    }

    for(int i=0;i <= min(n,k);i++)
    {
        for(int j=0;j+i <= min(n,k);j++)
        {
            priority_queue<ll> q;
            ll sub=0;

            for(int a=0;a < i;a++)
            {
                q.push(-v.at(a));
                sub+=v.at(a);
            }
            for(int b=0;b < j;b++)
            {
                q.push(-v.at(n-1-b));
                sub+=v.at(n-1-b);
            }
            ans=max(ans,sub);
            for(int c=0;c < k-i-j && !q.empty();c++)
            {
                sub+=q.top();
                q.pop();
                ans=max(ans,sub);
            }
            
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

bool f[100001];
int c[100002];
int Q, L, R;

int main(void) {
    for (int i = 2; i <= 100000; ++i) {
        if (!f[i]) {
            for (int j = i + i; j <= 100000; j += i) {
                f[j] = true;
            }
        }
    }
    for (int i = 3; i <= 100000; i += 2) {
        if (!f[i] && !f[(i + 1) / 2]) {
            c[i]++;
        }
    }
    for (int i = 3; i <= 100000; ++i) {
        c[i] += c[i - 1];
    }
    cin >> Q;
    for (int i = 0; i < Q; ++i) {
        cin >> L >> R;
        cout << c[R] - c[L - 1] << endl;
    }
    return 0;
}

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())
#define rsort(v) sort(all(v)); reverse(all(v))

using namespace std;

using i32 = int;
using i64 = long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template<typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template<typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template<typename T> inline void amax(T &x, T y) { if (x >= y) x = y; }
template<typename T> inline void amin(T &x, T y) { if (x <= y) x = y; }
template<typename T> inline T power(T x, i64 n) { T r = 1; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template<typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }

void solve() {
  int h, w;
  cin >> h >> w;
  vector<vector<string>> b(h, vector<string>(w, ""));
  rep(i, h) rep(j, w) cin >> b[i][j];
  rep(i, h) rep(j, w) {
    if (b[i][j] == "snuke") {
      cout << (char) ('A' + j) << i + 1 << '\n';
    }
  }
}


Measured memory_bytes: 256
n, k = map(int, input().split())
class Dice:
    def __init__(self,point,count):
        self.point = point
        self.count = count
dice = [Dice(i, 0) for i in range(1,n+1)]
p = []
for i in range(n):
 while 1<= dice[i].point <= k-1:
    dice[i].point *= 2
    dice[i].count += 1

 p.append(0.5 ** dice[i].count)

print(sum(p) / n)

Measured memory_bytes: 26732
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
using namespace std;
const int inf=2147483647,dx[]={-1,0,1,0},dy[]={0,-1,0,1};// 上 左 下 右
const int N=100005,M=1000005,mod=1000000007;
const long long llinf=9223372036854775807ll;
int n,l,r;
string s,t,a,b;
string query(int x)
{
	cout<<x<<'\n';
	fflush(stdout);
	cin>>s;
	return s;
}
int main(){
	cin>>n;
	a=query(0);
	if(a=="Vacant")
		return 0;
	b=query(n-1);
	if(b=="Vacant")
		return 0;
	l=1,r=n-2;
	while(l<=r)
	{
		int m=(l+r)>>1;
		t=query(m);
		if(t=="Vacant")
			return 0;
		if(m%2==0)
		{
			if(t==a)
				l=m+1;
			else
				r=m-1;
		}
		else if(t==b)
			l=m+1;
		else
			r=m-1;
	}
	return 0;
}

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

int main() {
    int n;
    cin >> n;
    int a[n][3];
    rep(i,n-1) cin >> a[i][0] >> a[i][1] >> a[i][2];
    int ans[n] = {};
    rep(i,n-1) {
        int t = a[i][1] + a[i][0];
        for (int station = i+1; station < n-1; station++) {
            int station_t = a[station][1];
            while (t > station_t) station_t += a[station][2];
            t = station_t + a[station][0];
        }
        ans[i] = t;
    }
    rep(i,n) {
        cout << ans[i] << endl;
    }
}

Measured memory_bytes: 256
import numpy as np
n, m, c = map(int, input().split())
b = []
a = list(map(int, input().split()))
for _ in range(n):
    tmp = list(map(int, input().split()))
    b.append(tmp)

ary_a = np.array(a)
ary_b = np.array(b)

ans = np.dot(ary_b, ary_a)
cnt = 0
for i in range(len(ans)):
    if ans[i] + c > 0:
        cnt += 1

print(cnt)


Measured memory_bytes: 12508
#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())
#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 X, Y;
    cin >> X >> Y;
    cout << (X + (Y / 2)) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
  ll n;
  cin>>n;
  ll a[n*3],bb[n+1],cc[n+1];
  bb[0]=0,cc[n]=0;
  priority_queue<ll> c;
  priority_queue<ll,vector<ll>,greater<ll>> b;
  for(int i=0;i<n*3;i++){
    cin>>a[i];
    if(i<n){
      b.push(a[i]);
      bb[0]+=a[i];
    }
    else if(i>=n*2){
      c.push(a[i]);
      cc[n]+=a[i];
    }
  }
  for(int i=1;i<=n;i++){
    b.push(a[i+n-1]);
    bb[i]=bb[i-1]+a[i+n-1]-b.top();
    b.pop();
  }
  for(int i=n-1;i>=0;i--){
    c.push(a[i+n]);
    cc[i]=cc[i+1]+a[i+n]-c.top();
    c.pop();
  }
  ll m=-10000000000000000;
  for(int i=0;i<=n;i++){
    m=max(m,bb[i]-cc[i]);
  }
  cout<<m<<endl;
}

Measured memory_bytes: 5876
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

use std::cmp;

fn main() {
    input! {
        n: usize,
        k: usize,
        costs: [i64; n],
    }

    let inf:i64 = 1 << 60;
    let mut dp = vec![inf; n];
    dp[0] = 0;

    for i in 1..n {
        for j in 0..k + 1 {
            if i >= j {
                dp[i] = cmp::min(dp[i], dp[i - j] + (costs[i - j] - costs[i]).abs());
            }
        }
    }

    println!("{}", dp[n - 1]);
}

Measured memory_bytes: 6396
#include <bits/stdc++.h>
using namespace std;
const int N=65;
const double eps=1e-9;
int n,k;
double x[N],y[N],c[N],r[N];
double dis(pair<double,double> a,pair<double,double> b) {
    return sqrt((a.first-b.first)*(a.first-b.first)+(a.second-b.second)*(a.second-b.second));
}
vector<pair<double,double> > cal(double x1,double y1,double r1,double x2,double y2,double r2) {
    x1-=x2,y1-=y2;
    double S=x1*x1+y1*y1,a=(S+r2*r2-r1*r1)/2,D=S*r2*r2-a*a;
    if(D<0) return {};
    double A1=a*x1,B1=y1*sqrt(D);
    double A2=a*y1,B2=x1*sqrt(D);
    return {{(A1+B1)/S+x2,(A2-B2)/S+y2},{(A1-B1)/S+x2,(A2+B2)/S+y2}};
}
bool check(double t) {
    for(int i=0;i<n;i++) r[i]=t/c[i];
    vector<pair<double,double> > vec;
    for(int i=0;i<n;i++) {
        vec.push_back({x[i],y[i]});
        for(int j=i+1;j<n;j++) {
            auto v=cal(x[i],y[i],r[i],x[j],y[j],r[j]);
            for(auto it:v) vec.push_back(it);
        }
    }
    for(auto it:vec) {
        int cnt=0;
        for(int i=0;i<n;i++) {
            if(r[i]+eps>=dis(it,{x[i],y[i]})) cnt++;
        }
        if(cnt>=k) return true;
    }
    return false;
}
int main() {
    //freopen("in.txt","r",stdin);
    scanf("%d%d",&n,&k);
    for(int i=0;i<n;i++) {
        scanf("%lf%lf%lf",&x[i],&y[i],&c[i]);
    }
    double L=0,R=1e9;
    for(int i=0;i<100;i++) {
        double mid=(L+R)/2;
        if(check(mid)) R=mid;
        else L=mid;
    }
    printf("%.12f\n",R);
    return 0;
}

Measured memory_bytes: 256
n, k = map(int, input().split())

d = []
a = []

for i in range(k):
    d.append(int(input()))
    a.append(list(map(int,input().split())))


okashi = [0] * n


for i in a:
    for j in i:
        okashi[j-1] = 1

ans = n - sum(okashi)

print(ans)

Measured memory_bytes: 9196
#include <cstdio>
#include <iostream>
using namespace std;
int main(){
	int h,n,x,s=0;
	cin>>h>>n;
	for(int i=1;i<=n;i++){
		cin>>x;
		s+=x;
	}
	if(s>=h)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}

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

#define vec              vector<int>
#define vecll            vector<ll>
#define vecd             vector<double>
#define vecst            vector<string>
#define vecb             vector<bool>
#define v2(v,n,m,init)   vector<vector<int>>  v(n, vector<int>(m, init))
#define vb2(v,n,m,init)  vector<vector<bool>> v(n, vector<bool>(m, init))
#define vll2(v,n,m,init) vector<vector<ll>>   v(n, vector<ll>(m, init))

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define arrst(var, n)    vecst var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define uniqueall(v)     v.erase(unique(v.begin(), v.end()), v.end());
#define pb(var)          push_back(var)
#define prt(var)         cout << (var) << "\n"
#define prtd(n, var)     cout << fixed << setprecision(n) << (var) << "\n"
#define prtfill(n, var)  cout << setw(n) << setfill('0') << (var);
#define prt2(v1, v2)     cout << (v1) << " " << (v2) << "\n"
#define prt3(v1, v2, v3) cout << (v1) << " " << (v2) << " " << (v3) << "\n"
#define prtall(v)        rep(i,v.size()){cout<<v[i]<<(i!=v.size()-1?" ":"\n");}
template <typename T>
bool chmax(T &a, const T& b){if(a<b){a=b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T& b){if(a>b){a=b; return true;} return false;}
//----------------------------------------------------------------

int main(void) {
  int n, x, t;
  cin >> n >> x >> t;
  prt(((n-1)/x+1)*t);
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
int main() {
int X;
  int t;
  cin >>X>>t;
  if (X<=t) {
cout <<0 << endl;
  }
  else if (X>t) {
cout << X-t<< endl;
  }
}

Measured memory_bytes: 256
n, m = map(int, input().split())

mod = 10**9+7
N = 10**6  # N!まで求める
fact  = [1, 1]  # 階乗の元テーブル
fact_inv = [1, 1]  # 階乗の逆元テーブル
inv = [0, 1]  # 逆元テーブル計算用テーブル 1,2,,...の逆元を求めてる

# 計算 O(1)
def comb(n, r, mod):
    if (r<0 or r>n):
        return 0
    r = min(r, n-r)
    return fact[n] * fact_inv[r] * fact_inv[n-r] % mod

def perm(n, r, mod):
    if (r<0 or r>n):
        return 0
    return fact[n] *  fact_inv[n-r] % mod

# 前処理 O(n)
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % mod)
    inv.append((-inv[mod % i] * (mod//i)) % mod)
    fact_inv.append((fact_inv[-1] * inv[-1]) % mod)

ans = 0
for k in range(n+1):
    ans += comb(n, k, mod) * perm(m, k, mod) * (perm(m-k, n-k, mod) ** 2) * ((-1) ** k)
    ans %= mod

print(ans)

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

int main() {
  long n,a,b;
  cin>>n>>a>>b;
  long cnt=n/(a+b);
  long res = n - cnt*(a+b);
  cnt *= a;
  if (res>0) cnt += min(a,res);
  cout << cnt;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
// const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
const int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

int main() {
  const int X = 18, Y = 43;
  int n; cin >> n;
  ll ans = 0;
  vector cnt(X * 2 + 1, vector(Y * 2 + 1, 0));
  while (n--) {
    string s; cin >> s;
    int pos = 0;
    while (pos < s.length() && s[pos] != '.') ++pos;
    ll num = stoll(s.substr(0, pos) + (pos < s.length() ? s.substr(pos + 1) : ""));
    int den = 1;
    FOR(_, pos + 1, s.length()) den *= 10;
    // cout << num << ' ' << den << '\n';
    int p = X, q = Y;
    while (num % 5 == 0) {
      num /= 5;
      ++p;
    }
    while (num % 2 == 0) {
      num >>= 1;
      ++q;
    }
    while (den % 5 == 0) {
      den /= 5;
      --p;
    }
    while (den % 2 == 0) {
      den >>= 1;
      --q;
    }
    ++cnt[p][q];
    // cout << p - X << ' ' << q - Y << '\n';
    if (p >= X && q >= Y) --ans;
  }
  REP(i, X * 2 + 1) REP(j, Y * 2 + 1) {
    int p = i - X, q = j - Y;
    REP(y, X * 2 + 1) REP(x, Y * 2 + 1) {
      int r = y - X, s = x - Y;
      if (p + r >= 0 && q + s >= 0) ans += 1LL * cnt[i][j] * cnt[y][x];
    }
  }
  cout << ans / 2 << '\n';
  return 0;
}


Measured memory_bytes: 3616
import scala.io.Source.stdin

object Main extends App {
  def det(a00:Double,a01:Double,a10:Double,a11:Double) = a00*a11-a01*a10

  for( i <- stdin.getLines ) {
    val Array(a,b,e,c,d,f) = i.split(" ").map(_.toDouble)
    val detA = det(a,b,c,d)
    printf("%.3f %.3f\n",det(e,b,f,d)/detA+0.0,det(a,e,c,f)/detA+0.0)
  }
}

Measured memory_bytes: 44180
s = input()
k = int(input())

sub = ["zzzzz" for i in range(k)]


def compare(sub_word):
    for i in range(len(sub)):
        #print("{} vs {}".format(sub[i], sub_word))
        if sub_word == sub[i]:
            return
        if sub_word < sub[i]:
            #print("----")
            for j in reversed(range(i, k - 1)):
                sub[j + 1] = sub[j]
            sub[i] = sub_word
            return


count = 0
for i in range(len(s)):
    for j in range(i, min(i + k, len(s))):
        compare(s[i:j + 1])
print(sub[-1])


Measured memory_bytes: 3064
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<malloc.h>

int my_gets(char *buf,int nBuf,FILE *fp){
    int ch;

    while(--nBuf >0){
        ch=getc(fp);
        if(ch==EOF || ch=='\n')
            break;
        *(buf++)=(char)ch;
    }
    *(buf)='\0';

    return nBuf;
}

int main(void){
    int A,B,C,D;

    scanf("%d %d %d %d%*c",&A,&B,&C,&D);
    printf("%d\n",(A*B>C*D)?(A*B):C*D);
    return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

class Main
{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int[] m = new int[51];
		int[] f = new int[51];
		int[] r = new int[51];
		int[] sum = new int[51];
		int i = 0;
		
		while(!(m[i]==-1 && f[i]==-1 && r[i]==-1)){
			i++;
			m[i] = scan.nextInt();
			f[i] = scan.nextInt();
			r[i] = scan.nextInt();
			sum[i] = m[i] + f[i];
		}
		
		for(int q=1; q<i; q++){
			if(m[q]==-1 || f[q]==-1){
				System.out.println("F");}
			else if(sum[q]>=80){
				System.out.println("A");}
			else if(sum[q]>=65){
				System.out.println("B");}
			else if(sum[q]>=50){
				System.out.println("C");}
			else if(sum[q]>=30){
				if(r[q]>=50){
					System.out.println("C");}
				else{
					System.out.println("D");}}
			else{
				System.out.println("F");}}
	}
}


Measured memory_bytes: 26288
#include <stdio.h>
int main(void){
    int a,b,c;
    scanf("%d %d %d\n",&a,&b,&c);
    if(a<=b&&b<=c){
        printf("%d %d %d\n",a,b,c);
    }
    else if(b<=a&&a<=c){
        printf("%d %d %d\n",b,a,c);
    }
    else if(a<=c&&c<=b){
        printf("%d %d %d\n",a,c,b);
    }
    else if(b<=c&&c<=a){
        printf("%d %d %d\n",b,c,a);
    }
    else if(c<=a&&a<=b){
        printf("%d %d %d\n",c,a,b);
    }
    else if(c<=b&&b<=a){
        printf("%d %d %d\n",c,b,a);
    }
    return 0;
}


Measured memory_bytes: 2104
#include <iostream>
#include <bits/stdc++.h> 
using namespace std;
#define MAXN 100001
int dp[MAXN][3];
int n,m,k, a[MAXN][3];
int main() {
  cin>>n;
  for(int i = 0,x; i < n; i++){
    for(int j = 0 ;j < 3; j++){
      cin>>a[i][j];
    }
  }

  dp[0][0] = a[0][0]; dp[0][1] = a[0][1]; dp[0][2] = a[0][2];
  for(int i = 0; i < n; i++){
    dp[i+1][1] = max(dp[i+1][1], dp[i][0] + a[i+1][1]);
    dp[i+1][2] = max(dp[i+1][2], dp[i][0] + a[i+1][2]);

    dp[i+1][0] = max(dp[i+1][0], dp[i][1] + a[i+1][0]);
    dp[i+1][2] = max(dp[i+1][2], dp[i][1] + a[i+1][2]);

    dp[i+1][0] = max(dp[i+1][0], dp[i][2] + a[i+1][0]);
    dp[i+1][1] = max(dp[i+1][1], dp[i][2] + a[i+1][1]);
  }
  cout<< max(max(dp[n][0], dp[n][1]), dp[n][2]);
}

Measured memory_bytes: 2560
#include<iostream>
#include<string>

using namespace std;

int main(){
 string n;
  cin >> n;
  
 int res=0;
  if(n[0]=='2') res++;
  if(n[1]=='2') res++;
  if(n[2]=='2') res++;
  if(n[3]=='2') res++;
  
  cout << res << endl;

}

Measured memory_bytes: 256
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String S = sc.next();
        
        // String[] charValue = new String[S.length()];
        
        
        for (int i = 0; i < S.length(); i++) {
            int charValue = S.charAt(i);
            if (charValue + N > 90) {
                charValue -= 26;
            }
            
            String next = String.valueOf((char)(charValue + N));
            System.out.print(next);
        }
        System.out.println();
    }
}

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

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; } 
template <typename A>
string to_string(A v) {
    bool first = true; 
    string res = "{";
    for (const auto &x : v) {
        if (!first) res += ", ";
        first = false;
        res += to_string(x);
    }
    res += "}"; 
    return res;
}
void dbg_out() { cerr << endl; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    dbg_out(T...);
}
#ifdef LOCAL
    #define dbg(...) cerr << "[" << #__VA_ARGS__ << "]:", dbg_out(__VA_ARGS__)
#else
    #define dbg(...) 42
#endif

#define int long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define ff first
#define ss second
#define MP make_pair
#define sz(v) ((int)(v).size())  
#define fr(i, j, k) for(int i = j; i < k; i++)
#define nl "\n"
typedef pair<int, int> pii;
typedef vector <int> vi;

pii dir[8] = { {-1, 0}, {1, 0}, {0, -1}, {0, 1}, {1, 1}, {-1, -1} , {-1, 1}, {1, -1} };

const int inf = (1LL << 60), mod = 1e9+7, nn = 2e5+5;

void solve(){
    int n;
    cin >> n;
    int c = 1, ans = 0;
    while(n){
        ans += c;
        c = c * 2;
        n = n/2;
    }
    cout << ans;
}

int32_t main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int T = 1;
    // cin >> T;
    for(int tc = 1; tc <= T; tc++){
        // cout << "Case #" << tc << ": ";
        solve();
    }
    return 0;
}

Measured memory_bytes: 256
S = int(input())
r = int(S**(1/2))
d = S-r**2

X1 = r
Y1 = 0
X2 = 0

Y2_tmp = r - ((r+1)**2 - r**2 - (d+1))

if d == 0:
    Y2 = r
elif Y2_tmp < 1:
    Y2 = 1
else:
    Y2 = r - ((r+1)**2 - r**2 - (d+1))


if d == 0:
    Y3 = r
else:
    Y3 = r+1


if d == 0:
    X3 = r
elif d < r+1:
    X3 = d
else:
    X3 = r+1

print(X1, Y1, X2, Y2, X3, Y3)

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

using ll = long long int;

const ll MAX = (ll)(1e9 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_N = (int)(1e5 + 5);

/////////////////////////////////////////////////////////////
class BinaryIndexedTree {
 public:
  static const int MAX_N = (int)(2e5 + 100);

  ll arr[MAX_N];
  int n;

  BinaryIndexedTree(int n) {
    this->n = n;
    init();
  }

  void init() {
    for (int i = 0; i < n; ++i) arr[i] = 0LL;
  }

  ll sum(int i) {
    ll s = 0LL;
    while (i > 0) {
      s += arr[i];
      i -= i & -i;
    }
    return s;
  }

  void add(int i, ll x) {
    while (i <= n) {
      arr[i] += x;
      i += i & -i;
    }
  }
};
/////////////////////////////////////////////////////////////

int n;
ll a[MAX_N];
ll b[MAX_N];

int s[MAX_N];

BinaryIndexedTree bit(MAX_N * 2);

bool check(ll x) {
  ll num = 0;

  for (int i = 1; i <= n; ++i) s[i] = (a[i] >= x) ? 1 : -1;
  for (int i = 1; i <= n; ++i) s[i] += s[i - 1];

  bit.init();

  for (int i = 0; i <= n; ++i) {
    num += bit.sum(s[i] + MAX_N);
    bit.add(s[i] + MAX_N, 1);
  }

  ll whole = (1LL * (n + 1) * n) / 2;
  ll target =  (whole - 1) / 2 + 1;

  return (num >= target);
}

int main(void) {
  // Here your code !
  scanf("%d", &n);

  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &(a[i]));
    b[i] = a[i];
  }

  sort(b + 1, b + n + 1);

  b[n + 1] = b[n] + 1; // guard

  int ok = 1;
  int ng = n + 1;

  while (abs(ok - ng) > 1) {
    int next = (ok + ng) / 2;

    if (check(b[next])) {
      ok = next;
    }
    else {
      ng = next;
    }
  }

  printf("%lld\n", b[ok]);

  return 0;
}


Measured memory_bytes: 3712
// inputに入力データ全体が入る
function Main(input) {
  
    var inp = input.split('\n');
    var buf = inp[0].split(' ');
    var A = parseInt(buf[0]);
    var B = parseInt(buf[1]);

    var inp2 = inp[1].split('-');
    
    if (inp2.length !== 2) {
      console.log('%s', 'No')
      return;
    };
    if (inp2[0].length !== A ) {
      console.log('%s', 'No');
      return;
    }
    if (inp2[1].length !== B ) {
      console.log('%s', 'No');
      return;
    }
    if (isNaN(parseInt(inp2[0]))) {
      console.log('%s', 'No');
      return;
    }
    if (isNaN(parseInt(inp2[1]))) {
      console.log('%s', 'No')
      return;
    };
    
    console.log('%s', 'Yes');


  }
  //*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
  Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

#define pii pair<int, int>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define sz(v) int(v.size())
#define all(v) v.begin(), v.end()
#define vec vector<int>
#define dead not_bad
#define bad gooood

#define left not_right
#define y1 what

using namespace std;

const int N = (int) 2e3 + 10;
const int M = (int) (1 << 16) + 1000;
const int K = (int) 350;
const ll LINF = (ll) 1e18;
const int INF = (int) 1e9 + 7;
const int ALPHA = 26;
const int mod = INF + 2;
const double PI = 3.14159265359;
const ld EPS = (ld) 1e-12;
int n;
int a[N];
ll dp[N];
int p[N];

int main() {
  #define fn "saddle"
  #ifdef witch
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
  #else
      //freopen(fn".in", "r", stdin);
      //freopen(fn".out", "w", stdout);
  #endif
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int mx = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j < i; j++) {
      if ((i - j) % 2 == 0 && dp[i] < dp[j]) { 
        dp[i] = dp[j];
        p[i] = j;
      }
    }
    dp[i] += a[i];
    if (dp[mx] < dp[i]) {
      mx = i;
    }
  }
  cout << dp[mx] << endl;
  vec ans;
  for (int i = 1; i <= n - mx; i++) {
    ans.pb(n - i + 1);
  }
  while (mx) {
    if (p[mx]) {
      int mid = (p[mx] + mx) / 2;
      for (int i = 0; i < (mx - p[mx] - 1) / 2; i++) {
        ans.pb(p[mx] + 2);
      }
      ans.pb(p[mx] + 1);
    }
    //cout << "here " << mx << ' ' << p[mx] << ' ' << (mx - p[mx] - 1) / 2 + 1 << endl;  
    if (p[mx] == 0) {
      for (int i = 1; i < mx; i++) {
        ans.pb(1);
      }
    }
    mx = p[mx];
  }
  cout << sz(ans) << endl;
  for (auto it : ans) 
    cout << it << endl;
  return 0;
}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap};

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;

fn main() {
    input! {
        n: usize,
        mut tasks: [(usize, usize); n],
    }

    tasks.sort_by_key(|t| t.1);

    let mut t = 0;
    for i in 0..n {
        t += tasks[i].0;
        if t > tasks[i].1 {
            println!("No");
            return;
        }
    }
    println!("Yes");
}


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

int main() {
    int X, N;
    cin >> X >> N;
    set<int> A;
    int a;
    for(int i = 0; i < N; i++) {
        cin >> a;
        A.insert(a);
    }
    if(A.count(X) == 0) {
        cout << X << endl;
        return 0;
    }
    int d = 1;
    int ans = X;
    while(true) {
        if(A.count(X - d) == 0) {
            ans = X - d;
            break;
        }
        if(A.count(X + d) == 0) {
            ans = X + d;
            break;
        }
        d++;
    }

    cout << ans << endl;

    return 0;
}

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


int main() {
  int a, b;
  cin >> a >> b;
  cout << (a+b+1) / 2;
  return 0;
}

Measured memory_bytes: 3592