akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef long double lb;
typedef pair<int,int> P;
const int MOD = 1000000007;
const ll INF = 1e10;
const double EPS = 1e-10;
const double PI = 3.141592653589793;
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 
#define int long long
#define double long double



////////////////////////////////////////////////////////////////////
template<typename T>
struct edge {
  int to, from;T cost;
  edge(int to, T cost) : from(-1), to(to), cost(cost) {}
  edge(int from, int to, T cost) : from(from), to(to), cost(cost) {}
};
template<typename T>
using edges = vector<edge<T>>;
template<typename T>
using graph = vector<edges<T>>;
template<typename T>
using matrix = vector<vector<T>>;

template<typename T>
bool compByCost(const edge<T>& left, const edge<T>& right){
  return left.cost < right.cost; 
}

////////////////////////////////////////////////////////////////////i

int n,m;graph<int> g(110000);
int h[110000], ans[110000];
signed main(){
  cin>>n>>m;
  rep(i,n+m-1){
    int a, b;cin>>a>>b;a--;b--;
    g[a].push_back(edge<int>(b, -1));
    h[b]++;
  }
  int root;rep(i,n)if(h[i] == 0)root = i;
  queue<int> que;que.push(root);
  while(!que.empty()){
    int p = que.front();que.pop();
    rep(i,g[p].size()){
      int to = g[p][i].to;
      if(h[to] == 1){
        ans[to] = p+1;
        h[to] = 0;
        que.push(to);
      }else{
        h[to]--;
      }
    }
  }
  rep(i,n)cout << ans[i] << endl;
}


Measured memory_bytes: 8816
#include <iostream>
#include <string>

using namespace std;

