akhauriyash/Code-Regression huggingface dataset:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            ans += 1 * ((i * 500 + j * 100 + k * 50) == X)
print(ans)


Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define mrep(i,j,n) for(int i = j; i < n; i++)
#define reps(i,n) for(int i = 1; i <= n; i++)
#define rrep(i,n) for(int i = n-1; i >= 0; i--)
#define rreps(i,n) for(int i = n; i >= 1; i--)
#define co(x) cout << x <<endl
#define cs(x) cout << x <<" "
#define el cout<<endl
#define cer(x) cerr << x <<endl
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define ERASE(x,val) x.erase(remove(ALL(x), val), x.end())
#define vi vector<int> 
#define vvi vector<vector<int>> 
#define vpii vector<pair<int,int>> 
#define vl vector<ll> 
#define vvl vector<vector<ll>> 
#define vb vector<bool> 
#define vvb vector<vector<bool>>
#define vs vector<string> 
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
ll mod = 1e9 + 7;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a * b / g; }
bool is_prime(ll x) { for (ll i = 2; i * i <= x; i++) { if (x % i == 0)return false; } return true; }

int h, w;
vs maze;
vvi dist;
int inf = 1001000;
int dy[4] = { 0,-1,0,1 };
int dx[4] = { 1,0,-1,0 };

queue<int> que_x;
queue<int> que_y;

void bfs(int y, int x)
{
	rep(i, 4)
	{
		int ny = y + dy[i];
		int nx = x + dx[i];
		if (0 <= ny && ny < h && 0 <= nx && nx < w
			&& maze[ny][nx] == '.' && dist[ny][nx]>dist[y][x] + 1)
		{
			dist[ny][nx] = dist[y][x] + 1;
			que_y.push(ny);
			que_x.push(nx);
		}
	}
}

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

	int n;
	cin >> n;
	vvi a(n, vi(3));
	rep(i, n)rep(j,3) cin >> a[i][j];
	vvi dp(n, vi(3));
	rep(j, 3)dp[0][j] = a[0][j];
	reps(i, n - 1)rep(j, 3)rep(k, 3)
	{
		if (j != k)
		{
			chmax(dp[i][j], dp[i - 1][k] + a[i][j]);
		}
	}
	int ans = 0;
	rep(i, 3)chmax(ans, dp[n - 1][i]);
	co(ans);
	return 0;
}


Measured memory_bytes: 11264
S = input()
fst, snd = S[:2], S[2:]

def isMonth(s):
    return 1 <= int(s) <= 12

table = {
    (False, True):  'YYMM',
    (True,  False): 'MMYY',
    (True,  True):  'AMBIGUOUS',
    (False, False): 'NA'
}
print(table[(isMonth(fst), isMonth(snd))])


Measured memory_bytes: 2940
// template version 1.12
using namespace std;
#include <iostream>
#include <bits/stdc++.h>

// varibable settings
#define infile "../test/sample-1.in"
#define int long long //{{{
const int INF=1e18;
const int MOD=1e9+7; //}}}

// define basic macro {{{
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ub upper_bound
#define lb lower_bound
#define posl(A, x) (lower_bound(all(A), x)-A.begin())
#define posu(A, x) (upper_bound(all(A),x)-A.begin())
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

#if defined(PCM) || defined(LOCAL)
  #include "lib/dump.hpp"
#else
  #define dump(...) 42
  #define dump_1d(...) 42
  #define dump_2d(...) 42
#endif
//}}}

int solve(){
  int n;cin>>n;
  vector<int> a(n);

  set<int> s;
  map<int, int> d;
  rep(i, n) {
    cin>>a[i];
    s.insert(a[i]);
    d[a[i]]++;
  }

  dump(a);

  if (sz(s)>=4){
    cout << "No" << endl;
    return 0;
  }
  else if(sz(s)==1 and a[0]==0){
    cout << "Yes" << endl;
    return 0;
  }
  else if(sz(s)==1){
    cout << "No" << endl;
    return 0;
  }
  else if(sz(s)==2){
    if (n%3!=0){
      cout << "No" << endl;
      return 0;
    }
    if (d[0]!=n/3){
      cout << "No" << endl;
      return 0;
    }
    if (d[0]==n/3){
      cout << "Yes" << endl;
      return 0;
    }
  }
  else if(sz(s)==3){
    if (n%3!=0){
      cout << "No" << endl;
      return 0;
    }

    vi x;
    each(el, s){
      x.pb(el);
      if (d[el]!=n/3) {
        cout << "No" << endl;
        return 0;
      }
    }
    int p,q,r;
    p = x[0];
    q = x[1];
    r = x[2];

    if ((p^q)==r){
      cout << "Yes" << endl;
      return 0;
    }

    if ((p^r)==q){
      cout << "Yes" << endl;
      return 0;
    }

    if ((q^r)==p){
      cout << "Yes" << endl;
      return 0;
    }

    cout << "No" << endl;
    return 0;
  }

  assert(false);

  return 0;
}

signed main() { //{{{
#ifdef INPUT_FROM_FILE
  std::ifstream in(infile);
  std::cin.rdbuf(in.rdbuf());
#endif
  solve();
  return 0;
} //}}}


