akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main(){
    long n,m,l;
    cin >> n >> m >> l;
    long queue1[n][m];
    long queue2[m][l];
    long queue3[n][l];
    //行列の代入
    for(long i=0; i<n; i++){
        for(long j=0; j<m; j++){
            cin >> queue1[i][j];
        }
    }
    for(long i=0; i<m; i++){
        for(long j=0; j<l; j++){
            cin >> queue2[i][j];
        }
    }
    for(long i=0; i<n; i++){
        for(long j=0; j<l; j++){
            queue3[i][j]=0;
        }
    }
    //行列の計算
    long sum[m];
    for(long i=0; i<n; i++){
        for(long k=0; k<l; k++){
            for(long j=0; j<m; j++){
                queue3[i][k]+=queue1[i][j]*queue2[j][k];
            }
        }
    }
    for(long i=0; i<n; i++){
        for(long k=0; k<l; k++){
            cout << queue3[i][k];
            if(k!=l-1){
                cout << " ";
            }
        }
        cout << endl;
    }
}



Measured memory_bytes: 3296
#include <chrono>

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <time.h>
#include <random>
#include <string>
#include <cassert>
#include <vector>
#include <ostream>
#include <istream>
#include <stack>
#include <deque>
#include <queue>
#include <functional>

using namespace std;

#define int long long
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define pii pair<int, int>
#define ld long double

ostream& operator << (ostream &a, const vector<int> &b) {
    for (auto k : b) cout << k << " ";
    return a;
}

#ifdef LOCAL
    #define dbg(x) cout << #x << " : " << (x) << "\n";
    const int INF = 1e18;
//    const int mod = 2600000069;
//    const int p = 10;
//    const ld PI = 3.1415926535;
#else
    #define dbg(x)
    const int INF = 1e18;
//    const int mod = 2600000069;
//    const int p = 179;
//    const ld PI = 3.1415926535;
#endif

//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,sse3,sse4")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("fast-math")
//#pragma GCC target("avx2")
//#pragma GCC optimize("section-anchors")
//#pragma GCC optimize("profile-values,profile-reorder-functions,tracer")
//#pragma GCC optimize("vpt")
//#pragma GCC optimize("rename-registers")
//#pragma GCC optimize("move-loop-invariants")
//#pragma GCC optimize("unswitch-loops")
//#pragma GCC optimize("function-sections")
//#pragma GCC optimize("data-sections")

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifdef LOCAL
    #else
