akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>

using namespace std;
typedef long long ll;

int main()
{
	int N;
	char S[51];
	
	scanf("%d", &N);
	scanf("%s", S);
	
	int count = 0;
	for(int i = 0; i < N-2; i++)
	{
		if(S[i] == 'A' && S[i+1] == 'B' && S[i+2] == 'C'){
			count++;
		}
	}
	
	printf("%d\n", count);
	
	return 0;
}

Measured memory_bytes: 128
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-6;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
char in[110];
int main(){
	scanf("%s",in);
	int n=strlen(in);
	for(int i=0;i<n;i++)for(int j=i+1;j<n;j++)if(in[i]==in[j]){printf("no\n");return 0;}
	printf("yes\n");
}

Measured memory_bytes: 128
#include <iostream>


int main()
{
	int num = 0;
	std::cin >> num;
	int rem = num % 10;
	if (rem == 0 || rem == 1 || rem == 6 || rem == 8) {
		std::cout << "pon";
	}
	else if (rem == 3) {
		std::cout << "bon";
	}
	else {
		std::cout << "hon";
	}
	return 0;
}

Measured memory_bytes: 3592
let count = 0;

const func = (nums: Array<number>) => {
  const isAllEven = nums.every(n => n % 2 === 0);
  if (!isAllEven) return;
  
  count++;
  func(nums.map(n => n / 2));
}

