akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ul unsigned long int
#define ld long double
#define f(t) for(ll i =0;i<t;i++)
#define vi vector<int>
#define vl vector<ll>
#define pri pair<int,int>
#define mpi map<int,int>
#define prl pair<ll,ll>
#define mp make_pair
#define mpl map<ll,ll>
#define umpl unordered_map<ll,ll>
#define pb push_back
#define ff first
#define ss second
#define MOD 1000000007
#define inf 2e18
#define EPS 1e-3
#define PI 3.1415926535897932385
const double h = 1e-6;
const int MAX_  = 100005;
#define display(v) f(v.size())cout << v[i] << " "
#define all(v) v.begin(),v.end()

inline ll mul(ll a, ll b){ return (a * 1ll * b) % MOD; }
inline ll sub(ll a, ll b){ ll c = a - b; if(c < 0) c += MOD; return c; }
inline ll add(ll a, ll b){ ll c = a + b; if(c > MOD) c -= MOD; return c; }
 //////////////////////*********CODE***********/////////////////////
 //////////////////////////////////////////////////////////////////
bool isp(string s)
{
   string t = s;
   reverse(all(t));
   return (s==t);
}

int main()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   cout.tie(NULL);
   cout << fixed;
   cout.precision(13);
   double n ;  cin>>n;
   double l = (n/3);
   n-=l;
   double w = (n/2);
   n-=w;
   double h = n;
   cout << l*w*h << "\n";



   return 0;
}     

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define per(a,b,c) for(int a=b;a>=c;a--)
#define ios; ios::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define mk make_pair
#define fi first
#define se second
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
#define ls(x) (x<<1)
#define rs(x) (ls(x)|1)
#define eps 1e-11
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef double db;
mt19937 rnd(random_device{}());
const int mod = 1e9 + 7;
const int N = 5e3 + 5;
const int M = 1e3 + 5;
inline ll gcd(ll a,ll b){ return b?gcd(b,a%b):a; }
inline ll lcm(ll a,ll b){ return a*b/gcd(a,b); }
inline ll ksm(ll x,ll y){ ll res=1; while(y){if(y&1) res=res*x%mod;
x=x*x%mod; y>>=1;} return res; }
int n, m, k;
int p[N];
ll c[N], f[N];

int main(){
    ios;
    cin>>n>>k;
    rep(i,1,n) cin>>p[i];
    rep(i,1,n) cin>>c[i];
    ll ans=-4e18;
    rep(i,1,n){
        mem(f,0);
        int pos=p[i], tot=0;
        while(pos!=i){
            ++tot;
            f[tot]=f[tot-1] + c[pos];
            pos=p[pos];
        }
        ++tot;
        f[tot]=f[tot-1]+c[pos];
        //rep(j,1,tot) printf(" %lld",f[j]); puts("");
        ll res=f[1], res2=f[1];
        rep(j,1,(k-1)%tot+1) res=max(res,f[j]);
        res+=1ll*((k-1)/tot)*max(0ll,f[tot]);

        rep(j,1,tot) res2=max(res2,f[j]);
        res2+=1ll*(k/tot-1)*max(0ll,f[tot]);
        //printf("res=%d\n",res);
        res=max(res,res2);
        ans=max(ans,res);
    }
    cout<<ans<<"\n";
    return 0;
}
/*

*/
//
//                            _ooOoo_
//                           o8888888o
//                           88" . "88
//                           (| -_- |)
//                           O\  =  /O
//                        ____/`---'\____
//                      .'  \|     |//  `.
//                     /  \|||  :  |||//  \
//                    /  _||||| -:- |||||-  \
//                    |   | \  -  /// |   |
//                    | \_|  ''\---/''  |   |
//                    \  .-\__  `-`  ___/-. /
//                  ___`. .'  /--.--\  `. . __
//               ."" '<  `.___\_<|>_/___.'  >'"".
//              | | :  `- \`.;`\ _ /`;.`/ - ` : | |
//              \  \ `-.   \_ __\ /__ _/   .-` /  /
//         ======`-.____`-.___\_____/___.-`____.-'======
//                            `=---='
//        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//                     ·ð×æ±£ÓÓ      ÓÀÎÞBUG


Measured memory_bytes: 3760
#include <bits/stdc++.h>
#define fname "A"
#define bug(x) cerr << (#x) << " = " << (x) << endl
#define ll long long
#define REP0(i, n) for(int i = 0, _n = (n); i < _n; ++i)
#define REP1(i, n) for(int i = 1, _n = (n); i <= _n; ++i)
#define REPB0(i, n) for(int i = (n) - 1; i >= 0; --i)
#define REPB1(i, n) for(int i = (n); i > 0; --i)
#define FOR(i, a, b) for(int i = (a), _b = (b); i <= _b; ++i)
#define FORB(i, a, b) for(int i = (a), _b = (b); i >= _b; --i)
#define ARR0(a, n) {cerr <<(#a)<< ": ["; REP0(i, n) cerr<< ' ' << a[i] <<','; cerr<<']'<<endl;}
#define ARR1(a, n) {cerr <<(#a)<< ": ["; REP1(i, n) cerr<< ' ' << a[i] <<','; cerr<<']'<<endl;}
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define LB lower_bound
#define UB upper_bound
#define X first
#define Y second

using namespace std;
template<typename T, typename V>
inline void bugp(const pair<T, V> &x) {cerr << '{' << x.X << ", " << x.Y << '}' << endl;}
template<typename T, typename U, typename V>
inline void bugpp(const pair<T, pair<U, V> > &x) {cerr << '{' << x.X << ", {" << x.Y.X << ", " << x.Y.Y << "}}" << endl;}
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef pair<ll, int> li;
typedef pair<ll, ii> lii;
typedef vector<int> vi;
typedef vector<vi> vvi;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
    int n, x, t, d;
    cin >> n >> x >> t;
    if(n % x == 0) d = n / x;
    else d = n / x + 1;
    cout << d * t;
	return 0;
}


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

