akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define rep(i, n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
 
const double PI = 3.14159265358979323846;
int main(void){
    int a, b, h, m;
    cin>>a>>b>>h>>m;
    double theta = ((double)h+(double)m/60.0)*PI/6.0-((double)m+(double)h*60)*PI/30.0;
    /*cout<<theta/PI*180<<endl;
    cout<<(double)h*PI/6.0<<" "<<(double)m*PI/30.0<<endl;*/
    double d = sqrt((double)a*(double)a+(double)b*(double)b-2*(double)a*(double)b*cos(theta));
    //cout<<x1<<" "<<y1<<" "<<x2<<" "<<y2<<endl;
    printf("%.15f\n", d);
    return 0;
}

Measured memory_bytes: 4164
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>

using namespace std;


int main()
{
	char s[8000];
	char *ans;
	int x, y;

	scanf("%s", s);
	scanf("%d %d", &x, &y);

	int ls=strlen(s);
	
	deque<int> op0, op1;

	int nf=0, par=0;
	for(int i=0; i<ls; i++){
		if(s[i]=='F'){
			nf++;
		}else if(s[i]=='T' && par==0){
			op0.push_back(nf);
			nf=0;
			par=1;
		}else{
			op1.push_back(nf);
			nf=0;
			par=0;
		}
	}
	if(nf>0 && par==0){
		op0.push_back(nf);
	}else if(nf>0 && par==1){
		op1.push_back(nf);
	}

	set<int> rx, rx1, ry, ry1;
	int d;

	d=op0.front();
	op0.pop_front();
	rx.insert(d);

	while(!op0.empty()){
		d=op0.front();
		op0.pop_front();
		while(!rx.empty()){
			auto itr=rx.begin();
			int r=*itr;
			rx.erase(itr);
			rx1.insert(r+d);
			rx1.insert(r-d);
		}
		while(!rx1.empty()){
			auto itr=rx1.begin();
			int r=*itr;
			rx1.erase(itr);
			rx.insert(r);
		}
	}
  	
  	ry.insert(0);

	while(!op1.empty()){
		d=op1.front();
		op1.pop_front();
		while(!ry.empty()){
			auto itr=ry.begin();
			int r=*itr;
			ry.erase(itr);
			ry1.insert(r+d);
			ry1.insert(r-d);
		}
		while(!ry1.empty()){
			auto itr=ry1.begin();
			int r=*itr;
			ry1.erase(itr);
			ry.insert(r);
		}
	}
	
	if(rx.find(x)!=rx.end() && ry.find(y)!=ry.end()){
		ans="Yes";
	}else{
		ans="No";
	}

	printf("%s\n", ans);

	return 0;

}

Measured memory_bytes: 640
#include<bits/stdc++.h>
typedef long long ll;
#define INF 100000000
#define MOD 100000007
int dx[4]={1,0,-1,0},dy[4]={0,-1,0,1};
using namespace std;
int main(void){
    int n,m;
    cin>>n>>m;
    int x[m];
    for(int i=0;i<m;i++){
        cin>>x[i];
    }
    sort(x,x+m);
    int diff[m-1];
    for(int i=0;i<m-1;i++){
        diff[i]=abs(x[i+1]-x[i]);
    }
    sort(diff,diff+m-1);
    int ans=0;
    int val=max(0,m-n);
    for(int i=0;i<val;i++){
        ans+=diff[i];
    }
    cout<<ans<<endl;
   return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define pb push_back
#define f(i,n) for(int i=0; i<n; ++i)
#define fi(i,st,n) for(int i=st; i<=n; ++i)
#define veci vector<int>
#define vecp vector<pair<int,int> >
#define vecl vector<ll>
int prime[100000+10];

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

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

ll sum(int arr[], int n) {
	ll res = 0;
	f(i,n) {
		res += arr[i];
	}
	return res;
}

void seive() {
	prime[1] = 0;
	for(int i=2; i<=100000; i++) {
		prime[i] = 1;
	}
	for(ll i=2; i<=100000; i++) {
		if(prime[i]) {
			for(ll j=i*i; j<=100000; j+=i) {
				prime[j] = 0;
			}
		}
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t = 1;
//	cin>>t;
	while(t--){
		ll n,x,k;
		cin>>n>>x>>k;
		if(n%x == 0) {
			cout<<(n/x)*k<<"\n";
		} else {
			cout<<(n/x)*k + k<<"\n";
		}
		
 	}
 	return 0;
}


Measured memory_bytes: 3644
from math import sqrt

def func(a, b):
	if a == b:
		return (a - 1) * 2
	else:
		sq = int(sqrt(a * b))
		if a * b == sq ** 2:
			return (sq - 1) * 2 - 1
		elif sq * (sq + 1) >= a * b:
			return (sq - 1) * 2
		else:
			return sq * 2 - 1

q = int(input())
for _ in range(q):
	a, b = map(int, input().split())
	print(func(a, b))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <map>
#include <algorithm>
#include <vector>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <chrono>
#include <thread>
#include <string.h>
 
#define rep(i,n)    for(ll i=0;i<n;i++)
#define repu(i,k,n) for(ll i=k;i<=n;i++)
#define repd(i,k,n) for(ll i=k;i>=n;i--)
#define se second
#define fi first
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define endl "\n"
#define INF (ll)ll_MAX
 
typedef long long ll;
typedef long double ld;
typedef std::pair<ll, ll> pii;
typedef std::vector< ll > vi;
typedef std::vector< pii > vii;
typedef std::vector< ll > vll;
typedef std::vector< std::pair < pii, ll > > vpp;
 
const ll N = 3*1e5 +5 ;
const long long MOD = 1000000007;
const long long MOD2 = 998244353;
const long long inf = 1e18;
 
using namespace std;



void solve()
{	

    ll n,k;
    cin>>n>>k;

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

    for(ll i=k;i<n;i++){
        if(a[i]>a[i-k]){
            cout<<"Yes\n";
        }
        else cout<<"No\n";
    }

    
}

int main() {

    // #ifndef ONLINE_JUDGE
    //     // for getting input from input.txt
    //     freopen("input.txt", "r", stdin);
    //     // for writing output to output.txt
    //     freopen("output.txt", "w", stdout);
    // #endif


    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    ll t = 1;
    // cin>>t;
    ll ctr=0;
    while(t--)
    {   
        ctr++;
        // cout<<"Case #"<<ctr<<": ";
        solve();    
    } 
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
 
}

Measured memory_bytes: 5368
// template version 1.15
using namespace std;
#include <bits/stdc++.h>

// varibable settings
#define int long long
const int INF=1e18;

// define basic macro {{{
#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__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(a, b, c) make_tuple(a, b, c)
#define ub upper_bound
#define lb lower_bound
#define posl(A, x) (lower_bound(all(A), x)-A.begin())
#define posu(A, x) (upper_bound(all(A),x)-A.begin())
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

#define divceil(a,b) ((a)+(b)-1)/(b)
#define is_in(x, a, b) ((a)<=(x) && (x)<(b))
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define slice(l, r) substr(l, r-l)

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

#if defined(PCM) || defined(LOCAL)
    #include "lib/dump.hpp"
#else
    #define dump(...) 42
    #define dump_1d(...) 42
    #define dump_2d(...) 42
    #define cerrendl 42
#endif
//}}}

int cnt(int x){
    int res = 0;
    for(int mul=2; mul<=x; mul*=2){
        res += x/mul;
    }
    return res;
}

int mod2(int n, int k){
    int c1 = cnt(n);
    int c2 = cnt(n-k) + cnt(k);
    assert(c1>=c2);
    return (c1==c2 ? 1 : 0);
}

signed main() {
    int n;cin>>n;
    string s;cin>>s;

    vector<int> a;
    rep(i, n) a.pb((s[i]-'0') - 1);
    map<int, int> d;
    rep(i, n){
        d[a[i]]++;
    }

    if (d[1]==0){
        rep(i, n) if (a[i]==2) a[i] = 1;
        int res = 0;
        {
            int n = sz(a);
            rep(k, n){
                res += mod2(n-1, k) * a[k];
                res %= 2;
            }
        }
        cout << res*2 << endl;
    }
    else{
        int res = 0;
        {
            int n = sz(a);
            rep(k, n){
                res += mod2(n-1, k) * a[k];
                res %= 2;
            }
        }
        cout << res << endl;
    }

    return 0;
}


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

long long lcm(long long x, long long y){
  if(x<y) swap(x,y);
  long long r = x%y , xy = x*y;
  while(r!=0){
    x = y;
    y = r;
    r = x%y;
  }
  return xy / y;
}

int main() {
  long long A,B,C,D;
  cin >> A >> B >> C >> D;
  A--;
  
  long long L = lcm(C,D);
  long long X = B/C - A/C, Y = B/D - A/D, Z = B/L - A/L;
  cout << (B-A) - (X+Y-Z) << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

template <class F>
int lower_bound(int i0, int i1, F f) {
    while (i0 < i1) {
        int i = (i0 + i1) / 2;
        if (f(i)) i1 = i; else i0 = i + 1;
    }
    return i0;
}

struct P {
    int x, y, vx, vy;
};

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

    vector<P> p(n);
    for (int i = 0; i < n; i++) {
        int x, y;
        char d;
        cin >> x >> y >> d;

        p[i].x = x * 2;
        p[i].y = y * 2;
        if (d == 'R') {
            p[i].vx = 1;
            p[i].vy = 0;
        } else if (d == 'L') {
            p[i].vx = -1;
            p[i].vy = 0;
        } else if (d == 'U') {
            p[i].vx = 0;
            p[i].vy = 1;
        } else if (d == 'D') {
            p[i].vx = 0;
            p[i].vy = -1;
        }
    }

    auto f = [&](int t, int d) {
        int r = 0, b = 0;
        for (int i = 0; i < n; i++) {
            int x = p[i].x + p[i].vx * t;
            int y = p[i].y + p[i].vy * t;
            int t;
            if (d == 0) {
                t = x;
            } else if (d == 1) {
                t = -x;
            } else if (d == 2) {
                t = y;
            } else if (d == 3) {
                t = -y;
            }
            if (b == 0 || t > r) {
                r = t;
                b = 1;
            }
        }
        return r;
    };

    int t0[9] = {};
    for (int d = 0; d < 4; d++) {
        t0[d * 2 + 0] = lower_bound(0, 1 << 30, [&](int t) {
            return f(t + 1, d) - f(t, d) >= 0;
        });
        t0[d * 2 + 1] = lower_bound(0, 1 << 30, [&](int t) {
            return f(t + 1, d) - f(t, d) > 0;
        });
    }

    ll r = 1LL << 60;
    for (int d = 0; d < 9; d++) {
        int t = t0[d];
        if (t == 1 << 30) continue;
        ll x = f(t, 0) + f(t, 1);
        ll y = f(t, 2) + f(t, 3);
        //if (y < 0) {
        //    cout << t << ' ' << y << ' ' << f(t, 2) << ' ' << f(t, 3) << endl;
        //}
        r = min(r, x * y);
    }

    printf("%.8f\n", r * 0.25);

    //短いほう優先で
    //4方向を別々に考えると、縮んでるか変わらないか伸びてるのどれか 伸び始まったらそのまま 縮む不変伸びると遷移する
    //2倍して受け取る

    return 0;
}

Measured memory_bytes: 1792
import itertools

N,M,R = map(int,input().split())
r = list(map(int,input().split()))

D = [[float('inf') for _ in range(N)] for _ in range(N)]
for _ in range(M):
  a,b,c = map(int,input().split())
  a -= 1
  b -= 1
  D[a][b] = c
  D[b][a] = c
for i in range(N):
  D[i][i] = 0

for k in range(N):
  for i in range(N):
    for j in range(N):
      D[i][j] = min(D[i][j],D[i][k]+D[k][j])

ans = float('inf')
for p in list(itertools.permutations(r)):
  d = 0
  for i in range(R-1):
    d += D[p[i]-1][p[i+1]-1]
  ans = min(d,ans)
print(ans)


Measured memory_bytes: 78808
#include<bits/stdc++.h>
using namespace std ;
#define rep( i, s, t ) for( register int i = s; i <= t; ++ i )
#define re register
int gi() {
    char cc = getchar() ; int cn = 0, flus = 1 ;
    while( cc < '0' || cc > '9' ) {  if( cc == '-' ) flus = - flus ; cc = getchar() ; }
    while( cc >= '0' && cc <= '9' )  cn = cn * 10 + cc - '0', cc = getchar() ;
    return cn * flus ;
}
const int N = 1e6 + 5 ; 
int n, a[N], w[10], bk[10] ; 
char s[N] ; 
signed main()
{
    n = gi(); scanf("%s", s ) ; n--;
    rep( i, 0, n ) a[i] = s[i] - '1', bk[a[i]] = 1 ; 
    rep( i, 0, n ) if( ( ( i  ) & ( n  ) ) == ( i  ) ) w[a[i]] ^= 1 ; 
    if( w[1] ) { puts("1") ; exit(0) ; }
    if( w[2] && ( !bk[1] ) ) { puts("2") ; exit(0) ; }
    puts("0") ; 
    return 0 ;
} 

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

#define int long long
#define rep(i,l,r) for(int i=(int)(l);i<(int)(r);i++)
#define all(x) (x).begin(),(x).end()
template<class T>bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,T b){if(a>b){a=b;return 1;}return 0;}

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

const int inf = 1LL<<60;
const int mod = 1e9 + 7;
const double eps = 1e-9;

/*{
  }*/

int dp[100001][13];

signed main(){
  string s;
  cin >> s;
  int n = s.size();

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

  cout << dp[n][5] << endl;

  return 0;
}


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

using namespace std;

int main() {
    bool exist[31];
    for (int i = 0; i <= 30; ++i) {
        exist[i] = false;
    }
    for (int i = 0; i < 28; ++i) {
        int s;
        cin >> s;
        exist[s] = true;
    }
    for (int i = 1; i <= 30; ++i) {
        if (!exist[i]) cout << i << '\n';
    }
    return 0;
}


Measured memory_bytes: 3076
#include <bits/stdc++.h>
#define bug1(x) cout<<#x<<" = "<<x<<endl
#define bug2(x,y) cout<<#x<<" = "<<x<<" "<<#y<<" = "<<y<<endl
#define bug3(x,y,z) cout<<#x<<" = "<<x<<" "<<#y<<" = "<<y<<" "<<#z<<" = "<<z<<endl
#define bug4(x,y,z,m) cout<<#x<<" = "<<x<<" "<<#y<<" = "<<y<<" "<<#z<<" = "<<z<<" "<<#m<<" = "<<m<<endl

using namespace std;

template<class T> 
ostream& operator<<(ostream &os, vector<T> input) {
    os << "[ ";
    for(auto elem : input) { 
		os << elem << " ";
	}
	return os << "]";
}

template<class T> 
ostream& operator<<(ostream &os, set<T> input) {
    os << "{ ";
    for(auto elem : input) { 
		os << elem << " ";
	}
	return os << "}";
}

template<class T> 
ostream& operator<<(ostream &os, unordered_set<T> input) {
    os << "{ ";
    for(auto elem : input) { 
		os << elem << " ";
	}
	return os << "}";
}

template<class T> 
ostream& operator<<(ostream &os, multiset<T> input) {
    os << "{ ";
    for(auto elem : input) { 
		os << elem << " ";
	}
	return os << "}";
}

template<class T> 
ostream& operator<<(ostream &os, unordered_multiset<T> input) {
    os << "{ ";
    for(auto elem : input) { 
		os << elem << " ";
	}
	return os << "}";
}

template<class L, class R> 
ostream& operator<<(ostream &os, map<L,R> input) {
    os << "{ ";
    for(auto elem : input) { 
		os << "(" << elem.first << "," << elem.second << ") ";
	}
	return os << "}";
}

template<class L, class R> 
ostream& operator<<(ostream &os, unordered_map<L,R> input) {
    os << "{ ";
    for(auto elem : input) { 
		os << "(" << elem.first << "," << elem.second << ") ";
	}
	return os << "}";
}

#define ll long long
const int MAXN = 100005;
const ll INF = 1e18;
const int MOD = 1e9 + 7;

class TaskB {
private:

public:
	void solveOne(int it){
		ll a , b , c , d;
		cin >> a >> b >> c >> d;
		vector<ll> op1{a, b};
		vector<ll> op2{c, d};
		ll ans = -INF;
		for(ll x : op1) {
			for(ll y : op2) {
				ans = max(ans, x * y);
			}
		}
		cout << ans << endl;

	}

	void solve(){
		int tc = 1;
		for(int it = 1; it <= tc; it++){
			solveOne(it);
		}
	}
};


int main(){
	ios_base::sync_with_stdio(false);
	TaskB solver;
	solver.solve();
	return 0;
}


Measured memory_bytes: 3652
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <unordered_map>
constexpr int MOD = 1000000000 + 7;
constexpr int INF = 2000000000;
using namespace std;
using LL = long long;

int main() {
	string s;
	cin >> s;
	bool isok = false;
	for (int i = 0; i < s.size() - 1; i++) {
		if (s[i] == s[i + 1]) {
			cout << i + 1 << " " << i + 2 << endl;
			isok = true;
			break;
		}
	}
	if (!isok) {
		for (int i = 0; i < s.size() - 2; i++) {
			if (s[i] == s[i + 2]) {
				cout << i + 1 << " " << i + 3 << endl;
				isok = true;
				break;
			}
		}
	}
	if (!isok) {
		cout << -1 << " " << -1 << endl;
	}
}

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


int main (int argc, char const *argv[])
{
    int a,b;
    cin>>a>>b;

    
    if (a>b) {
        cout<<a-1<<endl;
    }
    else
    {
        cout<<a<<endl;
    }
    
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = (a), i##_end_ = (b); i <= i##_end_; ++i)
#define drep(i, a, b) for(int i = (a), i##_end_ = (b); i >= i##_end_; --i)
#define clar(a, b) memset((a), (b), sizeof(a))
#define debug(...) fprintf(stderr, __VA_ARGS__)
typedef long long LL;
typedef long double LD;
int read() {
    char ch = getchar();
    int x = 0, flag = 1;
    for (;!isdigit(ch); ch = getchar()) if (ch == '-') flag *= -1;
    for (;isdigit(ch); ch = getchar()) x = x * 10 + ch - 48;
    return x * flag;
}
void write(int x) {
    if (x < 0) putchar('-'), x = -x;
    if (x >= 10) write(x / 10);
    putchar(x % 10 + 48);
}

const int Maxn = 100009;
int n, h[Maxn], dp[Maxn], k;

void init() {
	n = read(); k = read();
	rep (i, 1, n) h[i] = read();
}

void solve() {
	clar(dp, 0x3f), dp[1] = 0;
	rep (i, 2, n) 
		rep (j, 1, k) 
			if (i - j >= 1) dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]));

	cout << dp[n] << endl;
}

