akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <list>
#include <stack>
#include <math.h>
#include <map>
#include <unordered_map>
#include <set>
using namespace std;

#define ll long long
#define ull unsigned long long

#define	max	1000000007

ll gcd(ll a, ll b) {
	if (a < b)
		swap(a, b);
	while (ll r = a % b)
		a = b, b = r;
	return b;
}

class mod
{
public:
	ll val;

	mod(ll v)
	{
		val = v % max;
	}

	mod()
	{
		val = 0;
	}

	void operator -=(const mod &v)
	{
		val -= v.val;

		if (val < 0)
			val += max;
	}

	void operator +=(const mod &v)
	{
		if (val + v.val >= max)
			val -= max;
		val += v.val;
	}

	void operator +=(ll &v)
	{
		if (val + v >= max)
			val -= max;
		val += v;
	}

	void operator *=(const mod &v)
	{
		val *= v.val;
		val %= max;
	}

	void operator *=(ll &v)
	{
		val *= v;
		val %= max;
	}

	ll modinv(ll a)
	{
		ll b = max, u = 1, v = 0;
		while (b)
		{
			ll t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		u %= max;
		if (u < 0)
			u += max;
		return u;
	}

	void operator /=(const mod &v)
	{
		val *= modinv(v.val);
		val %= max;
	}

	void operator /=(ll &v)
	{
		val *= modinv(v);
		val %= max;
	}
};

int main()
{
	int n, k;
	cin >> n >> k;
	vector<bool> s(n, false);
	for (int i = 0; i < k; i++)
	{
		int d;
		cin >> d;
		for (int j = 0; j < d; j++)
		{
			int a;
			cin >> a;
			s[a - 1] = true;
		}
	}
	int r = 0;

	for (int i = 0; i < n; i++)
		if (s[i] == false)
			r++;
	printf("%d", r);
	return 0;
}

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

int main()
{
    int x1, y1, z1, w1, x2, y2, z2, w2;
    int n;

    while( cin >> n )
    {
        if( n == 0 )
            break;
        for( int i = 0; i < n; i++ )
        {
            cin >> x1 >> y1 >> z1 >> w1 >> x2 >> y2 >> z2 >> w2;
            cout << x1*x2-y1*y2-z1*z2-w1*w2 << " " << x1*y2+y1*x2+z1*w2-w1*z2 << " " << x1*z2+x2*z1-y1*w2+w1*y2 << " " << x1*w2+w1*x2+y1*z2-y2*z1 << endl;
        }
    }
    return 0;
}



Measured memory_bytes: 3060
n = int(input())

# # 名前の長さを求める
i = 1
while 1:
    # print(i)
    if n <= 26 ** i:
        break
    else:
        n -= 26**i
    i += 1

name = ""
n -= 1
for j in range(i):
    name += chr(ord('a') + n % 26)
    n //= 26

print(name[::-1])

Measured memory_bytes: 9164
#include<stdio.h>
int main(void)
{
	int i=0;
	char c[1001]={0};
	scanf("%s",c);
	while(c[i]!='\0')
	{
		if(c[i]>='D')
		{
			printf("%c",c[i]-3);
		}
		else
		{
			printf("%c",c[i]+23);
		}
		i++;
	}
	printf("\n");
	return 0;
}


Measured memory_bytes: 2084
#include <cstdio>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iterator>

using namespace std;

const int INF = 123456789;

struct point
{
	int x, y;
	point(int x_, int y_) :x(x_), y(y_) {}
	bool operator<(const point& other)const
	{
		return (x == other.x) ? (y < other.y) : (x < other.x);
	}
};

int getnear(vector<point>::iterator b, vector<point>::iterator e)
{
	if (b + 1 == e)
	{
		return INF;
	}
	auto mid = b + ((int)(e - b) / 2);
	int dist = min(getnear(b, mid), getnear(mid, e));
	auto left = lower_bound(b, e, point(mid->x - dist, -INF));
	auto right = upper_bound(b, e, point(mid->x + dist, INF));
	vector<point>ribbon;
	copy(left, right, back_inserter(ribbon));
	for (auto itr = ribbon.begin(); itr != ribbon.end(); ++itr)
	{
		//abs?
		for (auto itr2 = itr; itr2 != ribbon.end() && itr2->y - itr->y < dist; ++itr2)
		{
			if (itr != itr2)
			{
				int dx = abs(itr->x - itr2->x);
				int dy = abs(itr->y - itr2->y);
				dist = min(dist, dx * dx + dy * dy);
			}
		}
	}
	return dist;
}

vector<point> sheet;
int n;

int main()
{
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
	{
		int x, y;
		scanf("%d %d", &x, &y);
		sheet.push_back(point(x, y));
	}
	sort(sheet.begin(), sheet.end());
	int ans = getnear(sheet.begin(), sheet.end());
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 6636
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) throws Exception {
		while (true) {
			int N = sc.nextInt();
			long K = sc.nextLong();
			if (N == 0 && K == 0) break;
			solve(N, K);
		}
	}

	static void solve(int N, long K) {
		if (N % 2 != 0 || K > (1 << (N / 2))) {
			System.out.println("No");
			System.out.println();
			return;
		}
		--K;
		boolean[][] f = new boolean[N][N];
		for (int i = 0; i < N / 2; ++i) {
			f[i][i] = i % 2 == 0 ^ (K & (1 << (N / 2 - i - 1))) == 0;
			for (int j = 1; j <= i; ++j) {
				f[i - j][i + j] = f[i + j][i - j] = f[i][i] ^ j % 2 != 0;
			}
			for (int j = 0; j <= i; ++j) {
				int r = i - j;
				int c = i + 1 + j;
				int count = 0;
				if (f[r][c - 1] == f[r + 1][c - 1]) ++count;
				if (r != 0 && f[r][c - 1] == f[r - 1][c - 1]) ++count;
				if (c > 1 && f[r][c - 1] == f[r][c - 2]) ++count;
				f[r][c] = count >= 2 ? !f[r][c - 1] : f[r][c - 1];
			}
			for (int j = 0; j <= i; ++j) {
				int r = i + 1 + j;
				int c = i - j;
				int count = 0;
				if (f[r - 1][c] == f[r - 1][c + 1]) ++count;
				if (c != 0 && f[r - 1][c] == f[r - 1][c - 1]) ++count;
				if (r > 1 && f[r - 1][c] == f[r - 2][c]) ++count;
				f[r][c] = count >= 2 ? !f[r - 1][c] : f[r - 1][c];
			}
		}
		for (int i = 0; i < N; ++i) {
			for (int j = 0; j < N - i - 1; ++j) {
				f[N - 1 - i][N - 1 - j] = f[i][j];
			}
		}
		for (int i = 0; i < N; ++i) {
			for (int j = 0; j < N; ++j) {
				System.out.print(f[i][j] ? 'E' : '.');
			}
			System.out.println();
		}
		System.out.println();
	}
}