Measured memory_bytes: 9344
#define _USE_NATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <random>
#include <tuple>


using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
#define EPS 1e-9
const int INF = 1050000000;
const long long LINF = 1LL << 60;
const ll MOD = 1e9 + 7;
const int MINF = -1050000000;

int n, a, b, c, d;
string s;
bool cd = false;

int next_action(int now_position, int you, bool is_exist) {
	int next;
	if (is_exist) return now_position;
	if (now_position + 1 > n || now_position + 2 > n) next = -1;
	if (cd) {
		if (s[now_position + 1] == '.') next = 1;
		else if (s[now_position + 2] == '.') next = 2;
		else next = -1;
	}
	else {
		if (s[now_position + 1] == '.' && now_position + 1 != you) next = 1;
		else if (s[now_position + 2] == '.'&& now_position + 2 != you) next = 2;
		else next = -1;
	}
	return next;
}

int main() {
	
	cin >> n >> a >> b >> c >> d >> s;
	a--;
	b--;
	c--;
	d--;
	n--;

	bool a_ans = false, b_ans = false, ok = false;
	int a_now = a, b_now = b, next;

	if (c > d) {
		cd = true;
		for (int i = b; i <= d; ++i) {
			if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
				ok = true;
			}
		}
	}
	else ok = true;

	while (ok) {
		if (a_now == c) a_ans = true;
		if (b_now == d) b_ans = true;
		if (a_ans && b_ans) break;

		next = next_action(b_now, a_now, b_ans);
		if (next < 0) break;
		if (b_ans == 0) b_now += next;

		next = next_action(a_now, b_now, a_ans);
		if (next < 0) break;
		if (a_ans == 0)a_now += next;


	}
	
	if (a_ans && b_ans) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}


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


bool isEnoughSmall(double q, double x) {
  return fabs(x*x*x-q) < 0.00001*q;
}

double solve(double q) {
  double x = q/2.0;
  while(!isEnoughSmall(q,x)) x = x - (x*x*x-q)/(3.0*x*x);
  return x;
}

int main() {
  double q;
  while(cin >> q && q != -1) printf("%.6f\n", solve(q));
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <numeric>
#include <ctype.h>
#include <cstdlib>


using namespace std;


int main()
{
	string s, p;

	cin >> s;
	cin >> p;

	s += s;

	if (s.find(p) == string::npos)
		cout << "No" << endl;
	else
		cout << "Yes" << endl;

		return 0;
}

Measured memory_bytes: 3176
import math
a, b, h, m = list(map(int, input().split()))

if h / 12 + m / 360 >= m / 60:
	dif = min(h / 12 + m / 720 - m / 60, 1 + m / 60 - h / 12 - m / 720)
else:
	dif = min(1 + h / 12 + m / 720 - m / 60, m / 60 - h / 12 - m / 720)

ans_sq = a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(dif * 360))
print(math.sqrt(ans_sq))

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
using P = pair<ll, ll>;
using V = vector<ll>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i, n) for(ll i=1;i<=(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define INF 1000000000

bool dpx[10000][20001];
bool dpy[10000][20001];

void solve_abc_d() {
	ll n;
	string s;
	string ans = "No";

	cin >> s;
	n = s.size();

	ll x, y;
	cin >> x >> y;

	bool is_x = true;
	V xv, yv;
	ll val = 0;
	rep(i, n) {
		if (s[i] == 'F') {
			val++;
		}
		else {
			if (is_x) {
				xv.push_back(val);
			}
			else {
				yv.push_back(val);
			}
			is_x = !is_x;
			val = 0;
		}
	}
	if (val != 0) {
		if (is_x) {
			xv.push_back(val);
		}
		else {
			yv.push_back(val);
		}
	}

	ll offset = 10000;

	dpx[0][offset] = true;
	rep(i, xv.size()) {
		rep(j, offset * 2) {
			if (dpx[i][j]) {
				if (i == 0) {
					dpx[i + 1][j + xv[i]] = true;
				}
				else {
					dpx[i + 1][j + xv[i]] = true;
					dpx[i + 1][j - xv[i]] = true;
				}
			}
		}
	}
	if (!dpx[xv.size()][x + offset]) {
		cout << "No" << endl;
		return;
	}

	dpy[0][offset] = true;
	rep(i, yv.size()) {
		rep(j, offset * 2) {
			if (dpy[i][j]) {
				dpy[i + 1][j + yv[i]] = true;
				dpy[i + 1][j - yv[i]] = true;
			}
		}
	}

	if (!dpy[yv.size()][y + offset]) {
		cout << "No" << endl;
		return;
	}

	cout << "Yes" << "\n";
}

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

	solve_abc_d();

	return 0;
}


Measured memory_bytes: 154368
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // TODO 自動生成されたメソッド・スタブ

    	Scanner sc = new Scanner(System.in);

    	int A = sc.nextInt();
    	int B = sc.nextInt();
    	int T = sc.nextInt();

    	double val = (T + 0.5) / A;
    	BigDecimal val2 = new BigDecimal(val);
    	BigDecimal seijo = val2.setScale(0, BigDecimal.ROUND_DOWN);

    	int val3 = seijo.intValue();

    	System.out.println( B * val3);

    	sc.close();
    }


}

