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

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll , ll> 			pll;
typedef pair<ld, ld> 			pld;
typedef unordered_map<ll, ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5 + 7;
const ll 	MAX7 	= 	1e+7 + 7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9 + 7;

int dx4[] = {0, 1, 0, -1}, dy4[] = {1, 0, -1, 0};

// <------------- Declare Variables Here ------------> //

ll T = 1;
ll n, v, m, x, y, p, q, k, W;
string s, t, s0, s1, s2;

// <------------- Implement Functions Here ----------> //



// <------------- Start of main() -------------------> //

void MAIN() {
	cin>>s>>t;
	n = s.length();
	ll cou = 0;
	for(ll i=0;i<n;i++) cou+=(s[i]!=t[i]);
	cout<<cou;
}

int main() {
	fastio; randomINT;
	//cin >> T;
	while (T--) {
		MAIN();
	}
	return 0;
}


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

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var a = Console.ReadLine().Split().Select(int.Parse).ToArray();

            Array.Sort(a);
            var total1 = 0L;
            for (var i = N; i < 2 * N; i++) total1 += a[i];
            var total2 = 0L;
            for (var i = N; i < 3 * N; i += 2) total2 += a[i];

            Console.WriteLine(Math.Max(total1, total2));
        }
    }
}


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

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

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

int main() {


    int a,b; cin >> a >> b;
    int ans = a + b;
    ans = max(ans, (a-b));
    ans = max(ans, (a*b));

    cout << ans << endl;

    return 0;
    
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
   int N;
   cin>>N;
   vector<string> s(N);
   for(int i=0;i<N;i++){
      cin>>s.at(i);
   } 
   unordered_map<string,int> essence;
   int64_t count=0;

   for(int i=0;i<N;i++){
      sort(s.at(i).begin(),s.at(i).end());
      string key=s.at(i);
      if(essence.find(key)==essence.end())
         essence[key]=1;
      else{
         count+=essence[key];
         essence[key]++;
      }
   }
   cout<<count<<endl;
}

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

def main():
    l = [x + y for x in range(N + 1) if x % 4 == 0
               for y in range(N + 1) if y % 7 == 0]
    l = list(set(l))
    ans = "Yes" if l.count(N) else "No"
    print(ans)

if __name__ == "__main__":
    main()

Measured memory_bytes: 3060
import fractions as m

n = int(input())
al = list(map(int, input().split()))

gstackl = [0]*n
gstackr = [0]*n

ans = 0

for i in range(1, n):
	gstackl[i] = m.gcd(gstackl[i-1], al[i-1])
	gstackr[n-i-1] = m.gcd(gstackr[n-i], al[n-i])

#print(gstackl)
#print(gstackr)

for i in range(n):
	l = gstackl[i]
	r = gstackr[i]
	#print("{} {}".format(l, r))
	a = m.gcd(l, r)
	#print(a)
	if a > ans:
		ans = a

print(ans)

Measured memory_bytes: 16088
#include <bits/stdc++.h>
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define repm(i,a,b) for(ll i=(ll)(a);i>(ll)(b);i--)
#define all(v) v.begin(), v.end()
#define rall(x) (x).rbegin(),(x).rend()
#define pll pair<long long,long long>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define vc vector<char>
#define vvc vector<vc>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<long long>;
using vvll = vector<vll>;
using vb =vector<bool>;
using vvb=vector<vb>;
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; }
//snippets:tmp,cl,cvl,cs,co,coy,con,cov,setp

int main(){
    string s;
    cin >> s;
    cout << s[0] <<s[1]<<s[2]<< endl;
}

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