Measured memory_bytes: 12000
n=int(input())
d=[list(map(int,input().split())) for _ in range(n)]
for i in range(n-2):
    if d[i][0]==d[i][1]:
        if d[i+1][0]==d[i+1][1]:
            if d[i+2][0]==d[i+2][1]:
                print("Yes")
                exit()
print("No")

Measured memory_bytes: 9200
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using vll = vector<ll> ;
#define all(v) v.begin(),v.end()

int main(){
  vector<string> S{"SUN","MON","TUE","WED","THU","FRI","SAT"};
  string s;cin>>s;
  rep(i,S.size()){
    if(s==S[i]) cout<<7-i<<endl;
  }
}

Measured memory_bytes: 3548
#undef NDEBUG
#include <bits/stdc++.h>

using namespace std;

#define all(v) (v).begin(), (v).end()

using li = long long;
using ld = long double;

void solve(bool);

int main() {
#ifdef YA
    auto s = clock();
    assert(freopen("input.txt", "r", stdin));
    // assert(freopen("output.txt", "w", stdout));
#else
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#endif

    cout << fixed << setprecision(20);

    srand(time(0));
    solve(true);

#ifdef YA1
    while (true) solve(false);
#endif

#ifdef YA
    cout << endl << endl << "time = " << (clock() - s) / (double)CLOCKS_PER_SEC << endl;
#endif

    return 0;
}

void solve(bool __attribute__((unused)) read) {
    string s;
    li k;
    cin >> s >> k;
    li len = 0;
    li x = 0;
    li st_len = 0;
    li en_len;
    for (int i = 0; i < (int)s.size(); ++i) {
        ++len;
        if (i == (int)s.size() - 1 || s[i + 1] != s[i]) {
            if (st_len == 0)
                st_len = len;
            if (i == (int)s.size() - 1)
                en_len = len;
            x += len / 2;
            len = 0;
        }
    }
    if (st_len == (int)s.size()) {
        cout << st_len * k / 2 << endl;
    } else if (s[0] != s.back()) {
        cout << x * k << endl;
    } else {
        x -= st_len / 2;
        x -= en_len / 2;
        li ans = (st_len + en_len) / 2 * (k - 1) + x * k + st_len / 2 + en_len / 2;
        cout << ans << endl;
    }
}


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

t=0
z=0
x=0

for z in range(N):
    x=x+1
    if x>=10000:
        a=x//10000
        b=(x-a*10000)//1000
        c=(x-a*10000-b*1000)//100
        d=(x-a*10000-b*1000-c*100)//10
        e=x-a*10000-b*1000-c*100-d*10
        y=a+b+c+d+e
        if A<=y<=B:
            t=t+x
    elif 1000<=x<10000:
        f=x//1000
        g=(x-f*1000)//100
        h=(x-f*1000-g*100)//10
        i=x-f*1000-g*100-h*10
        y=f+g+h+i
        if A<=y<=B:
            t=t+x
    elif 100<=x<1000:
        j=x//100
        k=(x-j*100)//10
        l=x-j*100-k*10
        y=j+k+l
        if A<=y<=B:
            t=t+x
    elif 10<=x<100:
        m=x//10
        n=x-m*10
        y=m+n
        if A<=y<=B:
            t=t+x 
    else:
        o=x
        y=o
        if A<=y<=B:
            t=t+x

    
print(t)

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

ll N, a[300005];
ll maxsum[300005], minsum[300005];

priority_queue<ll> pq1, pq2;

int main() {
    scanf("%lld", &N);
    for (int i = 0; i < 3*N; i++) scanf("%lld", a+i);
    ll sum = 0;
    for (int i = 0; i < N; i++) pq1.push(-a[i]), sum += a[i];
    for (int i = N; i <= 2*N; i++) {
        maxsum[i] = sum;
        pq1.push(-a[i]);
        sum += a[i] + pq1.top();
        pq1.pop();
    }
    sum = 0;
    for (int i = 3*N-1; i >= 2*N; i--) pq2.push(a[i]), sum += a[i];
    minsum[2*N] = sum;
    for (int i = 2*N-1; i >= N; i--) {
        pq2.push(a[i]);
        sum += a[i] - pq2.top();
        pq2.pop();
        minsum[i] = sum;
    }

    ll ans = -1e17;
    for (int i = N; i <= 2*N; i++) {
        ans = max(ans, maxsum[i] - minsum[i]);
    }
    printf("%lld\n", ans);
}

Measured memory_bytes: 7668
import Control.Applicative
import Data.Bool (bool)

main :: IO ()
main = solve <$> f <*> f <*> readLn >>= putStrLn
  where
    f = map read <$> words <$> getLine

solve :: [Int] -> [Int] -> Int -> String
solve [a, v] [b, w] t = bool "NO" "YES" $ v > w && abs (a - b) <= (v - w) * t


Measured memory_bytes: 3884
n=int(input())
a=list(input())
b=list(input())
c=list(input())

ans=0
for i in range(n):
	tmp=set()
	tmp.add(a[i])
	tmp.add(b[i])
	tmp.add(c[i])
	ans+=len(tmp)-1
	tmp=set()