Measured memory_bytes: 21844
<?php
//error_reporting(0);
$s = trim(fgets(STDIN));
//list($N,$W) = explode(" ",trim(fgets(STDIN)));
//$h = explode(" ",trim(fgets(STDIN)));

$k="keyence";
if (substr($s,0,7)==$k || substr($s,-7)==$k) {
  printf("YES\n");
  exit;
}
for($i=0;$i<7;$i++) {
  if ($k[$i]!=$s[$i]) break;
}
$l = (7-$i) * -1;
if (substr(substr($s,$i,strlen($s)),$l)==substr($k,$l)) {
  printf("YES\n");
}
else {
  printf("NO\n");
}


Measured memory_bytes: 4856
import heapq
n, m = map(int, input().split())
a = list(map(int, input().split()))

heap = []
for i in a:
    heapq.heappush(heap, -i)


for i in range(m):
    x = - heapq.heappop(heap)
    x = x / 2
    heapq.heappush(heap, - x)



print(sum(map(lambda n: int (-n), heap)))


Measured memory_bytes: 87448
x = input().split()
A = []
for i in x:
    try:
        A.append(int(i))
    except:
        b = A.pop()
        a = A.pop()
        if i == '+':
            A.append(a + b)
        if i == '-':
            A.append(a - b)
        if i == '*':
            A.append(a * b)
print(A.pop())

Measured memory_bytes: 7636
/*
Problem :
Algorithm :
Status :
*/
#include<bits/stdc++.h>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#define DEBUG printf("Passing Line %d in Function [%s].\n",__LINE__,__FUNCTION__);
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

const int INF = 0x3f3f3f3f;
const int MAXN = 2e5 + 5;

int n,top;
ll ans;
ll A[MAXN],B[MAXN],C[MAXN];

struct Vector{
    int x;
    ll y;

    Vector() {}
    Vector(int _x,ll _y) : x(_x),y(_y) {}

    friend Vector operator - (const Vector &a,const Vector &b){
        return Vector(a.x - b.x,a.y - b.y);
    }

    friend ll operator * (const Vector &a,const Vector &b){
        return 1ll * a.x * b.y - 1ll * a.y * b.x;
    }
};

Vector st[MAXN];

void Insert(Vector vec){
    while(top > 1 && (vec - st[top]) * (st[top] - st[top - 1]) <= 0)
        top--;
    st[++top] = vec;
}

int main(){
    // freopen("data.in","r",stdin);
    // freopen("data.out","w",stdout);
    scanf("%d",&n);
    for(int i = 1;i <= n;i++)
        scanf("%lld",&A[i]);
    for(int i = 1;i <= n;i++)
        scanf("%lld",&B[i]);
    int pos = max_element(A + 1,A + 1 + n) - A;
    rotate(A + 1,A + pos,A + 1 + n);
    rotate(B + 1,B + pos,B + 1 + n);
    A[n + 1] = A[1];
    B[n + 1] = B[1];
    for(int i = 2;i <= n;i++)
        C[i + 1] = 2 * (B[i] + C[i]) - C[i - 1];
    for(int i = 1;i <= n + 1;i++)
        A[i] -= C[i];
    for(int i = 1;i <= n + 1;i++)
        Insert(Vector(i,A[i]));
    for(int i = 1;i < top;i++){
        int d = st[i + 1].x - st[i].x;
        ans += st[i].y * (d + 1) + st[i + 1].y * (d - 1);
    }
    for(int i = 1;i <= n;i++)
        ans += C[i] * 2;
    printf("%.12lf\n",ans / (2.0 * n));
    return 0;
}

Measured memory_bytes: 11572
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF=1e9,MOD=1e9+7,ohara=1e6+10;
const ll LINF=1e18;
using namespace std;
    
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl
#define doublecout(a) cout<<fixed<<setprecision(15)<<a<<endl;
#define Cerr(x) cerr<<(x)<<endl
#define fi first
#define se second
#define P pair<ll,ll> 
#define m_p make_pair
#define V vector<ll> 
#define U_MAP unordered_map<ll,ll>
#define pq priority_queue<ll>
#define rpq priority_queue<ll,vector<ll>,greater<ll>>
#define p_b push_back
    
ll n,cnt,ans,a,b,c,d,tmp,tmpp,m,h,w,x,y,sum,pos,k;
ld doua;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
//int dy[]={-1,0,1,-1,1,-1,0,1};
//int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};
ll tate[1000][1000];//各頂点に配布する二進
ll rui[ohara];
    
//-------------------------↓↓↓↓↓↓------------------------
    
//------ 自分を天才だと信じる ------
    
int main(void){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    
    cin>>n;

    cnt=2;
    rui[0]=1;
    rrep(i,1,46){
        rui[i]=cnt;
        cnt*=2;
    }

    rep(i,n){
        tmp=i;
        while(1){
            rrrep(j,45,0){
                if(rui[j]<=tmp){
                    tmp-=rui[j];
                    tate[i][j+1]++;
                    break;
                }
            }
            if(tmp==0)break;
        }
    }
    rep(i,n){
        rrep(j,i+1,n){
            rep(k,46){
                if(tate[i][k]!=tate[j][k]){
                    if(j!=n-1)cout<<k<<" ";
                    else Cout(k);
                    break;
                }
            }
        }
    }
    return 0;
}