const Main = (input) {
  const [length, nums] = input.split("\n");
  const numsArr = nums.split(' ');
  func(numsArr.map(n => Number(n)));
  console.log(count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 11468
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

typedef long long ll;
typedef uint64_t ull;
typedef pair<int, int> P;
typedef pair<int, double> Pid;
typedef pair<double, int> Pdi;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
typedef pair<int, pair<int, int>> PP;
typedef pair<P, int> PPi;
constexpr double PI = 3.1415926535897932;   // acos(-1)
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define chadd(x, y) x = (x + y) % mod

bool unused[2525252];

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

    int n, k;
    cin >> n >> k;
    vector<ll> a(n);
    vector<ll> sum(n + 1, 0);
    for(int i = 0; i < n; ++i){
        cin >> a[i];
        sum[i + 1] = sum[i] + a[i];
    }
    vector<ll> val;
    for(int i = 0; i < n; ++i){
        for(int j = 1; j <= n - i; ++j){
            val.push_back(sum[i + j] - sum[i]);
        }
    }
    ll ans = 0;
    int sz = val.size();
    for(int d = 40; d >= 0; --d){
        int cnt = 0;
        for(int i = 0; i < sz; ++i){
            if(unused[i])   continue;
            if((val[i] >> d) & 1)   ++cnt;
        }

        if(cnt < k) continue;
        ans += (1ll << d);
        for(int i = 0; i < sz; ++i){
            if(unused[i])   continue;
            if((val[i] >> d) & 1)   continue;
            unused[i] = true;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 6384
h,w = map(int,input().split())
ans = []
n = h
for i in range(h):
  s = input()
  if("#" in s):
    ans.append(s)
  else:
    n -= 1
i = 0
j = w-1
while True:
  if(i > j):
    break
  flg = True
  for k in range(n):
    if(ans[k][i] == "#"):
      flg = False
      break
  if(flg):
    for k in range(n):
      ans[k] = ans[k][:i] + ans[k][i+1:]
    j -= 1
  else:
    i += 1
for i in ans:
  print(i)

Measured memory_bytes: 3064
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut iter = buf.split_whitespace();
    let n: usize = iter.next().unwrap().parse().unwrap();
    println!("{}", (n - n / 2) as f32 / (n as f32));
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
map<ll, ll> mp;
struct  pnt
{
	ll g, x;
};
pnt mkk(ll a, ll b){
	pnt tmp;tmp.g=a;tmp.x=b;
	return tmp;
}
	ll n, a, b, c, d;
bool operator < (pnt a, pnt b){
	// if(b.x==a.x){
		return a.g>b.g;
	// }
	if((a.g-b.g)/d==(b.x-a.x) && (a.g-b.g)%d==0)
		return a.x>b.x;
	return (a.g-b.g)/d>(b.x-a.x);
	// ll tmp1=1e18, tmp2=1e18;
	// if(a.x<tmp1/d){
	// 	tmp1=a.x*d;
	// }
	// if(b.x<tmp2/d){
	// 	tmp2=b.x*
	// }
}
int main(){
	int t;
    cin>>t;
    while(t--){
    	scanf("%lld",&n);
    	scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
    	priority_queue<pnt>q;
    	q.push(mkk(0,n));
    	q.push(mkk(d,n+1));
    	q.push(mkk(2*d,n+2));
    	q.push(mkk(3*d,n+3));
    	q.push(mkk(4*d,n+4));
    	mp.clear();
    	ll x, cost, tmp1, h;
    	pnt tmp;
    	while(!q.empty()){
    		tmp=q.top();
    		q.pop();
    		x=tmp.x;
    		cost=tmp.g;
    		// cout<<x<<" "<<cost<<endl;
    		if(mp.count(x)){
    			continue;
    		}
    		// if(x>n){
    		// 	continue;
    		// }
    		mp[x]=cost;
    		if(x==1){
    			break;
    		}
    		if(x%2==0){
				if(x/2>1e18/d){
					tmp1=1e18;
				}
				else{
					tmp1=x/2*d;
				}
	    		q.push(mkk(cost+min(tmp1, a), x/2));
	    	}
    		if(x%3==0){
				if((x-x/3)>1e18/d){
					tmp1=1e18;
				}
				else{
					tmp1=(x-x/3)*d;
				}
	    		q.push(mkk(cost+min(tmp1, b), x/3));
			}
			if(x%5==0){
				if((x-x/5)>1e18/d){
					tmp1=1e18;
				}
				else{
					tmp1=(x-x/5)*d;
				}
	    		q.push(mkk(cost+min(tmp1, c), x/5));
	    	}
	    	tmp1=(x-1)/2*2;
	    	h=tmp1+2;
	    	if(mp.count(h)==0){
	    		q.push(mkk(cost+(x-tmp1)*d, tmp1));
	    	}
	    	tmp1=(x-1)/3*3;
	    	h=tmp1+3;
	    	if(mp.count(h)==0){
	    		q.push(mkk(cost+(x-tmp1)*d, tmp1));
	    	}
	    	tmp1=(x-1)/5*5;
	    	h=tmp1+5;
	    	if(mp.count(h)==0){
	    		q.push(mkk(cost+(x-tmp1)*d, tmp1));
	    	}

	    	tmp1=(x+2)/2*2;
	    	h=tmp1-2;
	    	if(mp.count(h)==0){
	    		q.push(mkk(cost+abs(x-tmp1)*d, tmp1));
	    	}		
	    	tmp1=(x+3)/3*3;
	    	h=tmp1-3;
	    	if(mp.count(h)==0){
	    		q.push(mkk(cost+abs(x-tmp1)*d, tmp1));
	    	}
	    	tmp1=(x+5)/5*5;
	    	h=tmp1-5;
	    	if(mp.count(h)==0){
	    		q.push(mkk(cost+abs(x-tmp1)*d, tmp1));
	    	}
    	}
    	printf("%lld\n",mp[1]+d);
    }
  return 0;
}




Measured memory_bytes: 5384
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <iterator>
#include <cmath>
#include <set>
#include <deque> 
#include <string>


using namespace std;

int n;
int a[200010];
long long numCount[200010];
long long highSum[200010];
long long lowSum[200010];
long long sumDiff[200010];

int main()
{
	for (int i = 0 ; i < 200010 ; i++) {
		numCount[i] = 0;
	}
	
	scanf("%d", &n);
	for (int i = 0 ; i < n ; i++) {
		scanf("%d", &(a[i]));
		numCount[a[i]]++;
	}
	
	
	long long curSum = 0;
	for (int i = 0 ; i < 200010 ; i++) {
		if (numCount[i] == 0) {
			lowSum[i] = 0;
			highSum[i] = 0;
			sumDiff[i] = 0;
			continue;
		}
		
		long long sum = numCount[i] * (numCount[i] - 1) / 2;
		highSum[i] = sum;
		curSum = curSum + highSum[i];
		
		
		long long lSum = (numCount[i] - 1) * (numCount[i] - 2) / 2;
		lowSum[i] = lSum;
		
		sumDiff[i] = highSum[i] - lowSum[i];
	}
	
	for (int i = 0 ; i < n ; i++) {
		int p = a[i];
		long long ans = curSum - sumDiff[p];
		printf("%lld\n", ans);
	}
	
	
	return 0;
}

Measured memory_bytes: 9472
#include <stdio.h>
#include <math.h>
#define PI 3.14159265358979

int main(){
	int a,b,h,m;
	scanf("%d%d%d%d",&a,&b,&h,&m);
	
	double aa=(60*h+m)/720.0*2*PI;
	double bb=m/60.0*2*PI;
	
	printf("%.20f",hypot(a*cos(aa)-b*cos(bb),a*sin(aa)-b*sin(bb)));
}

Measured memory_bytes: 2448
#include<stdio.h>
void trace(int A[], int N){
    int i;
    for(i=0;i<N;i++){
        if(i>0)printf(" ");
        printf("%d",A[i]);
    }
    putchar('\n');
}

void insertionSort(int A[], int N){
    int j,i,v;
    for(i=1;i<N;i++){
        v = A[i];
        j = i - 1;
        while(j >= 0 && A[j] > v){
            A[j+1] = A[j];
            j--;
        }
        A[j+1] = v;
        trace(A,N);
    }
}

int main(void){
    int N,i,j;
    int A[100];

    scanf("%d",&N);
    for(i=0;i<N;i++) scanf("%d",&A[i]);

    trace(A,N);
    insertionSort(A,N);

    return 0;
}


Measured memory_bytes: 2064
#include "bits/stdc++.h"
using namespace std;
#define FOR(i,a,b) for(int i =(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
#define REPm(i,n) for(int i=(n)-1;i>=0;i--)
#define REP1(i,n) for(int i=1;i<=(n);i++)
typedef long long ll;
int c[26];
int main(){
    string w;
    cin >> w;
    REP(i,w.length()){
        c[(int)w[i] - 97]++;
    }
    bool isB = true;
    REP(i,26){
        if(c[i]%2 != 0){
            isB = false;
            break;
        }
    }
    if(isB) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	string s;
	ll i,n,ans=0;
	cin>>s;
	n=s.length();
	for(i=0;i<n;i++){
		if(s[i] == 'o'){
			ans++;
		}
	}
	if(15 - n + ans < 8){
		cout<<"NO";
	}else{
		cout<<"YES";
	}
}
	
	

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] pasta = new int[3], juice = new int[2];
		int pmin = 0, jmin = 0;
		for(int i = 0; i < 3; i++){
			pasta[i] = sc.nextInt();
			if(pasta[pmin] > pasta[i]) pmin = i;
		}
		for(int i = 0; i < 2; i++){
			juice[i] = sc.nextInt();
			if(juice[jmin] > juice[i]) jmin = i;
		}
		
		System.out.println(pasta[pmin] + juice[jmin] - 50);
	}
}

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

int main() {
    ll H,W; cin >> H >> W;
    if(H==1 || W == 1)cout << "1" << endl;
    else cout << (H*W+1)/2 << endl;
}   


Measured memory_bytes: 256
a,b,c,x,y=map(int,input().split())
if x>y:
  a,b=b,a
  x,y=y,x
ans1=0
if a+b>2*c:
  ans1=2*x*c
else:
  ans1=x*a+x*b
y-=x
ans2=10**100
for i in range(y+1):
  tmp=b*i+c*2*(y-i)
  if tmp<ans2:
    ans2=tmp
print(ans1+ans2)

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

int main()
{
	long long  X, Y;
	cin >> X >> Y;
	
	int ans = 0;
	while (X <= Y) {
		ans++;
		X *= 2;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<bitset>
#include<queue>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
typedef long long ll;
int main(){
	int a,b,c,x,y;
	int a_an,b_an,c_an;
	cin >> a>>b>>c>>x>>y;
	ll mi = 10000000000;
	int tem;
	rep(i,x+1){
		c_an = (x - i) * 2;
		b_an = max(0,y - x + i);
		tem = i * a + b_an * b + c_an * c;
		if (mi > tem) {
			mi = tem;
			a_an = i;
		//	cout << a_an << " " << b_an << " " << c_an << endl;
		}
	}
	rep(i,y+1){
		c_an = (y - i) * 2;
		a_an = max(0, x - y + i);
		tem = i * b+a_an * a+c_an * c;
		if (mi > tem) {
			mi = tem;
			b_an = i;
		//	cout << a_an << " " << b_an << " " << c_an << endl;
		}
	}

	cout << mi << endl;
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define reverse(x) reverse(x.begin(), x.end())
#define pb push_back
#define pii pair<int, int>
#define pll pair<long long,long long>
typedef long long ll;
const int mod = 1e9+7;
using namespace std;
int  n, m;

int main(){
	int i, j=0;
	string a, b;
	cin >> a >> b;
	for(i=0;i<a.length();i++){
		if(a[i]!=b[i])j++;
	}
	cout << j;
}


Measured memory_bytes: 3852
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a, b;
    cin >> a >> b;
    cout << (a + b) / 2 << endl;
}

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

#define deb(x) cerr<<"["#x<<" : "<<x<<" ]\n";

int main()
{
	int n, k;
	cin >> n >> k;
	for(int i = 0; i < n; i++) {
		int _;
		cin >> _;
	}
	
	if(((n-1) % (k-1)) == 0) {
		cout << (n-1) / (k-1);
	} else {
		cout << ((n-1) / (k-1)) + 1;
		
		// ceil((n-k) / (k-1)) + 1;
		// ((n-k + (k-1) - 1) / (k-1)) + 1
		// (n-k+k-1/k-1) + 1
		// (n-1/k-1) + 1
	}
}


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

ll solve() {
    ll K;
    cin >> K;
    ll n = 1, x = 7;
    while ( true ) {
        if ( x % K == 0 ) break;
        x = (x*10+7) % K;
        n++;
        if ( n > K + 10) return -1;
    }
    return n;
}

int main() {
    auto ans = solve();
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 3628
#include <iostream>
#include <string>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <queue>
#include <bitset>
#include <map>
#include <math.h>
#include <utility>

using namespace std;

int main(){

    long long A, B, C, D;
    cin >> A >> B >> C >> D;

    // C,D の最小公倍数 LCM を求める
    long long c = C, d = D, r, GCD, LCM;
    if (c < d) swap(c, d);
    r = c % d;
    while(r != 0){
        c = d;
        d = r;
        r = c % d;
    }
    GCD = d;
    LCM = (C / GCD) * D;
    // cout << LCM << endl;

    long long numC, numD, numCD;

    numC = B/C - A/C;
    if (A == (A/C) * C) numC++;
    numD = B/D - A/D;
    if (A == (A/D) * D) numD++;
    numCD = B/LCM - A/LCM;
    if (A == (A/LCM) * LCM) numCD++;

    // cout << numC << " : " << numD << " : " << numCD << endl;

    cout << B - A + 1 - numC - numD + numCD << endl;

    return 0;
}


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

//
#define int long long
#define pb(x) push_back(x)
#define m0(x) memset((x), 0, sizeof(x))
#define mm(x) memset((x), -1, sizeof(x))

//container
#define ALL(x) (x).begin(), (x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
#define PERM(c) \
  sort(ALL(c)); \
  for (bool c##p = 1; c##p; c##p = next_permutation(ALL(c)))

// debug
#define GET_VAR_NAME(variable) #variable
#define test(x) cout << GET_VAR_NAME(x) << " = " << x << endl;

// bit_macro
#define bit(n) (1LL << (n))
#define bitset(a, b) (a) |= (1 << (b))
#define bitunset(a, b) (a) &= ~(1 << (b))
#define bitcheck(a, b) ((((a) >> (b)) & 1) == 1)
#define bitcount(a) __builtin_popcountll((a))

//typedef
typedef long long lint;
typedef unsigned long long ull;
typedef complex<long double> Complex;
typedef pair<int, int> P;
typedef tuple<int, int, int> TP;
typedef vector<int> vec;
typedef vector<vec> mat;

//constant
const int INF = (int)1e18;
const int MOD = (int)1e9 + 7;
const double PI = (double)acos(-1);
const double EPS = (double)1e-10;
const int dx[] = {-1, 0, 0, 1, 0, -1, -1, 1, 1};
const int dy[] = {0, -1, 1, 0, 0, 1, -1, 1, -1};

//
template <typename T>
void chmax(T &a, T b) { a = max(a, b); }
template <typename T>
void chmin(T &a, T b) { a = min(a, b); }
//
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

//
struct Accelerate_Cin {
  Accelerate_Cin() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);
  };
};

signed main() {
  int N, K;
  cin >> N >> K;
  if (N % K == 0) {
    cout << 0 << endl;
  } else {
    cout << 1 << endl;
  }

  return 0;
}


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

int main(){
 int n,minv=1000,maxv=0,a;
 cin >> n;
 for(int i=0;i<n;i++){
    cin >> a;
    minv=min(minv,a);
    maxv=max(maxv,a);
 }
 maxv-=minv;
 cout << maxv << endl;

  return 0;
}

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

using namespace std;

typedef long long ll;
const ll inf = 0x3f3f3f3f;
#define case(i) "Case #" << i << ": "
 
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
    out << '(' << p.first << ", " << p.second << ')';
    return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
    ll l = v.size();
    for (ll i = 0; i < l - 1; i++) out << v[i] << ' ';
    if (l > 0) out << v[l - 1];
    return out;
}

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

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

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

    double sum(0);
    int j = k;
    for(int i = 0; i < j; ++i) {
        double temp = v[i];
        sum += (temp + 1) / 2;
    }

    double ans = sum;
    int i = 0;

    while(j < n) {
        double temp = v[j];
        sum += (temp + 1) / 2;
        temp = v[i];
        sum -= (temp + 1) / 2;

        ans = max(ans, sum);

        j++;
        i++;

        // cout << sum << endl;
    }

    cout << fixed << setprecision(10);

    cout << ans << endl;
}

Measured memory_bytes: 1024
/*  -*- coding: utf-8 -*-
 *
 * b.cc: B - 1%
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

typedef long long ll;

/* global variables */

/* subroutines */

/* main */

int main() {
  ll x;
  scanf("%lld", &x);

  ll a = 100;
  int y = 0;

  while (a < x) {
    a = a * 1.01;
    y++;
  }

  printf("%d\n", y);
  return 0;
}


Measured memory_bytes: 3252
#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <vector>
#include <list>

using namespace std;
int main() {
	int n, d[50], sum = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> d[i];
	}
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			sum += d[i] * d[j];
		}
	}
	cout << sum << endl;
	return 0;
}

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