int main() {
//	freopen("b.in", "r", stdin);
//	freopen("b.out", "w", stdout);

	init();
	solve();

#ifdef Qrsikno
    debug("\nRunning time: %.3lf(s)\n", clock() * 1.0 / CLOCKS_PER_SEC);
#endif
    return 0;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define INF 1000000010
using namespace std;
int main(){
	int i,q;
	vector<long long> fs;
	long long a,b,ans,l=0,r=1000000010,mid;
	cin>>q;
	for(i=0;i<q;i++)
	{
		cin>>a>>b;
		l=0;
		r=INF;
		while(l<r-1)
		{
			mid=(l+r)/(long long)2;
			if(mid*(mid+1)<a*b)
			{
				l=mid;
			}
			else
			{
				r=mid;
			}
		}
		ans=r+(a*b-1)/r-2;
		if(a==b)
		{
			ans++;
		}
		fs.push_back(ans);
	}
	for(i=0;i<fs.size();i++)
	{
		cout<<fs[i]<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <list>
#include <set>
#include <stack>
#include <cctype>
#include <cmath>
#include <bitset>

using namespace std;

/* typedef */
typedef long long ll;

/* constant */
const int INF = 1 << 30;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;

/* global variables */

/* function */

/* main */
int main(){

    int N, K;
    cin >> N >> K;

    int ans = 0;
    while (N) {
        ans++;
        N /= K;
    }
    cout << ans << '\n';

}


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

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

int main() {
    int a,b,c,x;cin>>a>>b>>c>>x;
    int ans=0;

    rep(i,a+1)rep(j,b+1)rep(k,c+1)if(500*i + 100*j + 50*k == x)++ans;
    
    cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<math.h>
using namespace std;

int main(){
    string str;
    long long  wn = 0;
    long long ans = 0;
    
    cin >> str;

    for(int i = str.length() - 1;i >= 0;i--){
        if(str[i] == 'W')wn++;
        else ans += wn;
    }

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

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

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

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

    cout << ( a - 1 ) * ( b - 1) << endl;

    return 0;
}


Measured memory_bytes: 256
def main():
        run()

def run():
        word = input()
        word = list(word)
        target = input()
        isSame = False
        for _ in range(len(word)):
                word_string = "".join(word)
                if word_string == target:
                        isSame = True
                        break
                rotate_char = word.pop(0)
                word.append(rotate_char)
        if isSame:
                print("Yes")
        else:
                print("No")

if __name__ == "__main__":
        main()

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		if(sc.nextInt() * sc.nextInt()%2 == 0) {
			System.out.println("Even");
		}else {
			System.out.println("Odd");
		}
	}
}

Measured memory_bytes: 21204
#include <stdio.h>

int a,b,c ;

int main(void){
    
    scanf ("%d%d%d",&a,&b,&c) ;
    
    if ( a+b>=c ){
        printf ("Yes\n") ;
    } else {
        printf ("No\n") ;
    }
    
    
    return 0 ;
}

Measured memory_bytes: 128
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;


public class Main {

    int n,m,d;

    private void solve() {
        n = nextInt();
        m = nextInt();
        d = nextInt();

        double ans = 0.0;
        if (d == 0) {
            ans = 1.0 / n * (m - 1);
        } else {
            ans = 2.0 * (n - d) * (m - 1) / n / n;
        }

        out.println(String.format("%.09f", ans));
    }

    public static void main(String[] args) {
        out.flush();
        new Main().solve();
        out.close();
    }

    /* Input */
    private static final InputStream in = System.in;
    private static final PrintWriter out = new PrintWriter(System.out);
    private final byte[] buffer = new byte[4096];
    private int p = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (p < buflen)
            return true;
        p = 0;
        try {
            buflen = in.read(buffer);
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (buflen <= 0)
            return false;
        return true;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrint(buffer[p])) {
            p++;
        }
        return hasNextByte();
    }

    private boolean isPrint(int ch) {
        if (ch >= '!' && ch <= '~')
            return true;
        return false;
    }

    private int nextByte() {
        if (!hasNextByte())
            return -1;
        return buffer[p++];
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = -1;
        while (isPrint((b = nextByte()))) {
            sb.appendCodePoint(b);
        }
        return sb.toString();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 23124
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a;
	double jl,flag;
	cin>>a;
	for(int i=1;i<=a;i++){
		if(i % 2!=0){
			flag=flag+1;
		}
	}
	jl=flag/(a*1.0);
	printf("%.10lf\n",jl);
	flag=0;
	return 0;
} 

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
 
int main(void) {
    char hanazawa_kana[1024];
    while (scanf("%1023s", hanazawa_kana) == 1 && strcmp(hanazawa_kana, "0") != 0) {
        int horie_yui = 0;
        char *noto_mamiko;
        for (noto_mamiko = hanazawa_kana; *noto_mamiko != '\0'; noto_mamiko++) {
            horie_yui += *noto_mamiko - '0';
        }
        printf("%d\n", horie_yui);
    }
    return 0;
}


Measured memory_bytes: 2064
N = int(input())


li = []

for _ in range(N):
    a, b = list(map(int,input().split(" ")))
    li.append([b,a,b])

flag = True
now = 0
li = sorted(li)

for a, b, c in li:
    now += b
    if now > c:
        print("No")
        flag = False
        break
        
if flag:
    print("Yes")

Measured memory_bytes: 38104
import sys
input=sys.stdin.readline
#from collections import defaultdict
#d = defaultdict(int)
#import fractions
#import math
#import collections
#from collections import deque
#from bisect import bisect_left
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
#import itertools
mod = 10 ** 9 + 7
s = 0
N,K = map(int,input().split())
for i in range(K,N+2):
    Min = i*(i+1)/2
    Max = i*(2*N+3-i)/2
    s += Max - Min +1
    s = s%mod
s = int(s)
print(s)




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


int main(){
  int H, W;
  cin >> H>> W;
  vector<string> S(H);
  for (int row=0;row<H;row++) cin >> S.at(row); 
  
  int memo[H][W] = {};
  
  for (int row=0;row<H;row++){
    for (int col=0;col<W;col++){
      if (S.at(row).at(col)=='#') {
        memo[row][col]++;
        if (row>0) memo[row-1][col]++;
        if (row<H-1) memo[row+1][col]++;
        if (col>0) memo[row][col-1]++;
        if (col<W-1) memo[row][col+1]++;
        //if (row>0 && col>0) memo[row-1][col-1]++;
        //if (row<H-1 && col>0) memo[row+1][col-1]++;
        //if (row>0 && col<W-1) memo[row-1][col+1]++;
        //if (row<H-1 && col<W-1) memo[row+1][col+1]++;
      }
    }
  }
  
  bool possible = true;
  for (int row=0;row<H;row++){
    for (int col=0;col<W;col++){
      if (S.at(row).at(col)=='#' && memo[row][col]<2){
        possible = false;
        break;
      }
    }
  }
  cout << (possible? "Yes" : "No") << endl;

}
 

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>

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

using namespace std;

#define rep(i, a, b) for (int i = a; i < b; i++)
#define rrep(i, a, b) for (int i = a; i <= b; i++)
#define revrep(i, s) for (int i = s-1; i > 0; i--)
#define revrrep(i, s) for (int i = s-1; i >= 0; i--)
#define all(a)  begin((a)),end((a))
#define uniq(c) (c).erase(unique(all((c))), end((c)))

int main()
{
    int N; cin >> N;
    string S; cin >> S;

    int cnt = 0;
    rrep (i, 0, N-3) {
        if ("ABC" == S.substr(i, 3))
            ++cnt;
    }

    cout << cnt << endl;
}

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

a, p = [1], [1]
for i in range(N):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)


def f(N, X):
    if N == 0:
        return 0 if X <= 0 else 1
    elif X <= 1 + a[N - 1]:
        return f(N - 1, X - 1)
    else:
        return p[N - 1] + 1 + f(N - 1, X - 2 - a[N - 1])


print(f(N, X))


Measured memory_bytes: 3064
program prob6
    implicit none
    integer :: N
    integer(8), allocatable :: A(:)
    integer(8) :: ans, tmp
    integer :: i
    read(*,*) N
    allocate(A(N))
    
    do i = 1, N
        read(*,*) A(i)
    end do

    call msort(A)

    ans = 0
    tmp = 0
    if(mod(N, 2) == 1)then
        do i = 1, N/2
            ans = ans - 2 * A(i)
        end do
        ans = ans + A(N/2+1)
        ans = ans + A(N/2+2)
        do i = N/2+3, N
            ans = ans + 2 * A(i)
        end do

        do i = 1, N/2 -1
            tmp = tmp - 2 * A(i)
        end do
        tmp = tmp - A(N/2)
        tmp = tmp - A(N/2+1)
        do i = N/2+2, N
            tmp = tmp + 2 * A(i)
        end do 
        ans = max(tmp, ans)       
    else
        do i = 1, N/2 -1
            ans = ans - 2 * A(i)
        end do
        ans = ans - A(N/2)
        ans = ans + A(N/2+1)
        do i = N/2+2, N
            ans = ans + 2 * A(i)
        end do               
    end if

    write(*,*) ans

    deallocate(A)
    stop
contains

  !
  ! swap two arguments
  !
subroutine swap(a, b)
    implicit none
    integer(8), intent(inout) :: a, b

    integer(8) :: c

    c = a
    a = b
    b = c

  end subroutine swap

  !
  ! merge sort
  !
  recursive subroutine msort(x)
    implicit none
    integer(8), intent(inout) :: x(:)

    integer(8) :: n, mid, i, j, k
    integer(8), allocatable :: tmp(:)
    
    n = size(x)
    
    if(n == 1) then
      return
    end if

    !
    ! 前半と後半に分けてソート
    ! 1~midとmid+1~nをそれぞれソート済みにする
    !
    mid = n / 2
    call msort(x(:mid))
    call msort(x(mid+1:))

    !
    ! tmpという配列にxを一時的に保管
    ! マージソートは外部ソート
    !
    allocate(tmp(n))
    tmp = x

    ! tmpの後半部分を左右反転
    do k = n, mid+1, -1
      tmp(k) = x(mid + n - k + 1)
    end do

    ! iは前半のリストのうちまだ見ていないものの最小値
    ! jは後半のリストのうちまだ見ていないものの最小値
    ! kは見た回数の合計
    i = 1
    j = n

    do k = 1, n
      !
      ! 一番左と一番右のうち小さい方をxに入れていく
      ! ここが等号つき不等号なので、安定ソートとなる
      !
      if(tmp(i) <= tmp(j)) then
        x(k) = tmp(i)
        i = i + 1
      else
        x(k) = tmp(j)
        j = j - 1
      end if
    end do
    
    deallocate(tmp)
    return
  end subroutine msort

end program prob6

Measured memory_bytes: 4364
#include<stdio.h>

int main(){
  while(1){
    int i,j,n;
    int a[10][10];
    scanf("%d", &n);
    if(n!=0){
      for(i=0;i<n;i++){
	for(j=0;j<n;j++){
	  scanf("%d", &a[i][j]);
	}
      }

      for(i=0;i<n;i++){
	int m=0;
	for(j=0;j<n;j++){
	  m+=a[i][j];
	  printf("%5d", a[i][j]);
	}
	printf("%5d\n", m);
      }
      int k=0;
      for(j=0;j<n;j++){
	int l=0;
	for(i=0;i<n;i++){
	  l+=a[i][j];
	}
	printf("%5d", l);
	k+=l;
      }
      printf("%5d\n", k);
    }

    else
      break;
  }
  return 0;
}

Measured memory_bytes: 2668
#include<stdio.h>
int main()
{
	long long int n,d,x,y,c=0,i;
	scanf("%lld %lld",&n,&d);
	for(i=0;i<n;i++){
		scanf("%lld %lld",&x,&y);
		if(x*x+y*y<=d*d) c++;
	}
	printf("%lld\n",c);
	return 0;
}


Measured memory_bytes: 1732
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <string>
#include <queue>
#include <numeric>
#include <ctype.h>
#include <limits>
#include <iomanip>

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

typedef long long ll;

int main()
{
	int k, a, b;
	cin >> k >> a >> b;
	bool ok = false;
	for (int i = a; i <= b; i++) {
		if (i % k == 0)ok = true;
	}
	if (ok)puts("OK");
	else puts("NG");
	return 0;
}

Measured memory_bytes: 3620
S = input()
N = len(S)
memo = [0] * (N + 1)
memo[0] = 1
if N > 1:
    memo[1] = 1 + int(S[0] != S[1])
if N > 2:
    if S[0] == S[1] or S[1] == S[2]:
        memo[2] = 2
    else:
        memo[2] = 3

for i in range(3, N):
    if S[i] != S[i - 1]:
        memo[i] = memo[i - 1] + 1
    else:
        memo[i] = memo[i - 3] + 2
print(memo[N-1])

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

using namespace std;

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

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

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();
		
		DisjointSet dj = new DisjointSet(n);
		
		int a[] = new int[m];
		int b[] = new int[m];
		for(int i = 0; i < m; i++) {
			int tmpA = sc.nextInt();
			int tmpB = sc.nextInt();
			
			a[m - i - 1] = tmpA;
			b[m - i - 1] = tmpB;
		}
		long pattern = (long)n*(n - 1)/2;
		long result[] = new long[m + 1];
		result[m] = pattern;
		for(int i = 0; i < m; i++) {
//			System.out.println("i = "+i);
			if(!dj.isSameSet(a[i], b[i])) {
//				System.out.println("union "+a[i]+" " +b[i]);
				pattern -= (long)dj.amountOfOwnGroup(a[i])*dj.amountOfOwnGroup(b[i]);
				dj.union(a[i], b[i]);
			}
			result[m - i - 1] = pattern;
		}
		
		for(int i = 1; i < m + 1; i++) {
			System.out.println(result[i]);
		}
	}

}