//        freopen("capitals.in", "r", stdin);
//        freopen("capitals.out", "w", stdout);
    #endif
    int a, b, c;
    cin >> a >> b >> c;
    swap(a, b);
    swap(a, c);
    cout << a << " " << b << " " << c;
}
/*
*/


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

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

    int a, b, c;
    cin >> a >> b >> c;

    if((a < b) and (b < c)){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 3164
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(x) (x).begin(), (x).end()

ll find(ll x, vector<ll>& p)
{
    return (x==p[x]?x:p[x]=find(p[x],p));
}

int main()
{
    ll i,j,n,m;
    cin>>n>>m;
    vector<ll> p(n+1);
    for(i=0;i<=n;i++) p[i] = i;
    vector<ll> sz(n+1,1);
    for(i=0;i<m;i++)
    {
        ll a,b;
        cin>>a>>b;
        a = find(a,p);
        b = find(b,p);
        if(a != b)
        {
        	if(a>b) swap(a,b);
            sz[a]+=sz[b];
            p[b] = a;
        }
    }
    ll ans = 0;
    for(i=1;i<=n;i++)
    {
        ans = max(ans, sz[i]);
    }
    cout<<ans<<"\n";
}

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

int main() {
  string a;
  cin >> a;
  
  if(a.at(0) == a.at(1) || a.at(1) == a.at(2) || a.at(2) == a.at(3)){
    cout << "Bad" << endl;
  }
  
  else{
    cout << "Good" << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
    //cout.precision(10);
    int n;
    cin >> n;
    int zero = 1;
    long long a[200100];
    cin >> a[1];
    if(a[1] != 0){
        cout << -1 << endl;
        return 0;
    }
    long long ans = 0;
    for(int i = 2; i <= n; i++){
        cin >> a[i];
        if(a[i] == 0){
            zero = i;
            continue;
        }
        if(a[i] > i - zero){
            cout << -1 << endl;
            return 0;
        }
        if(a[i] > (a[i - 1] + 1)){
          cout << -1 << endl;
          return 0;
        }
        if(a[i] == a[i - 1] + 1){
            ans++;
            continue;
        }
        ans += a[i];
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,a[2005];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;cin>>s;
    ll n=s.size(),ans=s.size();
    for(ll i=1;i<n;i++){
        if(s[i]!=s[i-1])ans=min(ans,max(i,n-i));
    }
    cout<<ans;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+5;
int X, K, Q, r[maxn], t[maxn], a[maxn], ub, lb, b, t1, t2, add, tmp, diff, sgn;
void Add(int &n, int num){
    n+=num;
    n = max(0, min(X, n));
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> X >> K;
    for(int i = 1; i <= K; i++) cin >> r[i];
    cin >> Q;
    for(int i = 1; i <= Q; i++) cin >> t[i] >> a[i];
    t1 = 0, t2 = 1;
    lb = b = 0, ub = X, sgn = -1;
    while(t2 <= Q){
        if(t[t2] > r[t1+1] && t1 < K){
            t1++;
            add = sgn*(r[t1] - r[t1-1]);
            Add(lb, add); Add(ub, add);
            b+=add;
            sgn*=-1;
        }
        else{
            diff = (t[t2] - r[t1]);
            tmp = max(lb, min(ub, a[t2]+b));
            Add(tmp, diff*sgn);
            cout << tmp << "\n";
            t2++;
        }
    }
    return 0;
}

Measured memory_bytes: 2432
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <math.h>
using namespace std;
typedef long long int ll;

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	ll t; cin >> t;
	vector<ll> v;
	vector<ll> vv;
	v.push_back(1);
	ll a=1;
	for(int i=0;;i++){
		vv.push_back(a);
		a*=3;
		ll k=0;
		for(ll p:vv){
			k+=p*2;
		}
		k+=a;
		if(k<=t){
			v.push_back(k);
		}
		else{
			break;
		}
	}
	ll ans=1e18;
	for(int i=0;i<v.size();i++){
		ll cnt=2*(i+1)-1;
		ll cp=t;
		cp-=v[i];
		for(int j=i;j>=0;j--){
			cnt+=cp/vv[j];
			cp%=vv[j];
		}
		ans=min(ans,cnt);
	}
	vector<ll> f;
	vector<ll> ff;
	f.push_back(0);
	a=1;
	for(int i=0;;i++){
		ff.push_back(a);
		a*=3;
		ll k=0;
		for(ll p:ff){
			k+=p*2;
		}
		k+=a;
		k--;
		if(k<=t){
			f.push_back(k);
		}
		else{
			break;
		}
	}
	for(int i=0;i<f.size();i++){
		ll cnt=2*(i+1)-2;
		ll cp=t;
		cp-=f[i];
		for(int j=i;j>=0;j--){
			cnt+=cp/ff[j];
			cp%=ff[j];
		}
		ans=min(ans,cnt);
	}
	cout << ans << endl;
} 



Measured memory_bytes: 3184
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T> using vec = std::vector<T>;

int main() {
    int X;
    cin >> X;
    ll now = 0;
    ll i   = 1;
    while (true) {
        now += i;
        if (now >= X) {
            cout << i << endl;
            return 0;
        }
        ++i;
    }
}


Measured memory_bytes: 3572
#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(){
    int n;
    cin >> n;

    vector<string> s(n);
    rep(i, n) cin >> s[i];

    map<string, int> mp;
    int maxcount = 0;

    rep(i, n) {
        mp[s[i]]++;
        if(maxcount < mp[s[i]]) maxcount = mp[s[i]];
    }

    for(auto itr = mp.begin(); itr != mp.end(); itr++) {
        if(maxcount == itr->second) cout << itr->first << endl;
    }

    return 0;
}

Measured memory_bytes: 26752
#include <iostream>
#include <map>
#include <queue>
#include <string>

using namespace std;

map<string, bool> mpp1;
map<string, int> mpp2;

struct P{
	int c;
	string str;
	int x;
	int y;
};

int xdir[4] = {0, 1, 0, -1}, ydir[4] = {1, 0, -1, 0};

void func(void)
{
	string str = "";
	char a[2][8];
	queue<P> que;
	for(int i = 0; i < 2; i++){
		for(int j = 0; j < 4; j++){
			str += (char)('0'+(4*i+j));
		}
	}
	P p, q;
	p.str = str;
	p.c = p.x = p.y = 0;
	que.push(p);
	mpp1[str] = true;
	mpp2[str] = 0;
	
	while(!que.empty()){
		p = que.front();
		que.pop();
		for(int i = 0; i < 4; i++){
			int dx = p.x+xdir[i], dy = p.y+ydir[i];
			str = p.str;
			if(0 <= dx && dx < 4 && 0 <= dy && dy < 2){
				char w = str[dx+4*dy];
				str[dx+4*dy] = str[p.x+p.y*4];
				str[p.x+p.y*4] = w;
				if(!mpp1[str]){
					mpp1[str] = true;
					q.c = mpp2[str] = p.c + 1;
					q.str = str;
					q.x = dx;
					q.y = dy;
					que.push(q);
				}
			}
		}
	}
	
	return ;
}

int main()
{
	int n;
	char w;
	string str;
	func();
	
	while(cin>>w){
		str = "";
		str += w;
		for(int i = 1; i < 8; i++){
			cin >> w;
			str += w;
		}
		
		cout << mpp2[str] << endl;
	}
	
	
	return 0;
}

Measured memory_bytes: 3456
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{

	public static void main(String[] args) {

		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


			String line = br.readLine();
			int N = Integer.parseInt(line);
			line = br.readLine();
			int H = Integer.parseInt(line);
			line = br.readLine();
			int W = Integer.parseInt(line);

			int nh = N-H+1;
			int nw = N-W+1;

			System.out.println(nh*nw);
			//String[] strs = line.split(" ");//区切りで変える
			//int[] ia = new int[strs.length]; for(int i = 0;i<strs.length;i++){ia[i] = Integer.parseInt(strs[i]);}Integer.parseInt
			//Java8
			//int[] ia = Stream.of(strs).mapToInt(Integer::parseInt).toArray();


		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}

	}

}


Measured memory_bytes: 20564
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ZYCSwing
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            int l = 0, r = s.length() - 1;
            int res = 0;
            while (l < r) {
                if (s.charAt(l) == s.charAt(r)) {
                    ++l;
                    --r;
                } else if (s.charAt(l) == 'x') {
                    ++l;
                    ++res;
                } else if (s.charAt(r) == 'x') {
                    --r;
                    ++res;
                } else {
                    out.println(-1);
                    return;
                }
            }
            out.println(res);
        }

    }
}



Measured memory_bytes: 24844
#pragma GCC optimize ("O2")
#pragma GCC optimize ("tree-vectorize")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define FFOR(i, a, b) FOR(i, a, b+1)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) FOR(i, 1, n+1)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define LEN(x) (int)(x).size()
#define DUMP(x) cerr<<__LINE__<<' '<<#x<<"="<<(x)<<endl;
#define pb push_back
#define eb emplace_back
#define mp make_pair

using namespace std;
using lint = long long;
using pii =  pair<int, int>;
using pll =  pair<lint, lint>;
template <typename T> using vc = vector<T>;
template <typename T> using vvc = vector<vector<T>>;
template <typename T> inline bool chmax(T &a, T b){if(a<b){a = b; return true;} return false;}
template <typename T> inline bool chmin(T &a, T b){if(a>b){a = b; return true;} return false;}

const double PI = acos(-1);
constexpr lint ten(int n) {return n==0 ? 1 : ten(n-1)*10;}

