akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <sstream>
using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long

int n, s;
int cnt;
void dfs(int i, int j,int sum)
{
	if (i==n)
	{
		if (sum==s)cnt++;
	}
	else if (i <= n && sum <= s && j <= 9)
	{
		dfs(i + 1, j + 1, sum + j);
		dfs(i, j + 1, sum);
	}
}

int main()
{
	while (cin>>n>>s)
	{
		if (n == 0 && s == 0)return 0;
		cnt = 0;
		dfs(0, 0, 0);
		cout << cnt << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include<cstdio>
#include<iostream>
using namespace std;
int main(){
	long long a,b,x;
	scanf("%lld %lld %lld",&a,&b,&x);
	if(a%x==0)
	printf("%lld\n",(b/x)-(a/x)+1);
	else
	printf("%lld\n",(b/x)-(a/x+1)+1);
	return 0;
}

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

int main() {

  ios_base::sync_with_stdio(false);
  cin.tie(0); cout.tie(0);

  int A,B,C; cin >> A >> B >> C;

  if (A+B >= C) cout << "Yes" << endl;
  else cout << "No" << endl;
}
  


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

int gcd(int a, int b) // Use Euclid's Algorithm to find GCD of 2 numbers
{
	while (a != b)
	{
		if (a > b) a -= b;
		else b -= a;
	}
	return b;
}

int main()
{
	int a, b;
	cin >> a >> b;
	cout << gcd(a,b) << endl;

}


Measured memory_bytes: 3100
#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<iomanip>
using namespace std;
typedef long long ll;
ll dp[105][2][5]={0};
int main(){
  string N;
  cin>>N;
  ll K;
  cin>>K;
  dp[0][0][0]=1;
  int nl=N.length();
  for(int i=0;i<nl;i++){
    int n=(int)(N[i]-'0');
    for(int k=0;k<=K;k++){
      if(n==0){
        dp[i+1][0][k]+=dp[i][0][k];
        dp[i+1][1][k]+=dp[i][1][k];
        dp[i+1][1][k+1]+=dp[i][1][k]*9;
      }
      else{
        dp[i+1][1][k]+=dp[i][0][k];
        dp[i+1][1][k+1]+=(n-1)*dp[i][0][k];
        dp[i+1][0][k+1]+=dp[i][0][k];
        dp[i+1][1][k]+=dp[i][1][k];
        dp[i+1][1][k+1]+=dp[i][1][k]*9;
      }
    }
  }
  ll ans=0;
  ans+=dp[nl][0][K];
  ans+=dp[nl][1][K];
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<string>
#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
#include<iomanip>
using namespace std;
#define REP(i,n) for(int i=0;i < n; i++)
#define RREP(i,n) for(int i=n-1;i >=0; i--)
#define p(a) (a) * (a)
#define p2(a,b) p((a) - (b)) 

#define MAX 100002
int p[1000];
int q[1000];
void solver() {
	for (int i = 2; i <= 1000; i++) {
		int j = 2;
		while (i*j <= 1000) {
			p[i*j] = 1;
			j++;
		}
	}
}


int main() {
	int n;
	long long s = 1;
	solver();
	cin >> n;
	for (int i = 2; i <= n; i++) {
		int t=i, c=0;
		while (t > 1) {
			for (int j = 2; j <= i; j++) {
				if (!p[j] && t % j == 0) {
					t /= j;
					q[j]++;
					break;
				}
			}
		}
	}
	for (int i = 2; i <= n; i++) {
		if (q[i]) {
			s *= (q[i]+1);
			s %= 1000000007;
		}
	}
	cout << s << endl;
	return 0;
}

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

int main() {
	string S;
	cin >> S;
	stack<char> tmp;
	for (char& i : S) {
		if (tmp.empty()) tmp.push(i);
		else {
			if (i == '0') {
				if (tmp.top() == '0') tmp.push(i);
				else tmp.pop();
			}
			else {
				if (tmp.top() == '0') tmp.pop();
				else tmp.push(i);
			}
		}
	}
	cout << S.size() - tmp.size();
}

Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

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

    if (abs(n - m) > 1)
    {
        cout << 0 << endl;
        return 0;
    }

    ll ans = 1;
    REP(i, n)
    {
        ans *= i + 1;
        ans %= 1000000007;
    }

    REP(i, m)
    {
        ans *= i + 1;
        ans %= 1000000007;
    }

    if (n == m)
    {
        ans *= 2;
        ans %= 1000000007;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <utility>
#include <typeinfo>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#define REP(i,n) for(int i=0;i<n;i++)
typedef long long ll;
using namespace std;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;

int main() 
{
	int n,m;
	while(cin>>n>>m&&!(n==0&&m==0))
	{
		pll a[20000],b[20000];
		REP(i,m)
		{
			ll x,y,z;
			cin>>x>>y>>z;
			y-=1;z-=1;
			a[i] = make_pair(x,y);
			b[i] = make_pair(x,z);
		}
		sort(a,a+m);
		sort(b,b+m);
		
		bool inf[20000]={};
		inf[0]=true;
		//REP(i,n)cout<<inf[i];cout<<endl;
		REP(i,m){if(inf[a[i].second]){inf[b[i].second]=true;}}
		//REP(i,n)cout<<inf[i];cout<<endl;
		int ans(0);
		REP(i,n)ans+=inf[i];
		
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 1824
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define dump(x) cerr<<#x<<": "<<x<<endl;
#define bit(k) (1LL<<(k))
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 >& p) {
  os << "{" <<p.first << ", " << p.second << "}";
  return os;
}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = (ll)1e9+7;
const double PI = acos(-1.0);
/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int K;
    cin >> K;
    vector<ll> A(K);
    rep(i,K)cin>>A[i];
    auto f = [&](ll X){
        for(int i = 0; i < K; i++){
            X = X / A[i] * A[i];
        }
        return X;
    };
    //f(x) >= 2となるxの最小値
    ll ok = INFLL, ng = 0;
    while(ok - ng > 1){
        ll mid = (ok + ng)>>1;
        if(f(mid) >= 2)ok = mid;
        else ng = mid;
    }
    ll l = ok;
    
    //f(x) <= 2となるxの最大値
    ok = 0, ng = INFLL;
    while(ng - ok > 1){
        ll mid = (ok + ng)>>1;
        if(f(mid)<=2)ok = mid;
        else ng = mid;
    }
    ll r = ok;
    if(l > r){
        cout << -1 << endl;
        return 0;
    }
    cout << l << " " << r << endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define MAX(a,b) (((a)>(b))?(a):(b))

int main(){
    string s, t;
    int i, j;
    cin >> s >> t;
    int n = s.length(), m = t.length();
    int dp[n + 1][m + 1] = {};
    for(i = 1; i <= n; i++){
        for(j = 1; j <= m; j++){
            if(s[i-1] == t[j-1]){
                dp[i][j] = dp[i-1][j-1] + 1;
            }
            else{
                dp[i][j] = MAX(dp[i-1][j], dp[i][j-1]);
            }
        }
    }

    string a = "";
    i = n;
    j = m;
    while(i > 0 && j > 0){
        if(dp[i][j] == dp[i-1][j]){
            i--;
            continue;
        }
        if(dp[i][j] == dp[i][j-1]){
            j--;
            continue;
        }
        a = s[i-1] + a;
        i--;
        j--;
    }
    cout << a << endl;
}

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

using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
#define REP(i,n) for(ll i = 0;i < (ll)n;i++)
#define REPD(i,n) for(ll i = (ll)n - 1;i >= 0;i--)
#define ALL(x) (x).begin(),(x).end()
#define FILLl(n,first_dimension_size,value) fill((ll*)n,(ll*)(n+first_dimension_size),value)
#define FILL(n,first_dimension_size,value) fill((int*)n,(int*)(n+first_dimension_size),value)
#define INF (1 << 30)
#define MOD 1000000007
//int dy[4] = {-1,0,0,1};
//int dx[4] = {0,1,-1,0};



int main(){

  string s;
  cin >> s;
  string res = "";
  res += s[0];
  res += to_string((int)s.size()-2);
  res += s[(int)s.size()-1];
  cout << res << endl;


  

  return 0;
}


Measured memory_bytes: 256
/*
No i'm not down, No I'm not out
*/
#include <bits/stdc++.h>
using namespace std;
#define fast() ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define ll  long long
#define f(i,a,b) for(int i=a; i<b; i++)
#define pb push_back
#define MP make_pair
#define vi vector<int>
#define vll vector<long long>
#define M map<int,int>
#define F     first
#define S    second
#define nl "\n"
#define lb lower_bound
#define ub upper_bound
#define max(a, b) (a < b ? b : a)
#define min(a, b) (a > b ? b : a)
#define mem(a,n)  memset(a, n, sizeof(a))
#define all(v) v.begin(), v.end()
int dx[8] ={0, 0, 1, 1, 1, -1, -1, -1};
int dy[8] ={1, -1, -1, 0, 1, -1, 0, 1};
#define mod 10000007
#define N 100005

int main()
{
    fast();
    int n;
    cin >> n;
    int a[n], dp[n];
    f(i, 0, n)
    {
        cin >> a[i];
        if(!i)dp[i] = 0;
        else if(i == 1)dp[i] = abs(a[0]-a[1]);
        else dp[i] = min((dp[i-1] + abs(a[i] - a[i-1])), (dp[i-2] + abs(a[i] - a[i-2])));
    }
    cout << dp[n-1] ;
    return 0;

}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef  long long  ll;
ll inf=LLONG_MAX,mod=1000000007,BS,k;

int main(){
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        #ifndef ONLINE_JUDGE
            freopen("input.txt","r",stdin);
            freopen("output.txt","w",stdout);
        #endif
        string s,t;cin>>s>>t;
        ll mi=inf,sum=0,n,m;n=s.length();m=t.length();
        for(ll i=0;i+m-1<n;i++){
            sum=0;
            for(ll j=0;j<m;j++)
            if(t[j]!=s[i+j])
            sum++;
            mi=min(mi,sum);
        }
        cout<<mi;

}


Measured memory_bytes: 3636
import itertools
N,M=map(int,input().split())

graph=[[] for _ in range(N+1)]
for _ in range(M):
  a,b=map(int,input().split())
  graph[a].append(b)
  graph[b].append(a)
#print(graph)

answer=0
for perm in itertools.permutations(range(2,N+1)):
  path=[1]+list(perm)
  #print(path)
  
  for i in range(1,N):
    u=path[i-1]
    v=path[i]
    if not v in graph[u]:
      break
  else:
    answer+=1
    
print(answer)

Measured memory_bytes: 40176
#include <iostream>
#include <string>
using namespace std;
const int len = 1e5 + 10;
const long long mod = 1e9 + 7;
long long dp[len][14];
int main()
{
	string s;
	cin >> s;
	int len = s.length(), cur;
	dp[0][0] = 1;
	for (int i = 0; i < len; i++) {
		if (s[i] == '?') cur = -1;
		else cur = s[i] - '0';
		for (int j = 0; j < 10; j++) {
			if (cur != -1 && cur != j) continue;
			for (int k = 0; k < 13; k++) {
				dp[i + 1][(k * 10 + j) % 13] += dp[i][k];
			}
		}
		for (int j = 0; j < 13; j++) {
			dp[i + 1][j] %= mod;
		}
	}
	cout << dp[len][5];
}


Measured memory_bytes: 11392
/* Coached by rainboy */
#include <stdio.h>
#include <stdlib.h>

#define N 8
#define INF 0x3f3f3f3f

int main() {
	static int ll[N];
	int n, a, b, c, i, p, x, ans;

	scanf("%d%d%d%d", &n, &a, &b, &c);
	for (i = 0; i < n; i++)
		scanf("%d", &ll[i]);
	p = 1;
	for (i = 0; i < n; i++)
		p *= 4;
	ans = INF;
	for (x = 1; x < p; x++) {
		int y, k1, k2, k3, s1, s2, s3, mp;

		k1 = k2 = k3 = s1 = s2 = s3 = 0;
		for (i = 0, y = x; i < n; i++, y /= 4) {
			int d = y % 4;

			if (d == 1)
				k1++, s1 += ll[i];
			else if (d == 2)
				k2++, s2 += ll[i];
			else if (d == 3)
				k3++, s3 += ll[i];
		}
		if (k1 == 0 || k2 == 0 || k3 == 0)
			continue;
		mp = (k1 - 1 + k2 - 1 + k3 - 1) * 10 + abs(a - s1) + abs(b - s2) + abs(c - s3);
		if (ans > mp)
			ans = mp;
	}
	printf("%d\n", ans);
	return 0;
}


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

int main() {
	int A,B,K;
  	cin>>K>>A>>B;
   	int ikeru;
  
	for(int i=A;i<=B;i++){
       if(i%K==0){
      	ikeru++;
      }
    }
  
  
  	if(ikeru>0){
    	cout<<"OK"<<endl;
    }
  	else{
     	cout<<"NG"<<endl;
    }
  
}

Measured memory_bytes: 3556
#include<iostream>
#include<vector>
#include<string>
#include<map>

// ref : https://drken1215.hatenablog.com/entry/2018/09/23/232100

int main(){
    std::string S, T;
    std::cin >> S >> T;
    std::map<char, char> transform, invTransform;
    for(int i = 0; i < S.size(); i++){
        char s = S[i], t = T[i];
        if(transform.count(s)){
            if(transform[s] != t){
                std::cout << "No" << std::endl;
                return 0;
            }
        }
        if(invTransform[t]){
            if(invTransform[t] != s){
                std::cout << "No" << std::endl;
                return 0;
            }
        }
        transform[s] = t, invTransform[t] = s;
    }
    std::cout << "Yes" << std::endl;
    return 0;
}


Measured memory_bytes: 776
import math

a, b, x = map(int, input().split())

epsilon = 1e-6
delta = 1.0
lim_sum = b * a / 2
lim_sum *= a
tmp_sum = 0.0
theta = 0.0
N = 1000

stop_count = 0

if x == lim_sum:
    #45度のとき
    print(float(45))
elif x > lim_sum:
    #45度未満のとき
    while True:
        stop_count += 1
        if theta < 0 or 90 < theta or stop_count == N:
            print('error')
            break
        tmp_sum = a*b - a*a*math.tan(math.radians(theta))/2.0
        tmp_sum *= a
        #print(theta, tmp_sum, x)
        if x - tmp_sum > 0:
            theta -= delta
            delta /= 2
            continue
        elif abs(x - tmp_sum) <= epsilon:
            print(theta)
            break
        theta += delta
elif x < lim_sum:
    #45度より大きいとき
    theta = 45.0
    while True:
        stop_count += 1
        if theta < 0 or 90 < theta or stop_count == N:
            print('error')
            break
        tmp_sum = b*b/math.tan(math.radians(theta))/2.0
        tmp_sum *= a
        #print(theta, tmp_sum, x)
        if x - tmp_sum > 0:
            theta -= delta
            delta /= 2
            continue
        elif abs(x - tmp_sum) <= epsilon:
            print(theta)
            break
        theta += delta

Measured memory_bytes: 3316
// Package main provides
//
// File:  main.go
// Author: ymiyamoto
//
// Created on Sat Feb  9 15:06:41 2019
//
package main

import (
	"fmt"
	"sort"
)

func main() {
	var N, K int
	fmt.Scan(&N, &K)

	m := map[int]int{}
	for i := 0; i < N; i++ {
		var a int
		fmt.Scan(&a)
		m[a]++
	}

	nums := make([]int, 0)
	for _, v := range m {
		nums = append(nums, v)
	}
	sort.Ints(nums)

	ans := 0
	for i := 0; i+K < len(nums); i++ {
		ans += nums[i]
	}

	fmt.Println(ans)
}


Measured memory_bytes: 16896
#include <iostream>

int main()
{
  int a, b, c;
  int x;
  int count = 0;

  std::cin >> a;
  std::cin >> b;
  std::cin >> c;
  std::cin >> x;


  for (int i = 0; i <= a; ++i) {
    for (int j = 0; j <= b; ++j) {
      for (int r = 0; r <= c; ++r) {
        if (x == i*500 + j*100 + r*50) {
          count++;
        }
      }
    }
  }

  std::cout << count << std::endl;



  return 0;
}


Measured memory_bytes: 256
def solve():
    n = read()
    result = think(n)
    write(result)


def read():
    return read_int(1)[0]


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(n):
    count = 0
    for i in range(n):
        if len(str(i + 1)) % 2 == 1:
            count += 1
    return count


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

Measured memory_bytes: 39920
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
#define LL long long

using namespace std;

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

    LL sum[N-1];
    REP(i,N-1)sum[i]=a[i]+a[i+1];

    LL ans=0;
    REP(i,N-1){
        if(sum[i]>x){
            ans+=sum[i]-x;
            if(i<N-2){
                sum[i+1]-=(a[i+1]>=sum[i]-x ? sum[i]-x : a[i+1]);
            }
            sum[i]=x;
        }
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long i,j,k,a,b,c,x,y,sumc=0,sumx=0,sumy=0;
  cin >> a >> b >> c >> x >> y;
  
  while(a+b >= 2*c && sumx < x && sumy < y){
	sumc += 2*c;
    sumx += 1;
    sumy += 1;
  }
  while(a+b < 2*c && sumx < x && sumy < y){
	sumc += a+b;
    sumx += 1;
    sumy += 1;
  }
  
  while(sumx < x){
    if(a <= 2*c){
      sumc += a;
      sumx += 1;
    }
    if(a > 2*c){
      sumc += 2*c;
      sumx += 1;
    }
  }
  
  while(sumy < y){
    if(b <= 2*c){
      sumc += b;
      sumy += 1;
    }
    if(b > 2*c){
      sumc += 2*c;
      sumy += 1;
    }
  }
  
  cout << sumc << endl;
}

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

int main(){
    long n, numjumps=0, prevnumjumps=-1;
    uint64_t h, hprev;
    std::cin>>n;
    std::cin>>hprev;
    for (long i = 1; i < n; i++)
    {
        std::cin>>h;
        if(h<=hprev){
            numjumps++;
            hprev=h;
        }
        else
        {
            if(numjumps>prevnumjumps){
                prevnumjumps=numjumps;
            }
            numjumps=0;
            hprev=h;
        }
    }
    if(numjumps>prevnumjumps){
        prevnumjumps=numjumps;
    }
    std::cout<<prevnumjumps<<"\n";
    return 0;
}

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

// M A F I A - M A F I A - M A F I A - M A F I A - M A F I A - M A F I A //

#define int                                       long long
#define lop(i,s,e)                                for(int i=s;i<(int)e;i++)
#define rlop(i,e,s)                               for(int i=e;i>=s;i--)
#define prvec(v)                                  lop(R15,0,v.size())cout << v[R15] <<" "; cout << endl;
#define prarr(arr,s1,e1)                          lop(R15,s1,e1)cout << arr[R15] << " "; cout << endl;

#define endl                                      '\n'
#define ff                                        first
#define ss                                        second
#define pii                                       pair<int,int>

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

// M A F I A - M A F I A - M A F I A - M A F I A - M A F I A - M A F I A //
#define bug(...)                                  __f (#__VA_ARGS__, __VA_ARGS__)
#define rtn                                       if(0)return;
template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { rtn cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{    rtn
     const char* comma = strchr (names + 1, ',');
     cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

const int N = 3e6 + 7, M = 1000000007, inf = INT_MAX;
const long long INF = LLONG_MAX;

int n, Q;
int arr[N + 2];

#define ld long double

void solve()
{
     ld x;
     cin >> x;
     ld p = 100;

     lop(i, 1, 10000)
     {
          ld t = p * .01;
          p += floor(t);
          // bug(i, p);
          if ( p >= x )
          {
               cout << i;
               return;
          }
     }

}

int32_t main()
{
     ios_base::sync_with_stdio(0);   cin.tie(0);   cout.tie(0);

     int test = 1;
     // cin >> test;
     while (test--)solve();


}





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

#define rep(i, a, n)  for(ll i=a; i<n; i++)
#define per(i, a, n)  for(ll i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define LONGMAX 1e18
#define llMAX 1000000000
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;

int n, m;
map<int, int> mp;

int main(){
  cin >> n >> m;
  vector<int> a(m);
  vector<ll> dp(n+1);
  for(int i = 0; i < m; i++)cin >> a[i];

  //降順にする
  sort(all(a));
  reverse(all(a));

  string res = "";

  //数字とマッチ棒の対応を表す連想配列の定義
  mp[1] = 2; mp[2] = 5; mp[3] = 5;
  mp[4] = 4; mp[5] = 5; mp[6] = 6;
  mp[7] = 3; mp[8] = 7; mp[9] = 6;//動的計画法部分
  

  //桁に対してDPを行う．dp[i] = 桁数: i本のマッチ棒で作れる桁数
  dp[0] = 0;
  for(int i = 1; i < n+1; i++){
    ll ans  = INT32_MIN;
    for(int j = 0; j < m; j++){
      ll index = i - mp[a[j]];
      if(index >= 0){
        ll tmp = dp[index]+1;
        ans = max(tmp, ans);
      } 
    }
    dp[i] = ans;
  }

  //dp[n]の桁に対して，最上位桁かた順々に決定していく．
  int match = n;//マッチの数
  while(match > 0){
    for(int j = 0; j < m; j++){
      int index = match - mp[a[j]];
      if(index < 0 )continue;//indexの負は未定義なので，処理しない
      if(dp[index] == (dp[match]-1)){
        res += a[j]+'0';
        match -= mp[a[j]];
        break;//決まったら次のマッチ棒へ
      }
    }
  }
  cout << res << endl;
}

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

using namespace std;

typedef long long int ll;

const ll N=1e6+1;

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

ll fact[N];
bool prime[N];

void sieve(){
    for(ll i=2;i<N;i++){
        if(prime[i]==true){
            for(ll j=i*i;j<=N;j+=i){
                prime[j]=false;
                fact[j]=i;
            }
        }
    }
}

int main(){
    ll n,x,t;
    cin>>n>>x>>t;
    if(n%x==0)
        cout<<(n/x)*t;
    else
        cout<<(n/x+1)*t;
    return 0;
}


Measured memory_bytes: 3636
h,w = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(h)]
li = []

for i in range(h):
    for j in range(w-1):
        if a[i][j]%2 == 1:
            li.append((i+1,j+1,i+1,j+2))
            a[i][j] -= 1
            a[i][j+1] += 1

for i in range(h-1):
    if a[i][w-1]%2 == 1:
        li.append((i+1,w,i+2,w))
        a[i][w-1] -= 1
        a[i+1][w-1] += 1

print(len(li))
for i in li:
    print(*i)

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

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

        int ans;
        int i;

        if (n == 0) {
                ans = 0;
        }
        else {
                for(i = 1; i < n + 1; i *= 2) {
                        ans = i;
                }
        }

        cout << ans << endl;
}


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;

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

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

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

    int l; cin>>l;

    int N = 0;
    while(pow(2, N) <= l) N++;

    vector<T> edge;
    for(int i=1; i<N; i++){
        int u = i, v = i + 1;
        edge.emplace_back(u, v, pow(2, i - 1));
        edge.emplace_back(u, v, 0);
    }

    int base = pow(2, N - 1);
    for(int i=N-1; i>=1; i--){
        if(l - pow(2, i - 1) >= base){
            edge.emplace_back(i, N, l - pow(2, i - 1));
            l -= pow(2, i - 1);
        }
    }

    int M = edge.size();

    cout << N << " " << M << endl;
    for(auto i : edge){
        cout << get<0>(i) << " " << get<1>(i) << " " << get<2>(i) << endl;
    }


    return 0;
}

Measured memory_bytes: 384
import heapq
from collections import deque

N, K = map(int, input().split())
v = list(map(int, input().split()))

res = 0 # 答えの初期値
for i in range(K+1): # 左端から宝石を取り出す回数
    for j in range(K+1-i): # 右端から宝石を取り出す回数
        sub = K - i - j # 価値がマイナスの宝石を捨てる回数
        d = deque(v) # dequeに詰まった宝石
        a = [] # 持っている宝石
        
        # 左端から宝石を取り出す
        cnt = 0
        while (cnt < i) & (len(d) > 0):
            heapq.heappush(a, d.popleft())
            cnt += 1
            
        # 右端から宝石を取り出す
        cnt = 0
        while (cnt < j) & (len(d) > 0):
            heapq.heappush(a, d.pop())
            cnt += 1
        
        # 試行回数が許す限り手持ちの宝石から価値がマイナスのものを捨てる
        # マイナスでない事によるストップ→bを足す、そうでないなら足さない
        b = 0 # 捨てる宝石の価値
        cnt = 0
        while (cnt < sub) & (b <= 0) & (len(a) > 0):
            b = heapq.heappop(a)
            cnt += 1
        value = sum(a) + b if b > 0 else sum(a)
        res = max(res, value)
print(res)

Measured memory_bytes: 3444
#include<iostream>
#include<algorithm>
#include<map>
#include<climits>
#include<cctype>
using namespace std;
typedef long long ll;
#define reps(i,b,n) for(int i = b ; i < n ; ++i )
#define rep(i,n) reps(i,0,n)
#define INFTY (1 << 31)
#define fr first
#define sc second

int main(){
  ll n , T , ans = 0;
  string f;
  cin >> n >> T;
  cin >> f;
  for(int i = 0 ; i < f.size() ; i++ ){
    if(!isdigit(f[i])) continue;
    ll rec = 1;
    for(int j = 0 ; j < f[i] - '0' ; j++ ) rec = ( rec * n ) % (ll)INT_MAX;
    ans += rec;
    ans = min(ans,(ll)INT_MAX);
  }
  ans *= T;
  if( 1e+9 < ans ) cout << "TLE" << endl;
  else cout << ans << endl;
}

Measured memory_bytes: 1200
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define MAX 100005
#define mod 1000000007
#define sp fixed<<setprecision(12)
using namespace std;

void solve(){
    string s,t;
    cin>>s>>t;
    int ans=0;
    for(int i=0;i<(s.size());i++){
        if(s[i]!=t[i]) ans++;
    }
    cout<<ans<<"\n";

}

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    //double    pi=3.14159265358979323846;

    int t=1;
    //cin>>t;
    while(t--){
        solve();   
    }

    return 0;
    
}

Measured memory_bytes: 3880
#![allow(non_snake_case)]
#![allow(unused_variables)]
#![allow(dead_code)]

fn main() {
    let N: i64 = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().parse().unwrap()
    };

    let m = std::cmp::min(5000, 2 * ((N - 2) / 2));
    let res = if N == 3 {
        vec![2, 3, 25]
    } else {
        (0..m)
            .map(|i| 6 * i + 3)
            .chain((1..(N - m + 1)).map(|i| {
                if m + i == N && i % 3 == 1 {
                    2 * (i + 2)
                } else {
                    2 * i
                }
            }))
            .collect::<Vec<_>>()
    };
    let ans = res
        .iter()
        .map(|&x| x.to_string())
        .collect::<Vec<_>>()
        .join(" ");

    println!("{}", ans);
}


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

int main(){
	int n,num;
	vector<int> nums;
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> num;
		nums.push_back(num);
	}

	vector<long> res;
	for (int i = -100; i < 101; i++){
		long sum(0);
		for (int j = 0; j < nums.size(); j++){
			sum += pow(nums[j] - i, 2);
		}
		res.push_back(sum);
	}

	long result = *min_element(res.begin(), res.end());
	cout << result;

}


Measured memory_bytes: 256
import sys

def get_gcd(x, y):
    if x < y:
        x, y = y, x

    if x % y == 0:
        return y                # ?°??????????????????§??¬?´???°
    else:
        return get_gcd(y, x % y)
    
if __name__ == '__main__':
    data = sys.stdin.readline().strip().split(' ')
    x = int(data[0])
    y = int(data[1])

    ans = get_gcd(x, y)
    print(ans)
    

Measured memory_bytes: 7760
package main

import "fmt"

func main() {
	var w, h, x, y int
	fmt.Scan(&w, &h, &x, &y)

	ans1 := float64(w*h) / 2

	ans2 := 0
	if x*2 == w && y*2 == h {
		ans2 = 1
	}

	fmt.Printf("%g %d\n", ans1, ans2)
}


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

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double dd;
#define all(v) v.begin(),v.end()
#define all(v) v.begin(),v.end()
#define endl "\n"
#define clr(n, r) memset(n,r,sizeof(n))
typedef bitset<13> MASK;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef vector<vector<int>> vvi;

//set iterator can be increamnted and decreamnted
void fast() {
    cin.tie(0);
    cin.sync_with_stdio(0);
}


int main() {
    fast();
    int n;cin>>n;
    int cnt=0;
    while(n--){
        int a,b;cin>>a>>b;
        if(a==b)cnt++;
        else cnt=0;
        if(cnt==3)return cout<<"Yes",0;
    }
    cout<<"No";
}


Measured memory_bytes: 3644
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <map>

using namespace std;

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

#define F first
#define S second
#define mkp make_pair
#define pb push_back
#define ppb pop_back
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
#define show(x) cerr << "# " << #x << " = " << (x) << endl
//#define int ll

const int N = 2e6 + 1;
const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int szT = (1 << 17) - 1;
const double PI = acos(-1.0);
const int dx[] = {0,0,1,-1};
const int dy[] = {1,-1,0,0};

char c;

int main () {
//    freopen(".in", "r", stdin);
//    freopen(".out", "w", stdout);
    ios_base :: sync_with_stdio(0);
    cin >> c;
    if(c == 'A') {
        cout << 'T';
    }
    if(c == 'T') {
        cout << 'A';
    }
    if(c == 'C') {
        cout << 'G';
    }
    if(c == 'G') {
        cout << 'C';
    }
    return 0;
}


Measured memory_bytes: 256
import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    val k = scanner.nextInt()
    val list = mutableListOf<Int>()
    for (i in (1..n)) {
        list.add(scanner.nextInt())
    }
    println(list.count { it >= k })
}