class DisjointSet {
	private int n;
	private int[] p;
	private int[] rank;
	//各グループの要素数を管理する
	private int[] num;

	public DisjointSet(int n){
		this.n = n;

		p = new int[n + 1];
		rank = new int[n + 1];

		num = new int[n + 1];
		
		Arrays.fill(num, 1);
		
		for(int i = 1; i <= n; i++){
			makeSet(i);
		}
	}

	private void makeSet(int x){
		p[x] = x;
		rank[x] = 0;
	}

	public void union(int x, int y){
		int p1 = findSet(x), p2 = findSet(y);
		int num1 = num[p1];
		int num2 = num[p2];
		link (findSet(x), findSet(y));
		
		num[p1] = num[p2] = num1 + num2;
		
//		System.out.println("amount of new group "+ num[p1]);
	}
	
	public int amountOfOwnGroup(int x) {
		return num[findSet(x)];
	}

	private int findSet(int x){
		if(x != p[x]){
			p[x] = findSet( p[x]);
		}
		return p[x];
	}

	public boolean isSameSet(int x, int y){
		return findSet(x) == findSet(y);
	}

	private void link(int x, int y){
		if(rank[x] > rank[y]){
			p[y] = x;
		}
		else {
			p[x] = y;
			if(rank[x] == rank[y]){
				rank[y]++;
			}
		}
	}
}