int main() {
	string s;
	bool ans = false;
	cin >> s;
	for (int i = 0;i < s.size()-1;++i) {
		if (s[i] == 'A' && s[i+1] == 'C') ans = true;
	}
	if (ans) cout << "Yes" << "\n";
	else cout << "No" << "\n";
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <complex>
#include <functional>
#include <utility>
#include <iterator>

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (m); i < (int)(n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define INF 2000000000
//#define int long long int

#ifdef LOCAL
  #define eprintf(...) fprintf(stdout, __VA_ARGS__)
#else
  #define eprintf(...) 0
#endif

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned int uint;

int main() {
  string s;
  cin >> s;
  auto res = s.find("YAKI");
  if(res == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
  
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

const double EPS = 1e-10;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;

struct Combination{
    vector<long long> _fac,_finv,_inv;
    const int m = MOD;

    Combination(int sz) : _fac(sz),_finv(sz),_inv(sz){
        _fac[0] = _fac[1] = 1;
        _finv[0] = _finv[1] = 1;
        _inv[1] = 1;
        for(int i = 2; i <= sz; i++){
            _fac[i] = _fac[i-1]*i%m;
            _inv[i] = m-_inv[m%i]*(m/i)%m;
            _finv[i] = _finv[i-1]*_inv[i]%m;
        }
    }

    inline long long fac(int n){return _fac[n];}
    inline long long inv(int n){return _inv[n];}
    inline long long finv(int n){return _finv[n];}

    long long comb(int n,int k){
        if(n < k) return 0;
        if(n < 0 || k < 0) return 0;
        return _fac[n]*(_finv[k]*_finv[n-k]%m)%m;
    }
};

int main(){
    int n,k; cin >> n >> k;
    Combination C(1000000);
    if(k >= n-1){
        cout << C.comb(2*n-1,n-1) << endl;
    }
    else{
        ll ans = 0;
        rep(i,k+1){
            ans += C.comb(n-1,i)*C.comb(n,i)%MOD;
            ans %= MOD;
        }
        cout << ans << endl;
    }
}


Measured memory_bytes: 23808
#ifdef __APPLE__
# include <iostream>
# include <cmath>
# include <algorithm>
# include <stdio.h>
# include <cstdint>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <random>
# include <deque>
# include <functional>
# include <iomanip>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <immintrin.h>
# include <cassert>
# include <array>
# include <tuple>
# include <unordered_map>
# include <unordered_set>
# include <thread>
#else
# include <bits/stdc++.h>
#endif

#define F first
#define S second
#define MP make_pair
#define PB push_back

#define all(a) a.begin(),a.end()
#define len(a) (int)(a.size())
#define mp make_pair
#define pb push_back
#define fir first
#define sec second

using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;

const int max_n = 1e6+10, inf = 1000111222;

struct node
{
    array<int,26> go;
    array<int,26> cnt;

    node() {
        for (int i=0;i<26;i++){
            go[i]=0;
            cnt[i]=0;
        }
    }
};

int root=1;
int last_used_node=1;
node a[max_n];

int go_bor(string t)
{
    int cur=root;
    for (auto i:t){
        if (!a[cur].go[i-'a']){
            return -1;
        }
        cur=a[cur].go[i-'a'];
    }
    return cur;
}

void add_bor(string s)
{
    array<int,26> cur_cnt;
    for (int j=0;j<26;j++){
        cur_cnt[j]=0;
    }
    for (auto i:s){
        cur_cnt[i-'a']++;
    }

    int cur=root;
    for (auto i:s){
        /// add this
        for (int j=0;j<26;j++){
            if (cur_cnt[j]){
//                cout<<"kek :: "<<cur<<" "<<j<<"\n";
                a[cur].cnt[j]++;
            }
        }
        cur_cnt[i-'a']--;
        if (!a[cur].go[i-'a']){
            a[cur].go[i-'a']=++last_used_node;
        }
        cur=a[cur].go[i-'a'];
    }
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

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

    int n;
    cin>>n;
    vector<string> kek(n);
    for (int i=0;i<n;i++){
        cin>>kek[i];
    }

    ll ans=0;
    for (int it=0;it<2;it++){
        for (auto i:kek){
            string s=i;
            reverse(all(s));

            string t=s;
            int last_char=t.back();
            t.pop_back();
            int cur=go_bor(t);
            if (cur!=-1){
//                cout<<"lol :: "<<(last_char-'a')<<" "<<a[cur].cnt[last_char-'a']<<"\n";
                ans+=a[cur].cnt[last_char-'a'];
            }
            add_bor(s);
        }
        for (int i=0;i<max_n;i++){
            a[i]=*new node();
        }
        last_used_node=1;
        reverse(all(kek));
    }

    map<string,int> kek_cnt;
    for (auto i:kek){
        kek_cnt[i]++;
    }
    for (auto i:kek_cnt){
        ans-=1ll*i.sec*(i.sec-1)/2;
    }

    cout<<ans<<"\n";
}


Measured memory_bytes: 665692
// AOJ 2335: 10-Year-Old Dynamic Programming
// 2017.11.27 bal4u@uu

#include <stdio.h>

#define M   1000000007
#define MAX 2020000

long long fact[MAX+2], inv[MAX+2], factinv[MAX+2];

long long comb(int n, int k)
{
    if (n < 0 || k < 0 || n < k) return 0;
	if (k == 0) return 1LL;
    return (((fact[n] * factinv[k]) % M) * factinv[n-k]) % M;
}

int main()
{
	int n, m, k, i, j, ii, jj, kk;
	long long ans, r, c;

	for (fact[0] = 1, i = 1; i <= MAX; i++) fact[i] = (fact[i-1]*i) % M;
	for (inv[1]  = 1, i = 2; i <= MAX; i++) inv[i] = (M + (-(M/i)*inv[M % i]) % M) % M;
	for (factinv[0] = 1, i = 1; i <= MAX; i++) factinv[i] = (factinv[i-1]*inv[i]) % M;

	scanf("%d%d%d", &n, &m, &k);

    ans = 0; kk = n + m + (k << 1);
    for (i = 0; i <= k; i++){
        j = k-i, ii = n + (i << 1), jj = m + (j << 1);
        r = (comb(ii, i) - comb(ii, i-1) + M) % M;
        c = (comb(jj, j) - comb(jj, j-1) + M) % M;
        ans = (ans + (r*c) % M * comb(kk, ii)) % M;
    }
    printf("%lld\n", ans);
}

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

int main(){

    int x , a , b ;
    cin>>x>>a>>b;

    int aD=abs(x-a);
    int bD=abs(x-b);

    if(aD < bD) cout<<"A"<<endl;
    else cout<<"B"<<endl;


    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
using namespace std;
int main(){
	int n,h[100000],dp[100000],k=3;
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>h[i];
	dp[1]=abs(h[1]-h[0]);
	for(int i=2;i<n;i++){
		dp[i]=min(dp[i-2]+abs(h[i]-h[i-2]),dp[i-1]+abs(h[i]-h[i-1]));

	}
	cout<<dp[n-1];

}

Measured memory_bytes: 1024
#include "bits/stdc++.h"
 
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; i++) 
#define REP(i,n) for(int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define INF LLONG_MAX/2
#define all(x) (x).begin(),(x).end()
#define debug(x) cerr<<#x<<": "<<x<<endl
#define debug_vec(v) cerr<<#v<<":";rep(i,v.size())cerr<<" "<<v[i];cerr<<endl
using namespace std;
int MOD = 1000000007;
int dp[103][4][4][4] = {0};
signed main(){
    int n;
    cin >> n;
    rep(i,4){
        rep(j,4){
            rep(k,4){
                dp[3][i][j][k] = 1;
            }
        }
    }
    dp[3][0][1][2] = dp[3][0][2][1] = dp[3][1][0][2] = 0; 
    for(int cnt = 4;cnt <= n;cnt++){
        rep(i,4){
            rep(j,4){
                rep(k,4){
                    dp[cnt][j][k][0] += dp[cnt-1][i][j][k];
                    dp[cnt][j][k][3] += dp[cnt-1][i][j][k];
                    if(!((i == 0 && j == 1) || (i == 0 && k == 1) || (k == 0 && j == 1) || (k == 1 && j == 0))){
                        dp[cnt][j][k][2] += dp[cnt-1][i][j][k];
                    }
                    if(!(k == 2 && j == 0)){
                        dp[cnt][j][k][1] += dp[cnt-1][i][j][k];
                    }
                    rep(l,4)dp[cnt][j][k][l] %= MOD;
                }
            }
        }
    }
    int ans = 0;
    rep(i,4){
        rep(j,4){
            rep(k,4){
                ans += dp[n][i][j][k];
                ans %= MOD;
            }
        }
    }
    cout << ans << endl;

   
    
    return 0; 
}

// g++ -std=c++14 code1.cpp
// rm -r -f test;oj dl https://yahoo-procon2019-qual.contest.atcoder.jp/tasks/yahoo_procon2019_qual_d
// rm -r -f test;oj dl http://abc122.contest.atcoder.jp/tasks/abc122_a

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	int n; cin >> n;
	cout << n * n * n << endl;
	
	return 0;
}

Measured memory_bytes: 256
import sys
input = lambda : sys.stdin.readline().rstrip()

n = int(input())
As = map(int, input().split(" "))

status = None
start_A = None
cur = 1000
for i, A in enumerate(As):
    if i == 0:
        pass
    else:
        if last_A < A:
            if status is None or status == "down":
                start_A = last_A
                status = "up"

        elif last_A > A:
            if status == "up":
                end_A = last_A
                r = cur // start_A
                q = cur % start_A
                cur = r * end_A + q
                start_A = None
                status = "down"

    last_A = A

if start_A is not None:
    end_A = last_A
    r = cur // start_A
    q = cur % start_A
    cur = r * end_A + q
    start_A = None
   
print(cur)

Measured memory_bytes: 64460
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <numeric>
using namespace std;

int main(){

    int n = 3;
    vector<long long>v(n);
     
    for(int i = 0; i < n; i++){
        cin >> v[i];
    }

    long long ans = 0;
    while(v[0] % 2 == 0 && v[1] % 2 == 0 && v[2] % 2 == 0 ){

        if(v[0] == v[1] && v[0] == v[2]){
            ans = -1;
            break;
        }

        long long tmp0 = v[0];
        long long tmp1 = v[1];
        long long tmp2 = v[2];

        v[0] = (tmp1 + tmp2) / 2;
        v[1] = (tmp0 + tmp2) / 2;
        v[2] = (tmp1 + tmp0) / 2;
        ans ++;

    }

    cout << ans << endl;




}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

// c++11
#include <array>
#include <tuple>
#include <unordered_map>
#include <unordered_set>

#define mp make_pair
#define mt make_tuple
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

const int INF = 1 << 29;
const double EPS = 1e-9;
const ll MOD = 1000000007;

const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
const int MAX_N = 100100;
ll N,M;
vector<int> edges[MAX_N];
int visited[MAX_N];
int colors[MAX_N];
bool is_cycle(int pos, int pre, int color){
    visited[pos] = 2;
    colors[pos] = color;
    for (auto &nxt : edges[pos]){
        if (nxt != pre){
            if (visited[nxt] == 2 and colors[nxt] == color){
                return true;
            }
            if (visited[nxt] == -1){
                if (is_cycle(nxt, pos, 1 - color)){
                    return true;
                }
            }
        }
    }
    visited[pos] = 1;
    return false;
}
int main() {
    cin >> N >> M;
    for (int i = 0; i < M; i++){
        int a,b;
        cin >> a >> b;
        a--,b--;
        edges[a].push_back(b);
        edges[b].push_back(a);
    }
    memset(visited, -1, sizeof(visited));
    bool cycle = is_cycle(0, -1, 0);
    if (cycle){
        ll res = (ll)N * (N - 1) / 2;
        cout << res - M << endl;
    }else{
        int X,Y;
        X = Y = 0;
        for (int i = 0; i < N; i++){
            if (colors[i]){
                X++;
            }else{
                Y++;
            }
        }
        cout << (ll)X*Y - M << endl;
    }
   return 0;
 }


Measured memory_bytes: 7168
using System;
using System.Linq;
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var v = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var c = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int total = 0;
            for (int nIdx = 0; nIdx < v.Length; ++nIdx)
            {
                var sa = v[nIdx] - c[nIdx];
                if (0 < sa)
                {
                    total += sa;
                }
            }
            Console.WriteLine($"{total}");
        }
    }

Measured memory_bytes: 13396
//
// Created by sanyinchen on 17/4/12.
//

#include "iostream"
#include<cstdio>
using namespace std;

/*
int *insertSort(int (&array)[8], int length) {


    for (int i = 1; i < length; i++) {

        // loop change header of array
        for (int k = 0; k < i; k++) {
            if (array[i] < array[k]) {
                swap(array[i], array[k]);
            }

        }
    }


    return array;
}
 */
void printArray(int *array, int length) {
    for (int i = 0; i < length; i++) {
        if(i!=0)cout<<" ";
        cout << array[i];
    }
    cout << endl;
}

int main() {
    //freopen("../files/sort_1.txt","r",stdin);
    int array[100] = {0};
    int length = 0;
    cin >> length;
    for (int i = 0; i < length; i++) {
        cin >> array[i];
    }
    printArray(array, length);

    for (int i = 1; i < length; i++) {

        // loop change header of array
        for (int k = 0; k < i; k++) {
            if (array[i] < array[k]) {
                swap(array[i], array[k]);
            }

        }
        printArray(array, length);
    }


    return 0;
}

Measured memory_bytes: 3080
//#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <vector>
#include <string>

//Some constants don't work
#ifndef INT_MAX
#define INT_MAX 2147483647
#endif
#ifndef INT_MIN
#define INT_MIN -2147483648
#endif
//short hand tricks
typedef long long ll;

using namespace std;

int main(int argc, char * argv[]) {
    ios_base::sync_with_stdio(false);
    ll N, K;
    cin >> N >> K;
    vector<ll> logs(N);
    for(int i=0; i<N; i++) {
        cin >> logs[i];
    }
    ll low = 1;
    ll high = 1e9;
    ll res = 1e9;
    while(low<=high) {
        ll mid = low+(high-low)/2;
        //see if mid is a solution
        //count how many cuts to make each log <=mid
        ll kcuts = 0;
        for(ll log : logs) {
            if(log>mid) {
                kcuts+=log/mid;
                if(log%mid==0) kcuts--;
            }
        }
        if(kcuts<=K) {
            res = min(mid, res);
            high = mid-1;
        } else {
            low = mid+1;
        }
    }
    cout << res << "\n";
    return 0;
}


Measured memory_bytes: 4852
import java.io.*;
import java.util.*;

class Main{
	
	public static void sentence(ArrayList<String> list){
		int max_l= 0,max=0,m_count=0,l,count;
		
		String str,str1,str2;
		
		for(int i=0;i<list.size();i++){
			str = list.get(i);
			l = str.length();
			if(l > max_l)
				max_l = l;
		}
		
		for(int i=0;i<list.size();i++){
			count = 0;
			for(int j=0;j<list.size();j++){
				if(i == j) continue;
				str1 = list.get(i);
				str2 = list.get(j);
				if(str1.equals(str2))
					count++;
			}
			if(m_count < count){
				m_count = count;
				max = i;
			}
		}
		
		for(int i=0;i<list.size();i++){
			str = list.get(i);
			if(i == max)
				System.out.print(str + " ");
		}
		
		for(int i=0;i<list.size();i++){
			str = list.get(i);
			l = str.length();
			if(l == max_l)
				System.out.println(str);
		}
		
	}

	public static void main(String args[]) throws IOException{
		String str;
		ArrayList <String> inp = new ArrayList<String>();

		Scanner scan = new Scanner(System.in);
		
		while(scan.hasNext()){
			
			str = scan.next();
			inp.add(str);
		}
		sentence(inp);
	}
}

Measured memory_bytes: 12000
#include <iostream>
#include <algorithm>
#include <climits>
#include <numeric>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
 
#define barsik ios::sync_with_stdio(false)
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
typedef long long ll;
typedef std::vector<int> vi;
typedef std::pair <int, int> pii;
typedef std::unordered_set <int> u_si;
const double PI = acos(-1);
const long double EPS = 1e-9;
using namespace std;


void solve(){
    int n, k;
    cin >> n >> k;
    int ans = 0;
    
    for(int i = 0; i < n; i++){
        int x;
        cin >> x;
        ans += 2 * min(x, abs(x - k));
    }
    cout << ans;
}


int main(){
    int q = 1;
    //cin >> q;}
    while(q--) solve();
}
// vse dolzhny vyiti v internet po hhtp


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

public static partial class Program
{
    public static void Main()
    {
        var nums = CRL().ArrayInts();
        var add = nums.Sum();
        var sub = nums[0] - nums[1];
        var mul = nums[0] * nums[1];
        CWL(new []{add, sub, mul}.Max());
    }
}

public static partial class Program
{
    //テンプレここから
    public static long GCD(long a, long b) => b == 0 ? a : GCD(b, a % b);
    public static int GCD(int a, int b) => b == 0 ? a : GCD(b, a % b);
    public static long LCM(long a, long b) => a * b / GCD(a, b);
    public static int LCM(int a, int b) => a * b / GCD(a, b);
    public static int ToInt(this double d) => (int) d;
    public static long ToLong(this double d) => (long) d;
    public static int ToInt(this string str) => int.Parse(str);
    public static long ToLong(this string str) => long.Parse(str);
    public static long[] ToLong(this IEnumerable<string> strs) => strs.Select(x => x.ToLong()).ToArray();
    public static int[] ToInt(this IEnumerable<string> strs) => strs.Select(x => x.ToInt()).ToArray();
    public static long[] ArrayLongs(this string str, char opr = ' ') => str.Split(opr).ToLong();
    public static int[] ArrayInts(this string str, char opr = ' ') => str.Split(opr).ToInt();
    public static string CRL() => Console.ReadLine();
    public static string RL() => Console.ReadLine();
    public static void CWL(object obj) => Console.WriteLine(obj);
    public static void WL(object obj) => Console.WriteLine(obj);
    public static long Diff(long a, long b) => Math.Abs(Math.Max(a, b) - Math.Min(a, b));
    public static int Diff(int a, int b) => Math.Abs(Math.Max(a, b) - Math.Min(a, b));
    public static long Sign(this long i) => Math.Sign(i);
    public static bool IsEven(this long i) => i % 2 == 0;
    public static bool IsEven(this int i) => i % 2 == 0;
    public static int[] dx = new [] {0, -1, 0, 1};
    public static int[] dy = new [] {-1, 0, 1, 0};
    public static long mod = 1000000007;
    public static string alphabet = "abcdefghijklmnopqrstuvwxyz";
    public static long ToLong(this char c) => c.ToString().ToInt();
    public static long[] Sort(this long[] array) => array.OrderBy(x => x).ToArray();
    public static int[] Sort(this int[] array) => array.OrderBy(x => x).ToArray();
    public static long[] DSort(this long[] array) => array.OrderByDescending(x => x).ToArray();
    public static int[] DSort(this int[] array) => array.OrderByDescending(x => x).ToArray();
    public static string Join(this IEnumerable<string> array, string sep = "") => string.Join(sep, array);
    public static string Join(this IEnumerable<char> array, string sep = "") => string.Join(sep, array);
    //テンプレここまで
}


Measured memory_bytes: 13396
#include <iostream>

long long a[200020];
long long b[200020];

int main(){
    int n;
    std::cin >> n;
    for(int i = 0; i < n; i++){
        std::cin >> a[i];
        b[a[i]] += 1;
    }
    long long pre = 0;
    for(int i = 1; i <= n; i++){
        pre += b[i]*(b[i]-1)/2;
    }
    for(int i = 0; i < n; i++){
        std::cout << pre - b[a[i]] + 1 << std::endl;
    }
    return 0;
}


Measured memory_bytes: 4736
# coding: utf-8
from fractions import gcd
a,b,c,d = map(int,input().split())
lcm = c*d//gcd(c,d)
print((b-a + 1) - (b//c-(a-1)//c) - (b//d-(a-1)//d) + (b//(lcm) - (a-1)//(lcm)))

Measured memory_bytes: 5048
import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args) throws Exception{
	int i = 0;
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	
	String str_A = br.readLine();

	int[] A;
	A = new int[2];
	
	Scanner s = new Scanner(str_A).useDelimiter("\\s* \\s*");
	
	while(s.hasNext()){
	    A[i] = s.nextInt();
	    i++;
	}
	
	while(Math.min(A[0],A[1]) != 0){
	    int x,y;
	    x = Math.min(A[0],A[1]);
	    y = Math.max(A[0],A[1]) % x;
	    A[0] = x;
	    A[1] = y;
	}
	System.out.println(Math.max(A[0],A[1]));
	return ;
    }
}

	



Measured memory_bytes: 26260
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mp(a,b) make_pair(a,b)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) if(a){cout<<"Yes"<<endl;}else cout<<"No"<<endl;//条件によってYes、Noを出力する
int main(){
    int n;
    cin>>n;
    int64_t ans=0;
    vector<int64_t> a(n);
    rep(i,n)cin>>a[i];
    for(int i=1;i<n;i++){
        if(a[i]<a[i-1]){
            ans += (a[i-1]-a[i]);
            a[i]=a[i-1];
        }
    }
    cout<<ans<<endl;

}

