akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <string.h>

int main(void) {
    char p[200]={'\0'}, s[100]={'\0'}, c;
    int i;

    i=0;
    while ((c=getchar())!='\n') p[i]=c, i++;
    i=0;
    while ((c=getchar())!='\n') s[i]=c, i++;
    sprintf(p, "%s%s", p, p);
    if (strstr(p, s)!=NULL) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }
    return 0;
}



Measured memory_bytes: 2112
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b)  for(int i=(a),i##formax=(b);i< i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formin=(b);i>=i##formin;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max((x),(y))
#define mins(x,y) x=min((x),(y))
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define all(a) ((a).begin()),((a).end())
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define bit(n) (1LL<<(n))
typedef long long ll;
typedef __int128_t lll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>using P=pair<T,Y>;
template<class T,class Y>ostream& operator<<(ostream&o,P<T,Y>&p){return o<<"("<<p.fi<<","<<p.se<<")";}
template<class T>ostream& operator<<(ostream&o,V<T>&v){for(T&t:v)o<<t<<",";return o<<endl;}
template<class T>void uniq(V<T>&v){sort(all(v));v.erase(unique(all(v)), v.end());}
template<typename A, size_t N, typename T>void Fill(A (&a)[N], const T &v){fill((T*)a,(T*)(a+N),v);}

lll gcd(lll a,lll b,lll&x,lll&y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return(x%m+m)%m;}
ll modPow(lll a,lll n,ll m){lll p=1;for(;n;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return p;}
V<ll>F,R;void setF(int n,int mod){F=R=V<ll>(++n);F[0]=1;FOR(i,1,n)F[i]=F[i-1]*i%mod;R[n-1]=modInv(F[n-1],mod);FORR(i,n-1,1)R[i-1]=R[i]*i%mod;}
ll comb(int a,int b,int m){return a<b||b<0?0:F[a]*R[b]%m*R[a-b]%m;}

const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD=1e9+7;
const int N=1e5+1;
const double PI = acos(-1);
double a, b, x;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> a >> b >> x;
  x /= a;
  printf("%.12f\n", ((x >= a*b/2) ? atan2((b-x/a)*2, a) : PI/2-atan2(x/b*2, b))/PI*180);
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

int main()
{
    int n;
    vector<int> l;

    cin >> n;

    l.resize(n);

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

    sort(l.begin(), l.end(), greater<int>());

    cout << (l.front() < accumulate(l.begin() + 1, l.end(), 0) ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <list>
#include <queue>
#include <map>

#define N 205
using namespace std;


int l[N];

int main(){
    int n;
    cin >> n;
    for(int i=0;i<2*n;i++){
        scanf(" %d",&l[i]);
    }
    int ans = 0;
    sort(l, l+2*n);
    for(int i=0;i<n;i++){
        ans += l[2*i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
<?php
fscanf(STDIN, "%d", $n);

const FIVE = 2000;
$list = [];
for ($i = 2; $i < FIVE; $i++) {
	$list[$i] = $i;
}
for ($i = 2; $i < FIVE; $i++) {
	if (!isset($list[$i])) {
		continue;
	}
	foreach ($list as $key => $value) {
		if ($value <= $i) {
			continue;
		}
		if ($value % $i === 0) {
			unset($list[$key]);
		}
	}
}

$answer = [];
foreach ($list as $num) {
	if ($num % 5 === 1) {
		$answer[] = $num;
	}
	if (count($answer) === $n) {
		break;
	}
}

foreach ($answer as $ans) {
	echo $ans, " ";
}
echo "\n";

Measured memory_bytes: 4856
require 'pp'
IS_DEBUG = true
# IS_DEBUG = false
def dputs str
	if(IS_DEBUG)
		puts str
	end
end
def dpp str
	if(IS_DEBUG)
		pp str
	end
end

n,m,d=gets.chomp.split(' ').map{|n| n.to_i}
if(d==0)
	puts (m-1)*1.0.quo(n).to_f
else
	puts (2*n-2*d)*(m-1)*1.0.quo(n*n).to_f
end


Measured memory_bytes: 2044
#include <bits/stdc++.h>
using namespace std;
#define ALL(obj) obj.begin(),obj.end()
#define pb(obj) push_back(obj)
#define REP(i,N) for(ll i=0;i<N;i++)
typedef long long ll;
ll const MOD=1000000007;

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll A,B;
    cin>>A>>B;
    ll g=gcd(A,B);
    ll sum=1;
    for(ll i=2;i<=sqrt(g);i++){
        if(g%i==0){
            sum++;
            while(g%i==0&g!=1)g/=i;
        }
    }
    if(g!=1)sum++;
    cout<<sum<<endl;
}

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

void read(int &x)
{
	char c=getchar(); x=0;
	while (c<'0'||c>'9') c=getchar();
	while (c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
}

const int maxn=3e5+10;

int n,m,Ans[maxn],vis[maxn];

int main()
{
#ifdef h10
	freopen("E.in","r",stdin);
	freopen("E.out","w",stdout);
#endif
	int i,j,l,r,x;
	read(n); read(m);
	for (i=1;i<=n;i++)
	{
		read(l); read(r);
		if (!l) {Ans[1]++; continue;}
		int last=m+1,len=r-l+1,_r=(int)sqrt(r);
		Ans[1]++; Ans[len+1]--;
		for (x=1;x<=_r;x++)
		{
			int u=(l+x-1)/x,v=r/x;
			u=max(u,len+1);
			if (v<=len) break;
			if (u<=v)
			{
				if (v<last) Ans[u]++,Ans[v+1]--;
				else Ans[u]++,Ans[last]--;
				last=u;
				for (j=u;j<=v&&j<=_r&&vis[j]!=i;j++) vis[j]=i;
			}
		}
		for (x=len+1;x<=_r;x++)
		{
			int u=(l+x-1)/x,v=r/x;
			if (u<=v&&vis[x]!=i)
				vis[x]=i,Ans[x]++,Ans[x+1]--;
		}
	}
	for (i=1;i<=m;i++)
		Ans[i]+=Ans[i-1],printf("%d\n",Ans[i]);
}


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

typedef long long int ll;
typedef pair<ll, ll> p_ll;
typedef vector<pair<ll, ll>> vec_p; //vector<pair<ll, ll>> pairs(n) ,pairs.at(i) = make_pair(i*i, i)

#define ture ture
#define flase false
#define falg flag

#define REP(i, x) for (ll i = 0; i < (ll)(x); i++)
#define REPS(i, x) for (ll i = 1; i <= (ll)(x); i++)
#define RREP(i, x) for (ll i = ((ll)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (ll i = ((ll)(x)); i > 0; i--)
#define all(x) (x).begin(), (x).end()

const ll MOD = pow(10, 9) + 7;
const ll LLINF = pow(2, 61) - 1;//llの最大9*10^18
const int INF = pow(2, 30) - 1;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

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

    double D,T,S;
    
    cin >> D>>T>>S;

    double tmp = D / S;

    if(tmp<=T){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}


Measured memory_bytes: 3736
a, b, h, m = map(int, input().split())

t = h + (m / 60)

# 時針の角度
a_deg = 360 * (t / 12)
# 分針の角度
b_deg = 360 * (m / 60)

# 余弦定理
import math
c = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(abs(a_deg-b_deg))))

print(c)


Measured memory_bytes: 9496
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<cmath>
#include<functional>
#include<algorithm>
#define INF (1<<29)
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;


int main(){
	int p[11];
	int n,m;
	while(cin>>n>>m,n||m){
		fill(p,p+11,0);
		rep(i,n){
			int a,b;
			cin>>a>>b;
			p[b] += a;
		}
		for(int i=10;m&&i>=0;i--){
			int t=min(p[i],m);
			p[i] -= t;
			m -= t;
		}
		int ans=0;
		rep(i,11)ans+=p[i]*i;
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#define rep(i,n) for(int i = 0; i < n;i++)
#define ll long long
#include <bits/stdc++.h>
using namespace std;
int main(){ 
  ll n,m;cin>>n>>m;
  ll ans=0,sum=0;
  vector<pair<ll,ll>>p(n);
  for(int i=0;i<n;i++)
  {
    ll a,b;cin>>a>>b;
    p.at(i)=make_pair(a,b);
  }
  sort(p.begin(),p.end());
  for(int i=0;i<n;i++)
  {
    sum+=p.at(i).second;
    ans+=p.at(i).first*p.at(i).second;
    if(sum>=m)
    {
      ans-=(sum-m)*p.at(i).first;
      break;
    }
  }
  cout<<ans;
}
    
                         
      

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int N,M;
    cin >> N >> M;
    ll sum = 0;
    map<int,ll> mp;
    mp[0]++;
    rep(i,0,N){
        int a;
        cin >> a;
        sum = (sum + a) % M;
        mp[sum]++;
    }
    ll ans = 0;
    for(auto p:mp){
        ans += p.second * (p.second-1) / 2;
    }
    cout << ans << endl;
}

Measured memory_bytes: 4224
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int N=2e6+5;
struct node{
    int u,v,nxt;
}edge[N];
int head[N],mcnt;
void add_edge(int u,int v){
    mcnt++;
    edge[mcnt].u=u;
    edge[mcnt].v=v;
    edge[mcnt].nxt=head[u];
    head[u]=mcnt;
}
int g[N];
int SG(int u,int fa=0){
    g[u]=0;
    for(int i=head[u];i;i=edge[i].nxt){
        int v=edge[i].v;
        if(v==fa)
            continue ;
        g[u]^=SG(v,u)+1;
    }
    return g[u];
}
int n;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<n;i++){
        int u,v;
        scanf("%d%d",&u,&v);
        add_edge(u,v);
        add_edge(v,u);
    }
    puts(SG(1)?"Alice":"Bob");
}


Measured memory_bytes: 13440
N, K = map(int, raw_input().split())
p = map(int, raw_input().split())

for i in range(N):
    p[i] = (p[i]+1)/2.0

ans = 0
for i in range(K):
    ans = ans + p[i]

current = ans

for i in range(K, N):
    diff = p[i] - p[i-K]
    temp = current + diff
    if temp >  ans:
        ans = temp
    current = temp

print ans


Measured memory_bytes: 20120
import java.util.*;
import java.io.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        int[] n = sc.nextIntArray(3);
        Arrays.sort(n);
        System.out.println(n[0]+n[1]);
    }
}


class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

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

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

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

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}


Measured memory_bytes: 24660
#include <stdio.h>

int main(void){
	int H, W;
	int i, j;
	
	for(;;){
		scanf("%d %d",&H, &W);
		if(H == 0 && W == 0){
			break;
		}
		
		for(i=0; i<H; i++){
			for(j=0; j<W; j++){
				if(i == 0 || i == H-1 || j == 0 || j == W-1){
					printf("#");
				}else{
					printf(".");
				}
			}
			printf("\n");
		}
		printf("\n");
	}
	
	return 0;
}


Measured memory_bytes: 572
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if(a > b){ a = b; return 1; } return 0; }
int main()
{
  int n,m; cin >> n >> m;
  cout << (n-1)*(m-1) << "\n";
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long int ll;
using namespace std;
#define MAXN 100005
#define X first
#define Y second
#define mod 1000000007
#define inf 1e18
#define pb push_back
#define fastio ios_base::sync_with_stdio(false);cout.tie(0);cin.tie(0);
ll n,i,j,k;

int main()
{
    fastio;
    ll a,b;
    cin>>a>>b;
    if(a!=1 && b!=1) cout<<"1"<<endl;
    else if(b!=2 && a!=2) cout<<"2"<<endl;
    else cout<<"3"<<endl;
}


Measured memory_bytes: 256
import sys
from operator import itemgetter, attrgetter
from itertools import starmap
import cmath
from math import isinf, sqrt, acos, atan2
readline = sys.stdin.readline
EPS = 1e-9
ONLINE_FRONT = -2
CLOCKWISE = -1
ON_SEGMENT = 0
COUNTER_CLOCKWISE = 1
ONLINE_BACK = 2
class Circle(object):
    __slots__ = ('c', 'r')
    def __init__(self, c, r):
        self.c = c
        self.r = r
class Segment(object):
    __slots__ = ('fi', 'se')
    def __init__(self, fi, se):
        self.fi = fi
        self.se = se
Line = Segment
def cross(a, b):
    return a.real * b.imag - a.imag * b.real
def dot(a, b):
    return a.real * b.real + a.imag * b.imag
def norm(base):
    return abs(base) ** 2
def project(s, p2):
    base = s.fi - s.se
    r = dot(p2 - s.fi, base) / norm(base)
    return s.fi + base * r
def reflect(s, p):
    return p + (project(s, p) - p) * 2.0
def ccw(p1, p2, p3):
    a = p2 - p1
    b = p3 - p1
    if cross(a, b) > EPS: return 1
    if cross(a, b) < -EPS: return -1
    if dot(a, b) < -EPS: return 2
    if norm(a) < norm(b): return -2
    return 0
def intersect4(p1, p2, p3, p4):
    return (ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0 and
			ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0)
def intersect2(s1, s2):
    return intersect4(s1.fi, s1.se, s2.fi, s2.se)
def getDistance(a, b):  return abs(a - b)
def getDistanceLP(l, p):
    return abs(cross(l.se - l.fi, p - l.fi) / abs(l.se - l.fi))
def getDistanceSP(s, p):
    if dot(s.se - s.fi, p - s.fi) < 0.0: return abs(p - s.fi)
    if dot(s.fi - s.se, p - s.se) < 0.0: return abs(p - s.se)
    return getDistanceLP(s, p)
def getDistances(s1, s2):
    if intersect2(s1, s2): return 0.0
    return min(getDistanceSP(s1, s2.fi), getDistanceSP(s1, s2.se),
               getDistanceSP(s2, s1.fi), getDistanceSP(s2, s1.se))
def getCrossPoint(s1, s2):
	base = s2.se - s2.fi
	d1 = abs(cross(base, s1.fi - s2.fi))
	d2 = abs(cross(base, s1.se - s2.fi))
	t = d1 / (d1 + d2)
	return s1.fi + (s1.se - s1.fi) * t
def getCrossPoints(c, l):
    pr = project(l, c.c)
    e = (l.se - l.fi) / abs(l.se - l.fi)
    base = sqrt(c.r * c.r - norm(pr - c.c))
    return Segment(pr + e * base, pr - e * base)
def getCrossPointsCL(c, l):
    pr = project(l, c.c)
    e = (l.se - l.fi) / abs(l.se - l.fi)
    base = sqrt(c.r * c.r - norm(pr - c.c))
    return Segment(pr + e * base, pr - e * base)
def getCrossPointsCC(c1, c2):
    d = abs(c1.c - c2.c)
    a = acos((c1.r * c1.r + d * d - c2.r * c2.r) / (2.0 * c1.r * d))
    t = cmath.phase(c2.c - c1.c)
    return Segment(c1.c + cmath.rect(c1.r, t + a), c1.c + cmath.rect(c1.r, t - a))
x, y, r = map(int, readline().split())
c1 = Circle(complex(x, y), r)
x, y, r = map(int, readline().split())
c2 = Circle(complex(x, y), r)
cpc = getCrossPointsCC(c1, c2)
if cpc.se.real < cpc.fi.real or (cpc.se.real == cpc.fi.real and cpc.se.imag < cpc.fi.imag):
    cpc.fi, cpc.se = cpc.se, cpc.fi
print(*map('{:.10f}'.format, (cpc.fi.real, cpc.fi.imag, cpc.se.real, cpc.se.imag)))

Measured memory_bytes: 8252
#include <iostream>
#include <utility>
#include <vector>
#include <map>
using namespace std;


const int mxN = 1e5 + 5;
int par[mxN], Size[mxN];
vector<int> adj[mxN], adj2[mxN];

int find_Set(int x) {
	return par[x] = par[x] == x ? x : find_Set(par[x]);
}

void Union_set(int x, int y) {
	x = find_Set(x);
	y = find_Set(y);
	if(x != y) {
		if(Size[x] < Size[y])
			swap(x, y);
		Size[x] += Size[y];
		par[y] = x;
	}
}

int main() {
	int n, m, k;
	cin >> n >> m >> k;
	for(int i = 1; i <= n; ++i)
		Size[i] = 1, par[i] = i;
	map<pair<int, int>, bool> good, bad;
	while(m--) {
		int u, v;
		scanf("%d%d", &u, &v);
		adj[u].push_back(v);
		adj[v].push_back(u);
		good[{u, v}] = good[{v, u}] = 1;
		Union_set(u, v);
	}
	while(k--) {
		int u, v;
		scanf("%d%d", &u, &v);
		bad[{u, v}] = bad[{v, u}] = 1;
		adj2[u].push_back(v);
		adj2[v].push_back(u);
	}
	for(int i = 1; i <= n; ++i)
		find_Set(i);
	for(int i = 1; i <= n; ++i) {
		int tot = Size[find_Set(i)] - 1;
		int x = par[i];
		for(int cur : adj[i]) {
			int y = par[cur];
			if(x == y) {
				--tot;
			}
		}
		for(int cur : adj2[i]) {
			int y = par[cur];
			if(y == x)
				--tot;
		}
		cout << tot << ' ';
	}
}


Measured memory_bytes: 40072
#include<bits/stdc++.h>
using namespace std;
#define rep(i,N) for(ll i=0;i<N;++i)
typedef long long int ll;
ll INF = 1LL<<60;

int main(){
    ll N, M;
    vector<vector<ll> > A(100010);
    cin >> N >> M ;
    priority_queue<ll> que;
    rep(i,N){
        ll a,b;
        cin >> a >> b;
        A[a].push_back(b);
    }
    ll ans = 0;
    for(int i=0;i<=M;i++){
        for(auto it : A[i]){
            que.push(it);
        }
        if(que.size()){
            ans += que.top();
            que.pop();
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 5632
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>

#define ll long long
using namespace std;

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

int main()
{
	int N,X,x;
	cin>>N>>X;
	int y=0;
	for(int i=0; i<N; ++i)
	{
		cin>>x;
		y=gcd(y,x-X);
	}
	cout<<y<<endl;
	return 0;
}

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


public class Main {
	public static void main(String[] args) {
		new Main().solve();
	}
	
	void solve(){
		Scanner sc = new Scanner(System.in);
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		map.put("A", 0);
		map.put("B", 0);
		map.put("AB", 0);
		map.put("O", 0);
		
		while(sc.hasNext()){
			String str[] = sc.next().split("\\,");
			String p = str[1];
			map.put(p, map.get(p)+1);
		}
		
		System.out.println(map.get("A"));
		System.out.println(map.get("B"));
		System.out.println(map.get("AB"));
		System.out.println(map.get("O"));
		
		sc.close();
	}
	
	void debug(Object... os){
		System.err.println(Arrays.deepToString(os));
	}
}

Measured memory_bytes: 12000
#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<map>
#include<unordered_map>
#include<queue>
#include<algorithm>
#include<iomanip>
#include<typeinfo>
#include<complex>
using namespace std;
using ll = long long int;
const int mod = 1e9 + 7;
#define rep(i, a, b) for(ll i = a;i < b; i++)
const long double PI = (acos(-1));

int main() {

	int n;
	cin >> n;

	int ans = 111;
	rep(i, 2, 11) {
		if (n <= ans) {
			cout << ans << endl;
			return 0;
		}
		ans = i * 100;
		ans += i * 10 + i;
	}

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#define OUT(x) ((0>x)||(x>2))
typedef struct{
  double new;
  double prev;
}point;

typedef struct{
  int x;
  int y;
}ipoint;

point bo[3][3];

int main(){
  int i,j,k,x,y,n;
  char buf[16];
  ipoint dic[]={{0,0},{1,0},{2,0},
		{0,1},{1,1},{2,1},
		{0,2},{1,2},{2,2}},
    dir[]={{-1,0},{1,0},{0,-1},{0,1}};
  ipoint st,go,wa;
  while(1){
    fgets(buf,16,stdin);
    n=atoi(buf);
    if(!n) break;
    fgets(buf,16,stdin);
    st=dic[(int)buf[0]-(int)'A'];
    go=dic[(int)buf[2]-(int)'A'];
    wa=dic[(int)buf[4]-(int)'A'];
    bo[st.y][st.x].prev=1.0;
    for(i=0;i<n;i++){
      for(j=0;j<9;j++){
	if(bo[dic[j].y][dic[j].x].prev==0.0) continue;
	for(k=0;k<4;k++){
	  x=dic[j].x+dir[k].x;
	  y=dic[j].y+dir[k].y;
	  if(OUT(x)||OUT(y)||((x==wa.x)&&(y==wa.y))){
	    x=dic[j].x;
	    y=dic[j].y;
	  }
	  bo[y][x].new+=bo[dic[j].y][dic[j].x].prev/4.0;
	}
      }
      for(j=0;j<9;j++){
	x=dic[j].x;
	y=dic[j].y;
	bo[y][x].prev=bo[y][x].new;
	bo[y][x].new=0.0;
      }
    }
    printf("%.8f\n",bo[go.y][go.x].prev);
    for(j=0;j<9;j++){
      x=dic[j].x;
      y=dic[j].y;
      bo[y][x].prev=bo[y][x].new=0;
    }
  }
  return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
int a[20][20];
int b[20];
int m,n;
int c[20];
int vis[20];
int p[20];
int ans=0;
int cs=0;
void dfs(int pos,int c[])
{
     if(pos==n+1)
     {
         /*for(int i=1;i<=n;i++)
                cout<<c[i]<<' ';
            cout<<endl;*/
         int f=1;
         for(int i=0;i<m;i++)
         {   int s=0;
             for(int j=0;j<b[i];j++)
             {
                 if(c[a[i][j]]==1)
                     s++;
             }
             if(s%2!=p[i])
                 {
                      f=0;
                      break;
                 }
         }
         if(f){
           /* for(int i=1;i<=n;i++)
                cout<<c[i]<<' ';
            cout<<endl;*/
         ans++;
         }
         return ;
     }
       c[pos]=1;
      dfs(pos+1,c);
      c[pos]=0;
      dfs(pos+1,c);
      // c[pos]=1;
//       dfs()
}
int main()
{

    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
        cin>>b[i];
        for(int j=0;j<b[i];j++)
            cin>>a[i][j],vis[a[i][j]]++;
    }
    for(int i=0;i<m;i++)
        cin>>p[i];
    dfs(1,c);
    int couts=0;
    for(int i=1;i<=n;i++)
    {
        if(vis[i]==0)
         couts++;
    }
    //if(couts==0)
    cout<<ans<<endl;
    //else
   // cout<<ans*couts*2<<endl;
    return 0;
}


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

using namespace std;

#define loop(x, start, end) for(int x = start; x < end; x++)

void fib(vector<int> &dp, int n) {
    dp[0] = 1;
    dp[1] = 1;
    loop (i, 2, n+1) {
        dp[i] = dp[i-1] + dp[i-2];
    }
}


int main(void){
    int n;
    cin >> n;
    vector<int> dp(n+1);
    fib(dp, n);
    cout << dp[n] << endl;
}



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

#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define RFOR(i, a, b) for(int i=(a); i>=(b); i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define CEIL(n, m) ceil(n/pow(10.0, m))*pow(10.0, m)
#define FLOOR(n, m) floor(n/pow(10.0, m))*pow(10.0, m)
#define ROUND(n, m) round(n/pow(10.0, m))*pow(10.0, m)
#define ALL(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define RSORT(x) sort((x).begin(),(x).end(),greater<int>())
#define SZ(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define llong long long
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) " (L" << __LINE__ << ") " << __FILE__ << endl;

void solve()
{
  llong x; cin >> x;

  cout << (x/11)*2 + (llong)ceil((x%11)/6.0) << endl;
}

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


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

const int len = 1e6+6;
char str[len];

int main(){
    scanf("%s", &str);
    int n = strlen(str), up = 0, down = 0, right = 0, left = 0;
    for (int i = 0; i < n; i++){
        if (str[i] == 'N') up = 1;
        if (str[i] == 'S') down = 1;
        if (str[i] == 'W') left = 1;
        if (str[i] == 'E') right = 1;
    }

    if ((up && !down) || (down && !up) || (left && !right) || (right && !left))
        printf("No\n");
    else
        printf("Yes\n");
    return 0;
}


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

constexpr long double PI = acos(-1);
constexpr long double EPS = 1e-15;
constexpr int inf = 2e9;
constexpr ll INF = 2e18;
constexpr ll MOD = 1e9+7;
constexpr ll MOD1 = 998244353;
typedef pair<ll,ll> P;

#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 REP(i,n) rep(i,0,n)
#define RREP(i,n) rrep(i,n,0)
#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
//#define mp make_pair

int m, k;
bool used[200010];

int main(){
  cin >> m >> k;
  if (k == 0) {
    REP(i,(1<<m)) {
      cout << i << " " << i;
      if (i != (1 << m) - 1) cout << " ";
      else cout << endl;
    }
    return 0;
  }
  if (k >= (1 << m)) {
    cout << -1 << endl;
    return 0;
  }
  if (m == 0) {
    cout << "0 0" << endl;
    return 0;
  }
  if (m == 1) {
    if (k != 0) {
      cout << -1 << endl;
    } else {
      cout << "0 0 1 1" << endl;
    }
    return 0;
  }

  deque<int> dq;
  dq.push_back(k);
  dq.push_front(0);
  dq.push_back(0);
  int num = 1;
  used[k] = 1;
  for (int i = 0; i < (1 << (m-1))-1; i++) {
    while (used[num]) num++;
    int b = k ^ num;
    dq.push_front(num);
    dq.push_back(num);
    dq.push_front(b);
    dq.push_back(b);
    used[num] = 1;
    used[b] = 1;
    num++;
  }

  dq.push_back(k);

  while (!dq.empty()) {
    cout << dq.front();
    dq.pop_front();
    if (!dq.empty()) cout << " ";
    else cout << endl;
  }
  return 0;
}


Measured memory_bytes: 3072
using System;

namespace tst
{
    class Program
    {
        public static void Main()
        {
            string[] In1 = Console.ReadLine().Split(' ');
            int n = int.Parse(In1[0]);
            int k = int.Parse(In1[1]);
            string[] In2 = Console.ReadLine().Split(' ');
            int[] H = new int[n];
            long sum =0;
            for(int i=0; i<n; i++)
            {
                H[i] = int.Parse(In2[i]);
            }
            Array.Sort(H);
            Array.Reverse(H);
            /*for (int i=0; i<k; i++)
            {//必殺技は数えない
                Console.WriteLine("++");
                sum++;
            }*/
            if (!(n == k))
            {
                //敵全員に必殺技使える場合はここはいらない
                for(int i=k; i<n; i++)
                {
                    //Console.WriteLine("H[i]="+H[i]);
                    sum += H[i];
                }
            }
            Console.WriteLine(sum);
        }

    }
}

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

int main(void)
{
  string S, T;
  cin >> S >> T;
  int size = S.size();
  vector<int> s(size,-1), t(size,-1);
  int m=0;
  for (int j=0; j < size; ++j) {
    if (s[j] == -1) {
      s[j] = m;
      for (int k=j+1; k < size; ++k) {
        if (S[k] == S[j]) s[k] = m;
      }
      m+=1;
    }
  }
  m=0;
  for (int j=0; j < size; ++j) {
    if (t[j] == -1) {
      t[j] = m;
      for (int k=j+1; k < size; ++k) {
        if (T[k] == T[j]) t[k] = m;
      }
      m+=1;
    }
  }
  bool f=true;
  for (int j=0; j < size; ++j) {
    if (s[j] != t[j]) {
      f = false;
      break;
    }
  }
  if (f) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}



Measured memory_bytes: 2312
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest
import math
from functools import reduce

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

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    #n,m,k=map(int, readline().rstrip().split())
    #arr=list(map(int, readline().rstrip().split()))
    k=int(readline())
    #ss=readline().rstrip()
    #yn(1)
    ans=0
    for a in range(1,k+1):
        for b in range(1,k+1):
            for c in range(1,k+1):
                ans+=gcd(a,b,c)
    print(ans)



    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------


Measured memory_bytes: 72760
#include <stdio.h>
#include <string.h>
char str[120];
int main(void)
{
	int i,j,len;
	memset(str,'\0',sizeof(str));
	while(fgets(str,sizeof(str),stdin) != NULL)
	{
		len = strlen(str);
			while(1)
			{
				if(strstr(str,"the")==NULL&&strstr(str,"this")==NULL&&strstr(str,"that")==NULL)
				{
						for(j=0;j<len;j++)
						{
							if(str[j] == ' ' || str[j] == '.'|| str[j] == '\n')continue;
							if(str[j] == 'z')str[j] = 'a';
							else str[j] += 1;
						}
				}
				else
				{
					printf("%s",str);
					break;
				}
			}
		memset(str,'\0',sizeof(str));
	}
	return 0;
}

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

int main() {
  
  int a;
  string s;
  cin >> a >> s;
  
  if (a>=3200) {
    cout << s << endl;
  }
  else {
    cout << "red" << endl;
  }
  
  

return 0;
}

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

int main() {
  int N, M;
  while(1){
        cin >> N >> M;
        if(N == 0 && M == 0) break;
        for(int i = 0; i < N; i++){
            for(int k = 0; k < M; k++){
                if(i%2 == 0){
                    if(k%2 == 0){
                    cout << "#";
                    }
                    else cout << ".";
                }
                else {
                    if(k%2 == 1){
                        cout << "#";
                    }
                    else  cout << ".";
                }
            }
            cout << endl;
        }
        cout << endl;
  }
}


Measured memory_bytes: 3096
#include <stdio.h>

int main(void)
{

    int year;
    int price;
    scanf("%d %d",&year,&price);

    if(year>12) printf("%d\n",price);
    if(year>=6 && year<=12) printf("%d\n",price/2);
    if(year<=5) printf("0\n");

    return 0;
}

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

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

int size_road[200001]; //rank
int size_rail[200001]; //rank
int rail[200001]; //par
int road[200001]; // par

void initialize(int n){
    for(int i = 1;i<=n;i++){
        road[i] = i ;
        rail[i] = i;
        size_road[i]=1;
        size_rail[i]=1;
    }
}

int findSet1(int i) {
    return (road[i]==i)?i:road[i]=findSet1(road[i]);
}

void unionSet1(int i, int j) {
    int b = findSet1(i), s = findSet1(j);
    if(size_road[b] < size_road[s]) swap(b, s);
    if(size_road[b] == size_road[s]) size_road[b]++;
    road[s] = b;
}

int findSet2(int i) {
    return (rail[i]==i)?i:rail[i]=findSet2(rail[i]);
}

void unionSet2(int i, int j) {
    int b = findSet2(i), s = findSet2(j);
    if(size_rail[b] < size_rail[s]) swap(b, s);
    if(size_rail[b] == size_rail[s]) size_rail[b]++;
    rail[s] = b;
}

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n,k,l;
    cin>>n>>k>>l;
    initialize(n);
    for(int i=0;i<k;i++){
        int p,q;
        cin>>p>>q;
        unionSet1(p,q);
    }
    for(int i=0;i<l;i++){
        int p,q;
        cin>>p>>q;
        unionSet2(p,q);
    }
    vector<tuple <int,int,int> > vect;
    for(int i = 1;i<=n;i++){
        int u=findSet1(road[i]);
        int v=findSet2(rail[i]);
        tuple<int,int,int> asd=make_tuple(u,v,i);
        vect.pb(asd);
    }
    sort(vect.begin(),vect.end());
    vect.pb(make_tuple(-1,-1,-1));
    stack<int> s;
    int ans[n+1];
    int count=0;
    pair<int,int> t=mp(get<0>(vect[0]),get<1>(vect[0]));

    for(int i=0;i<=n;i++){

        if(t.fi==get<0>(vect[i]) && t.se==get<1>(vect[i])){
            count+=1;
        }
        else{
            while(!s.empty()){
                int u=s.top();
                s.pop();
                ans[u]=count;
            }
            t=mp(get<0>(vect[i]),get<1>(vect[i]));
            count=1;
        }
        s.push(get<2>(vect[i]));
    }
    for(int i=1;i<=n;i++){
        cout<<ans[i]<<' ';
    }
    cout<<endl;
    return 0;
}


Measured memory_bytes: 7924
#include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <vector>

const int mod = 1e9 + 7;
const int kmax = 510000;

long long fact[kmax], fact_inv[kmax], inv[kmax];

int gcd(int a, int b)
{
    if (!b) {
        return a;
    }

    return gcd(b, a % b);
}

void init_comb()
{
    fact[0] = fact[1] = 1;
    fact_inv[0] = fact_inv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < kmax; i++) {
        fact[i] = fact[i - 1] * i % mod;
        inv[i] = mod - inv[mod % i] * (mod / i) % mod;
        fact_inv[i] = fact_inv[i - 1] * inv[i] % mod;
    }
}

long long comb(int n, int r)
{
    if (n < r) {
        return 0;
    }

    if (n < 0 || r < 0) {
        return 0;
    }

    return fact[n] * (fact_inv[r] * fact_inv[n - r] % mod) % mod;
}

template <typename T, T N>
class UnionFind {
    T parent_[N];
    T rank_[N];
    T size_[N];

public:
    UnionFind();
    T Root(T idx);
    bool IsSame(T x, T y);
    void Unite(T x, T y);
    T GetSize(T idx);
};

template <typename T, T N>
UnionFind<T, N>::UnionFind()
{
    for (T i = 0; i < N; i++) {
        parent_[i] = i;
        rank_[i] = 0;
        size_[i] = 1;
    }
}

template <typename T, T N>
T UnionFind<T, N>::Root(T idx)
{
    return parent_[idx] == idx ? idx : parent_[idx] = Root(parent_[idx]);
}

template <typename T, T N>
bool UnionFind<T, N>::IsSame(T x, T y)
{
    return Root(x) == Root(y);
}

template <typename T, T N>
void UnionFind<T, N>::Unite(T x, T y)
{
    x = Root(x);
    y = Root(y);
    if (x == y) {
        return;
    }

    if (rank_[x] < rank_[y]) {
        parent_[x] = y;
        size_[y] += size_[x];
    } else {
        parent_[y] = x;
        size_[x] += size_[y];
        if (rank_[x] == rank_[y]) {
            rank_[x]++;
        }
    }
}

template <typename T, T N>
T UnionFind<T, N>::GetSize(T idx)
{
    return size_[Root(idx)];
}

long long XorValue(long long n)
{
    switch (n % 4) {
    case 0:
        return n;
    case 1:
        return 1;
    case 2:
        return n + 1;
    case 3:
        return 0;
    }
}

int main(void)
{
    long long a, b;
    std::cin >> a >> b;

    std::cout << (XorValue(std::max(a - 1, 0LL)) ^ XorValue(b)) << std::endl;
}


Measured memory_bytes: 256
//05
#include<iostream>
#include<iomanip>

using namespace std;

int main(){
  for(int n;cin>>n,n;){
    int ms[15][15]={};
    int y=n/2+1,x=n/2;
    for(int i=1;i<=n*n-1;i++){
      ms[y][x]=i;
      y=(y+1)%n;
      x=(x+1)%n;
      while(ms[y][x]){
	y=(y+1)%n;
	x=(x+n-1)%n;
      }
    }
    ms[y][x]=n*n;
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
	cout<<setw(4)<<right<<ms[i][j];
      }
      cout<<endl;
    }
  }
  return 0;
}

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