Measured memory_bytes: 61868
#include <bits/stdc++.h>
 
using namespace std;
 
#define FOR(i, n) for(int i = 0; i < (int) n; i++)
#define rall(x) x.rbegin(), x.rend()
#define all(x) x.begin(), x.end()
#define PB push_back
#define F first
#define S second
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
 
const ll MOD = 1e9+7;

int main(){
	ios::sync_with_stdio(false); cin.tie(0);
 	
 	string s; cin >> s;
 	for(auto& c : s){
 		if(c == 'D' || c == '?')
 			cout << 'D';
 		else
 			cout << 'P';
 	}
 	cout << '\n';

	return 0;
}

Measured memory_bytes: 3740
n,k=map(int,input().split())
ans=0
if k%2==0:
    hanbun=len([i for i in range(k//2,n+1,k)])
    ans+=hanbun**3
baisuu=len([i for i in range(k,n+1,k)])
ans+=baisuu**3
print(ans)

Measured memory_bytes: 77392
n,u,v=map(int,input().split())
u-=1
v-=1
e=[[]for _ in range(n)]
for i in range(n-1):
  a,b=map(int,input().split())
  a-=1
  b-=1
  e[a].append(b)
  e[b].append(a)
cho=[u]
cho_dis=[10**7]*n
cho_dis[u]=0
cho_visited={u}
countt=1
while cho:
  CHO=[]
  for i in cho:
    for j in e[i]:
      if j in cho_visited:continue
      cho_visited.add(j)
      CHO.append(j)
      cho_dis[j]=countt
  countt+=1
  cho=CHO
aok=[v]
aok_dis=[10**7]*n
aok_dis[v]=0
aok_visited={v}
countt=1
while aok:
  AOK=[]
  for i in aok:
    for j in e[i]:
      if j in aok_visited:continue
      aok_visited.add(j)
      AOK.append(j)
      aok_dis[j]=countt
  countt+=1
  aok=AOK
ans=0
for i in range(n):
  if cho_dis[i]<aok_dis[i]:ans=max(ans,aok_dis[i]-1)
print(ans)

Measured memory_bytes: 38312
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            var N = cin.ReadInt;
            var K = cin.ReadInt;

            var ans = Max(0, (double)(N - K + 1) / (double)N);
            var pow = 1;
            for (int i = Min(K - 1, N); i > 0; i--)
            {
                while (i * Pow(2, pow) < K)
                {
                    pow++;
                }
                ans += 1.0 / Pow(2, pow) / (double)N;
            }

            Console.WriteLine(ans);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); }}
        public int ReadInt { get { return int.Parse(Read); }}
        public long ReadLong { get { return long.Parse(Read); }}
        public double ReadDouble { get { return double.Parse(Read); }}
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret;}
    }
}


