akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

typedef long long ll;
typedef pair<ll,ll> P;

struct UF
{
	vector<int> par; // 親のインデックスを記憶する配列
	vector<int> sz; // サイズを記憶する。
	vector<int> rank;
	vector<int> val;
	// 初期化
	UF(int n):par(n),sz(n),val(n),rank(n){
		for(int i = 0; i < n; i++){
			par[i] = i;sz[i] = 1;rank[i] = 0;
		}
	}
	// 親を求める
	int find(int x) {
		if (par[x] == x) return x;
		else return par[x] = find(par[x]);
	}
	// xとyの属する集合を併合
	void unite(int x, int y) {
		x = find(x); y = find(y);
		if (x == y) return;
		if(rank[x] < rank[y]){
			par[x] = y;
			sz[y] += sz[x];
			val[y] += val[x];
		}
		else{
			par[y] = x;
			sz[x] += sz[y];
			val[x] += val[y];
			if(rank[x] == rank[y])rank[x]++;
		}
	}
	// xとyが同じ集合ならtrue
	bool same(int x, int y) { return find(x) == find(y); }
	// 素の集合のサイズを求める
	int size(int n){return sz[find(n)];}
	int value(int n){return val[find(n)];}
};

const ll N = 5005;
ll dp[N][N];
ll kaijo[N];
ll kake[N];

void mod_add(ll &a, ll b){
	a += b;
	a %= MOD;
}

int main(){
	cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
	ll n;cin >> n;

	kaijo[0] = 1;
	for(ll i = 1;i < N;i++)kaijo[i] = kaijo[i-1] * i % MOD;
	kake[0] = 1;
	REP(i, N - 1)kake[i+1] = kake[i] * (n-1) % MOD;

	ll k = 0;
	UF uf(n);
	vector<ll> v(n);REP(i, n)cin >> v[i];

	REP(i, n){
		if(v[i] != -1)continue;
		uf.val[i] = 1;
		k++;
	}

	REP(i, n){
		if(v[i] == -1)continue;

		v[i]--;
		uf.unite(i, v[i]);
	}

	ll ans = 0;
	ll base = n;
	vector<ll> ki;
	REP(i, n){
		if(uf.find(i) != i)continue;
		if(uf.value(i) == 0){
			base--;
			continue;
		}
		ki.PB(uf.size(i));
	}

	mod_add(ans, base * kake[k]);
	//cout << "k: " << k << endl;
	//cout << "base: " << base << endl;
	//cout << "ans1: " << ans << endl;

	dp[0][0] = 1;
	REP(i, ki.size()){
		REP(j, i+1){
			mod_add(dp[i+1][j+1], dp[i][j] * ki[i]);
			mod_add(dp[i+1][j], dp[i][j]);
		}
	}

	ll mai = 0;
	REP(i, ki.size()){
		mod_add(mai, (ki[i] - 1) * kake[k-1]);
	}

	//cout << "mai: " << mai << endl;

	REP(i, k+1){
		//cout << "dp[" << ki.size() << "][" << i << "]: " << dp[ki.size()][i] << endl;
		if(i < 2)continue;
		mod_add(mai, ((dp[ki.size()][i] * kaijo[i-1]) % MOD) * kake[k - i]);
	}

	//cout << "mai: " << mai << endl;

	mod_add(ans, MOD - mai);
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 120600
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <deque>
#include <queue>
#include <functional>
#include <boost/multiprecision/cpp_int.hpp>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define REP(i, m, n) for(int i = m; i < n; ++i)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define RREP(i, m, n) for(int i = n; i >= m; --i)
#define llrep(i, n) for(ll i = 0; i < n; ++i)
#define llREP(i, m, n) for(ll i = m; i < n; ++i)
#define llrrep(i,n) for(ll i = n; i >= 0; --i)
#define llRREP(i, m, n) for(ll i = n; i >= m; --i)

using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;
using pil = std::pair<int, long long>;
using pli = std::pair<long long, int>;
using plpii = std::pair<long long, std::pair<int, int>>;
using pdd = std::pair<double, double>;

const long long INF = 1000000000000000001;
const long long _MOD = 1000000007;
const long long MOD = 998244353;
const int ALPHABET = 27;
const double pi = 3.14159265358979;

using namespace std;
namespace mp = boost::multiprecision;

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

	int n;
	cin >> n;
	ll* a = new ll[n + 1];
	rep(i, n + 1) cin >> a[i];

	if (a[0] > 1) {
		cout << "-1" << "\n";
		return 0;
	}
	if (a[0] == 1) {
		bool flag = false;
		REP(i, 1, n + 1) {
			if (a[i] != 0) {
				flag = true;
				break;
			}
		}

		if (flag) {
			cout << "-1" << "\n";
		}
		else {
			cout << 1 << "\n";
		}

		return 0;
	}

	mp::cpp_int* maxN = new mp::cpp_int[n + 1];
	maxN[0] = 1;
	REP(i, 1, n + 1) {
		maxN[i] = (maxN[i - 1] - a[i - 1]) * 2;
		if (maxN[i] < 0) {
			cout << "-1" << "\n";
			return 0;
		}
	}
	if (maxN[n] < a[n]) {
		cout << "-1" << "\n";
		return 0;
	}

	ll ans = a[n];
	ll next = a[n];
	rrep(i, n-1) {

		if (next + a[i] <= maxN[i]) {
			ans += next + a[i];
			next += a[i];
		}
		else {
			ans = ans + static_cast<ll>(maxN[i]);
			next = static_cast<ll>(maxN[i]);
		}
	}

	cout << ans << "\n";

	return 0;
}