Measured memory_bytes: 51296
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define elif else if
using namespace std;
int a,b,c,d,e,f,g;
string s;
signed main()
{
	cin>>a>>b>>c>>d;
	a--;
	e=c;
	f=d;
	while(1){
		if(f%e==0){
			g=e;
			break;
		}else{
			g=f%e;
			f=e;
			e=g;
		}
	}
	e=c*d/g;
	cout<<b-a-b/c-b/d+b/e+a/c+a/d-a/e;
}

Measured memory_bytes: 256
N, M = list(map(int, input().split()))


ACd = [0] * N
whenACd = [0] * N

pena = 0
I,X=[],[]
for m in range(M):
    i, x = list(map(str, input().split()))
    I.append(i)
    X.append(x)

for m,(i,x) in enumerate(zip(I,X)):
    if x == 'AC' and ACd[int(i) - 1] == 0:
        ACd[int(i) - 1] = 1
        whenACd[int(i) - 1] = m

for m,(i,x) in enumerate(zip(I,X)):
    if x == 'WA' and whenACd[int(i) - 1] > m:
        pena += 1

print(sum(ACd), pena)

Measured memory_bytes: 20580
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
typedef long long ll;
using namespace std;

int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  int dis = abs(c-a);
  if(dis <= d){
    cout << "Yes" << endl;
    return 0;
  }else{
    int dis1 = abs(b-a);
    int dis2 = abs(c-b);
    if(dis1 <= d && dis2 <= d){
      cout << "Yes"  << endl;
      return 0;
    }else{
      cout << "No" << endl;
      return 0;
    }
  }
}