vector<int> zAlgorithm(string S){
    int n = S.size(), c = 0;
    vc<int> z(n);
    for(int i=1;i<n;++i){
        if(i+z[i-c]<c+z[c]) z[i] = z[i-c];
        else{
            int j = max(0, c+z[c]-i);
            while(i+j<n and S[i+j]==S[j]) ++j;
            z[i] = j;
            c = i;
        }
    }
    z[0] = n;
    return z;
}

class Task{
public:
    void solve(istream& in, ostream& out){
        int N, ans = 0;
        string S;
        in>>N>>S;
        REP(i, N-1){
            string cur = S.substr(i);
            vc<int> z = zAlgorithm(cur);
            REP(j, LEN(z)){
                chmax(ans, min(z[j], j));
            }
        }
        out<<ans<<'\n';
    }
};

int main(){
    istream& in(cin);
    ostream& out(cout);
    ios_base::sync_with_stdio(false);
    in.tie(nullptr), out.tie(nullptr);
    Task solver;
    solver.solve(in, out);
    return 0;
}

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

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

using namespace std;

int main(){
    int A, B;
    int sum = 0;
    cin >> A >> B;
    for (int i=0;i<2;i++){
        if (A > B){
            sum += A;
            A--;
        }else{
            sum += B;
            B--;
        }
    }
    cout << sum << endl;

    return 0;
}



Measured memory_bytes: 256
// https://atcoder.jp/contests/abcXXX/tasks/abcXXX_x

#include <iostream>
#include <vector>
#include <tuple>

using namespace std;
using ll = long long;

struct C {
    vector<ll> v_{};
    explicit C(vector<ll> v) : v_(move(v)){}
    bool resolve() {
        ll N = v_.size();
        for (ll i=1; i < N; ++i) {
            if (v_[i-1] > v_[i]) {
                ++v_[i];
            }
            if (v_[i-1] > v_[i]) {
                return false;
            }
        }
        return true;
    }
};

int main() {
    ll N;
    cin >> N ;
    vector<ll> v{};
    for (int i=0; i < N; ++i) {
        ll x;
        cin >> x;
        v.emplace_back(x);
    }
    C c{move(v)};
    cout << (c.resolve() ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 1400
#include <iostream>
#include<string>
using namespace std;
int main(void){
    // Your code here!
    string S;
    int t=0;
    cin >> S ;
    for(int i=0;i<4;i++){
        if (S[i]=='+'){
            t++; 
    }else{
        t--;
    }
    }
    cout <<t <<endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	long int n;
	int m;
	cin>>n>>m;
	int a[n];
	int i,sum=0;
    for(i=0;i<m;i++){
    	cin>>a[i];
    	sum+=a[i];
	}
	if(sum>n){
		cout<<"-1";
	}
	else{
		cout<<n-sum;
	}
}

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

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string>vst;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
#define all(ct) ct.begin() , ct.end()
#define endl "\n"
#define fr(i,a) for(auto i:a)
#define f(i,a,b) for(int i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>=b;--i)
#define pb push_back
#define in(d,v) d.find(v)!=d.end()
#define mp make_pair
#define size(a) int(a.size())

const ll mod = 1e9 + 7;
const ll inf = ll(4e18);
const double PI = acos(-1);

ll modexp(ll x, ll n, int md) {
    if (n == 0)return 1;
    if (n % 2 == 0)return modexp((x * x) % md, n / 2, md);
    return (x * modexp((x * x) % md, n / 2, md)) % md;
}
int n;
pair<ll,pii>a[15];
ll ans[16];
int ax[16]={0},ay[16]={0},countx=0,county=0;
void road(int i){
    if(i==n){
        int count=countx+county;
        ll curr=0;
        f(i,0,n){
            ll curr1=inf;
            f(j,0,countx+1){
                curr1=min(curr1,a[i].first*abs(ax[j]-a[i].second.first));
            }
            ll curr2=inf;
            f(j,0,county+1){
                curr2=min(curr2,a[i].first*abs(ay[j]-a[i].second.second));
            }
            curr+=min(curr1,curr2);
            if(curr>ans[count])return;
        }
        ans[count]=curr;
        return;
    }
    road(i+1);
    ++countx;ax[countx]=a[i].second.first;
    road(i+1);
    --countx;
    ++county;ay[county]=a[i].second.second;
    road(i+1);
    --county;
}
int main() {
    fastio;
    // clock_t tm = clock();
    int x,y;ll p;
    cin>>n;
    f(i,0,n){
        cin>>a[i].second.first>>a[i].second.second>>a[i].first;
    }
    sort(a,a+n,greater<pair<ll,pii>>());
    f(i,0,n+1)ans[i]=inf;
    road(0);
    f(i,0,n+1)cout<<ans[i]<<endl;
    //cout<<((clock()-tm)*1.0)/CLOCKS_PER_SEC<<endl;
}

Measured memory_bytes: 3652
#include<iostream>
#include<algorithm>
 using namespace std;
 #define N 100010
 int main()
 {
 	int n,m,h[N],ma[N];
 	cin>>n>>m;
 	for(int i=1;i<=n;i++)
	{
 		cin>>h[i];
 		ma[i]=0;
 	}
 	for(int i=0;i<m;i++)
	{
		int a,b;
		cin>>a>>b;
 		ma[a]=max(ma[a],h[b]);
 		ma[b]=max(ma[b],h[a]);
 	}
	int ans=0;
 	for(int i=1;i<=n;i++)
	{
		 ans+=h[i]>ma[i];
 	}
 	cout<<ans<<endl;
}

Measured memory_bytes: 4416
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define int long long
#define ieps (int) 1e6
#define eps (int) 1e9
int dist[ieps];
vector<int> adj[ieps];
int resp = 0;
void dfs(int x , int pai){
	for(auto v : adj[x]){
		if(v == pai) continue;
		dist[v] = dist[x] + 1;
		dfs(v , x);
	}
}
void dfs2(int x , int pai , int currdist){
	for(auto v: adj[x]){
		if(v == pai) continue;
		if(currdist  + 1 < dist[v]){
			resp++;
		}
		dfs2(v , x , currdist + 1);
	}
}
int32_t main(){
	int n;
	cin>>n;
	for(int i = 0 ;i<n - 1;i++){
		int x , y;
		cin>>x>>y;
		x-- , y--;
		adj[x].pb(y);
		adj[y].pb(x);
	}
	for(int i = 0;i<ieps;i++) dist[i] = 0;
	dfs(0 , -1);
	dfs2(n - 1 , - 1 , 0);
	int q = n;
	resp++;
	q-=resp;
	if(resp == q){
		cout<<"Snuke"<<endl;
	}
	else if(q > resp){
		cout<<"Fennec";
	}
	else{
		cout<<"Snuke";
	}

}

Measured memory_bytes: 39296
h, w = gets.split.map(&:to_i)
n = gets.to_i
as = gets.split.map(&:to_i)
as_f = as.map.with_index { |e,i|  e.times.map { i+1 } }.flatten

ans = []
h.times do |j|
  tmp = []
  w.times do |i|
    if j%2 == 0
      tmp << as_f.shift
    else
      tmp.unshift(as_f.shift)
    end
  end
  ans << tmp.join(" ")
end
puts ans


Measured memory_bytes: 3324
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
 
int main()
{
#ifdef ONPC
    freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
#else
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
#endif
    int n;
    scanf("%d", &n);
    vector <int> a(n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
    }
    vector <int> q;
    int ans = 0;
    for (int i = 0; i < n; i++)
    {
        if (q.size() != 0 && (q.size() == 1 || (q.back() == a[i]) || ((q[0] <= q[1]) == (q.back() <= a[i]))))
        {
            if (q.back() != a[i])
            {
                q.push_back(a[i]);
            }
        }
        else
        {
            q.clear();
            q.push_back(a[i]);
            ans++;
        }
    }
    printf("%d\n", ans);
}

Measured memory_bytes: 1276
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long ans = 0;
for(int i = 0;i < n;i++) {
	long b = sc.nextLong();
	ans += b-1;
}
System.out.println(ans);
}}