Measured memory_bytes: 6656
#include <iostream>

using namespace std;

int main(int argc, char const *argv[]) {
  int n;
  bool tf = false;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (4*i+7*j==n) {
        tf = true;
        break;
      }
    }
  }
  if (tf) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


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

#define all(a) (a).begin(), (a).end()
#define pb push_back
#define sz(a) (int)(a).size()

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;

int main() {

    //ifstream cin("defend.in");
    //freopen("defend.out", "w", stdout);
    //ifstream cin("input.txt");

    ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

    int n, m, k;
    cin >> n >> m >> k;

    for (int i = 0; i <= n; ++i) {
        for (int j = 0; j <= m; ++j) {
            int sum = i * m + j * n - 2 * i * j;
            if (sum == k) {
                cout << "Yes\n";
                return 0;
            }
        }
    }

    cout << "No\n";

}


Measured memory_bytes: 384
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
typedef unsigned int uint;
using namespace std;

int main(){
  string S;
  ll K;
  cin >> S >> K;
  int n = S.size();

  //S=11111159938なら5を
  //S=678....なら6を

  int pos=0;
  int atai;
  while(1){
    if(pos==n){
      cout << 1 << endl;
      return 0;
    }
    if(S[pos]=='1'){
      pos++;
    }else{
      atai = S[pos] - '0';
      break;
    }
  }

  //cout << "pos" << pos << "atai" << atai << endl;

  if(K<=pos){
    cout << 1 << endl;
  }else{
    cout << atai << endl;
  }
  return 0;
}


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

const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

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

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

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

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int x;
    cin >> x;
    if (x == 0) cout << 1 << endl;
    else cout << 0 << endl;
    return 0;
}


Measured memory_bytes: 3456
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = (1 << 30) - 1;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng; //use it by rng() % mod, shuffle(all(vec), rng)
///////////////////////////////////////////////////////////////////////////////////////////////////

void solve() {
	int sum = 0;
	int left = 0;
	rep(i, 0, 5) {
		int a; cin >> a;
		sum += (a + 9) / 10 * 10;
		MAX(left, (a + 9) / 10 * 10 - a);
	}
	cout << sum - left << "\n";
}

uint32_t rd() {
	uint32_t res;
#ifdef __MINGW32__
	asm volatile("rdrand %0" :"=a"(res) ::"cc");
#else
	res = std::random_device()();
#endif
	return res;
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
    cerr << fixed;
	cerr.precision(6);
	rng.seed(rd());
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
	if(!freopen("in.txt", "rt", stdin)) return 1;
#endif	
	solve();
    cerr << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}



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


int main(){
	int A,B,C; cin >> A >> B>> C;
	set<int> S;
	int i = 1;
	while(true){
		if(! S.count((A * i) % B)){
			S.insert((A * i) % B);
			i++;
		}
		else{
			break;
		}
	}
	if(S.count(C)) cout << "YES" <<  endl;
	else cout << "NO" << endl;
}

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

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int X = sc.nextInt();
		
		int g[] = new int[N];
		int kei =0;
		
		for(int i=0;i<N;i++) {
			g[i] = sc.nextInt();
			kei += g[i];
		}
		
		Arrays.sort(g);
		System.out.println(N+(X-kei)/g[0]);

	}
}

Measured memory_bytes: 23252
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <list>
#include <string>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <iomanip> // setprecisionを使用するのに必要 cout << fixed << setprecision(15) << p でpを小数点以下15桁表示
using namespace std;
#define REPD(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) REPD(i, 0, n)
typedef long long ll;
#define fin(ans) cout << (ans) << '\n'
/*

*/
int main()
{
    unsigned long long A,ans = 0;
    string B;
    cin >> A >> B;
    ans += (B[0] - '0') * A*100;
    if(B.length() >= 3)ans += (B[2] - '0') * A*10;
    if(B.length() >= 4)ans += (B[3] - '0') * A*1;
    //ll BB = B * 100;
    fin(ans/100);
    return 0;
}

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

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef vector<vector<long long>> VVL;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef tuple<int,int,int> tpl;

#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define EXIST(m,v) (m).find((v)) != (m).end()
#define LB(a,x) lower_bound((a).begin(), (a).end(), x) - (a).begin()
#define UB(a,x) upper_bound((a).begin(), (a).end(), x) - (a).begin()

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);--i)
#define RREP(i,n) RFOR(i,n,0)

#define en "\n"

constexpr double EPS = 1e-9;
constexpr double PI  = 3.1415926535897932;
constexpr int INF = 2147483647;
constexpr long long LINF = 1LL<<60;
constexpr long long MOD = 1000000007; // 998244353;

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

void Main(){
    int N; cin >> N;
    VI A(N); REP(i,N) cin >> A[i];

    VI l(N+1,0),r(N+1,0);
    REP(i,N) l[i+1] = max(A[i],l[i]);
    REP(i,N) r[N-1-i] = max(A[N-1-i],r[N-i]);

    REP(i,N) cout << max(l[i],r[i+1]) << en;
    return;
}