Measured memory_bytes: 256
X, Y, A, B, C = map(int, input().split())
P = sorted(list(map(int, input().split())))
Q = sorted(list(map(int, input().split())))
R = list(map(int, input().split()))

A = sorted(P[-X:] + Q[-Y:] + R)
print(sum(A[-(X+Y):]))


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

int main(void) {
  int N;
  cin >> N;
  vector<int> a(N);
  int i = 0;
  int r = -N;
  for(; i < N; i++) {
    cin >> a[i];
    r += a[i];
  }
  cout << r << endl;
}

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

#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define size_t unsigned long long
#define ll long long
#define rep(i,a) for(int i=0;i<(a);i++)
#define repr(i,a) for(int i=(int)(a)-1;i>=0;i--)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORR(i,a,b) for(int i=(int)(b)-1;i>=a;i--)
#define ALL(a) a.begin(), a.end()
using namespace std;
int si() { int x; scanf("%d", &x); return x; }
long long sl() { long long x; scanf("%lld", &x); return x; }
string ss() { string x; cin >> x; return x; }
void pi(int x) { printf("%d ", x); }
void pl(long long x) { printf("%lld ", x); }
void pd(double x) { printf("%.15f ", x); }
void ps(const string &s) { printf("%s ", s.c_str()); }
void br() { putchar('\n'); }

