akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
# define mod 1000000007
# define INF (1 << 29)
# define MAX_N 1000010
/* ちゃんと考えてわかって実装 */

bool is_prime(int n){
    for(ll i = 2; i * i <= n; i++){
        if(n % i == 0) return false;
    }
    return n != 1; // exception:n=1
}

bool is2017like(int n){
    if(n == 0 || n == 1) return false;
    else if(n % 2 == 0) return false;
    else{
        if(is_prime(n) && is_prime((n+1)/2)){
            return true;
        }
        else return false;
    }
}

int main(void){
    int q;
    cin >> q;
    vector<int> l, r;
    for(int i=0; i<q; i++){
        int tmp_l, tmp_r;
        cin >> tmp_l >> tmp_r;
        l.push_back(tmp_l);
        r.push_back(tmp_r);
    }

    vector<int> a(100001);
    for(int i=0; i<=100000; i++){
        if(is2017like(i)) a[i] = 1;
        else a[i] = 0;
    }

    vector<int> rui(100002);
    rui[0] = 0;
    for(int i=0; i<=100000; i++){
        rui[i+1] = rui[i] + a[i];
    }

    for(int i=0; i<q; i++){
        cout << rui[r[i]+1] - rui[l[i]] << endl;
    }
    return 0;
}

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

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef vector<pi> vpi;
typedef vector<bool> vbool;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define forall(it,s) for(auto it = s.begin(); it != s.end(); ++it)
#define F0(i,n) for(ll i = 0; i < n; i++)
#define F1(i,n) for(ll i = 1; i <= n; i++)
#define rep(i,a,b) for(int i = a; i <= b; i++)
#define per(i,a,b) for(int i = b-1; i >= a; i--)
#define FIN ios::sync_with_stdio(false);cin.tie(0);
#define db(x) cout<<#x<<" = "<<x<<"\n"
#define all(v) v.begin(),v.end()
#define modulo(a,b) ((a%b)+b)%b
#define F first
#define S second
#define INF 1000000010
#define eps 0.000000000001
#define mod 1000000007
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

//=======================//
int test_case = 1;
const int maxn = 1e5+2;
int n;
vi a,b,c;
int dp[maxn][3];

int main () {
	//FIN

	cin >> n;
	a = b = c = vi(n);
	F0(i,n) cin >> a[i] >> b[i] >> c[i];
	F0(i,n) F0(j,3) dp[i][j] = 0;

	dp[0][0] = a[0];
	dp[0][1] = b[0];
	dp[0][2] = c[0];

	F1(i,n-1) {
		dp[i][0] = a[i] + max(dp[i-1][1], dp[i-1][2]);
		dp[i][1] = b[i] + max(dp[i-1][0], dp[i-1][2]);
		dp[i][2] = c[i] + max(dp[i-1][0], dp[i-1][1]);
	}

	int res = max(dp[n-1][0], max(dp[n-1][1],  dp[n-1][2]));
	cout << res << "\n";

	return 0;
}










Measured memory_bytes: 5588
#include <iostream>
#include<string>
#include<algorithm>
#include<map>
#include<math.h>
using namespace std;

int main() {
    int N;
    string S;
    cin >> N;
    cin >> S;
    int num, tmp;
    map<char, int> c1, c2;
    num = 0;
    for (int i = 0; i < N; i++){
        c1.clear();
        c2.clear();
        tmp = 0;
        for (int j = 0; j < N; j++){
            if (j <= i)c1[S[j]] = 1;
            else c2[S[j]] = 1;
        }
        for (int k = 0; k < 26; k++){
            if (c1['a' + k] == 1 && c2['a' + k] == 1) tmp++;
            num = max(num, tmp);
        }
    }

    cout << num;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	long long a[3];
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	if(a[2]%2==0){
		cout<<"0"<<endl;
	}
	else{
		long long s=a[1]*a[0];
		cout<<s<<endl;
	}
	return 0;
}

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

using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;

ll gcd(ll a, ll b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}

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

ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}


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

  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];

  sort(a.rbegin(), a.rend());

  ll ans = 0;
  ans += a[0];

  int cnt = 0;
  int num = 1;
  while(cnt < n-2){

    cnt++;

    ans +=  a[num];

    if(cnt % 2 == 0){
      num++;
    }
    
  }

  cout << ans << endl;


  return 0;
}


Measured memory_bytes: 4768
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long
#define sd(a) scanf("%d", &a)
#define sd2(a,b) scanf("%d%d", &a, &b)
#define sd3(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define sld(a) scanf("%lld", &a)
#define sld2(a,b) scanf("%lld%lld", &a, &b)
#define sld3(a, b, c) scanf("%lld%lld%lld", &a, &b, &c)
#define pd(a) printf("%d", a)
#define pld(a) printf("%lld", a)
#define sp printf(" ")
#define nl printf("\n")
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
#define clr(a, val) memset((a), (val), sizeof(a))
#define pb push_back
#define endl "\n"
#define mp(a, b) make_pair(a, b)
#define pii pair<int, int>
#define xx first
#define yy second
#define mx 100001
int main()
{
	string s;cin>>s;
	for(int i=0;i<s.size()-8;i++)
		printf("%c", s[i]);
	nl;
}

Measured memory_bytes: 256
k, n = map(int, input().split())
p = list(map(int, input().split()))
d = []

for i in range(n):
  if i != n - 1:
    d.append(p[i+1] - p[i])
  else:
    d.append(k + p[0] - p[i])

a = sum(d) - max(d)
print(a)


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

