akhauriyash/Code-Regression huggingface dataset:
//Fast IO + Debug Template
#include <bits/stdc++.h>

using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define pb push_back
#define gl(x) getline(cin,x)
#define gc(x) cin.get(x)
#define sz(x) (int)(x.size())
#define al(x) (x).begin(),(x).end()
#define ms(a, b) memset(a,b,sizeof(a))
#define sp ' '
#define nl '\n'
#define f first
#define s second
#define lsb(x) ((x)&(-x))
#define mp make_pair
#define m(x, y) (x + y) / 2
#define MOD 1000000007
#define gcd(x,y) __gcd(m,n);
#define perm(x) next_permutation(x.begin(), x.end());
#define bs(x,z) binary_search(x.begin(),x.end(),z);
#define lb(x,z) lower_bound(x.begin(),x.end(),z);
#define ub(x,z) upper_bound(x.begin(),x.end(),z);
#define nl '\n'


void sc(){}template<class T,class...A>void sc(T&t,A&...a){cin>>t,sc(a...);}
void pr(){}template<class T,class...A>void pr(T t,A...a){cout<<t,pr(a...);}
typedef long long ll;
typedef pair<int, int> pi;
//weighted (with adjList[])
typedef vector<pi> vii;
//unweighted (with adjList[])
typedef vector<int> vi;
typedef double db;
typedef long double ld;


const int INF = 0x3f3f3f3f;
const int NINF = -INF;
string a;
int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
	gl(a);
	ll total = 0;
	for(int i = 0; i < (int) a.size(); i ++){
		int k = a[i] - '0';
		total += k;
	}
	if (total % 9 == 0) cout << "Yes" << endl;
	else cout << "No" << endl;

	}

Measured memory_bytes: 3676
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
const int mod=1e9+7;
using LL=long long;
using namespace std;
 
int main(){
		LL n,k;cin>>n>>k;
		vector<int> a(n);for(int i=0;i<n;i++)cin>>a[i];
		vector<int> b(n),rank(n);for(int i=0;i<n;i++)b[i]=a[i];
		sort(b.begin(),b.end());
		for(int i=0;i<n;i++)rank[i]=distance(b.begin(),lower_bound(b.begin(),b.end(),a[i]));
		vector<int> later(n);
		for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
				if(a[i]>a[j])later[i]++;
		}}
	
		LL ans=0;
        
        for(int i=0;i<n;i++){
            for(int j=0;j<rank[i];j++){
                ans+=k*(k-1)/2;
                ans%=mod;
            }
            ans+=k*later[i];
            ans%=mod;
        }
		cout<<ans<<endl;
		return 0;
}


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

#define all(x)        (x).begin(),(x).end()
#define eb            emplace_back
#define mp            make_pair
#define pb            push_back
#define fi            first
#define se            second
#define sz(x)         ((int)(x).size())
#define rep(x,y,z)    for(int x=y;x<z;x++)
#define per(x,z,y)    for(int x=z-1;x>=y;x--)
#define trav(y,x)     for(auto& y:x)
#define pii           pair<int, int>
#define pll           pair<ll, ll>
#define vi            vector<int>
#define vpi           vector<pii>

int dbg = 0;
#define cri           if(0)
#define shame         cri cerr<<(++dbg)<<"\n\n";

// aaaaaaaaaaaaaaaa
void solve() {
  double pi = 3.141592;
  int r; scanf("%d", &r);
  printf("%f\n", 2.0 * pi * r);
}

int main() {
  // int _; scanf("%d", &_); while (_--)
  solve();
	return 0;
}



Measured memory_bytes: 3836
#[allow(unused_macros)]
macro_rules! get {
    ([$t:ty] ; $n:expr) => {
        (0..$n)
        .map(|_| get!([$t])).collect::<Vec<_>>()
    };
    ($($t:ty),+ ; $n:expr) => {
        (0..$n).map(|_| get!($($t),+)).collect::<Vec<_>>()
    };
    ([$t:ty]) => {
        rl().split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect::<Vec<$t>>()
    };
    ($t:ty) => {
        rl().parse::<$t>().unwrap()
    };
    ($($t:ty),*) => {
        {
            let line =rl();
            let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$t>().unwrap()),*)
        }
    };
}
fn rl() -> String {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    line.trim().to_string()
}

fn main() {
    let s: Vec<char> = get!(String).chars().collect();
    let k = get!(usize);
    let mut count = 0;
    let mut num = 'a';
    for i in 0..s.len() {
        if s[i] == '1' {
            count += 1;
        } else {
            num = s[i];
            break;
        }
    }
    if k <= count {
        println!("1");
    } else {
        println!("{}", num);
    }
}


Measured memory_bytes: 4352
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define all(a) (a).begin(), (a).end()


int main() {
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    cout << max(A*B, C * D) << endl;
}


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

int main() {
// #ifndef ONLINE_JUDGE
//     freopen("input1.txt", "r", stdin);
//     freopen("output1.txt", "w", stdout);
// #endif


    ios_base::sync_with_stdio(false);
    cin.tie(NULL);


    ll a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;
    ll diff = (c - a) * 60 + d - b - e;
    cout << diff << "\n";




    return 0;

}

Measured memory_bytes: 3652
//why tle lol
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<string> vs;
typedef complex<double> pnt;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<pii, pii> pp;
typedef double ld;
typedef long double lld;
#define INF 0x3f3f3f3f // for int
#define LL_INF 0x3f3f3f3f3f3f3f3f // for ll
#define ms(x, y) memset(x, y, sizeof(x))
//coordinate compression:sort(val.begin(), val.end());
//		val.resize(unique(val.begin(), val.end()) - val.begin());
#define nl '\n'
typedef unsigned long long ull;
const lld pi = 3.14159265358979323846;
const int MOD = 1e9 + 7;

//remember to remove ios stuff if i use scanf