void fnInput(vector<int>& rvnTrg, vector<int>& rvnSch)
{
  int nTrgCnt;
  cin >> nTrgCnt;

  rvnTrg.resize(nTrgCnt);
  for (int i = 0; i < nTrgCnt; i++)
    cin >> rvnTrg[i];

  int nSchCnt;
  cin >> nSchCnt;

  rvnSch.resize(nSchCnt);
  for (int i = 0; i < nSchCnt; i++)
    cin >> rvnSch[i];
}

void fnBinSch(const vector<int>& cnrvnTrg, const vector<int>& cnrvnSch, int& rnFnd)
{
  for (int i = 0; i < cnrvnSch.size(); i++)
  {
    int nLow  = 0;
    int nHigh = cnrvnTrg.size();
    while (nLow < nHigh)
    {
      int nMid = (nLow + nHigh) / 2;
      if (cnrvnSch[i] == cnrvnTrg[nMid])
      {
        rnFnd++;
        break;
      }
      else if (cnrvnSch[i] < cnrvnTrg[nMid])
        nHigh = nMid;
      else
        nLow  = nMid + 1;
    }
  }
}

void fnResult(int nFnd)
{
  cout << nFnd << endl;
}

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

  vector<int> vnTrg, vnSch;
  int nFnd = 0;

  fnInput(vnTrg, vnSch);
  fnBinSch(vnTrg, vnSch, nFnd);
  fnResult(nFnd);

  return 0;
}



Measured memory_bytes: 3300
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define enl printf("\n")
#define case(t) printf("Case #%d: ", (t))
#define ni(n) scanf("%d", &(n))
#define nl(n) scanf("%lld", &(n))
#define nai(a, n) for (int i = 0; i < (n); i++) ni(a[i])
#define nal(a, n) for (int i = 0; i < (n); i++) nl(a[i])
#define pri(n) printf("%d\n", (n))
#define prl(n) printf("%lld\n", (n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vii vector<pii>
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef cc_hash_table<int,int,hash<int>> ht;
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int MAXN = 1e6 + 5;
const double eps = 1e-9;
int dp[MAXN], h[MAXN];

int main()
{
    int n, k=2;
    ni(n);
    nai(h, n);
    dp[0] = 0;
    for (int i = 1; i < n; i++) {
        dp[i] = INF;
        for (int j = i - 1; j >= max(0, i - k); j--) {
            dp[i] = min(dp[i], dp[j] + abs(h[i] - h[j]));
        }
    }
    pri(dp[n - 1]);
    return 0;
}


Measured memory_bytes: 4736
import java.util.*;