Measured memory_bytes: 630128
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int> P;
typedef long long ll;
int N;
class BellmanFord
{
    struct edge
    {
        int a, b;
        ll w;
    };
    int n;
    vector<edge> edges;
    vector<vector<int>> rev;
    vector<ll> d;
    vector<bool> reachable;
    void bfs(){
        queue<int> que;
        que.push(N);
        reachable[N] = true;
        while(!que.empty()){
        int a = que.front();
        que.pop();
        for(auto i:rev[a]){
            if(reachable[i]==false)
            {
                reachable[i] = true;
                que.push(i);
            }
            }
        }
    }
public:
    bool is_negative_loop = false;
    BellmanFord(int n) : n(n), edges(n), d(n, 1e18),rev(n),reachable(n) {}
    void add_edge(int a, int b, ll w)
    {
        assert(0 <= a && a < n && 0 <= b && b < n);
        edges.push_back({a, b, w});
        edges.push_back({b, a, w});
    }

    void add_arc(int a, int b, ll w)
    {
        assert(0 <= a && a < n && 0 <= b && b < n);
        edges.push_back({a, b, w});
        rev[b].push_back(a);
    }

    // return true if has negative loop
    void build(int a)
    {
        d[a] = 0;
        bfs();
        for (int i = 0; i < n; i++)
        {
            bool change = false;
            for (edge e : edges)
            {
                if (d[e.a] != 1e18 && reachable[e.a])
                {
                    if (d[e.b] > d[e.a] + e.w)
                    {
                        d[e.b] = d[e.a] + e.w;
                        change = true;
                    }
                }
            }
            if (!change)
            {
                return;
            }
        }
        is_negative_loop = true;
    }

    ll dist(int a)
    {
        return d[a];
    }
};

int main()
{
    int m, p;
    cin >> N >> m >> p;
    BellmanFord bel(N+10);
    rep(i, m)
    {
        int a, b, c;
        cin >> a >> b >> c;
        c-=p;
        bel.add_arc(a,b,-c);
    }
    bel.build(1);
        if (bel.is_negative_loop)
        {
            cout << -1 << endl;
            return 0;
        }
    cout << max(0LL,-bel.dist(N))<<endl;
    return 0;
}

Measured memory_bytes: 640
import itertools

N, K = map(int, input().split())
A = list(map(int, input().split()))
end = [N] * N

for _ in range(K):
    lst = [0] * N
    for i, a in enumerate(A):
        lst[max(0, i - a)] += 1
        if i + a + 1 < N:
            lst[i + a + 1] -= 1
    A = list(itertools.accumulate(lst))
    if A == end:
        break
print(*A)


Measured memory_bytes: 184320
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
using namespace std;
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919364364
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}
int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1) * x % mod;
}
int mod_pow(int x, int y, int mood) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % mood;
		}
		x = x * x % mood;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x)* mod_pow(kai(x - y), mod - 2, mod) % mod * mod_pow(kai(y), mod - 2, mod) % mod;
}

int a, b;