int main(){
    int len;
    cin >> len;
    string a, b;
    cin >> a >> b;
    for(int i = 0; i < len; i ++)
    {
        cout << a[i] << b[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
	long long a, b, c, d;
	scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
	long long w = a * c, x = a * d, y = b * c, z = b * d;
	if (w >= x && w >= y && w >= z) printf("%lld\n", w);
	else if (x >= w && x >= y && x >= z) printf("%lld\n", x);
	else if (y >= w && y >= x && y >= z) printf("%lld\n", y);
	else printf("%lld\n", z);
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 1736
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>

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

using namespace std;

int main()
{
  int N, M, C;
  cin >> N >> M >> C;
  
  vector<int> B(M);
  rep(i,M) cin >> B[i];
  
  vector<vector<int>> A(N, vector<int>(M));
  
  for(int i=0; i<N; i++)
  {
    rep(j,M) cin >> A[i][j];
  }
  
  int ans = 0;
  
  for(int i=0; i<N; i++)
  {
    int val = C;
    rep(j,M) val += A[i][j] * B[j];
    if(val>0) ans++;
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#include<functional>
#include<cstring>
using namespace std;
int main(void)
{
	int n,i,mx,cnt;
	char s[101];
	scanf("%d",&n);
	scanf(" %s",s);
	mx=0;	cnt=0;
	for(i=0;i<n;i++)	{
		if(s[i]=='I')	cnt++;
		else cnt--;
		mx=max(mx,cnt);
	}
	printf("%d\n",mx);
	return 0;
}

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


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

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

int l[105];

int main() {
  int n;
  scanf("%d", &n);
  n *= 2;
  for(int i = 0; i < n; i++) {
    scanf("%d", &l[i]);
  }
  sort(l, l+n);
  int ret = 0;
  for(int i = n-2; i >= 0; i-=2) {
    ret += l[i];
  }
  printf("%d\n", ret);
  return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

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

    double ans = 0;
    exrep(i, 1, n) {
        ll x = i;
        ll p = 1;
        while(x < k) {
            x*= 2;
            p *= 2;
        }
        ans += 1.0/(double)p;
    }

    ans /= (double)n;

    exout(ans);
    re0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
int main() {
    int n,r=0,b=0;
    string s;
    cin >> n>>s;
    for (int i=0;i<n;i++){
        if(s.at(i)=='R') r++;
        else b++;
    }
    if(r>b) cout<<"Yes"<<endl;
    else cout <<"No"<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rrep(i, n) for(int i=n-1; i>=0; i--)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define eb emplace_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const ll MAX = 1000010;
ll maisu[MAX];

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

    for (int i = 1; i < MAX; i++) {
        maisu[i] = maisu[i-1] + a;
        if (i % 7 == 0) maisu[i] += b;
    }
    rep(i, MAX) {
        if (maisu[i] >= c) {
            cout << i << endl;
            return 0;
        }
    }
}



Measured memory_bytes: 10936
// abc127_d
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF ((1 << 29)-1)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif

    int N, M;
    cin >> N >> M;
    vector<ll> A(N);
    REP(i, N) cin >> A[i];
    vector<P> CB(M);
    REP(j, M) cin >> CB[j].second >> CB[j].first;

    sort(ALL(A));
    sort(ALL(CB), greater<P>());

    int k = 0;
    REP(j, M){
        int b = CB[j].second;
        int c = CB[j].first;

        REP(i, b){
            if (A[k] > c) break;
            A[k] = c;
            k++;
        }
    }

    ll ans = accumulate(ALL(A), 0ll);
    print(ans);

    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store") // to restrict undesirable precision
#pragma GCC optimize ("-fno-defer-pop")// to pop argument of function as soon as it returns
#define all(a) a.begin(),a.end()
#define ll long long int
#define ld long double
ll power(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=power(a,b/2,m)%m; t=(t*t)%m; if(b&1) t=((t%m)*(a%m))%m; return t;}
ll modInverse(ll a, ll m) { return power(a, m-2, m); }
#define ps push_back
#define fs first
#define takeline cin.ignore();
#define sc second
#define N 3000005
#define endl "\n"
#define mod 1000000007
//((1.0l)*BIG MULTIPLY MAGIC?)
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();
//-----------------------------------------------
int main(){

	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	
	ll i,j,k,l,n;
	cin>>n>>k;
	ll fl[10]={0};
	for(i=1;i<=k;i++){
		cin>>l;
		fl[l]=1;
	}

	for(i=n;;i++){
		k=i; l=1;
		while(k>0){
			if(fl[(k%10)]==1){
				l=0;
				break;
			}
			k=k/10;
		}
		if(l){
			cout<<i;return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define repr(i, a, b) for(ll i = (a); i < (b); i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
const ll MOD = 1000000007;
const ll INF = 100000000000000000LL;
inline ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; }
inline ll LCM(ll a, ll b){ return a/GCD(a, b)*b; }
inline ll powint(ll x, ll y){ ll r=1; while(y){ if(y&1) r*=x; x*=x; y>>=1; } return r; }
inline ll powmod(ll x, ll y, ll m = MOD){ ll r=1; while(y){ if(y&1) r*=x; x*=x; r%=m; x%=m; y>>=1; } return r; }
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(b<a) { a=b; return 1; } return 0; }
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll n;
    cin >> n;
    ll ans = 0;
    repr(i, 1, min(10ll, n+1)) ans++;
    repr(i, 100, min(1000ll, n+1)) ans++;
    repr(i, 10000, min(100000ll, n+1)) ans++;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <numeric>
#include <string>
#include <functional>

using namespace std;

int main(void){
    int X,Y,Z,K;
    cin>>X>>Y>>Z>>K;

    vector<long long> A(X);
    vector<long long> B(Y);
    vector<long long> C(Z);

    for(int i=0;i<X;i++){
        cin>>A[i];
    }
    for(int i=0;i<Y;i++){
        cin>>B[i];
    }
    for(int i=0;i<Z;i++){
        cin>>C[i];
    }
    sort(A.begin(),A.end(),greater<long long>());
    sort(B.begin(),B.end(),greater<long long>());
    sort(C.begin(),C.end(),greater<long long>());

    vector<long long> AB;
    for(int i=0;i<X;i++){
        for(int k=0;k<Y;k++){
            AB.push_back(A[i]+B[k]);
        }
    }
    sort(AB.begin(),AB.end(),greater<long long>());

    vector<long long> ABC;
    int minXYK=min(X*Y,K);
    for(int i=0;i<minXYK;i++){
        for(int k=0;k<Z;k++){
            ABC.push_back(AB[i]+C[k]);
        }
    }
    sort(ABC.begin(),ABC.end(),greater<long long>());

    for(int i=0;i<K;i++){
        cout<<ABC[i]<<endl;
    }

    return 0;
}

Measured memory_bytes: 43240
#include <iostream>
using namespace std;
#define INFTY  (1 << 30)//极大值
#define NIL  -1
const int TOTAL = 101;
int totalnode,color[TOTAL], matrix[TOTAL][TOTAL], DistanceBetweenParent[TOTAL], parent[TOTAL];//颜色0白色，1为灰色，2是黑色
void includeMinimumSpanningTree()
{
	int u,min;
	DistanceBetweenParent[0] = 0;//这个点到其父节点的距离为0
	parent[0] = -1;//根的父节点为-1
	while (1)
	{
		min = INFTY;
		for (int i = 0; i < totalnode; i++)//找出非黑色同时到父节点加权值最少的节点
			if (color[i] != 2 && DistanceBetweenParent[i] < min)//第一次只有根
				min = DistanceBetweenParent[i], u = i;//以u寻找连接它的其他点
		color[u] = 2;//u的颜色为黑色
		if (min == INFTY)break;//寻找结束
		for (int i = 0; i < totalnode; i++)//寻找相连的点
		{
			if (color[i] != 2 && matrix[u][i]!= -1)//未发现且存在边
			{
				if (matrix[u][i] < DistanceBetweenParent[i])//当前点连接父节点的加权值大于新的加权值
				{
					color[i] = 1;//灰色
					DistanceBetweenParent[i] = matrix[u][i];
					parent[i] = u;
				}
			}
		}
	}
}
int main()
{	
	int inputdata,minmum=0;
	cin >> totalnode;
	for (int i = 0; i < totalnode; i++)color[i] = 0;//颜色初始化
	for(int i = 0; i < totalnode; i++)DistanceBetweenParent[i] = INFTY;//将距离初始化为最大值
	for (int i = 0; i < totalnode; i++)//顶点i 到顶点j的距离，不存在的为-1；
		for (int j = 0; j < totalnode; j++)
			cin >> inputdata, matrix[i][j] = inputdata;
	includeMinimumSpanningTree();
	for (int i = 0; i < totalnode; i++)
		minmum += DistanceBetweenParent[i];
	cout << minmum << endl;

}


Measured memory_bytes: 3112
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <bitset>
#include <climits>
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define RFOR(i,a,b) for (int i=(a)-1;i>=(b);i--)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const int INF = 1e9;
const ll LL_INF = 1e18;
const int MOD = 1e9 + 7;

using namespace std;

struct Cake {
  int A, B;
};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  Cake a[100005];
  REP(i,N){
    int A, B;
    cin >> A >> B;
    a[i] = {A, B};
  }
  sort(a, a + N, [](const Cake& a, const Cake& b){
      return a.A + a.B > b.A + b.B;
    });
  ll ans = 0;
  REP(i,N){
    if(i % 2 == 0) ans += a[i].A;
    else ans -= a[i].B;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
    public static void main(String[] args)throws IOException {
        BufferedReader br=new BufferedReader (new InputStreamReader(System.in));
        int n,s=0;
        String[] str;
        long[] hen=new long[3];
        n=Integer.parseInt(br.readLine());
        StringBuilder out=new StringBuilder();
        for(int i=0;i<n;i++){
            str=br.readLine().split(" ");
            long max=0;
            for(int j=0;j<3;j++){
                hen[j]=Integer.parseInt(str[j]);
                if(max<hen[j]){  max=hen[j]; s=j;}
            }
            hen[s]=0;
            if(max*max == hen[0]*hen[0]+hen[1]*hen[1]+hen[2]*hen[2]){
                out.append("YES" + "\n");
            }else out.append("NO"+"\n");
        }
        out.delete(out.length()-1,out.length());
        System.out.println(out);
    }
}

Measured memory_bytes: 25324
// C - Divide the Problems

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const int MOD = 1e9 + 7;

int d[100000];

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

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

	sort(d, d+N);

	int half = N / 2;

	int ans = d[half] - d[half-1];

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 640
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;

typedef long long LL;
const int N = 510;
const LL inf = 1LL<<60;
const double eps = 1e-6;
int n, Ma, Mb; LL ans = inf, f[2][N][N]; double lim;

//inline double abs(double x) {return x <= -eps ? -x : x;}
//template <class T> inline T max(T a, T b) {return a > b ? a : b;}
//template <class T> inline T min(T a, T b) {return a < b ? a : b;}
template <class T> inline void in(T &x) {
	x = 0; LL f = 1; char ch = getchar();
	for (; ch<'0' || ch>'9';) {if (ch=='-') f=-1; ch = getchar();}
	for (; ch>='0' && ch<='9';) x = x*10 + ch-'0', ch = getchar();
	x *= f;
}

inline void init(int now) {
	for (int i = 0; i < N; ++i)
		for (int j = 0; j < N; ++j) f[now][i][j] = inf;
}

inline void work() {
	int a, b, now = 0, pre = 1; LL c;
	in(n), in(Ma), in(Mb); init(0), f[0][0][0] = 0;
	for (int l = 1; l <= n; ++l) {
		in(a), in(b), in(c);
		now ^= 1, pre = now^1, init(now);
		for (int i = 0; i < N; ++i)
			for (int j = 0; j < N; ++j) {
				if (f[pre][i][j] == inf) continue;
				f[now][i][j] = min(f[now][i][j], f[pre][i][j]);
				f[now][i+a][j+b] = min(f[now][i+a][j+b], f[pre][i][j] + c);
			}
	}
	double tmp; lim = ((double)Ma / (double)Mb);
	for (LL i = 0; i < N; ++i)
		for (LL j = 0; j < N; ++j) {
			tmp = ((double)i / (double)j);
			if (abs(tmp - lim) < eps) ans = min(ans, f[now][i][j]);
		}
	printf("%lld\n", ans < inf ? ans : -1);
}

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

Measured memory_bytes: 4224
using System;
using System.Collections.Generic;
using System.Linq;
using BitArray = System.Collections.BitArray;
using BigInteger = System.Numerics.BigInteger;

namespace AtCoderProject
{
    public class Program
    {
        public object Calc()
        {
            //var line = consoleReader.SplitInt32();
            var N = consoleReader.Int32();
            var line = consoleReader.SplitInt32();
            var T = line[0];
            var A = line[1];
            var h = consoleReader.SplitInt32();

            double min = int.MaxValue;
            var index = -1;
            for (int i = 0; i < N; i++)
            {
                var temp = T - h[i] * 0.006;
                var diff = Math.Abs(A - temp);
                if (diff < min)
                {
                    min = diff;
                    index = i;
                }
            }
            return index + 1;
        }

        IEnumerable<long> GetYakusu(long num)
        {
            long amari;
            var sqrt = (long)Math.Sqrt(num);
            for (long l = 1; l <= sqrt; l++)
            {
                var d = Math.DivRem(num, l, out amari);
                if (amari == 0)
                {
                    yield return l;
                    yield return d;
                }
            }
        }

        private readonly ConsoleReader consoleReader;
        public Program() : this(new ConsoleReader()) { }
        public Program(ConsoleReader consoleReader) { this.consoleReader = consoleReader; }
        static void Main() => Console.WriteLine(new Program().Calc());
        public static string MultiLine<T>(IEnumerable<T> source) => string.Join("\n", source);
    }

    public class ConsoleReader { public virtual string String() => Console.ReadLine(); public int Int32() => int.Parse(String()); public long Int64() => long.Parse(String()); public ulong UInt64() => ulong.Parse(String()); public double Double() => double.Parse(String()); public string[] Split() => String().Split().ToArray(); public int[] SplitInt32() => String().Split().Select(int.Parse).ToArray(); public long[] SplitInt64() => String().Split().Select(long.Parse).ToArray(); public ulong[] SplitUInt64() => String().Split().Select(ulong.Parse).ToArray(); public double[] SplitDouble() => String().Split().Select(double.Parse).ToArray(); public IEnumerable<string> Repeat(int count) { for (int i = 0; i < count; i++) yield return String(); } public IEnumerable<int> RepeatInt32(int count) { for (int i = 0; i < count; i++) yield return Int32(); } public IEnumerable<long> RepeatInt64(int count) { for (int i = 0; i < count; i++) yield return Int64(); } public IEnumerable<string[]> RepeatSplit(int count) { for (int i = 0; i < count; i++) yield return Split(); } public IEnumerable<int[]> RepeatSplitInt32(int count) { for (int i = 0; i < count; i++) yield return SplitInt32(); } }
}

Measured memory_bytes: 13340
s = gets.chomp
a = 0
s.size.times do |i|
    a += 1 if (s[i] == "0") == (i%2 == 0)
end
b = 0
s.size.times do |i|
    b += 1 if (s[i] == "0") == (i%2 == 1)
end
puts [a,b].min

Measured memory_bytes: 1916
# coding: utf-8

import heapq


def coord_on_edge(x, y, R, C):
    if y == 0:
        return x
    if x == R:
        return R + y
    if y == C:
        return R + C + R - x
    if x == 0:
        return 2 * (R + C) - y
    return None


def on_edge(x1, y1, x2, y2, R, C, i, edge_points):
    c1 = coord_on_edge(x1, y1, R, C)
    c2 = coord_on_edge(x2, y2, R, C)
    if c1 is not None and c2 is not None:
        heapq.heappush(edge_points, (c1, i))
        heapq.heappush(edge_points, (c2, i))


def solve():
    R, C, N = map(int, input().split())
    edge_points = []            # (coord, point#)
    for i in range(N):
        x1, y1, x2, y2 = map(int, input().split())
        on_edge(x1, y1, x2, y2, R, C, i, edge_points)
    q = []
    while edge_points:
        c, i = heapq.heappop(edge_points)
        # print((c, i))           # dbg
        if len(q) and q[-1] == i:
            q.pop()
        else:
            q.append(i)
    if len(q):
        return "NO"
    return "YES"


print(solve())


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

using namespace std;

#define intt long long
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int N = 100005;

int n;
int a[N];

bool is_pal (int n) {
	string ans = "";
	while (n > 0) {
		ans += char(n % 10 + '0');
		n /= 10;
	}
	reverse(ans.begin(), ans.end());
	string rs = ans;
	reverse(rs.begin(), rs.end());
	return (rs == ans);
}

int main() {

	FAST;

	int a, b;
	cin >> a >> b;
	int ans = 0;
	for (int i = a; i <= b; i ++) {
		ans += is_pal(i);
	}	
	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 256
//#define NDEBUG
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <iostream>
#include <utility>
#include <vector>

namespace n91 {

using i8 = std::int_fast8_t;
using i32 = std::int_fast32_t;
using i64 = std::int_fast64_t;
using u8 = std::uint_fast8_t;
using u32 = std::uint_fast32_t;
using u64 = std::uint_fast64_t;
using isize = std::ptrdiff_t;
using usize = std::size_t;

struct rep {
  struct itr {
    usize i;
    constexpr itr(const usize i) noexcept : i(i) {}
    void operator++() noexcept { ++i; }
    constexpr usize operator*() const noexcept { return i; }
    constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
  };
  const itr f, l;
  constexpr rep(const usize f, const usize l) noexcept
      : f(std::min(f, l)), l(l) {}
  constexpr auto begin() const noexcept { return f; }
  constexpr auto end() const noexcept { return l; }
};
struct revrep {
  struct itr {
    usize i;
    constexpr itr(const usize i) noexcept : i(i) {}
    void operator++() noexcept { --i; }
    constexpr usize operator*() const noexcept { return i; }
    constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
  };
  const itr f, l;
  constexpr revrep(const usize f, const usize l) noexcept
      : f(l - 1), l(std::min(f, l) - 1) {}
  constexpr auto begin() const noexcept { return f; }
  constexpr auto end() const noexcept { return l; }
};
template <class T> auto md_vec(const usize n, const T &value) {
  return std::vector<T>(n, value);
}
template <class... Args> auto md_vec(const usize n, Args... args) {
  return std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
}
template <class T> constexpr T difference(const T &a, const T &b) noexcept {
  return a < b ? b - a : a - b;
}
template <class T> void chmin(T &a, const T &b) noexcept {
  if (b < a)
    a = b;
}
template <class T> void chmax(T &a, const T &b) noexcept {
  if (a < b)
    a = b;
}
template <class F> class fix_point : private F {
public:
  explicit constexpr fix_point(F &&f) : F(std::forward<F>(f)) {}

  template <class... Args>
  constexpr decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, std::forward<Args>(args)...);
  }
};
template <class F> constexpr decltype(auto) make_fix(F &&f) {
  return fix_point<F>(std::forward<F>(f));
}
template <class T> T scan() {
  T ret;
  std::cin >> ret;
  return ret;
}

} // namespace n91
#include <array>
#include <map>
#include <string>

namespace n91 {

void main_() {
  /*
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  //*/
  const usize n = scan<usize>();
  bool f = true;
  for (const usize i : rep(0, n)) {
    const u32 a = scan<u32>();
    if (a % 2 == 0 && a % 3 != 0 && a % 5 != 0)
      f = false;
  }
  std::cout << (f ? "APPROVED" : "DENIED") << std::endl;
}

} // namespace n91

int main() {
  n91::main_();
  return 0;
}


Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
 
#define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define cout_precision cout.setf(ios::fixed); cout.precision(32);
#define clr(a) memset(a,0,sizeof(a))
#define umap unordered_map
#define uset unordered_set
#define fr first
#define sc second
#define pb push_back
#define M int(1e9+7)


using ll = int64_t; using vll = vector<ll>; using vvll = vector<vll>;
using pll = pair<ll, ll>; using vpll = vector<pll>; using vvpll = vector<vpll>;


int main(){
	fast_io; cout_precision;
	double a,b;	cin >>a >>b;
	cout<<int(ceil((b-1)/(a-1)));
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n;
string s;
bool used_l[30];
bool used_r[30];
int cnt;
int maxcnt=-1;
int main()
{
	cin>>n>>s;
	for(int i=0;i<s.size();i++)
	{
		cnt=0;
		memset(used_l,false,sizeof(used_l));
		memset(used_r,false,sizeof(used_r));
		for(int j=0;j<=i;j++)
		{
			if(!used_l[s[j]-'a']) used_l[s[j]-'a']=true;
		}
		for(int j=i+1;j<s.size();j++)
		{
			if(!used_r[s[j]-'a']) used_r[s[j]-'a']=true;
		}
		for(int j=0;j<26;j++)
		{
			if(used_l[j]==true&&used_r[j]==true) cnt++;
		}
		if(cnt>maxcnt) maxcnt=cnt;
	} 
	cout<<maxcnt;
}


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

template<typename T_char>
T_char ToUpper(T_char cX){return toupper(cX);}

int main(){
  int q, h, s, d, n;
  cin >> q >> h >> s >> d >> n;

  ll cpq = q*8, cph = h*4, cps = s*2, cpd = d;
  ll mn;
  mn = min(cpd, min(cps, min(cpq, cph)));
  ll ans = (n/2) * mn + n%2 * min(4*q,min(2*h, s));
  cout << ans << endl;
}

Measured memory_bytes: 3608
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <iomanip>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstdint>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

int main() {
    int A, B;
    cin >> A >> B;
    for(int i = 1; i <= 10100; i++) {
        if((i * 8) / 100 == A && (i * 10) / 100 == B) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define int long long
#define _GLIBCXX_DEBUG

signed main() {
  int N; cin >> N;
  vector<int> X(N);
  rep(i, N) cin >> X[i];
  vector<int> Y = X;
  
  sort(all(Y));
  int y = Y[(N-2)/2], z = Y[N/2];
  
  rep(i, N) cout << (X[i]<=y ? z : y) << endl;
  

}

Measured memory_bytes: 5376
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
ll h, w, n;
ll check(ll x, ll y, ll i, ll j, map<pair<ll, ll>, ll> &mp) {
    ll count = 0;
    for(ll k = x - i; k < x - i + 3; k++) {
        for(ll l = y - j; l < y - j + 3; l++) {
            if(k < 0 || k >= h || l < 0 || l >= w) {
                return -1;
            } else {
                if(mp.find(make_pair(k, l)) != mp.end()) {
                    count++;
                }
            }
        }
    }
    return count;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> h >> w >> n;
    map<pair<ll, ll>, ll> mp;
    for(int i = 0; i < n; i++) {
        ll a, b;
        cin >> a >> b;
        a--, b--;
        mp[make_pair(a, b)] = 1;
    }
    vector<ll> ans(10, 0);
    for(auto e : mp) {
        ll x = e.first.first;
        ll y = e.first.second;
        // cout << x << ":" << y << endl;
        for(ll i = 0; i < 3; i++) {
            for(ll j = 0; j < 3; j++) {
                ll count = check(x, y, i, j, mp);
                if(count != -1) {
                    ans[count]++;
                }
            }
        }
    }
    ll sum = 0;
    for(int i = 1; i < 10; i++) {
        ans[i] /= i;
        sum += ans[i];
    }
    ans[0] = (h - 2) * (w - 2) - sum;
    for(auto e : ans) {
        cout << e << endl;
    }
}


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


#define mx 100005
#define ll long long 

void IO()
{
  #ifndef ONLINE_JUDGE
  freopen("in.txt","r",stdin);
  freopen("out.txt","w",stdout);
  #endif
}


int ar[mx];
char ch[mx];
int m,n,k,ii;
vector<int>mp;
vector<ll>v;
ll csum[mx];
void solve()
{
   ll a,b,c;
   scanf("%lld%lld%lld",&a,&b,&c);
   mp.push_back(b);
   ar[b]++;
   ll ace=0;
   ll st=0;
   for(ll i=2;i<=a;i++)
   {
      b*=b;
      b%=c;

      if(ar[b]>0)
        {

           ace=a-i+1;
           st=b;
           break;
       }
       mp.push_back(b);
       ar[b]++;
   }
   int idx=-1;
   int cnt=1;
   for(auto it:mp)
   {
   
      v.push_back(it);
      csum[cnt]=csum[cnt-1]+it;
      if(ace>0 && st==it)
      {
        idx=cnt;
      }
      cnt++;
   }
  // cout<<idx<<" "<<st<<endl;
   ll re=csum[cnt-1];
   if(ace>0)
   {
       ll barti=cnt-idx;
       ll ex=csum[cnt-1]-csum[idx-1];
       ll koto=ace/barti;
       int nibo=ace%barti;
       re+=ex*koto;
       for(int i=1;i<=nibo;i++)
       {
         re+=v[idx+i-2];
       }


   }
   printf("%lld\n",re );

}

int main()
{
   IO();
  int t=1;
  //scanf("%d",&t);
  while(t--)
  {
    solve();
  }
  return 0;
}

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

#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()

typedef long long ll;

const char nl = '\n' ;
const ll MOD = 1e9 + 7;

bool check(string s)
{
   int k = s.size()/2;
   for(int i = 0; i <k; i++)
   {
      if(s[i] != s[i+k])
         return false;
   }
   return true;
}
int main()
{
   ios_base::sync_with_stdio(0); cin.tie(0);
   int n, m; cin >> n >> m;
   cout << (n-1)*(m-1) << nl;
}


Measured memory_bytes: 3632
#include<stdio.h>
int main(){
    int i=0;
    char s[3];
    scanf("%s",s);

    if(s[0]=='1')i++;
    if(s[1]=='1')i++;
    if(s[2]=='1')i++;
    printf("%d",i);
   
    
    return 0;
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;

int main() {
	ll n, a,pos=0,index=0;
	ll k;
	cin >> n >> k;
	set<int>cycle;
	vector<int>city;
	vi tere;
	rep(i, n) {
		cin >> a;
		city.push_back(--a);
	}
	pos = 0;
	for (int s:city) {
		cycle.insert(pos);
		tere.push_back(pos);
		pos = city[pos];
		if (cycle.count(pos))break;
	}
	for (int s : tere) {
		if (s == pos) break;
		else index++;
	}
	if (k <= index) {
		cout << tere[k] + 1 << endl;
	}
	else {
		k -= index;
		cout << tere[index + (k % (tere.size() - index))] + 1 << endl;
	}
	return 0;
}


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

namespace AtCoder
{
	class Program
	{
		static void Main(string[] args)
		{
            var firstLine = Console.ReadLine().Split(' ').Select(value => int.Parse(value)).ToList();
			var k = firstLine[0];
			var n = firstLine[1];

			var aList = Console.ReadLine().Split(' ').Select(value => int.Parse(value)).ToList();

			var min = int.MaxValue;

			for(int i = 0; i < n; i++)
			{
				if(i == 0)
				{
					min = Math.Min(min, aList[n - 1] - aList[0]);
				}
				else
				{
					min = Math.Min(min, aList[i - 1] + k - aList[i]);
				}
			}

            Console.WriteLine(min);
		}
	}
}


Measured memory_bytes: 34780
while True:
 
    x, y, z = input().split()
    l = int(x)
    r = int(z)
    if y == '+':
        print(l + r)
    elif y == '-':
        print(l - r)
    elif y == '/':
        print(l // r)
    elif y == '*':
        print(l * r)
    else:
        break

Measured memory_bytes: 7592
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <algorithm>
#include <utility>
#include <numeric>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <limits>
#include <cassert>
#include <bitset>
#include <list>
#include <iomanip>
#include <cctype>

#define for0(i, N)    for (long long i = 0  ; i <  (N); ++i)
#define for1n(i, N)   for (long long i = 1  ; i <= (N); ++i)
#define for1(i, N)    for (long long i = 1  ; i <  (N); ++i)
#define forn(i, N)    for (long long i = 0  ; i <= (N); ++i)
#define forx(i, N, x) for (long long i = (x); i <  (N); ++i)
#define forl(i, N, x, a) for (long long i = (x), a = 0; a < (N);    \
                              i = (i + 1) % (N), ++a)
#define int long long

template<size_t i>
std::bitset<i> operator++(std::bitset<i> b, signed){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    return b = (unsigned long long)b + 1;
}

template<size_t i>
std::bitset<i> operator++(std::bitset<i> b){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    auto temp = b;
    b++;
    return temp;
}

template<size_t i>
std::bitset<i> operator--(std::bitset<i> b, signed){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    return b = (unsigned long long)b - 1;
}

template<size_t i>
std::bitset<i> operator--(std::bitset<i> b){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    auto temp = b;
    b--;
    return temp;
}

long long constexpr inf = std::numeric_limits<long long>::max();

using namespace std;

typedef long long ll;
typedef long double ld;
typedef priority_queue<ll> pq;
typedef priority_queue<ll,vector<ll>, greater<ll>> pql;
typedef stack<ll> stk;
typedef queue<ll> qu;
typedef pair<ll, ll> pll;
typedef map<ll, ll> mll;
typedef unordered_map<ll, ll> umll;
typedef set<ll> sll;
typedef unordered_set<ll> usll;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<vector<ll>> vvll;


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

    int a, b;

    cin >> a >> b;

    vll v8(1001), v10(1001);

    forn(i, 1000){
        v8[i] = i * 0.08;
        v10[i] = i * 0.1;
    }

    auto x = lower_bound(v8.begin(), v8.end(), a);
    auto y = lower_bound(v10.begin(), v10.end(), b);

    if (*x != a || * y != b) {
        cout << -1;
        return 0;
    }

    auto xx = distance(v8.begin(), x);
    auto yy = distance(v10.begin(), y);

    if (xx < yy) {
        if(v8[yy] == a)cout << yy;
        else cout << -1;
    } else {
      if (v10[xx] == b) cout << xx;
      else cout << -1;
    }

    return 0;
}


Measured memory_bytes: 256
def I(): return int(input())
def LI(): return list(map(int,input().split()))
N = I()
AB = [LI() for _ in range(N)]
ans,max = 0,0
for x in AB:
    a,b = x[0],x[1]
    if a>max:
        max = a
        ans = a+b
print(ans)


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

int main(){
  int N;
  std::cin >> N;

  std::vector<int> h_arr(N);
  for(int i = 0; i < N; i++) std::cin >> h_arr[i];

  for(int i = N-2; i >= 0; i--){
    if(h_arr[i] > h_arr[i+1]) h_arr[i]--;
    if(h_arr[i] > h_arr[i+1]){
      std::cout << "No" << std::endl;
      return 0;
    }
  }
  std::cout << "Yes" << std::endl;

  return 0;
}



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

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int a[] = new int[3];

		for (int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
		}
		sc.close();

		Arrays.sort(a);

		System.out.print(a[2] * 10 + a[1] + a[0]);
	}
}


Measured memory_bytes: 22228
#include <iostream>

int main() {
  int n; std::cin >> n;
  long long sum = 0;
  for (int i = 1; i <= n; ++i) {
    if (i%3 == 0 || i%5 == 0) continue;
    sum += i;
  }
  std::cout << sum << std::endl;
  
  return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N,Y;
    cin >> N >> Y;

bool fin=false;

    for(int i=0;i<(Y/10000)+1;i++){
        for(int j=0;j<((Y-10000*i)/5000)+1;j++){
            if(((Y-10000*i-5000*j)/1000)+i+j==N){
                cout << i << " " << j << " " << (Y-10000*i-5000*j)/1000 <<endl;
                fin = true; 
                break;
            }
        }
        if(fin==true)break;
    }

    if(fin==false){
        cout <<"-1 -1 -1" << endl;
    }
}

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

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

    if(S[0]==S[1]&& S[1]==S[2]){
        cout << "No"<< endl;
        return 0;
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
#define OUT(n) cout << (n) << endl;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;

int main(void)
{
    IOS
    int a, b;
    cin >> a >> b;
    cout << a*b << " " << (a+b)*2 << endl;

    return 0;
}


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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)     (a).begin(),(a).end()
#define RALL(a)     (a).rbegin(),(a).rend()
#define PRINT(a)   cout << (a) << endl

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second

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

using ll = long long int;
using P = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;

template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

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 (b<a) { a=b; return 1; } return 0; }

const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;

int main(){
  string s;
  cin >> s;
  map<char,int> mp;
  for(auto c: s)mp[c]++;
  bool ok=true;
  for(auto v: mp){
    if(v.second != (s.size() + 2)/3 && v.second != (s.size() + 2)/3-1)ok=false;
  }

  cout << (ok ? "YES" : "NO") << endl;
}



Measured memory_bytes: 3756
#include<bits/stdc++.h>
using namespace std;
int main (){
  int N;
  cin >> N;
  int vec[N];
  int a, count = 0;
  string ans = "DENIED";
  for(int i = 0; i < N; i++){
    cin >> vec[i];
    if(vec[i] % 2 == 0){
      a++;
    }
    if(vec[i] % 2 == 0 && vec[i] % 3 == 0){
      count++;
    }
    else if(vec[i] % 2 == 0 && vec[i] % 5 == 0){
      count++;
    }
  }
  if(count == a){
    ans = "APPROVED";
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<time.h>
#include<set>
#include<map>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i>b;i--)
#define vint vector<int> 
#define vvint vector<vint>
#define ct(a) cout<<a<<endl
#define tget(a,b) get<a>(b)
using namespace std;
typedef long long ll;
const ll INF = 1e17;
const int MOD = 1e9 + 7;

int a, b;

int main(void) {
	cin >> a >> b;
	if (a + b >= 10)ct("error");
	else ct(a + b);
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define sort(a)         sort((a).begin(), (a).end())
#define uniq(a)         SORT(a);(a).erase(unique((a).begin(), (a).end()), (a).end())
#define reverse(a)      reverse((a).begin(), (a).end())
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define Yes()           printf("Yes\n")
#define No()            printf("No\n")
#define YES()           printf("YES\n")
#define NO()            printf("NO\n")
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }

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

const ll MOD = 1000000007; // 10^9 + 7

void solve() {
  int x, a, b; cin >> x >> a >> b;
  x -= a;
  x -= (x / b) * b;
  outl(x);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}


Measured memory_bytes: 888
#include<stdio.h>
int main(){
int W,H,x,y,r;
scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
if(x+r>W||x-r<0||y+r>H||y-r<0)
printf("No\n");
else
printf("Yes\n");
}

Measured memory_bytes: 1012
// Author: 23forever
#include <bits/stdc++.h>
#define pii pair<int, int>
#define mp make_pair
#define fi first
#define se second
typedef long long LL;
const int MAXN = 1000;
const int MOD = 1e9 + 7;
using namespace std;

inline int read() {
  int x = 0, w = 1;
  char c = ' ';

  while (c < '0' || c > '9') {
    c = getchar();
    if (c == '-') w = -1;
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }

  return x * w;
}

int a[MAXN + 5][MAXN + 5], n, m, dp[MAXN + 5][MAXN + 5];

void init() {
  n = read();
  m = read();
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      char c = getchar();
      while (c != '.' && c != '#') c = getchar();
      a[i][j] = (c == '#');
    }
  }
}

int dfs(int x, int y) {
  if (~dp[x][y]) return dp[x][y];
  if (x == n && y == m) return 1;

  int &ret = dp[x][y] = 0;
  if (y + 1 <= m && !a[x][y + 1]) ret = (ret + dfs(x, y + 1)) % MOD;
  if (x + 1 <= n && !a[x + 1][y]) ret = (ret + dfs(x + 1, y)) % MOD; 
  return ret;
}

int main() {
#ifdef forever23
  freopen("test.in", "r", stdin);
  //freopen("test.out", "w", stdout);
#endif
  init();

  memset(dp, -1, sizeof(dp));
  printf("%d\n", dfs(1, 1));
  return 0;
}

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

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<pair<int, int>, int> PP;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;

//------------------------------------------------------------------------------------------------------------------------------

int main(void) { 
    int H, W, K;
    cin >> H >> W >> K;
    int ans[310][310];
    int cnt = 0;
    for (int i = 0; i < H; i++) {
        for(int j = 0; j < W; j++) {
            char s;
            cin >> s;
            if (s == '#') ans[i][j] = ++cnt;
        }
    }
    for(int i = 0; i < H; i++) {
        for(int j = 1; j < W; j++) {
            if (ans[i][j] == 0) ans[i][j] = ans[i][j - 1];
        }
    }
    for(int i = 0; i < H; i++) {
        for(int j = W-2; j >= 0; j--){
            if (ans[i][j] == 0) ans[i][j] = ans[i][j + 1];
        }
    }
    for(int i = 0; i < W; i++) {
        for(int j = 1; j < H; j++) {
            if (ans[j][i] == 0) ans[j][i] = ans[j - 1][i];
        }
    }
    for(int i = 0; i < W; i++) {
        for(int j = H-2; j >= 0; j--) {
            if (ans[j][i] == 0) ans[j][i] = ans[j + 1][i];
        }
    }
    for(int i = 0; i < H; i++) {
        for(int j = 0; j < W; j++) {
            cout << ans[i][j] << ' ';
        }
        cout << endl;
    }
}


Measured memory_bytes: 1152
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define lPair pair<ll,ll>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
ll N,W;
ll w[101],v[101];
int main(){
    cin >> N >> W;
    for(ll i = 1; i <= N; i++) cin >> w[i] >> v[i];

    ll dp[101][100100] = {0};
    dp[0][0] = 0;
    for(ll i = 0; i < N; i++){
        for(ll j = 0; j <= W; j++){
            dp[i+1][j] = dp[i][j];
            if(j >= w[i+1]){
                dp[i+1][j] = max(dp[i+1][j],dp[i][j-w[i+1]]+v[i+1]);
            } else {
                dp[i+1][j] = dp[i][j];
            }
        }
    }
    ll mx = 0;
    for(ll i = 0; i <= W; i++){
        mx = max(mx, dp[N][i]);
    }
    cout << mx << endl;
}



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

typedef long long ll;

int main() {
    //ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int n, k;
    cin >> n >> k;

    double ans = 0.0;
    int mx = 0;
    for(int i = 1; i <= n; i++) {
        int t = ceil(log2(k) - log2(i));
        t = max(t, 0);
        ans += 1.0 / (1.0 * n * (1 << t));
    }

    printf("%.12f\n", ans);
}

/**
1 / n * (1/2)^k
*/


Measured memory_bytes: 384
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <string>
#include <stack> // s.top()
#include <bitset>
#include <queue> // s.front()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define print(x) cout<<(x)<<endl
#define INF10 1001001001 
#define INF5 100000
#define EPS 1e-10


int N, M;
vector<vector<int>> g;

int ans;

void dfs(int current, set<int>seen) {
	seen.insert(current);
	if (seen.size() == N) {
		ans++;
		seen.erase(current);
		return;
	}
	else {
		for (int i = 0; i < g[current].size(); i++) {
			int nx = g[current][i];
			if (seen.count(nx) == 0) {
				dfs(nx, seen);
			}
		}
		seen.erase(current);
		return;
	}
}

int main() {
	cin >> N >> M;
	g.assign(N, vector<int>());
	for (int i = 0; i < M; i++) {
		int a, b; cin >> a >> b;
		a--; b--;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	dfs(0, set<int>());

	cout << ans << endl;






	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
    int a,b,i;

    scanf("%d %d",&a, &b);

    if(a < b){
        for(i=0; i<b; i++){
            printf("%d",a);
        }
    } else {
        for(i=0; i<a; i++){
            printf("%d",b);
        }
    }

    printf("\n");

    return 0;
}

Measured memory_bytes: 128