const int MOD = 1e9 + 7;

struct mint {
    int n;
    mint(int n_ = 0) : n(n_) {}
};

mint operator+(mint a, mint b) { a.n += b.n; if (a.n >= MOD) a.n -= MOD; return a; }
mint operator-(mint a, mint b) { a.n -= b.n; if (a.n < 0) a.n += MOD; return a; }
mint operator*(mint a, mint b) { return (long long)a.n * b.n % MOD; }
mint &operator+=(mint &a, mint b) { return a = a + b; }
mint &operator-=(mint &a, mint b) { return a = a - b; }
mint &operator*=(mint &a, mint b) { return a = a * b; }

typedef pair<int, int> P;

const int N = 1e6+5;
string s;
vector<int> v[N];
int n,c;
ll a[N];

int main () {
  cin >> s;
  n = s.length()/2;
  rep(i,n){
    if(s[i] != s[s.length()-1-i]) c++;
  }
  cout << c << endl;
}


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

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)

using ll = long long;
using ld = long double;
ll INF = LLONG_MAX;

using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;

namespace output {
	void pr(int x) { cout << x; }
	void pr(long x) { cout << x; }
	void pr(ll x) { cout << x; }
	void pr(unsigned x) { cout << x; }
	void pr(unsigned long x) { cout << x; }
	void pr(unsigned long long x) { cout << x; }
	void pr(float x) { cout << x; }
	void pr(double x) { cout << x; }
	void pr(ld x) { cout << x; }
	void pr(char x) { cout << x; }
	void pr(const char* x) { cout << x; }
	void pr(const string& x) { cout << x; }
	void pr(bool x) { pr(x ? "true" : "false"); }
	template<class T> void pr(const complex<T>& x) { cout << x; }
	