Measured memory_bytes: 27624
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <string>
#include<map>
#define maxn 100+5
using namespace std;
int p[maxn];
int main()
{
    int ans[3]={0,0,0};
    int n,a,b;
    scanf("%d%d%d",&n,&a,&b);
    for(int i=0;i<n;i++){
        scanf("%d",&p[i]);
        if(p[i]<=a)ans[0]++;
        else if(p[i]>=b+1)ans[2]++;
        else ans[1]++;
    }
    sort(ans,ans+3);
    printf("%d\n",ans[0]);
    return 0;
}


Measured memory_bytes: 256
package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)

	n, _ := strconv.Atoi(scanLine(sc))
	l1 := scanLine(sc)
	l2 := scanLine(sc)

	var cur rune
	prev, i := detectDomino(0, l1, l2)

	if prev == '=' {
		prev = '|'
		i = 0
	}

	pat := 1

	for i < n {
		cur, i = detectDomino(i, l1, l2)
		switch {
		case prev == '|' && cur == '|':
			pat *= 2
		case prev == '|' && cur == '=':
			pat *= 2
		case prev == '=' && cur == '|':
			pat *= 1
		case prev == '=' && cur == '=':
			pat *= 3
		}
		pat %= 1000000007
		prev = cur
	}

	fmt.Println(pat * 3 % 1000000007)
}

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

func detectDomino(idx int, l1 string, l2 string) (rune, int) {
	if l1[idx] == l2[idx] {
		return '|', idx + 1
	}
	return '=', idx + 2
}

Measured memory_bytes: 640
def main():
    import sys,heapq
    input = sys.stdin.readline
    n = int(input())
    edge = [[] for i in range(n)]
    for i in range(n-1):
        a,b = map(int,input().split())
        edge[a-1].append(b-1)
        edge[b-1].append(a-1)
    
    c2 = list(map(int,input().split()))
    
    c = sorted(c2)
    
    h = []
    for i in range(n):
        heapq.heappush(h,[len(edge[i]),i])
    
    used = [False]*n

    p = [len(edge[i]) for i in range(n)]
    res = 0
    ans = [-1]*n
    for i in range(n):
        q = 0
        while len(h)>0:
            q,ten = heapq.heappop(h)
            if not used[ten]:
                used[ten] = True
                ans[ten] = c[i]
                break
        res += q*c[i]
        for e in edge[ten]:
            if not used[e]:
                p[e]-=1
                heapq.heappush(h,[p[e],e])
    print(res)


    for e in ans:
        print(e,end = ' ')

if __name__ == '__main__':
    main()
    