int main(void){
    cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);cout<<fixed<<setprecision(15);
    int t=1; //cin>>t;
    REP(_,t) Main();
    return 0;
}

Measured memory_bytes: 5584
#include <stdio.h>

int main(){
	int p[100],i;
	int cnt;
	scanf("%d",&i);
	for(cnt=0;cnt<i;cnt++){
		scanf("%d",&p[cnt]);
	}
	for(cnt=1;cnt<=i;cnt++){
		printf("%d",p[i-cnt]);
		if(cnt<i){
			printf(" ");
		}
	}
	printf("\n");
	return 0;
}

Measured memory_bytes: 600
#include <stdio.h>

int main(void)
{
	int num, game, array[32], i, n;
	
	while (scanf("%d", &n), n != 0){
		for (i = 0; i < n; i++){
			scanf("%d", &array[i]);
		}
		
		num = 32;
		game = 0;
		i = 0;
		while (1){
			if (game % 2 == 0){
				num -= (num - 1) % 5;
			}
			
			else {
				num -= array[i % n];
				i++;
			}
			
			if (num <= 0){
				num = 0;
				printf("%d\n", num);
				break;
			}
			
			printf("%d\n", num);
			
			game++;
		}
	}
	
	return (0);
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i, n) for(int (i)=0;(i)<(n);(i)++)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
bool custom1 (pair<int, int> a, pair<int, int> b) {
  return (a.first < b.first);
}
bool custom2(pair<int, int> a, pair<int, int> b) {
  return (a.second < b.second);
}

const int MAX = 200005;
const long long MOD = 1000000007;
const long long MODMOD = 998244353;

long long fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

long long gcd(long long a, long long b) {
  if(a % b == 0) return b;
  else return gcd(b, a % b);
}

int main() {
  int n;
  cin >> n;
  map<int, int> count;
  vector<int> d(n);
  rep(i, n) {
    cin >> d[i];
  }
  bool yes = true;
  if(d[0] != 0) yes = false;
  sort(d.begin(), d.end());
  rep(i, n) {
    count[d[i]]++;
  }
  if(count[0] != 1) yes = false;
  if(!yes) {
    cout << 0 << endl;
    return 0;
  }
  long long lim = d[n-1];
  long long ans = 1;
  long long prev = 1;
  for(int i=1;i<=lim;i++) {
    rep(j, count[i]) {
      ans *= prev;
      ans %= MODMOD;
    }
    prev = count[i];
  }

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


Measured memory_bytes: 5376
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;


int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;

    cout << n / 3 << '\n';

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <utility>
#include <math.h>
#include <stdexcept>
#include <algorithm>
#include <vector>
#include <cstring>
#include <cassert>
#include <string.h>

using namespace std;
#define  rep(i,n) for(int i=0;i<n;i++)
#define  rrep(i,n) for(int i=n-1;i>=0;i--)///n-1番目からn回
#define  REP(i,a,b) for(int i=a;i<b;i++) ///a番目からb回
#define  RREP(i,a,b) for(int i=a;i<b;i--)
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<string> vs;



//int arr[N]
////sort(arr,arr +N)

//vector <int> hoge
////sort(hoge.begin(),hoge.end());
///*min_element(hoge.begin(),hoge.end();　最小値　　　最大値はmax_element();

#define Ru(n)  ( ((n)+9)/10*10  ) //切りあげ
#define Rd(n)  ( ((n)-10)/10*10 +10 )	切り捨て

int gcd(int a,int b);
int main() {
	int n,k,ans;
	cin>>n>>k;
		cout<<n-k+1;
}







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

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdint>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>


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

using namespace std;

template <class T, class U>
istream& operator>>(istream& is, pair<T, U>& pair)
{
    is >> pair.first >> pair.second;
    return is;
}

template <class T>
istream& operator>>(istream& is, vector<T>& collection)
{
    for (auto& item : collection)
        is >> item;
    return is;
}

struct node_t {
    bool isFloor = false;
    int distance = 0;
    vector<int> next;
};

void solution()
{
    int H, W;
    cin >> H >> W;
    const int N = H * W;
    vector<node_t> graph(N);
    rep(i, N)
    {
        char c;
        cin >> c;
        graph[i].isFloor = c == '.';
        if (graph[i].isFloor) {
            if (i >= W && graph[i - W].isFloor) {
                graph[i - W].next.push_back(i);
                graph[i].next.push_back(i - W);
            }
            if (i % W > 0 && graph[i - 1].isFloor) {
                graph[i - 1].next.push_back(i);
                graph[i].next.push_back(i - 1);
            }
        }
    }
    int dmax = 0;
    rep(i, N)
    {
        if (graph[i].isFloor) {
            for (auto& n : graph){
                n.distance = numeric_limits<int>::max();
            }
            queue<int> visit_queue;
            graph[i].distance = 0;
            visit_queue.push(i);
            while (!visit_queue.empty()) {
                const int x = visit_queue.front();
                visit_queue.pop();
                const int next_d = graph[x].distance + 1;
                for (int n : graph[x].next){
                    if(graph[n].distance > next_d){
                        graph[n].distance = next_d;
                        visit_queue.push(n);
                    }
                }
            }
            for (auto& n : graph){
                if(n.distance != numeric_limits<int>::max() && n.distance > dmax){
                    dmax = n.distance;
                }
            }
        }
    }
    cout << dmax << '\n';
}

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


Measured memory_bytes: 256
X, Y = input().split()
d = {'A': 10, 'B': 11, 'C': 12, 'D': 13, 'E': 14, 'F': 15}
if d[X] > d[Y]:
    print('>')
elif d[X] == d[Y]:
    print('=')
else:
    print('<')

Measured memory_bytes: 38384
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <limits>
#include <numeric>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;

int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	if (c >= a && c <= b) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define str string
#define pb push_back
#define vc vector
#define ci cin
#define co cout
std::vector<ll> adj[200000];
bool vis[200000];
void dfs(ll src)
{
	vis[src]=true;
	for(auto u:adj[src])
	{
		if(!vis[u])
			dfs(u);
	}
}
// remove fropen in online judge
int main()
{ 
	 

	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
    	ll x,y;
    	cin>>x>>y;
    	adj[x].pb(y);
    	adj[y].pb(x);
    }
    ll ct=0;
    for(int i=1;i<=n;i++)
    {
    	if(!vis[i])
    		{dfs(i);
    			ct++;}
    }
    cout<<ct-1;
}