	template<class T1, class T2> void pr(const pair<T1,T2>& x);
	template<class T> void pr(const T& x);
	
	template<class T, class... Ts> void pr(const T& t, const Ts&... ts) { 
		pr(t); pr(ts...); 
	}
	template<class T1, class T2> void pr(const pair<T1,T2>& x) { 
		pr("{",x.f,", ",x.s,"}"); 
	}
	template<class T> void pr(const T& x) { 
		pr("{"); // const iterator needed for vector<bool>
		bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; 
		pr("}");
	}
	
	void print() { pr("\n"); } // print w/ spaces
	template<class T, class... Ts> void print(const T& t, const Ts&... ts) { 
		pr(t); if (sizeof...(ts)) pr(" "); print(ts...); 
	}
}

using namespace output;

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int H, W; cin >> H >> W;
	int N; cin >> N;
	vi arr (N);
	F0R(i, N) cin >> arr[i];

	vector<vi> ans (H, vi (W));
	bool dir = false;
	int cur = 0;
	F0R(y, H) {
		F0R(j, W) {
			int x = dir ? j : W - j - 1;
			while (arr[cur] == 0) ++cur;
			ans[y][x] = cur + 1;
			--arr[cur];
		}
		dir = !dir;
	}
	for (vi row : ans) {
		for (int x : row) {
			cout << x << " ";
		}
		cout << endl;
	}
}