Measured memory_bytes: 7320
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define REP1(i, n) for(int i = 1; i <= (n); i++)
#define REPD(i,a,b) for (int i=(a);i<(b);i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef set<int> si;
typedef vector<si> vsi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<int, int> pi;
typedef queue<int> qi;
typedef queue<pi> qpi;
typedef pair<ll, ll> pll;
typedef queue<pll> qpll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
const int mod = 1000000007;
const int INF = 1001001001;
// 小数点　<< fixed << setprecision(0) <<
// sort降順　sort(ALL(),greater<int>());
// 円周率　M_PI
// 文字判定　isupper islower
// 文字変換　
// 順列　do {} while(next_permutation(ALL(X)));
// 最大値　LLONG_MAX
// a内でx以上　auto iter = lower_bound(ALL(a), x);
// a内でxより大きい　auto iter = upper_bound(ALL(a), x);
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
struct edge {
    int from; //出発点
    int to;   //到達点
    int cost; //移動コスト
};
typedef struct edge se;
typedef vector<edge> ve;
unsigned Euclidean_gcd(unsigned a, unsigned b) {
  if(a < b) return Euclidean_gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

vpll PrimeFactorization(ll n) {
  vpll res;
  for (ll i=2; i*i<=n; i++) {
    if(n%i!=0) continue;
    ll ex=0;
    while(n%i==0) {
      ex++;
      n/=i;
    }
    res.push_back(pll(i,ex));
  }
  if(n!=1) res.push_back(pll(n,1));
  return res;
}

int main() {
  int h,w;
  cin >> h >> w;
  char s[h][w];
  bool check[h][w]={false};
  REP(i,h) {
    REP(j,w) {
      cin >> s[i][j];
      if(s[i][j]=='.') check[i][j]=true;
    }
  }
  REP(i,h) {
    REP(j,w) {
      if(j>0&&s[i][j-1]=='#'&&s[i][j]=='#') {
        check[i][j-1]=true;
        check[i][j]=true;
      }
      if(i>0&&s[i-1][j]=='#'&&s[i][j]=='#') {
        check[i-1][j]=true;
        check[i][j]=true;
      }
    }
  }
  string ans="Yes";
  REP(i,h) {
    REP(j,w) {
      if(!check[i][j]) ans="No";
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3620
//INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
//DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>
//CONST
//------------------------------------------
#define INF 1010000000000000017LL
#define MOD 1000000007LL
#define EPS 1e-12
#define PI 3.14159265358979323846
//REPEAT
//------------------------------------------
#define   FOR(i,m,n) for(ll (i)=(m);   (i)<(n);  (i)++)
#define   REP(i,n)   for(ll (i)=0;     (i)<(n);  (i)++)
#define  REPS(i,x)   for(ll (i)=1;     (i)<=(x); (i)++)
#define  RREP(i,x)   for(ll (i)=(x)-1; (i)>=0;   (i)--)
#define RREPS(i,x)   for(ll (i)=(x);   (i)> 0;   (i)--)
#define  WREP(i,in,j,jn) REP(i,in)REP(j,jn)
//-----------------------------------------
#define dcml(n) fixed<<setprecision(n)
using namespace std;
int main(void){
    ll N;cin>>N;
    vector<ll> A(N),B(N);REP(i,N)cin>>A[i];
    B=A;
    sort(ALLv(A),greater<ll>());
    ll a0=A[0],a1=A[1];
    //cout<<a0<<a1<<"\n\n";
    REP(i,N){
        if(B[i]!=a0)cout<<a0<<"\n";
        else cout<<a1<<"\n";
    }
}

Measured memory_bytes: 4736
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
#define REP(i, n) for (ll i = 0; i < (int)(n); i++)
#define RREP(i, n) for (ll i = (int)(n)-1; i > -1 ; i--)
#define IN(T, x) T x;cin >> x;
#define AIN(T, a, n) vector<T> a(n);REP(i, n){cin >> a[i];}
#define A2IN(T1, a, T2, b, n) vector<T1> a(n);vector<T2> b(n);REP(i, n){cin >> a[i] >> b[i];}
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) SORT(a);reverse(ALL(a))
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;}
#define OUT(x) cout << x << endl
#define BOUT(b) if(b){OUT("Yes");}else{OUT("No");}
const ll INF = 100000007;

int main() {
  IN(ll, N);
  IN(ll, K);
  unordered_map<ll, ll> A;
  REP(i, N){
    int a;
    cin >> a;
    if (A.count(a) == 0)
      A[a] = 1;
    else
      A[a] = A[a] + 1;
  }
  vector<ll> num(0);
  for(auto i = A.begin(); i != A.end(); i++)
    num.push_back(i->second);
  RSORT(num);
  ll sum = 0;
  for(int i = K; i < num.size(); i++){
    sum += num.at(i);
  }
  OUT(sum);
}




Measured memory_bytes: 11592
import copy
import math

# a = get_int()
def get_int():
    return int(input())

# a = get_string()
def get_string():
    return input()

# a_list = get_int_list()
def get_int_list():
    return [int(x) for x in input().split()]

# a_list = get_string_list():
def get_string_list():
    return input().split()

# a, b = get_int_multi()
def get_int_multi():  # a, b = get_int_multi()
    return map(int, input().split())

# a_list = get_string_char_list()
def get_string_char_list():
    return list(str(input()))

# print("{} {}".format(a, b))
# for num in range(0, a):
# a_list[idx]
# a_list = [0] * a
'''
while (idx < n) and ():

    idx += 1
'''

def main():

    a, b ,c = get_int_multi()
    k = get_int()

    n2 = a / b
    m2 = math.floor(math.log(n2,2) +1)
    if m2 < 0:
        m2 = 0

    n1 = (b * pow(2, m2)) / c
    m1 = math.floor(math.log(n1,2) +1)
    if m1 < 0:
        m1 = 0

    if k >= m1+m2:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()




Measured memory_bytes: 9268
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
 
    int c = a % 3;
    int d = b % 3;
    int e = ( a + b ) % 3;
 
    if ((c==0) || (d==0) || (e==0) ){
      System.out.println("Possible");
    }
    else {
      System.out.println("Impossible");
    }
  }
}

Measured memory_bytes: 21844
#include <algorithm>
#include <iostream> //標準入出力
#include <fstream>  //ファイルでの入出力
#include <vector>
#include <queue>
#include <functional>
#include <string>
#include <utility> //pair
#include <cmath>  //sqrt 
#include <iomanip> //setprecision
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define MAX 1000000
#define pair(a) pair<a,a>

void _main(){
    string s,t; cin >> s>>t;
    int ls=s.size(),lt=t.size();
    int out = __INT_MAX__;
    rep(i,ls-lt+1){
        int sum=0;
        rep(j,lt){
            if(t[j]!=s[i+j]) sum++; 
        }
        out = min(out,sum);
    }
    cout << out << endl;
    return;
}
int main() {
    cout << fixed << setprecision(10);
    _main();
    return 0;
}

Measured memory_bytes: 3232
#include <iostream>
#include <vector>
#include <string.h>
#include <set>
#include <map>
#include <unordered_map>
#include <assert.h>
#include <algorithm>
#include <queue>
#include <bitset>
#include <stack>
#include <chrono>
#include <random>
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define ll long long
#define INF 1000000000000000000
#define MOD 998244353
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define uid uniform_int_distribution <int>
using namespace std;
// Read the question carefully and see all the given sample tests
// Think about the correctness before implementing