signed main() {
	cin >> a >> b;
	if (a < 10 && b < 10)cout << a * b << endl;
	else cout << -1 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PLL = pair<ll, ll>;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repn(i,n) for(int i = 0; i <= (int)(n); i++)
#define srep(i,l,n) for(int i = l; i < (int)(n); i++)
#define srepn(i,l,n) for(int i = l; i <= (int)(n); i++)
#define drep(i,n) for(int i = (int)(n-1); i >= 0; i--)
#define drepn(i,n) for(int i = (int)(n); i >= 0; i--)
#define size(s) (int)s.size()
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T = int> using V = vector<T>;
template<class T = int> using VV = vector<V<T>>;
bool isIn(int i, int j, int h, int w) {return i >= 0 && i < h && j >= 0 && j < w;}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void err() {cout << -1 << endl;}
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define ep emplace_back

const int MOD = 1000000007;
const int INF = 1e9;

#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k;
    cin >> n >> k;
    V<ll> a(n);
    rep(i, n) cin >> a[i];
    sort(all(a));
    ll ans = 0;
    rep(i, k) ans += a[i];
    cout << ans << endl;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using ll  = long long;
#define int ll
#define rep(i,n) for(int i=0;i<n;i++)
#define all(in) in.begin(), in.end()
#define INF (sizeof(int) == 4 ? (int)1e9:(int)1e18)
using namespace std;
signed main(){
    string s,t;
    cin >> s >> t;
    int N = s.size(), M = t.size();
    vector<vector<int>>dp(N + 1, vector<int>(M +1 ,0LL));
    string ans = "";
    for(int i = 0; i < N ;i++){
        for(int j = 0; j < M ;j++){
            if(s[i] == t[j]){
                dp[i + 1][j + 1] = dp[i][j] + 1;
            } else {
                dp[i + 1][j + 1] = max(dp[i][j + 1],dp[i + 1][j]);
            }
        }
    }
    int si = N, ti = M;
    // ここから復元....逆順に戻す
    
    while(si > 0 and ti >  0){
        if(dp[si][ti] == dp[si - 1][ti]){
            --si;
        } else if(dp[si][ti] == dp[si][ti - 1]){
            --ti;
        } else {
            --si,--ti;
             ans.push_back(s[si]);
        }
    }
    for(auto itr = ans.rbegin(); itr != ans.rend(); ++itr)
        cout << *itr;
    cout << endl;
}





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

int main(){
    int x, y;
    vector<int> a = {1,3,5,7,8,10,12};
    vector<int> b = {4,6,9,11};
    vector<int> c = {2};

    cin >> x >> y;

    auto ans1 = find(a.begin(), a.end(), x);
    auto ans2 = find(a.begin(), a.end(), y);
    if(ans1 != a.end() && ans2 != a.end()){
        cout << "Yes" << endl;
        return 0;
    }
    else{
        auto ans1 = find(b.begin(), b.end(), x);
        auto ans2 = find(b.begin(), b.end(), y);
        if(ans1 != b.end() && ans2 != b.end()){
            cout << "Yes" << endl;
            return 0;
        }
        else{
            auto ans1 = find(c.begin(), c.end(), x);
            auto ans2 = find(c.begin(), c.end(), y);
            if(ans1 != c.end() && ans2 != c.end()){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }

    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
def main():
    s = input()
    t = input()
    S = len(s)
    T = len(t)
    dp = [[0 for j in range(T+1)] for _ in range(S+1)]
    for i in range(S):
        for j in range(T):
            if s[i] == t[j]:
                dp[i+1][j+1] = dp[i][j]+1
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i+1][j], dp[i][j+1])

    res = ""
    i = S
    j = T
    while i > 0 and j > 0:
        if dp[i][j] == dp[i][j-1]:
            j -= 1
        elif dp[i][j] == dp[i-1][j]:
            i -= 1
        else:
            res = s[i-1]+res
            i -= 1
            j -= 1
    print(res)


main()


Measured memory_bytes: 120540
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B, C = map(int, readline().split())

    if A <= C <= B:
        print('Yes')
    else:
        print('No')
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 61672
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    A=LI()
    ans=[0]*N
     
     
    for i in range(N-1):
        ans[A[i]-1]+=1
        
    for i in range(N):
        print(ans[i])

main()


Measured memory_bytes: 99956
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

int n;
string a,b,c;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>n>>a>>b>>c;
	int t=0;
	for(int i=0;i<n;i++){
		if(a[i]!=b[i]&&b[i]!=c[i]&&c[i]!=a[i]) t+=2;
		else if(a[i]==b[i]&&b[i]==c[i]) t+=0;
		else if(a[i]==b[i]||b[i]==c[i]||c[i]==a[i]) t+=1;
	}
	cout<<t<<endl;
}

Measured memory_bytes: 256
<?php
$n = trim(fgets(STDIN));
$j=0;
$b=0;
$i=0;
while($i<$n){
  list($x,$u)=explode(" ",trim(fgets(STDIN)));
  if($u=="BTC"){
    $b+=$x;
  }else{
    $j+=$x;
  }
  ++$i;
}
printf("%7f",$j+$b*380000);

Measured memory_bytes: 4728
/*input
3
3 1 2
2 5 4
3 6
*/

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

int main() {
    ll n;
    cin >> n;
    vector<ll> a(n), b(n), c(n-1);
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) cin >> b[i];
    for (int i = 0; i < n-1; i++) cin >> c[i];
    int ans = 0;
    for (int i = 0; i < n; i++) {
        ans += b[a[i]-1];
        if (i >= 1 && a[i] == a[i-1]+1) {
            ans += c[a[i]-2];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(){
	string s;
	cin>>s;
	if(s[1]=='B'){
		cout<<"ARC"<<endl;
	}
	else{
		cout<<"ABC"<<endl;
	}
	return 0;
} 

Measured memory_bytes: 3596
import heapq
import math

def minus_float(s):
    return float(s)*-1

def main():
    N,M=map(int, input().split())
    A=list(map(minus_float, input().split()))
    heapq.heapify(A)

    for i in range(M):
        t = heapq.heappop(A)
        heapq.heappush(A, t/2)
    
    ans = 0
    for a in A:
        ans += math.floor(a * -1)
    print(ans)
    
if __name__ == '__main__':
    main()
    

Measured memory_bytes: 13672
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>

#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

using namespace std;

//inline int read(){int t = 0;int neg=1;char c;while((c=getchar_unlocked())!='\n'&&c!=' '&&c!=EOF){if(c=='-'){neg=-1;continue;}t=t*10+c-48;}return neg*t;}
//inline int readl(){long long t = 0;long long neg=1ll;char c;while((c=getchar_unlocked())!='\n'&&c!=' '&&c!=EOF){if(c=='-'){neg=-1ll;continue;}t=t*10+c-48;}return neg*t;}

#define debug(x) cout<<(#x)<<"="<<(x)<<", ";
#define debug1(x) debug(x) cout<<'\n';
#define debug2(x1, x2) debug(x1) debug(x2) cout<<'\n';
#define debug3(x1, x2, x3) debug(x1) debug(x2) debug(x3) cout<<'\n';
#define debug4(x1, x2, x3, x4) debug(x1) debug(x2) debug(x3) debug(x4) cout<<'\n';
#define debug5(x1, x2, x3, x4, x5) debug(x1) debug(x2) debug(x3) debug(x4) debug(x5) cout<<'\n';

typedef long long int lli;
typedef unsigned long long int ulli;
typedef pair<int,int> pi;
typedef pair<lli,lli> plli;
typedef vector<int> vi;
typedef vector<lli> vlli;
typedef vector<pi> vpi;
typedef vector<plli> vplli;
const lli M=1000000007ll;

int main(){
	fast_io
	string s; cin>>s;
	if(s[1]=='B') cout<<"ARC";
	else cout<<"ABC"; 
	
	return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define endl '\n'
#define pi 3.1415926535897932384626433832
#define ll long long
using namespace std;
ll lcm(ll a, ll b){ if(!a || !b) return 0; return a * b / __gcd(a, b); }
bool isPrime(int n) {if (n <= 1) return false;
    if (n <= 3) return true;
    if (n % 2 == 0 || n % 3 == 0) return false;
    for (int i = 5; i * i <= n; i = i + 6) if (n % i == 0 || n % (i + 2) == 0) return false;
    return true;}



int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    ll a;
    cin>>a;
    vector<ll> pak(a);
    for(auto &u:pak){
        cin>>u;
    }
    int ans=0;
    for(int i=0;i<a;i+=2){
        if(pak[i]&1){
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}


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

int main()
{
    int x[10000] = {0};

    rep(i, 10000)
    {
        cin >> x[i];

        if (x[i] != 0)
        {
            cout << "Case " << i + 1 << ": " << x[i] << endl;
        }
        else
        {
            break;
        }
    }
}



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

int main(){
  int n, q;
  cin >> n;
  vector<int> a(n);
  int sum = 0;
  rep(i, n){
    cin >> a[i];
    sum += a[i];
  }
  cin >> q;
  vector<int> m(q);
  rep(i, q) cin >> m[i];
  int h = max(sum+1, 2001);
  vector<bool> p(h, false);
  
  rep(i, 1<<n){
    int x = 0;
    rep(j, n){
      if ( (i / (1<<j)) % 2 ){
        x += a[j];
      }
    }
    p[x] = true;
  }
  
  rep(i, q){
    if (p[m[i]])
      cout << "yes" << endl;
    else
      cout << "no" << endl;
  }
  
  return 0;
}


Measured memory_bytes: 3108
#include<iostream>
#include<fstream>
#include<sstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<cstdlib>
using namespace std;

#define ull unsigned long long
#define ll long long
#define rep(i,j) for(int i=0;i<j;++i)
#define loop(i,a,j) for(int i=a;i<j;++i)
#define mpi(it,table,T,E) for(map<T,E>::iterator it = table.begin();it!=table.end();++it)
#define PI 3.141592654
/*
   ifstream fin("input.txt");
   ofstream fout("output.txt");
#define cin fin
#define cout fout
 */


int main(){
	int a,b;
	while(scanf("%d %d",&a,&b)==2){
		printf("%.6f\n",(a*b)/3.305785);
	}
	return 0;
}

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

int main(){
int n, m, sum=0;
cin >> n >> m;
int a[100000]={0};
rep(i,m) {
    cin >> a[i];
    sum+=a[i];
}
if(sum>n) cout << -1 << endl;
else cout << n-sum << endl;


}

Measured memory_bytes: 4028
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };

void  bubbleSort(int number[], int length);

int main() {
	int N;
	int L[10000];

	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		scanf("%d", &L[i]);
	}

	bubbleSort(L, N);

	int ans = 0;
	int check = 0;

	for (int i = 0; i < N; i++) {
		for (int j = i + 1; j < N; j++) {
			for (int k = j + 1; k < N; k++) {
				if (L[i] < L[j] + L[k] && L[j] < L[i] + L[k] && L[k] < L[j] + L[i]) {
					ans++;
				}
				else {
					break;
				}
			}
		}
	}

	printf("%d", ans);

}
void  bubbleSort(int number[], int length) {
	for (int i = 0; i < length; i++)
		for (int j = i + 1; j < length; j++)
			if (number[i] > number[j]) {
				int tmp = number[i];
				number[i] = number[j];
				number[j] = tmp;
			}
}


/*         提出前の確認事項

・デバッグ用の関数は＜＜コメント化＞＞しているか？
・すべての＜＜入力例＞＞は試したか？
・＜＜限界値分析＞＞はしたか？
・＜＜出力の改行＞＞の有無は確認したか？
・文字列の＜＜スペル＞＞は確認したか？
　　　　　　　　↓
	 ＜＜提出先＞＞に注意して提出！！
*/

Measured memory_bytes: 128
#include <iostream>
#include <map>

using namespace std;
constexpr int64_t MOD = 1'000'000'007;

int main(void) {
    int N;
    cin >> N;

    map<int, int> mp;
    for(int i=1; i<=N; i++) {
        int tmp = i;
        for(int j=2; j*j<=i; j++) {
            while(tmp%j == 0) {
                mp[j]++;
                tmp /= j;
            }
        }
        if(tmp != 1) {
            mp[tmp]++;
        }
    }

    int64_t ans = 1;
    for(auto itr=mp.begin(); itr!=mp.end(); itr++) {
        ans = (ans * (itr->second+1)) % MOD;
    }

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


Measured memory_bytes: 256
/**
 * Created by hiramekun at 20:54 on 2019-08-24.
 */
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
template<typename T> using pq = priority_queue<T>;
template<typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template<typename T, typename K> using ump = unordered_map<T, K>;
const ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll e5 = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define each(i, mp) for(auto& i:mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()

template<class T>
ostream &operator<<(ostream &out, const vector<T> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << ' ';
    return out;
}


template<class T>
istream &operator>>(istream &in, vector<T> &list) {
    ll n = list.size();
    rep(i, n) in >> list[i];
    return in;
}

/* ------------- ANSWER ------------- */
/* ---------------------------------- */

void solve() {
    ll n;
    cin >> n;
    vl t(n);
    ump<ll, ll> mp;
    rep(i, n) {
        cin >> t[i];
        mp[i] = t[i];
    }
    ll m;
    cin >> m;
    vl p(m), x(m);
    rep(i, m) {
        cin >> p[i] >> x[i];
        p[i]--;
    }
    ll ans = accumulate(all(t), 0LL);

    rep(i, m) {
        cout << ans - mp[p[i]] + x[i] << ' ';
    }
}

int main() {
#ifdef MY_DEBUG
    while (true) {
#endif
        solve();
#ifdef MY_DEBUG
    }
#endif
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int st = -1;
int e = -1;
int main (){
  int n,x;
  cin >> n >> x;
  vector <int> mlist(n);
  int sum;
  int count = n;
  for (int i; i<n; i++){
    cin >> mlist.at(i);
    sum += mlist.at(i);
  }
  sort(mlist.begin(), mlist.end());
  count += (x-sum)/mlist[0];
  cout << count << endl;
}

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

int main() {
    ll N;
    int K;
    cin >> N >> K;
    rep(i, 31){
        if(N < pow(K, i)){
            out(i);
            break;
        }
    }
}


Measured memory_bytes: 384
def solve(_list,_k):
  accumulate_list = [0.]
  for i in _list:
    accumulate_list.append((i+1)/2 + accumulate_list[-1])

  ans = -1.0
  for i in range(len(accumulate_list)-_k):
    ans = max(ans, accumulate_list[i+_k]-accumulate_list[i])
  return ans

if __name__ == "__main__":
  _n, _k = map(int, input().split())
  _l = [int(i) for i in input().split()]

  result = solve(_l, _k)
  print(result)


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

int main(){
  int N;
  cin >> N;
  vector<int> C(N);
  for(int i=0;i<N;i++){
    cin >> C.at(i);
  }
  sort(C.begin(),C.end());
  int A=0;
  int B=0;
  for(int i=0;i<N;i++){
    if(i%2==0){
      A += C.at(N-1-i);
    }else{
      B += C.at(N-1-i);
    }
  }
  cout << A-B << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<ll, P> E;
#define cost first
#define from second.first
#define to second.second
#define MOD (1000000007ll)
#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

int main(void){
	int x,a,b;
	cin >> x >> a >> b;
	b -= a;
	cout << ((b>x)?"dangerous":((b>0)?"safe":"delicious")) << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.util.ArrayList;

public class Main {
	Scanner sc;
	public void run(){
		sc = new Scanner(System.in);
		ArrayList<Integer> n = new ArrayList<Integer>();

		
			int value = sc.nextInt();
			if(value != 0){
				calc(value);
			}
		
	}
	public void calc(int n){
		int usual = 20 * 5 + 19 * 5;
		int notUsual = 20 * 10;
		int alldays = getDays(1000);
		
		for(int i = 0; i < n; i++){
			int year = sc.nextInt();
			int month = sc.nextInt();
			int day = sc.nextInt();
			
			int days = getThisYearDays(year, month, day);
			
			System.out.println(alldays - days + 1);
		}
	}
	public int getThisYearDays(int year, int month, int day){
		int m = month - 1;
		int ans = getDays(year);
		if(year % 3 == 0){
			ans = ans + m * 20 + day;
		}
		else{
			if(m % 2 == 0){
				ans = ans + (m/2) * 20 + (m/2) * 19 + day;
			}
			else{
				ans = ans + (m/2) * 20 + (m/2) * 19 + 20 + day;
			}
		}
		return ans;
	}
	public int getDays(int year){
		int usual = 20 * 5 + 19 * 5;
		int notUsual = 20 * 10;
		
		year = year - 1;
		int years = year / 3;
		int amari = year % 3;
		
		int d = (usual + usual + notUsual) * years;
		if(amari == 1){
			d = d + usual;
		}
		else if (amari == 2){
			d = d + usual + usual;
		}
		return d;
	}
	public static void main(String[] args){
		new Main().run();
	}
}

Measured memory_bytes: 20620
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define pb push_back

void test_case()
{
	int n;
	cin >> n;
	vector<int> v(n);
	for (auto &it : v)
		cin >> it;

	vector<int> dp(n, 1e9 + 5);
	dp[0] = 0;
	for (int i = 0; i < n; i++)
		for (int j : {i + 1, i + 2})
			if (j < n)
				dp[j] = min(dp[j], dp[i] + abs(v[i] - v[j]));
	cout << dp[n - 1] << endl;
}

int main()
{
	int t = 1;
	// cin >> t;
	while (t--)
		test_case();
	return 0;
}

Measured memory_bytes: 4036
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ln(a) cout << (a) << endl
#define debug(a, n) rep(hoge, n) printf("%lld%c", a[hoge], hoge == (n) - 1? '\n' : ' ');
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define INF 1e9
#define LINF 1e18
#define int ll

using namespace std;
using ll = long long;
using P = pair<int, int>;
using LP = pair<ll, ll>;

signed main() {
    char c;
    cin >> c;
    ln((char)(c + 1));
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
    int b=0,c=0,counter=0,d=0;
    int house=0;
    cin>>house;
    int a[house];
    for(int i=0;i<house;i++){
        cin>>a[i];
        if(b<a[i]){
            b=a[i];
        }
        if(c>a[i]){
            c=a[i];
        }
        if(counter==0){
            c=a[i];
        }
        counter++;
    }
   /* cout<<"b"<<b<<endl;
    cout<<"c"<<c<<endl;*/
    d=b-c;
    cout<<d;
    cout<<endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

int main(){
	int n,m;
	LL a[3][1010]={},ans=0;
	cin>>n>>m;
	FOR(i,0,n)FOR(j,0,3)cin>>a[j][i];
	FOR(i,0,2){
		FOR(j,0,2){
			FOR(k,0,2){
				LL s1=(i*2-1)*1LL,s2=(j*2-1)*1LL,s3=(k*2-1)*1LL;
				LL sm1=0,sm2=0,sm3=0,tmp=0;
				priority_queue<pair<pair<LL,LL>,pair<LL,LL>>>pq;
				FOR(i,0,n)pq.push(MP(MP(s1*a[0][i]+s2*a[1][i]+s3*a[2][i],s1*a[0][i]),MP(s2*a[1][i],s3*a[2][i])));
				FOR(i,0,m){
					pair<pair<LL,LL>,pair<LL,LL>> pr=pq.top();
					pq.pop();
					tmp+=pr.ST.ST;
					sm1+=pr.ST.ND;sm2+=pr.ND.ST;sm3+=pr.ND.ND;
				}
				if(tmp<0||sm1<0||sm2<0||sm3<0)continue;
				if(tmp>ans)ans=tmp;
			}
		}
	}
	cout<<ans;
    return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
#define   ll          long long int
#define   sz          200010
#define   sc(a)       scanf("%lld",&a)
#define   sc2(a,b)    scanf("%lld %lld",&a,&b)
#define   py          printf("Yes\n")
#define   pn          printf("No\n")
using namespace std;


ll num[sz];



int main()
{

    ll a,b;

    cin>>a>>b;
    if(a+b<=9)cout<<a+b<<endl;
    else
        cout<<"error"<<endl;


    return 0;
}



Measured memory_bytes: 256
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int l = sc.nextInt();
		String s[] = new String[n];
		for(int i = 0; i < n; i++) {
			s[i] = sc.next();
		}
		
		sc.close();
		
		Arrays.sort(s);
		
		for(int i = 0; i < n; i++) {
			System.out.print(s[i]);
		}
		System.out.println();
		
		return;
	}
	
}

Measured memory_bytes: 10056
#include<stdio.h>
int main()
{
	int a,b,c=0,i;
	scanf("%d %d",&a,&b);
	if(a==0){
		if(b>=1868&&b<=1911){
			c=(1911-b)-44;
			printf("M");
			printf("%d\n",-1*c);
		}
		else if(b>=1912&&b<=1925){
			c=(1925-b)-14;
			printf("T");
			printf("%d\n",-1*c);
		}
		else if(b>=1926&&b<=1988){
			c=(1988-b)-63;
			printf("S");
			printf("%d\n",-1*c);
		}
		else if(b>=1989&&b<=2016){
			c=(2016-b)-28;
			printf("H");
			printf("%d\n",-1*c);
		}
	}
	else if(a==1) printf("%d\n",1868+b-1);
	else if(a==2) printf("%d\n",1912+b-1);
	else if(a==3) printf("%d\n",1926+b-1);
	else if(a==4) printf("%d\n",1989+b-1);
	return 0;
}


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

int main(){
  ll n, m;
  cin>>n>>m;
  vector<bool> broken(n+1, false);//壊れていればtrue
  for( int i = 0; i<m ; i++){
    ll tmp;
    cin>>tmp;
    broken.at(tmp) = true;
  }
  vector<ll> ans(n+1);
  ans.at(0)=1;
  if(broken.at(1)) ans.at(1)=0;
  else ans.at(1)=1;
  for(int i = 2 ; i<n+1 ; i++){
    if(broken.at(i) ) ans.at(i)=0;
    else{
      ans.at(i)= (ans.at(i-1)+ans.at(i-2) )%mod;
    }
  }
  cout<<ans.at(n)<<endl;
}

Measured memory_bytes: 1024
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long 
using namespace std;
int main(){
  int a,b;
  cin >>a>>b;
  if(a<=b){
    cout <<"unsafe"<<endl;
  }else{
    cout <<"safe"<<endl;
  }
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#define EACH(value, var) for (auto value : var)
#define SORT(var) sort(var.begin(), var.end())
#define REVERSE(var) reverse(var.begin(), var.end())
#define RSORT(var) SORT(var); REVERSE(var)
#define OPTIMIZE_STDIO ios::sync_with_stdio(false); cin.tie(0); cout.precision(10); cout << fixed
#define endl '\n'

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

void solve(istream& cin, ostream& cout) {
  int n, x, t;
  cin >> n >> x >> t;
  if (n % x == 0) {
    cout << t * (n / x) << endl;
  } else {
    cout << t * (int(n / x) + 1) << endl;
  }
}

#ifndef TEST
int main() {
  OPTIMIZE_STDIO;
  solve(cin, cout);
  return 0;
}
#endif


Measured memory_bytes: 3600
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <set>
#include <map>
#include <unordered_map>
#include <complex>
#include <iomanip>
#include <cmath>
#include <tuple>
using namespace std;

long long const MOD = 1000000007LL;

int main() {
    string a, b;
    cin >> a >> b;

    for (int i = 0; i < a.size(); i++) {
        for (int j = 0; j < a.size(); j++) {
            if (a[i] < a[j]) swap(a[i], a[j]);
        }
    }

    for (int i = 0; i < b.size(); i++) {
        for (int j = 0; j < b.size(); j++) {
            if (b[i] > b[j]) swap(b[i], b[j]);
        }
    }
    
    int numEqual = 0;
    for (int i = 0; i < min(a.size(), b.size()); i++) {
        if (a[0] > b[0]) {
            cout << "No" << endl;
        }
        if (b[i] > a[i]) {
            cout << "Yes" << endl;
            return 0;
        } else if (a[i] == b[i]) {
            ++numEqual;
        }
        if (numEqual == i && b[i] < a[i]) {
            cout << "No" << endl;
            return 0;
        }
    }

    if (b.size() > a.size()) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct point{
	int a,b;
	point *l,*r,*pa;
	point(){l=r=pa=NULL;}
	point(int aa,int bb):a(aa),b(bb){l=r=pa=NULL;};
};
point *root;
point *rightRotate(point *t){
	point *s=t->l;
	t->l=s->r;
	s->r=t;
	return s;
}
point *leftRotate(point *t){
	point *s=t->r;
	t->r=s->l;
	s->l=t;
	return s;
}
point* insert(point *p,int a,int b){
	if(p==NULL)return new point(a,b);
	if(a==p->a)return p;
	if(a<p->a){
		p->l=insert(p->l,a,b);
		if(p->b<p->l->b)
			p=rightRotate(p);
	}else{
		p->r=insert(p->r,a,b);
		if(p->b<p->r->b)
			p=leftRotate(p);
	}return p;
}
point *_del(point *p, int a);
point *del(point *p,int a){
	if(p==NULL)return NULL;
	if(a<p->a)p->l=del(p->l,a);
	else if(a>p->a)p->r=del(p->r,a);
	else return _del(p,a);
	return p;
}
point *_del(point *p, int a){
	if(p->l==NULL&&p->r==NULL)return NULL;
	else if(p->l==NULL)p=leftRotate(p);
	else if(p->r==NULL)p=rightRotate(p);
	else{
		if(p->l->b>p->r->b)p=rightRotate(p);
		else p=leftRotate(p);
	}return del(p,a);
}
bool find(int a){
	point *p=root;
	while(p){
		if(a==p->a)return 1;
		if(a>p->a)p=p->r;
		else p=p->l;
	}
	return 0;
}
void dfs1(point *p){
	if(!p)return;
	dfs1(p->l);
	printf(" %d",p->a);
	dfs1(p->r);
}
void dfs2(point *p){
	if(!p)return;
	printf(" %d",p->a);
	dfs2(p->l);
	dfs2(p->r);
}
int main(){
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	int T;cin>>T;
	int ta,tb;
	string s;
	while(cin>>s){
		if(s=="insert"){
			cin>>ta>>tb;
//			if(!root)root=new point(ta,tb);
//			else 
			root=insert(root,ta,tb);
		}else if(s=="find"){
			cin>>ta;
			if(find(ta))printf("yes\n");
			else printf("no\n");
		}else if(s=="print"){
			dfs1(root);
			printf("\n");
			dfs2(root);
			printf("\n");
		}else if(s=="delete"){
			cin>>ta;
			root=del(root,ta);
		}
	}
	return 0;
}



Measured memory_bytes: 12740
#include "bits/stdc++.h"

using namespace std;

int main() {
	int N;
	cin >> N;
	vector<int >A(N);
	for (int n = 0; n < N; ++n) {
		cin >> A[n];
	}
	sort(A.begin(), A.end());//昇順ソート
	int nmax = A[N - 1];
	vector<bool>DP(nmax + 1);
	for (int n = 0;n <= nmax; ++n) {
		DP[n] = true;
	}
	set<int> pair;
	for (int n = 0 ;n < N;++n) {
		if (n != 0) {
			if (A[n] == A[n-1]) {
				pair.insert(A[n]);
				continue;
			}
		}
		for (int m = 2 * A[n];m <= nmax ; m += A[n]) {
			DP[m] = false;
		}
	}

	int nAns = 0;
	for (int n = 0;n < N;++n) {
		auto itr = pair.find(A[n]);
		if (itr != pair.end()) { // 見つかった
			continue;
		}
		if (false == DP[A[n]]) {
			continue;
		}
		nAns++;
	}


	cout << nAns << endl;
	return 0;
}

Measured memory_bytes: 5036
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    char[] s = scanner.next().toCharArray();
    for (int i = 0; i < s.length - 1; i++) {
      if (s[i] == s[i + 1]) {
        System.out.printf("%d %d\n", i + 1, i + 2);
        return;
      }
    }
    for (int i = 0; i < s.length - 2; i++) {
      if (s[i] == s[i + 2]) {
        System.out.printf("%d %d\n", i + 1, i + 3);
        return;
      }
    }
    System.out.println("-1 -1");
  }
}


Measured memory_bytes: 25900
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        var x = long.Parse(Console.ReadLine());
        int year = 0;
        long cur = 100;
        while (cur < x)
        {
            cur += cur / 100;
            year++;
        }
        Console.WriteLine(year);
    }
}

Measured memory_bytes: 27536
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * @Author: Tard1grad3                                                         *
 * @Last modified time: Sunday, September 20th 2020, 08:20:22 pm (UTC+06:00)   *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include <bits/stdc++.h>
using namespace std;
#define IC ios_base::sync_with_stdio(false); cin.tie(NULL);
#define f(i, a, b) for(int i=a; i<b; i++)
#define ff(i, a, b) for(int i=a-1; i>=b; i--)
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define mp make_pair
#define sz 25
#define mod 998244353
#define line "\n"
#define ALL(x) x.begin(), x.end()
#define F first
#define S second
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef vector<int> vi;
typedef set<int> si;
typedef map<int, int> mii;
typedef map<char, int> mci;
const double PI = acos(-1);

// int a[sz];
// string s;
// si st;
// vector<string> vs;
// vector<char> vc;
// mci mm;

void solve()
{
    ll k, n, m=0, cnt=0, flg=0, ans=0, pos=0, sum=0, mx=INT_MIN, mn=INT_MAX;
    cin >> k;
    k? cout << 0: cout << 1;
}

int main()
{
    int T=1, k=1;
    // cin >> T;
    while(T--)
        solve();
    return 0;
}


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

using namespace std;

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

void hawawa(){
  int h, w;
  cin >> h >> w;
  vector<string> s(h);
  int cnt = 0;
  for (auto&& i : s) {
    cin >> i;
    cnt += count(begin(i), end(i), '#');
  }
  queue<tuple<int, int, int>> q;
  set<pair<int, int>> se;
  q.push(make_tuple(1, 0, 0));
  while (q.size()) {
    auto status = q.front();
    q.pop();
    auto point = make_pair(get<1>(status), get<2>(status));
    if (se.count(point)) {
      continue;
    }
    se.insert(point);
    int score = get<0>(status);
    if (point.first + 1 == h && point.second + 1 == w) {
      std::cout << h * w - score - cnt << "\n";
      return;
    }
    for (int i = 0; i < 4; i++) {
      if (point.first + dx[i] < 0 || point.first + dx[i] == h) {
        continue;
      }
      if (point.second + dy[i] < 0 || point.second + dy[i] == w) {
        continue;
      }
      if (s[point.first + dx[i]][point.second + dy[i]] == '#') continue;
      q.push(make_tuple(score + 1, point.first + dx[i], point.second + dy[i]));
    }
  }
  std::cout << "-1\n";
}

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

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
#define erep(i,n) for(int i = 0;i<=n;i++)
#define rep1(i,n) for(int i = 1;i<n;i++)
#define erep1(i,n) for(int i = 1;i<=n;i++)
typedef long long ll;
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstring vector<string>
#define vdouble vector<double>
#define vll vector<ll>:
#define vbool vector<bool>
#define INF 1101010101010101010
#define MOD 1000000007
#define int long long
using P = pair<int,int>;

signed main(){
  int summer,day;
  cin >> summer >> day;
  rep(i,day){
    int a;
    cin >> a;
    summer -= a;
  }
  if(summer >= 0) cout << summer << endl;
  else cout << -1 << endl;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
using lli = int_fast64_t;
using ulli = uint_fast64_t;
#define debug(x) cerr << #x << " : " << x << endl
#define debugv(x) cerr << #x << " : {";for(auto value_of_x:x){ cerr << value_of_x << ", ";}cerr << endl
#define debugst(x) auto xt = x;cerr << #x << " : {";for(int i=0;i<x.size();i++){ cerr << xt.top() << ", ";xt.pop();}cerr << endl
#define debugvp(x) cerr << #x << " : {";for(auto value_of_x:x){ cerr << value_of_x.first << " : " << value_of_x.second << ", ";}cerr << endl

const lli MOD = 1000000007;
const lli LIMIT = 1000000000000000000 * 5;
const int tenfive = 100000;

int main() {
	lli A, B, C, K;
	cin >> A >> B >> C >> K;
	cout << (K % 2 ? B - A : A - B) << endl;
	return 0;
}


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

int main(){
    int tc; cin>>tc;
    int ac = 0, wa = 0, tle = 0, re = 0;
    for(int i=0; i<tc; i++){
        string s; cin>>s;
        if(s=="AC") ac++;
        else if(s=="WA") wa++;
        else if(s == "TLE") tle++;
        else re++;
    }
    cout<<"AC x "<<ac<<"\n";
    cout<<"WA x "<<wa<<"\n";
    cout<<"TLE x "<<tle<<"\n";
    cout<<"RE x "<<re<<"\n";
}

Measured memory_bytes: 3640
//minamoto
#include<bits/stdc++.h>
#define R register
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmax(T&a,const T&b){return a<b?a=b,1:0;}
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
using namespace std;
const int P=1e9+7;
inline void upd(R int &x,R int y){(x+=y)>=P?x-=P:0;}
inline int add(R int x,R int y){return x+y>=P?x+y-P:x+y;}
inline int dec(R int x,R int y){return x-y<0?x-y+P:x-y;}
inline int mul(R int x,R int y){return 1ll*x*y-1ll*x*y/P*P;}
int ksm(R int x,R int y){
	R int res=1;
	for(;y;y>>=1,x=mul(x,x))(y&1)?res=mul(res,x):0;
	return res;
}
const int N=3005;
int f[N][N],n,m,res;
int main(){
	scanf("%d%d",&n,&m),--n,--m;
	fp(i,0,n)f[0][i]=1;
	fp(i,0,m-1)fp(j,0,n)if(f[i][j]){
		if(j)upd(f[i+1][j-1],f[i][j]);
		if(j<n)upd(f[i+1][j+1],f[i][j]);
		upd(f[i+1][j],add(f[i][j],f[i][j]));
		f[i][j]=0;
	}
	fp(i,0,n)upd(res,f[m][i]),f[m][i]=0;
	--n;
	fp(i,0,n)f[0][i]=1;
	fp(i,0,m-1)fp(j,0,n)if(f[i][j]){
		if(j)upd(f[i+1][j-1],f[i][j]);
		if(j<n)upd(f[i+1][j+1],f[i][j]);
		upd(f[i+1][j],add(f[i][j],f[i][j]));
	}
	fp(i,0,n)upd(res,P-f[m][i]);
	printf("%d\n",mul(res,4));
	return 0;
}

Measured memory_bytes: 35456
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <random>
#include <algorithm>
#include <functional>

using namespace std;
typedef long long ll;

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

const int INF = (1 << 30) - 1;
const ll INFLL= (1LL << 61) - 1;
const int MOD = 1000000007;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int N;
  cin>>N;
  vector<int>L(N);
  REP(i,N)cin>>L[i];
  sort(ALL(L));
  ll ans=0ll;
  REP(i,N){
    REP(j,i){
      REP(k,j){
        if(L[k]>L[i]-L[j])ans++;
      }
    }
  }
  cout<<ans<<endl;
}


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

char s[100010];

int main()
{
	ll i, j, k, t, n, m;
	ll res=0;
	scanf(" %s", s);

	n=strlen(s);

	for(i=1; i<n; i++)
	{
		if(s[i]!=s[i-1]) res++;
	}
	ll res2=0;

	reverse(s, s+n);

	for(i=1; i<n; i++)
	{
		if(s[i]!=s[i-1]) res2++;
	}

	res=min(res, res2);

	printf("%lld\n", res);


	return 0;
}

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

typedef long long ll;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define is(a, b) a == b
#define len(v) ll(v.size())
int main(){
    string s,t,ans;
    cin>>s>>t;
    vector<vector<int> > dp(len(s)+1,vector<int>(len(t)+1));
    rep(i,len(s)){
        rep(j,len(t)){
            if(s[i]==t[j]){
                dp[i+1][j+1]=dp[i][j]+1;
            }else{
                dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j]);
            }
        }
    }
    int l=dp[len(s)][len(t)];
    int x=len(s);
    int y=len(t);
    while(l>0){
        if(s[x-1]==t[y-1]){
            ans.push_back(s[x-1]);
            x--,y--,l--;
        }else if(dp[x][y]==dp[x-1][y]){
            x--;
        }else{
            y--;
        }
    }
    reverse(ans.begin(),ans.end());
    cout<<ans<<endl;
}

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


int main(void)
{
  int a, b;
  cin >> a >> b;
  int d, r;
  d = a / b;
  r = a % b;
  double f = (double)a / b;
  
  cout << d << " " << r <<" "; 
  cout << fixed << setprecision(6) << f << endl;
}


Measured memory_bytes: 3284
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef long double ld;
const double pi=acos(-1.0);
const ll mod=pow(10,9)+7;
const ll INF=pow(2,31)-1;
typedef pair<int,int> P;
typedef vector<int> vi;

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

ll gcd(ll a , ll b){
	if(b == 0) return a;
	return gcd(b , a % b);	
}
ll lcm(ll a , ll b){
	ll g = gcd(a , b);
	ll lc = (a/g) * b;
	return lc;
}

int main(){
    ios::sync_with_stdio(false);
    ll x; cin >> x;
    ll n,m;
    for(int a=-500;a<(500);a++){
        for(int b=-500;b<(500);b++){
            if(pow(a,5)-pow(b,5)==x){
                n=a;
                m=b;
                break;
            }
        }
    }
    cout << n << " " << m << endl;
    return 0;
}

Measured memory_bytes: 4072