Measured memory_bytes: 4840
#include <iostream>

using namespace std;

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

    int a = N / 100;
    int b = (N - a * 100) / 10;
    int c = N - a * 100 - b * 10;

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

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<climits>

long k = 0;

void Merge(int a[], int left, int mid, int right){
	int n1 = mid - left;
	int n2 = right - mid;
	int* L = new int[n1+1];
	int* R = new int[n2+1];
	for ( int i = 0; i < n1; i++) L[i] = a[left + i];
	L[n1] = INT_MAX;
	for (int i = 0; i < n2; i++) R[i] = a[mid + i];
	R[n2] = INT_MAX;
	int i = 0;
	int j = 0;
	while(i < n1 || j < n2){
		if (L[i] <= R[j]){
			a[left + i + j] = L[i];
			i++;
		}
		else{
			a[left + i + j] = R[j];
			j++;
			k += n1 - i;
		}
	}
}

void MergeSort(int a[], int left, int right){
	if (left + 1 < right){
		int mid = (left + right) / 2;
		MergeSort(a, left, mid);
		MergeSort(a, mid, right);
		Merge(a, left, mid, right);
	}
}

int main(){
	int n = 0;
	scanf("%d", &n);
	int a[200000];
	for (int i = 0; i < n; i++) scanf("%d", &a[i]);
	MergeSort(a, 0, n);
//	for ( int i = 0; i < n; i++){
//		printf("%ld", a[i]);
//		if (i != n-1) printf(" ");
//	}
//	printf("\n");
	printf("%ld\n", k);
}