Measured memory_bytes: 12736
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;


int main(){
	int n;
	while(cin>>n){
		if(n==0)break;
		double minabs=INT_MAX;
		
		double len,wei,num,minnum;
		while(n--){
			cin>>num>>len>>wei;
			double dbmi=abs(22.0-wei/len/len*100*100);
			if(dbmi<minabs){
				minnum=num;
				minabs=dbmi;
			}
		}
		cout<<minnum<<endl;
	}
}

Measured memory_bytes: 856
#!/usr/bin/python3
# -*- coding: utf-8 -*-


"""
https://beta.atcoder.jp/contests/abc070/tasks/abc070_a
"""

import sys
import math
from inspect import currentframe

def debug(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args), file=sys.stderr)

N = int(input())

if str(N)[0] == str(N)[2]:
    print('Yes')
else:
    print('No')








Measured memory_bytes: 5224
#include <bits/stdc++.h>
#define int int64_t
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
#define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); -- (i))
#define REPP(i, n) for (int i = 1; (i) < (int)(n+1); ++ (i))
#define REPR(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i, m, n) for(int i=(m)-1; i>=(n); i--)
#define ALL(v) v.begin(), v.end()
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())
#define SORTR(c) sort((c).begin(),(c).end(),greater<int>());
#define BIT(n) (1LL<<(n))
#define PCNT(x) __builtin_popcountll(x)
#define GCD(x,y) __gcd(x,y)
#define LCM(x,y) x/__gcd(x,y)*y
#define PB push_back
#define MP make_pair
#define endl "\n"
#define yes cout << "Yes" << endl
#define no cout << "No" << endl
using namespace std;
using Graph = vector<vector<int> >;
using WeightedGraph = vector<vector<pair<int, int> > >;
typedef long double LD;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
const int INF = 2000000000;
const long double PI = acosl(-1);
const int MOD = 1000000007;
void print() {cout << endl;}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head; if (sizeof...(tail) != 0) cout << " ";print(forward<Tail>(tail)...);}
template <class T> void print(vector<T> &vec) {for (auto& a : vec) {cout << a; if (&a != &vec.back()) cout << " ";} cout << endl;}
template <class T> void print(vector<vector<T>> &df) { for (auto& vec : df) { print(vec);}}

int modpow(int N, int M){return M ? modpow(N * N % MOD, M / 2) * (M % 2 ? N : 1) % MOD : 1;}
int modcomb(int N,int M){ int x = 1, y = 1; for(int i = 1; i <= M; i++) {x = x * (N-i+1) % MOD; y = y * i % MOD;} return x * modpow(y, MOD-2) % MOD;}

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    int ans = 0;
    
    int X, Y;
    cin >> X >> Y;
    int x = 2*Y-X, y = 2*X-Y;
    if ((X+Y) % 3 != 0) {
        cout << ans << endl;
        return 0;
    }
    x /= 3;
    y /= 3;
    if (x < 0 || y < 0) {
        cout << ans << endl;
        return 0;
    }
    ans = modcomb(x+y,x);
    ans %= MOD;
    cout << ans << endl;

    
    
    return 0;
}

/*
cd ~/Desktop/Programming/AtCoder/contest/abc145/abc145_d && sh shellscripts/test_cpp.sh
cd ~/Desktop/Programming/AtCoder/contest/abc145/abc145_d && sh shellscripts/etest_cpp.sh
cd ~/Desktop/Programming/AtCoder/contest/abc145/abc145_d && sh shellscripts/submit_cpp.sh
*/


Measured memory_bytes: 3632
#include "bits/stdc++.h"

using namespace std;

#define sp(x) cout<<setprecision(x);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define all(a) (a).begin(), (a).end()
#define inf 10000000
#define linf INT64_MAX*0.99
#define print(s) cout<<(s)<<endl
#define lint long long
#define yes "Yes"
#define no "No"

