akhauriyash/Code-Regression huggingface dataset:
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//                       _oo0oo_                         //
//                      o8888888o                        //
//                      88" . "88      ------ hzt1       //
//                      (| -_- |)                        //
//                      0\  =  /0                        //
//                    ___/`---'\___                      //
//                  .' \|     |// '.                     //
//                 / \|||  :  |||// \                    //
//                / _||||| -:- |||||- \                  //
//               |   | \  -  /// |     |                 //
//               | \_|  ''\---/''  |_/ |                 //
//               \  .-\__  '-'  ___/-. /                 //
//             ___'. .'  /--.--\  `. .'___               //
//          ."" '<  `.___\_<|>_/___.' >' "".             //
//         | | :  `- \`.;`\ _ /`;.`/ - ` : | |           //
//         \  \ `_.   \_ __\ /__ _/   .-` /  /           //
//     =====`-.____`.___ \_____/___.-`___.-'=====        //
//                       `=---='                         //
//                                                       //
//                                                       //
//     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       //
//                                                       //
//                 God-He Bless All.                     //
//           This Code Will Never Explode.               //
//                                                       //
//                                                       //
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
#include<cstdio>
#include<cstring>
#include<cctype>
#include<queue>
#include<algorithm>
#define rep(i,a,b) for(int i=(a),i##_end_=(b);i<=i##_end_;i++)
#define dwn(i,a,b) for(int i=(a),i##_end_=(b);i>=i##_end_;i--)
using namespace std;
const int Size=1<<16;
char buffer[Size],*head,*tail;
inline char Getchar() {
    if(head==tail) {
        int l=fread(buffer,1,Size,stdin);
        tail=(head=buffer)+l;
    }
    if(head==tail) return -1;
    return *head++;
}
inline int read() {
    int x=0,f=1;char c=getchar();
    for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
    for(;isdigit(c);c=getchar()) x=x*10+c-'0';
    return x*f;
}
deque<int> ans;
typedef long long ll;
int bit[100],m;
int main() {
	ll n;scanf("%lld",&n);n++;
	while(n) bit[m++]=n&1,n>>=1;
	int q=0;
	dwn(i,m-2,0) {
		ans.push_back(++q);
		if(bit[i]) ans.push_front(++q);
	}
	printf("%d\n",q*2);
	rep(i,1,q) printf("%d ",i);
	rep(i,1,q) {
		printf("%d ",ans.front());
		ans.pop_front();
	}
	return 0;
}


Measured memory_bytes: 256
-- Try AtCoder
-- author: Leonardone @ NEETSDKASU

main = print . solve . read =<< getLine

solve n = ans where
    ans = fst $ foldl h (0, 0) $ map g [1..n]
    g x = (x, f 0 x)
    f a 1 = a
    f a x = f (a + 1 - mod x 2) (div x 2)
    h a@(_, ac) v@(_, vc) = if ac > vc then a else v



Measured memory_bytes: 508
#include<stdio.h>
int main()
{
	int a[3] , ans = 0 , i ;
	scanf("%d%d%d",&a[0],&a[1],&a[2]);
	for(i = 0 ; i < 3 ; i++ )
	{
		for(int j = 0 ; j < i ; j++ )
		{
			if(a[i] < a[j] )
			{
				int c = a[i] ;
				a[i] = a[j] ;
				a[j] = c ;
			}
		}
	}
	ans = a[0] * a[1] ;
	ans /= 2 ;
	printf("%d\n",ans);
}


Measured memory_bytes: 128
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <limits>
#include <fstream>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
int toC(int A, int B, int C){
  if(!A&&!B)return 0;
  if(C&1)return toC(A>>1,B>>1,C>>1);
  else if(B&1)return toC(C>>1,B>>1,A>>1)+1+toC((A|B|C)>>1,0,0);
  else if(A&1)return toC(A>>1,B>>1,C>>1)+2*toC((A|B|C)>>1,0,0)+2;
  return 0;
}
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n,m;
  while(cin>>n>>m,n||m){
    int cup[3];// それぞれのトレイにあるカップの集合を表す
    CLR(cup);
    FOR(i,0,3){
      int t;cin>>t;
      FOR(j,0,t){
        int a;cin>>a;
        a--;
        cup[i]|=1<<a;
      }
    }
    //全てAカCにする
    int x=min(toC(cup[0],cup[1],cup[2]),toC(cup[2],cup[1],cup[0]));
    cout<<(x<=m?x:-1)<<endl;
  }
  return 0;
}


Measured memory_bytes: 3204
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll half_inf = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);


int main() {
    ll n, m;
    vector<ll> a, b, c, d;
    cin >> n >> m;
    a.resize(n), b.resize(n), c.resize(m), d.resize(m);
    rep(i, n) cin >> a[i] >> b[i];
    rep(i, m) cin >> c[i] >> d[i];

    ll ans[n];
    rep(i, n) {
        ll tmp = ll_inf;
        rep(j, m) {
            if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < tmp) {
                tmp = abs(a[i] - c[j]) + abs(b[i] - d[j]);
                ans[i] = j + 1;
            }
        }
        cout << ans[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 256
def main(input =STDIN)
  while (arg = input.gets)
    x1, y1, x2, y2, xq, yq = arg.split(",").map(&:to_f)
    p1, p2, q = Complex(x1, y1), Complex(x2 - x1, y2 - y1), Complex(xq - x1, yq - y1)
    puts (Complex.polar(q.abs, p2.phase * 2 - q.phase) + p1).rect.map{|i|i.round(5)}.join(" ")
  end
end
main

Measured memory_bytes: 6268
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int n, m, L; scanf("%d%d%d", &n, &m, &L);
	auto g = make_v<i64>(n, n);
	for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) g[i][j] = 1LL << 60;
	for(int i = 0; i < n; i++) g[i][i] = 0;
	for(int i = 0; i < m; i++) {
		int a, b, c; scanf("%d%d%d", &a, &b, &c);

		g[a - 1][b - 1] = g[b - 1][a - 1] = c;
	}

	for(int k = 0; k < n; k++) for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) g[i][j] = std::min(g[i][j], g[i][k] + g[k][j]);

	auto vec = make_v<int>(n, n);
	for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) vec[i][j] = 1 << 30;
	for(int i = 0; i < n; i++) {
		vec[i][i] = -1;

		std::queue<int> qu({i});
		while(!qu.empty()) {
			auto v = qu.front(); qu.pop();

			for(int j = 0; j < n; j++) {
				if(g[v][j] > L or vec[i][j] != 1 << 30) continue;
				vec[i][j] = vec[i][v] + 1;
				qu.push(j);
			}
		}
	}
	
	int q; scanf("%d", &q);
	while(q--) {
		int s, t; scanf("%d%d", &s, &t);

		printf("%d\n", (vec[s - 1][t - 1] == 1 << 30 ? -1 : vec[s - 1][t - 1]));
	}
	return 0;
}