using namespace std;

int main() {
    int n,tmp,ans=0;
    cin >> n;
    map<int,int> mzk;
    vector<int> jbn(n);
    vector<int> ex(n-1);
    for (int i=0; i<n; ++i)
        cin >> jbn.at(i);

    for (int i=1; i<=n; ++i) {
        cin >> tmp;
        mzk[i] = tmp;
    }

    for (int i=0; i<n-1; ++i)
        cin >> ex.at(i);

    tmp = 0;

    for (auto& e : jbn) {
        ans += mzk.at(e);
        if (tmp != 0 && (e - tmp) == 1 )
            ans += ex.at(tmp-1);
        tmp = e;
    }

    cout << ans;
}


Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {x: u64};

    let mut money: u128 = 100;
    let mut count: u64 = 0;

    while x > money as u64 {
        money = money * 101 / 100;
        count += 1;
    }

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


Measured memory_bytes: 2100
from fractions import gcd
def lcm(a, b):
    return a * b // gcd(a,b)

a,b,c,d = map(int, input().split())
x1 = b // c
x2 = b // d
e = lcm(c,d)
x3 = b // e
y1 = b - x1 -x2 + x3
x4 = (a-1) // c
x5 = (a-1) // d
x6 = (a-1) // e
y2 = a -1 - x4 - x5 + x6
print(y1 - y2)