print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#define ll long long
using namespace std;
const int MAXN=100001;
vector<vector<int> > adj;
int v[MAXN],dep[MAXN];
int par[MAXN],deg[MAXN];
int root;
void no(){
    cout<<"NO";
    exit(0);
}
void yes(){
    cout<<"YES";
    exit(0);
}
ll dfs(int here,int dad,int d){
    ll mx=0;
    ll sum=0;
    for(auto there:adj[here]){
        if(there==dad)continue;
        ll t=dfs(there,here,d+1);
        mx=max(mx,t);
        sum+=t;
    }
    if(deg[here]==1 && here!=root)return v[here];
    if(root==here && deg[root]==1){
        if(v[here]-mx<0)no();
        return v[here]-mx;
    }
    else{
        if(2*v[here]-sum<0 || sum-v[here]<0 || v[here]<mx)no();
        return 2*v[here]-sum;
    }
}
set<pair<int,int> > st; //가장 큰원소2개
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    adj.resize(n+1);
    for(int i=1;i<=n;i++){
        cin>>v[i];
    }
    root=1;
    for(int i=1;i<=n-1;i++){
        int u,v;
        cin>>u>>v;
        adj[u].push_back(v);
        deg[v]++;
        adj[v].push_back(u);
        deg[u]++;
    }
    dfs(1,0,0);
    if(dfs(1,0,0))no();
    yes();
    
    return 0;
}

Measured memory_bytes: 13184
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vector<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;}

// 0 false, 1 true 
// string to int : -48
// ceil(a)  1.2->2.0
// c++17	g++ -std=c++17 a.cpp


int main() {
    std::cout << std::fixed << std::setprecision(15);
    ll n;
    cin >> n;
    map<ll,ll> mp;
    rep(i, n){
        ll tmp;
        cin >> tmp;
        mp[tmp]++;
    }
    ll q;
    cin >> q;

    ll ans = 0;
    rep(i,q){
        ll tmp;
        cin >> tmp;
        if(mp.count(tmp) >= 1) ans++;
    }
    cout << ans << endl;


}


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

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

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> p(m), y(m);
    vector<vector<pair<int, int>>> v(n);
 
    rep(i, m) {
        cin >> p[i] >> y[i];
        v[p[i]-1].push_back(make_pair(y[i], i));
    }
 
    rep(i, n) {
        sort(v[i].begin(), v[i].end());
 
        rep(j, v[i].size()) {
            y[v[i][j].second] = j+1;
        }
    }
 
    rep(i, m) {
        printf("%06d%06d\n", p[i], y[i]);
    }
    
    return 0;
}

Measured memory_bytes: 7808
N = int(input())
A = list(map(int,input().split()))
X = 0
Y = 0
Z = 0
for i in A:
    if i % 4 == 0:
        X += 1
    elif i % 2 == 1:
        Y += 1
    elif i % 2 == 0:
        Z = 1
Y+=Z
# print(X,Y,Z)
if X+1 >= Y:
    print('Yes')
else:
    print('No')

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


int main(){
    int n; cin >> n;
    vector<int> x;
    vector<int> y;
    for(int i=0;i<n;i++){
        int a,b;
        cin >> a >> b;
        x.push_back(a+b);
        y.push_back(a-b);
    }
    sort(x.begin(),x.end());
    sort(y.begin(),y.end());
    cout << max(x[n-1]-x[0],y[n-1]-y[0]);
}



Measured memory_bytes: 4720
n = int(input())
a = list(map(int,input().split()))
a = a*2
k = 0
for i in range(0,n):
  k += (-1)**(i+2)*a[i]
k = abs(k)
print(k,end=" ")
for i in range(0,n-1):
  y = 2*(a[i] - k/2)
  k = y
  print(int(y),end=" ")

Measured memory_bytes: 14092
#include<bits/stdc++.h>
using namespace std;
const long long mod=998244353;
int n,l[300005],r[300005],mx,an;
bool vi[300005];
vector<int>v;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>n;
    for(int i=1; i<=n; i++)
    {
        l[i]=1e9;
        r[i]=-1e9;
    }
    for(int i=0; i<n; i++)
    {
        int x;
        cin>>x;
        l[x]=min(l[x],i);
        r[x]=max(r[x],i);
        if(vi[x]==false)v.push_back(x);
        vi[x]=true;
    }
    sort(v.begin(),v.end());
    an=1;
    mx=0;
    for(int i=1; i<v.size(); i++)
    {
        mx=max(mx,an);
        if(l[v[i]]>r[v[i-1]])an++;
        else an=1;
    }
    mx=max(mx,an);
    cout<<v.size()-mx<<endl;

}


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



void solve() {
    int n; cin >> n;
    int x = 0;
    vector<int> a(n);
    for (int i = 0; i < n; i++)
        cin >> a[i], x ^= a[i];
    for (int i = 0; i < n; i++) 
        cout << (a[i] ^ x) << ' ';
    cout << '\n';
}
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    // int _; cin >> _; while (_--)
    solve();
    return 0;
}


Measured memory_bytes: 3972
#include<stdio.h>
int main()
{
    double N,s,d=0;
    scanf("%lf",&N);
    int i;
    for(i=1;i<=N;i++)
    {
        if(i%2!=0)
        {
            d++;
        }

    }
    s=d/N;
    printf("%lf",s);
    return 0;

}


Measured memory_bytes: 128
def main():
  c = []
  for _ in range(3):
    c.append(list(input_list()))
  
  for a1 in range(101):
    b1 = c[0][0] - a1
    b2 = c[0][1] - a1
    b3 = c[0][2] - a1
    a2 = c[1][0] - b1
    a3 = c[2][0] - b1
    if a1+b1 == c[0][0] and a1+b2 == c[0][1] and a1+b3 == c[0][2] and\
    a2+b1 == c[1][0] and a3+b1 == c[2][0] and a2+b2 == c[1][1] and a2+b3 == c[1][2] and\
    a3+b2 == c[2][1] and a3+b3 == c[2][2]:
      print('Yes')
      exit()
  print('No')
    
def input_list():
  return map(int, input().split())

def input_list_str():
  return map(str, input().split())

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

# 2で割り切れる回数
def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c 

import math
import fractions
import collections
from functools import reduce
main()

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