#define MAX(p,q) ((p>q)?(p):(q))
#define MIN(p,q) ((p<q)?(p):(q))

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

int gcd(int a,int b);

int main(void)
{
  int d,n;
  scanf("%d%d",&d,&n);
  //pow使うからだめ
  //愚直に場合分けせよ
  if(d==0)
  {
    if(n==100) printf("101\n");
    else printf("%d",n);
  }
  else if(d==1)
  {
    if(n==100) printf("10100\n");
    else printf("%d",n*100);
  }
  else
  {
    if(n==100) printf("1010000\n");
    else printf("%d",n*10000);
  }
  return 0;
}

int gcd(int a,int b)
{
  int max,min,tmp;
  max = MAX(a,b);
  min = MIN(a,b);
  if(max%min==0) return min;
  else
  {
    tmp = min;
    min = max%min;
    max = tmp;
    return gcd(max,min);
  }
}


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

int main(void) {

  char s[101];
  scanf("%s", s);
  char keyence[8] = "keyence";
  int length = strlen(s);
  int current = 0;
  for (int i = 0; i < length; i++) {
    if (s[i] != keyence[current]) {
      break;
    } else {
      current++;
      if (current == 7) {
        break;
      }
    }
  }
  int flag = 1;
  int start = length-1-(6-current);
  for (int i = start; i < length; i++) {
    if (s[i] != keyence[current]) {
      flag = 0;
      break;
    } else {
      current++;
    }
  }
  if (flag == 1) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }

  return 0;
}