Measured memory_bytes: 5244
#include <cstdio>
#include <iostream>

using namespace std;

int main() {

  char c;
  cin >> c;

  switch(c) {
  case 'a':
    cout << "vowel" << endl;
    break;
  case 'e':
    cout << "vowel" << endl;
    break;
  case 'i':
    cout << "vowel" << endl;
    break;
  case 'o':
    cout << "vowel" << endl;
    break;
  case 'u':
    cout << "vowel" << endl;
    break;
  default:
    cout << "consonant" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
string = str(input())
q = int(input())
for _ in range(q):
    
    data = input().split()
    left = int(data[1])
    right = int(data[2]) + 1
    
    if data[0] == "print":
        print(string[left:right])
        
    elif data[0] == "reverse":
        string = string[:left] + string[left:right][::-1] + string[right:]
        
    else:
        string = string[:left] + data[3] + string[right:]



Measured memory_bytes: 5616
import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)

#ここから書き始める
n = int(input())
a = []
yes = True
for i in range(n):
    w = input()
    if i != 0 and a[i - 1][-1] != w[0]:
        yes = False
    a.append(w)
# print(a)
a_set = set(a)
if len(a_set) != n:
    yes = False
if yes:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 5180
#include <bits/stdc++.h>
using namespace std;
#define forloop(n) for(int i = 0; i < n; i++)
#define ll long long
 
#define mod 1000000007
long long exp(long long taban, long long us) {
    long long carpan = taban;
    long long temp = us;
    long long res = 1;
    for(int i = 0;;i++){
        if(temp % 2) res = (res*carpan) % mod;
        temp /= 2;
        carpan = (carpan*carpan) % mod;
        if(temp == 0) break;
    }
    return res;
}
ll ebob(ll a, ll b){
	if(!a)return b;
	return ebob(b%a, a);
}
ll ekok(ll a, ll b){
	return (((a*b)%mod)*(exp(ebob(a,b), (ll)mod-2))) % mod;
}

int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	int a, b; cin>>a>>b;
	cout<<(a/b + (a%b > 0));
	return 0;
}