//printf("%05lld\n", x); --> print last 5 digits including 0's
//printf("%02d:%02d", h, m); --> time
ll gcd(ll a, ll b){return b == 0 ? a : gcd(b, a % b);}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
ll pwmd(ll b, ll exp) {
    ll ret = 1;
    while (exp > 0) {
        if (exp % 2 == 1) ret = (ret * b) % MOD;
        exp /= 2;
        b = (b * b) % MOD;
    }
    return ret;
}
//void RotateArr(int X) {
//    for (int n=0; n<X; n++) {
//        for (int i=0; i<N/2; i++) {
//            for (int j=0; j<N; j++) {
//                swap(a[i][j], a[N-i-1][j]);
//            }
//        }
//        for (int i=0; i<N; i++) {
//            for (int j=i+1; j<N; j++) {
//                swap(a[i][j], a[j][i]);
//            }
//        }
//    }
//}

/*
 * string input;
 *
 * stringstream ss(input);
 *- if the input contains '\n', separate lines with: string line; while (getline(ss, line))
 * - clear() to clear the stream
 * - >> : read smth from stringstream object ie. while (s >> word)
 */

struct pair_hash { //--> for unordered_set<pair<ll, ll>>
    //initialize the set with unordered_set<pair<ll, ll>, pair_hash>st
    inline std::size_t operator()(const std::pair<ll,ll> & v) const {
        return v.first*31+v.second;
    }
};
/* for dijkstra:
 * bool operator < (const E &other) const {
        return this->w > other.w;
    }
 */

int n, d1[105], d2[105];

void solve(int tc) {

    cin >> n;
    for (int i = 1; i <= n; i++)  {
        cin >> d1[i] >> d2[i];
        if (i >= 3) {
            if (d1[i] == d2[i] && d1[i-1] ==d2[i-1] && d1[i-2] == d2[i-2]) {
                cout << "Yes" << nl; return;
            }
        }
    }
    cout << "No" << nl;

}

//you should really read the stuff at the bottom

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    int tc = 1; //cin >> tc;
    for (int t = 1; t <= tc; t++) solve(t);

    return 0;
}

/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
	* DON'T GET STUCK ON ONE APPROACH
// Did you read the bounds?
// Did you make typos?
// Are there edge cases (N=1?)
// Are array sizes proper (scaled by proper constant, for example 2* for koosaga tree)
// Integer overflow?
// DS reset properly between test cases?
// Is using long longs causing TLE?
// Are you using floating points?
*/

Measured memory_bytes: 3648
#include <bits/stdc++.h>
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++)
typedef long long ll;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;

int main(){
  string o,e;
  cin >> o >> e;
  int len = e.length();
  
  rep(i,len){
    cout << o[i] << e[i];
  }
  if(o.length() > len) cout << o[len];
  
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
#define fst first
#define snd second
using ll = long long;
using I = pair<int, int>;
const int D = 16;

template <class T, size_t D>
struct _Vec {
  using type = vector<typename _Vec<T, D - 1>::type>;
};
template <class T>
struct _Vec<T, 1> {
  using type = vector<T>;
};
template <class T, size_t D>
using Vec = typename _Vec<T, D>::type;

template <class T>
vector<T> make_v(size_t size, const T& init) {
  return vector<T>(size, init);
}
template <class... Ts>
auto make_v(size_t size, Ts... rest) {
  return vector<decltype(make_v(rest...))>(size, make_v(rest...));
}

vector<int> split(ll n) {
  vector<int> dig(D);
  for (int i = D - 1; i >= 0; i--) {
    dig[i] = n % 10;
    n /= 10;
  }
  return dig;
}

Vec<int, 3> solveDP(const vector<int>& dig) {
  Vec<int, 3> dp = make_v(D + 1, 2, D * 9 + 1, 0);
  dp[D][0][0] = dp[D][1][0] = 1;
  for (int i = D - 1; i >= 0; i--) {
    for (int big = 0; big < 2; big++) {
      for (int dsum = 0; dsum <= D * 9; dsum++) {
        for (int d = big ? 0 : dig[i]; d <= 9; d++) {
          if (dsum - d < 0) break;
          dp[i][big][dsum] |= dp[i + 1][big | (d > dig[i])][dsum - d];
        }
      }
    }
  }
  return dp;
}

ll solveGreedy(const vector<int>& dig, const Vec<int, 3>& dp, int dsum) {
  if (!dp[0][0][dsum]) {
    return -1;
  }
  ll m = 0;
  bool big = false;
  for (int i = 0; i < D; i++) {
    for (int d = big ? 0 : dig[i]; d <= 9; d++) {
      if (dp[i + 1][big | (d > dig[i])][dsum - d]) {
        m = m * 10 + d;
        big |= d > dig[i];
        dsum -= d;
        break;
      }
    }
  }
  return m;
}

ll f(ll n) {
  auto dig = split(n);
  auto dp = solveDP(dig);
  ll p = 1, q = 0;
  for (int k = 1; k <= D * 9; k++) {
    ll m = solveGreedy(dig, dp, k);
    if (m < 0) continue;
    if (p * k > m * q || (p * k == m * q && p > m)) {
      p = m;
      q = k;
    }
  }
  return p;
}

int main() {
  int K;
  while (cin >> K) {
    vector<ll> res;
    res.push_back(1);
    while (res.size() < K) {
      ll n = res.back();
      res.push_back(f(n + 1));
    }
    for (ll x : res) cout << x << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b;
	if(a<b)
	{
		c=a;
		a=b;
		b=c;
	}
	if(a+b>16)
	cout<<":(";
	if(a>8)
	cout<<":(";
	else
	cout<<"Yay!";
	return 0;
}

Measured memory_bytes: 256
N = int(input())
h = list(map(int, input().split()))

DP = [0]*N
DP[1] = abs(h[0] - h[1])

for i in range(2, N):
    DP[i] = min(DP[i-1] + abs(h[i]-h[i-1]), DP[i-2] + abs(h[i]-h[i-2]))
print(DP[N-1])


Measured memory_bytes: 52208
#import<iostream>
#import<vector>
using namespace std;main(){string s[20],b;for(int n,m,d,i,a;cin>>n,i=n;cout<<a<<' '<<b<<endl){vector<int>v[20],c(30);for(a=1e9;i--;)for(cin>>s[i]>>m;m--;++c[d],v[i].push_back(d))cin>>d;for(;++i<n;a>m?a=m,b=s[i]:a-m?b:b=min(b,s[i]))for(m=d=0;d<v[i].size();)m-=c[v[i][d++]]+~n;}}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repe(i,n) for (int i = 0; i <= (n); ++i)
#define repe1(i,n) for (int i = 0; i <= (n); ++i)
#define all(x) (x).begin(),(x).end()
#define pb(x) push_back(x)
using namespace std;
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; }
typedef long long ll;
const int INF = 1e9;
const ll mod = 1000000007;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a * b / gcd(a, b);}