Measured memory_bytes: 384
using System;

namespace AOJ0034
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string input = Console.ReadLine();
                if (string.IsNullOrEmpty(input)) break;
                string[] num = input.Split(',');
                decimal[] distance = new decimal[10];
                decimal[] total = new decimal[10];

                for (int i = 0; i < 10; i++)
                {
                    distance[i] = decimal.Parse(num[i]);
                    if (i != 0) total[i] = total[i - 1] + distance[i];
                    if (i == 0) total[i] = distance[i];
                }
                decimal v1 = decimal.Parse(num[10]);
                decimal v2 = decimal.Parse(num[11]);

                decimal t = 0.000m;
                t = total[9] / (v1 + v2);
                decimal position = v1 * t;
                int place = 0;

                for (int i = 0; i < 10; i++)
                {
                    if (position <= total[i])
                    {
                        place = i+1;
                        break;
                    }
                }

                Console.WriteLine(place);
            }
        }
    }
}

Measured memory_bytes: 9144
/**   Created by: Marcos Portales
          Codeforces User: marcosportales
          Country: Cuba
          Copyright                    */
#include<bits/stdc++.h>
using namespace std;
/// Pragmas:
#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
#pragma GCC target("avx2") //Enable AVX
/// Macros:
#define int long long
#define f first
#define s second
#define db(x) cerr << #x << ": " << (x) << '\n';
#define pb push_back
#define lb lower_bound
#define up upper_bound
#define all(x) x.begin() , x.end()
#define rall(x) x.rbegin() , x.rend()
#define enl '\n'
#define vi vector<int>
#define sz(a) int((a).size())
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,n) for(int i=(1);i<=(n);i++)
typedef pair<int,int> ii;
typedef long double ld;
typedef unsigned long long ull;
/// Constraints:
const int maxn = 200005;
const int mod = 1000000007;
const ld eps = 1e-9;
const int inf = ((1ll<<31ll)-1ll);
const int INF = 2000000000000000000ll;
const ld pi = acos(-1);
/// Prime Numbers:
// 2, 173, 179, 181, 197, 311, 331, 737, 1009, 2011, 2027, 3079, 4001, 10037, 10079, 20011, 20089;
// 100003, 100019, 100043, 200003, 200017, 1000003, 1000033, 1000037, 1000081;
// 2000003, 2000029, 2000039, 1000000007, 1000000021, 2000000099;
/// Functions:
#define lg2(x) 31 - __builtin_clz(x)
#define lgx(x,b) ( log(x) / log(b) )
/// Red-Black Tree Test.insert(x)late ---------------------------------
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//typedef tree < long long ,  null_type ,  less<long long> ,  rb_tree_tag ,  tree_order_statistics_node_update > ordered_set;
/// Quick Pow------------------------------------------------
int qpow(int b,int e){
    if( !e ) return 1;
    if( e & 1 ) return qpow(b,e-1) * b % mod;
    int pwur = qpow(b,e>>1);
    return (pwur * pwur) % mod;
}
int modinv(int x){
    return qpow(x,mod-2);
}