using namespace std;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(ll (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(ll (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define MOD 1000000007


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

int main()
{
	int x;cin >> x;
	int ans = 1;
	for(int i = 2;i <= x;i++){
		for(int j = 2;j < i;j++){
			if(i % j == 0){
				int tmp = i;
				int cou = 0;
				while(tmp % j == 0){
					tmp /= j;
					cou++;
				}
				if(cou > 1 && tmp == 1)ans = i;
			}
		}
	}
	
	cout << ans << endl;
		
	
	return 0;
}

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

int main() {
	int n;
	cin >> n;
	int maxi;
	cin >> maxi;
	int count = 1;
	for (int i = 1; i < n; i++) {
		int temp;
		cin >> temp;
		if (maxi <= temp) {
			count++;
			maxi = max(maxi, temp);
		}
	}
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 3532
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))

int compare_f(const void *a, const void *b) {
	return *((size_t *)a) < *((size_t *)b) ? -1 : 1;
}

static size_t comb(const size_t n, const size_t r) {
	size_t result = 1;

	for (size_t i = 0; i < r; i++) {
		result *= n - i;
		result /= i + 1;
	}

	return result;
}

static uint64_t gcd(uint64_t m, uint64_t n)
{
	uint64_t temp;

	while (m%n != 0) {
		temp = n;
		n = m % n;
		m = temp;
	}

	return n;
}

int main(void) {
	size_t N;

	scanf("%zu", &N);

	size_t count = 0;
	while (0 < N) {
		if (N % 10 == 2) {
			count++;
		}

		N /= 10;
	}

	printf("%zu", count);

	return 0;
}


Measured memory_bytes: 128
#include <stdio.h>

int main(void)
{
	int a, b, c;
	int i, divisor = 0;

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

	i = a;	
	while (i <= b)
	{
		if (c % i == 0)
			divisor++;

		i++;
	}

	printf("%d\n", divisor);

	return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#pragma gcc optimize ("O3")
#pragma gcc optimize ("Ofast")
using namespace std;
typedef long long ll;
char s[15];

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> s+1;
	if(strlen(s+1) % 2) {
		cout << "No";
		return 0;
	}
	for(int i = 1;i <= strlen(s+1);i += 2) {
		if(s[i] != 'h'||s[i+1] != 'i') {
			cout << "No";
			return 0;
		}
	}
	cout << "Yes";
}

Measured memory_bytes: 256
x=int(input())
for A in range(10**5):
    k=A**5-x
    if k>=0:
        l=int(k**0.2)
        if l**5==k:
            print(A,l)
            break
    else:
        k=-k
        l=int(k**0.2)
        if l**5==k:
            print(A,-l)
            break



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

int main(){
  string N; cin >> N;
  if(N.size()==1){
    cout << N << endl;
  }else{
    bool nine=true;
    for(int i=1; i<N.size(); i++){
      if(N[i]!='9') nine=false;
    }
    int top=N[0]-'0';
    if(nine==true){
      cout << top+9*(N.size()-1) << endl;
    }else{
      cout << top-1+9*(N.size()-1) << endl;
    }
  }
}

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

const long int mod = 1000000007;

int main() {
  char s[100005];
  cin >> s;

  long int dp[100005][13];
  dp[0][0] = 1;

  long int mul = 1;
  int n = strlen(s);

  for (int i = 0; i < n; i++) {
      if (s[n - (i+1)] == '?') {
        for (int j = 0; j < 13; j++) {
          for (int k = 0; k < 10; k++) {
            dp[i + 1][(k * mul + j) % 13] += dp[i][j];
            dp[i + 1][(k * mul + j) % 13] %= mod;
          }
        }
      } else {
        int c = s[n - (i+1)] - '0';
        for (int j = 0; j < 13; j++) {
          dp[i + 1][(c * mul + j) % 13] += dp[i][j];
          dp[i + 1][(c * mul + j) % 13] %= mod;
        }
      }

      for (int j = 0; j < 13; j++) {
        dp[i+1][j] %= mod;
      }

      mul *= 10;
      mul %= 13;
  }
  
  long long int res = dp[n][5];
  cout << res << endl;

  return 0;
}

Measured memory_bytes: 10496
N = int(input())
h = list(map(int, input().split()))

ans = 0
atmp = 0

for i in range(1, N):
    if h[i - 1] >= h[i]:
        atmp += 1
    else:
        ans = max(ans, atmp)
        atmp = 0
ans = max(ans, atmp)

print(ans)

Measured memory_bytes: 15020
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;


#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define PSET(x,y) fixed<<setprecision(y)<<x
#define pb push_back
#define pii pair<int,int>
#define pf push_front
#define mp make_pair
#define vi vector<int>
#define vip vector<pair<int,int> >
#define ff first
#define ss second
#define int long long
#define mod 1000000007
#define BIG 998244353
#define s(t) scanf("%lld",&t)
#define p(t) printf("%lld\n",t)
#define mii map<int,int>
#define MSET(table,i) memset(table, i, sizeof(table))
#define endl '\n'
#define tc int t;cin>>t;while(t--)
#define pi  3.1415926358
#define bits(x) __builtin_popcount(x)
#define minimum(a,n) min_element(a,a+n)-a
#define maximum(a,n) max_element(a,a+n)-a
#define pqbig priority_queue<int>
#define pqsmall priority_queue<pair<int,pii>,vector<pair<int,pii> >,greater<pair<int,pii> > >
#define all(v) v.begin(),v.end()
#define sitr set<int>:: iterator
#define spitr set<pii>:: iterator
#define mitr map<string,int>:: iterator

int toint(const string &s) {stringstream ss; ss << s; int x; ss >> x; return x;}
string tostring ( int number ) {stringstream ss; ss << number; return ss.str();}

typedef tree<pii, null_type, less<pii>, rb_tree_tag,
        tree_order_statistics_node_update>
        new_data_set;

#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl

int32_t main()
{
    fast;
    int arr[]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int k;cin>>k;
    cout<<arr[k-1];
}

Measured memory_bytes: 256
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())


k, a, b = li()

if b <= a+2 or k < a:
    print(k+1)
else:
    k -= (a-1)
    print(a + (b - a) * (k // 2) + bool(k%2))


Measured memory_bytes: 3064
#include <iostream>

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

  while(std::cin >> x[n++]);
  for(int i = 0; i < n-2; i++){
    std::cout << "Case " << i+1 << ": " << x[i] << std::endl;
  }

  return 0;
}



Measured memory_bytes: 3124
#include<bits/stdc++.h>
using namespace std;
#define ll  long long int
#define ld long double
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,a) REP(i,0,a)
#define REV(i,a,b) for(i=a-1;i>=b;i--)
#define rev(s) reverse(s.begin(),s.end())
#define pb push_back
#define mp make_pair
#define ord(v) sort(v.begin(),v.end());
const ll MAXN=2*1e5+10;
#define MAX 2*1e9
#define fi first
#define se second
#define pi 3.141592653589793238
#define rem 1000000007
#define eps 1e-9
// fflush(stdout);
//lower_bound,upper_bound,equal_range
int main()
{
	#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
	int n,W;
	cin>>n>>W;
	int i,j;
	vector<int>v(n),w(n);
	vector<pair<int,int>>q;
	rep(i,n)
	{
		cin>>w[i]>>v[i];
		q.push_back(mp(w[i],v[i]));
	}
	sort(q.begin(),q.end());
	rep(i,n)
	{
		w[i]=q[i].first;
		v[i]=q[i].second;
	}
	vector<vector<ll>>dp(n,vector<ll>(W+1,0));
	REP(i,1,W+1)
	{
		if(i>=w[0])dp[0][i]=v[0];
	}
	REP(i,1,n)
	{
		REP(j,1,W+1)
		{
			if(j>=w[i])dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i]]+v[i]);
			else
			{
				dp[i][j]=dp[i-1][j];
			}
		}
	}
	cout<<dp[n-1][W];
	return 0;
}