Measured memory_bytes: 11348
#include <iostream>


using namespace std;

int main(){
	int x,y;

	cin >> x >> y;

	if (x == y){ cout << "a == b" << endl; }
	else if (x < y){ cout << "a < b" << endl; }
	else{ cout << "a > b" << endl; }


	return 0;
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rfor(i, a, b) for(int i = a; i < (int)b; i++)
#define all(ary) (ary).begin(), (ary).end()
#define debug(x) cerr << #x << ": " << x << '\n'
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
using namespace std;
using v = vector<int>;
using ll = long long;
template <class T = int> T in(){ T x; cin >> x; return (x);}

int main(int argc, char *argv[]){
    int n, k; cin >> n >> k;
    long long int i = k * pow(k-1, n-1);
    cout << i << endl;
    return 0;
}	

Measured memory_bytes: 512
#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
using ll = long long;
using ull = unsigned long long;
using namespace std;
#define int long long
#define CONTAINS_VEC(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
#define CONTAINS_SET(m, a) (m).find((a)) != m.end()
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }


int X, K, D;

signed main()
{
	cin >> X >> K >> D;

	if (X < 0) X = -X;

	if (X == 0)
	{
		if (K % 2 == 0)
		{
			cout << 0 << endl;
		}
		else
		{
			cout << D << endl;
		}
	}
	else
	{
		if (K <= X / D)
		{
			cout << (X - (K * D)) << endl;
			return 0;
		}

		int d = X / D;
		K -= d;
		X -= D * d;
		
		if (K % 2 == 0)
		{
			cout << X << endl;
		}
		else
		{
			cout << abs(X - D) << endl;
		}
	}
}



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