Measured memory_bytes: 256
la, lb, lc, ld = 0, 0, 0, 0
ra, rb, rc, rd = 0, 0, 0, 0

while True:
    try: n = input()
    except: break

    l, r = map(float, n.split())
    
    if 1.1 <= l:
        la += 1
    elif 0.6 <= l < 1.1:
        lb += 1
    elif 0.2 <= l < 0.6:
        lc += 1
    elif l < 0.2:
        ld += 1
    
    if 1.1 <= r:
        ra += 1
    elif 0.6 <= r < 1.1:
        rb += 1
    elif 0.2 <= r < 0.6:
        rc += 1
    elif r < 0.2:
        rd += 1

print(la, ra)
print(lb, rb)
print(lc, rc)
print(ld, rd)



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

using namespace std;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()
#define sortAl(v) sort(all(v))
#define sortAlr(v)          \
  sort(v.begin(), v.end()); \
  reverse(v.begin(), v.end())

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

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T &a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T &a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
#define INF LLONG_MAX

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

  string s;
  cin >> s;

  string th = "2019/04/30";

  if (s <= th) {
    cout << "Heisei" << endl;
  } else {
    cout << "TBD" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
n, a, b, c, d = map(int, input().split())
s = '#' + input()

def check(l, r):
    return "##" not in s[l:r]

if c < d:
    if check(a, c) and check(b, d):
        print("Yes")
    else:
        print("No")
else: # c > d
    space = "..." in s[b-1:d+2]
    if space and check(a, c) and check(b, d):
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 3572
import java.io.*;
import java.util.*;
public class Main {
   public static void main(String args[]) {
       int n = 0;
       int[] arr = null;
       try (Scanner scanner = new Scanner(System.in)) {
           n = scanner.nextInt();
           arr = new int[n];
           for (int i=0; i < n; i++) {
               arr[i] = scanner.nextInt();
           }
       }
       int[] dp = new int[n];
       //dp[0] = arr[0];
       dp[1] = Math.abs(arr[1] - arr[0]);
       for(int i = 2; i < n; i++){
           dp[i] = Math.min(dp[i-1] + Math.abs(arr[i]- arr[i-1]),
                            dp[i-2] + Math.abs(arr[i]- arr[i-2]));
       }
       
       System.out.println(dp[n - 1]);
   }
}


Measured memory_bytes: 50472
import java.util.Scanner;

public class Main {

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

		long s = sc.nextLong();
		int mod = 1_000_000_000;
		long x = (mod - s%mod)%mod;
		long y = (s + x)/mod;

		System.out.println("0 0 1000000000 1 " + x + " " + y);
	}

}