Measured memory_bytes: 128
#include <algorithm>
#include <array>
#include <climits> // INT_MAX, LONG_MAX, LLONG_MAX, UINT_MAX, ULONG_MAX, ULLONG_MAX
#include <cmath>
#include <cstdint>
#include <cstring> // memset
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>

#define ALL(x) (x).begin(), (x).end()
#define INF 1e9
#define LOG(x) cout << #x << " = " << (x) << endl
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)

using namespace std;

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

    int sum = 1900 * m + 100 * (n - m);
    int r = int(pow(2, m));
    cout << sum * r << endl;
    
    return 0;
}


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

#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y
//#define CPP_STR(x) CPP_STR_I(x)
//#define CPP_STR_I(args...) #args
//#define ASSERT(expr...) assert((expr))

using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
//using f80 = __float80;

constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
constexpr char EL[] = "\n";

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());

template<typename T = i64>
T IN() { T x; cin >> x; return (x); }

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T(&)[N]) { return static_cast<i64>(N); }

template<typename T, typename U, typename Comp = less<>>
bool chmax(T& xmax, const U& x, Comp comp = {}) {
	if (comp(xmax, x)) {
		xmax = x;
		return true;
	}
	return false;
}
template<typename T, typename U, typename Comp = less<>>
bool chmin(T& xmin, const U& x, Comp comp = {}) {
	if (comp(x, xmin)) {
		xmin = x;
		return true;
	}
	return false;
}

void print() {
	cout << EL;
}
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
	cout << head;
	if (sizeof...(tail) != 0) cout << " ";
	print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
	for (auto& a : vec) {
		cout << a;
		if (&a != &vec.back()) cout << " ";
	}
	cout << EL;
}
template <class T>
void print(vector<vector<T>> &df) {
	for (auto& vec : df) {
		print(vec);
	}
}

struct ProconInit {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;

	ProconInit() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH)
			cout << unitbuf;
	}
} PROCON_INIT;
#pragma endregion

#ifdef LOCALCODE
signed solve()
#else
signed main()
#endif
{
	auto A = IN();
	auto B = IN();
	auto C = IN();
	auto K = IN();
	i64 ans = 0;
	if (A >= B && A >= C)
		ans = A * pow(2, K) + B + C;
	else if (B >= A && B >= C)
		ans = B * pow(2, K) + A + C;
	else
		ans = C * pow(2, K) + A + B;
	print(ans);
	return 0;
}


Measured memory_bytes: 384
#include<stdio.h>
int main(void){
  int number;
  int count=0;
  while(scanf("%d",&number)){
    if(number==0){
      break;
    }
    while(number!=1){
      if(number%2==0){
	number=number/2;
	count++;
      }
      else{
	number=number*3+1;
	count++;
      }
    }
    printf("%d\n",count);
    count=0;
  }
  return 0;
}

Measured memory_bytes: 600
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
#define ENDL "\n"
typedef long long int llint;
int intinput()
{
  int x;
  scanf("%d", &x);
  return x;
}

llint dp[300][300 * 300 + 1];