Measured memory_bytes: 26928
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define Clear(a) a = decltype(a)()
#define all(a) a.begin(),a.end()
#define vec vector
typedef long long ll;
typedef pair<int,int> p;
//const ll big=998244353;
const ll big=1000000007;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
ll max(ll x,ll y){
if(x>y)return x;
else return y;
}
ll min(ll x,ll y){
if(x<y)return x;
else return y;
}
ll expm(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||x==0)return x;
    if(y%2==1)return (expm(x,y-1)*x)%big;
    ll t=expm(x,y/2);
    return (t*t)%big;
}
ll exp(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||y==0)return x;
    if(y%2==1)return exp(x,y-1)*x;
    ll t=exp(x,y/2);
    return t*t;
}
ll inv(ll x){
    return expm(x,big-2);
}


int main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    /*--------------------------------*/

    vec<bool> prime(1001,1);
    prime[0]=0;prime[1]=0;
    rep2(i,2,1001){
        if(!prime[i])continue;
        for(int j=2*i;j<=1000;j+=i)prime[j]=0;
    }

    int n;cin >> n;
    vec<ll> a(n);
    rep(i,n)cin >> a[i];
    /*
    最小公倍数を割る感じだが…
    l/a+l/b+l/c+...
    =l((product/a)+(product/b)+...)/abc...
    pの指数を見ると,l/abc...について
    max(a,b,c,...)-(a+b+...)
    =-(ほとんどの和)
    pの指数についてmax以外のやつらの積を取る
    i.e.全部の積をとってmaxのやつらで割ったもので割る
    */
   ll pro=1;
   map<ll,ll> primes;
   rep(i,n){
       pro=pro*a[i]%big;
       int k=a[i];
       //素因数分解の指数のmaxを保持しとく
       for(int j=2;j*j<=k;j++){
           if(!prime[j])continue;
           int now=0;
           while(k%j==0){
               k/=j;
               now++;
           }
           if(now)primes[j]=max(primes[j],now);
       }
       if(k!=1)primes[k]=max(primes[k],1);
   }
   ll ans=0;
   rep(i,n){
       ans+=pro*inv(a[i]);
       ans%=big;
   }

   for(p t:primes){
       pro*=inv(expm(t.first,t.second));
       pro%=big;
       //cout << t.first << 'T' << endl;
   }
   ans*=inv(pro);
   cout << ans%big << endl;
}