Measured memory_bytes: 27092
package main

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

var sc = bufio.NewScanner(os.Stdin)

func Scanner() string {
	sc.Scan()
	return sc.Text()
}

func intScanner() int {
	n, _ := strconv.Atoi(Scanner())
	return n
}

func floatScanner() float64 {
	n, _ := strconv.ParseFloat(Scanner(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func stringSliceScanner(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scanner()
	}
	return a
}
func intSliceScanner(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = intScanner()
	}
	return a
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	m := intScanner()
	fmt.Println(24 + (24 - m))
}


Measured memory_bytes: 1772
#include<iostream>
using namespace std;
int main(){
	int k,a,b;
  	cin>>k>>a>>b;
  	int x = a/k;
  	if(x*k==a)cout<<"OK"<<endl;
  	else{
        x++;
        if(x*k<=b)cout<<"OK"<<endl;
        else cout<<"NG"<<endl;
  	}
  return 0;
}


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

#define maxn 400005
#define mod 998244353

typedef pair<int, int> P;

int main()
{
    ll h, w;
    cin >> h >> w;
    if (h == 1 || w == 1)
        cout << 1 << endl;
    else
        cout << (h * w + 1) / 2 << endl;
    return 0;
}

Measured memory_bytes: 256
w[100000],n,k,g;
f(p)
{
    int c=1;g=0;
    for(int i=0;i<n;)
    {
        if(g+w[i]<=p)
        {
            g+=w[i++];
        }
        else
        {
            if(g>0)c++;
            else return k+1; 
            g=0;
        }
    }
    return c;
}
main()
{
    scanf("%d%d",&n,&k);
    for(int i=0;i<n;scanf("%d",w+i++));
    int l=0,r=1e9,m;
    while(l<r)
    {
        m=(l+r)/2;
        if(f(m)>k)l=m+1;
        else r=m;
    }
    for(m--;;m++)
    {
        if(f(m)<=k)break;
    }
    printf("%d\n",m);
    return 0;
}

Measured memory_bytes: 2140
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fill fill_n
#define pf push_front
#define pb push_back
#define FOR(i,l,r) for(int i=l;i<r;i++)
#define ROF(i,r,l) for(int i=r;i>=l;i--)
#define comp(v) (v).begin(),(v).end()
#define ff first
#define ss second
#define infile freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
typedef vector<int> vi;
typedef vector<ll> vli;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvli;
const int M = 1e9+7;
const int N = 2e5;
ll po(int,int);


void solve(){
    int n,k;cin>>n>>k;
    ll a[n];
    FOR(i,0,n) cin>>a[i];
    FOR(i,k,n){
        if(a[i]>a[i-k]) cout<<"Yes\n";
        else cout<<"No\n";
    }
}





int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    int t=1;
    //cin>>t;
    FOR(i,1,t+1){
        //cout<<"Case #"<<i<<": "; 
        solve();
    }
    
	return 0;
	
	
}