void code()
{
  llint MOD = 998244353;
  int N = intinput();
  vector<int> a(N);
  for (int i = 0; i < N; i++)
  {
    a[i] = intinput();
  }
  llint S = 0;
  for (int i = 0; i < N; i++)
  {
    S += a[i];
  }
  // すべての配置パターン
  llint ans = 1;
  for (int i = 0; i < N; i++)
  {
    ans *= 3;
    ans %= MOD;
  }
  // R, G, Bの長さがS/2を超えるパターンを除外
  // dp[i個目まで使う][Rの長さ] = パターン数
  dp[0][0] = 2; //Gに使うかBに使うか
  dp[0][a[0]] = 1;
  for (int i = 1; i < N; i++)
  {
    for (int s = 0; s <= S; s++)
    {
      dp[i][s] = 2 * dp[i - 1][s] + (s - a[i] >= 0 ? dp[i - 1][s - a[i]] : 0);
      dp[i][s] %= MOD;
    }
  }
  for (int s = (S + 1) / 2; s <= S; s++)
  {
    ans -= dp[N - 1][s] * 3;
    while (ans < 0)
    {
      ans += MOD;
    }
  }
  // R==G==S/2の場合が引かれすぎている
  // dp[i個目まで使う][Rの長さ] = パターン数　・・・今度はRとGのみに使い、R==G==S/2のパターン数を計算する
  if((S&1)==0){ //合計が偶数でないと起こり得ない
    for (int s = 0; s <= S/2; s++){
      dp[0][s] = 0; //リセット
    }
    //
    dp[0][0] = 1; //Gに使う(Bには使えないので1)
    dp[0][a[0]] = 1;  //Rに使う
    for (int i = 1; i < N; i++)
    {
      for (int s = 0; s <= S/2; s++){
        dp[i][s] = dp[i-1][s] + (s-a[i] >= 0 ? dp[i-1][s-a[i]] : 0);
        dp[i][s] %= MOD;
      }
    }
    ans += dp[N-1][S/2] * 3;
    ans %= MOD;
  }
  //
  ans %= MOD;
  cout << ans << ENDL;
}

int main()
{
  code();
  return 0;
}


Measured memory_bytes: 210816
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
#define vec(s) vector

#define vvec(s) vector<vector
>
typedef vector<lli> vi;
typedef vector<vi> vvi;
typedef pair<lli,lli> pii;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Yes(x) cout<<(x?"Yes":"No")<<endl;
#define YES(x) cout<<(x?"YES":"NO")<<endl;
#define out(s) cout<<s<<endl;
#define pb(s) push_back(s);
#define sp " " 
#define INF 10000000000
#define LINF 9000000000000000000
#define all(s) s.begin(),s.end()
void vout(vi v){
    for(lli i=0;i<v.size();i++)
    cout<<v.at(i)<<endl;
}
int main(){
    lli n;
    cin >> n;
    string s, t, ans = "";
    cin >> s >> t;
    rep(i,n){
        ans += s[i];
        ans += t[i];
    }
    out(ans);
}

Measured memory_bytes: 3592
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <vector>
using ll = long long;
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;