Measured memory_bytes: 82456
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define SZ(x) ((int)(x).size())
#define rep(i,n) for(int i=0;i<(n);++i)
#define fore(i,a) for(auto &i:a)
#define min(...) min({__VA_ARGS__})
#define max(...) max({__VA_ARGS__})
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define ALL(x) (x).begin(),(x).end()
signed _main(); signed main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
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; }
template<class T> using v = vector<T>;
template<class T> using vv = vector<v<T>>;
const int MOD=1e9+7;
const long long INF = 1LL << 60;
using P=pair<int,int>;

signed _main(){
  double A,B,H,M; cin >> A >> B >> H >> M;
  double theta = min(abs(6.0*M-(60.0*H+M)/2.0),360.0-abs(6.0*M-(60.0*H+M)/2.0));
  //cout << theta << endl;
  //cout << cos(theta/180.0*M_PI) << endl;
  double ans = sqrt(A*A+B*B-2*A*B*cos(theta/180.0*M_PI));
  cout << fixed << setprecision(9) << ans << endl;

  return 0;
}


Measured memory_bytes: 4144
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int N, M, C;
    cin >> N >> M >> C;
    int B[M];
    int A[N][M];
    for (int i = 0; i < M; i++)
    {
        cin >> B[i];
    }
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < M; j++)
        {
            cin >> A[i][j];
        }
    }
    int cnt = 0;
    for (int i = 0; i < N; i++)
    {
        int sum = 0;
        for (int j = 0; j < M; j++)
        {
            sum += A[i][j] * B[j];
        }
        sum += C;
        if (sum > 0)
            cnt++;
    }
    cout << cnt << endl;
}


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

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
#define out(ans) cout << ans << endl;
const long long mod = 1e9 + 7;

int GetDigit(ll num)
{
  ll digit = 0;
  while (num != 0)
  {
    num /= 10;
    digit++;
  }
  return digit;
}

int main()
{
  ll n;
  cin >> n;
  ll count = 0;
  for (ll i = 1; i <= n; i++)
  {
    if(GetDigit(i)%2==1)
      count++;
  }
  out(count);

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String string = scanner.nextLine();
		for (int i = 1; i < string.length(); i++) {
			for (int j = 0; j < i; j++) {
				if (string.charAt(i) == string.charAt(j)) {
					System.out.println("no");
					System.exit(0);
				}
			}
		}
		System.out.println("yes");
		scanner.close();
	}
}


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

#define f first
#define s second
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define ll long long
#define ull unsigned long long
#define db double
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pli pair<ll, int>
#define px pair<db, db>
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define input(a) for (auto& el : a) cin >> el;
#define output(a) cout << '!'; for (auto& el : a) cout << el << ' '; cout << '\n'; cout.flush();
#define sz(el) int(el.size())
#define sq(a) ((a) * (a))
#define xll bitset<128>
#define xmin(a,b) a = min(a, b)
#define xmax(a,b) a = max(a, b)
#define sun(a) sort(all(a)); a.resize(unique(all(a)) - a.begin());
/**/  /// extra
//#define forn(i,n) for (int i = 0; i < n; ++i)
//#define rforn(i,n) for (int i = n - 1; i >= 0; --i)
#define bn '\n'
#define vi vector<int>
#define vii vector<vi>
#define vl vector<ll>
#define vll vector<vl>
//#define G vector<vector<pii>>
#define GVE vector<vector<edge>>
#define usi unordered_set<int>
#define usp set<pii>
/**/

using namespace std;

const int INF = 1'000'000'017;
const ll LLINF = 1'000'000'000'000'000'017LL;
const ld inf = 1.0 / 0.0;
const ld eps = 1e-9;
const int MOD = 998244353;

//mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

//uniform_int_distribution<int> uid(l, r); [l, r]
//int x = uid(rng);

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

    int n;
    cin >> n;
    int nd = 1, del = 0;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        if (x == nd) {
            ++nd;
        } else {
            ++del;
        }
    }
    cout << (del == n ? -1 : del);
    return 0;
}


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

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int Alice = 0;
		int Bob = 0;
		int n = sc.nextInt();
		int []a = new int [n ];
		
		for (int i = 0; i < n  ; i++) {
			a[i] = sc.nextInt();	
		}
		 Arrays.sort(a);
		 if (n % 2 == 0)
		for(int i = 1 ; i <= n/2 ; i++) {
			Alice += a[n - ( 2 * i - 1)];
			Bob += a[n - (2 * i) ];					
		}
		 if (n % 2 == 1) {
		for(int i = 1; i <= (n - 1)/2; i++) {
			Alice += a[n - (2 * i - 1)];
			Bob += a[n - (i * 2)];					
		}
		    Alice += a[0];
		 }
		 
		System.out.println((Alice - Bob));
		
	}
			
	}




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