Measured memory_bytes: 1664
line = readlines.map(&:to_i)

N = line[0]

ans = []
for i in 1..N do
  if ans == [] then
    ans.unshift(line[i])
  else
    found = false
    j = (ans.length - 1) / 2
    min = -1
    max = ans.length - 1
    while found == false do
      if ans[j] < line[i] then   #can be colored j
        min = j
        j = (max + j + 1) / 2
      else
        max = j - 1
        j = (min + j) / 2
      end
      if min == max then
        found = true
      end
    end
    if min == -1 then
      ans.unshift(line[i])
    else
      ans[min] = line[i]
    end
  end
end
        
print ans.length

Measured memory_bytes: 11900
#include <bits/stdc++.h>
#define rep(i, N) for (int i = 0; i < (N); i++)
using namespace std;

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

    bool ok = false;

    int half = N / 2;
    if (S.substr(0, half) == S.substr(half, N)) ok = true;

    if (ok) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


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

using namespace std;
using ll = long long;
using pii = pair<int, int>;

template <typename T>
struct edge {
  int from, to; T cost;
  edge() {}
  edge(int f, int t, int c): from(f), to(t), cost(c) {}
};

int N, M;
bool used[100010];
int dis[100010];
vector<edge<int>> G[100010];

bool dfs(int u) {
  bool res = true;
  for (auto &e : G[u]) {
    int v = e.to;
    if (used[v]) {
      if (dis[v] != dis[u] + e.cost) return false;
    } else {
      used[v] = true;
      dis[v] = dis[u] + e.cost;
      res &= dfs(v);
    }
  }
  return res;
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    int L, R, D;
    cin >> L >> R >> D;
    L--, R--;
    G[L].emplace_back(L, R, D);
    G[R].emplace_back(R, L, -D);
  }

  bool yes = true;
  for (int i = 0; i < N; i++) {
    if (used[i]) continue;
    used[i] = true;
    dis[i] = 0;
    yes &= dfs(i);
  }
  cout << (yes ? "Yes" : "No") << endl;

  return 0;
}

Measured memory_bytes: 13952
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <cmath>
#include <string>
#define INF 2100000000
#define INVALID -1
using namespace std;
int dx[4] = { 1,-1,0,0 }, dy[4] = { 0,0,1,-1 };
int absint(int a)
{
	return max(a , - a);
}
int main()
{
	int n, a, b;
	cin >> n >> a >> b;
	cout << min(a, b) <<' '<< max(0, a + b - n);
}


Measured memory_bytes: 256
S = input()
T = input()
ans = len(T)
for i in range(len(S)-len(T)+1):
    s = S[i:i+len(T)]
    count = 0
    for c, t in zip(s, T):
        if c != t:
            count += 1
    ans = min(count, ans)
    if ans == 0:
        break

print(ans)


Measured memory_bytes: 67812
#include <bits/stdc++.h>
#define REP(i,n) for(int64_t i=0;i<(n);i++)
#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define REV(c) reverse((c).begin(),(c).end())
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define COUTDOUBLE(d,i) cout << setprecision((i)) << (d) << endl;
#define VIN(v) for(int64_t i=0;i<(v).size();i++){cin >> (v).at(i);}
#define MREP(i,m) for(auto i=(m).begin(); i != (m).end(); ++i) // auto key = i->first;auto value = i->second;

using namespace std;
typedef int64_t I;
typedef pair<I,I> P;
typedef vector<I> V;

I MOD = pow(10,9)+7;
I MAX = LONG_MAX;
I MIN = LONG_MIN;


// 最大公約数
I gcd(I a, I b) {
  return b != 0 ? gcd(b, a % b) : a;
}

// 最小公倍数
I lcm(I a, I b) {
  return a * b / gcd(a, b);
}