ll po(int a,int b){
    if(b==0) return 1;
    ll ans=1;
    if(b%2==0){
        ans = po(a,b/2)%M;
        ans=(ans%M * ans%M)%M;
    }
    else{
        ans = po(a,(b-1)/2)%M;
        ans = (ans%M * ans%M * a)%M;
    }
    return ans%M;
}


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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
using P = pair<ll,ll>;
using ld=long double;

int main(){
   string s;cin >>s;
   int n=s.size();
   vector<int>cnt(26,0);
    for (int i = 0; i < n; ++i) {
        cnt[s[i]-'a']++;
    }
    string ans;
    char nx;
    for (int i = 0; i < 26; ++i) {
        if(cnt[i]==0){
            nx=(char)('a'+i);
            break;
        }
    }
    if(s.size()!=26){
        ans=s+nx;
        cout <<ans <<endl;
    }
    else {
        ll mx=-1;
        reverse(all(s));
        int k=-1;
        vector<char>f;
        for (int i = 0; i < n; ++i) {
            if(mx>s[i]-'a'){
//                for (int i = 0; i < f.size(); ++i) {
//                    cout <<f[i]<<" ";
//                }
                int key=lower_bound(all(f),s[i])-f.begin();
                s[i]=f[key];
                k=n-i;
                break;
            }
            else {
                mx=s[i]-'a';
                f.push_back(s[i]);
            }
        }
        reverse(all(s));
        if(k>0){
            cout <<s.substr(0,k)<<endl;
        }
        else cout <<-1<<endl;
    }
}