typedef pair<int, int> P;
 
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s; cin>>s;
    int ans = 0;
    
    REP(i,s.length()){
        if(s[i]=='+') ans++;
        else ans--;
    }
    print(ans);
    return 0;
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    s=SI()
    t=SI()
    if s==t[:-1]:print("Yes")
    else:print("No")

main()

Measured memory_bytes: 9072
using System;

class main
{
    public static int Main()
    {
        string S1 = Console.ReadLine();
        int SS = int.Parse(S1);
        int h;
        int m;
        int s;
        int amari;
        h = Math.DivRem(SS, 3600, out amari);
        m = Math.DivRem(amari,60, out s);

        Console.WriteLine(h + ":" + m + ":" + s );


        return 0;
    }
}

Measured memory_bytes: 9236
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <chrono>
#include <string>
#include <cstring>
#include <bitset>
#include <cassert>
#include <queue>
#include <deque>
#include <memory>

//#pragma comment(linker, "/STACK:16777216")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("unswitch-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,abm,mmx,avx,avx2,popcnt,tune=native")

using namespace std;

mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

#define ll long long
#define ull unsigned long long
//#define double long double
#define int ll
//#define int ull
//#define int short
//#define int unsigned short
//#define int unsigned int
#define mp make_pair
#define F first
#define S second
#define pii pair<int, int>
#define hash hash228
const int SZ = 3e5 + 4;
const double EPS = 1e-7;
const int mod = 1e9 + 7;
const int hashpow = 2;
const int inf = 2e9;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

string s;

inline void read() {
    cin >> s;
}

inline void solve() {
    if (s == "ABC") {
        cout << "ARC\n";
        return;
    }
    
    cout << "ABC\n";
}

signed main() {

#ifdef __LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#endif

//    int t;
//    cin >> t;
//    for (int i = 0; i < t; ++i) {
    read();
    solve();
//    }

    return 0;
}

Measured memory_bytes: 3656
/* ex7_1
    Jun_JPN */

#include <stdio.h>

typedef struct{ // 頂点の(x,y)座標
    int x_elem;
    int y_elem;
}point;

point shift_point(point A_vec, point B_vec, int pm);    // pm = 1 or -1

int main(void){

    point A_vec, B_vec, C_vec, D_vec;
    scanf("%d %d %d %d", &A_vec.x_elem, &A_vec.y_elem, &B_vec.x_elem, &B_vec.y_elem);

    C_vec = shift_point(B_vec, A_vec, -1);  // BAベクトルを-90度回転
    D_vec = shift_point(A_vec, B_vec,  1);  // ABベクトルを+90度回転

    printf("%d %d %d %d\n", C_vec.x_elem, C_vec.y_elem, D_vec.x_elem, D_vec.y_elem);

    return 0;
}

/* ABベクトルをpm*90度回転した先にある点の座標を返す関数 */
point shift_point(point A_vec, point B_vec, int pm){
    point AB_vec, AD_vec, D_vec;

    /* 引数OAベクトル，OBベクトルからABベクトルを計算 */
    AB_vec.x_elem = B_vec.x_elem - A_vec.x_elem;
    AB_vec.y_elem = B_vec.y_elem - A_vec.y_elem;

    /* ABベクトルを90度回転し，ADベクトルを得る
        ただしpm=-1のときは-90度回転となる */
    AD_vec.x_elem = (-1)*pm*AB_vec.y_elem;
    AD_vec.y_elem = pm*AB_vec.x_elem;

    /* OAベクトルとADベクトルの和を取ればODベクトルが得られる */
    D_vec.x_elem = A_vec.x_elem + AD_vec.x_elem;
    D_vec.y_elem = A_vec.y_elem + AD_vec.y_elem;

    return D_vec;
}


Measured memory_bytes: 1732
n = int(input())
a = list(map(int, input().split()))
s =0
d = list(range(n))
for i in range(n):
    s = s+a[i]
    d[i] = s
# print(s)
# print(d)
for i in range(n):
    d[i] = abs(2*d[i]-s)
# print(d)
d.pop(n-1)
print(min(d))

Measured memory_bytes: 24412
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;