ll pow_kai(ll a, ll n) {
    ll x = 1;
    while(n > 0) {
        if(n&1) {
            x = x*a;
        }
        a = a*a;
        n >>= 1;
    }
    return x;
}

int main() {
    ll n;
    cin >> n;
    ll t = 0;
    for(ll i=1; i<=n; ++i) {
        if (i*i<=n) {
            t = i*i;
        }
    }
    cout << t << "\n";
}

Measured memory_bytes: 256
#include<stdio.h>

int main() {
  int n;
  int i, j;
  scanf("%d", &n);
  
  for(i = 1; i < 10; i++) {
	for(j = 1; j < 10; j++) {
      if(i * j == n) {
        printf("Yes\n");
        return 0;
      }
    }
  }
  
  printf("No\n");
  
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;

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

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

	int d, A;
	vector<int> check(N, 1);
	REP(k, K) {
		cin >> d;
		REP(i, d) {
			cin >> A;
			check[A-1] = 0;
		}
	}

	cout << accumulate(check.begin(), check.end(), 0) << endl;

	return 0;
}

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

int main()
{
  int A, B, K;
  cin >> A >> B >> K;
  int ans = 0;
  int count = 0;
  for ( int i = 100; i >= 1; i-- )
  {
    int ansA = A % i;
    int ansB = B % i;
    if ( ansA > 0 || ansB > 0 ) continue;
    count++;
    if ( count == K )
    {
      ans = i;
      break;
    }
  }
  cout << ans;
}

Measured memory_bytes: 256
A = int(input())
B = int(input())
C = int(input())
X = int(input())

case = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if a*500 + b * 100 + c * 50 == X:
                case+=1
print(case)

Measured memory_bytes: 3060
#include <stdio.h>

int main()
{
	char c;
	scanf("%c", &c);
	switch(c){
		case 'a':
		printf("vowel\n");
		break;
		case 'i':
		printf("vowel\n");
		break;
		case 'u':
		printf("vowel\n");
		break;
		case 'e':
		printf("vowel\n");
		break;
		case 'o':
		printf("vowel\n");
		break;
		default:
		printf("consonant\n");
		break;
	}
}

Measured memory_bytes: 128
# -*- coding: utf-8 -*-
import collections

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n
    if n == 0: return 0
    if n == 1: return 0

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result


"""
def cmb(n, r):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % mod

N = 3 * pow(10, 5)  # N は必要分だけ用意する
mod = pow(10, 9) + 7
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % mod)
    #fact.append(fact[-1] * i)
    inv.append((-inv[mod % i] * (mod // i)) % mod)
    #inv.append(-inv[mod%i] * (mod // i))
    factinv.append((factinv[-1] * inv[-1]) % mod)
    #factinv.append(factinv[-1] * inv[-1])
"""

n = int(input())
a = [int(i) for i in input().split()] 

count = [0 for _ in range(n+1)]
ans = [0 for _ in range(n+1)]
c = collections.Counter(a)
#print(c)
for i in range(n+1):
    #tmp = a.count(i)
    tmp = c[i]
    #print(tmp)
    count[i] = tmp
    ans[i] = cmb(tmp, 2)
    #print(tmp, ans[i])
#print(count, ans)
sum_ans = sum(ans)
#print(sum_ans)
for k in range(n):
    #count[k] -= 1
    #print(a[k], count[a[k]])
    #print(count[a[k]] - 1 ,cmb(count[a[k]]-1, 2))
    #print(count[a[k]] ,cmb(count[a[k]], 2))
    ans = sum_ans + cmb(count[a[k]]-1, 2) - cmb(count[a[k]], 2)
    print(ans)