/// My Code -------------------------------------------------

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    cout.setf(ios::fixed); cout.precision(0);
    srand(time(NULL));
    //freopen("a.in","r",stdin);
    //freopen("a.in","w",stdout);
    int n;
    cin>>n;
    map<int,int>mp;
    rep(i,n){
        int x;
        cin>>x;
        if(mp[x]==0)mp[x]++;
        else mp[x]--;
    }
    int ans=0;
    for(auto val:mp){
        ans+=val.s;
    }
    cout<<ans<<enl;

    return 0;
}


Measured memory_bytes: 9792
import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char[] c = new char[4];

    for(int i = 0;i < 4;i++) {
      c[i] = s.charAt(i);
    }

    if(c[0] == c[1] || c[1] == c[2] || c[2] == c[3]) {
      System.out.println("Bad");
    } else {
      System.out.println("Good");
    }

  }

}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
#include <vector>
#include <queue>
#include <stack>
#include <cstring>
#define mil 200001

using namespace std;


int main()
{
    int n,k,count = 0,lenght = 0,index;
    string s;
    cin>>n>>k;
    cin>>s;
    int count0 = 0,total0 = 0,lastIndex[mil] = {5};
    int temp = k, p =0;
    bool flag = true;
    for(int i=0;i<n;i++)
    {
        if(s[i] == '0' && s[i+1] == '1')
            lastIndex[p++] = i+1;
    }
    p = 0;
    for(int i=0;i<n;i++)
    {
       if(s[i] == '1')
       {
           count++;flag = true;
           if(count > total0)
            total0 = count;
       }
       else
       {
           if(temp == 0 && flag == true)
           {
               count = i - lastIndex[p];p++;
               temp = 1;
           }
           if(flag == true)
            {
                temp--;flag = false;
            }
           count++;
           if(count > total0)
            total0 = count;
       }
    }
    cout<<total0;



}


Measured memory_bytes: 1280
n,a,b = gets.split.map(&:to_i)
l = []
for i in a..n
if i < 10 && i >= a && i <= b
    l << i
elsif i >= 10 
   sum = i.to_s.split("").map(&:to_i).inject(:+)
    if sum >= a && sum <= b
        l << i
    end
end
end
puts l.inject(:+)

Measured memory_bytes: 4092
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;

int main(){
int s;
double w,h,BMI;
char p;

while(cin>>s>>p>>w>>p>>h){
    BMI=w/(h*h);

    if(BMI>=25){
        cout<<s<<endl;
    }
}
    return 0;
}