int main() {
  int n, x;
  cin >> n >> x;
  vector<int> l(n);
  int i;
  for(i = 0; i < n; i++) {
    cin >> l[i];
  }
  int sum = 0, result = 1;
  for(i = 0; i < n; i++) {
    sum += l[i];
    if(sum > x) {
      break;
    }
    result++;
  }
  cout << result << endl;
  return 0;
} 

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	x := scanInt()
	m := map[int]int{}
	for i := -1000; i < 1000; i++ {
		m[pow(i, 5)] = i
	}

	for b5, b := range m {
		a5 := x + b5
		if a, ok := m[a5]; ok {
			fmt.Fprintln(wr, a, b)
			return
		}
	}

}

func pow(a, n int) int {
	res := 1
	for n > 0 {
		if n&1 == 1 {
			res *= a
		}
		a *= a
		n >>= 1
	}
	return res
}


Measured memory_bytes: 1964
#include <algorithm>
#include <cassert>
// #include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
// #include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

/*
unsigned seed1 = std::chrono::system_clock::now().time_since_epoch().count();
mt19937 g1.seed(seed1);
*/
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<pii, pii> ppiipii;
typedef pair<int, ppiipii> pippiipii;
typedef pair<int, pii> pipii;
typedef pair<pii, int> ppiii;
typedef pair<int, ppiii> pippiii;
typedef pair<int, ll> pill;
typedef pair<int, double> pid;
// note to self, the below two triggers someone
typedef pair<ll, ll> pll;
typedef pair<ll, int> plli;
typedef long double ld;