Measured memory_bytes: 4196
import java.util.*;
import java.io.*;

class Main{		//?????£??????

	int a;
	int b;

	public Main(){
		Scanner scan = new Scanner(System.in);
		a = scan.nextInt();
		b = scan.nextInt();

		int x = a / b;
		int y = a % b;
		double z = (double)a / (double)b;

		System.out.printf("%d %d %.5f", x, y, z);
		System.out.println("");
	}
	public static void main(String[] args){
		new Main();
	}
}

Measured memory_bytes: 26416
#include <iostream>
using namespace std;
typedef long long ll;
ll n, m, a, b, c, d[200][200], e[200][200], res = 0;
const ll INF = 1000000000000000000;
int main(void){
    // Your code here!
    cin >> n >> m;
    for (ll i = 1; i <= n; i++) {
        for (ll j = 1; j <= n; j++) {
            if (i == j) continue;
            d[i][j] = INF;
            e[i][j] = INF;
        }
    }
    for (ll i = 0; i < m; i++) {
        cin >> a >> b >> c;
        d[a][b] = c; e[a][b] = c;
        d[b][a] = c; e[b][a] = c;
    }
    for (ll k = 1; k <= n; k++) {
        for (ll i = 1; i <= n; i++) {
            for (ll j = 1; j <= n; j++) {
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
            }
        }
    }
    for (ll i = 1; i <= n; i++) {
        for (ll j = i + 1; j <= n; j++) {
            if (e[i][j] == INF || d[i][j] == e[i][j]) continue;
            res++;
        }
    }
    cout << res << endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
template<class T> inline bool chmax(T &a, T b) { if (a<b) {a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, T b) { if (b<a) {a=b; return 1;} return 0;}

const int INF = 1001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int d; ll g;
    cin >> d >> g;
    vll p(d), c(d);
    rep(i, d) cin >> p[i] >> c[i];
    int ans = INF;
    rep(bit, 1<<d) {
        ll now = 0;
        int cnt = 0;
        rep(i, d) {
            if (bit>>i & 1) {
                cnt += p[i];
                now += c[i] + p[i] * 100 * (i+1);
            }
        }
        if (now < g) {
            for (int i = d-1; i >= 0; --i) {
                if (!(bit>>i&1)) {
                    int point = 100 * (i+1);
                    ll x = (g - now + point - 1) / point;
                    now += point * min(x, p[i] - 1);
                    cnt += min(x, p[i] - 1);
                    break;
                }
            }
        }
        if (now >= g) chmin(ans, cnt);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
//
#include <bits/stdc++.h>
using namespace std;
#define INF 1000000000
#define MOD 1000000007
#define PI 3.14159265
#define EPS 1e-9
#define Pi acos(-1.0)
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;

/*CODE START HERE*/

int n, k, ans;

int main(){
    ios::sync_with_stdio(0);
    cin >> n >> k;
    ans = 1;
    forn(i,n){
        if(ans > k){
            ans+=k;
        }else{
            ans+=ans;
        }
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int

using namespace std;

int main()
{
    vector <ll> a;
    ll n,m,i,j,s=0;
    double x;
    cin>>n>>m;

    for(i=0; i<n; i++)
    {
        cin>>x;
        a.push_back(x);
        s+=x;
    }

    x=ceil((1/(4*m*1.00))*s*1.00);

    sort(a.begin(), a.end(), greater <ll>());

    ll f=0;
//cout<<x<<endl;

    for(i=0; i<m; i++)
    {

        if(a[i]<x)
        {
            f=1;
            break;
        }

    }
    if(f==1)
    {
        cout<<"No"<<endl;

    }
    else
    {
        cout<<"Yes"<<endl;

    }

    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std; 
  
void simpleSieve(int limit, vector<int>& prime) 
{ 
    bool mark[limit + 1]; 
    memset(mark, false, sizeof(mark)); 
  
    for (int i = 2; i <= limit; ++i) { 
        if (mark[i] == false) { 
           
            prime.push_back(i); 
            for (int j = i; j <= limit; j += i) 
                mark[j] = true; 
        } 
    } 
} 
  

void primesInRange(int low, int high) 
{ 
    
    int limit = floor(sqrt(high)) + 1; 
    vector<int> prime; 
    simpleSieve(limit, prime); 
  
    int n = high - low + 1; 
  
   
    bool mark[n + 1]; 
    memset(mark, false, sizeof(mark)); 
  
    
    for (int i = 0; i < prime.size(); i++) { 
    
        int loLim = floor(low / prime[i]) * prime[i]; 
        if (loLim < low) 
            loLim += prime[i]; 
        if(loLim==prime[i]) 
            loLim += prime[i]; 
       
        for (int j = loLim; j <= high; j += prime[i]) 
            mark[j - low] = true; 
    } 
 
    for (int i = low; i <= high; i++) 
        if (!mark[i - low]) 
           { cout << i << "  "; 
            break;}
} 
  
int main() 
{   int x;
    cin>>x;
    int low = x, high = x+1000; 
    if(x==1)
    cout<<2;
    else{
    primesInRange(low, high); }
    return 0; 
} 

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

int main() {
	int n;
	string s;

	cin >> n;
	cin >> s;

	int count = 0;
	for (int i = 0; i < n - 2; i++) {
		if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C')
			count++;
	}

	cout << count << endl;

	return 0;
}


Measured memory_bytes: 256
N, K = map(int, input().split())
cnt_list = []
cnt_value = 0
for i in range(1, N+1):
    cnt = 1
    cnt_value = i
    while (1):
        if K <= cnt_value:
            cnt_list.append(cnt)
            break
        cnt_value *= 2
        cnt += 1
for i in range(len(cnt_list)):
    cnt_list[i] = float(1/(2**(cnt_list[i]-1)))
#print(cnt_list)
print("{0:.16f}".format(float(sum(cnt_list)/N)))

Measured memory_bytes: 6296
#include<bits/stdc++.h>
using namespace std;
int a[100005];
int main()
{
    memset(a,0,sizeof(a));
   int i,j,n;
   cin>>n;
   int s=0;
   while(n--)
   {
       int x,y;
       cin>>x>>y;
       s+=y-x+1;
   }
   cout<<s<<endl;
}


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

using namespace std;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
typedef long long ll;
//typedef pair<int, int> P;
typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = 10e10;
const ll MINF = -10e10;
//const int INF = INT_MAX;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)

typedef priority_queue<P, vector<P>, greater<P>> PQ_ASK;
const int mod = 1000000007;

//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);

ll pow2(ll a, ll b) {
    ll res = a;
    for (ll i = 1; i < b; i++) {
        res *= a;
    }
    return res;
}

int main() {

    vector<ll> nums(3);
    cin >> nums[0];
    cin >> nums[1];
    cin >> nums[2];

    sort(nums.rbegin(), nums.rend());

    int k;
    cin >> k;
    nums[0] = nums[0] * pow2(2, k);

    ll ans = accumulate(nums.begin(), nums.end(), 0);
    cout << ans << endl;

}

Measured memory_bytes: 256
q=int(input())
l=[list(map(int,input().split())) for i in range(q)]
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]
p=primes(10**5)
a=[0]*(10**5+1)
cnt=0
for i in range(1,10**5+1):
  if i%2==1 and i in p and (i+1)//2 in p:
    cnt+=1
  a[i]=cnt
for i in range(q):
  print(a[l[i][1]]-a[l[i][0]-1])

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

import bisect

N, K = map(int,input().split())
x = list(map(int, input().split()))
zero = bisect.bisect_right(x,0)
x.append(0)
x.sort()
dis = []
for i in range(1,N+1):
    dis.append(x[i]-x[i-1])

left=1
leftdis=0
while left<=K and zero-left>=0:
    leftdis+=dis[zero-left]
    left+=1
left-=1

right=1
rightdis=0
while left+right<=K:
    rightdis+=dis[zero+right-1]
    right+=1
right-=1

ans = min(rightdis*2+leftdis, rightdis+leftdis*2)
while right+zero<N and left > 0:
    leftdis-=dis[zero-left]
    rightdis+=dis[zero+right]
    ans = min(ans,rightdis*2+leftdis, rightdis+leftdis*2)
    left-=1
    right+=1

print(ans)
    





Measured memory_bytes: 14252
#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 <iomanip>

using namespace std;

int main(){
   string S;
   cin >> S;
   if(S[1]=='R') cout << "ABC"<<endl;
   else cout << "ARC" <<endl;
   return 0;
}


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

int main() {
    int n;
    int a[201];
    cin >> n;

    for(int i=0;i<n;i++)cin >> a[i];
    int ans = 0;
    while(true){
        bool ok = true;
        for(int i=0;i<n;i++)if(a[i]%2==1)ok = false;
        if(!ok)break;
        for(int i=0;i<n;i++)a[i]=a[i]/2;
        ans++;
    }
    cout << ans << endl;
}

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int N;
int A[111111];

int a[111111];

signed main(){
    cin>>N;
    string s;cin>>s;
    rep(i,s.size()){
        A[i]=s[i]=='x';
    }

    rep(i,2)rep(j,2){
        a[0]=i;a[1]=j;
        for(int j=1;j<N+1;j++){
            a[j+1]=a[j-1]^A[j%N]^a[j];
        }

        if(a[0]==a[N]&&a[1]==a[N+1]){
            rep(k,N){
                if(a[k])s[k]='W';
                else s[k]='S';
            }
            cout<<s<<endl;
            return 0;
        }
    }

    cout<<-1<<endl;
}


Measured memory_bytes: 2176
class PriorityQueue
  
  def initialize
    @heap = Array.new
    @sz = 0
  end
  
  def push x
    i = @sz
    @sz += 1
    while i > 0 do
      p = ( i - 1 ) / 2
      break if @heap[p] <= x
      @heap[i] = @heap[p]
      i = p
    end
    @heap[i] = x
  end
  
  def pop
    
    ret = @heap[0]
    x = @heap[@sz-=1]
    
    i = 0
    while i * 2 + 1 < @sz do
      a = i * 2 + 1
      b = i * 2 + 2
      a = b if b < @sz && @heap[b] < @heap[a]
      break if @heap[a] >= x
      @heap[i] = @heap[a]
      i = a
    end
    
    @heap[i] = x
    @heap.delete_at(-1)
    ret
  end
  
  def top
    @heap[0]
  end
  
  def empty?
    @sz == 0
  end
  
  def all
    @heap
  end
end

n, m = gets.to_s.split.map{|t| t.to_i }
dr   = Array.new(n){ gets.to_s.split.map{|t| t.to_i } }.sort_by{|d,_|d}

pq = PriorityQueue.new

ans = 0
cur = 0
(1..m).each do |i|
  
  while dr[cur] && dr[cur][0] == i do
    pq.push -dr[cur][1]
    cur += 1
  end
  pq.empty? || ans += -pq.pop
end

puts ans

Measured memory_bytes: 14584
#include "bits/stdc++.h"
using namespace std;
#ifndef LOCAL
#define endl '\n'
#endif

#define fr(i, a, b) for(int i = a; i <= b; i++)
#define rf(i, a, b) for(int i = a; i >= b; i--)
#define pf push_front
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) (int)x.size()
#define rsz resize()
#define lb lower_bound
#define ub upper_bound
#define br cout << endl

typedef long long ll;
typedef long double f80;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

int pct(int x) { return __builtin_popcount(x); }
int pct(ll x) { return __builtin_popcountll(x); } 
int bit(int x) { return 31 - __builtin_clz(x); } // floor(log2(x))
int bit(ll x) { return 63 - __builtin_clzll(x); } // floor(log2(x))
int cdiv(int a, int b) { return a / b + !(a < 0 || a % b == 0); }
ll cdiv(ll a, ll b) { return a / b + !(a < 0 || a % b == 0); }

template<typename T>
void leftShift(vector<T> &v, ll k) { k %= sz(v); if(k < 0) k += sz(v); rotate(v.begin(), v.begin() + k, v.end()); }
template<typename T>
void rightShift(vector<T> &v, ll k) { leftShift(v, sz(v) - k); }

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

ll rand(ll l, ll r){
	uniform_int_distribution<ll> uid(l, r);
	return uid(rng);
}

inline int nxt() {
	int x;
	cin >> x;
	return x;
}

inline int nxtll() {
	ll x;
	cin >> x;
	return x;
}

void pr() {}
void sc() {}

template <typename Head, typename... Tail>
void pr(Head H, Tail... T) { cout << H << " "; pr(T...); }

template <typename Head, typename... Tail>
void sc(Head &H, Tail &... T) { cin >> H; sc(T...); }

#ifdef LOCAL
#define debug(...) cerr << "[L:" << __LINE__ << "][" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#ifndef LOCAL
string to_string(__int128 x) {
	string s = "";
	bool neg = 0;
	if(x < 0) { s += "-"; neg = 1; }
	if(!x) s += '0';
	while(x) {
		int rem = x % 10;
		s += to_string(rem);
		x /= 10;
	}
	reverse(s.begin() + neg, s.end());
	return s;
}
#endif

const int mod = 1e9 + 7; // 998244353;

int pwr(int a,int b) {
	int ans = 1;
	while(b) {
		if(b & 1) ans = (ans * 1LL * a) % mod;
		a = (a * 1LL * a) % mod;
		b >>= 1;
	}
	return ans;
}

/*
	Lookout for overflows!!
	Check array sizes!!
	Clear before test cases!!
	Use the correct modulo!!
	Check for corner cases!!
	Are you forgetting something?!
*/

void solve() {
	int n, m;
	sc(n, m);
	fr(i, 1, m) {
		int x = nxt();
		n -= x;
		if(n < 0) {
			pr(-1);
			return;
		}
	}
	pr(n);
}

signed main() {
	ios :: sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t;
	// cin >> t;
	t = 1;
	for(int tt = 1; tt <= t; tt++) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 3656
#include <iostream>
#include <cmath>
#include <string>
#include <deque>
using namespace std;

int main(){
	long long N, A, B;
	cin >> N >> A >> B;
	while (cin){
		long long sol, div = N / (A + B), k = N - div*(A + B);
		if (k >= A) sol = A*(div+1);
		else sol = div*A + k;
		cout << sol << "\n";
		cin >> N >> A >> B;
	}
	return 0;
}

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

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

  dp[0] = 0;
  dp[1] = abs(h[1] - h[0]);

  int h_1,h_2;
  for(int i=2;i<n;++i){
    h_1 = dp[i-1]+abs(h[i]- h[i-1]);
    h_2 = dp[i-2]+abs(h[i] - h[i-2]);
    if(h_1 < h_2) dp[i] = h_1;
    else dp[i] = h_2;
  }
  cout<<dp[n-1]<<endl;

  return 0;
}

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

int main()
{


    int k;
    cin>>k;
    string s;
    cin>>s;

    if(s.length()>k)
    {
        for(int i=0; i<k; i++)
        {
            cout << s[i];
        }
        cout << "...";
    }
    else cout << s << endl;



    return 0;
}


Measured memory_bytes: 3592