akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>

using namespace std;
#define For(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for(int i = 0; i < (n); ++i)


int main()
{
	int N;

	cin >> N;
	string S;

	cin >> S;

	int count = 0;
	char status = 'X';

	rep(i, N) {
		if (S[i] != status) {
			count++;
			status = S[i];
		}
	}

	cout << count << endl;

	return 0;
}

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

int main() {
  int a,c;
  char b;

  cin >> a >> b >> c;
  while( b != '?') {
      switch(b) {
          case '+':
              cout << a+c << endl;
              break;
          case '-':
              cout << a-c << endl;
              break;
          case '*':
              cout << a*c << endl;
              break;
          case '/':
              cout << a/c << endl;
              break;

      }
      cin >> a >> b >> c;
  }
}

Measured memory_bytes: 3104
#include <iostream>
#include <vector>
#include <array>
#include <algorithm>
#include <cstring>
#include <queue>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cstdlib>

using namespace std;

//#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

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

//static const ll MOD = 1000000007;
//static const ll INF = 100000000;

int main() {
    ll H, W, A, B;

    // input
    cin >> H >> W >> A >> B;

    // process
    for (ll i = 0; i < B; i++) {
        for (ll k = 0; k < A; k++) {
            cout << 0;
        }
        for (ll k = A; k < W; k++) {
            cout << 1;
        }
        cout << endl;
    }
    for (ll i = B; i < H; i++) {
        for (ll k = 0; k < A; k++) {
            cout << 1;
        }
        for (ll k = A; k < W; k++) {
            cout << 0;
        }
        cout << endl;
    }

    return 0;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 
using vs = vector<string>;
using vvs = vector<vs>; 
using vc = vector<char>;
using vvc = vector<vc>; 
using vb = vector<bool>;
using vvb = vector<vb>; 

#define rep(i,n) ;for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define f(i,a,b) for(int i=a;i<b;i++)
#define pri(a)  printf("%.14lf\n",a);
#define MOD 1000000007
bool is_int_lround(double x){
  return std::lround(x)==x;
}
ll keta(ll x){
  ll n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}

ll conbi(int n,int m){
  
  cin>>n>>m;
  vector<ll> a(100);
  a[0] =1;
  for(int i=0;i<14;i++){
    a[i+1]=a[i]*(i+1);
  }
  return a[n] /(a[m] *a[n-m]);
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;//繰り返し二乗法
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
ll kaijo(ll x){
  ll z=1;
  while(x>0){
    z *=x;
    z %=MOD;
    x--;
  }
  return z;
}
ll yakusu_num(ll n){
  vl yakusu(n+1,1);
  for(ll i=2;i*i<=n;i++){ 
    while(n%i==0){
      n /=i;
      yakusu[i]++;
    }
  }
  if(n!=1)yakusu[n]++;
  ll num=1;
  for(ll i=0;i <=n;i++){
    num*=yakusu[i];
  }
  return num;
}
int main(){
  int x1,y1,x2,y2;cin>>x1>>y1>>x2>>y2;
  cout<< x2-(y2-y1)<<" "<<y2+x2-x1 <<" "<<x1-(y2-y1) <<" "<<y1+x2-x1<<endl;

}

Measured memory_bytes: 256
#include<iostream>
#include<utility>
#include<deque>
#include<algorithm>
using namespace std;
int main(){
int n,m;cin >> n >> m;    
pair<int , int> c[100010];  
for(int i = 0; i < m; i++){
    int a,b;cin >> a >> b;
    c[i].first = b;
    c[i].second = a;
}
sort(c, c + m);
deque<bool> dp;
dp.assign(n - 1,true);
for(int i = 0; i < m; i++){
    int t = 0;    
    for(int j = c[i].second; j < c[i].first; j++){
        if(!dp[j - 1]) {
            t = 1;
            break;
        }
    }
    if(!t) dp[c[i].first - 2] = false;    
}
int time = 0;    
for(int i = 0; i < n -1; i++){
    if(!dp[i]) time++;
}
cout << time << "\n";
}    

Measured memory_bytes: 1152
#include <iostream>
#include <iterator>
#include <vector>
#include <climits>
#include <queue>
using namespace std;
typedef long long ll;
int w[110];
int v[110];
ll dp[110][100010];

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, W;
    cin >> N >> W;
    for (int i = 0; i < N; i++) cin >> w[i] >> v[i];
    for (int j = 0; j <= W; j++) dp[0][j] = 0;

   for (int i = 0; i < N; i++) {
       for (int j = 0; j <= W; j++) {
           if (j >= w[i]) dp[i + 1][j] = max(dp[i][j - w[i]] + v[i], dp[i][j]);
           else dp[i + 1][j]  = dp[i][j];
       }
   }

    cout << dp[N][W] << endl;
    return 0;
}

Measured memory_bytes: 80128
x = int(input())

flag = True

for a in range(1, 1000):
    a5 = pow(a, 5)
    for b in range(-1000, 1000):
        b5 = pow(b, 5)
        if a5 - b5 == x and flag:
            print(a, b)
            flag = False
        
    

Measured memory_bytes: 9168
// B - Two Contests
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char *argv[])
{
	ios::sync_with_stdio(false); cin.tie(0);
	int n, ans = 0;
	cin >> n;
	vector<pair<int, int> > a(n);
	int maxl = 0, minr = 2000000000;
	for (int i = 0; i < n; i++) {
		cin >> a[i].first >> a[i].second;
		a[i].first--;
		maxl = max(maxl, a[i].first);
		minr = min(minr, a[i].second);
	}
	for (int i = 0; i < n; i++)
		ans = max(ans, max(0, minr - maxl) + a[i].second - a[i].first);

	vector<pair<int, int> > p;
	for (int i = 0; i < n; i++)
		p.push_back(make_pair(max(a[i].second - maxl, 0), -max(minr - a[i].first , 0)));
	sort(p.begin(), p.end());

	int w = 1000000000;
	for (int i = 0; i < n; i++) {
		if (i) ans = max(ans, p[i].first + w);
		w = min(w, -p[i].second);
	}

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


Measured memory_bytes: 2168
import java.util.*;
public class Main{
    public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int count = 0;
        for(int i = 0; i < N; i++){
            int h = sc.nextInt();
            if(h >= K)count++;
        }
System.out.println(count);
    }
}