int l[105];

int main() {
  int n;
  scanf("%d", &n);
  for(int i = 0; i < n; i++) {
    scanf("%d", &l[i]);
  }
  int r = 0;
  for(int i = 0; i < n;) {
    int j = i+1;
    while(j < n && l[i] == l[j]) {
      j++;
    }
    r += (j-i)/2;
    i = j;
  }
  printf("%d\n", r);
}


Measured memory_bytes: 768
//頂点の次数が全て偶数じゃなきゃダメ。そうでないなら貪欲に閉路を作って、3つ作れたらOK. 作れなければダメ。
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <cstdio>
#include <cmath>
#include <cassert>
#define rep(i, n) for(i = 0; i < n; i++)
using namespace std;

int n, m;
vector<int> et[100000];
vector<int> rev[100000];
vector<bool> used[100000];
int cnt[100000];

bool make_cycle() {
	static int t[100000];
	int i, j;
	int INF = 11451419;
	
	for (i = 0; i < n; i++) t[i] = INF;
	for (i = 0; i < n; i++) if (cnt[i] > 0) break;
	if (i == n) return false;
	//cout << "start = " << i << endl;
	
	int prev = -1;
	int pos = i;
	int nowT = 0;
	vector<int> poses;
	vector<int> ids;
	while (t[pos] == INF) {
		//cout << "pos = " << pos << endl;
		t[pos] = nowT;
		poses.push_back(pos);
		for (j = 0; j < et[pos].size(); j++) {
			if (used[pos][j]) continue;
			if (et[pos][j] == prev) continue;
			break;
		}
		if (j == et[pos].size()) { /*cout << "False" << endl;*/ return false; }
		int nxt = et[pos][j];
		//cout << "nxt = " << nxt << endl;
		prev = pos;
		//cout << "prev = " << pos << endl;
		pos = nxt;
		ids.push_back(j);
		nowT++;
	}
	//cout << "last pos = " << pos << endl;
	poses.push_back(pos);
	
	for (i = t[pos]; i < poses.size() - 1; i++) {
		int u = poses[i];
		int v = poses[i + 1];
		//cout << "u, v = " << u << ", " << v << endl;
		used[u][ids[i]] = true;
		used[v][rev[u][ids[i]]] = true;
		cnt[u]--;
		cnt[v]--;
	}
	
	//for (i = 0; i < n; i++) cout << cnt[i] << endl;
	return true;
}