int main() {
	int a, b, c, x,  y;
	cin >> a >> b >> c >> x >> y;
	int ans = 0;
	if(2 * c <= (a + b)) {
		ans += min(x, y) * (2 * c);
		int t = min(x, y);
		x -= t;
		y -= t;
		if(x > 0) {
			if(2 * c <= a) {
				ans += x * (2 * c);
			}
			else {
				ans += x * a;
			}
		}
		if(y > 0) {
			if(2 * c <= b) {
				ans += y * (2 * c);
			}
			else {
				ans += y * b;
			}
		}
	}
	else {
		ans += x * a + y * b;
	}
	cout << ans;
}


Measured memory_bytes: 256
(function main( input )
{
  var lines = input.trim().split('\n').map(Number);
  
  lines.sort( function(a,b){ return b-a; } );

  console.log( lines.slice( 0, 3 ).join('\n') );
})( require('fs').readFileSync( '/dev/stdin', 'utf8' ) );

Measured memory_bytes: 15420
#include <bits/stdc++.h>
using namespace std;
#define loop(i,a,n) for (ll i=a;i<n;i++)
#define loopm(i,a,n) for (ll i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define Graph(n) vector < vector < ll > > (n,vector < ll >(0,0))
#define tr(container,it)\
for(auto it=container.begin();it!=container.end();it++)
#define SZ(x) ((int)(x).size())
typedef vector<long long> VI;
typedef long long ll;
typedef vector < vector < ll > > VII;
typedef pair<ll,ll> PII;
typedef double db;
struct  quad
{
    ll a,b,c,d;
};
vector < quad > conditions;
ll m,n;
vector < ll > perm;
ll ans=0;
void rec(ll i,ll lvl)
{

    loop(j,i,m+1)
    {
        perm[lvl]=j;
        if(lvl!=n-1)
        {
            rec(j,lvl+1);
        }
        else
        {
            ll thi=0;
             loop(f,0,conditions.size())
             {
                if(perm[conditions[f].b-1]-perm[conditions[f].a-1]==conditions[f].c)
                    thi+=conditions[f].d;
             }
             ans=max(ans,thi);
        }
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll q;
    cin>>n>>m>>q;
    conditions=vector < quad > (q);
    perm=VI(n,0);
    loop(i,0,q)
    {
        cin>>conditions[i].a;
        cin>>conditions[i].b;
        cin>>conditions[i].c;
        cin>>conditions[i].d;
    }
    rec(1,0);
    cout<<ans<<"\n";
}


Measured memory_bytes: 3624
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <fstream>

using namespace std;

int main(void){
    set<string> s;
    string str;
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>str;
        s.insert(str);
    }
    cout<<s.size()<<endl;
    return 0;
}


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

typedef long long ll;
typedef vector<int> vi;

const double PI=acos(-1.0);

ll a,b,c,k;
void input()
{
    cin>>a>>b>>c>>k;
}

void solve()
{
    if(k<=a) cout<<k<<endl;
    else if(k<=a+b) cout<<a<<endl;
    else cout<<a-(k-a-b)<<endl;
}

int main()
{
    cin.tie();
    ios::sync_with_stdio(false);
    input();
    solve();
    return 0;
}

Measured memory_bytes: 3612
/*
How to lambda
  ex) sort(ALL(cont),[](dat a,dat b){return a.l<b.l;});
lower_bound/upper_bound of 2
  1 2 2 2 3 3 
    ^lb   ^ub */
#include <cstdio>
#define BR "\n"
#define REP(i,n) for(int (i)=0;(i)<(n);++(i))
#define ALL(cont) begin(cont),end(cont)
#define AS_MOD(a,b) ((((a) % (b) ) + (b)) % (b))
#define FEACH(it,cont) for(auto (it) = begin(cont); it!=end(cont);++it)
#define FEACHR(it,cont) for(auto (it) = rbegin(cont); it!=rend(cont);++it)
#define pb push_back
#define pob pop_back
#define fi first
#define se second
#define prl(P) printf("%lld", P)
#define prd(P) printf("%.10Lf", P)
#define pr(P) printf(P)
#define assign_if_greater(V, T) V=max(V,T)
using namespace std;
typedef long long ll;
typedef long double ld;
int A,B,Q;
ll As[100000+10];
ll Bs[100000+10];
ll INF=(ll)1000*1000*1000*1000;
ll min(ll a, ll b) {
  return a>b? b:a;
}
ll abs(ll a) {
  return a>0?a:-a;
}
ll* lower_bound(ll* a, ll* b, ll v){
  while(b>a+1) {
    ll* m=a+(b-a)/2;
    if(*m >= v) {
      b=m;
    } else {
      a=m;
    }
  }
  return b;
}
char buf[1<<25];
int p=0;
inline char my_get_char() {
  return buf[p++];
}
#define getchar_unlocked my_get_char
ll fastGet() {
  ll ret=0;
  char c=getchar_unlocked();
  // skipping
  while(c<'0' || c > '9') c=getchar_unlocked();
  do {
    ret = (ret<<3)+(ret<<1);
    ret += (c-'0');
    c = getchar_unlocked();
  } while(c>='0' && c<='9');
  return ret;
}
void fastPut(ll v) {
  char s[256];
  int p=0;
  do {
    s[p++]=(v%10)+'0';
    v/=10;
  } while(v>0);
  while(p--)
    putchar_unlocked(s[p]);
}
int main() {
  fread(buf,1,sizeof(buf),stdin);
  A=fastGet();
  B=fastGet();
  Q=fastGet();
  As[0]=-INF;
  Bs[0]=-INF;
  As[A+1]=INF;
  Bs[B+1]=INF;
  REP(i,A)
    As[i+1]=fastGet();
  REP(i,B)
    Bs[i+1]=fastGet();
  REP(i,Q) {
    ll x=fastGet();
    ll* ita=lower_bound(As, As+A, x);
    ll* itb=lower_bound(Bs, Bs+B, x);
    ll ans=INF;
    ll alis[2],blis[2];
    alis[0]=*ita;
    blis[0]=*itb;
    alis[1]=ita[-1];
    blis[1]=itb[-1];
    REP(j,2)
      REP(k,2){
        ll a=alis[j],b=blis[k];
        ans = min(ans,abs(a-x)+abs(b-a));
        ans = min(ans,abs(b-x)+abs(b-a));
      }
    fastPut(ans);
    putchar_unlocked('\n');
  }
  return 0;
}