Measured memory_bytes: 3608
import java.util.Scanner;
    
    public class Main{
    public static void main(String args[]){
    int N;
    int[] a=new int[101];
    int sum=0;
    int av;
    int cost=10000000;
    int ncost=0;
    Scanner scan = new Scanner(System.in);

    N=scan.nextInt();
    for(int i=0;i<N;i++){
    	a[i]=scan.nextInt();
    	sum=sum+a[i];
    }
    av=sum/N;
    
    for(int i=0;i<N;i++){
    	ncost=ncost+(a[i]-(av-1))*(a[i]-(av-1));
    }
    if(cost>ncost)cost=ncost;
    ncost=0;
    for(int i=0;i<N;i++){
    	ncost=ncost+(a[i]-(av))*(a[i]-(av));
    }
    if(cost>ncost)cost=ncost;
    ncost=0;
    for(int i=0;i<N;i++){
    	ncost=ncost+(a[i]-(av+1))*(a[i]-(av+1));
    }
    if(cost>ncost)cost=ncost;
    ncost=0;
    
    System.out.println(cost);
    }
}

Measured memory_bytes: 9556
let () =
let n, x = Scanf.scanf "%d %d\n" (fun a b -> a, b) in
let lst = Array.to_list (Array.init n (fun _ -> Scanf.scanf "%d\n" (fun x -> x))) in
let s = List.fold_left (+) 0 lst in
let m = List.fold_left min max_int lst in
let alpha = (x - s) / m in
Printf.printf "%d\n" (n+alpha)

Measured memory_bytes: 2432