Measured memory_bytes: 47060
#126 b
def change(x):
    if 1<=x<=12:
        return 0
    else:
        return 1
ans=["AMBIGUOUS","NA","MMYY","YYMM"]#[00,11,01,10]
s=input()
a=change(int(s[:2]))
b=change(int(s[2:]))
if a==b:
    print(ans[a])
else:
    print(ans[a+2])

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
long long ans,n,a[1000001];
int main() {
	cin>>n;
	for(int i=0; i<n*2; i++) {
		cin>>a[i];
	}
	sort(a,a+n*2);
	for(int i=0; i<2*n; i++) {
		ans+=1*i*a[i];
	}
	printf("%.12lf\n",1.0*ans/(2*n-1));
	return 0;
}

Measured memory_bytes: 1792
from bisect import bisect_left, bisect_right
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N-1, 1, -1):
    for j in range(i - 1, 0, -1):
        x = L[i] - L[j]
        bottom = bisect_right(L, x)
        if j > bottom:
            ans += j - bottom
print(ans)


Measured memory_bytes: 9244
#include <stdio.h>

void scaninput(int input[]) {
	int i;
	for(i = 0; i < 10; i++ ) {
		scanf("%d",&input[i]);
	}
}

int check(int input[]) {
	int portA, portB = 0, i;
	portA = input[0];
	for(i = 1; i < 10; i++ ) {
		if(portA < input[i] && portB < input[i]) {
			if(portA < portB) {
				portB = input[i];
			} else {
				portA = input[i];
			}
		} else if(portA < input[i]) {
			portA = input[i];
		} else if(portB < input[i]) {
			portB = input[i];
		} else {
			return 0;
		}
	}
	return 1;
}


int main(void) {
	int input[10];
	int n, dataset;
	scanf("%d",&n);
	for(dataset = 0; dataset < n; dataset++ ) {
		scaninput(input);
		if(check(input)) {
			puts("YES");
		} else {
			puts("NO");
		}
	}
	return 0;
}

Measured memory_bytes: 580
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main() {
	while (true) {
		string s;
		int seq[1000005] = { 0 };
		int n, m;
		cin >> n;
		if (n == 0) return 0;
		cin >> m;
		cin >> s;
		//cout << " ";
		for (int i = 1; i < m; i++) {
			if (s[i] == 'I'&&s[i - 1] == 'O') {
				if (i == 1) seq[1] = 1;
				else seq[i] = seq[i - 2] + 1;
			}
			//cout << seq[i] ;
		}
		//cout << "\n";
		int res = 0;
		for (int i = 2; i < m; i++) {
			if (seq[i] > n) res++;
			if (seq[i] == n && s[i - (2 * n)] == 'I') res++;
		}
		cout << res << endl;
	}
}


Measured memory_bytes: 7836
n = int(input())
red = [list(map(int, input().split())) for i in range(n)]
blue = [list(map(int, input().split())) for i in range(n)]
red = list(reversed(sorted(red, key=lambda x: x[1])))
blue = sorted(blue)
ans = 0
done = []
for pos in blue:
  i = 0
  while i < n:
    if pos[0] > red[i][0] and pos[1] > red[i][1] and not i in done:
      done.append(i)
      ans += 1
      i += 1
      break
    i += 1

print(ans)

Measured memory_bytes: 3064
import math

n = int(input())
l = 0

x_list = []
y_list = []

for i in range(n):
    x, y = map(int, input().split())
    x_list.append(x)
    y_list.append(y)

for j in range(n):
    for k in range(n):
        if j>=k:
            continue
        l += math.sqrt((x_list[j] - x_list[k]) ** 2 + (y_list[j] - y_list[k]) ** 2)

print(l * 2/n)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}

struct UnionFind{
	vector<int> par,rank,r;
	UnionFind(int N){
		par.assign(N,0);
		rank.assign(N,0);
		r.assign(N,0);
		rep(i,N) par[i]=i,r[i]=i;
	}
	int find(int x){
		if(par[x]==x) return x;
		return par[x]=find(par[x]);
	}
	bool same(int x,int y){
		return find(x)==find(y);
	}
	void unite(int x,int y){
		x=find(x),y=find(y);
		if(x==y) return;
		if(rank[x]<rank[y]){
			par[x]=y;
			chmax(r[y],r[x]);
		}else{
			par[y]=x;
			chmax(r[x],r[y]);
			if(rank[x]==rank[y]) rank[x]++;
		}
	}
};

using ll = long long;
using P = pair<int,int>;
using PP = pair<ll,P>;
int N;
vector<vector<int>> G;
vector<ll> cs;
vector<int> sz;
vector<ll> ans;

void dfs(int v,ll d){
	if(v<N){
		ans[v] = d;
		return;
	}
	int x = G[v][0], y = G[v][1];
	ll c = cs[v];
	dfs(x,d+c*sz[y]);
	dfs(y,d+c*sz[x]);
}
int main(){
	cin>>N;
	vector<PP> es;
	rep(i,N-1){
		int a,b,c;
		cin>>a>>b>>c;
		a--,b--;
		es.pb(PP(c,P(a,b)));
	}
	sort(all(es),greater<PP>());
	cs.resize(N*2-1);
	sz.resize(N*2-1);
	G.resize(N*2-1);
	UnionFind UF(N*2-1);

	rep(i,N) sz[i] = 1;

	int I = N;
	for(auto e:es){
		ll c = e.fs;
		int x = e.sc.fs, y = e.sc.sc;
		x = UF.r[UF.find(x)], y = UF.r[UF.find(y)];
		UF.unite(I,x);
		UF.unite(I,y);
		G[I].pb(x);
		G[I].pb(y);
		cs[I] = c;
		sz[I] = sz[x]+sz[y];
		I++;
	}
	ans.resize(N);
	dfs(I-1,0);
	rep(i,N) cout<<ans[i]<<endl;
}