public class Main {
    public static void main(String[] args){
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        String r = sc.next();
        String g = sc.next();
        String b = sc.next();
        
        String str = r + g + b;
        int num = Integer.parseInt(str);
        
        if((num % 4) == 0 ){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }
    
}


Measured memory_bytes: 26860
module Main where

import Control.Applicative
import Control.Monad
import Data.List

g1 = [1, 3, 5, 7, 8, 10, 12]
g2 = [4, 6, 9, 11]
g3 = [2]

main :: IO ()
main = do
    [x, y] <- fmap read . words <$> getLine :: IO [Int]
    let b1 = and $ fmap (`elem` g1) [x, y]
    let b2 = and $ fmap (`elem` g2) [x, y]
    let b3 = and $ fmap (`elem` g3) [x, y]
    if or [b1, b2, b3]
        then putStrLn "Yes"
        else putStrLn "No"

Measured memory_bytes: 508
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;

#define dprint(Exp,...) if(Exp){fprintf(stderr, __VA_ARGS__);}
#define printe(...) fprintf(stderr, __VA_ARGS__);
#define PrtExp(_Exp)  cerr<< #_Exp <<" = "<< (_Exp)
#define PrtExpN(_Exp)  cerr<< #_Exp <<" = "<< (_Exp) <<"\n"

#define SINT(n) scanf("%d",&n)
#define SINT2(n,m) scanf("%d %d",&n,&m)
#define SINT3(n,m,o) scanf("%d %d %d",&n,&m,&o)
#define SINT4(n,m,o,p) scanf("%d %d %d %d",&n,&m,&o,&p)
#define SINT5(n,m,o,p,q) scanf("%d %d %d %d %d",&n,&m,&o,&p,&q)
#define SLL(n) scanf("%lld",&n)
#define SLL2(n,m) scanf("%lld %lld",&n,&m)
#define SLL3(n,m,o) scanf("%lld %lld %lld",&n,&m,&o)
#define SST(s) scanf("%s",s)
#define SCH(c) scanf("%c",&c)

#define GC() getchar()

#define PINT(n) printf("%d",(int)(n))
#define PINT2(n,m) printf("%d %d",(int)(n),(int)(m))
#define PINT3(n,m,l) printf("%d %d %d",(int)(n),(int)(m),(int)(l))
#define PLL(n) printf("%lld",(long long)(n))
#define PST(s) printf("%s",(s))
#define PCH(s) printf("%c",(s))

#define PINTN(n) printf("%d\n",(int)(n))
#define PINT2N(n,m) printf("%d %d\n",(int)(n),(int)(m))
#define PINT3N(n,m,l) printf("%d %d %d\n",(int)(n),(int)(m),(int)(l))
#define PLLN(n) printf("%lld\n",(long long)(n))
#define PSTN(s) printf("%s\n",(s))
#define PCHN(s) printf("%c\n",(s))

#define PSP() printf(" ")
#define PN() printf("\n")

#define PC(c) putchar(c)
#define CSP (' ')
#define SN ("\n")

#define rep(i,a) for(int i=0;i<a;i++)
#define reP(i,a) for(int i=0;i<=a;i++)
#define Rep(i,a) for(int i=a-1;i>=0;i--)
#define ReP(i,a) for(int i=a;i>=0;i--)

#define rEp(i,a) for(i=0;i<a;i++)
#define rEP(i,a) for(i=0;i<=a;i++)
#define REp(i,a) for(i=a-1;i>=0;i--)
#define REP(i,a) for(i=a;i>=0;i--)

#define repft(i,a,b) for(int i=a;i<b;i++)
#define repfT(i,a,b) for(int i=a;i<=b;i++)
#define Repft(i,a,b) for(int i=a-1;i>=b;i--)
#define RepfT(i,a,b) for(int i=a;i>=b;i--)

#define foreach(a,it) for(auto it = a.begin(); it != a.end(); ++it)

#define FILL(a,v) fill(begin(a),end(a), v)
#define FILL0(a) memset(a,0,sizeof(a))
#define FILL1(a) memset(a,-1,sizeof(a))

typedef long long ll;

typedef unsigned long long ull;
typedef pair<int, int> Pi;
typedef pair<ll, ll>   Pll;


const int INF = 0x2aaaaaaa; // 715,827,882
const ll INFLL = 0x1f1f1f1f1f1f1f1fLL;//2,242,545,357,980,376,863

template <class A, class B> inline ostream& operator<<(ostream& st, const pair<A, B>& P) { return st << "(" << P.first << "," << P.second << ")"; };
template <class A, class B> inline pair<A, B> operator+(const pair<A, B>& P, const pair<A, B>& Q) { return pair<A, B>(P.first + Q.first, P.second + Q.second); };
template <class A, class B> inline pair<A, B> operator-(const pair<A, B>& P, const pair<A, B>& Q) { return pair<A, B>(P.first - Q.first, P.second - Q.second); };

#define fs  first
#define sc  second



int main() {
	int n, k;

	cin >> n >> k;

	map<int, int> m;
	rep(i, n) {
		int a;
		cin >> a;
		++m[a];
	}
	vector<int> v;
	for (auto &x : m) {
		v.push_back(x.second);
	}
	sort(v.begin(), v.end());
	int ret = 0;
	rep(i, (int)v.size() - k) {
		ret += v[i];
	}

	cout << ret << endl;

}



Measured memory_bytes: 10748
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define int long long
#define pb push_back
const int MOD=1e9+7;
const int INF=1e15;

signed main(){
    int N;cin>>N;
    vector<int>A(N);
    REP(i,N)cin>>A[i];
    sort(A.rbegin(),A.rend());
    int ans=0;
    for(int i=0;i<N-2;i++){
        for(int j=i+1;j<N-1;j++){
            int d=A[i]-A[j];
            int left=j+1;
            int right=N-1;
            if(left==right){
                if(A[left]>d)ans++;
                break;
            }
            while(right-left>0){
                if(right==j+2&&left==j+1){
                    if(A[left]>d)ans++;
                    if(A[right]>d)ans++;
                    break;
                }
                if(right-left==1){
                    if(A[right]<=d&&A[left]>d){
                        ans+=left-j;
                        break;
                    }
                    if(A[right]>d){
                        ans+=right-j;
                        break;
                    }
                    if(A[left]<=d){
                        break;
                    }
                }
                int mid=(left+right)/2;
                if(A[mid]>d)left=mid;
                else right=mid;
            }
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
N = int(input())

dp = [0]*(N+10)

for n in range(1, N+1):
  dp[n] = 100000
  power = 1
  while power <= n:
    dp[n] = min(dp[n], dp[n-power]+1)
    power *= 6
  power = 1
  while power <=n:
    dp[n] = min(dp[n], dp[n-power]+1)
    power *= 9
    
print(dp[N])

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

char s[1005];
int n,flag,a[4];

int main()
{
	scanf("%s",s+1);n=strlen(s+1);
	for(int i=1;i<=n;i++)
	{
		if(s[i]=='N') a[0]=1;
		if(s[i]=='S') a[1]=1;
		if(s[i]=='W') a[2]=1;
		if(s[i]=='E') a[3]=1;
	}
	
	if(a[0]) if(!a[1]) flag=1;
	if(a[1]) if(!a[0]) flag=1;
	if(a[2]) if(!a[3]) flag=1;
	if(a[3]) if(!a[2]) flag=1;
	if(flag) printf("No\n");
	else printf("Yes\n");
}

Measured memory_bytes: 256
n,k = map(int,input().split())
a = list(map(int,input().split()))
now = 1
ss = set([1])
sw = 0
x = 0
for i in range(k):
    now = a[now-1]
    ss.add(now)
    if len(ss) != i+2:
        b = now
        x = i+1
        sw = 1
        break
y = 0
now2 = 1
for j in range(x-1):
    if now2 == b:
        y = j
        break
    now2 = a[now2-1]
if sw == 1:
    L = (k-y)%(x-y)
    for i in range(L):
        now = a[now-1]
print(now)

Measured memory_bytes: 32372
from collections import defaultdict
T = int(input())


def dfs(n, b):

    if dp[n] != 0:
        return dp[n]

    if n == 1:
        return D
    elif n == 0:
        return 0

    ans = 10**30

    # ..2
    if n % 2 != 0:
        t = n // 2 * 2 + 2
        tmp = dfs(t // 2, n) + min(A, t // 2 * 2 * D) + D * abs(n - t)
        ans = min(ans, tmp)
        t = n // 2 * 2 + 0
        tmp = dfs(t // 2, n) + min(A, t // 2 * 2 * D) + D * abs(n - t)
        ans = min(ans, tmp)
    elif n % 2 == 0:
        t = n
        tmp = dfs(t // 2, n) + min(A, t // 2 * D)
        ans = min(ans, tmp)

    # ..3
    if n % 3 != 0:
        t = n // 3 * 3 + 3
        tmp = dfs(t // 3, n) + min(B, t // 3 * 2 * D) + D * abs(n - t)
        ans = min(ans, tmp)
        t = n // 3 * 3 + 0
        tmp = dfs(t // 3, n) + min(B, t // 3 * 2 * D) + D * abs(n - t)
        ans = min(ans, tmp)
    else:
        t = n
        tmp = dfs(t // 3, n) + min(B, t // 3 * 2 * D) + D * abs(n - t)
        ans = min(ans, tmp)

    # ..5
    if n % 5 != 0:
        t = n // 5 * 5 + 5
        tmp = dfs(t // 5, n) + min(C, t // 5 * 4 * D) + D * abs(n - t)
        ans = min(ans, tmp)

        t = n // 5 * 5 + 0
        tmp = dfs(t // 5, n) + min(C, t // 5 * 4 * D) + D * abs(n - t)
        ans = min(ans, tmp)
    else:
        t = n
        tmp = dfs(t // 5, n) + min(C, t // 5 * 4 * D) + D * abs(n - t)
        ans = min(ans, tmp)

    dp[n] = ans

    return ans


for _ in range(T):
    N, A, B, C, D = list(map(int, input().split()))

    dp = defaultdict(int)
    print(dfs(N, -1))


Measured memory_bytes: 90624
// dfmt off
T lread(T=long)(){return readln.chomp.to!T;}T[] lreads(T=long)(long n){return iota(n).map!((_)=>lread!T).array;}
T[] aryread(T=long)(){return readln.split.to!(T[]);}void arywrite(T)(T a){a.map!text.join(' ').writeln;}
void scan(L...)(ref L A){auto l=readln.split;foreach(i,T;L){A[i]=l[i].to!T;}}alias sread=()=>readln.chomp();
void dprint(L...)(lazy L A){debug{auto l=new string[](L.length);static foreach(i,a;A)l[i]=a.text;arywrite(l);}}
static immutable MOD=10^^9+7;alias PQueue(T,alias l="b<a")=BinaryHeap!(Array!T,l);import std, core.bitop;
// dfmt on

void main()
{
    long N = lread();
    auto A = aryread();
    auto idx = new long[](N + 1);
    foreach (i; 0 .. N)
    {
        idx[A[i]] = i;
    }
    auto rbt = new RedBlackTree!long();
    rbt.insert(-1);
    rbt.insert(N);
    long ans;
    foreach (x; 0 .. N)
    {
        long i = idx[x + 1];
        long l = rbt.lowerBound(i).back;
        long r = rbt.upperBound(i).front;
        ans += (r - i) * (i - l) * (x + 1);
        rbt.insert(i);
        dprint(x, i, r, l, (r - i), (i - l));
    }
    writeln(ans);
}


Measured memory_bytes: 22300
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int>A(N);
  for (int i=0; i < N; i++){
    cin >> A.at(i);
  }
    
    sort(A.begin(),A.end());
  cout << A.at(N-1) - A.at(0) << endl;
  
}
    
    

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  string s;
  cin >> s;
  int n = (int)s.length();
  int i;
  int chk[2] = {0,0};
  for(i=0;i<n;i++){
    if(s[i] == '0')chk[0]++;
    else chk[1]++;
  }
  cout << 2*min(chk[0],chk[1]);
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define Would
#define you
#define please

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

	int N;
	int a[200000], b[200000];
	cin >> N;
	rep(i, N) cin >> a[i];
	rep(i, N) cin >> b[i];

	int bmod[30][200000];
	rep1(i, 29) {
		rep(ii, N) {
			bmod[i][ii] = b[ii] % (1 << i);
		}
		sort(bmod[i], bmod[i] + N);
	}

	ll kotae[30] = {};
	rep(i, N) {
		rep1(ii, 29) {
			int amod = a[i] % (1 << ii);

			int l = 0;
			int r = N;
			while (l != r) {
				int chk = (l + r) / 2;
				if (bmod[ii][chk] + amod < (1 << ii)) l = chk + 1;
				else r = chk;
			}
			int k1 = l;
			l = 0;
			r = N;
			while (l != r) {
				int chk = (l + r) / 2;
				if (bmod[ii][chk] + amod < (1 << ii) + (1 << (ii - 1))) l = chk + 1;
				else r = chk;
			}
			int k2 = l;
			l = 0;
			r = N;
			while (l != r) {
				int chk = (l + r) / 2;
				if (bmod[ii][chk] + amod < (1 << (ii - 1))) l = chk + 1;
				else r = chk;
			}
			kotae[ii] += k1 - l + N - k2;
		}
	}
	int hontou = 0;
	rep1(i, 29) {
		kotae[i] %= 2;
		hontou += kotae[i] * (1 << (i - 1));
	}
	co(hontou);
	Would you please return 0;
}

Measured memory_bytes: 25216
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pqueue priority_queue
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int A;
  cin>>A;
  if(A<1200) cout<<"ABC"<<endl;
  else cout<<"ARC"<<endl;
}


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

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

    int n;
    cin >> n;

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

    vector<int> dp(n, 0);
    dp[1] = abs(h[0] - h[1]);
    for(int i = 2; i < n; ++i){
        dp[i] = min(dp[i-1] + abs(h[i] - h[i-1]), dp[i-2] + abs(h[i] - h[i-2]));
    }

    cout << dp[n-1] << endl;
}

Measured memory_bytes: 3984
#include<bits/stdc++.h>
using namespace std;
char c[880][880];
int n,m,k,x,y,dis[880][880],mm=1e9;
int dx[]={1,-1,0,0},dy[]={0,0,1,-1};
int main()
{
	cin>>n>>m>>k;
	for(int i=0;i<n;i++)
	{
		cin>>c[i];
		for(int j=0;j<m;j++)
			if(c[i][j]=='S')
			{
				x=i;
				y=j;
			}
	}
	queue<pair<int,int> >que;
	que.push(make_pair(x,y));
	memset(dis,-1,sizeof(dis));
	dis[x][y]=0;
	while(!que.empty())
	{
		int a=que.front().first;
		int b=que.front().second;
		que.pop();
		if(dis[a][b]>k)
			break;
		if(a==0||b==0||a==n-1||b==m-1)
		{
			cout<<1<<endl;
			return 0;
		}
		mm=min(mm,min(min(a,n-a-1),min(b,m-b-1)));
		for(int i=0;i<4;i++)
		{
			int u=a+dx[i],v=b+dy[i];
			if(c[u][v]!='#'&&dis[u][v]==-1)
			{
				dis[u][v]=dis[a][b]+1;
				que.push(make_pair(u,v));
			}
		}
	}
	cout<<(mm+k-1)/k+1<<endl;
	return 0;
}


Measured memory_bytes: 4476
#include <iostream>
#include <array>
#include <algorithm>

int main() {
  unsigned long n, a, b, c, d, e;
  std::cin >> n;
  std::cin >> a;
  std::cin >> b;
  std::cin >> c;
  std::cin >> d;
  std::cin >> e;

  const std::array<unsigned long, 5> capacity = {a, b, c, d, e};
  const unsigned long min_capacity = *std::min_element(capacity.begin(), capacity.end());
  const unsigned long stop_time = n / min_capacity;
  const unsigned long amari = n % min_capacity;

  if (amari == 0) {
    std::cout << stop_time - 1 + 5 << std::endl;
  } else {
    std::cout << stop_time + 5 << std::endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
using namespace std;
#define Rep(i,n) for(int i=0;i<(n);i++)
int a[50];
int b[50];
int c[50];
int d[50];
int main(void)
{
int N,M;
cin>>N>>M;
Rep(i,N)cin>>a[i]>>b[i];
Rep(i,M)cin>>c[i]>>d[i];
Rep(n,N){
 int ans=1;
 int mn=abs(a[n]-c[0])+abs(b[n]-d[0]);
 Rep(m,M){
  if(abs(a[n]-c[m])+abs(b[n]-d[m])<mn){
   mn=abs(a[n]-c[m])+abs(b[n]-d[m]);
   ans=m+1;
  }
 }
 cout<<ans<<endl;
}
return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

unsigned int f(unsigned int u) {
	unsigned int r = 0;
	while (u) {
		r += u % 10;
		u /= 10;
	}
	
	return r;
}

int main() {
	unsigned int n;
	cin >> n;
	
	unsigned int a;
	
	unsigned int end = n / 2 + 1, result = 10000000;
	for (unsigned int i = 1; i < end; ++i) {
		a = f(i);
		a += f(n - i);
		
		if (result > a) {
			result = a;
		}
	}
	
	cout << result << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define LOCAL
using namespace std;
template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
out << "(" << a.first << "," << a.second << ")";
return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');
cerr.write(names, comma - names) << ": " << arg1 << " |";
__f(comma + 1, args...);
}
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
#define int long long
using P = pair<int,int>;
//#########################################
signed main(){
	int n;cin >> n;
	vector<int> a(n),b(n),c(n);
	rep(i,n)cin >> a[i];
	rep(i,n)cin >> b[i];
	rep(i,n)cin >>c[i];
	int ret = 0;
	sort(a.begin(),a.end());
	sort(b.begin(),b.end());
	sort(c.begin(),c.end());
	rep(i,n){
		//b[i]
		int cnum = n-(int)(upper_bound(c.begin(),c.end(),b[i]) - c.begin());
		int anum = lower_bound(a.begin(),a.end(),b[i]) - a.begin();
		ret += anum*cnum;
	}
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 5644
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long int lli;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    lli n;
    cin>>n;
    lli i, a[n], ans=0;
    
    for(i=0;i<n;i++) cin>>a[i];
    sort(a, a+n, greater<lli>());
    
    for(i=1;i<n;i++)
    {
        if(i==1) ans+=a[0];
        else ans+=a[i/2];
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 5204
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,d,e;
  cin>>a>>b>>c;
  d=b-a;
  e=c-a;
  if(d<0)
     d=d/-1;
  if(e<0)
     e=e/-1;
  	if(d<=e)
    cout<<"A"<<endl;
  else
    cout<<"B"<<endl;
  
    
      
  return(0);
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <numeric>
#include <queue>
#include <sstream>
#include <string>
#include <string.h>
#include <tuple>
#include <vector>

#define REP(i,x) for(int i{ 0 }; i < (int)(x); i++)
#define REPC(i,x) for(int i{ 0 }; i <= (int)(x); i++)
#define RREP(i,x) for(int i{ (int)(x) - 1 }; i >= 0 ;i--)
#define RREPC(i,x) for(int i{ (int)(x)}; i >= 0; i--)
#define REP1O(i,x) for(int i{ 1 }; i < (int)(x); i++)
#define REP1C(i,x) for(int i{ 1 }; i <= (int)(x); i++)
#define REPIT(i,x) for(auto i{(x).begin()}; i != (x).end(); i++) 

#define PB push_back
#define MP make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

using namespace std;

typedef int64_t ll;
typedef double dbl;
typedef vector<bool> Vb;
typedef vector<char> Vc;
typedef vector<double> Vd;
typedef vector<int> Vi;
typedef vector<ll> Vl;
typedef vector<string> Vs;
typedef vector<vector<int>> VVi;
typedef vector<vector<ll>> VVl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;

template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
inline void swap(ll& a, ll& b) { a ^= b; b ^= a; a ^= b; }
inline void swap(int& a, int& b) { a ^= b; b ^= a; a ^= b; }
inline void YES() { cout << "YES" << endl; } inline void Yes() { cout << "Yes" << endl; }
inline void NO() { cout << "NO" << endl; } inline void No() { cout << "No" << endl; }

const int inf = 1 << 30;
const ll linf = 1LL << 60;
const int MOD = 1000000007;

int n, m;
Vi va;
vector<pii> vm;
priority_queue<int, Vi, greater<int>> que;

void init()
{
	cin >> n >> m;
	va.resize(n);
	REP(i, n) cin >> va[i];
	vm.resize(m);
	REP(i, m)
	{
		int b, c; cin >> b >> c;
		vm[i] = (pii(c, b));
	}
	sort(ALL(vm), greater<pii>());
}


int main()
{
	init();

	int i = 0;
	while (que.size() < n && i < m)
	{
		int x = vm[i].first;
		int t = vm[i].second;
		REP(_i, t)
			que.push(x);
		++i;
	}

	REP(i, n)
		que.push(va[i]);

	while (que.size() > n)
		que.pop();
	
	ll ans = 0;
	REP(i, n)
	{
		ans += (ll)que.top();
		que.pop();
	}

	cout << ans << endl;
	
}

//// done A-D in 15min on Sep 27, 2019 ////


Measured memory_bytes: 2552
N = int(input())
As = list(map(int, input().split()))

def calcgcd(a, b):
  if a > b:
    a, b = b, a
  while a > 0:
    a, b = b%a, a
  return b
def calclcm(a, b):
  return a*b//calcgcd(a, b)

r = 1
a = As[0]
for i in range(1, N):
  b = As[i]
  d = calcgcd(a, b)
  r = (r*(b//d)+(a//d))%1000000007
  a = a*b//d
print(r)


Measured memory_bytes: 4084
#include <bits/stdc++.h>
using namespace std;
#define int long long
using ll=long long;
using vi=vector<int>;
using pii=pair<int,int>;
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)
#define ITR(i,b,e) for(auto i=(b);i!=(e);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define SZ(c) ((int)c.size())
#define CONTAIN(c,x) (c.find(x)!=end(c))
#define OUTOFRANGE(y,x,h,w) (y<0||x<0||y>=h||x>=w)
#define dump(...)
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
#define INF (1001001001)
#define INFLL (1001001001001001001ll)
template<class T> ostream& operator << (ostream &os,const vector<T> &v) {
    ITR(i,begin(v),end(v)) os<<*i<<(i==end(v)-1?"":"\n"); return os; }
template<class T> istream& operator >> (istream &is,vector<T> &v) {
    ITR(i,begin(v),end(v)) is>>*i; return is; }
template<class T> istream& operator >> (istream &is, pair<T,T> &p) {
    is>>p.first>>p.second; return is; }
template <class T> bool chmax(T &a,const T &b) {if(a<b) {a=b;return 1;} return 0;}
template <class T> bool chmin(T &a,const T &b) {if(b<a) {a=b;return 1;} return 0;}
template <class T> using heap = priority_queue<T,vector<T>,greater<T>>;
struct before_main_function {
    before_main_function() {
        #ifdef int
            #undef INF
            #define INF INFLL
            #define stoi stoll
        #endif
        cin.tie(0);ios::sync_with_stdio(false);
        cout<<setprecision(15)<<fixed;
        #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

signed main() {
    string s;
    cin>>s;
    char t=s[0];
    bool ok=1;
    REP(i,3) {
        if(s[i]!=t) {
            ok=0;
            break;
        }
    }
    t=s[3];
    bool ok2=1;
    REP(i,3) {
        if(s[i+1]!=t) {
            ok2=0;
            break;
        }
    }
    if(ok || ok2) {
        cout<<"Yes"<<endl;
    } else {
        cout<<"No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
public class Main {
  private static void solve() {
    long h = nl();

    long ret = 0;
    long f = 1;
    while (h > 0) {
      if (h % 2 == 1) {
        h--;
      }
      ret += f;
      f *= 2;
      h /= 2;
    }
    System.out.println(ret);

  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}


Measured memory_bytes: 21332
import math
from functools import reduce

N = int(input())
A= list(map(int,input().split( )))

def gcd(x,y):
    if x > y:
        x , y = y , x
    while x>0:
        x, y = y%x , x
    return y
    
def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


m =  lcm_list(A) -1

B = 0

for j in range(len(A)):
    B += m%A[j]

print(B)

Measured memory_bytes: 3824
#include<bits/stdc++.h>    
using namespace std;
int main() {
   // freopen("input.in","r",stdin); 
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    long long c;
  cin>>c;
    cout<<(long long )pow(c,3);
    return 0;
}

Measured memory_bytes: 256
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;

void main()
{
	auto n = readln.chomp.to!int * 2;
	auto cards = iota(1, n+1).array;
	auto m = readln.chomp.to!int;
	while (m--) {
		auto t = readln.chomp.to!int;
		if (t == 0) {
			auto tmp = cards.dup;
			foreach (i; iota(0, n, 2)) {
				tmp[i] = cards[i/2];
				tmp[i+1] = cards[(i+n)/2];
			}
			cards = tmp;
		} else {
				cards = cards[t..$] ~ cards[0..t];
		}
	}
	cards.map!(to!string).join("\n").writeln;
}

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

def solve(N: int, a: "List[int]"):
    # 素因数分解して，2の個数 == ans
    def factorization(n):
        factor = []
        n_ = n
        for i in range(2, int(math.sqrt(n) + 1)):
            if i == 3:
                break
            if n_ % i == 0:
                cnt = 0
                while n_ % i == 0:
                    n_ = n_ // i
                    cnt += 1
                factor.append([i, cnt])
        if n_ != 1:
            factor.append([n_, 1])
        if n == []:
            factor.append([n, 1])
        return factor

    ans = 0
    for ai in a:
        factor = factorization(ai)
        if factor[0][0] == 2:
            ans += factor[0][1]

    print(ans)

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()


Measured memory_bytes: 4212
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;
const int INF = 1e15;
const int mod = 1e9 + 7;

int n;
int h[105];

long long mod_pow(long long x, long long n){
    if(n == 0) return 1;
    long long res = mod_pow(x*x % mod, n / 2);
    if(n & 1) res = res*x % mod;
    return res;
}

P calc(int L, int R, int v){
    int dp1 = 1, dp2 = 1;
    if(L > R) return {-1, -1};
    int MIN = INF;
    rep(i, L, R + 1) MIN = min(MIN, h[i]);
    int w = R - L + 1;
    rep(i, L, R + 1) if(MIN != h[i]) w--;
    int pre = L - 1;
    rep(i, L, R + 1){
        if(MIN == h[i]){
            P p = calc(pre + 1, i - 1, MIN);
            if(p.first >= 0){
                (dp1 *= p.first) %= mod;
                (dp2 *= p.first + p.second) %= mod;
            }
            pre = i;
        }
    }
    P p = calc(pre + 1, R, MIN);
    if(p.first >= 0){
        (dp1 *= p.first) %= mod;
        (dp2 *= p.first + p.second) %= mod;
    }
    (dp2 = dp2 * mod_pow(2, w) + (mod_pow(2, MIN - v) + mod - 2) * dp1) %= mod;
    (dp1 *= mod_pow(2, MIN - v)) %= mod;
    return {dp1, dp2};
}

signed main(){
    cin >> n;
    rep(i, 1, n + 1) cin >> h[i];
    cout << calc(1, n, 0).second << endl;
}

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

int main()
{
	int A, B, C; cin >> A >> B >> C;

	int n = 0;
	bool found = false;
	int c_digits = 0; int tmp_c = C;
	while(tmp_c != 0){
		tmp_c >>= 1;
		c_digits++;
	}
	while(n <= pow(10, c_digits) && !found){
		if((n * A) % B == C){
			found = true;
		}
		n++;
	}

	if(found) cout << "YES" << endl;
	else cout << "NO" << endl;

	return 0;

}

Measured memory_bytes: 256
import java.util.*;
public class Main{
	
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		int A1 = sc.nextInt();
		int A2 = sc.nextInt();
		int A3 = sc.nextInt();
		
		if(A1+A2+A3 >=22) {
			System.out.print("bust");
		}else {
			System.out.print("win");
		}
		
	}

}


Measured memory_bytes: 22996
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
using ll = long long;

long long ncr(int n, int r) {
    if(r > n - r) r = n - r; // because C(n, r) == C(n, n - r)
    long long ans = 1;
    int i;

    for(i = 1; i <= r; i++) {
        ans *= n - r + i;
        ans /= i;
    }

    return ans;
}
ll mod(ll a,ll b,ll m){
    if(b==0)return 1;
    if(b%2==0){
        ll y =  mod(a,b/2,m);
        return (y*y)%m;
    }
    else{
        return ((a%m)*mod(a,b-1,m))%m;
    }
}

ll modinv(ll a,ll m){
return mod(a,m-2,m);
//works only for prime m.
//else calculate phi(m)-1.
}



int main()
{
    string s;
    cin>>s;
    int r=0;
    if(s[0]=='R'&&s[1]=='R'&&s[2]=='R'){
        cout<<3;
    }
    else if(s[0]=='R'&&s[1]=='R')cout<<2;
    else if(s[1]=='R'&&s[2]=='R')cout<<2;
    else if(s[0]=='R'||s[1]=='R'||s[2]=='R')cout<<1;
    else cout<<0;

    return 0;
}


Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define show(x) {for(auto i: x){cout << i << " ";} cout<<endl;}
#define showm(m) {for(auto i: m){cout << m.x << " ";} cout<<endl;}
typedef long long ll;
typedef pair<int, int> P;
ll gcd(int x, int y){ return y?gcd(y, x%y):x;}
ll lcm(ll x, ll y){ return (x*y)/gcd(x,y);}

//tag 桁数導出

int main()
{
    ll n;
    cin >> n;
    //Nの公約数の内、sqrt(N)より小さく、かつn/最大の数の桁数が答え
    ll invans = 1;
    for (ll i = 1; i*i <= n; i++)
    {
        if (n%i == 0){
            invans = i;
        }
    }
    
    //cout << n/invans << endl;
    cout << (int)to_string(n/invans).size() << endl; 
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define iREP(i,Itr) for(auto (i)=(Itr).begin();(i)!=(Itr).end();(i)++)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

string ori="CODEFESTIVAL2016";

int main(){
    
    string s;
    cin>>s;
    
    int cnt=0;
    REP(i,s.size())if(ori[i]!=s[i])cnt++;
    
    cout<<cnt<<endl;
    
    
    return 0;
}


Measured memory_bytes: 764
k, n = map(int, input().split())
a = list(map(int, input().split()))
b = 0
bp = 0
c = 0
for i in range(-1, n-1):
	b = abs(a[i+1]-a[i])
	bp = abs(k + a[i+1] - a[i])
	if bp < b:
		b = bp
	if b > c:
		c = b

print(k-c)

Measured memory_bytes: 26444
N=int(input())
for i in range(N):
    a,b,c=map(int,input().split())
    A=a**2
    B=b**2
    C=c**2
    if A+B==C:
        print('YES')
    elif A+C==B:
        print('YES')
    elif B+C==A:
        print('YES')
    else:
        print('NO')

Measured memory_bytes: 5596
#include <cstdio>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long lint;

int main()
{
	int N, K;
	static int cube[128][128][128];
	int x1[64], x2[64], y1[64], y2[64], z1[64], z2[64];
	vector<int> xs, ys, zs;
	map<int, int> convx, convy, convz;
	map<int, int> motox, motoy, motoz;
	
	scanf("%d %d", &N, &K);
	
	for (int i = 0; i < N; i++){
		scanf("%d %d %d %d %d %d", x1 + i, y1 + i, z1 + i, x2 + i, y2 + i, z2 + i);
		xs.push_back(x1[i]); xs.push_back(x2[i]);
		ys.push_back(y1[i]); ys.push_back(y2[i]);
		zs.push_back(z1[i]); zs.push_back(z2[i]);
	}
	
	sort(xs.begin(), xs.end());
	sort(ys.begin(), ys.end());
	sort(zs.begin(), zs.end());
	
	int idx = 0;
	convx[xs[0]] = idx;
	motox[idx++] = xs[0];
	for (int i = 1; i < 2 * N; i++){
		if (xs[i] != xs[i - 1]){
			convx[xs[i]] = idx;
			motox[idx++] = xs[i];
		}
	}
	
	idx = 0;
	convy[ys[0]] = idx;
	motoy[idx++] = ys[0];
	for (int i = 1; i < 2 * N; i++){
		if (ys[i] != ys[i - 1]){
			convy[ys[i]] = idx;
			motoy[idx++] = ys[i];
		}
	}
	
	idx = 0;
	convz[zs[0]] = idx;
	motoz[idx++] = zs[0];
	for (int i = 1; i < 2 * N; i++){
		if (zs[i] != zs[i - 1]){
			convz[zs[i]] = idx;
			motoz[idx++] = zs[i];
		}
	}
	
	for (int i = 0; i < N; i++){
		//printf("%d %d %d %d %d %d\n", convx[x1[i]], convy[y1[i]], convz[z1[i]], convx[x2[i]], convy[y2[i]], convz[z2[i]]);
		for (int x = convx[x1[i]]; x < convx[x2[i]]; x++){
			for (int y = convy[y1[i]]; y < convy[y2[i]]; y++){
				for (int z = convz[z1[i]]; z < convz[z2[i]]; z++){
					cube[x][y][z]++;
				}
			}
		}
	}
	
	lint ans = 0;
	for (int i = 0; i < 128; i++){
		for (int j = 0; j < 128; j++){
			for (int k = 0; k < 128; k++){
				/*if (cube[i][j][k] >= K){
					printf("!!\n");
					printf("motox[i + 1] = %d motox[i] = %d motoy[j + 1] = %d motoy[j] = %d motoz[k + 1] = %d motoz[k] = %d\n", motox[i + 1], motox[i], motoy[j + 1], motoy[j], motoz[k + 1], motoz[k]);
				}*/
				ans += (cube[i][j][k] >= K ? (lint)(motox[i + 1] - motox[i]) * (motoy[j + 1] - motoy[j]) * (motoz[k + 1] - motoz[k]) : 0);
			}
		}
	}
	
	printf("%lld\n", ans);
	
	return (0);
}

Measured memory_bytes: 8800
/* Author : bhavye9499 - Bhavye Anand Gupta */

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;

#define endl "\n"
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pii pair<ll,ll>
#define showArr(A,a,n) {for(int i=a; i<a+n; i++) cout << A[i] << " "; cout << endl;}
#define showPair(A,a,n) {for(int i=a; i<a+n; i++) cout << A[i].fi << " " << A[i].se << endl;}

const ll MOD = 1e9 + 7;

ll dp[100100][3], A[100100], B[100100], C[100100], n;

ll fun(ll i, ll j);

int main() {
    ios::sync_with_stdio(false);
    memset(dp, -1, sizeof(dp));
    memset(A, -1, sizeof(A));
    memset(B, -1, sizeof(B));
    memset(C, -1, sizeof(C));
    cin >> n;
    for(int i = 0; i < n; i++) {
    	cin >> A[i] >> B[i] >> C[i];
    }
    ll ans = max(A[0] + fun(1, 0), max(B[0] + fun(1, 1), C[0] + fun(1, 2)));
    cout << ans << endl;
}

ll fun(ll i, ll j) {
	if(dp[i][j] != -1)
		return dp[i][j];
	if(i == n-1 && j == 0)
		return dp[i][j] = max(B[n-1], C[n-1]);
	if(i == n-1 && j == 1)
		return dp[i][j] = max(A[n-1], C[n-1]);
	if(i == n-1 && j == 2)
		return dp[i][j] = max(A[n-1], B[n-1]);
	if(i >= n)
		return dp[i][j] = 0;
	if(j == 0)
		return dp[i][j] = max(B[i] + fun(i + 1, 1), C[i] + fun(i + 1, 2));
	if(j == 1)
		return dp[i][j] = max(A[i] + fun(i + 1, 0), C[i] + fun(i + 1, 2));
	if(j == 2)
		return dp[i][j] = max(A[i] + fun(i + 1, 0), B[i] + fun(i + 1, 1));
}

Measured memory_bytes: 9600
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include<limits.h>
#include<iomanip>
#define rep(i, n) for(int i = 0; i < n; i++)
#define rrep(i, n) for(int i = n-1; i >= 0; i--)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define lamsort(v,p) sort(v.begin(),v.end(),[](p a, p b){return a.num < b.num;});
#define check(v) rep(i,v.size()) cout << v[i] << " ";\
cout << endl
const long long INF = 1LL<<60;
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; }
typedef long long ll;
using namespace std;
//オーバーフローに気をつけろよおおおおおお
//確認忘れるなよおおおおおお
struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n,m; cin >> n >> m;

    UnionFind tree(n);

    vector<int> v(n);
    rep(i,n) {
        cin >> v[i];
        v[i]--;
    }
    rep(i,m) {
        int x, y; cin >> x >> y;
        tree.unite(x-1,y-1);
    }
    int cnt = 0;
    rep(i,n) {
        if(tree.same(i,v[i])) cnt++;
    }

    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>		// standard input output
#include <iostream>		// input output stream, cin cout( console in console out)
#include <cmath>		// circle math ( sin, con, sinh
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>		// input output manipulation

using namespace std;
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long 


int main() {
  int A,B; // 変数の宣言
  cin >> A >> B;; // 標準入力
  
  cout <<  A*B<< endl; // 標準出力
}

Measured memory_bytes: 3636
n = int(input())
l=list(map(int ,input().split()))

dp=[float("inf")]*n

dp[0]=0
dp[1]=abs(l[0]-l[1])
for i in range(n-2):
    dp[i+2]=min(dp[i]+abs(l[i]-l[i+2]),dp[i+1]+abs(l[i+1]-l[i+2]))
print(dp[-1])

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



public class Main {


	public static void main(String[] args){
		int a = 0;
		int b = 0;
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			while(true){
				String[] arr = br.readLine().split(" ");
				
				a = Integer.parseInt(arr[0]);
				b = Integer.parseInt(arr[2]);
				String op = arr[1];
				
				if("+".equals(op)){
					System.out.println(a+b);
				}else if("-".equals(op)){
					System.out.println(a-b);
				}else if("*".equals(op)){
					System.out.println(a*b);
				}else if("/".equals(op)){
					System.out.println(a/b);
					
				}else{
					break;
				}
				
				
			}
		}catch(IOException e){
			
		}

	}
}

Measured memory_bytes: 24324
#include<stdio.h>
#include<string.h>
#define LEN 100005

 typedef struct pp{
   char name[100];
   int t;
 }P;

P Q[LEN];

int head,tail,n;

void enqueue(P x);
P dequeue();
int min(int a,int b);

int main(){
  int elaps=0,c;
  int i,q;
  P u;

  scanf("%d %d",&n,&q);

  for(i=1;i<=n;i++){
    scanf("%s",Q[i].name);
    scanf("%d",&Q[i].t);
  }

  head=1;
  tail=n+1;

  while(head!=tail){
    u=dequeue();
    c=min(q,u.t);
    u.t-=c;
    elaps+=c;
    if(u.t>0)enqueue(u);
    else{
      printf("%s %d\n",u.name,elaps);
    }
  }

  return 0;
}

void enqueue(P x){
  Q[tail]=x;
  tail=(tail+1)%LEN;
}

P dequeue(){
  P x = Q[head];
  head=(head+1)%LEN;
  return x;
}

int min(int a,int b){
  return a<b?a:b;
}


Measured memory_bytes: 11984