typedef long long int ll;

int main(){
    ll N;
    cin >> N;
    vector<ll> A(N,0);
    for(int i = 0;i < N;i++)cin >> A[i];
    sort(A.begin(),A.end());
    ll ans = 0;
    int cnt = 1;
    for(int i = 0;i < N;i++){
        if(A[i] == A[i+1]){
            cnt++;
        }else{
            if(cnt % 2 == 1){
                ans++;
            }
            cnt = 1;
            i = i + cnt - 1;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 1024
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;

struct str{
    char s[102];
    int len;
    
    bool operator < (const str &b) const{
        for(int i=0;i<len && i< b.len;i++){
            if(s[i]!=b.s[i])return s[i]<b.s[i];
        }
        return len<b.len;
    }
    
    void print(){
        for(int i=0;i<len;i++)putchar(s[i]);
    }
};
str A[100];
int main(){
    char buf[102];
    int n,l;
    cin>>n>>l;
    cin.getline(buf,101);
    for(int i=0;i<n;i++){
        cin.getline(A[i].s,101);
        A[i].len=l;
    }
    sort(A,A+n);
    for(int i=0;i<n;i++)A[i].print();
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

#define MAX 100001

typedef struct{
  char name[11];
  int time;
} queue;

queue Q[MAX];
int front,p,pos,empty;

void push(queue);
queue pop(void);

int main(){
  int n,q,i,sum = 0;
  queue que;

  scanf("%d %d" ,&n ,&q);
  for(i = 0 ; i < n ; i++){
    scanf("%s %d" ,Q[i].name ,&Q[i].time);
  }

  front = 0;
  empty = p = n;
  while(empty != 0){
    que = pop(); 

    if(que.time == 0){
      continue;
    }
  
    if(que.time > q){
      Q[pos].time -= q;
      sum += q;
      push(Q[pos]);
    }else{
      sum += Q[pos].time;
      Q[pos].time = 0;

      printf("%s %d\n" ,Q[pos].name, sum);
    }
  }

  return 0;
}

void push(queue que){
  empty++;
  Q[p++] = que;
  p %= MAX;
}

queue pop(){
  empty--;
  pos = front;
  queue res = Q[front++];
  front %= MAX;
  return res;
}

Measured memory_bytes: 2160
#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include <cassert>
#include <cmath>
#include<cstdint>

#define INF 1e9
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()

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



int main(){
    int n;
    cin >> n;
    vector<ll> A(n), b(n), v;
    rep(i, n){
        cin >> b[i];
        A[i] = i + b[i];
        v.push_back(A[i]);
    }
    v.push_back(INF * INF);
    sort(ALL(v));

    ll res = 0;
    REP(i, 1, n - 1){
        ll now = i - b[i];
        res += upper_bound( ALL(v), now) - lower_bound( ALL(v), now);
    }
    cout << res << endl;
}



Measured memory_bytes: 8500
s = input()
l = 0
r = len(s) -1
for i in range(len(s)):
    if s[i] == "A":
        l = i
        break
for i in range(len(s)-1,-1,-1):
    if s[i] == "Z":
        r = i
        break
print(r-l+1)

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

#define rep(i,n)  for(int i=0;i<n;++i)
#define per(i,n)  for(int i=n-1;i>=0;--i)
#define sc1(a)  scanf("%d",&a)
#define sc2(a,b)  scanf("%d %d",&a,&b)
#define sc3(a,b,c)  scanf("%d %d %d",&a,&b,&c)
#define sl1(a)  scanf("%lld",&a)
#define sl2(a,b)  scanf("%lld %lld",&a,&b)
#define sl3(a,b,c)  scanf("%lld %lld %lld",&a,&b,&c)
#define PI 3.1415926535897932

//typedef long long ll;


int lcm(int a,int b) { return a*b/__gcd(a,b); }
//ll lcm(ll a,ll b) { return a*b/__gcd(a,b); }

/**
 * sort(ar.begin(),ar.end())
 * int sum=accumulate(ar.begin(),ar.end(),0);
 **/


int main(){
    int n,ans=0;
    scanf("%d",&n);
    ans=1000-(n%1000);
    if (ans==1000) {
        printf("0\n");
    } else {
        printf("%d\n",ans);
    }
    return 0;
}


Measured memory_bytes: 3724
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
using namespace std;

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

typedef long long ll;

const int kMaxN = 100;

int N, a[kMaxN];
int ans;

int main() {
  cin >> N;
  REP(i, N) { cin >> a[i]; }

  priority_queue<int> q;
  REP(i, N) { q.push(a[i]); }
  int a = 0;
  int b = 0;
  bool turn_a = true;
  while (!q.empty()) {
    if (turn_a) {
      a += q.top();
    } else {
      b += q.top();
    }
    q.pop();
    turn_a = !turn_a;
  }
  ans = a-b;

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


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

c = []
d = []
for i in range(n):
	s = list(map(int, input().split()))
	#a = s.pop(0)
	#c.append(a)
	d.append(s)
ans = 10**9
for i in range(1,n+1):
	for j in itertools.combinations(d,i):
		s = [0 for ii in range(m+1)]
		for k in j:
			for l in range(m+1):
				s[l] += k[l]
		y = min(s[1:])
		if y >= x:
			ans = min(ans,s[0])
if ans == 10**9:
	print (-1)
else:
	print (ans)


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

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

int arr[200001], sc[200001][61];

int succ(int v, int k)
{
    if (sc[v][k] != 0)
        return sc[v][k];
    if (k == 0)
        return sc[v][k] = arr[v];
    return sc[v][k] = succ(succ(v, k-1), k-1);
}

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

    int n;
    ll k;
    cin >> n >> k;
    for (int i = 1; i <= n; i++)
        cin >> arr[i];
    int ans = 1;
    for (int i = 60; i >= 0; i--) {
        if (((k >> i) & 1) == 1)
            ans = succ(ans, i);
    }
    cout << ans;

    return 0;
}


Measured memory_bytes: 52056
#include <iostream>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <stack>
#define Endl endl
#define mp make_pair
#define rep(N) for(int i=0;i<N;i++)
#define repj(N) for(int j=0;j<N;j++)
#define ll long long 
#define pii pair<int,int>
#define pll pair<ll,ll>
#define For(I,N) for(int I=0;I<N;I++)
#define cinone(N) int N;cin>>N;
#define scanfone(N) int N;cin>>N;
#define cinng(N,M) int N[M];for(int yiuytvnm=0;yiuytvnm<M;yiuytvnm++) cin>>N[yiuytvnm];
#define scanfng(N,M) int N[M];for(int qrwuoiq=0;qrwuoiq<M;qrwuoiq++) scanf("%d",&N[qrwuoiq]);
#define over(A) {cout<<A<<endl;exit(0);}
#define all(A) A.begin(),A.end()
#define ceil(a,b) ((a-1)/b+1)
typedef unsigned long long ull;
const int inf=1039074182;
using namespace std;
ll dp[200005];
ll bit[400005];
int nn;
int n;
int a[200005];
int cost[200005];
int id[200005];

void update(int x,ll v)
{
	while(x<=nn)
	{
		bit[x]=max(bit[x],v);
		x+=x&-x;
	}
}

ll query(int x)
{
	ll res=0;
	while(x)
	{
		res=max(res,bit[x]);
		x&=x-1;
	}
	return res;
}

int main()
{
//	freopen("input.txt","r",stdin);
	ios_base::sync_with_stdio(false);
	cin>>n;
	nn=1;
	while(nn<n)
	{
		nn<<=1;
	}
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		id[a[i]]=i;
	}
	for(int i=0;i<n;i++)
	{
		cin>>cost[i];
	}
	for(int h=1;h<=n;h++)
	{
//		cout<<h<<' '<<query(id[h])<<endl;
		dp[h]=query(id[h])+cost[id[h]];
		update(id[h]+1,dp[h]);
	}
	cout<<query(n)<<endl;
	return 0;
}

Measured memory_bytes: 7296
#include <cstdio>
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#define rep(i,n) for (int i=0;i<n;i++)
using ll = long long;
using namespace std;

void solve(){

}
int main (){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,k;
    cin >> n >> k;
    double ans = 0.0;
    rep(i,n){
        int cnt=0;
        int q=i+1;
        while(q<k){
            cnt++;
            q*=2;
        }
        // cout << cnt << endl;
        double p=1.0;
        rep(i,cnt){
            p*=0.5;
        }
        ans += p;
    }
    cout << setprecision(10) << (double) ans/n << endl;
    return 0;
}

Measured memory_bytes: 3780
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define lf long double
#define F first
#define S second
typedef vector <ll> vi;
typedef pair <ll,ll> ii;
typedef vector <pair <ll,ll> >vii;
typedef vector <vector <ll> > vv;
typedef vector <string> vs;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll s;
    cin>>s;
    ll n=1000000000;
    if(s==1000000000000000000ll)
    {
        ll b=n-1;
        ll c=n;
        ll y=b+1;
        ll x=n-c;
        cout<<"0 0 "<<n<<" "<<0<<" "<<0<<" "<<n<<endl;
        return 0;
    }
    ll b=s/n;
    ll c=s%n;
    ll x=n-c;
    ll y=b+1;
    cout<<"0 0 "<<n<<" "<<1<<" "<<x<<" "<<y<<endl;
} 


Measured memory_bytes: 256
/*ex7_3
saitomo*/
#include <stdio.h>
#include <stdlib.h>


int main(void){
    int col, row,i,j;
    int *count_row, *count_col;
    char **box;
    scanf("%d%d", &row, &col);
    // メモリ領域の確保
    count_row = (int*)calloc(row, sizeof(int));
    // エラーチェック
    if (count_row == NULL){
        exit(1);
    }
    // メモリ領域の確保
    count_col = (int*)calloc(col, sizeof(int));
    // エラーチェック
    if (count_col == NULL){
        exit(1);
    }
    // メモリ領域の確保
    box = (char**)calloc(row, sizeof(char*));
    // エラーチェック
    if (box == NULL){
        exit(1);
    }
    for (int i=0; i<row; i++){
        // メモリ領域の確保
        box[i] = (char*)calloc(col, sizeof(char));
        // エラーチェック
        if(box[i] == NULL){
            exit(1);
        }
    }
    for(i=0;i<row;i++){
        for(j=0;j<col;j++){
            scanf(" %c",&box[i][j]);
            count_row[i]=0;//値の初期化
            count_col[j]=0;
        }
    }
    for(i=0;i<row;i++){
        for(j=0;j<col;j++){
            if(box[i][j]=='#'){
                count_row[i]=1;//行または列に＃が存在すれば1となる
                count_col[j]=1;
            }
        }
    }
    for(i=0;i<row;i++){
        if(count_row[i]==1){//行中に＃があるか判定
            for(j=0;j<col;j++){
                 if(count_col[j]){//列中に＃があるか判定
                      printf("%c",box[i][j]);//消えない部分をプリントする
                 }
            }
            printf("\n");//1行ごとに改行
        }
    }
    free(count_row);//メモリの解放
    free(count_col);
    for (int i=0; i<row; i++){
        free(box[i]);
    }
    free(box);

    return 0;
}


Measured memory_bytes: 1648
W, H, x, y, r = map(int, input().split())

def in_range(low, high, max):
    return 0 <= low and high <= max

def within(W, H, x, y, r):
    return in_range(x - r, x + r, W) and in_range(y - r, y + r, H)

if within(W, H, x, y, r):
    print("Yes")
else:
    print("No")


Measured memory_bytes: 5600
N,K,Q=input().split()
N=int(N)
K=int(K)
Q=int(Q)

a=[]
for q in range(Q):
    a.append(int(input()))

cnt=[0]*N
for q in range(Q):
    cnt[int(a[q])-1]+=1

for n in range(N):
    if K - (Q - cnt[n]) > 0:    
        print('Yes')
    else:
        print('No')

Measured memory_bytes: 8592
#include<iostream>
#include<iomanip>
#include<math.h>
using namespace std;
typedef struct POINT
{
    double x;
    double y;
}POINT;
double dist(POINT a,POINT b)
{
    return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}
bool cocircle(POINT p1,POINT p2,POINT p3,POINT &q,double &r)
{
  double x12=p2.x-p1.x;
  double y12=p2.y-p1.y;
  double x13=p3.x-p1.x;
  double y13=p3.y-p1.y;
  double z2=x12*(p1.x+p2.x)+y12*(p1.y+p2.y);
  double z3=x13*(p1.x+p3.x)+y13*(p1.y+p3.y);
  double d=2.0*(x12*(p3.y-p2.y)-y12*(p3.x-p2.x));
  //if(abs(d)<EP)                           //共&#32447;，&#22278;不存在
     //return false;
  q.x=(y13*z2-y12*z3)/d;
  q.y=(x12*z3-x13*z2)/d;
  r=dist(p1,q);
  return true;
}
int main()
{
    int n;
    double x1,x2,x3,y1,y2,y3,xp,yp,r;
    cin>>n;
    while(n--)
    {
        cin>>x1>>y1>>x2>>y2>>x3>>y3;
        POINT A,B,C,P;
        A.x=x1;
        A.y=y1;
        B.x=x2;
        B.y=y2;
        C.x=x3;
        C.y=y3;
        cocircle(A,B,C,P,r);
        cout<<fixed << setprecision(3)<<P.x<<' '<<P.y<<' '<<r<<endl;
    }

    return 0;
}

Measured memory_bytes: 1288
#include <bit>
#include <bitset>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <iomanip>

typedef long double ld;
typedef long long ll;

using namespace std;


/* TEMPLATE ENDS HERE */

int main() {
	cout << fixed << setprecision(12);	
	int k;
	cin >> k;
	cout << 1 - k << endl;
	return 0;
}


ll MOD = ((ll)1e9 + 7);

struct mod {
	ll x;

	mod(ll tx = 0) {
		x = tx;
		x %= MOD;
	}
	
	mod& operator=(const ll & tx) {
		x = tx % MOD;
		return *this;
	}
	
	mod& operator=(const mod & m2) {
		x = m2.x;
		return *this;
	}

	mod operator+(const mod& m2) const {
		return mod((x + m2.x) % MOD);
	}

	mod& operator+=(const mod& m2) {
		x += m2.x;
		x %= MOD;
		return *this;
	}

	mod operator-(const mod & m2) const {
		return mod((x - m2.x + MOD) % MOD);
	}

	mod& operator-=(const mod & m2) {
		x -= m2.x;
		x = (x + MOD) % MOD;
		return *this;
	}

	mod operator*(const mod & m2) const {
		return mod((x * m2.x) % MOD);
	}

	mod& operator*=(const mod & m2) {
		x *= m2.x;
		x %= MOD;
		return *this;
	}

	mod mypow(ll k) const {
		mod ret = 1;
		mod cur = x;
		while (k) {
			if (k & 1) {
				ret *= cur;
			}
			cur *= cur;
			k >>= 1;
		}
		return ret;
	}

	mod inv() const {
		return mypow(MOD - 2);
	}

	mod operator/(const mod & m2) const {
		return (*this) * m2.inv();
	}

	mod& operator/=(const mod & m2) {
		x *= m2.inv().x;
		x %= MOD;
		return *this;
	}

	bool operator<(const mod & m2) const {
		return x < m2.x;
	}
};

ostream &operator<<(ostream & os, const mod & m) {
	return os << m.x;
}



Measured memory_bytes: 3612
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define MOD 1000000007
using namespace std;

typedef pair<int, int> P;
typedef pair<long long, long long> LLP;

int main() {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cout << (x2 - (y2 - y1)) << " " << (y2 - (x1 - x2)) << " " << (x1 - (y2 - y1)) << " " << (y1 - (x1 - x2)) << endl;
    return 0;
}

Measured memory_bytes: 256
"""
C - Coloring Colorfully
https://atcoder.jp/contests/abc124/tasks/abc124_c
"""
if __name__ == '__main__':
    S = str(input())

    len_S = len(S)
    S_list = []
    answer_type_1 = []
    answer_type_2 = []
    for i in range(0, len_S):
        S_list.append(S[i])
        if i % 2 == 0:
            answer_type_1.append("0")
            answer_type_2.append("1")
        else:
            answer_type_1.append("1")
            answer_type_2.append("0")

    answer_1 = 0
    answer_2 = 0

    for i, Si in enumerate(S_list):
        if S_list[i] != answer_type_1[i]:
            answer_1 += 1
        if S_list[i] != answer_type_2[i]:
            answer_2 += 1

    answer = min(answer_1, answer_2)

    print(answer)

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

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


Measured memory_bytes: 3288
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
#define first first
#define second se
using namespace std;
typedef pair<int, int> P;
typedef vector<int> vi;

int gcd(int a, int b){
    if(a < b) swap(a, b);
    if(b == 0) return a;
    return gcd(b, a % b);
}

int lcm(int a, int b){
    return a / gcd(a, b) * b;
}

signed main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, 0, n){
        cin >> a[i];
    }
    int ans = 1;
    rep(i, 0, n){
        ans = lcm(ans, a[i]);
    }
    o(ans);
}