Measured memory_bytes: 19696
#include <iostream>
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
using namespace std;

int main(){
	long A, B, K, C, D;
	cin >> A >> B >> K;
	if(A > K){
		C = A-K;
		D = B;
	}else if(A+B > K){
		C = 0;
		D = A+B-K;
	}else{
		C = 0;
		D = 0;
	}
	cout << C << " " << D;
	return 0;
}

Measured memory_bytes: 256
import sys
from collections import deque
from bisect import bisect_left, bisect_right

N=input()
A=[ int(sys.stdin.readline().strip())  for _ in range(N) ]

q=deque()

for x in A:
	i=bisect_left(q,x)
	if i==0:
		q.appendleft(x)
	else:
		q[i-1]=x

print len(q)

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

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    
    if (abs(a-c)<=d
        or (abs(a-b)<=d and abs(b-c)<=d)) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 256
// by adiforluls
#pragma GCC optimize ("-O2")
#include<bits/stdc++.h>
using namespace std;
#define FASTNIBBA   ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define ll          long long
#define ld          long double
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define mii         map<int,int>
#define vi          vector<int>
#define vll         vector<long long>
#define lbnd        lower_bound
#define ubnd        upper_bound
#define all(a)      (a).begin(),(a).end()
#define clz(a)      __builtin_clz(a) // count leading zeroes
#define ctz(a)      __builtin_ctz(a) // count trailing zeroes
#define popc(a)     __builtin_popcount(a) // count set bits (for ints only diff for ll)
#define lul         1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define SIZE        1000005
#define F           first
#define S           second
#define debug(x)    cerr << #x << " = " << x << endl;
#define mod         998244353

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    std::cerr << name << " = " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " = " << arg1<<" |";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define endl        '\n'
const ld PI = acos(-1.0);
const int INF = 0x3f3f3f3f;

void solve()
{
    ll k,a,b,stp; cin>>k>>a>>b;
    stp=k;
    if(b<=a || k<=a) {cout<<k+1; return;}
    ll ans=b;
    stp-=(a+1);
    if(stp%2) ans++,stp--;
    ans+=max((stp/2)*(b-a),stp);
    cout<<max(ans,k+1);
}
int main()
{
    FASTNIBBA;
   //  #ifndef ONLINE_JUDGE
     // freopen("input.txt", "r", stdin);
     // freopen("output.txt", "w", stdout);
   //  #endif
    int t; t=1;
    while(t--){
       solve();
    }
    return 0;
}

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