int main() {
    int r, c;
    cin >> r >> c;
    vector<vector<int>> T(r + 1, vector<int>(c + 1));

    rep(i, r) rep(j, c) cin >> T[i][j];

    rep(i, r) {
        int tot = 0;
        rep(j, c) {
            tot += T[i][j];
            cout << T[i][j] << " ";
        }
        cout << tot << endl;
        T[i][c] = tot;
    }
    rep(j, c + 1) {
        int tot = 0;
        rep(i, r) tot += T[i][j];
        cout << tot;
        if(j < c) {
            cout << " ";
        } else {
            cout << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 3216
//Pantyhose(black) + glasses = infinity

#include <bits/stdc++.h>
using namespace std;
 
#define debug(x) cerr << #x << " = " << x << '\n';
#define BP() cerr << "OK!\n";
#define PR(A, n) {cerr << #A << " = "; for (int _=1; _<=n; ++_) cerr << A[_] << ' '; cerr << '\n';}
#define PR0(A, n) {cerr << #A << " = "; for (int _=0; _<n; ++_) cerr << A[_] << ' '; cerr << '\n';}
#define FILE_NAME "data"

const int MAX_N = 302;
const int MOD = 998244353;

struct equation {

	vector<int> coeff;
	int val;

	void init(int n) {
		coeff.resize(n);
		val = 0;
	}

};

int n, m, a[MAX_N][MAX_N];
equation e[MAX_N];

void readInput() {
	cin >> n >> m;

	for (int i=0; i<n; ++i) {
		for (int j=0; j<m; ++j)
			cin >> a[i][j];
	}
}

void initEquationSystem() {
	for (int i=0; i<n; ++i) {
		e[i].init(m);
		for (int j=0; j<m; ++j)
			e[i].coeff[j] = a[i][j];
		e[i].val = 0;
	}
	// PR0(e[1].coeff, m);
}

int64_t pw(int n, int k) {
	if (k==0)
		return 1;

	int64_t tmp = pw(n, k/2);

	if (k%2)
		return tmp * tmp % MOD * n % MOD;
	return tmp * tmp % MOD;
}

void solve() {
	for (int i=0; i<n; ++i) {
		for (int j=i+1; j<n; ++j) {
			if (e[i].coeff<e[i].coeff)
				swap(e[i], e[j]);
		}

		int pos = -1;

		for (int j=0; j<m; ++j) {
			if (e[i].coeff[j]) {
				pos = j;
				break;
			}
		}

		for (int j=i+1; j<n; ++j) {
			if (pos>-1 && e[j].coeff[pos]) {
				for (int k=0; k<m; ++k)
					e[j].coeff[k] ^= e[i].coeff[k];
				e[j].val ^= e[i].val;
			}
		}
	}
	// PR0(e[0].coeff, m);

	int tmp = m;

	for (int i=n-1; i>=0; --i)
		tmp -= (accumulate(e[i].coeff.begin(), e[i].coeff.end(), 0)>0);
	// debug(tmp);

	cout << pw(2, n-1) * (pw(2, m) - pw(2, tmp) + MOD) % MOD;
}

int main() {
	#ifdef GLASSES_GIRL
		freopen(FILE_NAME".in", "r", stdin);
		freopen(FILE_NAME".out", "w", stdout);
	#endif
	ios::sync_with_stdio(0); cin.tie(0);
	readInput();
	initEquationSystem();
	solve();
}

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

int main(void){
    std::multiset<int> vs1, vs2;
    int Q;
    std::cin >> Q;
    int qi = 0;
    int med = -1;
    long sum_abs = 0;
    long bias = 0;
    for(int ii = 0; ii < Q; ++ii){
        int q;
        std::cin >> q;
        if(q == 1){
            int v, b;
            std::cin >> v >> b;
            qi++;
            bias += b;
            if(qi == 1){
                vs1.insert(v);
                med = v;
            } else if(qi == 2){
                int w = *vs1.begin();
                if(w <= v){
                    vs2.insert(v);
                } else {
                    vs1.clear();
                    vs1.insert(v);
                    vs2.insert(w);
                }
                med = *vs1.begin();
                sum_abs = *vs2.begin() - med;
            } else {
                auto vs1_size = vs1.size(), vs2_size = vs2.size();
                if(*vs1.rbegin() >= v){
                    vs1.insert(v);
                    if(vs1.size()-2 >= vs2.size()){
                        int w = *vs1.rbegin();
                        vs1.erase(--vs1.end());
                        vs2.insert(w);
                    }
                } else {
                    vs2.insert(v);
                    if(vs2.size() > vs1.size()){
                        int w = *vs2.begin();
                        vs2.erase(vs2.begin());
                        vs1.insert(w);
                    }
                }
                int new_med = *vs1.rbegin();
                sum_abs += std::abs(new_med - v);
                sum_abs += std::abs((new_med - med) * static_cast<long>(vs1_size - vs2_size));
                med = new_med;
            } // end of insertion
        } else {
            std::cout << med << " " << sum_abs + bias << std::endl;
        }
    }
    return 0;
}


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

int main() {
	string A,B,C;
	cin >> A >> B >> C;
	if(A.at(A.size()-1)==B.at(0) && B.at(B.size()-1)==C.at(0))
		cout << "YES";
	else
		cout << "NO";
	cout << endl;
}

Measured memory_bytes: 256
N, M = map(int, input().split())
lis = [[] for _ in range(N)]
for _ in range(M):
  question, result = input().split()
  question = int(question)
  lis[question-1].append(result)  

AC_times = 0
WA_times = 0
for i in range(N):
  pre_WA_times = 0
  for j in lis[i]:
    passed = False
    if not passed:
      if j == "AC":
        passed = True
        WA_times += pre_WA_times
      elif j == "WA":
        pre_WA_times += 1
    if passed:
      AC_times += 1
      break
      
print(AC_times, WA_times)

Measured memory_bytes: 20376
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
 
int main() {
 
  int N; cin >> N;
  string S; cin >> S;
  
  int ans = 0;
  for(int i = 0; i < N - 2; i++){
    if(S.at(i) == 'A'){
      if(S.at(i + 1) == 'B'){
        if(S.at(i + 2) == 'C'){
          ans++ ;
          i = i + 2;
        }
      }
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
int main(void)
{
	int a,l,x;
	double s,s2,x2;
	
	while(1)	{
		if(scanf("%d %d %d",&a,&l,&x)==EOF)	break;
		s=(double)(a+l+l)/2.0;
		s2=sqrt(s*(s-l)*(s-l)*(s-a));
//		printf("s=%lf\n",s2);
		s=(double)(l+l+x)/2.0;
		x2=(x+l)/2.0;
		s2+=2.0*sqrt(s*(s-l)*(s-x2)*(s-x2));
		printf("%lf\n",s2);
	}
	return 0;
}


Measured memory_bytes: 632
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
template<typename T, typename U> static void amin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> static void amax(T &x, U y) { if (x < y) x = y; }

template<int MOD>
struct ModInt {
	static const int Mod = MOD;
	unsigned x;
	ModInt() : x(0) { }
	ModInt(signed sig) { int sigt = sig % MOD; if (sigt < 0) sigt += MOD; x = sigt; }
	ModInt(signed long long sig) { int sigt = sig % MOD; if (sigt < 0) sigt += MOD; x = sigt; }
	int get() const { return (int)x; }

	ModInt &operator+=(ModInt that) { if ((x += that.x) >= MOD) x -= MOD; return *this; }
	ModInt &operator-=(ModInt that) { if ((x += MOD - that.x) >= MOD) x -= MOD; return *this; }
	ModInt &operator*=(ModInt that) { x = (unsigned long long)x * that.x % MOD; return *this; }

	ModInt operator+(ModInt that) const { return ModInt(*this) += that; }
	ModInt operator-(ModInt that) const { return ModInt(*this) -= that; }
	ModInt operator*(ModInt that) const { return ModInt(*this) *= that; }
};
typedef ModInt<1000000007> mint;

int main() {
	int N; int M;
	while (~scanf("%d%d", &N, &M)) {
		vector<int> graph(N);
		rep(i, M) {
			int u; int v;
			scanf("%d%d", &u, &v), -- u, -- v;
			graph[u] |= 1 << v;
		}
		vector<int> popcount(1 << N);
		rep(i, 1 << N) rep(j, N)
			popcount[i] += i >> j & 1;
		vector<mint> pow2s(N + 1);
		pow2s[0] = 1;
		rer(i, 1, N)
			pow2s[i] = pow2s[i - 1] * 2;
		//後ろから考える
		vector<mint> dp(1 << N);
		dp[0] = 1;
		rep(S, 1 << N) {
			mint x = dp[S];
			if (x.x == 0) continue;
			int rem = (1 << N) - 1 - S;
			for (int T = rem; T > 0; (-- T) &= rem) {
				if ((T & 3) == 3) continue;
				int U = rem - T;
				mint y = x;
				rep(i, N) if (S >> i & 1)
					y *= pow2s[popcount[graph[i] & T]];
				rep(i, N) if (U >> i & 1)
					y *= pow2s[popcount[graph[i] & T]] - 1;
				dp[S | T] += y;
			}
		}
		mint ans = dp.back();
		printf("%d\n", ans.get());
	}
	return 0;
}


Measured memory_bytes: 512
import Data.Int
import Data.List

modulo :: Int64
modulo = 10^9 + 7
newtype N = N Int64 deriving Eq
instance Show N where
  show (N x) = show x
instance Num N where
  N x + N y = N ((x + y) `rem` modulo)
  N x - N y = N ((x - y) `mod` modulo)
  N x * N y = N ((x * y) `rem` modulo)
  fromInteger n = N (fromInteger (n `mod` fromIntegral modulo))
  abs = undefined; signum = undefined

solution :: [(N,N,N)]
solution = (1,0,0):(4,0,1):(16,1,4):(61,3,15)
  : zipWith4 (\(a1,b1,c1) (a2,b2,c2) (a3,b3,c3) (a4,b4,c4) -> (4*a1-3*a3+b3+c3-3*a4,a2-c2,a1-b1)) (drop 3 solution) (drop 2 solution) (tail solution) solution

main = do
  n <- readLn :: IO Int
  print $ case solution !! n of
            (N x,_,_) -> x


Measured memory_bytes: 508
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

typedef long long ll;
typedef uint64_t ull;
typedef pair<int, int> P;
constexpr double PI = 3.1415926535897932;   // acos(-1)
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)

using ld = long double;
ld dp[3000][3000];

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

    int n;
    cin >> n;
    vector<ld> p(n);
    for(int i = 0; i < n; ++i)  cin >> p[i];

    dp[0][0] = 1.0;
    for(int i = 0; i < n; ++i){
        for(int j = 0; j <= i; ++j){
            dp[i + 1][j] += dp[i][j] * (1.0 - p[i]);
            dp[i + 1][j + 1] += dp[i][j] * p[i];
        }
    }

    ld ans = 0.0;
    for(int i = ceil((ld)n / 2); i <= n; ++i) ans += dp[n][i];
    cout << fixed << setprecision(10);
    cout << ans << endl;
}

Measured memory_bytes: 139136
<?php
list($x, $a, $b) = ints();
if ($b <= $a) $ans = 'delicious';
elseif ($b <= $a + $x) $ans = 'safe';
else $ans = 'dangerous';
echo $ans;
function ints()
{
    return array_map('intval', explode(' ', trim(fgets(STDIN))));
}


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

using namespace std;

#define FAST_IO ios_base::sync_with_stdio(0); cin.tie(nullptr)
#define FOR(i, a, b) for(int i = (a); i <= (b); i++)
#define REP(n) FOR(O, 1, (n))
#define pb push_back
#define f first
#define s second
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<ll> vl;
typedef vector<piii> viii;

const int MAXN = 500100, MAXK = 35;
const ll MOD = 1e9+7;
const ld INF = 2*1e18;
const ld PI = asin(1) * 2;


int main() {
	FAST_IO;

    ll n; cin >> n;
    cout << ((n-1)/2);

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,a;
int main()
{
	scanf("%d",&n);
	while(n--)
	{
		scanf("%d",&a);
		if((a&1)==0)if(a%3&&a%5)
		{
			puts("DENIED");
			return 0;
		}
	}
	puts("APPROVED");
	return 0;
}

Measured memory_bytes: 256
N, H = gets.split.map &:to_i
AB = $<.map{|s|s.split.map &:to_i}
A, B = AB.transpose
a_max = A.max
through = B.select{|b|b > a_max}.sort.reverse

hp = H
ans = 0
through.each{|dmg|
  hp -= dmg
  ans += 1
  break if hp <= 0
}
ans += [hp, 0].max.fdiv(a_max).ceil
p ans


Measured memory_bytes: 13320
import java.util.Scanner;
public class Main{
    public static void main(String args[]){
        Scanner scan=new Scanner(System.in);
        int N=scan.nextInt();
        int i;
        int ans=0;
        for(i=0;i*i<=N;i++){
            ans=i*i;
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 24404
#E
from collections import Counter
n,p=map(int,input().split())
s=input()
cnt=0

if p==2 or p==5:
    for i in range(n):
        if int(s[i])%p==0:
            cnt+=i+1
else:
    U=[0]*(n+1)
    for i in range(n,0,-1):
        U[i-1]=(int(s[i-1])*pow(10,n-i,p)+U[i])%p
    #print(U)
    C=Counter(U)
    for c in C.values():
        cnt+=c*(c-1)//2

print(cnt)

Measured memory_bytes: 12080
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> P;
ll Mod = 1000000007;
int main() {
  ll M;
  cin >> M;
  ll d[M],c[M];
  ll csum = 0;
  ll dsum = 0;
  for (int i = 0; i < M; i++) {
    cin >> d[i] >> c[i];
    csum += c[i];
    dsum += (d[i] * c[i]);
  }
  ll ans = (csum - 1) + ((dsum - 1) / 9);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 6748
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

class Program
{
    static void Main(string[] args)
    {
        var N = int.Parse(ReadLine());
        var S = new string[N];

        for (int i = 0; i < N; i++)
            S[i] = ReadLine();

        var group = S.GroupBy(s => s);
        var maxCount = group.Select(g => g.Count()).Max();
        var maxCountGroup = group.Where(g => g.Count() == maxCount);
        var maxCountString = maxCountGroup.Select(g => g.Key);

        foreach (var s in maxCountString.OrderBy(s => s))
            WriteLine(s);
    }
}


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

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

  int a, b, k, ans;
  cin >> a >> b >> k;
  vector<int> A;
  if(a >= b) {
    swap(a, b);
  }

  for(int i = 1; i <= a; i++) {
    if(a % i == 0 && b % i == 0) {
      A.push_back(i);
    }
  }
  sort(A.begin(), A.end(), greater<int>());
  ans = A[k - 1];
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char *argv[])
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    map<char, char> seqmap;
    seqmap.insert(make_pair('A', 'T'));
    seqmap.insert(make_pair('T', 'A'));
    seqmap.insert(make_pair('G', 'C'));
    seqmap.insert(make_pair('C', 'G'));

    char input;
    cin >> input;
    cout << seqmap[input] << endl;

    return 0;
}


Measured memory_bytes: 256
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Security.Cryptography;

class Program
{
    const string Yes = "Yes";
    const string No = "No";
    const char White = '.';
    const char Black = '#';
    const long Mod = 1000000007;

    static void Main(string[] args) {
#if DEBUG
        MyDebugger.Test(process, "../TextFile1.txt");
#else
        object ret = process(new StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static object process(TextReader input) {
        var a = int.Parse(input.ReadLine());
        var b = int.Parse(input.ReadLine());
        var c = int.Parse(input.ReadLine());
        var x = int.Parse(input.ReadLine());

        long y = 0;

        for(int aa = 0; aa <= a; aa++) {
            for (int bb = 0; bb <= b; bb++) {
                for (int cc = 0; cc <= c; cc++) {
                    if (aa * 500 + bb * 100 + cc * 50 == x) y++;
                }
            }
        }

        return y;
    }

    static long[] ToIntArray(string strs, int n) {
        var ret = new long[n];
        var spl = strs.Split(' ');
        for (int i = 0; i < n; i++)
            ret[i] = long.Parse(spl[i]);
        return ret;
    }
}

Measured memory_bytes: 13140
import java.util.HashMap;
import java.util.Scanner;

public class Main {

    private static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        int N = sc.nextInt();
        int M = sc.nextInt();
		//System.out.println(N+" "+M);
      if( (N >= 1 && N <= 9 ) &&
         (M >= 1 && M <= 9 ) )
      {
        System.out.println( N*M);
      }
      else{
        System.out.println("-1");
      }
    }


}


Measured memory_bytes: 22484
def f():
	a = input().split()
	b = input().split()
	for i,s in enumerate(((3,1,2,4),(2,0,3,5),(4,0,1,5),(1,0,4,5),(3,0,2,5),(2,1,3,4))):
		for j in range(4):
			r = s[j:] + s[:j]
			if [a[k] for k in (i, r[1], r[2], r[0], r[3], 5-i)] == b:
				print('Yes')
				return
	print('No')
f()



Measured memory_bytes: 5572
/**
 * File              : b.cpp
 * Author            : recurze
 * Date              : 23:58 20.01.2019
 * Last Modified Date: 00:01 21.01.2019
 */
#include <cstdio>

void readInput();
void solve();
void printAns();

int main() {
    int t = 1;
    //(void)scanf("%d", &t);

    for (int tc = 1; tc <= t; ++tc) {
        readInput();
        solve();
        printAns();
    }
}

const int N = 1010101;

int n = 0;
void readInput() {
    (void)scanf("%d", &n);
}

int run(int n, int i) {
    if (n == 4) return i;
    if (n&1) return run((3*n + 1)>>1, i + 2);
    return run(n>>1, i + 1);
}
int ans = 0;
void solve() {
    if (n <= 2) ans = 4;
    else ans = run(n, 4);
}

void printAns() {
    printf("%d\n", ans);
}


Measured memory_bytes: 128
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

typedef long long ll;
const int mod=1000000007;

int a[410],b[410],pow0[410][410],dp[410][410];

int main()
{
    #ifdef waltz
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    int n,c;scanf("%d%d",&n,&c);
    for (int i=1;i<=n;i++) scanf("%d",&a[i]);
    for (int i=1;i<=n;i++) scanf("%d",&b[i]);
    for (int i=1;i<=400;i++)
    {
        pow0[i][0]=1;
        for (int j=1;j<=400;j++) pow0[i][j]=ll(pow0[i][j-1])*i%mod;
    }
    memset(dp,0,sizeof(dp));
    dp[0][0]=1;
    for (int i=1;i<=n;i++)
    {
        for (int j=0;j<=c;j++)
        {
            int s=0;
            for (int k=a[i];k<=b[i];k++) s=(s+pow0[k][j])%mod;
            for (int k=j;k<=c;k++) dp[i][k]=(ll(dp[i-1][k-j])*s+dp[i][k])%mod;
        }
    }
    printf("%d\n",dp[n][c]);
    return 0;
}


Measured memory_bytes: 1408
A,B,C,D= map(int,input().split())
if A%D == 0:
  E = A // D
else:
  E = A//D + 1
if C%B == 0:
  F= C // B
else:
  F= C // B+1
if E >= F:
  print('Yes')
else:
  print('No')


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

namespace ABC
{
    class ProgramA
    {
        static void Main(string[] args)
        {
            var n = long.Parse(Console.ReadLine());

            var s = n / 1000 + 1;
            if (n % 1000 == 0)
                s--;
            var result = 1000 * s - n;
            Console.WriteLine(result);
        }
    }
}


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef pair<int,int> pii;
typedef pair<long long, int> pli;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

ll mod = 1000000007;

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

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

  int n,k;
  cin >> n >> k;
  vi p(n);
  rep(i,n)cin >> p[i];

  sort(all(p));
  int ret = 0;
  rep(i,k)ret += p[i];
  cout << ret << endl;
}

Measured memory_bytes: 3612
n,m=map(int,input().split())
you=[]
other={i:False for i in range(n+1)}
for i in range(m):
    a,b=map(int,input().split())
    if a==1:
        you.append(b)
    elif b==n:
        other[a]=True
flag=False
for some in you:
    if other[some]:
        flag=True
        break
if flag:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Measured memory_bytes: 27112
C = [tuple(map(int, input().split())) for _ in range(3)]
print("YNeos"[not all(C[i][j]+C[(i+1)%3][(j+1)%3] == C[(i+1)%3][j]+ C[i][(j+1)%3]for i in range(3) for j in range(3))::2])


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

struct node {
    double x, y;
};
double dist(node a, node b) {
    return sqrt((a.x - b.x) *  (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}

int main() {
    int n; double mx; int ans = 0;
    cin >> n >> mx;
    for (int i = 1; i <= n; i++) {
        node a, b; b.x = 0.0, b.y = 0.0;
        cin >> a.x >> a.y;
        double aa = dist(a, b);
        if(aa <= mx) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3840
n = int(input())
rgb = input()
r = set()
g = set()
b = set()
for i in range(len(rgb)):
    if rgb[i] == 'R':
        r.add(i + 1)
    if rgb[i] == 'G':
        g.add(i + 1)
    if rgb[i] == 'B':
        b.add(i + 1)
otv = 0
for i in r:
    for j in g:
        lb = len(b)
        if (i + j) % 2 == 0 and (i + j) // 2 in b:
            lb -= 1
        if 2 * j - i in b:
            lb -= 1
        if 2 * i - j in b:
            lb -= 1
        otv += lb
print(otv)

Measured memory_bytes: 9356