signed main() {
	int i, j;
	
	cin >> n >> m;
	rep(i, m) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		et[a].push_back(b); rev[a].push_back(et[b].size());
		et[b].push_back(a); rev[b].push_back(et[a].size() - 1);
	}
	
	int cnt4 = 0;
	rep(i, n) {
		used[i].resize(et[i].size());
		rep(j, used[i].size()) used[i][j] = false;
		cnt[i] = et[i].size();
		if (cnt[i] >= 4) cnt4++;
	}
	
	rep(i, n) {
		if (et[i].size() % 2 == 1) { cout << "No" << endl; return 0; }
	}
	if (cnt4 >= 3) { cout << "Yes" << endl; return 0; }
	
	rep(i, 3) {
		bool res = make_cycle();
		if (!res) { cout << "No" << endl; return 0; }
	}
	
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 19836
#include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using ll = long long;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
  ll modpow(ll x, ll b){
    ll res = 1;
    while(b){
      if(b&1)res = res * x % MOD;
      x = x * x % MOD;
      b>>=1;
    }
    return res;
  }

  ll modinv(ll x){
    return modpow(x, MOD-2);
  }

  bool was_output = false;
  template<class t>
  void output(t a){
    if(was_output)cout << " ";
    cout << a;
    was_output = true;
  }
  void outendl(){
    was_output = false;
    cout << endl;
  }
  ll in(){
    ll res;
    scanf("%lld", &res);
    return res;
  }

  template<class t>
  istream& operator>>(istream&is, vector<t>&x){
    for(auto &i:x)is >> i;
    return is;
  }

  template<class t, class u>
  istream& operator>>(istream&is, pair<t, u>&x){
    is >> x.first >> x.second;
    return is;
  }

  template<class t>
  void in(t&x){
    cin >> x;
  }

  template<class t>
  t in(){
    t res; cin >> res; return res;
  }

  template<class t>
  void out(t x){
    cout << x;
  }

  template<class t>
  vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
    sort(line.begin(),line.end(),comp);
    return line;
  }

  template<class t>
  vector<t> reversed(vector<t> line){
    reverse(line.begin(),line.end());
    return line;
  }
}

using namespace templates;

char func(){
  vector<string> strs(3);
  vector<int> itr(3,0);
  foreach(i,strs)i=in<string>();
  int turn = 0;
  while(itr[turn]<strs[turn].size()){
    int next = strs[turn][itr[turn]]-'a';
    ++itr[turn];
    turn = next;
  }
  return 'A'+turn;
}

int main(){
  cout << func() << endl;
  return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
#define ll int 
int main() {
	// your code goes here
	ll i,j,k,n,m;
	
	cin>>n;
	double re=0.0,s;
	while(n--){
	    cin>>s;
	    re=re+((1.0)/s);
	}
	re=(1.0)/re;
	printf("%0.6f",re);
	return 0;
}


Measured memory_bytes: 256