Measured memory_bytes: 3200
import java.io.*;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb= new StringBuilder();
		
		while (true) {
			String input = br.readLine();
			String cut[] = input.split(" ");
			int x = Integer.parseInt(cut[0]);
			int y = Integer.parseInt(cut[1]);
			if(x==0 && y==0){
				break;
			}
			else if (x < y) {
				sb.append(x + " " + y+"\n");
			} else if(x > y) {
				sb.append(y + " " + x+"\n");
			}
			else{
				sb.append(x +" "+y+"\n");
			}
		}
		System.out.print(sb);
	}
}

Measured memory_bytes: 26828
#include <iostream>
#include <cstdio>
#include <queue>
#include <stdlib.h>
#include <stack>
#include <string.h>
#include <set>
#include <iomanip>
#include <ctime>
#include <map>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <cstring>
#define eps 1e-15
#define ull unsigned long long
//priority_queue<int,vector<int>,greater<int> > q;
//priority_queue<int,vector<int>,less<int> > q;
//#define ls l, mid, rt << 1
//#define rs mid + 1, r, rt << 1 | 1
using namespace std;
typedef long long ll;
//typedef pair<int,int> P;
const int inf = 0x3f3f3f3f;
const int mod = 1e9+7;
const long long mod1 = 1e16;
//int gcd(int a, int b) {return a % b == 0 ? b : gcd(b, a % b);}
//int Find(int x){return x == p[x] ? x : p[x] = Find(p[x]);}
//#define lson 1<<rt
//#define rson 1<<rt|1
const int maxn=1e5+7;
#define pi 3.1415926535898
#define PI atan(1.0)*4
int dx[4]= {0,1,0,-1},dy[4]= {1,0,-1,0};
int dir[4][2]= {{1,0},{-1,0},{0,1},{0,-1}};
int dir1[8][2]= {{1,0},{-1,0},{0,1},{0,-1},{1,1},{-1,1},{1,-1},{-1,-1}};
//int d[]= {1,-1,4,-4}; //八数码问题
//----------------------------------------
int n,c,k,a[maxn],ans=0;
int main()
{
    while(cin>>n>>c>>k)
    {
        for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a+1,a+1+n);
    for(int i=1;i<=n;i++)
    {
        int j;
        if(a[n]>a[i]+k)
            j=upper_bound(a+1,a+1+n,a[i]+k)-a-1;
            else
                j=n;
        j=min(i+c-1,j);
        i=j;
        ans++;
    }
    cout<<ans<<endl;
    }
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define INF 1e18
#define int long long
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) Rep(i, 0, n)
#define all(a) (a).begin(), (a).end()
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int mod = 1000000007;

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

    int n;
    cin >> n;
    vector<int> v(n);
    rep(i, n) cin >> v[i];
    sort(all(v));
    double ans = v[0];
    Rep(i, 1, n) ans = (ans + v[i]) / 2.0;
    printf("%.8lf\n", ans);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define PI acos(-1)

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

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

    int a, b, c;
    cin>>a>>b>>c;
    cout<<min(a, min(b, c))<<" "<<max(a, max(b, c))<<endl;
}


Measured memory_bytes: 3216
package main

import (
  "fmt"
)

func main() {

  var a, b int

  fmt.Scan(&a, &b)
  
  for i:=1 ;i<=1009; i++ {
    if (i * 8 - i * 8 % 100) == a * 100 && (i * 10 - i * 10 % 100) == b * 100 {
      fmt.Println(i)
      return
    }
  }
  
  fmt.Println("-1")
}

Measured memory_bytes: 512
#include<iostream>
#include<string>
using namespace std;
int main(){
	int a,b;
	char p;
	while(cin>>a>>p>>b){
		if(p=='+')
			cout<<a+b<<endl;
		if(p=='-')
			cout<<a-b<<endl;
		if(p=='*')
			cout<<a*b<<endl;
		if(p=='/')
			cout<<a/b<<endl;
		if(p=='?')
			break;
	}
	return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
	int g,h[6], m[6], s[6], i, a,b,c;
	cin >> h[0] >> m[0] >> s[0] >> h[1] >> m[1] >> s[1] >> h[2] >> m[2] >> s[2] >> h[3] >> m[3] >> s[3] >> h[4] >> m[4] >> s[4] >> h[5] >> m[5] >> s[5];
	for (i = 0; i < 6; i=i+2)
	{
		g =( h[i+1] * 3600 + m[i+1] * 60 + s[i+1] )- (h[i] * 3600 + m[i] * 60 + s[i]);
		a = g / 3600;
		b = g % 3600 / 60;
		c = g % 3600 % 60;
		cout << a << " " << b << " " << c << endl;
	}
		return 0;
}

Measured memory_bytes: 3096
package main

import (
	"fmt"
	"math"
)

func main() {
	var n, p int
	fmt.Scan(&n)

	min := int(math.Pow(10, 15))
	for i := 0; i < 5; i++ {
		fmt.Scan(&p)
		if p <= min {
			min = p
		}
	}

	fmt.Println(((n + min - 1) / min) + 4)
}


Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<long long int>> v(8, vector<long long int>(0));
    for (int i = 0; i < n; i++) {
        long long int a, b, c;
        cin >> a >> b >> c;
        for (int ia = -1; ia <= 1; ia += 2) {
            for (int ib = -1; ib <= 1; ib += 2) {
                for (int ic = -1; ic <= 1; ic += 2) {
                    int index = 0;
                    if (ia == 1) index += 4;
                    if (ib == 1) index += 2;
                    if (ic == 1) index += 1;
                    v[index].push_back(ia * a + ib * b + ic * c);
                }
            }
        }
    }
    long long int res = 0;
    for (int i = 0; i < 8; i++) {
        sort(v[i].begin(), v[i].end(), greater<long long int>());
        res = max(res, accumulate(v[i].begin(), v[i].begin() + m, (long long int)0));
    }
    cout << res << endl;
}


Measured memory_bytes: 3684