using namespace std;
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
constexpr int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, -1, 1};

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

void solve() {
    int N, M;
    cin >> N >> M;
    int ans = 0;
    if (N == 1) {
        cout << M << endl;
        return;
    }
    for (int i = 1; i * N <= M; i++) {
        if ((M - i * N) % i == 0) {
            ans = i;
        } 
    }
    cout << ans << endl;
}

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}

Measured memory_bytes: 384
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


def factorization(N,M,cnt,fact):
    for i in range(2, int(-(-N**0.5//1))+1):
        if M % i == 0:
            cnt=0
            while M % i == 0:
                cnt += 1
                M //= i
            fact.append([i, cnt])

    if M != 1:
        fact.append([M, 1])

    if fact == []:
        fact.append([M, 1])

    return fact


def pert(L):
    cnt = [0 for i in range(L*2)]
    tot = 0
    i = 0
    while tot < L:
        i += 1
        tot += i
        cnt[tot] = i

    temp = 1
    for j in range(1,L+1):
        if cnt[j] == 0:
            cnt[j] += temp
        else:
            temp = 0 + cnt[j]

    return cnt


def main():
    N = int(input())

    fact = factorization(N,N,0,[])

    cnt = pert(40)

    M = len(fact)

    res = 0

    for i in range(M):
        now = fact[i]
        if now[0] == 1:
            continue
        res += cnt[now[1]]

    print(res)




main()


Measured memory_bytes: 9532
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define all(x) x.begin(),x.end()
#define FIO ios_base::sync_with_stdio(false), cin.tie(NULL);
#define N 100005
#define PI acos(-1)
vector<int> adj[N];
int n,m;
bool vis[N];
int par[N];
vector<int> ans, cur;
int mini = INT_MAX;
void bfs(){
    vis[0] = 1;
    queue<int> q;
    q.push(0);
    while(!q.empty()){
        int u = q.front();
        q.pop();
        for(auto v : adj[u]){
            if(vis[v]) continue;
            par[v] = u;
            q.push(v);
            vis[v] = 1;
        }
    }
}
int main(){
	FIO;
    cin >> n >> m;
    for(int i = 0 ; i < m ; i++){
        int u,v; cin >> u >> v; u--, v--;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    bfs();
    bool flag = 1;
    for(int i = 0; i < n ; i++) if(vis[i]==0) flag = 0;
    cout << (flag?"Yes":"No") << endl;
    for(int i = 1; i < n ; i++) cout << par[i]+1<< endl;
	return 0;
}

Measured memory_bytes: 10640
#include <iostream>
#include <atcoder/fenwicktree>

namespace ac = atcoder;

using lint = long long;

void solve() {
    int n, q;
    std::cin >> n >> q;

    ac::fenwick_tree<lint> fwt(n);
    for (int i = 0; i < n; ++i) {
        lint x;
        std::cin >> x;
        fwt.add(i, x);
    }

    while (q--) {
        int t;
        std::cin >> t;

        switch (t) {
            case 0: {
                int i;
                lint x;
                std::cin >> i >> x;
                fwt.add(i, x);
                break;
            }
            case 1: {
                int l, r;
                std::cin >> l >> r;
                std::cout << fwt.sum(l, r) << "\n";
                break;
            }
        }
    }
}

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

    solve();

    return 0;
}


Measured memory_bytes: 8256
/*Remember: The Struggle is Important*/

//CF,CC,AtC,SPOJ: hp1999
//HE: hemant269
//HR: hemant2132

#include<bits/stdc++.h>
using namespace std;

#define     int          long long int
#define     ld           long double
#define     fast()       ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define     all(x)       x.begin(),x.end()
#define     mem(a,b)     memset(a,b,sizeof(a))
#define     gcd(a,b)     (__gcd((a),(b)))
#define     lcm(a,b)     (((a)*(b))/gcd((a),(b)))
#define     pb           push_back
#define     ins          insert
#define     pii          pair<int,int>
#define     F            first
#define     S            second
#define     makep        make_pair
#define     maket        make_tuple
#define     show(x)      for(auto c:x)cout<<c<<" ";cout<<"\n";
#define     show2(x)     for(auto c:x)cout<<c.F<<" "<<c.S<<"\n";

const int inf=1e18,M=1e9+7;
const int N=1;

void solve()
{
    string s;
    cin>>s;

    if(s=="AAA" || s=="BBB")
        cout<<"No";
    else
        cout<<"Yes";
}

int32_t main()
{
    fast();

    int t=1;
    //cin>>t;
    while(t--)
    {
        solve();
        //cout<<"\n";
    }

    return 0;
}




Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cstdlib>
#include<stdio.h>
#include<time.h>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<deque>
#include<set>
#include<map>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int qx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int qy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

vector<vector<int> > panel;
vector<vector<int> > p;
int h, w, c;

void nuri(P roc, int col, int ori) {
	p[roc.first][roc.second] = col;
	REP(i, 4) {
		ll nh = roc.first + dx[i];
		ll nw = roc.second + dy[i];
		if(nh >= 0 && nh < h && nw >= 0 && nw < w && p[nh][nw] == ori) {
			nuri(P(nh, nw), col, ori);
		}
	}
}

int count(P roc) {
	int res = 1;
	p[roc.first][roc.second] = -1;
	REP(i, 4) {
		ll nh = roc.first + dx[i];
		ll nw = roc.second + dy[i];
		if(nh >= 0 && nh < h && nw >= 0 && nw < w && p[nh][nw] == c) {
			res += count(P(nh, nw));
		}
	}
	return res;
}

void init() {
	REP(i, h) {
		REP(j, w) {
			p[i][j] = panel[i][j];
		}
	}
}

int main(void) {
	while(true) {
		cin>>h>>w>>c;
		if(h == 0 && w == 0 && c == 0) break;
		panel.resize(h);
		p.resize(h);
		REP(i, h) panel[i].resize(w);
		REP(i, h) p[i].resize(w);
		REP(i, h) {
			REP(j, w) cin>>panel[i][j];
		}
		init();
		ll ans = 0;
		FOR(i, 1, 7) {
			FOR(j, 1, 7) {
				FOR(k, 1, 7) {
					FOR(l, 1, 7) {
						FOR(m, 1, 7) {
							if(p[0][0] != i) nuri(P(0, 0), i, p[0][0]);
							if(i != j) nuri(P(0, 0), j, i);
							if(j != k) nuri(P(0, 0), k, j);
							if(k != l) nuri(P(0, 0), l, k);
							if(l != m) nuri(P(0, 0), m, l);
							ans = max(ans, (ll)count(P(0, 0)));
							init();
						}
					}
				}
			}
		}
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 3096
#include <stdio.h>


int main(){
	int a;
	int b;
	int c;
	scanf("%d %d %d", &a, &b, &c);

	if ((a<b) && (b<c)){
		printf("Yes\n");
	}else{
		printf("No\n");
	}

	return 0;
}


Measured memory_bytes: 2040
//struct cmp {bool operator()(const pair<int, char> &a, const pair<int, char> &b) {if (a.first == b.first) {return a.second > b.second;} else {return a.first > b.first;}}};
#include<bits/stdc++.h>
#define endl "\n"
#define _  ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define mp make_pair
#define min_heap priority_queue <int, vector<int>, greater<int> >
#define max_heap priority_queue <int>
#define ll long long
//#define int long long
#define MOD 1000000007#define deb3(x,y,z) cout << #x << "=" << x << "\t"<<#y<<"="<<y<< "\t"<<#z<<"="<<z<<endl;
#define DEBUG cout<<"Hello1\n";
#define deb(x) cout << #x << " " << x << endl;
#define deb2(x,y) cout << #x << "=" << x << "\t\t"<<#y<<"="<<y<<endl;
#define deb3(x,y,z) cout << #x << "=" << x << "\t"<<#y<<"="<<y<< "\t"<<#z<<"="<<z<<endl;
#define all(v) (v).begin(),(v).end()
using namespace std;
template<class T>
void print_container(T &container) {for (auto &t : container) {cout << t << " ";} cout << endl;}


void solve() {
	string a, b, c;
	cin >> a >> b >> c;

	int i = 0, j = 0, k = 0;

	vector<stack<char>> v(3);
	for (int i = a.length() - 1; i >= 0 ; i--) {
		v[0].push(a[i]);
	}
	for (int i = b.length() - 1; i >= 0 ; i--) {
		v[1].push(b[i]);
	}
	for (int i = c.length() - 1; i >= 0 ; i--) {
		v[2].push(c[i]);
	}

	int curr = 0;
	while (1) {
		if (v[curr].size() != 0) {
			//	deb3(v[0].size(), v[1].size(), v[2].size());
			char c = v[curr].top();
			v[curr].pop();
			curr = c - 'a';
			//deb(curr);
		} else {
			cout << char(curr + 'A');
			break;
		}
	}
}

int32_t main() {
	_
	solve();
}



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

long long Euclid(long long A, long long B){
  if(A<B) return Euclid(B, A);
  while(B!=0){
    long long R = A%B;
    A = B; B = R;
  }
  return A;
}

int main(){
  long long N, K;
  std::cin >> N >> K;
  long long a = N % K;
  long long b = std::fabs(K - a);

  if(a <= b){
    std::cout << a << std::endl;
  }else{
    std::cout << b << std::endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	bool llega = true;
	int a, b, c, d, e, k;
	cin >> a >> b >> c >> d >> e >> k;
	if ((e - a) > k) cout << ":(";
	else cout << "Yay!";
	
	return 0;
}

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

inline long long read(){
    long long s = 0, w = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9'){
        if (ch == '-') w = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9'){
        s = s * 10 + ch - '0';
        ch = getchar();
    }
    return s * w;
}

int main(){
    string s;
    cin >> s;
    if (s[s.size()-1] == 's')
        cout << s << "es\n";
    else
        cout << s << "s\n";
    return 0;
}

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


int main()
{
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  if (a == 0)
    puts("1");
  else if (b == 0)
    puts("2");
  else if (c == 0)
    puts("3");
  else if (d == 0)
    puts("4");
  else
    puts("5");
  return 0;
}

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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	ll n, m;
	cin >> n >> m;

	multiset<ll> s;
	while (n--) {
		ll x; cin >> x;
		s.insert(x);
	}
	
	while (m--) {
		ll x = *s.rbegin();
		s.erase(s.find(x));
		x /= 2;
		s.insert(x);
	}

	cout << accumulate(all(s),0LL) << endl;
}



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

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

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

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

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
void dfs(vl vec){
  
}

int main(){
  ll n,m;cin>>n>>m;
  priority_queue<ll>  que;
  rep(i,n){ll a;cin>>a;que.push(a);}
  for(int i=1; i<=m;i++){
    ll c= que.top();
    que.pop();
    que.push(c/2);
  }
  ll ans=0;
  rep(i,n){
    ll b=que.top();
    ans +=b;
    que.pop(); 
  }
  cout<<ans<<endl;
}
  


Measured memory_bytes: 1400
#include <stdio.h>
 
int main(void)
{
    int i, n, a;
    long sum = 0;
    int M = -1000000, m = 10000000;
    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        scanf("%d", &a);
        sum = sum + a;
        if (a >= M)
        {
            M = a;
        }
        if(a <= m)
        {
            m = a;
        }
    }
    printf("%d %d %ld\n", m, M, sum);
    return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define rep(i, n) FOR(i, 0, n)
#define rep1(i, n) FOR(i, 1, int(n) + 1)
#define rrep(i, n) RFOR(i, 0, n)
#define rrep1(i, n) RFOR(i, 1, int(n) + 1)
#define all(c) begin(c), end(c)
const int MOD = 1000000007;

template <typename T>
void __dump__(std::ostream &os, const T &first) {
    os << first;
}
template <typename First, typename... Rest>
void __dump__(std::ostream &os, const First &first, const Rest &... rest) {
    os << first << ", ";
    __dump__(os, rest...);
}
#define dump(...)                                         \
    do {                                                  \
        std::ostringstream os;                            \
        os << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; \
        __dump__(os, __VA_ARGS__);                        \
        std::cerr << os.str() << std::endl;               \
    } while (0)

int main() {
    ll a, b, c;
    while (cin >> a >> b >> c) {
        int ans = 0;
        rep(i, 100) {
            if (a%2 || b%2 || c%2) break;
            ++ans;
            ll aa = (b + c) / 2;
            ll bb = (c + a) / 2;
            ll cc = (a + b) / 2;
            a = aa;
            b = bb;
            c = cc;
        }
        if (ans == 100) ans = -1;
        cout << ans << endl;
    }
}


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

int main() {
    int a,b,c;cin>>a>>b>>c;
    cout << a*b/2 << endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>

#define int long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define LOWER_BOUND(v,a) (lower_bound((v).begin(), (v).end(), (a)))
#define UPPER_BOUND(v,a) (upper_bound((v).begin(), (v).end(), (a)))
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
using namespace std;

int N;
int t[100010];
int x[100010];
int y[100010];

signed main()
{
	cin >> N;
	REP(i, N) cin >> t[i] >> x[i] >> y[i];

	int sx = 0;
	int sy = 0;
	int st = 0;
	REP(i, N)
	{
		int len = abs(x[i] - sx) + abs(y[i] - sy);
		int tt = t[i] - st;
		if (tt < len)
		{
			cout << "No" << endl;
			return 0;
		}
		else if ((tt % 2) != (len % 2))
		{
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
}





Measured memory_bytes: 2560
from collections import Counter
n,t = map(int, input().split())
a = list(map(int, input().split()))

mx = 0
b = []
for i in a[::-1]:
    if mx < i:
        mx = i
    b.append(mx-i if i < mx else 0)
c = Counter(b)

print(c[max(c.keys())])


Measured memory_bytes: 22496
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;


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

	string s;
	cin >> s;
	int n = s.length(), i, j, k;
	cin >> k;

	set<string> ss;
	set<string>::iterator it;
	for (i = 0; i < n; i++) {
		for (j = i; (j < n) && (j - i < 5); j++) {
			ss.insert(s.substr(i, j - i + 1));
		}
	}
	
	it = ss.begin();
	k--;
	while (k > 0) {
		it++;
		k--;
	}
	cout << *it << "\n";

	return 0;
}


Measured memory_bytes: 1664
#include<stdio.h>
int main(){
  char b[2];
  scanf("%s",b);
  char x[2];
  if(b[0]=='A') x[0]='T';
  if(b[0]=='T') x[0]='A';
  if(b[0]=='C') x[0]='G';
  if(b[0]=='G') x[0]='C';
  
  printf("%c",x[0]);
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define long long long 

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

typedef trie<string,null_type,trie_string_access_traits<>,pat_trie_tag,trie_prefix_search_node_update> pref_trie;
typedef tree<long int,null_type,less<long int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef cc_hash_table<long int,long int, hash<long int>, equal_to<long int>, direct_mask_range_hashing<long int>, 
hash_standard_resize_policy<hash_exponential_size_policy<>, hash_load_check_resize_trigger<true>, true>> ht;


int main(){
   IOS;
 //    #ifndef ONLINE_JUDGE
 //        freopen("in.txt",  "r",  stdin);
 //        freopen("out.txt", "w", stdout);
 //    #endif
   
   	long int n,k,sum = 0;
   	cin>>k>>n;

   	vector<long int> v(n);
   	for(long int i = 0; i < n; i++){
   		cin>>v[i];
   		sum += v[i];
   		if(sum >= k)
   			return cout<<"Yes",0;
   	}
   	cout<<"No";
   return 0;
}

Measured memory_bytes: 1024
/* be name khoda */

// #define stream_enable
#define long_enable
#include <iostream>
#include <algorithm>
#include <cstring>
#include <numeric>
#include <iomanip>
#include <sstream>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;

#ifdef stream_enable
#define cin sss
#endif
#ifdef long_enable
typedef long long int ll;
#else
typedef int ll;
#endif

typedef pair<ll, ll> pii;
typedef pair<pii, ll> ppi;
typedef pair<ll, pii> pip;
typedef vector<ll> vi;
typedef vector<pii> vpii;

const ll MOD = 1000000007;
const long long BIG = 1446803456761533460;
const int Big = 336860180;

#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()

#define debug(x) cout << #x << " -> " << (x) << endl
#define debug2(x, y) cout << #x << ' ' << #y << " -> " << (x) << ' ' << (y) << endl
#define debug3(x, y, z) cout << #x << ' ' << #y << ' ' << #z << " -> " << (x) << ' ' << (y) << ' ' << (z) << endl
#define debug4(x, y, z, t) cout << #x << ' ' << #y << ' ' << #z << ' ' << #t << " -> " << (x) << ' ' << (y) << ' ' << (z) << ' ' << (t) << endl
#define debugp(x) cout << #x << " -> " << "(" << (x).F << ", " << (x).S << ")" << endl
#define debuga(x, n) cout << #x << " -> "; fori (i1_da, n) { cout << (x)[i1_da] << ' '; } cout << endl
#define debugap(x, n) cout << #x << " ->\n"; fori (i1_dap, n) { cout << "(" << (x)[i1_dap].F << ", " << (x)[i1_dap].S << ")\n"; } cout << endl
#define debugaa(x, n, m) cout << #x << " ->\n"; fori (i1_daa, n) { fori (i2_daa, m) { cout << (x)[i1_daa][i2_daa] << ' '; } cout << '\n'; } cout << endl
#define debugav(x, n) cout << #x << " ->\n"; fori (i1_dav, n) { fori (i2_dav, (x)[i1_dav].size()) { cout << (x)[i1_dav][i2_dav] << ' '; } cout << '\n'; } cout << endl
#define debugia(x, n) cout << #x << " ->\n"; fori (i1_dia, n) { cout << i1_dia << " : " << (x)[i1_dia] << '\n'; } cout << endl

#define forifrom(i, s, n) for(ll i = (s); i < (n); ++i)
#define forirto(i, n, e) for(ll i = (n) - 1; i >= (e); --i)
#define fori(i, n) forifrom (i, 0, n)
#define forir(i, n) forirto (i, n, 0)

#define smin(a, b) a = min(a, (b))
#define smax(a, b) a = max(a, (b))

#define Add(a, b) a = ((a) + (b)) % MOD
#define Mul(a, b) a = (1LL * (a) * (b)) % MOD

stringstream sss;

// -----------------------------------------------------------------------

const ll maxn = 20010;

ll n;
ll P[maxn], A[maxn], B[maxn];

void MAIN() {

    cin >> n;
    fori (i, n) {
        ll p; cin >> p;
        P[p - 1] = i + 1;
    }
    B[0] = n * (n + 1) / 2;
    fori (i, n) {
        B[i + 1] = -P[i];
        A[i] = P[i];
    }
    fori (i, n) A[i + 1] += A[i], B[i + 1] += B[i];
    fori (i, n) {
        cout << A[i] << ' ';
    }
    cout << endl;
    fori (i, n) {
        cout << B[i] << ' ';
    }
    cout << endl;

}

// -----------------------------------------------------------------------

int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    cout << fixed << setprecision(10);
    sss << R"(
3
2 3 1
    )";
    MAIN();
    return 0;
}


Measured memory_bytes: 1152
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <tuple>

using ll = long long;
using namespace std;



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

    if(A%3 == 0 or B%3 == 0 or (A+B)%3 == 0){
        puts("Possible");
        return 0;
    }else{
        puts("Impossible");
        return 0;
    }


    return 0;
}


Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author TM
 */


#include <bits/stdc++.h>

using namespace std;

class DWall {
public:
    void solve(std::istream &cin, std::ostream &cout) {
        int h, w;
        cin >> h >> w;
        vector<vector<int>> c(10, vector<int>(10));
        for (int i = 0; i < 10; ++i) {
            for (int j = 0; j < 10; ++j) {
                cin >> c[i][j];
            }
        }
        vector<vector<int>> a_vec(h, vector<int>(w));
        for (int i = 0; i < h; ++i) {
            for (int j = 0; j < w; ++j) {
                cin >> a_vec[i][j];
            }
        }
        for (int k = 0; k < 10; ++k) {
            for (int j = 0; j < 10; ++j) {
                for (int i = 0; i < 10; ++i) {
                    c[i][j] = min(c[i][j], c[i][k] + c[k][j]);
                }
            }
        }
        int ans = 0;
        for (const auto &row : a_vec) {
            for (const auto &a : row) {
                if (a == -1)continue;
                ans += c[a][1];
            }
        }
        cout << ans << endl;
    }
};


int main() {
    DWall solver;
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


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

const int mod = 998244353  ;

#define ft first
#define sd second
#define pb push_back
#define all(x) x.begin(),x.end()

#define ll long long int
#define vi vector<int>
#define vii vector<pair<int,int> >
#define pii pair<int,int>
#define plii pair<pair<ll, int>, int>
#define piii pair<pii, int>
#define viii vector<pair<pii, int> >
#define vl vector<ll>
#define vll vector<pair<ll,ll> >
#define pll pair<ll,ll>
#define pli pair<ll,int>
#define mp make_pair
#define ms(x, v) memset(x, v, sizeof x)
#define pr_vec(v) for(int i=0;i<v.size();i++) cout << v[i] << " " ;

#define f_in(st) freopen(st,"r",stdin)
#define f_out(st) freopen(st,"w",stdout)

#define fr(i, a, b) for(i=a; i<=b; i++)
#define fb(i, a, b) for(i=a; i>=b; i--)
#define ASST(x, l, r) assert( x <= r && x >= l )


int main(){
 ios_base::sync_with_stdio(0);
        ll n,p,i;
        cin >> n >> p;
        ll ans=1,cnt=0;
        while(!(p&1)){
            p/=2;
            cnt++;
        }
//        cout << cnt << endl;
        if(cnt>=n){
            ans*=pow(2,(cnt/n));
        }
        for(i=3;i<=sqrt(p);i++){
            cnt=0;
            while(p%i==0){
                cnt++;
                p/=i;
            }
            if(cnt>=n){
//                    cout << i << endl;
                ans*=pow(i,(cnt/n));
            }
        }
        if(p>2){
            ans*=pow(p,(1/n));
        }
        cout << ans;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <set>

using namespace std;
set<int> s;
int main(void) {
  
  int q, command, x;
  cin >> q;

  for(int i = 0; i < q; i++) {
    cin >> command >> x;
    switch(command) {
      case 0:
        s.insert(x);
        cout << s.size() << endl;
        break;
      case 1:
        cout << s.count(x) << endl;
        break;
      case 2:
        s.erase(x);
        break;
    }  
  }
  

}


Measured memory_bytes: 12464
using System;

namespace AtC167
{
    class Program
    {
        static void Main(string[] args)
        {
            string S, T;
            S = Console.ReadLine();
            T = Console.ReadLine();

            int len = S.Length;
            T = T.Remove(len, 1);
            if (S == T) Console.WriteLine("Yes");
            else Console.WriteLine("No");

        }
    }
}


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

const int mod = 1000000007;





int main() {
    // 入力
  	int n;
    string S; 
  	cin >> n>>S;
	vector<int> alph(26,0);
  	
  	for(int i = 0; i < S.size(); i++){
    	alph[int(S[i]-'a')]++;
    }
  
  	long long ans = 1;
  	for(int i = 0; i < 26; i++){
    	ans *=(alph[i]+1);
    	ans %= mod;
    }
  	
  	ans--;
  	ans %= mod;
  	cout << ans << endl;
  	
}

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

using namespace std;

typedef long long ll;
typedef long double ld;
#define rep(i , j , n) for(long long i = j ; i <= n ; i++)
#define per(i , j , n) for(long long i = j ; i >= n ; i--)

const ll N = 123456;
const ll mod = 998244353;
const ld eps = 1e-5;

vector < int > a[N];
int vis[N];
int dp[N];

void dfs(int s) {
    vis[s] = true;

    for(auto j : a[s]) {
        if(vis[j] == false) {
            dfs(j);
        }

        dp[s] = max(dp[s] , 1 + dp[j]);
    }
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cout.precision(10);

    int n , m;

    cin >> n >> m;

    rep(i , 1 , m) {
        int x , y;
        cin >> x >> y;
        a[x].push_back(y);
    }

    rep(i , 1 , n) {
        if(vis[i] == false) {
            dfs(i);
        }
    }

    int ans = 0;

    rep(i , 1 , n) {
        ans = max(ans , dp[i]);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 9088
#include<iostream>
#include<cstdlib>
#include<cstdio>
using namespace std;

int main(){
  int ans[1000],i=0;
  char ch[1000];
  while(1){
    if(scanf("%s",ch)==EOF)break;

    if(ch[0]!='+'&&ch[0]!='-'&&ch[0]!='*')ans[i]=atoi(ch);
    else {
    if(ch[0]=='+')ans[i-2]+=ans[i-1];
    else if(ch[0]=='-')ans[i-2]-=ans[i-1];
    else if(ch[0]=='*')ans[i-2]*=ans[i-1];
    i-=2;
    }

    i++;
  }
    cout<<ans[0]<<endl;
    return 0;
}

Measured memory_bytes: 1168
import sys
sys.setrecursionlimit(10**7)

def main():
    N = int(input())
    edge = [[] for _ in range(N)]
    for _ in range(N-1):
        u, v, w = map(int, input().split())
        edge[u-1].append([v-1, w])
        edge[v-1].append([u-1, w])
    
    def dfs(x, co):
        if c[x] != -1:
            return
        c[x] = co
        directions = edge[x]
        for d in directions:
            t, w = d
            if w%2 != 0:
                nextco = abs(1-co)
            else:
                nextco = co
            dfs(t, nextco)
        
    c = [-1 for _ in range(N)]
    dfs(0, 0)
    for ans in c:
        print(ans)

main()

Measured memory_bytes: 95284
n, m = map(int, input().split())
a = [input() for i in range(n)]
b = [input() for j in range(m)]
out = "No"
for i in range(n-m+1):
    for j in range(n-m+1):
        cnt = 0
        for k in range(m):
            for l in range(m):
                if b[k][l] == a[i+k][j+l]:
                    cnt += 1
        if cnt == m**2:
            out = "Yes"
            break
print(out)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define ALL(a) (a).begin(),(a).end()
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
	int k,t;
	cin >> k >> t;
	vector<int> cake(t);
	int maxcake = 0;
	REP(i,t){
		cin >> cake[i];
		maxcake = max(cake[i],maxcake);
	}
	int sumoutmax = accumulate(cake.begin(),cake.end(),0) - maxcake;
	if(sumoutmax + 1 >= maxcake){
		cout << 0 << endl;
	}else{
		cout << maxcake - sumoutmax - 1 << endl;
	}
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
ll factorial(int i) {       //階乗
    if (i == 0) return 1;
    return (factorial(i - 1)) * i;
}

int main() {
    int n;
    cin >> n;
    vector<int> a(n - 1);
    int ans[210000];
    rep(i, n - 1) {
        cin >> a[i];
        ans[a[i]]++;
    }
    rep1(i, n) cout << ans[i] << endl;
}


Measured memory_bytes: 4756
#include <bits/stdc++.h>
#ifdef HIRO
#define d(f_, ...) printf((f_), ##__VA_ARGS__)
#else
#define d(f_, ...)
#endif

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<long long, long long> pllll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector< pair<int, int> > vii;
typedef vector< pair<long long, long long> > vllll;
typedef map<int, int> mii;
typedef map<long long, long long> mllll;
typedef queue<int> qi;
typedef queue< pair<int, int> > qp;
#define mp make_pair
#define pi 3.14159265358979323846
#define MAX max_element
#define MIN min_element
#define all(v) v.begin(), v.end()
#define gt(T) greater<T>()
#define sum(v) accumulate(v.begin(), v.end(), 0ll)
#define uni(v) do{ \
  sort(v.begin(), v.end()); \
  decltype(v)::iterator result = unique(v.begin(), v.end()); \
  v.erase(result, v.end()); \
}while(0)
#define fi(init, n) for(int i = init; i < n; ++i)
#define fj(init, n) for(int j = init; j < n; ++j)
#define fk(init, n) for(int k = init; k < n; ++k)
#define zero(x) memset(x, 0, sizeof(x))
#define negative(x) memset(x, ~0, sizeof(x))
#define bitsum(x) __builtin_popcount(x)
const ll MOD = 1e9 + 7;
const int INF = 1e9;
const int di[] = { 0, 1, 0, -1 };
const int dj[] = { 1, 0, -1, 0 };

template<typename T>
T gcd(T a, T b) {
	return b ? gcd(b, a % b) : a;
}
template<typename T>
T lcm(T a, T b) {
	return a / gcd(a, b) * b;
}
template<typename T>
int finder(vector<T> vec, T number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) return 1;
	else return 0;
}
ll frac(ll n){
	if (n == 0) return 1;
	return (n * frac(n - 1)) % MOD;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int main(int argc, char** argv) {
#ifdef HIRO
  string quiz(argv[1]);
  string id(argv[2]);
  string filename("input/" + quiz + "/" + id + ".txt");
  ifstream fin(filename);
  if (fin.peek() == ifstream::traits_type::eof()) {
    cout << "No input.";
    return 0;
  }
  ifstream cin(filename);
  std::cin.rdbuf(cin.rdbuf());
#endif
  ll n;
  cin >> n;
  int oe[n], arr[n];
  fi(0, n)
    cin >> oe[i];

  for(int i = n - 1; i >= 0; i--) {
    int x = i + 1;
    if(x > n / 2) {
      arr[i] = oe[i];
    }
    else {
      int y = 0;
      for(int j = x * 2; j < n + 1; j += x) {
        y ^= arr[j - 1];
      }
      arr[i] = y ^ oe[i];
    }
  }
  int cnt = 0;
  fi(0, n) {
    cnt += arr[i];
    // cout << arr[i] << " ";
  }
  // cout << endl;
  cout << cnt << endl;
  fi(0, n) {
    if(arr[i]) {
      cout << i + 1 << " ";
    }
  }
  return 0;
}



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

int main() {
    vector<int> package(3, 0);
    int biggest(0);
    for(int i(0); i < package.size(); ++i) {
        cin >> package.at(i);
        if(package.at(biggest) < package.at(i)) biggest = i;
    }

    bool possibility(false);
    switch (biggest) {
        case 0: possibility = package.at(biggest) == package.at(1) + package.at(2); break;
        case 1: possibility = package.at(biggest) == package.at(0) + package.at(2); break;
        case 2: possibility = package.at(biggest) == package.at(0) + package.at(1); break;
    }

    if(possibility) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""


n = onem()

if n:
    print(0)
else:
    print(1)







Measured memory_bytes: 65140
#include <bits/stdc++.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <algorithm>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define print(s) cout << s << endl
#define acc(v) accumulate(v.begin(), v.end(), 0)
#define cinv(n, v) rep(i, n) cin >> v[i]

using namespace std;
const int INF = 1e9;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
int x_pos[4] = {1, 0, -1, 0}, y_pos[4] = {0, 1, 0, -1};
int ctoi(char c)
{
	if (c >= '0' && c <= '9')
	{
		return c - '0';
	}
	return 0;
}

char upper(char c)
{
	return c - 0x20;
}

char lower(char c)
{
	return c + 0x20;
}

void unique_vector(vector<int> &v)
{
	sort(all(v));
	v.erase(unique(all(v)), v.end());
}

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val)
{
	std::fill((T *)array, (T *)(array + N), val);
}

//ユークリッドの互除法
//最大公約数
ll gcd(ll x, ll y)
{
	if (y == 0)
		return x;
	return gcd(y, x % y);
}

//最小公倍数
ll lcm(ll x, ll y)
{
	ll g = gcd(x, y);
	return x / g * y;
}

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

//k!
ll facctorialMethod(ll k)
{
	ll sum = 1;
	for (ll i = 1; i <= k; ++i)
	{
		sum *= i;
		sum %= MOD;
	}
	return sum;
}

//nCr
ll permutationMethod(ll n, ll r)
{
	ll n_sum, r_sum;
	r = n - r;
	n_sum = facctorialMethod(n);
	r_sum = facctorialMethod(r);
	return n_sum / r_sum;
}

// mod. m での a の逆元 a^{-1} を計算する
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

ll pow_kai(int a, int n)
{ //aのn乗を計算します。
	ll x = 1;
	while (n > 0)
	{ //全てのbitが捨てられるまで。
		if (n & 1)
		{ //1番右のbitが1のとき。
			x = (x * a) % MOD;
		}
		a = (a * a) % MOD;
		n >>= 1; //bit全体を右に1つシフトして一番右を捨てる。
	}
	return x % MOD;
}

ll sum(ll a, ll d, ll n, ll mod)
{
	mod *= 2;
	ll ret = (2 * a + d * (n - 1)) % mod;
	ret = ret * n % mod;
	return ret / 2;
}

int main()
{
	int n;
	cin >> n;
	cout << 1.0*n * 2 * M_PI << endl;
}


Measured memory_bytes: 3792
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x) (x).begin(), (x).end()
#define rep(i, s, n) for (i64 i = (s), i##_limit = (n); i < i##_limit; ++i)
#define repr(i, s, t) for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#define var(type, ...) \
    type __VA_ARGS__;  \
    read(__VA_ARGS__);
#ifndef DBG
#define dump(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U>
inline bool chmax(T &a, const U &b) {
    return b > a && (a = b, true);
}
template <class T, class U>
inline bool chmin(T &a, const U &b) {
    return b < a && (a = b, true);
}
constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template <class T>
inline vector<T> makeV(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}

template <class T, class... Args>
inline auto makeV(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(makeV<T>(initValue, args...))>(
        sz, makeV<T>(initValue, args...));
}

template <class T>
inline istream &operator>>(istream &is, vector<T> &vec) {
    for (auto &e : vec) is >> e;
    return is;
}

inline void read() {}

template <class Head, class... Tail>
inline void read(Head &head, Tail &... tail) {
    cin >> head;
    read(tail...);
}

inline void print() { cout << "\n"; }

template <class Head, class... Tail>
inline void print(Head &&head, Tail &&... tail) {
    cout << head;
    if (sizeof...(tail)) cout << ' ';
    print(forward<Tail>(tail)...);
}

template <class T>
inline ostream &operator<<(ostream &os, const vector<T> &vec) {
    static constexpr const char *delim[] = {" ", ""};
    for (const auto &e : vec) os << e << delim[&e == &vec.back()];
    return os;
}

template <class Container>
struct Rev {
    Container &x_;
    inline Rev(Container &x) : x_(x) {}
    inline auto begin() { return rbegin(x_); }
    inline auto end() { return rend(x_); }
};
// }}} End Header

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int mat[3][3];
    rep(i, 0, 3) rep(j, 0, 3) { read(mat[i][j]); }

    int a[3];
    int b[3];
    for (a[0] = 0; a[0] <= 100; ++a[0]) {
        rep(j, 0, 3) { b[j] = mat[0][j] - a[0]; }
        a[1] = mat[1][0] - b[0];
        a[2] = mat[2][0] - b[0];
        bool isOK = true;
        rep(i, 0, 3) rep(j, 0, 3) { isOK &= mat[i][j] == a[i] + b[j]; }

        if (isOK) {
            print("Yes");
            return 0;
        }
    }

    print("No");

    return 0;
}


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

using namespace std;

int main() {
	int n, m;
	scanf("%d %d", &n, &m);
	vector< pair<int, int> > a(n);
	
	for (int i = 0; i < n; ++i) {
		cin >> a[i].first >> a[i].second;
	}
	
	sort(a.begin(), a.end());
	long long tot = 0;
	
	for (int i = 0; i < n; ++i) {
		int num = min(m, a[i].second);
		tot += (long long) a[i].first * num;
		m -= num;
	}
	
	printf("%lld\n", tot);
}

Measured memory_bytes: 1152
import java.util.*;
public class Main{
	public static void main(String[]i){
		long s=Long.parseLong(new Scanner(System.in).next());
		int a=1000000000;
		System.out.println("0 0 "+a+" 1 "+(a-s%a)%a+" "+((s-1)/a+1));
	}
}

Measured memory_bytes: 21716
#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<queue>
#include<map>
#include<ctime>

using namespace std;

template <typename T>

inline T read()
{
	T x=0,f=1;char c=getchar();
	while(!isdigit(c))
	{if(c=='-') f=-f;c=getchar();}
	while(isdigit(c))
	{x=(x<<3)+(x<<1)+(c-48);c=getchar();}
	return x*f;
}

#define lint long long int
#define ulint unsigned lint

const int inf=1e9+1e7;

int ans=0;

int main(void)
{

	// freopen("testdata.in","r",stdin);
	// freopen("testdata.out","w",stdout);

	int a,b,k;

	scanf("%d%d%d",&k,&a,&b);

	for(int i=a;i<=b;i++) if(!(i%k)) ans=1;

	if(ans) puts("OK");
	else puts("NG");

	return 0;

}

Measured memory_bytes: 3764
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int MAXN = 200005;
char s[MAXN];
int n,stk[MAXN],top;
int main()
{
	scanf("%s",s+1);
	n=strlen(s+1);
	for(int i=1;i<=n;++i)
		if(s[i]=='T'){
			if(stk[top]==1)--top;
			else stk[++top]=-1;
		}else stk[++top]=1;
	cout<<top<<endl;
	return 0;
}


Measured memory_bytes: 1280
#include<iostream>
using namespace std;
int A, B, C;
int main(){
  cin >> A >> B >> C;
  int counter =0;
  bool flag = false;
  while(true){
    if (B - A >= 0 && counter < C) {
      counter++;
      B -= A;
    }
    else {
      flag = true;
    }
    if (flag) break;
  }
  cout << counter << endl;
  return 0;
}

Measured memory_bytes: 256