Measured memory_bytes: 109364
using System;
class c
{
    static void Main()
    {
        var nmk = Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
        long n = nmk[0], m = nmk[1], k = nmk[2];
        var a = Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
        var b = Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
        var ans = 0;
        var sum = (long)0;
        int aNow = 0;
        int bNow = 0;
        for (int i = 0; i < n; i++)
        {
            if (sum + a[i] <= k)
            {
                sum += a[i];
                aNow++;
            }
            else break;
        }
        for (int i = 0; i < m; i++)
        {
            if (sum + b[i] <= k)
            {
                sum += b[i];
                bNow++;
            }
            else break;
        }
        ans = aNow + bNow;
        for (int i = aNow - 1; i >= 0; i--)
        {
            aNow--;
            sum -= a[i];
            while (bNow < m && sum + b[bNow] <= k)
            {
                sum += b[bNow];
                bNow++;
            }
            ans = Math.Max(ans, aNow + bNow);
        }
        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 69388
k = int(input())
a=['1','2','3','4','5','6','7','8','9']

while k>len(a):
    b=[]
    for i in a:
        if i[-1]!='0':
            b.append(i+chr(ord(i[-1])-1))
        b.append(i+i[-1])
        if i[-1]!='9':
            b.append(i+chr(ord(i[-1])+1))
    k-=len(a)
    a=b.copy()

print(a[k-1])

Measured memory_bytes: 16936
#include<stdio.h>
#include<iostream>
#include<string>

using namespace std;
int main(){
    string t,w;
    int c = 0,i;
    size_t pos;
    cin >> w;
    while((cin >> t) && (t != "END_OF_TEXT")){
        for(int i = 0;i < t.length();i++){
            if(t[i] >= 'A' && t[i] <= 'Z') t[i] += 'a' - 'A';
        }
        pos = 0;
        if(t == w) c++;
    }
    printf("%d\n",c);
    return 0;
}




Measured memory_bytes: 3268
import java.util.Scanner;

//Stoning Fortune
public class Main{

	static class Point {
		public double x;
		public double y;
		public Point(double x_, double y_) {
			x = x_; y=y_;
		}
	}
	static class Line {
		public Point s,t;
		public Line(Point s_, Point t_) {
			s = s_; t = t_;
		}
	}
	static Point crosspoint(Line l, Line m) {
		if(isParallel(l, m)){
			return null;
		}
		  double A = extp(sub(l.t, l.s), sub(m.t, m.s));
		  double B = extp(sub(l.t, l.s), sub(l.t, m.s));
		  if (Math.abs(A) < EPS && Math.abs(B) < EPS) return m.s; // same line
		  if (Math.abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!!
		  Point tp = sub(m.t, m.s);
		  return new Point(m.s.x + B/A*tp.x, m.s.y + B/A*tp.y);
	}
	static boolean isParallel(Line l, Line m){
		Point a = new Point(l.t.x - l.s.x, l.t.y - l.s.y);
		Point b = new Point(m.t.x - m.s.x, m.t.y - m.s.y);
		if(Math.abs(Math.abs((a.x*b.x + a.y*b.y)/(Math.hypot(a.x, a.y)*Math.hypot(b.x, b.y)) - 1)) < EPS){
			return true;
		}
		return false;
	}
	static final double EPS = 1.0e-8;
	static Point sub(Point p1, Point p2) {
		return new Point(p1.x-p2.x, p1.y-p2.y);
	}
	static double extp(Point p1, Point p2) {
		return p1.x*p2.y - p2.x*p1.y;
	}
	static boolean intersectSS(Line s, Line t) {
		return ccw(s.s,s.t,t.s)*ccw(s.s,s.t,t.t) <= 0 &&
		       ccw(t.s,t.t,s.s)*ccw(t.s,t.t,s.t) <= 0;
	}
	static int ccw(Point a, Point b, Point c) {
		Point p = sub(b, a);
		Point q = sub(c, a);
		if(extp(p, q) > EPS) return 1;		// counter clockwise
		if(extp(p, q) < -EPS)return -1;		// clockwise
		if(inp(p, q) < -EPS) return 2;		// c--a--b on line
		if(Math.abs(norm(p) - norm(q)) < EPS) return -2;	// a--b--c on line
		return 0;				// a--c--b(or a--c=b) on line
	}
	static double inp(Point p1, Point p2) {
		return p1.x*p2.x + p1.y*p2.y;
	}
	static double norm(Point p) {
		return Math.hypot(p.x, p.y);
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			double x1 = sc.nextDouble();
			double y1 = sc.nextDouble();
			double x2 = sc.nextDouble();
			double y2 = sc.nextDouble();
			if(x1==0&&y1==0&&x2==0&&y2==0)break;
			Line[] l = new Line[3];
			l[0] = new Line(new Point(x1, y1), new Point(x2, y2));
			for(int i=1;i<3;i++)l[i]=new Line(new Point(sc.nextDouble(),sc.nextDouble()), new Point(sc.nextDouble(), sc.nextDouble()));
			Point[] c = new Point[3];
			boolean f = true;
			for(int i=0;i<3;i++){
				c[i] = crosspoint(l[i], l[(i+1)%3]);
				if(c[i]==null || !intersectSS(l[i], l[(i+1)%3]))f = false;
			}
			String ans = "";
			if(!f)ans = "kyo";
			else{
				double a = 0;
				for(int i=0;i<3;i++)a+=c[i].x*c[(i+1)%3].y-c[i].y*c[(i+1)%3].x;
				a = Math.abs(a/2);
				if(1900000<=a)ans = "dai-kichi";
				else if(1000000<=a)ans = "chu-kichi";
				else if(100000<=a)ans = "kichi";
				else if(0<a)ans = "syo-kichi";
				else ans = "kyo";
			}
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 12000
// When you are hungry for something and you're determined and you're focused 
// and you're committed to something it's hard to surrender, isn't it?

#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define endl "\n"
#define ll long long 
#define int ll
#define mod 1000000007
#define mod1 1000000006
#define modi 998244353
#define setbit(x) __builtin_popcount(x)
#define fff(i,n) for(int i=0;i<n;i++)
#define ff first
#define ss second
#define pb push_back
vector<ll> vi[300005];
int color[100005];
ll pa[500005];
ll si[500005];
#define pb push_back
bool visi[1000005]={false};
bool is[100005];
ll fac[10000001];
ll prime[400005];
ll bit[100005];
const long double eps = 1.0e-14;      // allowable error
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL);
 
 
void fact(){
    fac[0]=1;
    for(int i=1;i<=10000000;i++){
        fac[i]=(fac[i-1]*i)%mod;
    }
    return ;
}
void sieve(){
    prime[0]=0;
    prime[1]=0;
    for(int i=2;i<400005;i++){
        prime[i]=1;
    }
    for(int i=2;i*i<400005;i++){
        if(prime[i]==1){
            for(int j=i*i;j<400005;j+=i){
                prime[j]=0;
            }
        }
    }
    
}
 
ll power(ll n , ll p ){
    if(p==0)
        return 1;
    
    ll res = power((n*n)%mod,p/2);
    if(p%2==1)
        res = (n*res)%mod;
    
    return res;
}
 
 
void upd(ll i,ll val,ll n) {
    for(;i<=n;i+=i&(-i))
        bit[i]+=val;
}
 
ll qry(ll i) {
    ll sum=0;
    for(;i>0;i-=i&(-i))
        sum+=bit[i];
    return sum;
}
 
 
ll fin(ll u) {
    if(pa[u]==u)
        return u;
    return fin(pa[u]);
}
 
void uni(ll u,ll v) {
    ll p1=fin(u);
    ll p2=fin(v);
    if(p1==p2)
        return;
    if(si[p1]<si[p2])
        swap(p1,p2);
    si[p1]+=si[p2];
    pa[p2]=p1;
    return;
}
 
int32_t main() {
    fio
    
    cout << fixed << setprecision(15);
    int n;cin >> n;
    string s;cin >> s;
    
    string s1=s.substr(0,1);
    for(int i=1;i<n;i++ ){
        if(s[i]==s[i-1])
        continue;
        else
        s1+=s[i];
    }
    
    cout << s1.size();
    
    
	return 0;
    
}

Measured memory_bytes: 9168
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ll long long
#define MOD 1000000007
#define MAX 1000010
#define test(a,n) REP(i,n) cout << a[i] << " ";
using namespace std;

int main(){
  string n; cin >> n;
  int len = n.size();
  int carry = 0;
  int ans = 0;
  
  REPR(i,len){
    int d = n[i] -'0';
    d += carry;
    
    if(d>=6 || (d==5 && n[i-1]-'0' >= 5)){
      carry = 1;
      ans += 10-d;
    }
    else{
      carry = 0;
      ans += d;
    }
  }
  
  ans += carry;
  cout << ans;
  return 0;
}

Measured memory_bytes: 1412
import std.stdio;
import std.array;
import std.conv;
import std.string;
import std.algorithm;

void main()
{
    int n = readln.strip.to!int;
    int[10][3][4] h ;
    foreach(i;0..4)
        foreach(j;0..3)
            foreach(k;0..10)
                h[i][j][k] = 0;

    foreach(i;0..n) {
        auto info = map!(to!int)(readln.strip.split);
        h[info[0]-1][info[1]-1][info[2]-1] += info[3];
    }

    foreach(i;0..4) {
        foreach(j;0..3) {
            foreach(k;0..10) {
                write(" ");
                write(h[i][j][k]);
            }
            writeln();
        }
 	if(i<3)
        writeln("####################");
    }
}

Measured memory_bytes: 2464
// b.c --- Papers, Please
#include <stdio.h>
int main(void){
    int n, x;
    scanf("%d", &n);
    for(int i = 0; i < n; i++){
        scanf("%d", &x);
        if(x%2 == 0){
            if(x%3 != 0 && x%5 != 0){
                printf("DENIED");    
                return 0;
            }
        }
    }
    printf("APPROVED");
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
vector<int >prime;

int a[111111];
void  seive()
{
    int n=111111;
    int i,limit=sqrt(n*1.0)+2,k=1;
    prime.push_back(2);
    for(i = 4; i <= n; i += 2)
        a[i]=1;
    for(int i=3; i<=n ; i+=2)
    {
        if(!a[i])
        {
            prime.push_back(i);
           // cout<<prime[k]<<endl;
            if(i<=limit)
            {
                for(int j=i*i; j<=n; j+=(2*i))
                {
                    a[j]=1;
                }
            }
        }

    }
}
int main()
{
    int t,nn,c,x,p;
    string s;
    seive();

    cin>>nn;
    x=lower_bound(prime.begin(),prime.end(),nn)-prime.begin();
    cout<<prime[x];


}




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

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

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            String S = in.next();
            int ans = S.length() - 2;

            // 出力
            out.println(S.charAt(0) + String.valueOf(ans) + S.charAt(S.length() - 1));

        }

    }
}



Measured memory_bytes: 21588
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//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; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
*/

const int MAX = 200005;
const int mod = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];
void COMinit(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < MAX; i++){
        fac[i] = fac[i-1] * i % mod;
        inv[i] = mod - inv[mod%i] * (mod/i) % mod;
        finv[i] = finv[i-1] * inv[i] % mod;
    }
 
}
long long COM(int n, int k){
    if(n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % mod) % mod;
}