Measured memory_bytes: 7424
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){
    int n;
    cin >> n;
    int a[n];
    int b[n];
    for(int i=0;i<n;i++){
        cin >> a[i];
        b[i] = a[i] - (i+1);
    }
    sort(b,b+n);
    int x=0;
    if(n%2==0){
        x = (b[n/2]+b[n/2-1])/2;
    }else{
        x = b[(n-1)/2];
    }
    long long int anss = 0;
    for(int j=0;j<n;j++){
        anss += abs(b[j]-x);
    }
    cout << anss << endl;
}


Measured memory_bytes: 1792
N, Y = map(int, input().split())
for x in range(N + 1):
    for y in range(N - x + 1):
        z = N - x - y
        if Y == 10000 * x + 5000 * y + 1000 * z:
            print(x, y, z)
            exit()
print("-1 -1 -1")

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


int main(){
	int n, m;
    long long x[1001], y[1001], z[1001];
    vector<long long> s(8, 0);
    vector<long long> w(0);

    cin >> n >> m;
    for(int i=0;i<n;i++){
        cin >> x[i] >> y[i] >> z[i];
        w.push_back(0);
    }


    for(int i=0;i<n;i++){
        w[i] = x[i] + y[i] + z[i];
    }
    sort(w.begin(), w.end(), greater<long long>());
    for(int i=0;i<m;i++){
        s[0] += w[i];
    }

    for(int i=0;i<n;i++){
        w[i] = x[i] + y[i] - z[i];
    }
    sort(w.begin(), w.end(), greater<long long>());
    for(int i=0;i<m;i++){
        s[1] += w[i];
    }

    for(int i=0;i<n;i++){
        w[i] = x[i] - y[i] + z[i];
    }
    sort(w.begin(), w.end(), greater<long long>());
    for(int i=0;i<m;i++){
        s[2] += w[i];
    }

    for(int i=0;i<n;i++){
        w[i] = y[i] + z[i] - x[i];
    }
    sort(w.begin(), w.end(), greater<long long>());
    for(int i=0;i<m;i++){
        s[3] += w[i];
    }

    for(int i=0;i<n;i++){
        w[i] = x[i] - y[i] - z[i];
    }
    sort(w.begin(), w.end(), greater<long long>());
    for(int i=0;i<m;i++){
        s[4] += w[i];
    }

    for(int i=0;i<n;i++){
        w[i] = y[i] - z[i] - x[i];
    }
    sort(w.begin(), w.end(), greater<long long>());
    for(int i=0;i<m;i++){
        s[5] += w[i];
    }

    for(int i=0;i<n;i++){
        w[i] = y[i] + z[i] - x[i];
    }
    sort(w.begin(), w.end(), greater<long long>());
    for(int i=0;i<m;i++){
        s[6] += w[i];
    }

    for(int i=0;i<n;i++){
        w[i] = -1 * (x[i] + y[i] + z[i]);
    }
    sort(w.begin(), w.end(), greater<long long>());
    for(int i=0;i<m;i++){
        s[7] += w[i];
    }


    sort(s.begin(), s.end(), greater<long long>());
    cout << s[0] << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <numeric>
using namespace std;
typedef long long ll;
const int SVSZ = 1000009;
typedef int(*func_ptr) (int&, int&, int&);

int spf[SVSZ]; //Smallest Prime Factor
int hpp[SVSZ]; //Highest Power of spf
int hpc[SVSZ]; //Highest Power Count of spf
int func[SVSZ];//Multiplicative Function
vector<int> primes; int one = 1;


int divCount(int &HPP, int &HPC, int &SPF) { return HPC + 1; }

void buildSieveMult(func_ptr Mult) { //Computes a multiplicative function over a range in O(n)
	spf[0] = spf[1] = hpp[1] = func[1] = 1; //Initial Values
	hpp[0] = hpc[0] = hpc[1] = func[0] = 0; //Initial Values

	for (int i = 2; i < SVSZ; i++) {
		if (spf[i] == 0) { //i is Prime
			primes.push_back(i); spf[i] = i;
			func[i] = Mult(i, one, i); hpp[i] = i; hpc[i] = 1;
		}
		for (int j = 0; j < (int)primes.size() && i * primes[j] < SVSZ; j++) {
			spf[i * primes[j]] = primes[j];
			if (i % primes[j]) { //primes[j] < spf[i]
				func[i * primes[j]] = func[i] * func[primes[j]];
				hpp[i * primes[j]] = primes[j]; hpc[i*primes[j]] = 1;
			}
			else { //primes[j] == spf[i]
				hpp[i * primes[j]] = primes[j] * hpp[i]; hpc[i * primes[j]] = 1 + hpc[i];
				func[i * primes[j]] = func[i / hpp[i]] * Mult(hpp[i * primes[j]], hpc[i * primes[j]], primes[j]);
				break;
			}
		}
	}
}

int main() {
	int n; cin >> n; buildSieveMult(divCount);
	partial_sum(func, func + SVSZ, func);
	cout << func[n - 1] << '\n';
	cin.ignore(2); return 0;
}

Measured memory_bytes: 19524
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <cassert>
#include <memory>
#include <stack>
#include <set>
#include <map>

#define INF 1000000000
#define MOD 1000000007
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

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

  int a,b; cin>>a>>b;
  int ans = a + b;
  if(ans >= 10) {
    puts("error");
  } else {
    printf("%d\n", ans);
  }
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import math


def main():
    a, b, x = input_line(int, int, int)
    if a ** 2 * b / 2 < x:
        tt = 2 * (a ** 2 * b - x) / a ** 3
    else:
        tt = a * b ** 2 / (2 * x)
    t = math.degrees(math.atan(tt))
    print(t)


def input_line(*types):
    if len(types) == 1:
        return types[0](input())
    else:
        return [t(x) for t, x in zip(types, input().split())]


if __name__ == "__main__":
    main()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < n; i++)