int main() {
	char a, b;
	cin >> a >> b;
	if (((int)(unsigned)a - 70)*((int)(unsigned)b - 70) >= 0) {
		cout << "H" << endl;
	}
	else {
		cout << "D" << endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr auto pi = 3.14159265358979;

int main() {
	cout.precision(16);
	double a, b, h, m;
	cin >> a >> b >> h >> m;
	double ca = m / 60. * 2 * pi;
	double cb = (60 * h + m) / 720. * 2 * pi;
	double c = abs(ca - cb);
	c = min(c, 2 * pi - c);
	double ans = a * a + b * b - 2 * a * b * cos(c);
	cout << sqrt(ans) << endl;
}


Measured memory_bytes: 4228
#include <iostream>
using namespace std;
int main(void) {
	int N, A, B, p;
	cin >> N >> A >> B;
	int cntA = 0, cntB = 0, cntC = 0;
	for (int i = 0; i < N; ++i) {
		cin >> p;
		if (p <= A) ++cntA;
		if (A < p && p <= B) ++cntB;
		if (B < p) ++cntC;
	}
	cout << min(cntA, min(cntB, cntC)) << endl;
	return 0;
}

Measured memory_bytes: 256
import sys
import numpy as np
input = sys.stdin.readline

def main():
	N = int(input())
	A = list(map(int,input().split()))
	A.sort()
	count = 0
	m = 10**10
	if 0 in A:
		A = np.array(A)
		print(sum(abs(A)))
	else:
		for i in range(N):
			if A[i]<0:
				count += 1
			m = min(m,abs(A[i]))
		A = np.array(A)
		if count%2 == 0:
			print(sum(abs(A)))
		else:
			print(sum(abs(A))-2*m)

if __name__ == "__main__":
	main()

Measured memory_bytes: 23348
#include<bits/stdc++.h>
using namespace std;
const int N=100010;
long long a[N],b[N],c[N],sum[N];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%lld",&a[i]);
    for(int i=0; i<n; i++)
        scanf("%lld",&b[i]);
    for(int i=0; i<n; i++)
        scanf("%lld",&c[i]);
    sort(a,a+n);
    sort(b,b+n);
    sort(c,c+n);
    long long ans=0;
    for(int i=0; i<n; i++)
        sum[i]=lower_bound(a,a+n,b[i])-a;
    for(int i=0; i<n; i++)
        sum[i]+=i==0?0:sum[i-1];
    for(int i=0; i<n; i++)
        ans+=sum[lower_bound(b,b+n,c[i])-b-1];
    printf("%lld\n",ans);
    return 0;
}


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

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

    // 1とn以外の約数を求める関数
    auto getDivisors = [](ll n) {
        vector<ll> divisors;
        for (ll i = 2; i <= (ll)sqrt((double)n); ++i) {
            if (n % i == 0) {
                divisors.push_back(i);
                if (i != (ll)(n/i)) {
                    divisors.push_back((ll)(n/i));
                }
            }
        }
        return divisors;
    };
    
    // 条件⑴ 割り算を1度もしない場合
    vector<ll> noDiv;
    noDiv = getDivisors(n-1);
    if (n-1 != 1) {
        noDiv.push_back(n-1);
    }

    // 条件⑵ 割り算を1度以上をする場合
    vector<ll> div;
    div = getDivisors(n);
    div.push_back(n);
    int cnt = 0;
    for (ll k: div) {
        ll old = n;
        while (old % k == 0) {
            old = (ll)(old / k);
        }
        if (old % k == 1) ++cnt;
    }
    cout << noDiv.size() + cnt << endl;
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
typedef long long int lli;

int main() {
  lli X, Y;
  scanf("%lld %lld",&X,&Y);
  vector<lli> A;
  A.push_back(X);
  while (true) {
    if (2*X<=Y) {
      A.push_back(2*X);
    } else {
      break;
    }
    X*=2;
  }
  printf("%d\n",A.size());
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
bool mixing[15];//封建迷信害死人，外国人为啥对数字忌讳啊？ 
int che(int x)
{
	int s=0;
	while(x)
	{
		s=x%10;
		if(mixing[s]==false) return 0;
		x/=10;
	}
	return 1;
}
int main()
{
	int n,k;
	cin>>n>>k;
	for(int i=0;i<10;i++)
	mixing[i]=true;
	for(int i=0;i<k;i++)
	{
	int a;
	cin>>a;
	mixing[a]=false;	
	} 
	int j=n;
	while(1)
	{
		if(che(j)==1)
		{
			cout<<j;
			return 0;
		}
		j++;
	}
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;

int main() {
	int N; cin >> N;
	vector<int> r(N);
	for (int i = 0; i < N; i++)
		cin >> r[i];
	sort(r.begin(), r.end());
	double ma = 0;
	for (int n = 3; n <= N; n++) {
		vector<int> a(r.end() - n, r.end());
		do {
			vector<double> x(n), y(n);
			for (int i = 0; i < n; i++) {
				x[i] = a[i] * cos(M_PI*2 / n * i);
				y[i] = a[i] * sin(M_PI*2 / n * i);
			}
			for (int t = 0; t < 50; t++) {
				int i = rand() % n;
				int j = (i + n - 1) % n, k = (i + 1) % n;
				double dx = x[k] - x[j], dy = y[k] - y[j];
				double _dx = dy, _dy = -dx;
				double r = sqrt(_dx * _dx + _dy * _dy);
				x[i] = _dx / r * a[i];
				y[i] = _dy / r * a[i];
			}
			double sum = 0;
			for (int i = 0; i < n; i++) {
				int j = (i + 1) % n;
				sum += x[i] * y[j] - y[i] * x[j];
			}
			ma = max(ma, sum);
		} while (next_permutation(a.begin() + 1, a.end()));
	}
	printf("%.15f\n", ma / 2);
}

Measured memory_bytes: 3640
#include<iostream>
#include<iostream>
#include<string>
#include<sstream>
#include<vector>
#include<algorithm>
#include<math.h>
#include"boost/algorithm/string.hpp"

using namespace std;


int main(){


	/*Q2*/

	/*Q3*/

	int n = 0;
	string line;
	int miss[2] = {0};
	cin >> line;

	for (int i = 0; i < line.size(); ++i){
		if (i % 2 == 0){
			line[i] == '0' ? miss[0]++ : miss[1]++;
		}
		else{
			line[i] == '1' ? miss[0]++ : miss[1]++;
		}
	}

	cout << (miss[0] < miss[1] ? miss[0] : miss[1]) << endl;

	return 0;

	/*Q2*/
	/*
	int h[20];
	int n;
	int count = 0;
	int max = 0;

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

		if (max <= h[i]){
			count++;
			max = h[i];
		}

	}

	cout << count << endl;
	return 0;


	/*Q1*/
	/*
	int a, b;
	cin >> a >> b;

	if (a == b){
	cout << a + b;
	}
	else{
	if (a < b){
	cout << b * 2 - 1;
	}
	else{
	cout <<  a * 2 - 1;
	}
	}

	return 0;
	*/
}

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

int main(){
  int a, b,c,d;
  cin >> a >> b >> c >> d;
  if (a+b>c+d)
    cout << "Left" << endl;
  else if (a+b==c+d)
    cout << "Balanced" << endl;
  else
    cout << "Right" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<string> vs;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;

inline bool valid(int x, int n) {
    return 0 <= x && x < n;
}

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

template <typename T>
inline T pop(queue<T>& q) {
    T front = q.front();
    q.pop();
    return front;
}

template <typename T>
inline T gcd(T a, T b) {
    for (; b; a %= b, swap(a, b));
    return a; 
}

template <typename T>
tuple<T, T, T> xgcd(T a, T b) {
    if (b == 0) return {1, 0, a};
    T x, y, g;
    tie(x, y, g) = xgcd(b, a%b);
    return {y, x-(a/b)*y, g};
}

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

    int n, m, x; cin >> n >> m >> x;
    vvi a(n, vi(m+1));
    int minc = 0;
    vi asdf(m+1);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m+1; j++) {
            cin >> a[i][j];
            asdf[j] += a[i][j];
        }
    }
    minc = asdf[0];

    for (int i = 1; i <= m; i++) {
        if (asdf[i] < x) {
            cout << -1;
            return 0;
        }
    }

    for (int i = 0; i < (1<<n); i++) {
        int subc = 0;
        vi suba(m+1);
        for (int j = 0; j < n; j++) {
            if (i & (1 << j)) {
                subc += a[j][0];
                for (int k = 1; k <= m; k++) suba[k] += a[j][k];
            }
        }

        bool ok = true;
        for (int k = 1; k <= m; k++) {
            if (suba[k] < x) {
                ok = false;
                break;
            }
        }

        if (ok) minc = min(minc, subc);
    }

    cout << minc;
}


Measured memory_bytes: 3568
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <functional>
#include <numeric>
#include <math.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main(void) {
	int N;
	cin >> N;
	ll ans = 1;
	ll X = (ll)1e18;
	int flag = 0;
	for (int i = 0; i < N; i++) {
		ll tmp;
		cin >> tmp;
		if (ans == 0) break;
		if (tmp > X / ans) {
			flag++;
			ans = 1;
		} else {
			ans *= tmp;
		}
	}
	if (ans == 0) cout << ans << endl;
	else if (flag > 0) cout << -1 << endl;
	else cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3636
import std.algorithm, std.conv, std.range, std.stdio, std.string;

void main()
{
  auto n = readln.chomp.to!size_t;

  auto rd = readln.chomp.splitter;
  auto ai = new int[](n);
  foreach (i; n.iota) {
    ai[i] = rd.front.to!int;
    rd.popFront;
  }

  auto k = ai.reduce!(max);
  auto bi = countingSort(ai, k);

  foreach (i, b; bi) {
    write(b);
    if (i < n - 1) write(" ");
  }
  writeln;
}

int[] countingSort(int[] ai, int k)
{
  auto ci = new int[](k + 1);

  foreach (a; ai) ++ci[a];
  foreach (i; 1..k+1) ci[i] += ci[i - 1];

  auto bi = new int[](ai.length);

  foreach_reverse (a; ai) {
    bi[ci[a] - 1] = a;
    --ci[a];
  }

  return bi;
}

Measured memory_bytes: 27488
#include <stdio.h>

//prototype
int main(void);

int main(void){

  int i, j;   //count variable
  int height, width;

  while(1){

    scanf("%d", &height); scanf("%d", &width);

    if(height == 0 && width == 0){
      break;    //Exit conditions
    }

    for (i = 1; i <= height; i++) {
      if (i % 2 != 0) {
          
        //odd row
        for (j = 1; j <= width; j++) {

          if(j % 2 != 0){
            printf("#");//odd
          } else {
            printf(".");//even
          }

        }

        printf("\n");

      } else {
          
        //even row
        for (j = 1; j <= width; j++) {

          if(j % 2 != 0){
            printf(".");//odd
          } else {
            printf("#");//even
          }

        }

        printf("\n");

      }
    }
    printf("\n");
  }

  return 0;
  
}



Measured memory_bytes: 2040
from collections import Counter
from collections import deque
from functools import reduce
from pprint import pprint
import bisect
import copy
import fractions
import itertools
import math
import queue
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers): return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers): return reduce(LCM, numbers)
def LCM(m, n): return (m * n // fractions.gcd(m, n))


a, b, c = MI()
print('Yes' if a + b >= c else 'No')


Measured memory_bytes: 66668
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int[] P = new int[N];
		for (int i = 0; i < N; i++) {
			P[i] = sc.nextInt() - 1;
		}
		int[] C = new int[N];
		for (int i = 0; i < N; i++) {
			C[i] = sc.nextInt();
		}
		int[] L = new int[N];
		long[] sum = new long[N];
		for (int i = 0; i < N; i++) {
			if (L[i] > 0) continue;
			int cnt = 0;
			long tmp = 0;
			for (int j = i; L[j] == 0; j = P[j]) {
				cnt++;
				tmp += C[j];
				L[j] = -1;
			}
			for (int j = i; L[j] < 0; j = P[j]) {
				L[j] = cnt;
				sum[j] = tmp;
			}
		}
		long ans = -1L << 50;
		for (int i = 0; i < N; i++) {
			long tmp = K / L[i] > 0 ? sum[i] * ((K / L[i]) - 1) : 0;
			if (tmp < 0) tmp = 0;
			int T = K / L[i] > 0 ? K % L[i] + L[i] : K;
			for (int k = 0, j = i; k < T; k++) {
				tmp += C[j];
				j = P[j];
				ans = Math.max(tmp, ans);
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 48900
# n個の点全てを含む円のうち半径が最小である円の
# 中心座標と半径を求める
class SolvCircle

    LOOP_MAX = 100

    # 移動距離がこの値以下になったら処理を終了させる
    CONVRGV = 1.0e-16

    #
    #=== 円の中心座標と半径を求める
    #
    #_pt_x_ :: n個の点のx座標の配列
    #_pt_y_ :: n個の点のy座標の配列
    # 
    #返り値::配列を返す。[中心点のx座標, 中心点のy座標, 円の半径]
    #
    def solv_circle(pt_x, pt_y)
        mv_rate  = 0.5 # 移動係数
        max_dist = 0.0 # 中心点から最遠点までの距離
        cx       = 0.0 # 中心点のx座標。最初は仮に0とし、更新していく。
        cy       = 0.0 # 中心点のy座標。最初は仮に0とし、更新していく。
        k        = 0
        cvgflg   = false

        while (cvgflg == false)

            LOOP_MAX.times { |t|
                # 仮中心点からの最遠点を求める
                max_dist = 0.0
                pt_x.length.times { |i|
                    dist = distance(cx, cy, pt_x[i], pt_y[i])
                    if (dist > max_dist)
                        max_dist = dist
                        k        = i
                    end
                }

                # mv_rateに応じて、仮中心点を更新する移動距離を求める。
                dx = (pt_x[k] - cx) * mv_rate
                dy =  (pt_y[k] - cy) * mv_rate
                dist = Math.sqrt(dx ** 2 + dy **2 )
                
                # 仮中心点を更新する。
                cx += dx
                cy += dy

                # 移動距離が境界値を下回っていればループを抜ける
                if (dist <= CONVRGV)
                    cvgflg = true
                    break
                end
            }

            mv_rate /= 2.0 # 移動係数が1.5を下回ってくるとTLEとなりやすい。
        end

        return [cx, cy, max_dist]
    end

    #
    #=== 二点の距離を求める
    #
    def distance(x1, y1, x2, y2)
        dx = x2 - x1
        dy = y2 - y1
        Math.sqrt(dx * dx + dy * dy)
    end
end

N = gets.to_i
x = Array.new(N)
y = Array.new(N)
N.times{|i| x[i],y[i] = gets.split.map(&:to_i)}

sc = SolvCircle.new
ans = sc.solv_circle(x, y)
puts ans[2]



Measured memory_bytes: 1788
//入力マクロここから
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
//　入力マクロここまで

fn gcd(a: u64, b: u64) -> u64 {
    if b == 0 {
        return a;
    }
    gcd(b, a % b)
}

fn main() {
    input! {
        n: usize,
        a: [u64;n],
    }
    
    let mut ans = a[0];
    for i in 1..n {
        ans = gcd(a[i],ans);
    }

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

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

struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;

/* cpp template {{{ */

/* short */
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v), end(v)
#define RALL(v) (v).rbegin(), (v).rend()
#define X real()
#define Y imag()

/* REPmacro */
#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define rep(i, n) REPS(i, 0, n)
#define REP1(i,n) for (ll i = 1; i <= (ll)(n); ++i)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (ll i = (a); i >= (ll)(n); --i)
#define DEP(i, n) DEPS(i, n, 0)
#define EACH(i, n) for (auto&& i : n)

/* debug */
#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';

/* alias */
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using D = double;
using P = complex<D>;
using vs = vector<string>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;
const D EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; cin >> x; return x;}
inline ll IN() {ll x; cin >> x; return x;}
inline vs split(const string& t, char c) {vs v; stringstream s(t); string b; while(getline(s, b, c)) v.eb(b); return v;}
template <typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
template <typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
template <typename T, typename S> inline void print(const pair<T, S>& p) {cout << p.first << " " << p.second << endl;}
template <typename T> inline void print(const T& x) {cout << x << '\n';}
template <typename T, typename S> inline void print(const vector<pair<T, S>>& v) {for (auto&& p : v) print(p);}
template <typename T> inline void print(const vector<T>& v, string s = " ") {rep(i, v.size()) cout << v[i] << (i != (ll)v.size() - 1 ? s : "\n");}

signed main() 
{
  char x,y; cin>>x>>y;
  if(x>y) print('>');
  else if(x<y) print('<');
  else print('=');

  return 0;
}

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

using namespace std;

struct COORDINATE{
  double x;
  double y;
};

double CalcurateArea(COORDINATE, COORDINATE, COORDINATE);
double CalcurateLength(COORDINATE, COORDINATE);

int main(){
  int i;
  double x, y, s;
  char c;
  COORDINATE onedata;
  vector<COORDINATE> data;

  while(cin >> x >> c >> y){
    onedata.x = x;
    onedata.y = y;
    data.push_back(onedata);
  }

  for(i=1, s=0; i<data.size()-1; ++i)
    s += CalcurateArea(data[0], data[i], data[i+1]);

  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(6);
  cout << s << endl;

  return 0;
}

double CalcurateArea(COORDINATE A, COORDINATE B, COORDINATE C){
  double a, b, c, z, s;

  a = CalcurateLength(A, B);
  b = CalcurateLength(C, A);
  c = CalcurateLength(B, C);
  z = (a + b + c)/2;
  s = sqrt(z*(z - a)*(z - b)*(z - c));

  return s;
}

double CalcurateLength(COORDINATE A, COORDINATE B){
  double a, b, c;

  a = A.x - B.x;
  b = A.y - B.y;
  c = sqrt(a*a + b*b);

  return c;
}

Measured memory_bytes: 0
#include <iostream>
#include<string.h>
#include<algorithm>
using namespace std;

int main() {
	string n;
	cin >> n;
	if (n[0] == '1') n[0] = '9';
	else if (n[0] == '9') n[0] = '1';
	if (n[1] == '1') n[1] = '9';
	else if (n[1] == '9') n[1] = '1';
	if (n[2] == '1') n[2] ='9';
	else if (n[2] == '9') n[2] = '1';
	
	cout << n << endl;

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int a,b;
    scanf("%d", &a);
    scanf("%d", &b);
    if (a<2 || a>100 || b<2 || b>100) {
        printf("Invalid input");
        return 0;
    }
    else {
        int area= a*b - (a+b-1);
        printf("%d", area);
    }
    return 0;
}


Measured memory_bytes: 128
using System;
using System.Numerics;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace debug
{

    class ProgramD
    {
        static void Main(string[] args)
        {
            //入力
            string[] s = Console.ReadLine().Split(' ');
            long n = long.Parse(s[0]);
            long m = long.Parse(s[1]);
            long k = long.Parse(s[2]);
            long MOD = 998244353;

            //下準備
            nCk com = new nCk();
            com.fac = new long[n + 1];
            com.inv = new long[n + 1];
            com.finv = new long[n + 1];
            com.mod = MOD;
            com.max = n + 1;

            //メモ作成
            com.com_init();

            long ans = 0;

            for(long i = 0; i <= k;i++)
            {
                ans += (com.com(n - 1, i) * modpow(m - 1, n - i - 1, MOD)) % MOD; //変数はkじゃなくてiです！！
                ans %= MOD;

            }

            ans *= m;
            ans %= MOD;

            Console.WriteLine(ans);
                
        }

        //繰り返し二乗法で求める
        static long modpow(long a, long n, long MOD)
        {
            if (n == 0)
                return 1;
            if (n % 2 == 0)
            {
                long temp = modpow(a, n / 2, MOD);
                return temp * temp % MOD;
            }

            return a * modpow(a, n - 1, MOD) % MOD;
        }
    }

    class nCk
    {
        public long mod;
        public long max;
        public long[] fac;
        public long[] inv;
        public long[] finv;


        //メモ作成(前準備)
        public void com_init()
        {
            fac[0] = 1;
            fac[1] = 1;
            finv[0] = 1;
            finv[1] = 1;
            inv[1] = 1;
            for (long i = 2; i < max; i++)
            {
                fac[i] = i * fac[i - 1] % mod;
                inv[i] = mod - inv[mod % i] * (mod / i) % mod;
                finv[i] = finv[i - 1] * inv[i] % mod;
            }
        }

        //二項計算
        public long com(long n, long k)
        {
            if (n < 0 || k < 0)
                return 0;
            if (n < k)
                return 0;
            return fac[n] * (finv[n - k] * finv[k] % mod) % mod;
        }

    }
}


Measured memory_bytes: 32380
#include<bits/stdc++.h>
#define pii pair<int,int>
#define F first
#define S second
#define mp make_pair
#define ll long long
using namespace std;
ll x,y;
int main()
{
	cin>>x>>y;
	if(y-x+1>=2019)
		cout<<"0\n";
	else{
		vector<ll>v;
		for(ll i=x;i<=y;i++)
			v.push_back(i%2019);
		sort(v.begin(),v.end());
		ll ans=2019;
		for(int i=0;i<v.size();i++)
		{
			for(int j=i+1;j<v.size();j++)
			{
				ans=min(ans,v[i]*v[j]%2019);
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define rrep(i, a, b) for (int i = (a); i < (b); ++i)
#define PI acos(-1)
#define pcnt __builtin_popcountll
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
#define fi first
#define se second

using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using LP = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using tl = tuple<ll, ll, ll>;

template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) {if (a > b) { a = b; return true; } return false; }

ll INF = 1001001001;
ll LINF = 1001001001001001001ll;

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

    ll n, k; cin>>n>>k;
    vl as(n); cin>>as;

    vl vs(n + 1);
    rep(i, k) {
        rep(i, n) {
            vs[max(0ll, i - as[i])]++;
            vs[min(n, i + as[i] + 1)]--;
        }
        bool f = true;
        ll cur = 0;
        rep(i, n) {
            cur += vs[i];
            as[i] = cur;
            if (as[i] != n) f = false;
            vs[i] = 0;
        }
        if (f) break;
        vs[n] = 0;
    }
    rep(i, n) cout<<as[i]<<" ";
    cout<<endl;
}

Measured memory_bytes: 6368
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<deque>
#include<functional>
#include<numeric>

using namespace std;

#define sz(x) (int)(x.size())
#define fi(a,b) for(int i=a;i<b;++i)
#define fj(a,b) for(int j=a;j<b;++j)
#define fo(a,b) for(int o=a;o<b;++o)
#define fdi(a,b) for(int i=a-1;i>=b;--i)
#define fdj(a,b) for(int j=a-1;j>=b;--j)
#define fdo(a,b) for(int o=a-1;o>=b;--o)
#define pb push_back
#define mp make_pair
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
/////////////////////

string const F = "Alice";
string const S = "Borys";
string const D = "Draw";

int n, a[2];

int const N = 1e5 + 41;

bool move(int x){
	if(a[x] < a[1-x] && a[x] + 1 < a[1-x]){
		++a[x];
		return true;
	}
	if(a[x] > a[1-x] && a[x] - 1 > a[1-x]){
		--a[x];
		return true;
	}
	if(a[x] + 1 < n && a[x] + 1 != a[1-x]){
		++a[x];
		return true;
	}
	if(a[x] - 1 > 0 && a[x] - 1 != a[1-x]){
		--a[x];
		return true;
	}
	return false;
}

void ok(string s){
	cout << s << endl;
	exit(0);
}

void solve(){
	int w = 0;
	int q = N;
	while(move(w) && q--){
		w ^= 1;
	}
	if(q > 0){
		if(w) ok(F);
		else ok(S);
	}
	ok(D);
}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif

	scanf("%d %d %d",&n,&a[0],&a[1]);

	solve();


	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

bool sosu[300100];

int main() {
	int i,j;
	for(i=0;i<300100;i++){
		if(i%7==1||i%7==6)sosu[i]=true;
		else sosu[i]=false;
	}
	sosu[1]=false;
	for(i=0;i<300100;i++){
		if(!sosu[i])continue;
		for(j=i*2;j<300100;j+=i){
			sosu[j]=false;
		}
	}
	int n;
	while(n=in(),n!=1){
		int i;
		cout<<n<<":";
		for(i=0;i<=n;i++){
			if(sosu[i]&&n%i==0)cout<<" "<<i;
		}
		cout<<endl;
	}
	return 0;
}

Measured memory_bytes: 1176
#include <bits/stdc++.h>
using namespace std;
int main() {
int64_t N,A,B;
cin>>N>>A>>B;
int64_t a = N/(A+B);
int64_t b = N%(A+B);
int64_t c;
if(b>=A){
    c=A;
}else{
    c=b;
}
cout<<a*A+c<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[100005];
ll ans=1;
ll c[100005];
int main(void){
	ll n; cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
		c[a[i]]++;
	}
	if(n%2==0){
		for(int i=1;i<=n-1;i=i+2){
			if(c[i]!=2){
				cout<<0<<endl;
				return 0;
			}
			ans=(ans*2)%1000000007;
		}
		
	}else{
		for(int i=0;i<=n-1;i=i+2){
			if(i==0){
				if(c[i]!=1){
					cout<<0<<endl;
					return 0;
				}
			}else{
				if(c[i]!=2){
					cout<<0<<endl;
					return 0;
				}
			}
			ans=(ans*2)%1000000007;
		}
		ans=ans/2;
	}
	cout<<ans<<endl;  
}


Measured memory_bytes: 1792
//#pragma comment(linker, "/STACK:102400000,102400000") 
#pragma warning(disable:4996)
#include <fstream>
#include <iostream>
#include <functional>
#include <algorithm>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <deque>
#include <ctime>
#include <list>
#include <set>
#include <map>
using namespace std;

typedef long long ll;
#define eps 1e-10
#define LL_INF 0x33ffffffffffffff
#define INF 0x3f3f3f3f
#define mem(a, b) memset(a, b, sizeof(a))
#define pper(i,n,m) for(int i = n;i >= m; i--)
#define repp(i, n, m) for (int i = n; i <= m; i++)
#define rep(i, n, m) for (int i = n; i < m; i++)
#define sa(n) scanf("%d", &(n))
#define mp make_pair
#define ff first
#define ss second
#define pb push_back

const int maxn = 1e6 + 5;
const ll mod = 1e9 + 7;
const double PI = acos(-1.0);
const ll hax = 1e6 + 7;

int n, lk;
vector<string>s;

void solve()
{
	sa(n), sa(lk);
	string tmp;
	repp(i, 1, n)
	{
		cin >> tmp;
		s.push_back(tmp);
	}
	sort(s.begin(), s.end());
	rep(i, 0, n)
	{
		cout << s[i];
	}
}

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


Measured memory_bytes: 256
while True:
    a,op,b = input().split()

    a = int(a)
    b = int(b)

    if op == '?':
        break

    if op == '+':
        ANS = a+b
    elif op == '-':
        ANS = a-b
    elif op == '/':
        ANS = a//b
    elif op == '*':
        ANS = a*b

    print(ANS)



Measured memory_bytes: 5592
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long> vll;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<pair<long long,long long> > vpll;
typedef vector<vector<pair<ll,ll> > > vvpll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
 
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define all(x) x.begin() , x.end()
#define pb push_back
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define F first
#define S second
#define left (node << 1)
#define right (node << 1) + 1
#define pii pair<int,int> 
#define mii map<int,int>
#define vi vector<int>
#define umii unordered_map<int,int>
// #define mod 998244353
#define mod 1000000007 
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<": " <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define FILL(name,val) memset(name , val , sizeof(name))
#define repo(i,o,e) for(int i = o ; i < e ; i++)
#define rep(n) for(int i = 0 ; i < n ; i++)
#define repa(i,sta,end,inc) for(int i = sta ; i <= end ; i += inc)
#define repb(i,sta,end,inc) for(int i = sta ; i >= end ; i -= inc)
const ll sz = 1e5+5;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
 
const ll inf = 1000000000LL * 1000000000LL;

ll power(ll x , ll y){ll res = 1;x %= mod;while(y){if(y&1){res = res * x % mod;}x = x*x % mod;y /= 2;}return res%mod;}

void solve(){
    int r;
    cin >> r;
    cout << r * r << endl;
    return; 
}


int main(){
    FIO;
    int t = 1;
    // cin >> t;   
    while(t--){
        solve();
    }
    return 0;
}

 

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)
using ll = long long;
const int MOD = 1000000007;
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  ll red = -1;
  ll blue = -1;
  ll yellow = -1;
  ll ans = 1;
  rep(i, n) {
    cin >> a[i];
    if(red == blue && blue == yellow) {
      if(a[i] == red + 1) {
        ans *= 3;
        red++;
      }
      else ans = 0;
    }
    else if(red == blue) {
      if(a[i] == red + 1) {
        ans *= 2;
        red++;
      }
      else if(a[i] == yellow + 1) yellow++;
      else ans = 0;
    }
    else if(blue == yellow) {
      if(a[i] == blue + 1) {
        ans *= 2;
        blue++;
      }
      else if(a[i] == red + 1) red++;
      else ans = 0;
    }
    else if(red == yellow) {
      if(a[i] == yellow + 1) {
        ans *= 2;
        yellow++;
      }
      else if (a[i] == blue + 1) blue++;
      else ans = 0;
    }
    else if(a[i] == red + 1) red++;
    else if(a[i] == blue + 1) blue++;
    else if(a[i] == yellow + 1) yellow++;
    else ans = 0;
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
def abc161_C(N,K):
    if K == 1:
        return print(0)
    Min = 0
    N = N%K
    diff_list = [N]
    while 1:
        diff = abs(N - K)
        N = diff
        if diff in diff_list:
            return print(min(diff_list))
        elif diff < K/2:
            diff_list.append(diff)
            return print(min(diff_list))
        else:
            diff_list.append(diff)
    
N,K = map(int,input().split())
abc161_C(N,K)

Measured memory_bytes: 61864
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include "cmath"
using namespace std;

int main(int argc, const char * argv[]) {
    long long h,w;
    cin>>h>>w;
    long long c[11][11];
    long long a[h][w];
    for (long long i=0; i<10; i++) {
        for (long long j=0; j<10; j++) {
            cin>>c[i][j];
        }
    }
    for (long long i=0; i<h; i++) {
        for (long long j=0; j<w; j++) {
            cin>>a[i][j];
        }
    }
    for (long long k=0; k<10; k++) {
    for (long long i=0; i<10; i++) {
        for (long long j=0; j<10; j++) {
                if(c[i][j] > c[i][k]+c[k][j])
                    c[i][j] = c[i][k]+c[k][j];
//                cin>>c[i][j];
            }
        }
    }
    long long sum=0;
    for (long long i=0; i<h; i++) {
        for (long long j=0; j<w; j++) {
            if(a[i][j]!=-1){
                sum+=c[a[i][j]][1];
            }
        }
    }
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 512
#include<iostream>
#include<stdio.h>
using namespace std;

int main(){
	int a;
	int b;
	cin >> a >> b;
	int d=a/b;
	int r=a%b;
	double f;
	f = 1.00000*a / b;
	cout << d << " " << r << " " ;
	printf("%.5lf\n", f);
	return 0;
}

Measured memory_bytes: 3224