int main(){
    int N, K; cin >> N >> K;
    COMinit();

    for(int i=1; i<=K; i++){
        if(N-K+1 < i) cout << 0 << endl;
        else cout << COM(K-1, K-i)*COM(N-K+1, i)%mod << endl;
    }

    return 0;
}

Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,c=0;
    cin>>n;
    while(n)
    {
        int x=n%10;
        if(x==7)
        {
            c=1;
            cout<<"Yes"<<endl;
            break;
        }
        n=n/10;
    }
    if(c==0)
    {
        cout<<"No"<<endl;

    }
}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define MAXX 1000005
#define PI 3.14159265358979323846264338327950
#define ll signed long long int
using namespace std;
ll t , n, ans = 0, k, a[MAXX], b[MAXX], x, y, mn, mx, m = 0;
double f = 0.5;
vector<ll> v;
int main()
{
	string s;
	cin >> s;
	if(s == "Sunny"){
		cout << "Cloudy";
		
	}
	else if(s == "Cloudy"){
		cout << "Rainy";
	}
	else{
		cout << "Sunny";
	}
	return 0;
    
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main()
{
	char str1[1000],str2[1000]="\0";
	int len1,count;
	scanf("%s",str1);
	len1=strlen(str1);
	for(int i=0;i<len1;i++)
	{
		str2[i]=str1[len1-i-1];
	}
	count=0;
	for(int i=0;i<len1;i++)
	{
		if(str1[i]!=str2[i])
			count++;
	}
	printf("%d\n",(count/2));
	return 0;
}



Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int a,b;
int main()
{
    
    cin>>a>>b;
    if(a+b==15)
        cout<<"+"<<endl;
    else if(a*b==15)
            cout<<"*"<<endl;
        else
            cout<<"x"<<endl;

    return 0;//最后别忘了华丽的结束
}

Measured memory_bytes: 256
def main():
    import sys
    from collections import deque

    input = sys.stdin.readline

    N = int(input())

    graph = [[] for _ in range(N + 1)]
    for _ in range(N - 1):
        a, b = map(int, input().split())
        graph[a].append(b)
        graph[b].append(a)

    check = [0] * (N + 1)
    que1 = deque() #fennecのキュー
    que2 = deque() #sunukeのキュー

    que1.append(1)
    que2.append(N)

    check[1] = 1
    check[N] = 1

    fennec = 0
    snuke = 0

    flag = True

    while flag:
        flag = False

        tmp_lst = []
        while len(que1) != 0:
            flag = True
            tmp = que1.popleft()
            for next_ in graph[tmp]:
                if check[next_] == 0:
                    tmp_lst.append(next_)
                    fennec += 1
                    check[next_] = 1
        for i in tmp_lst:
            que1.append(i)
        
        tmp_lst = []
        while len(que2) != 0:
            flag = True
            tmp = que2.popleft()
            for next_ in graph[tmp]:
                if check[next_] == 0:
                    tmp_lst.append(next_)
                    snuke += 1
                    check[next_] = 1
        for i in tmp_lst:
            que2.append(i)

    if fennec > snuke:
        print ('Fennec')
    else:
        print ('Snuke')

if __name__ == '__main__':
    main()

Measured memory_bytes: 22232
#include<bits/stdc++.h>
#include<cmath>
#define pb push_back
#define ld long double
#define mp make_pair
#define vl vector<ll> 
#define vd vector<double>
#define vld vector<long double>
#define ll long long int
#define pl pair<ll, ll>
#define all(a) a.begin(), a.end()
#define forr(i, n) for(ll i=0; i<n; i++) 
#define forr1(i, n) for(ll i=1; i<=n; i++)
using namespace std;
const ld PI =3.1415926535897923846;
const ll MOD = 1000000007;
const ll N=998244353;
ll power(ll x,ll n){ll res=1;while(n>0){if(n&1) res=res*x%MOD;x=x*x%MOD;n>>=1;}return res;}
ll modinverse(ll a){return power(a, MOD-2);}
void solve()
{
    string s, t;
    cin>>s>>t;
    // start from all positons
    ll n=s.length(), k=t.length();
    ll ans=INT_MAX;
    for(ll i=0; i<=(n-k); i++)
    {
    	ll holy=0;
    	for(ll j=0; j<k; j++)
    	{
    		if(s[j+i]!=t[j])
    			holy++;
    	}
    	ans=min(ans, holy);
    }
    cout<<ans<<endl;
}
int main()
{
	#ifndef ONLINE_JUDGE
        // for getting input from input.txt
        freopen("input.txt", "r", stdin);
        // for writing output to output.txt
        freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll test=1;
    //cin>>test;
    while(test--)
    {
        solve();
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}

Measured memory_bytes: 3844
#include<iostream>
#include<string>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
const long long int M = 1e9 + 7, MAX_N = 2010;
int C[MAX_N][MAX_N];

int main(){
  C[0][0] = 1;
  for(int i = 1; i < MAX_N; i++){
    for(int j = 0; j <= i; j++){
      if(j - 1 >= 0) C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % M;
      else C[i][j] = C[i - 1][j];
    }
  }
  int N, K; cin >>N >>K;
  for(int i = 1; i <= K; i++){
    long long int r = i, n = N - K + 1;
    long long int ans = C[n][r];
    cout <<ans * C[K - 1][i - 1] % M <<endl;
  }
  return 0;
}


Measured memory_bytes: 15104
N=int(input())
lst=list(map(int,input().split()))
print(' '.join(map(str,lst)))

for i in range(1,len(lst)):
    j = i-1
    ele = lst[i]
    while j>=0 and lst[j] > ele:
        lst[j+1] = lst[j]
        j-=1
    lst[j+1] = ele
    print(' '.join(map(str,lst)))


Measured memory_bytes: 5600
cnt=int(input())
word=input()
if cnt%2==1:
    print("No")
    
elif cnt/2>=1:
    list=[word[i: i+int(cnt/2)] for i in range(0,len(word),int(cnt/2))]
    if list[0]==list[1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

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

#define REP(i,n) for(int i=0;i<(n);++i)
#define ll long long
const long long INF = 1LL<<60;
const long long mod = 1e9 + 7;

int F(int x){
    int count = 0;
    while(x % 2 == 0){
        x /= 2;
        count ++;
    }
    return count;
}

int main(){
    int N;
    cin >> N;
    int A[10010];
    REP(i,N) cin >> A[i];
    int res = 0;
    REP(i,N) res += F(A[i]);
    cout << res << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, c) for(int i=0; i<(int)c; i++)
int main() {
	int h,n,t,sum=0;

	cin >>h>>n;
	string ans="No";
	rep(i,n){
		cin >> t;
		sum+=t;
		if (sum>=h){
			ans="Yes";
			break;
		}
	}
	cout <<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
N, Q = map(int, input().split())
S = input()
lr = [[int(i) for i in input().split()] for _ in range(Q)]

ac = [0] * N
for i in range(N-1) :
    if S[i:i+2] == 'AC' :
        ac[i] += 1
    ac[i+1] += ac[i]
ac = [0] + ac
    
for l, r in lr :
    print(ac[r-1]-ac[l-1])

Measured memory_bytes: 69464
#include<bits/stdc++.h>
using namespace std;
#define rg register
#define rep(i,a,b) for (rg int i=(a);i<=(b);i++)
#define per(i,a,b) for (rg int i=(b);i>=(a);i--)
#define pb push_back
#define lowbit(x) (x&(-x))
#define replow(i,a,b) for(rg int i = (a);i<=(b);i+=lowbit(i))
#define perlow(i,a,b) for(rg int i = (b);i>=(a);i-=lowbit(i))
#define mk make_pair
#define VI vector<int>
#define pii pair<int,int>
#define pLL pair<long long,long long>
#define fi first
#define se second
#define il inline
#define ll long long
#define ull unsigned long long
#define db double
#define ld long double
#define inf 0x3f3f3f3f
#define getc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<15,stdin),p1==p2)?EOF:*p1++)
char buf[1<<15],*p1 = buf,*p2 = buf;
inline ll read(){
    #define num ch-'0'
    char ch;bool flag=0;ll res;
    while(!isdigit(ch=getc()))
    (ch=='-')&&(flag=true);
    for(res=num;isdigit(ch=getc());res=res*10ll+num);
    (flag)&&(res=-res);
    #undef num
    return res;
}
inline void write(ll x){
	if (x < 0) x = ~x + 1ll, putchar('-');
	if (x > 9) write(x / 10ll);
	putchar(x % 10ll + '0');
}
#define mid ((l + r)>>1)
#define ls (x<<1)
#define rs ((x<<1)|1)
#undef mid
#undef ls
#undef rs
multiset<int> s;
void solve()
{
	int n = read();
	int mn = 1e9 + 10;
	int cnt = 0;
	rep(i,1,n)
	{
		int x = read();
		if(s.empty())
		{
			s.insert(x);
		}
		else
		{
			auto it = s.lower_bound(x);
			if(it == s.begin())
			{
				s.insert(x);
			}
			else
			{
				it--;
				s.erase(it);
				s.insert(x);
			}
		}
	}
	printf("%d",s.size());
}
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("data.txt","r",stdin);
	#endif
//	int T = read();
//	while(T--)
	solve();
}

Measured memory_bytes: 8352
#![allow(non_snake_case)]
#![allow(unused_variables)]

fn main() {
    let N: usize = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().parse().unwrap()
    };

    // 部屋をできる限り二等分し、それらの間を結ぶ通路は同レベルとする
    // これを再帰的に繰り返す
    fn f(level: i64, L: usize, R: usize, p: &mut std::collections::HashMap<(usize, usize), i64>) {
        if L < R {
            let mid = (L + R) / 2;
            for i in L..(mid + 1) { for j in (mid + 1)..(R + 1) { p.insert((i, j), level); } }
            f(level + 1, L, mid, p);
            f(level + 1, mid + 1, R, p);
        }
    }
    let mut p = std::collections::HashMap::new();
    f(1, 1, N, &mut p);
    let ans = (1..N)
        .map(|i|
            ((i + 1)..(N + 1))
                .map(|j| p[&(i, j)].to_string())
                .collect::<Vec<_>>()
                .join(" "))
        .collect::<Vec<_>>()
        .join("\n");

    println!("{}", ans);
}


Measured memory_bytes: 18728
s = input()
res = 0

for i in range(3):
    if s[i] == 'R':
        res = 1
if s[0] == 'R' and s[1] == 'R':
    res += 1
if s[1] == 'R' and s[2] == 'R':
    res += 1

print(res)

Measured memory_bytes: 9036
#include<iostream>
#include<string>
#include<vector>
#include<numeric>
#include<math.h>
#include<algorithm>
#include<iomanip>
using namespace std;


int main() {

	string S;
	cin >> S;

	string ACGT = "ACGT";

	long long num = 0;
	long long num_max = 0;
	for (long long i = 0; i < S.size(); i++) {
		if (string::npos != ACGT.find(S[i])) {
			num += 1;
		}
		else {
			if (num_max < num) {
				num_max = num;
			}
			num = 0;
		}
	}

	if (num_max < num) {
		num_max = num;
	}

	cout << num_max << endl;

	return 0;
}



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

vector<int> dp(1e5,-1);
vector<vector<int>> dir(1e5,vector<int>{});

int res(int start) {
  if(dp.at(start)>-1) {
    return dp.at(start);
  }
  else {
    dp.at(start)=0;
    for(int i: dir.at(start)) {
      dp.at(start)=max(dp.at(start),res(i)+1);
      //cout << start << " " << i << endl;
    }
    return dp.at(start);
  }
}

int main() {
  int n,m;
  cin >> n >> m;
  for(int i=0;i<m;i++) {
    int x,y;
    cin >> x >> y;
    x--;
    y--;
    dir.at(x).push_back(y);
  }
  /*for(int i=0;i<n;i++) {
    for(int j:dir.at(i)) {
      cout << i << " " << j << endl;
    }
  }*/
  int ans=0;
  for(int i=0;i<n;i++) {
    ans=max(ans,res(i));
  }
  cout << ans << endl;
}

Measured memory_bytes: 8832
#include<stdio.h>

int main(){
    int n;
    int a,b,c;
    scanf("%d",&n);
    a = n%10;
    b = n%100-a;
    c = n%1000-(a+b);

    if(a == 7){
        printf("Yes\n");
    }else if(b == 70){
        printf("Yes\n");
    }else if(c == 700){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}

Measured memory_bytes: 1664
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys  # {{{
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools
# }}}

# pre-defined{{{
sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  # can also use string module
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe
# }}}

def solve():
    s = input()
    if s == "ABC":
        print("ARC")
    else:
        print("ABC")

    return 0

if __name__ == "__main__":# {{{
    solve()

# vim: set foldmethod=marker: }}}


Measured memory_bytes: 79764
#![allow(unused_imports)]
use proconio::{input, fastout};
use proconio::marker::*;

#[fastout]
fn main() {
    input! {
    x: [usize; 5]
    }
    let mut ans = 0;
    for i in 0..5{
        if x[i] == 0 {
            ans = i + 1;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 2116
#include<bits/stdc++.h>
using namespace std;
int main() {
  int N, M, input;
  int sum = 0;
  vector<int> A;
  cin >> N >> M;
  for (int i = 0; i < M; ++i) {
    cin >> input;
    A.push_back(input);
  }
  sum = accumulate(A.begin(), A.end(), 0);
  if (sum > N) {
    cout << -1;
  } else {
    cout << (N - sum);
  }
  return 0;
}


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

template <typename T, typename _ = void>
struct is_container : std::false_type {};
template <typename T>
struct is_container<T, std::void_t<decltype(std::declval<T>().begin()),
                                   decltype(std::declval<T>().end())>>
    : std::true_type {};
template <typename T, typename _ = void>
struct is_pair : std::false_type {};
template <typename T>
struct is_pair<T, std::void_t<decltype(std::declval<T>().first),
                              decltype(std::declval<T>().second)>>
    : std::true_type {};
template <typename T>
void debug(const T& v) {
  if constexpr (is_pair<T>::value) {
    std::cerr << "{";
    debug(v.first);
    std::cerr << ", ";
    debug(v.second);
    std::cerr << "}";
  } else if constexpr (is_container<T>::value) {
    std::cerr << "{";
    for (auto it = v.begin(); it != v.end(); ++it) {
      if (it != v.begin()) std::cerr << ", ";
      debug(*it);
    }
    std::cerr << "}";
  } else {
    std::cerr << v;
  }
}
template <typename T, typename... Ts>
void debug(const T& value, const Ts&... args) {
  debug(value);
  std::cerr << ", ";
  debug(args...);
}
#if DEBUG
#define dbg(...)                        \
  do {                                  \
    cerr << #__VA_ARGS__ << ": ";       \
    debug(__VA_ARGS__);                 \
    cerr << " (L" << __LINE__ << ")\n"; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define rd(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  if constexpr (std::is_same<T, bool>::value) {
    std::cout << (value ? "Yes" : "No");
  } else {
    std::cout << value;
  }
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  write_to_cout(value);
  std::cout << ' ';
  write_to_cout(args...);
}
#define wt(...)                 \
  do {                          \
    write_to_cout(__VA_ARGS__); \
    cout << '\n';               \
  } while (0)

#define all(x) (x).begin(), (x).end()
#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)

template <typename T>
std::istream& operator>>(std::istream& is, std::vector<T>& v) {
  for (T& vi : v) is >> vi;
  return is;
}

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

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

#include <boost/hana/functional/fix.hpp>
auto Fix = boost::hana::fix;

using ll = long long;

template <typename T>
using low_priority_queue =
    std::priority_queue<T, std::vector<T>, std::greater<T>>;

template <typename T>
using V = std::vector<T>;
template <typename T>
using VV = V<V<T>>;

using namespace std;

int main() {
  rd(int, n);
  V<char> s(n);
  cin >> s;
  wt(count(all(s), 'Y') ? "Four" : "Three");
}


Measured memory_bytes: 3532
#include<iostream>
#include<string>
using namespace std;
int main(){
  int a,b;cin>>a>>b;
  for(int i=0;i<a;i++){
    for(int j=0;j<b;j++){
      string str;cin>>str;
      if(str=="snuke"){
        cout<<(char)('A'+j)<<i+1<<endl;
      }
    }
  }
  return 0;
}

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

int main(){
	string s;
	cin >> s;
	int check = 1;
	for(int i = 0;i <= 2;i++){
		if(s[i] == s[i+1]){
			check = 0;
			break;
		}
	}
	if(check == 1)cout << "Good";
	if(check == 0)cout << "Bad";
	return 0;
}


Measured memory_bytes: 256
from collections import *

n = int(input())
s_counted = Counter(input())

for i in range(n - 1):
    si_counted = Counter(input())
    for j in s_counted:
        if j in si_counted:
            s_counted[j] = min(s_counted[j], si_counted[j])

        else:
            s_counted[j] = 0

ans = ""
for i in sorted(s_counted.most_common()):
    ans += i[1] * i[0]

print(ans)

Measured memory_bytes: 3316
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <math.h>
#include<iomanip>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main(){
  ll n,m,d;
  cin>>n>>m>>d;

  if(d==0) cout<<fixed<<setprecision(10)<<(double)(m-1)/n<<endl;
  else cout<<fixed<<setprecision(10)<<(double)(m-1)*2*(n-d)/pow(n,2)<<endl;
  //cout<<fixed<<setprecision(9)<<(double)(m-1)*pow((double)(n-d)/(double)n,m-2)/(n-d)<<endl;
  //cout<<fixed<<setprecision(9)<<(m-1)*pow((double)4*(n-d)/(double)n,m-2)/pow(n,2)<<endl;
  //cout<<fixed<<setprecision(9)<<2*(n-d)*(m-1)*pow((double)2/(double)n,m-2)/pow(n,2)<<endl;
  //cout<<fixed<<setprecision(9)<<2*(n-d)*(m-1)*pow(2,m-2)/pow(n,m)<<endl;
  //cout<<fixed<<setprecision(9)<<pow((2*(n-d)*4/n),m-2)/pow(n,2)<<endl;
  //cout<<fixed<<setprecision(9)<<(double)2*(n-d)*pow((double)n/4,m-2)/(pow(n,2))<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    int a,b,c;
    int flag=0;
    scanf("%d%d%d",&a,&b,&c);
    if(a+b==c || a+c==b || b+c==a)flag=1;
    printf(flag?"Yes\n":"No\n");
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define err(args...) {}
#ifdef DEBUG
#include "_debug.cpp"
#endif
using namespace std;
using ll = long long;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    n--;
    vector<int> c(n), s(n), f(n);
    for(int i = 0; i < n; i++) {
        cin >> c[i] >> s[i] >> f[i];
    }
    for(int start = 0; start < n; start++) {
        int t = 0;
        for(int i = start; i < n; i++) {
            if(t <= s[i]) {
                t = s[i];
            } else {
                t += (f[i] - (t - s[i]) % f[i]) % f[i];
            }
            t += c[i];
        }
        cout << t << endl;
    }
    cout << 0 << endl;
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<double, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size
#define EPS (1e-10)

void add_mod(ll &a, ll b){
	a += b;
	a %= MOD;
}

void mul_mod(ll &a, ll b){
	a *= b;
	a %= MOD;
}

int main(void){
	int n,w,i;
	string s;
	cin >> s;
	n = s.l_ength();
	cin >> w;
	for(i=0; i<n; i+=w){
		cout << s[i];
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 256