int ctoi(char c){
  return c - '0';
}
std::vector<I> enum_div(I n)//nの約数を列挙
{
	std::vector<I> ret;
	for(I i=1 ; i*i<=n ; ++i)
	{
		if(n%i == 0)
		{
			ret.push_back(i);
			if(i!=1 && i*i!=n)
			{
				ret.push_back(n/i);
			}
		}
	}
	return ret;
}
bool IsPrime(I num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    long double sqrtNum = sqrt(num);
    for (I i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  I a,b;
  cin >> a >> b;
  vector<I> tmp,v;
  tmp = enum_div(a);
  tmp.push_back(a);
  if (find(ALL(tmp), b) != tmp.end()){
    v.push_back(b);
  }
	for(I i=1 ; i*i<=b ; ++i)
	{
		if(b%i == 0)
		{
      if (find(ALL(tmp),i) != tmp.end()){
			  v.push_back(i);
      }
			if(i!=1 && i*i!=b)
			{
        if (find(ALL(tmp),b/i) != tmp.end()){
				  v.push_back(b/i);
        }
			}
		}
	}
  I t=0;
  REP(i,v.size()){
    if (IsPrime(v.at(i))){
      t++;
    }
  }
  cout << t+1 << endl;
  return 0;
}



Measured memory_bytes: 384
#include<iostream>
#include<map>
#include<string>
using namespace std;
map<string,int> mp;
int main(){
	int n;
	int i;
	int max=0;	
	cin>>n;
	for(i=0;i<n;i++){
		string str;
		cin>>str;
		mp[str]++;	
	}
	map<string,int>::iterator it;
	for(it=mp.begin();it!=mp.end();it++){
		if(it->second>max){
			max=it->second;	
		}
	}
	for(it=mp.begin();it!=mp.end();it++){
		if(it->second==max){
			cout<<it->first<<endl;
		}
	}
	
	

	return 0;
}

Measured memory_bytes: 25216
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define MAX_N 100
#define MAX_W 10000
int dp[MAX_N+1][MAX_W+1];

int main() {
    int N,W;
    cin >> N >> W;
    vector<int> v(N),w(N);
    rep(i,N)
        cin >> v.at(i) >> w.at(i);
    
    rep(i,N)
        rep(j,W+1)
            if(w.at(i) > j)
                dp[i+1][j] = dp[i][j];
            else
                dp[i+1][j] = max(dp[i][j], dp[i+1][j-w.at(i)]+v.at(i));
    
    cout << dp[N][W] << endl;
}


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

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
	string s;
	cin >> s;
	ll int t = 0;
	stack<char> st;
	REP(i,s.size()){
		if(s[i] == 'S'){
			st.push(s[i]);			
		}else{
			if(!st.empty() && st.top() == 'S'){
				st.pop();
				t++;
			}
		}
	}
	cout << s.size() - t*2 << endl;
}

Measured memory_bytes: 640
//void __(){
//    int n,m;
//    cin >> n >> m;
//    vs grid(n);
//    cin >> grid;
//    vvi dp(n,vi(m,MOD));
//    dp[0][0] = 1;
//    rep(i,n)
//        rep(j,m){
//            if(i)
//                dp[i][j] = min(dp[i][j],dp[i-1][j] + (grid[i-1][j] != grid[i][j]));
//            if(j)
//                dp[i][j] = min(dp[i][j],dp[i][j-1] + (grid[i][j-1] != grid[i][j]));
//        }
//    int ans = dp[n-1][m-1];
//    if(grid[0][0] == '#' && grid[n-1][m-1] == '#')
//        ans = (1+ans)/2;
//    else
//        ans = ans/2;
//    print ans;
//}
//
#include <iomanip>
#include <algorithm>
#include <cassert>
#include <vector>
#include <utility>
#include <iostream>
#include <string>
#define REP_ZERO_INT(i,r) for(int i = 0; i < r; ++i)
#define GET_REP_MACRO(_1,_2,_3,_4,NAME,...) NAME
#define rep(...) GET_REP_MACRO(__VA_ARGS__,REP_ANY,REP_INT,REP_ZERO_INT)(__VA_ARGS__)
#define all(v) (v).begin(), (v).end()
#define sz(v) ll(v.size())
#define T1 template<typename T> static
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
const ll MOD = 1e9 + 7;
T1 ostream& operator<<(ostream& stream, const vector<T>& t);
T1 istream& read(T, T, istream& = cin);
T1 istream& operator>>(istream& stream, vector<T>& t){
    return read(all(t), stream);
}
T1 istream& read(T b, T e, istream& stream){
    for(T it = b; it != e; ++it)
        stream >> *it;
    return stream;
}
struct _print {
    string sep,end;
    bool space;
    ostream &stream;
    _print(string _sep=" ",string _end="\n",
            ostream &_stream = cout)
        : sep(_sep),end(_end),space(false),
            stream(_stream) {}
    ~_print() { stream << end; }
    template <typename T>
        _print &operator , (const T &t) {
            if (space) stream << sep;
            space = true;
            stream << t;
            return *this;
        }
};
#define print _print(),
void __(){
    int n,m;
    cin >> n >> m;
    vs grid(n);
    cin >> grid;
    vvi dp(n,vi(m,MOD));
    dp[0][0] = 1;
    rep(i,n)
        rep(j,m){
            if(i)
                dp[i][j] = min(dp[i][j],dp[i-1][j] + (grid[i-1][j] != grid[i][j]));
            if(j)
                dp[i][j] = min(dp[i][j],dp[i][j-1] + (grid[i][j-1] != grid[i][j]));
        }
    int ans = dp[n-1][m-1];
    if(grid[0][0] == '#' && grid[n-1][m-1] == '#')
        ans = (1+ans)/2;
    else
        ans = ans/2;
    print ans;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
        __();
}


Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <array>


using namespace std;