static const long long INF = 1000000;
using p = pair<int,int>;

int main(){
    int h,w;
    cin >> h >> w;
    vector<vector<char>> road(h,vector<char>(w,'#'));
    rep(i,h){
        rep(j,w){
            char s;
            cin >> s;
            road[i][j] = s;
        }
    }
    
    //スタート、ゴール、壁の位置からかかる時間の最大値を出力する。
    auto haba = [&](int sh,int sw){
        queue<p> q;
        q.push({sh,sw});
        vector<vector<int>> score(h,vector<int>(w,0));
        vector<vector<int>> color(h,vector<int>(w,0));
            auto judge = [&](int gh,int gw){
            if (0 <= gh and gh < h){
                if (0 <= gw and gw < w){
                    if (road[gh][gw] == '.' and color[gh][gw] == 0){
                        return true;
                    }
                }
            }
            return false;
        };
        while (!q.empty()){
            p sp = q.front();
            color[sp.first][sp.second] = 1;
            q.pop();
            p p1,p2,p3,p4;
            p1 = {sp.first -1,sp.second};
            p2 = {sp.first+1,sp.second};
            p3 = {sp.first,sp.second-1};
            p4 = {sp.first,sp.second+1};
            if(judge(p1.first,p1.second)){
                q.push(p1);
                score[p1.first][p1.second] = score[sp.first][sp.second]+1;
                color[p1.first][p1.second] = 1;
            }
            if(judge(p2.first,p2.second)){
                q.push(p2);
                score[p2.first][p2.second] = score[sp.first][sp.second]+1;
                color[p2.first][p2.second] = 1;
            }
            if (judge(p3.first,p3.second)){
                q.push(p3);
                score[p3.first][p3.second] = score[sp.first][sp.second]+1;
                color[p3.first][p3.second] = 1;
            }
            if (judge(p4.first,p4.second)){
                q.push(p4);
                score[p4.first][p4.second] = score[sp.first][sp.second]+1;
                color[p4.first][p4.second] = 1;
            }
        }
        int mx = 0;
        rep(i,h){
            rep(j,w){
                mx = max(mx,score[i][j]);
            }
        }
        return mx;
    };
    int ans = 0;
    rep(i,h){
        rep(j,w){
            if (road[i][j] == '.'){
                int m = haba(i,j);
                ans = max(ans,m);
            }
        }
    }
    cout << ans << endl;
    
    
    
}

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

namespace _0030
{
    class Program
    {    
        static void Main(string[] args)
        {

            var himan = new List<int>();

            do
            {
                string input = Console.ReadLine();

                if (string.IsNullOrEmpty(input))
                {
                    break;
                }

                string[] str = input.Split(',');

                int num = int.Parse(str[0]);
                double w = double.Parse(str[1]);
                double h = double.Parse(str[2]);

                double bmi = w / (h * h);

                if(bmi >= 25)
                {
                    himan.Add(num);
                }

            } while (true);

            foreach(var s in himan)
            {
                Console.WriteLine(s);
            }

        }
    }
}


Measured memory_bytes: 15900
#include<math.h>
#include<stdio.h>
int main()
{
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    if(a>b&&b>c) printf("%d %d %d\n",c,b,a);
    if(a>=c&&c>=b) printf("%d %d %d\n",b,c,a);
    if(b>a&&a>c) printf("%d %d %d\n",c,a,b);
    if(b>=c&&c>=a) printf("%d %d %d\n",a,c,b);
    if(c>a&&a>b) printf("%d %d %d\n",b,a,c);
    if(c>=b&&b>=a) printf("%d %d %d\n",a,b,c);
    return 0;
}




Measured memory_bytes: 2720
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

int main(void){
    int a, b;
    cin >> a >> b;
    int ans = (b-1)%(a-1) ? ((b-1)/(a-1) + 1) : ((b-1)/(a-1));
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
void main() {
	while(true) {
		auto ip = readAs!(int[]);
		if(ip.count(0) == 2) break;
		"%(%d %)".writefln(ip.sort.array);
	}
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.conv;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}


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

int main() {
	int N,M,a,b,c=1,r;
	cin >> N >> M;
	r = N;
	vector<P> p(M);

	rep(i,M)
		cin >> p.at(i).first >> p.at(i).second;
	sort(p.begin(), p.end());

	rep(i,M) {
		if(p.at(i).first >= r) {
			c++;
			r = p.at(i).second;
		} else
			r = min(r,p.at(i).second);
	}

	cout << c << endl;
}

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

#define MAX 200000
#define SENT 2000000000
typedef long long ll;

int L[MAX / 2 + 2];
int R[MAX / 2 + 2];

ll merge(int A[], int left, int mid, int right){
    
    int i,j,k;
    ll cmp = 0;
    int n1 = mid - left;
    int n2 = right - mid;
    for (i=0; i < n1; i++) L[i] = A[left + i];
    for (i=0; i < n2; i++) R[i] = A[mid + i];
    L[n1] = R[n2] = SENT;
    
    i=j=0;
    for (k = left; k < right; k++) {
        if (L[i] <= R[j]) {
            A[k] = L[i++];
        }else{
            A[k] = R[j++];
            cmp += n1 - i; //=mid + j - k - 1
        }
    }
    return cmp;
}

//????´???°N???????????§????????´??????MergeSort(A, 0, N)??¨????????????????????????
ll mergeSort(int A[], int left, int right){
    
    int mid;
    ll cmp = 0;
    
    if( left + 1 < right ) {
        mid = (left + right) / 2;
        cmp += mergeSort(A, left, mid);
        cmp += mergeSort(A, mid, right);
        cmp += merge(A, left, mid, right);
    }
    return cmp;
}

int main(){
    
    int n,i;
    int A[MAX];
    ll ans = 0;
    
    cin >> n;
    for(i = 0; i < n; i++) {
        scanf("%d", &A[i]);
    }
    
    ans = mergeSort(A, 0, n);

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

Measured memory_bytes: 2800