Measured memory_bytes: 3108
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <vector>
#include <string>
using namespace std;

#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)
#pragma GCC optimize("unroll-loops")

#define DEBUG(x) cout << ">> " << #x << ": " << x << endl;
#define _ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const int MOD = 1000000007;
typedef long long ll;
typedef long double ld;

int main() { _
  int n, k; cin >> n >> k;
  int count = 0;
  for (int i = 0; i < n; i++) {
    int h; cin >> h;
    if (h >= k) count++;
  }
  cout << count << endl;
  return 0;
}

Measured memory_bytes: 384
#include<iostream>
using namespace std;
typedef long long ll;

ll n;
ll v[100010][3];

ll dp[100010][3];


int main(){

    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> v[i][0] >> v[i][1] >> v[i][2];
    }

    dp[0][0] = v[0][0];
    dp[0][1] = v[0][1];
    dp[0][2] = v[0][2];

    for(int i = 1; i < n; i++){
        for(int j = 0; j < 3; j++){
            for(int k = 0; k < 3; k++){
                if(j == k) continue;

                dp[i][j] = max(dp[i][j], dp[i-1][k] + v[i][j]);
            }
        }
    }

    ll ans = 0;
    for(int i = 0; i < 3; i++){
        ans = max(ans, dp[n-1][i]);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 4992