int main(int argc, char const *argv[])
{
    int min = 100000, n, out;
    string s;
    cin >> s;

    for(int p = 0; p < s.size() - 2; p++){
        int num = (s[p]-'0') * 100 + (s[p+1]-'0') * 10 +(s[p+2]-'0');
        n = abs(753-num);
        if(n < min){
            min = n;
        }
    }

    cout << min << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef double db;
#define go(u) for(int i = head[u], v = e[i].to; i; i=e[i].lst, v=e[i].to)
#define rep(i, a, b) for(int i = a; i <= b; ++i)
#define pb push_back
#define re(x) memset(x, 0, sizeof x)
inline int gi() {
    int x = 0,f = 1;
    char ch = getchar();
    while(!isdigit(ch)) { if(ch == '-') f = -1; ch = getchar();}
    while(isdigit(ch)) { x = (x << 3) + (x << 1) + ch - 48; ch = getchar();}
    return x * f;
}
template <typename T> inline bool Max(T &a, T b){return a < b ? a = b, 1 : 0;}
template <typename T> inline bool Min(T &a, T b){return a > b ? a = b, 1 : 0;}
const int N = 1e5 + 7, mod = 1e9 + 7;
int n, sz, tsum;
int vis[N], cir[N], fa[N], oncir[N], val[N], cnt[N], du[N];
LL ans = 1, f[N];
vector<int>G[N];
void tarjan(int u) {
	++tsum;
	vis[u] = 1;
	for(auto v:G[u]) if(!vis[v]) {
		fa[v] = u;
		tarjan(v);
	}else {
		cir[sz++] = u;
		for(int x = u; x ^ v; x = fa[x]) {
			cir[sz++] = fa[x];
		}
	}
}
int dfs(int u) {
	int cnt = 0;
	for(auto v:G[u]) if(!oncir[v]) ++cnt;
	if(cnt >= 2) puts("0"), exit(0);
	for(auto v:G[u]) if(!oncir[v]) {
		return dfs(v) + 1;
	}
	return 0;
}
int calc(int a, int b) {
	if(a < b) return 2;
	return a == b;
}
void solve() {
	rep(i, 0, sz - 1) val[i] = dfs(cir[i]);
	
	LL tot = 1; int L = -1, R = -1;
	for(int i = 0; i < sz; ++i) if(val[i]) { L = i; break;}
	for(int i = sz - 1; i >= 0; --i) if(val[i]) { R = i; break;}
	tot = tot * calc(val[L], sz - 1 - R + L + 1) % mod;
	for(int i = L + 1; i < sz; ++i) if(val[i]) {
		tot = tot * calc(val[i], i - L) % mod;
		L = i;
	}
	ans = ans * tot % mod;
}
int gg(int a) {
	if(a == 1 || a % 2 == 0) return 1;
	return 2;
}
vector<int>H[N];
int main() {
#ifdef fwat
	freopen("data.in", "r", stdin);
#endif
	n = gi();
	rep(i, 1, n) oncir[i] = 1;
	rep(i, 1, n) {
		int a = gi();
		G[a].pb(i);
		H[i].pb(a);
		++du[a];
	}
	queue<int>Q;
	rep(i, 1, n) if(!du[i]) Q.push(i);
	while(!Q.empty()) {
		int u = Q.front();Q.pop();
		oncir[u] = 0;
		for(auto v:H[u]) if(--du[v] == 0) Q.push(v);
	}
	rep(i, 1, n) if(oncir[i] && !vis[i]) {
		tsum = sz = 0;
		tarjan(i);
		if(sz == tsum)
			++cnt[tsum];
		else
			solve();
	}
	rep(len, 1, n) {
		fill(f, f + cnt[len] + 1, 0);
		f[0] = 1, f[1] = gg(len);
		rep(i, 2, cnt[len]) f[i] = (f[i - 1] * gg(len) + (i - 1ll) * len % mod * f[i - 2]) % mod;
		ans = ans * f[cnt[len]] % mod;
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 17792
a,b=map(int,input().split())
s=list(input())
f=0
for i in range(a):
    if not s[i] in "0123456789":
        f=1
if s[a]!="-":
    f=1
for i in range(b):
    if not s[i+a+1] in "0123456789":
        f=1
print("Yes" if f==0 else "No")


Measured memory_bytes: 61892
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rrep(i, n) for (ll i = n - 1; i >= 0; i--)
#define Rep(i, r, n) for (ll i = r; i < n; i++)
#define RRep(i, r, n) for (ll i = n - 1; i <= r; i--)
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define int long long
#define pb push_back
const int dx[] = {0, -1, 0, 1};
const int dy[] = {1, 0, -1, 0};
const int MOD = (1000000007);
//const int MOD = (998244353);
//const int INF = (1 << 30)-1;
const int INF = (1LL << 60)-1;
const double EPS = (1 >> 30);

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;}

using Graph = vector<vector<pair<int, int>>>;

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
    //---------------------------------------------
    
    int n;
    string s;
    cin>>n>>s;
    ll ans=0;
    for(int i=0;i<1000;i++){
        string t=to_string(i);
        string u="";
        for(int j=0;j<3-t.size();j++){
            u+="0";
        }
        u+=t;
        // cout<<u<<endl;
        int c=0;
        for(int j=0;j<n;j++){
            if(s[j]==u[c]){
                c++;
            }
        }
        if(c==3){
            ans++;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define LIMIT 1000000007 //10^9+7
#define rep(i, n) for(int i=0; i<(int)n; i++)
#define all(v) (v).begin(), (v).end()

int main(){
  int N;cin>>N;
  int bits = 0;
  vector<int> A(N);

  rep(i,N){
    cin>>A[i];
    bits ^= A[i];
  }

  rep(i,N){
    cout<<(A[i]^bits)<<" ";
  }
  cout<<endl;
}


Measured memory_bytes: 4004
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        long both = n / (a + b);
        long mod = n % (a + b);
        long ans = a * both + Math.min(mod, a);
        System.out.println(ans);
    }
}


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

int main() {
  int n, k;
  cin >> n >> k;
  
  vector<int> hlist;
  
  for(int i = 0; i < n; i++){
    int h;
    cin >> h;
    hlist.push_back(h);
  }
  
  sort(hlist.begin(), hlist.end());

  int difference = 1000000000;
  int a = 0;
  
  for(int i = 0; i < n + 1 - k; i++){
    a = hlist[i + k - 1] - hlist[i];
    if (a < difference) difference = a;
  }
  cout << difference << endl;
}


Measured memory_bytes: 3836
function main(input){
    let numarray=input.split(' ').map(Number);
    let a,b,c;
    a=numarray[0];
    b=numarray[1];
    c=numarray[2];
    if (a<b && b<c){
        console.log('Yes');
    }else{
        console.log('No');
    }
}
main(require("fs").readFileSync("/dev/stdin","utf8"));


Measured memory_bytes: 15108
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;

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

    map<lint, lint> mp;
    mp[a]++;
    mp[b]++;
    mp[c]++;

    cout << (mp.size()==2 ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {

	int a, b;

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

	if (a > 0 && b > 0) {
		printf("Positive\n");
	}
	else if (a<0&&b<0) {
		int a2 = -a;
		int b2 = -b;
		if((a2-b2)%2==1){ printf("Positive\n"); }
		else{ printf("Negative\n"); }
	}
	else {
		printf("Zero\n");
	}

	return 0;
}

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

using namespace std;

int main(){
    int x, a;
    cin >>x >> a;
    int ans;
    if (x<a)
    {
        ans = 0;
    }else
    {
        ans = 10;
    }

    cout << ans << endl;
    
}

Measured memory_bytes: 256
#include <queue>
#include <string>
#include <iostream>
using namespace std;
int main()
{
    string cmd;
    priority_queue<int> Q;
    int n,k;
    while(cin >> cmd && cmd != "end")
    {
        if(cmd == "insert")
        {
            cin >> k;
            Q.push(k);
        }
        else    if(cmd == "extract")
                {
                    n = Q.top();
                    Q.pop();
                    cout << n << endl;
                }
    }
}


Measured memory_bytes: 7016
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef pair<double,double> pdd;
#define MEM(a, b) memset(a, (b), sizeof(a))
#define SZ(i) ll(i.size())
#define FOR(i, j, k, in) for (ll i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (ll i=j ; i>=k ; i-=in)
#define REP(i, j) FOR(i, 0, j, 1)
#define REP1(i,j) FOR(i, 1, j+1, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)
#define ALL(_a) _a.begin(),_a.end()
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define X first
#define Y second
#ifdef tmd
#define debug(...) do{\
    fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<" ,";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,deque<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
#else
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
#endif

const ll MOD = 1000000007;
const ll INF = 0x3f3f3f3f3f3f3f3f;
// const ll MAXN = 

ll n;
pii work[200005];
/********** Good Luck :) **********/
int main()
{
    IOS();
    cin >> n;
    REP (i,n) {
        cin >> work[i].X >> work[i].Y;
    }

    sort(work,work+n,[&](pii a,pii b) {
        return a.Y < b.Y;
    });

    ll cur = 0;
    REP (i,n) {
        cur += work[i].X;
        if (cur > work[i].Y) {
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;


    return 0;
}


Measured memory_bytes: 3328
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <chrono>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

long long calc_xor(ll in) {
    if (in <= 0)
        return 0;
    else if (in == 1)
        return 1;
    else if (in == 2)
        return 3;
    else if (in == 3)
        return 0;
    int k = 0;
    ll tmp = in, d, ret = 0;
    while (tmp > 1) {
        tmp >>= 1;
        k += 1;
    }
    d = in - pow(2, k);
    if (d == 0)
        return in;
    else if (d % 2 == 0) {
        ret += pow(2, k);
    }
    ret += calc_xor(d);
    return ret;
}

int main() {
    ll A, B, ans;
    cin >> A >> B;
    ans = calc_xor(B) ^ calc_xor(A - 1);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
// 14.01.2018

/*
C - Traveling
Time limit : 2sec / Memory limit : 256MB
Score : 300 points
Problem Statement
AtCoDeer the deer is going on a trip in a two-dimensional plane.
In his plan, he will depart from point (0,0) at time 0,
then for each i between 1 and N (inclusive), he will visit point (xi,yi) at time ti.
If AtCoDeer is at point (x,y) at time t,
he can be at one of the following points at time t+1: (x+1,y), (x?1,y), (x,y+1) and (x,y?1).
Note that he cannot stay at his place. Determine whether he can carry out his plan.
Constraints
    1 <= N <= 10^5
    0 <= xi <= 10^5
    0 <= yi <= 10^5
    1 <= ti <= 10^5
    ti < ti+1 (1 <= i <= N-1)
    All input values are integers.
Input
Input is given from Standard Input in the following format:
N
t1 x1 y1
t2 x2 y2
:
tN xN yN
Output
If AtCoDeer can carry out his plan, print Yes; if he cannot, print No.

*/

# include <iostream>
# include <iomanip>
# include <cstdio>
# include <cstdlib>
# include <cmath>
# include <cstring>
# include <vector>
# include <stack>
# include <queue>
# include <algorithm>


//# define __TRR__


# define lint  long long int


using namespace std;


int n, m, d, t, ti, ti1, xi, yi, xi1, yi1;
bool ok;


int main ()
{
# ifdef __TRR__
   freopen ("A.TXT", "r", stdin);
   freopen ("A.OUT", "w", stdout);
# endif

   cin >> n;

# ifdef __TRR__
   cout << "n = " << n << endl;
# endif

   ok = true;
   for ( int i (0); i < n; i++ )
   {
      cin >> ti1 >> xi1 >> yi1;

# ifdef __TRR__
   cout << "t = " << ti1 << "  xi = " << xi1 << "  yi = " << yi1 << endl;
# endif

      d = abs (xi1 - xi) + abs (yi1 - yi);
      t = abs (ti1 - ti);

      if ( d > t || abs (d - t) % 2 != 0 )
      {
         ok = false;
         break;
      }

      ti = ti1, xi = xi1, yi = yi1;
   }

   if ( ok )
      cout << "Yes";
   else
      cout << "No";

   return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef complex<double> P;

P project(P a,P b,P c){
  b-=a,c-=a;
  return a+b*real(c/b);
}

int main(){
  int n;
  double ax,ay,bx,by,cx,cy;
  cin>>ax>>ay>>bx>>by>>n;
  while(n--){
    cin>>cx>>cy;
    P p=project(P(ax,ay),P(bx,by),P(cx,cy));
    printf("%.8f %.8f\n",p.real(),p.imag());
  }
  return 0;
}

Measured memory_bytes: 1256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;

//typedef pair<int,int> P;

int main(){
	char c;
	scanf("%c",&c);

	if (c =='a'|| c =='e'|| c =='i'|| c =='o'|| c =='u'){
		printf("vowel\n");
	}else{
		printf("consonant\n");
	}

		return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

class UnionFind:
    def __init__(self, numV):
        self.pars = list(range(numV))
        self.ranks = [0] * numV
        self.sizes = [1] * numV
    def getRoot(self, x):
        par = self.pars[x]
        if par != x:
            self.pars[x] = par = self.getRoot(par)
        return par
    def merge(self, x, y):
        x, y = self.getRoot(x), self.getRoot(y)
        sx, sy = self.sizes[x], self.sizes[y]
        if x == y: return (0, 0)
        if self.ranks[x] < self.ranks[y]:
            self.pars[x] = y
            self.sizes[y] += sx
        else:
            self.pars[y] = x
            self.sizes[x] += sy
            if self.ranks[x] == self.ranks[y]:
                self.ranks[x] += 1
        return (sx, sy)
    def isSame(self, x, y):
        return self.getRoot(x) == self.getRoot(y)
    def updatePars(self):
        for v in range(len(self.pars)):
            self.getRoot(v)
    def getSize(self, x):
        return self.sizes[self.getRoot(x)]

N, M, K = map(int, input().split())
UF = UnionFind(N)
anss = [-1] * N
for _ in range(M):
    A, B = map(int, input().split())
    A, B = A-1, B-1
    UF.merge(A, B)
    anss[A] -= 1
    anss[B] -= 1

for i in range(N):
    anss[i] += UF.getSize(i)

for _ in range(K):
    C, D = map(int, input().split())
    C, D = C-1, D-1
    if UF.isSame(C, D):
        anss[C] -= 1
        anss[D] -= 1

print(' '.join(map(str, anss)))


Measured memory_bytes: 23020
let inputString = "";
let currentLine = 0;
process.stdin.on("data", (data) => {
  inputString += data;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}
function main() {
  let [totalPeople, t] = readLine()
    .split(" ")
    .map((n) => parseInt(n));
  const graph = {};
  const seenCouple = {};
  while (t--) {
    let [p1, p2] = readLine()
      .split(" ")
      .map((n) => parseInt(n));

    if (!seenCouple[`${p1}-${p2}`]) {
      seenCouple[`${p1}-${p2}`] = true;

      if (!graph[p1]) graph[p1] = { [p2]: true };
      else graph[p1][p2] = true;
      if (!graph[p2]) graph[p2] = { [p1]: true };
      else graph[p2][p1] = true;
    }
  }

  let max = 1;
  let visited = {};
  for (let key in graph) {
    if (!visited[key]) {
      const stack = [key];
      let count = 0;
      while (stack.length) {
        const node = stack.pop();
        visited[node] = true;
        count++;
        for (let key in graph[node]) {
          if (!visited[key]) {
            visited[key] = true;
            stack.push(key);
          }
        }
      }
      max = Math.max(max, count);
    }
  }
  console.log(max);
}


Measured memory_bytes: 193596
#include<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
const ll N = 16 ;
ll dp[(1<<16)], n, a[N][N], Q[(1<<N)]; 
int main()
{
	scanf("%lld", &n) ;
	for(int i = 0 ; i < n ; i ++)
		for(int j = 0 ; j < n ; j ++) 
			scanf("%lld", &a[i][j]) ;
	for(int mask = 3 ; mask < (1<<n) ; mask ++){
		int x = log2(mask & -mask) ; 
		Q[mask] = Q[mask^(1<<x)] ;
		for(int i = 0 ; i < n ; i ++) 
			if(((1<<i) & mask) > 0) Q[mask] += a[x][i];	
	}
	for(int mask = 3 ; mask < (1<<n) ; mask ++){
		if(__builtin_popcount(mask) <= 1) continue ;
		int x = log2(mask & -mask) ;
		int M = mask ^ (1<<x), MASK = M;
		dp[mask] = max(dp[mask], dp[M]) ;
		while(M){
			dp[mask] = max(dp[mask], dp[MASK^M] + Q[M|(1<<x)]) ;
			M = (M-1)&MASK ;
		}	
	}
	cout << dp[(1<<n)-1] ;
}

Measured memory_bytes: 1280
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int n = sc.nextInt();
            if (n == 0) {
                sc.close();
                return;
            }
            int s[] = new int[n];
            for (int i = 0; i < n; i++) {
                s[i] = sc.nextInt();
            }
            double sum = 0;
            for(int i=0;i<n;i++){
                sum += s[i];
            }
            double ave = (double)sum / n;
            double arufa = 0;
            for(int i=0;i<n;i++){
                arufa += (s[i] - ave) * (s[i] - ave);
            }
            System.out.println(Math.sqrt(arufa / n));
        }
    }
}


Measured memory_bytes: 31044
#include <stdio.h>
#include <math.h>

int main(void)
{
	int w, i, j, sum, i2[20], wc;
	
	while (scanf("%d", &w) != EOF){
		i = 0;
		sum = 0;
		wc = w;
		while (w != 0){
			if (w % 2 == 1){
				printf("%.0lf", pow(2, i));
				sum += pow(2, i);
				if (sum == wc)puts("");
				else printf(" ");
			}
			w /= 2;
			i++;
		}
	}
	
	return (0);
}

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

int main()
{
    int i, coun=0;
    string s;

    cin>>s;


    for(i=0; i<4; i++)
    {
        if(s[i] == '+')
            coun++;
        else if(s[i] == '-')
            coun--;
    }
    cout<<coun;


}


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

typedef struct {
  int value;
  char mark;
}card;

void bsort(card *C,int N){
  card t;
  for (int i=0;i<N;i++){
    for (int j=N-1;j>i;j--){
      if (C[j].value < C[j-1].value){
	t=C[j];
	C[j]=C[j-1];
	C[j-1]=t;
      }
    }
  }
}

void ssort(card *C,int N){
  card t;
  int minj;
  for (int i=0;i<N;i++){
    minj=i;
    for (int j=i;j<N;j++){
      if (C[j].value<C[minj].value)minj=j;
    }
    t=C[i];
    C[i]=C[minj];
    C[minj]=t;
  }
}

int isstable(card *ori, card *srt,int N){
  int i=0,flg;
  while (i<N){
    flg=0;
    for (int j=0;j<N;j++){
      //cout << srt[i].mark << srt[i].value << " " << i << endl;
      if (srt[i].value==ori[j].value && srt[i].mark==ori[j].mark){
	if (i+1<N && srt[i].value==srt[i+1].value)i++;
	else{
	  flg=1;
	  i++;
	  break;
	}
      }
    }
    if (flg) continue;
    else return 0;
  }
  return 1;
}

int main(){
  card o[40],b[40],s[40];
  int N,i;
  char t[5];

  cin >> N;
  for (i=0;i<N;i++){
    cin >> t;
    o[i].mark=t[0];
    o[i].value=t[1]-'0';
    
    b[i]=s[i]=o[i];
  }

  bsort(b,N);
  ssort(s,N);

  for (i=0;i<N-1;i++)cout << b[i].mark << b[i].value << " ";
  cout << b[i].mark << b[i].value << endl;
  if (isstable(o,b,N))cout << "Stable" << endl;
  else cout << "Not stable" << endl;
  
  for (i=0;i<N-1;i++)cout << s[i].mark << s[i].value << " ";
  cout << s[i].mark << s[i].value << endl;
  if (isstable(o,s,N))cout << "Stable" << endl;
  else cout << "Not stable" << endl;
  
  return 0;
}

Measured memory_bytes: 3080
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
set<int>Q;
int main(){
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	while(n--){
		int tmp;
		cin>>tmp;
		Q.insert(tmp);
	}
	cout<<Q.size();
	return 0;
}


Measured memory_bytes: 256
<?php

$is_honban = 1;

if ($is_honban) {
  //----------------------------------------------------------------------------------
  // Input for honban
  //----------------------------------------------------------------------------------
  $sc = new Scanner();
  $a = array();
  $a[] = $sc->nextInt();
  $a[] = $sc->nextInt();
  $a[] = $sc->nextInt();
  $a[] = $sc->nextInt();
  $a[] = $sc->nextInt();

//  $t = array();
//  $d = array();
//  for ($i = 0; $i < $n; $i++) {
//    $t[] = $sc->next();
//    $d[] = $sc->next();
//  }


} else {
  //----------------------------------------------------------------------------------
  // Input for test
  //----------------------------------------------------------------------------------
  error_reporting(E_ERROR | E_WARNING | E_PARSE);

  $n = 8;
  $q = 3;
  $s = 'AABCBDBA';
  $t = array('A','B','A');
  $d = array('L','R','R');



}
//----------------------------------------------------------------------------------
// Main
//----------------------------------------------------------------------------------

$ans = 0;

$k = min(($a[0]-1) % 10, ($a[1]-1) % 10, ($a[2]-1) % 10, ($a[3]-1) % 10, ($a[4]-1) % 10);
for ($i = 0; $i < 5; $i++) {
  if (($a[$i]-1) % 10 == $k) { break; }
}
for ($j = 0; $j < 5; $j++) {
  if ($j == $i) {
    $ans += $a[$i];
  } else {
    $ans += ceil($a[$j]/10)*10;
  }
}




//----------------------------------------------------------------------------------
// Output
//----------------------------------------------------------------------------------
out::println($ans);



//----------------------------------------------------------------------------------
// Ref: https://qiita.com/yoshikyoto/items/6924478283dbdd549e4b
//----------------------------------------------------------------------------------
class Scanner {
  private $arr = array();
  private $count = 0;
  private $pointer = 0;
  public function next() {
    if($this->pointer >= $this->count) {
      $str = trim(fgets(STDIN));
      $this->arr = explode(' ', $str);
      $this->count = count($this->arr);
      $this->pointer = 0;
    }
    $result = $this->arr[$this->pointer];
    $this->pointer++;
    return $result;
  }
  public function hasNext() {
    return $this->pointer < $this->count;
  }
  public function nextInt() {
    return (int)$this->next();
  }
  public function nextDouble() {
    return (double)$this->next();
  }
}

class out {
  public static function println($str = "") {
    echo $str . PHP_EOL;
  }
}

?>


Measured memory_bytes: 3700
#include <iostream>
#include <fstream>
#include <string> 
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <functional>

using namespace std;
using ll = long long;

#define FOR(i, m, n) for(int i = (m);i < (n);i++)
#define REP(i,n) for(int i = 0; i < int(n); i++)
#define VI vector<int>
#define VVI vector<vector<int>>
#define VVVI vector<vector<vector<int>>>
#define VL vector<ll>
#define VVL vector<vector<ll>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define PAIR pair<int,int>
#define MP make_pair
#define VP vector<pair<int,int>>
#define VS vector<string>
#define QUE queue<int>
#define DEQ deque<int>
#define PQUE priority_queue<int> //5,5,4,3,3,2,...
#define REPQUE priority_queue<int, vector<int>, greater<int>> //1,1,2,3,4,4,5,...
#define SUM(obj) accumulate((obj).begin(), (obj).end(), 0)
#define SORT(obj) sort((obj).begin(), (obj).end()) // 1,2,3,4,5...
#define RESORT(obj) sort((obj).begin(), (obj).end(), greater<int>()) // 5,4,3,2,1...
#define UB(obj,n) upper_bound((obj).begin(), (obj).end(), n) //itr > n
#define LB(obj,n) lower_bound((obj).begin(), (obj).end(), n) //itr>= n

const ll MOD = (ll)1e9 + 7;

int main() {
	int A, B;
	cin >> A >> B;
	if (A + B >= 10) { 
		cout << "error" << endl;
		return 0;
	}
	cout <<A+B<< endl;
	return 0;
}


Measured memory_bytes: 256
' Imports System.Collections.Generic
' Imports System.Text.RegularExpressions

Class Main
    Public Shared Sub Main()
        Dim X As Integer = Console.ReadLine()
        Dim rm As Integer = X Mod 500
        Console.WriteLine(Math.Floor(X / 500) * 1000 + Math.Floor(rm / 5) * 5)
    End Sub
End Class


Measured memory_bytes: 11220
#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,sum=0,fo;
    cin >> n;
    fo=n;
    while(fo!=0)
    {
        sum+=(fo%10);
        fo/=10;
    }
    if(n%sum==0)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int a, b;
  	scanf("%d %d",&a, &b);
  	int array[]={1,2,3};
  	for(int i=0;i<3;i++){
    	if(array[i]!=a && array[i]!=b) printf("%d\n",array[i]);
    }

    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env pypy3
import collections
import itertools as it
import math
#import numpy as np
 
n  = int(input())
#  = int(input())
#  = map(int, input().split())
#  = list(map(int, input().split()))i
xy = []
for _ in range(n):
    a = int(input())
    xy.append([tuple(map(int, input().split())) for _ in range(a)])
#
# c = collections.Counter()

for i in range(2 ** n): # 嘘つき・正直者の総当り
    is_honest = [not(bool(int(s))) for s in list('{:015b}'.format(i)[-n:])]
    is_ok = True
    for i, h in enumerate(list(is_honest)): # 人の総当り
        for x, y in xy[i]: # 証言の総当り
            if is_honest[i] == False:
                continue

            x = x - 1
            v = bool(int(y))
            
            #print(is_honest[x], bool(y), v, )
            if is_honest[x] == v:
                pass
            else:
                is_ok = False
    
    if is_ok:
        i#print(is_honest)
        print(sum(is_honest))
        break


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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(ll i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const int MOD = 1000000007;
#define MAX_N 100010

ll N;
set<ll> cand;
bool isUsed[MAX_N] = {};

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

signed main()
{
    cin >> N;
    if(N == 3) {
        printf("2 5 63\n");
        return 0;
    }
    else if(N == 4) {
        printf("2 5 20 63\n");
        return 0;
    }

    // 30000 以下の 2 と 3 の倍数を取得
    for(ll i = 2; i <= 30000; i += 2) { cand.insert(i); }
    for(ll i = 3; i <= 30000; i += 3) { cand.insert(i); }

    // 最後の 1 つ以外は cand で埋める
    ll last = 0;
    ll odd = 0;
    ll sum = 0;
    ll ind = 0;
    for(auto& c : cand) {
        if(ind >= N-1) { break; }
        printf("%lld ", c);
        isUsed[c] = true;
        last = c;
        sum += c;
        if(c % 2 != 0) { odd++; }
        ind++;
    }

    ll ans = 0;
    if(odd % 2 == 0) {
        for(ans = 4; ans <= 30000; ++ans) {
            if(ans % 2 == 0 && !isUsed[ans] &&
                   gcd(sum - 3 + ans, (ll)3) != 1 && gcd(sum, ans) != 1) { break; }
        }
        assert(ans <= 30000);
    } else {
        for(ans = 5; ans <= 30000; ++ans) {
            if(ans % 2 != 0 && !isUsed[ans] &&
                   gcd(sum - 3 + ans, (ll)3) != 1 && gcd(sum, ans) != 1) { break; }
        }
        assert(ans <= 30000);
    }
    printf("%lld\n", ans);

    return 0;
}


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

int main() {

	const int N = 30;
	bool food[N][N] = { false };
	int tate, yoko;
	int cnt, like, ans = 0;

	cin >> tate >> yoko;

	for (int i = 0; i < tate; i++) {
		cin >> cnt;
		for (int k = 0; k < cnt; k++) {
			cin >> like;
			food[i][like - 1]++;
		}
	}

	/*//debug
	for (int i = 0; i < tate; i++) {
		for (int k = 0; k < yoko; k++) {
			food[i][k] ? cout << "T " : cout << "F ";
		}
		cout << endl;
	}
	*/

	for (int i = 0; i < yoko; i++) {
		int counter = 0;
		for (int k = 0; k < tate; k++) {
			if (food[k][i])counter++;
		}
		if (counter == tate)ans++;
	}

	cout << ans << endl;

	return 0;
	
}


Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
 
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
 
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
 
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
 
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
 
    ($next:expr, Chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
 
    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };
 
    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        l: f64,
    }

    let len = l / 3.0;
    println!("{:.12}", len.powf(3.0));
}


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

#define rep(i,a,b)      for(int i=a;i<=b;i++)
#define revp(i,a,b)     for(int i=b;i>=a;i--)

int n,cnt=0;
string s;
int main()
{

    cin>>n>>s;
    rep(i,0,n-1)
        if(s[i]=='A' and s[i+1]=='B' and s[i+2]=='C')
            cnt++;
    cout<<cnt;
}




Measured memory_bytes: 256
N, Q = (int(i) for i in input().split())
S = input()

code = [0] * N
cnt = 0
index = 0
flag = False
for chr in S: 
    if chr == "A":
            flag = True
    elif chr == "C" and flag == True:
        cnt += 1
        flag = False
    else:
        flag = False
    code[index] = cnt
    index += 1

for num in range(Q):
    l, r = (int(i) for i in input().split())
    print(code[r-1] - code[l-1])

Measured memory_bytes: 53592
a, b = map(int, input().split())

if a != 1 and b != 1:
    if a > b:
        print("Alice")
    elif a == b:
        print("Draw")
    else:
        print("Bob")
elif a == 1 and b != 1:
    print("Alice")
elif a == b == 1:
    print("Draw")
else:
    print("Bob")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define rep(a,b) for(int i=a;i<b;++i)

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < 20; ++i) {
    if (n < (1 << (i+1))) {
      cout << (1<<i) << endl;
      break;
    }
  }

  return 0;
}

Measured memory_bytes: 3620
#include <iostream>
#include<set>
#include<vector>
#include<string>
#include<iterator>
#include<iomanip>
#include<cmath>
#include<map>
#include<string.h>
#include<algorithm>

using namespace std;
void ll(){
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(0);
}

int main() {

	ll();

	int a, b, x;
	cin >> x >> a >> b;
	if (abs(x - b) < abs(x - a))
		cout << "B" << endl;
	else
		cout << "A" << endl;

}

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

int main() {
  int N;
  cin >>N;
  
  for(int i=0;i<N;i++){
    char S;
    cin >>S;
    
    if(S=='Y'){
      cout << "Four" <<endl;
      break;
    }
    else if(i==N-1){
      cout << "Three" <<endl;
    }
  }
}

Measured memory_bytes: 256