int main() {
  int count=0,sum;
  string s;
  cin >> s;
  rep(i,4){
    if(s[i]=='+'){
      count++;
    }
  }
  sum = 2*count-4;
  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
using namespace std;
int n;
string s;
void scan(){
	scanf("%d",&n);
}
int main(){
	scan();
	cin>>s;
	int x=0,max=0;
	for(int i=0;i<s.length();i++){
		if(s[i]=='I')x++;
		else x--;
		if(x>max){
			max=x;
		}
	}
	printf("%d",max);
	printf("\n");
	return 0;
	
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const long long MOD = 1e9+7;
#define rep(i,n) for(int i=0;i<n;++i)
typedef long long int ll;
typedef unsigned long long ull;
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
typedef pair<ll,ll> P;


int main()
{
   string s;
   cin>> s;
   int l=s.length();
   int a=0,b=0,c=0;
   for(int i=0;i<l;i++)
   {
       if(s[i]=='a')a++;
       else if(s[i]=='b')b++;
       else c++;
   }
   if(abs(a-b)<=1&&abs(c-b)<=1&&abs(a-c)<=1)cout<<"YES"<<endl;
   else cout<<"NO"<<endl;
   return 0;
}


Measured memory_bytes: 3712
using System;
 
namespace Sample
{
  class Sample
  {
    static void Main(string[] args)
    {
    string[] str =Console.ReadLine().Split(' ');
      int a=int.Parse(str[0]);
      int b=int.Parse(str[1]);
    int c=int.Parse(str[2]);
      int[] src={a,b,c};
       Array.Sort(src);
      int ans=0;
      ans=(src[1]-src[0])+(src[2]-src[1]);
      Console.WriteLine(ans);
     
    }
    
  }

}

Measured memory_bytes: 13140
#include <iostream>
using namespace std;
#define ll long long

int main () {
  ll n, k;
  cin >> n >> k;
  ll h[n + 1];
  for (ll i = 1; i <= n; i++) cin >> h[i];
  ll dp[n + 1];
  for (ll i = 1; i <= n; i++) dp[i] = -1;
  dp[1] = 0;
  for (ll i = 2; i <= n; i++) {
    ll min = -1;
    for (ll j = 1; j <= k; j++) {
      ll l = i - j;
      if (l >= 1) {
      	if (min == -1 || (dp[l] + abs(h[i] - h[l])) < min) {
          min = dp[l] + abs(h[i] - h[l]);
        }  
      }
    }
    dp[i] = min;
  }
  cout << dp[n] << endl;
}


Measured memory_bytes: 1792
/**
  *  Worg
  */
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>

//FILE *fin = freopen("main.in", "r", stdin); FILE *fout = freopen("main.out", "w", stdout);

using namespace std;

const int sigma = 26;

string s;
int dp[1 << sigma];

int main() {
    cin >> s;
    dp[0] = 1;

    int act = 0, crtBest = 0;
    for(int i = 0; i < (int)s.size(); i++) {
        act ^= (1 << (s[i] - 'a'));

        crtBest = i + 1;

        if(dp[act] != 0) {
            crtBest = dp[act];
        }

        for(int j = 0; j < sigma; j++) {
            if(dp[act ^ (1 << j)] != 0 && dp[act ^ (1 << j)] < crtBest) {
                crtBest = dp[act ^ (1 << j)];
            }
        }

        if(dp[act] == 0 || dp[act] > crtBest + 1) {
            dp[act] = crtBest + 1;
        }
    }

    cout << crtBest;
	return 0;
}


Measured memory_bytes: 262404
n = int(input())
a = [int(input()) for _ in range(n)]
s = max(a)
if a.count(s) >= 2:
  for i in range(n):  
    print(s)
else:
  for i in range(n):
    if a[i] == s:
      l = a.copy()
      l.sort()
      print(l[-2])
    else:
      print(s)

Measured memory_bytes: 14224
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {

	static class Edge {
		int to, weight,size;
		Edge(int to, int weight, int size) {
			this.to = to;
			this.weight = weight;
			this.size = size;
		}
	}

	static List<Edge> G[];
	static void addEdge(int from, int to, int weight) {
		G[from].add(new Edge(to, weight, G[to].size()));
		G[to].add(new Edge(from, 0, G[from].size() - 1));
	}

	static boolean[] used = new boolean[10000];
	static int maxFlow(int s, int t) {
		int flow = 0;
		while(true) {
			Arrays.fill(used, false);
			int f = dfs(s, t, 10000);
			if(f == 0) return flow;
			flow += f;
		}
	}

	static int dfs(int s, int t, int f) {
		if(s == t) return f;
		used[s] = true;
		for(int i = 0 ; i < G[s].size() ; i++) {
			Edge edge = G[s].get(i);
			if(!used[edge.to] && edge.weight > 0) {
				int d = dfs(edge.to, t, Math.min(f, edge.weight));
				if(d > 0) {
					edge.weight -= d;
					G[edge.to].get(edge.size).weight += d;
					return d;
				}
			}
		}
		return 0;
	}

	static class Point {
		int x, y;
		Point(int x, int y) {
			this.x = x;
			this.y = y;
		}
	}

	public static void main(String[] args) {
		Scanner	sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[n];
		int[] d = new int[n];
		Point[] red = new Point[n];
		Point[] blue = new Point[n];
		G = new ArrayList[2 * n + 2];
		for(int i = 0 ; i < 2 * n + 2 ; i++) G[i] = new ArrayList<>();
		for(int i = 0 ; i < n ; i++) {
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
		}
		for(int i = 0 ; i < n ; i++) {
			c[i] = sc.nextInt();
			d[i] = sc.nextInt();
		}
		for(int i = 0 ; i < n ; i++) {
			red[i] = new Point(a[i], b[i]);
			blue[i] = new Point(c[i], d[i]);
		}
		for(int i = 0 ; i < n ; i++) {
			for(int j = 0 ; j < n ; j++) {
				if(red[i].x < blue[j].x && red[i].y < blue[j].y) addEdge(j + 1, i + n + 1, 1);
			}
		}
		for(int i = 0 ; i < n ; i++) addEdge(0, i + 1, 1);
		for(int i = 0 ; i < n ; i++) addEdge(i + n + 1, 2 * n + 1, 1);
		System.out.println(maxFlow(0, 2 * n + 1));
	}
}


Measured memory_bytes: 23252