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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


int nextInt() { int x; scanf("%d", &x); return x;}
ll nextLong() { ll x; scanf("%lld", &x); return x;}

const int MAX_N = 212345;
ll A[MAX_N];
vector<ll> p, z, m;

ll comb2(ll n) {
  return n * (n-1) / 2;
}

int main2() {
  p.clear();
  z.clear();
  m.clear();

  int N = nextInt();
  ll K = nextLong();
  REP(i, N) A[i] = nextLong();
  sort(A, A+N);

  REP(i, N) {
    if (A[i] > 0) p.push_back(A[i]);
    if (A[i] == 0) z.push_back(A[i]);
    if (A[i] < 0) m.push_back(-A[i]);
  }
  sort(ALL(p));
  sort(ALL(z));
  sort(ALL(m));

  ll neg = (ll)p.size() * (ll)m.size();
  ll zero = (ll)z.size() * ((ll)p.size() + (ll)m.size()) + comb2((ll)z.size());
  ll pos = comb2((ll)p.size()) + comb2((ll)m.size());

  const ll INF = 1LL << 61;

  if (K <= neg) {
    // 答えは負
    K = neg + 1 - K;

    ll lo = 0;
    ll hi = INF;
    while (hi - lo > 1) {
      ll mid = (hi + lo) / 2;
      ll lem = 0;
      for (ll a : p) {
        ll v = mid / a;
        lem += distance(m.begin(), upper_bound(ALL(m), v));
      }
      if (lem >= K) hi = mid; else lo = mid;
    }
    cout << -hi << endl;
    return 0;
  }
  else if (K <= neg + zero) {
    // 答えはゼロ
    cout << 0 << endl;
    return 0;
  }
  else {
    // 答えは正
    K -= neg + zero;
    ll lo = 0;
    ll hi = INF;
    while (hi - lo > 1) {
      ll mid = (hi + lo) / 2;
      ll lem = 0;
      REP(i, p.size()) {
        ll v = mid / p[i];
        lem += distance(p.begin(), upper_bound(p.begin(), p.begin() + i, v));
      }
      REP(i, m.size()) {
        ll v = mid / m[i];
        lem += distance(m.begin(), upper_bound(m.begin(), m.begin() + i, v));
      }
      if (lem >= K) hi = mid; else lo = mid;
    }
    cout << hi << endl;
    return 0;
  }

  return 0;
}

int main() {

#ifdef LOCAL
  for (;!cin.eof();cin>>ws)
#endif
    main2();
  return 0;
}

Measured memory_bytes: 4340
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        if (str.contains("7")) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 35680
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <numeric>
#include <string>
#include <functional>

using namespace std;

long long MOD=1000000007;

int main(void){
    int N,M;
    cin>>N>>M;
    vector<int> a(M+1);
    for(int i=0;i<M;i++){
        cin>>a[i];
    }
    a[M]=N+1;

    vector<long long> ans(N+1);
    ans[0]=1;
    ans[1]=1;

    int breakFind=0;
    if(a[0]==1){
        ans[1]=0;
        breakFind++;
    }

    for(int i=2;i<=N;i++){
        bool isbreak=false;
        while(a[breakFind]<=i){
            if(a[breakFind]==i){isbreak=true;}
            breakFind++;
        }
        ans[i]=(ans[i-1]+ans[i-2])%MOD;
        if(isbreak){ans[i]=0;}
    }

    cout<<ans[N]<<endl;

    return 0;
}

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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

bool isNotPrime[200100];
std::vector<int> primes;

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

  primes.emplace_back(2);

  for(int i=4;i<=200'000;i+=2){
      isNotPrime[i] = true;
  }

  for(int i=3;i<=200'000;i+=2){
      if(!isNotPrime[i]){
          primes.emplace_back(i);

          for(int j=i*2;j<=200'000;j+=i){
              isNotPrime[j] = true;
          }
      }
  }

  int X;
  std::cin >> X;

  std::cout << *std::lower_bound(primes.begin(), primes.end(), X) << std::endl;
}


Measured memory_bytes: 640
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
            // 入力
            string[] sS = System.Console.ReadLine().Trim().Split(' ');
            int iH = int.Parse(sS[0]);
            int iW = int.Parse(sS[1]);
            List<List<int>> lstA = new List<List<int>>();
            for (int i = 0; i < iH; i++)
            {
                sS = System.Console.ReadLine().Trim().Split(' ');
                List<int> lstR = new List<int>();
                for (int j = 0; j < iW; j++)
                {
                    lstR.Add(int.Parse(sS[j]));
                }
                lstA.Add(lstR);
            }

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            // 解析
            int iWm = lstA[0].Count - 1;
            List<string> lstO = new List<string>();                     // 操作履歴
            for (int i = 0; i < lstA.Count; i++)
            {
                if (i % 2 == 0)                                         // 奇数行目
                {
                    for (int j = 0; j <= iWm - 1; j++)                  // 左から右 最後の右端はなし
                    {
                        if (lstA[i][j] % 2 == 1) { lstA[i][j] -= 1; lstA[i][j + 1] += 1; lstO.Add((i + 1).ToString() + " " + (j + 1).ToString() + " " + (i + 1).ToString() + " " + (j + 2).ToString()); }
                    }
                    if (i + 1 < lstA.Count && lstA[i][iWm] % 2 == 1) { lstA[i][iWm] -= 1; lstA[i + 1][iWm] += 1; lstO.Add((i + 1).ToString() + " " + (iWm + 1).ToString() + " " + (i + 2).ToString() + " " + (iWm + 1).ToString()); }   // 最後の右端
                }
                else                                                    // 偶数行目
                {
                    for (int j = iWm; j > 0 ; j--)                      // 右から左 最後の左端はなし
                    {

                        if (lstA[i][j] % 2 == 1) { lstA[i][j] -= 1; lstA[i][j - 1] += 1; lstO.Add((i + 1).ToString() + " " + (j + 1).ToString() + " " + (i + 1).ToString() + " " + (j - 1 + 1).ToString()); }
                    }
                    if (i + 1 < lstA.Count && lstA[i][0] % 2 == 1) { lstA[i][0] -= 1; lstA[i + 1][0] += 1; lstO.Add((i + 1).ToString() + " " + (0 + 1).ToString() + " " + (i + 2).ToString() + " " + (0 + 1).ToString()); }         // 最後の左端
                }
            }

            // 出力
            System.Console.WriteLine("{0}", lstO.Count.ToString().Trim());
            for (int i = 0; i < lstO.Count; i++)
            {
                System.Console.WriteLine("{0}", lstO[i].ToString().Trim());
            }

            sw.Stop();
#if DEBUG
            Console.WriteLine();
            Console.WriteLine("{0}", sw.Elapsed.ToString());
            Console.WriteLine("続行するには何かキーを押してください．．．");
            Console.ReadKey();
#endif
    }

}


Measured memory_bytes: 31132
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

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 S(): return input()
     
def main():
    X, Y, A, B, C = LI()
    p = sorted(LI())[::-1]
    q = sorted(LI())[::-1]
    r = sorted(LI())[::-1]
    eat = p[:X] + q[:Y]
    eat = sorted(eat)
    r_i = 0
    ans = 0
    for apple in eat:
        if r_i >= C:
            ans += apple
            continue
        if apple < r[r_i]:
            ans += r[r_i]
            r_i += 1
        else:
            ans += apple
    print(ans)


main()



Measured memory_bytes: 25604
#include<iostream>
#include<vector>
#include<algorithm>
#include<unordered_set>
#include<unordered_map>
using namespace std;

class UnionFind {
public:
  	vector<int> parents, ranks;
    UnionFind(int n) {
      	parents.resize(n);
      	ranks.resize(n);
        for (int i = 0; i < n; ++i)
            parents[i] = i;
    }
    
    int find(int x) {
        if (x != parents[x])
            parents[x] = find(parents[x]);
        return parents[x];
    }
    
    bool unite(int x, int y) {
        int px = find(x);
        int py = find(y);
        if (px == py) return false;
      
        if (ranks[px] > ranks[py])
            parents[py] = px;
        else if (ranks[px] < ranks[py])
            parents[px] = py;
        else {
            parents[py] = px;
            ranks[px]++;
        }
      
      	return true;
    }
};

int main() {
  int n, m, k, a, b;
  cin >> n >> m >> k;
  int ans[n] = {};
  UnionFind uf(n);
  vector<unordered_set<int>> friendships(n), blockships(n);
  
  while(m--) {
    cin >> a >> b;
    friendships[a-1].insert(b-1);
    friendships[b-1].insert(a-1);
    uf.unite(a-1, b-1);
  }
  
  while(k--) {
    cin >> a >> b;
    if (uf.find(a-1) == uf.find(b-1)) {
      blockships[a-1].insert(b-1);
      blockships[b-1].insert(a-1);
    }
  }
  
  unordered_map<int, vector<int>> infos;
  for (int i = 0; i < n; ++i) infos[uf.find(i)].push_back(i);
  for (int i = 0; i < n; ++i) {
    int k(infos[uf.parents[i]].size());
    if (k >= 3) 
    	ans[i] = k  - (int) friendships[i].size() - (int) blockships[i].size() - 1;
    cout << ans[i] << ' ';
  }
  cout << '\n';
  
  return 0;
}

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

using namespace std;
using ll = long long;

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

    int ans = n % 1000;
    if (ans == 0)
    {
        cout << 0 << endl;
    }
    else
    {
        cout << 1000 - ans << endl;
    }
}


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

typedef long long LL;

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9+7;

int main() {
    int N;
    cin >> N;
    int res = 0;
    for(;pow(2, res) <= N;res++) {
    }
    cout << pow(2, res - 1) << endl;
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const double inf=1e8;
vs in;
int score,n,m,r;
void f(){
//	rep(i,m)cout<<in[i]<<endl;;cout<<endl;
	int q=-1;
	while(1){
		q++;
		int sum=0;
		rep(i,n){
			int co=1;
			rep(j,m){
				if(j==m-1||in[j+1].size()<=i||in[j].size()<=i||in[j][i]!=in[j+1][i]){
					if(co>=r){
						sum+=co*(in[j][i]-'0');
						loop(k,j-co+1,j+1)in[k][i]='!';
					}
					co=1;
				}else co++;
			}
		}
//		cout<<sum<<endl;
		if(sum==0)break;
		score+=pow(2,q)*sum;
		rep(i,m)rep(j,n)if(in[i][j]=='!'){
			in[i].erase(in[i].begin()+j);
			j--;
		}
	}
}
int main(){
	cin>>n>>m>>r;
	vs tmp(m,"");
	rep(i,n)rep(j,m){
		char c;
		cin>>c;
		tmp[j]=c+tmp[j];
	}
	int out=0;
	rep(i,n)rep(j,m){
		in=tmp;
		in[j].erase(in[j].begin()+i);
		score=0;
		f();
		out=max(out,score);
	}
	cout<<out<<endl;
}









Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pb push_back
#define f(i,x,n) for(int i=x;i<n;i++)
#define all(c) c.begin(),c.end()
#define int ll
using ll = long long;
using pii = pair<int,int>;
const int MOD = 1e9+7, N = 1e5 + 10; 

int32_t main(){
   ios::sync_with_stdio(false);
   cin.tie(NULL);
   string s;
   cin >> s;
   if(s[2]==s[3] and s[4]==s[5]){
      cout << "Yes\n";
   }else{
      cout << "No\n";
   }
   return 0;
} 

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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = (1<<30) - 1;
const ll LINF = (1LL<<60) - 1;
const int mod = 1e9 + 7;

int main(){
    string s, t;
    cin >> s >> t;
    int res = 0;
    for (int i = 0; i < s.length(); ++i) {
        if (s[i] != t[i]) res++;
    }
    cout << res << endl;
}

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

int Prime[50000];

int isPrime(int n){
	int sq = sqrt((double)n);
	if(n==1)return 0;
	if(n==2)return 1;
	for(int i=2;i<=sq;++i)
		if(n%i==0)return 0;
	return 1;
}

int main() {
	int n,cnt;
	
	for(int i=0;i<50000;++i){
		Prime[i] = isPrime(i+1);
	}
	
	while(cin>>n,n){
		cnt = 0;
		if(isPrime(n-2))++cnt;
		for(int i=3;i<=n/2;i+=2){
			cnt += Prime[i-1] && Prime[n-i-1];
		}
		
		cout << cnt << endl;
	}
	return 0;
}

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

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

int main(){
  int a,b;
  cin>>a>>b;
  for(int i=1;i<4;i++){
    if((a*b*i)%2==1){
      cout<<"Yes"<<endl;
      return 0;
    }
      

  }
  cout<<"No"<<endl;

  return 0;
}


Measured memory_bytes: 384
#[allow(unused_imports)]
use std::cmp::{min,max};
#[allow(unused_imports)]
use std::collections::{BTreeMap,BTreeSet};
#[allow(unused_imports)]
use std::ops::*;
#[allow(unused_imports)]
use std::collections::BinaryHeap;

#[allow(unused_macros)]
macro_rules! tf {
    ($c:expr, $t:expr, $f:expr) => {{
        if $c { $t } else { $f }
    }};
}

fn main() {
    let (n, k) = {
        let xs = read_vec_i64();
        (xs[0] as usize, xs[1] as usize)
    };
    let res = tf!(n%k == 0, 0, 1);
    println!("{}", res);
}

#[allow(dead_code)]
fn read_line() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok();
    ret.pop();
    //ret.pop();
    return ret;
}

#[allow(dead_code)]
fn read_i64() -> i64 {
    let ss = read_line();
    return ss.parse::<i64>().unwrap();
}

#[allow(dead_code)]
fn read_vec_i64() -> Vec<i64> {
    let mut res = vec![];
    let ss = read_line();
    for ts in ss.split_whitespace() {
        let x = ts.parse::<i64>().unwrap();
        res.push(x);
    }
    return res;
}

use std::fmt::Display;
#[allow(dead_code)]
fn write_vec<T: Display>(xs: &Vec<T>) {
    if xs.len() == 0 {
        println!("");
        return;
    }
    print!("{}", xs[0]);
    for i in 1..xs.len() {
        print!(" {}", xs[i]);
    }
    println!("");
}


Measured memory_bytes: 4352
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        scan.close();

        List<Integer> list = new ArrayList<>();
        list.add(a + b);
        list.add(a - b);
        list.add(a * b);

        int max = list.parallelStream().max(Comparator.naturalOrder()).get();
        System.out.println(max);
    }
}

Measured memory_bytes: 29392
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;
import java.util.Scanner;

public class Main {
	char[] c;
    char[] apple = {'a','p','p','l','e'};
    char[] peach = {'p','e','a','c','h'};
    Scanner cin;
    public void solve() {
        cin = new Scanner(System.in);
        c = cin.nextLine().toCharArray();
        for(int i = 0;i < c.length;i++){
             
            if(i + 4 < c.length){
                 
                boolean isApple = true;
                boolean isPeach = true;
                 
                for(int j = 0;j < apple.length;j++){
                    if(apple[j] != c[i + j]){
                        isApple = false;
                    }
                }
                 
                for(int j = 0;j < peach.length;j++){
                    if(peach[j] != c[i + j]){
                        isPeach = false;
                    }
                }
                 
                if(isApple){
                    for(int j = 0;j < peach.length;j++){
                        c[i + j] = peach[j];
                    }
                }else if(isPeach){
                    for(int j = 0;j < apple.length;j++){
                        c[i + j] = apple[j];
                    }
                }
                 
            }
        }
        out.println(String.valueOf(c));
    }
 
	public static void main(String[] args) {
		out.flush();
		new Main().solve();
		out.close();
	}
		/* Input */
	private static final InputStream in = System.in;
	private static final PrintWriter out = new PrintWriter(System.out);
	private final byte[] buffer = new byte[2048];
	private int p = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (p < buflen)
			return true;
		p = 0;
		try {
			buflen = in.read(buffer);
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (buflen <= 0)
			return false;
		return true;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrint(buffer[p])) {
			p++;
		}
		return hasNextByte();
	}

	private boolean isPrint(int ch) {
		if (ch >= '!' && ch <= '~')
			return true;
		return false;
	}

	private int nextByte() {
		if (!hasNextByte())
			return -1;
		return buffer[p++];
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = -1;
		while (isPrint((b = nextByte()))) {
			sb.appendCodePoint(b);
		}
		return sb.toString();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

Measured memory_bytes: 26228
import sys

mod = 10**9 + 7
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))

ans = 1
xyz = [0] * 3
for i in range(N):
    tmp = 0
    index = -1
    for j in range(3):
        if A[i] == xyz[j]:
            tmp += 1
            if index == -1:
                index = j

    xyz[index] += 1
    ans *= tmp
    ans %= mod

    # print(xyz)
    # print(ans)

print(ans)

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

int main(){
	int k,s,res = 0;
	cin >> k >> s;
	for(int i = 0;i <= k;i++){
		for(int j = 0;j <= k;j++){
			if(s - i - j >= 0 && s - i - j <= k) res++;
		}
	}
	cout << res << endl;
	return 0;	
}

Measured memory_bytes: 384
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <set>
#include <vector>
#include <queue>

using namespace std;

typedef long long ll;
typedef long double ld;

constexpr int INF = 1e9;
constexpr ll BIGINF = 1e18;
constexpr double EPS = 1e-16;
constexpr int MOD = 1e9 + 7;

void preambule() {
  cin.tie(0);
  cout.precision(16);
  cout << fixed;
}

int x;

void input() {
  cin >> x;
}

void solve() {
  vector<string> a = {
      "Christmas Eve Eve Eve",
      "Christmas Eve Eve",
      "Christmas Eve",
      "Christmas"
  };

  cout << a[x % 22] << '\n';
}

int main() {
#ifdef _DEBUG
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  preambule();
  input();
  solve();
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<int,int>;
/* ちゃんと考えてわかって実装 */

const int MAX_N = 1000100;

int main(void){
    int n;
    cin >> n;
    vector<int> A(n);
    vector<int> all(MAX_N);
    for(int i=0; i<MAX_N; i++) all[i] = 0;
    for(int i=0; i<n; i++){
        cin >> A[i];
        all[A[i]]++;
    }
    sort(A.begin(), A.end());

    int ans = 0;
    for(int i=0; i<n; i++){
        if(all[A[i]] == 1) ans++;
        if(all[A[i]] != 0){
            for(int j=A[i]; j<MAX_N; j+=A[i]){
                all[j] = 0;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main() {

  int a,b;
  cin >> a >> b;
  if (a % 3 == 0 || b % 3 == 0 || (a+b) % 3 == 0){
    cout << "Possible";
  }
  else{
    cout << "Impossible";
  }
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  int n;
  int i, j;
  int card[4][13];
  int rank;
  char suite[2];

  for (i = 0; i < 4; i++){
    for (j = 0; j < 13; j++){
      card[i][j] = 0;
    }
  }

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

  for (i = 0; i < n; i++){
    scanf("%s %d", suite, &rank);
    if      (suite[0] == 'S') card[0][rank-1] = 1;
    else if (suite[0] == 'H') card[1][rank-1] = 1;
    else if (suite[0] == 'C') card[2][rank-1] = 1;
    else if (suite[0] == 'D') card[3][rank-1] = 1;
  }

  for (i = 0; i < 4; i++){
    for (j = 0; j < 13; j++){
      if      (card[0][j] == 0 && i == 0) printf("S %d\n", j+1);
      else if (card[1][j] == 0 && i == 1) printf("H %d\n", j+1);
      else if (card[2][j] == 0 && i == 2) printf("C %d\n", j+1);
      else if (card[3][j] == 0 && i == 3) printf("D %d\n", j+1);
    }
  }

  return 0;
}



Measured memory_bytes: 2128
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<vector>

using namespace std;

int main()
{
  int input[3];
  cin >> input[0] >> input[1] >> input[2];
  sort(input, input + 3);
  cout << input[0] << " " << input[1] << " " << input[2] << endl;
  return 0;
}

Measured memory_bytes: 1180
N = int(input())
F = [0] * N
for i in range(N):
    F[i] = [int(x) for x in input().split()]
P = [0] * N
for k in range(N):
    P[k] = [int(y) for y in input().split()]
kaburi = [0]*N  # 営業している時間が被っている数
ans = -10**9  # 利益の最大値

eigyou = [0]*10  # その時間営業してる？
for j in range(1, 2**10):
    rieki = 0
    for p in range(10):
        if j % 2 == 1:
            eigyou[p] = 1
        else:
            eigyou[p] = 0
        j = j//2
    for q in range(N):
        kaburi[q] = 0
        for m in range(10):
            if F[q][m] == eigyou[m] == 1:
                kaburi[q] += 1
        rieki += P[q][kaburi[q]]
    if rieki > ans:
        ans = rieki
print(ans)


Measured memory_bytes: 3064
# -*- coding: utf-8 -*-

import sys

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]


    token = lines[0].split()
    a = int(token[0])
    b = int(token[1])
    c = int(token[2])

    return (a, b, c)


def solve(a, b, c):

        

    

    return min(a+b, a+c, b+c)




def main():
    # 出力

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()
	

Measured memory_bytes: 3064
//https://atcoder.jp/contests/abc114/tasks/abc114_d
//D - 756
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
template<class T>bool chmax(T &a, const T &b) {if (a<b) { a=b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) {if (b<a) { a=b; return 1; } return 0;}

template< typename T >
std::vector<std::pair<T,T>> prime_factor_decomp(T n) {
    std::vector<std::pair<T,T>> pe_tbl;
    T m = n;
    for (T i = 2; i * i <= n; i++) {
        if (m % i != 0) continue;
        T c = 0;
        while (m % i == 0) c++, m /= i;
        pe_tbl.emplace_back(i,c);
    }
    if (m > 1) {
        pe_tbl.emplace_back(m,1);
    }
    return pe_tbl;
}

int main() {
    ll N=10; cin>>N;
    auto base = prime_factor_decomp(75LL);
    dump(base);
    auto tmp = prime_factor_decomp(32400LL);
    dump(tmp);
    tmp = prime_factor_decomp(362880LL);
    dump(tmp);
    unordered_map<ll,ll> pd_tbl;
    FOR(i,1,N+1){
        auto rs = prime_factor_decomp(i);
        for(const auto& r:rs){
            pd_tbl[r.first] += r.second;
        }
    }
    dump(pd_tbl);
    ll ov4 = 0;
    ll ov2_3 = 0;

    ll ov74 = 0;

    ll ov14 = 0;
    ll ov4_2 = 0;

    ll ov24 = 0;
    ll ov2 = 0;
    for (const auto& i:pd_tbl) {
        if (i.second>=4){
            ++ov4;
        }else if(i.second>=2){
            ++ov2_3;
        }
        if (i.second >= 74) {
            ++ov74;
        }
        if (i.second >= 14){
            ++ov14;
        }else if(i.second>=4){
            ++ov4_2;
        }
        if (i.second >= 24){
            ++ov24;
        }else if(i.second>=2){
            ++ov2;
        }
    }
    dump(ov4,ov2_3,ov74);
    ll ans = ov4 * (ov4-1) / 2;
    ans *= ((ov4-2)+ov2_3);
    ans += (ov74); //74
    ans += ov14 * (ov4_2-1+ov14); //15*5
    ans += ov24 * (ov24-1+ov2); //25*3
    cout<<ans<<endl;
    return 0;
}

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

def gcd(a,b):
    if a % b == 0:
        return b
    return gcd(b, a%b)

dec = {}
for a in range(1,K+1):
    for b in range(1, K+1):
        if gcd(a,b) not in dec:
            dec[gcd(a,b)] = 1
        else:
            dec[gcd(a,b)] += 1
ans = 0
for c in range(1, K+1):
    for key in dec.keys():
        ans += gcd(c, key)*dec[key]

print(ans)


Measured memory_bytes: 9140
import scala.io.StdIn.{readLine,readInt}

object Main {

  def getFee(x:Int,y:Int,h:Int,w:Int) = {
    val l = x+y+h
    if(l<=60 && w <= 2) 600
    else if(l<=80 && w<=5) 800
    else if(l<=100 && w<=10) 1000
    else if(l<=120 && w<=15) 1200
    else if(l<=140 && w<=20) 1400
    else if(l<=160 && w<=25) 1600
    else 0
  }

  def main(args:Array[String]) = {
    var n = 0
    while({n=readInt;n} != 0) {
      val sum = (1 to n).map { i =>
        val m = readLine.split(" ").map(_.toInt)
        getFee(m(0),m(1),m(2),m(3))
      }.sum
      println(sum)
    }
  }
}

Measured memory_bytes: 57036
N, K = map(int, input().split())
a = [int(input()) for i in range(N)]
a.sort()
ans = a[K-1]-a[0]
for i in range(1,N-K+1):
  b = a[i+K-1]-a[i]
  if b < ans:
    ans = b
print(ans)
  

Measured memory_bytes: 7384
#include <stdio.h>

int main(void) {
	int a, b, c, k=3;
	scanf("%d%d%d", &a, &b, &c);
	if (a==b) k--;
	else if (b==c) k--;
	if (c==a) k--;
	printf("%d\n", k);
	return 0;
}


Measured memory_bytes: 128
main = do
    l <- getLine
    putStrLn $ toTime (read l :: Int) 2

toTime :: Int -> Int -> String
toTime s 0 = show s
toTime s n = show divSecond ++ ":" ++ toTime modSecond (n-1)
    where divSecond  = s `div` (60 ^ n)
          modSecond  = s `mod` (60 ^ n)

Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#define FPEN freopen("in.txt", "r", stdin);
#define TEST(...)                                                              \
    { printf("! "), printf(__VA_ARGS__); }
#else
#define TEST(...)
#define FPEN
#endif
const int maxn = 200009;
typedef long long i64;
typedef pair<i64, i64> pi64;
typedef pair<int, int> pi;
const i64 MOD = 119 << 23 | 1;
class {
  public:
    void solve() {
        i64 n;
        cin >> n;
        i64 ans = 0;
        ans += n / 500 * 1000;
        n %= 500;
        ans += n / 5 * 5;
        cout << ans << '\n';
    }
} NSPACE;
int main() {
    FPEN;
    ios_base::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
    NSPACE.solve();
}

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  vector<int> B(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  
  sort (A.begin(), A.end(), greater<int>());
  B = A;
  B.erase(unique(B.begin(), B.end()), B.end());
  bool wholeflag = true;
  
  for (int i = 0; i < B.size(); i++) {
    bool flag = true;
    bool tmpflag = true;
    for (int j = 0; j < A.size(); j++) {
      if (A.at(j) % B.at(i) != 0 && tmpflag) {
        tmpflag = false;
      }
      else if (A.at(j) % B.at(i) != 0 && !tmpflag) {
        flag = false;
        break;
      }
    }
    if (flag) {
      cout << B.at(i) <<endl;
      wholeflag = false;
      break;
    }
  }
  
  if(wholeflag) {
    for (int i = A.at(N-1); i > 0; i--) {
      bool flag = true;
      bool tmpflag = true;
      for (int j = 0; j < A.size(); j++) {
        if (A.at(j) % i != 0 && tmpflag) {
          tmpflag = false;
        }
        else if (A.at(j) % i != 0 && !tmpflag) {
          flag = false;
          break;
        }
      }
      if (flag) {
        cout << i <<endl;
        break;
      }
    }
  }
}


Measured memory_bytes: 1024
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#include <set>
#include <map>
#define rep(i,n) for (int i=0; i<n;++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
typedef long long ll;
using namespace std;
const ll MOD = 1e9+7LL;
const int INF = 2e9;
int N;
ll DP[9][9]; // 1-9だが0-8にいれる

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

  cin >> N;
  rep(i, N) {
    int num = i+1;
    if (num < 10) {
      DP[i][i]++;
      continue;
    }
    int end = num%10;
    if (end==0) continue;
    int start = num; 
    while(start>=10) start = (start-(start%10))/10;
    DP[start-1][end-1]++;
  }
  ll cnt = 0;
  rep(i, N) {
    int num = i+1;
    if (num < 10) {
      cnt +=DP[i][i];
      continue;
    }
    int end = num%10;
    if (end==0) continue;
    int start = num;
    while(start>=10) start = (start-(start%10))/10;
    cnt += DP[end-1][start-1];
  }
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<ctime>
#include<cstdlib>
#define  ll int
using namespace std;
ll flag[20][20],f[20][20],a[20],d[20];
ll n,m,i,j,k,t,ans;
ll read()
{
	ll f=0,c=1;	char ch=getchar();
	while((ch<'0')||(ch>'9'))	{	if(ch=='-') c=-1;	ch=getchar();	}
	while((ch>='0')&&(ch<='9'))	{	f=f*10+ch-'0';	ch=getchar();	}
	return c*f;
}
void check()
{
//	for(ll i=1;i<=n;++i) cout<<a[i]<<" ";
//	cout<<endl;
	ll tot=0;
	for(ll i=1;i<=n;++i)
	{
		if(a[i])
		{
			++tot;
			for(ll j=1;j<=d[i];++j)
			{
				if(flag[i][j]!=a[ f[i][j] ]) return;
			}
		}
	}
	ans=max(ans,tot);
}
void dfs(ll x)
{
	if(x==n+1) { check(); return ; }
	a[x]=1; dfs(x+1);
	a[x]=0; dfs(x+1);
}
int main()
{
//	freopen("test.in","r",stdin);
//	freopen("test.out","w",stdout);
	n=read();
	for(ll i=1;i<=n;++i)
	{
		d[i]=read();
		for(ll j=1;j<=d[i];++j)
		{
			f[i][j]=read(); flag[i][j]=read();
		}
	}
	dfs(1);
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  cin >> s;
  char x=s[6];
  if (s[5]=='1'||x=='5'||x=='6'||x=='7'||x=='8'||x=='9'){
    cout << "TBD" << endl;
  }
  else {
    cout << "Heisei" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int inf = 1001001001;

int main(){
  int n;
  cin >> n;
  string s;
  cin >> s;

  string t = s;
  sort(t.begin(),t.end());

  int ans = 0;
  rep(i,n) {
    if(s[i] != t[i]) ans++;
  }
  
  cout << ans/2 << endl;
}


Measured memory_bytes: 3844
a,b,c,x,y = map(int,input().split())
tmpans = max(x,y)*2*c
ans = 0
if a+b > 2*c:
    tmp = min(x,y)
    ans += tmp *(2*c)
    x -= tmp
    y -= tmp
    ans += x*a + y*b
else:
    ans += x*a + y*b
print(min(ans,tmpans))

Measured memory_bytes: 3064
#include<stdio.h>
int main(void)
{
	int a,b,c,n;
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	if(a==b && b==c) printf("1\n");
	else if(a==b || a==c || b==c) printf("2\n");
	else printf("3\n");
	
	return 0;
}


Measured memory_bytes: 128
#include<iostream>

int main(){
	int h,w;
	while(1){
		std::cin>>h>>w;
		if(h == 0 && w == 0)break;
		for(int i = 0;i < h;++i){
			for(int i = 0; i < w; ++i){
				std::cout<<"#";
			}
			std::cout<<std::endl;
		}
		std::cout<<std::endl;
	}
	return 0;
}

Measured memory_bytes: 1152
import java.util.*;

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

        if((a + b) % 2 == 0){
            System.out.println((a + b) / 2);
        }else{
            System.out.println("IMPOSSIBLE");
        }
    }

}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using ld = long double;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define REPS(c, s) for (char c : s)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REV(c) reverse(ALL(c))
#define sz(v) (int)v.size()
#define Q int q; cin >> q; while (q--)
#define endl '\n'
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
template<class T> inline void printv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << (i == n - 1 ? endl : ' ');}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
 
void solve();
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

void solve() {
    map<string, int> m;
    Q {
        int c;
        string k;
        cin >> c >> k;
        if (c == 0) {
            int y;
            cin >> y;
            m[k] = y;
        } else if (c == 1) {
            cout << m[k] << endl;
        }
    }
}



Measured memory_bytes: 25956
#include <iostream>
#include <sstream>
#include <algorithm>
#include <functional>
#include <iterator>
#include <numeric>
#include <cstdint>
#include <cmath>
#include <bitset>
#include <string>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>

#define N_TIMES(i, n)     for ( uint64_t i = 0;     i <  n; ++i )
#define N_TIMES_REV(i, n) for (  int64_t i = n - 1; i >= 0; --i )
#define SQRTI(n) static_cast<uint64_t>(::floor(::sqrt(static_cast<double>(n))))

#ifdef __DEBUG__
template<typename T, typename U>
std::ostream& operator<<(std::ostream &os, const std::pair<T, U> &pair)
{
  os << pair.first << ": " << pair.second;
  return os;
}

template<class ForwardIterator>
std::ostream& _iterator_to_display(
  std::ostream &os, 
  ForwardIterator begin, ForwardIterator end, 
  const std::string &delim = ", "
)
{
  auto itr = begin;
  while (itr != end) {
    os << *itr;
    ++itr;
    if (itr != end) os << delim;
  }
  return os;
}

template<typename T>
std::ostream& operator<<(std::ostream &os, const std::list<T> &list)
{
  _iterator_to_display(os, list.begin(), list.end());
  return os;
}

template<typename T>
std::ostream& operator<<(std::ostream &os, const std::vector<T> &vector)
{
  _iterator_to_display(os, vector.begin(), vector.end());
  return os;
}

template<typename T, class C=std::less<T>>
std::ostream& operator<<(std::ostream &os, const std::set<T> &set)
{
  _iterator_to_display(os, set.begin(), set.end());
  return os;
}

template<typename T, typename U, class C=std::less<T>>
std::ostream& operator<<(std::ostream &os, const std::map<T, U> &map)
{
  _iterator_to_display(os, map.begin(), map.end());
  return os;
}
#endif /* __DEBUG__ */

struct Pair
{
  uint64_t a, b;
  Pair(uint64_t a = 0, uint64_t b = 0) : a(a), b(b) {}
  bool operator<(const Pair &rhs) const {
    return b == rhs.b ? a < rhs.a : b < rhs.b;
  }
};

std::istream& operator>>(std::istream &is, Pair &p)
{
  is >> p.a >> p.b;
  return is;
}

#ifdef __DEBUG__
std::ostream& operator<<(std::ostream &os, const Pair &p)
{
  os << '[' << p.a << ", " << p.b << ')';
  return os;
}
#endif /* __DEBUG__ */

int main(int argc, char **argv)
{
  uint64_t N, M;
  std::cin >> N >> M;
  
  std::vector<Pair> request(M);
  N_TIMES(m, M) std::cin >> request[m];
  std::sort(request.begin(), request.end());
  
  uint64_t c = 0, t = 0;
  N_TIMES(m, M) {
    if (t < request[m].a) {
      t = request[m].b - 1;
      ++c;
    }
  }
  std::cout << c << std::endl;
  
  return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define mod 1000000007
#define mod998 998244353
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define mkp make_pair
typedef long long ll;
using namespace std;
const string nyan("(=^・ω・^=)");

int N, M, K, c[100000], C[100000], t[100000], cnt;
bool b[100000];
ll res;
pair<int, pair<int, int>>p[100000];

int r(int x) {
	if (t[x] < 0)return x;
	return t[x] = r(t[x]);
}

bool u(int x, int y) {
	x = r(x);
	y = r(y);
	if (x == y)return false;
	if (t[x] < t[y]) {
		t[x] += t[y];
		t[y] = x;
	}
	else {
		t[y] += t[x];
		t[x] = y;
	}
	return true;
}

int main() {
	cin >> N >> M >> K;
	for (int i = 0; i < N; ++i) {
		cin >> c[i];
		--c[i];
	}
	for (int i = 0; i < M; ++i) {
		cin >> p[i].second.first >> p[i].second.second >> p[i].first;
		--p[i].second.first;
		--p[i].second.second;
	}
	sort(p, p + M);
	memset(t, -1, sizeof t);
	memset(C, -1, sizeof C);
	for (int i = 0; i < N; ++i) {
		if (c[i] >= 0) {
			if (C[c[i]] == -1) {
				C[c[i]] = i;
			}
			else {
				u(C[c[i]], i);
			}
		}
	}
	for (int i = 0; i < M; ++i) {
		if (u(p[i].second.first, p[i].second.second)) {
			++cnt;
			res += p[i].first;
			if (cnt == K - 1) {
				cout << res << endl;
				return 0;
			}
		}
	}
	cout << -1 << endl;
	return 0;
}


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

int main(){
    string s;
    cin >> s;
    int countW=0,countB=0;
    for(int i=0; i<s.size(); i++){
        if(s.at(i)=='W') countW++;
        if(s.at(i)=='B') countB++;
    }

    long long int ans=0;
    for(int i=0; i<s.size(); i++){
        if(s.at(i)=='W') countW--;
        else if(s.at(i)=='B'){
            ans+=countW;
            countB--;
        }
        if(countB==0 || countW==0) break;
    }

    cout << ans << endl;
}


Measured memory_bytes: 3700
#include <stdio.h>

int main(void) {
	// your code goes here
	
	int N;
	do{
	    scanf("%d",&N);
	    if(N/100==0)
	      printf("もう一度入力");
	}while(N/100==0);
	
	int a, b, c;
	int n;
	
	a=N/100;
	n=N-100*a;
	b=n/10;
	c=n-10*b;
	
	if(a==7||b==7||c==7)
	  printf("Yes");
	else
	  printf("No");
	
	
	return 0;
}

Measured memory_bytes: 1684
def main():
    n,k = map(int,input().split())
    h = list(map(int,input().split()))
    dp = [float('inf') for i in range(n)]
    dp[0] = 0
    for i in range(1,n):
        for j in range(1,min(i+1,k+1)):
            m = dp[i-j] + abs(h[i]-h[i-j])
            if dp[i]>m:
                dp[i] = m
    print(dp[n-1])
    

if __name__ == "__main__":
    main()


Measured memory_bytes: 20448
#include <iostream>
#include <string>

using namespace std;

long long ruizyo(int tei, int sisu){
  long long a = 1;
  for(int i=0; i<sisu; i++) a *= tei;
  return a;
}

int hikicount(long long &higensu, long long gensu){
  int i = 0;
  while(higensu>gensu){
    higensu -= gensu;
    i++;
  }
  return i;
}

long long zyokyo(long long hizyokyo, int &i){
  while(hizyokyo>ruizyo(26, i)){
    hizyokyo -= ruizyo(26, i);
    i++;
  }
  return hizyokyo;
}

int main(void){

  long long N;
  int j; // 文字数に関する処理で使う
  string s;

  cin >> N;

  j = 1;
  N = zyokyo(N, j);
//  cout << "処理後のN: " << N << ", " << "文字数: " << j << endl;

  for(int i=j; i>0; i--){
//    cout << N << " ";
    s += 'a' + hikicount(N, ruizyo(26, i-1));
//    cout << s << endl;
  }

  cout << s << endl;

  return 0;
}


Measured memory_bytes: 3632
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    
    string S;
    cin >> S;

    if (S == "ABC") cout << "ARC" << endl;
    else cout << "ABC" << endl;
    
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U> using Pa = pair<T, U>;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;

int main(){
    int N;
    cin >> N;
    auto digit = [](int n){
        int a = 0;
        while(n){
            a += n%10;
            n /= 10;
        }
        return a;
    };
    cout << (N%digit(N)==0? "Yes\n":"No\n");
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<string>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
#include<map>
#include<set>
#include<limits>
#include<bitset>
#include<array>
#include<numeric>
#include<iomanip>
#include<functional>
#include<deque>

using namespace std;
typedef long long int ll;

#define C cout<<
#define E <<endl

ll n,m,a,b,c,x,y,z,aa[200010],ab[200010],ac[1010][1010];
bool r,ra,rb,rc;
string s,sa,sb,sc;
char ca,cb,cc,cd[1010][1010];
vector<ll> va,vb,vc;

int gcd(ll tara,ll tarb){ //最大公約数
    ll am=1;
    while(am){
        am=tara%tarb;
        tara=tarb;
        tarb=am;
    }
    return tara;
}

int lcm(ll tara,ll tarb){ //最小公倍数
    return tarb/gcd(tara,tarb)*tara;
}


int main(){
    cin>>n;
    
    for(int i=0;i<n;i++){
        cin>>aa[i];
    }
    x=aa[0];
    for(int i=1;i<n;i++){
        x=gcd(x,aa[i]);
    }
    C x E;
    
}

Measured memory_bytes: 1024
#include<iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int Max = 1000000;
int main(){
  	int N;
  	cin >> N;
  	int P[N];
  	for(int i=0;i<N;i++){
  		cin >> P[i];
  	}

  	int cnt = 0;
  	int Min = 10000000;
  	for(int i=0;i<N;i++){
  		if(Min>P[i]){
  			cnt++;
  			Min = P[i];
  		}
  	}
  	cout << cnt <<endl;
    
  	return 0;
}


Measured memory_bytes: 1024
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define mp make_pair
#define fs first
#define se second
#define pi 2*acos(0)
#define PI 3.14159265358979323846264338

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

const int N = 100010;
const int MX = 123456;
const int mod = (int)1e9 + 7;
const int base = 97;
const ull BS1 = 10000019ULL;
const int INF = (1 << 29);

template < class T > inline void fastScan(T &x){
    register char c = getchar();
    int neg = 0; x = 0;
    for(   ; (c < 48 || c > 57) && (c != '-'); c = getchar());
    if(c == '-') { neg = 1; c = getchar(); }
    for(   ; c > 47 && c < 58; c = getchar()){
        x = (x << 1) + (x << 3) + c - 48;
    }
    if(neg) x = -x;
}

// OrderedSet
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// template < typename T > using ordered_set = tree < T, null_type, greater < T >, rb_tree_tag, tree_order_statistics_node_update >;

//typedef uint64_t hash_t;
//mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
//const int HASH_COUNT = 2;
//const hash_t HASH_P = (uint32_t)-13337;
//uniform_int_distribution<hash_t> MULT_DIST(0.25 * HASH_P, 0.75 * HASH_P);
//const hash_t HASH_MULT[HASH_COUNT] = {MULT_DIST(rng), MULT_DIST(rng)};

bool f_prime[N * 10];
int prime[N * 10], sz;

map < ll , int > mymp;

void sieve(){
  for(int i = 4; i < N * 10; i += 2) f_prime[i] = 1;
  for(int i = 3; i * i <= N * 10; i += 2){
    if(f_prime[i] == 0){
      for(int j = i * 3; j < N * 10; j+=i){
        f_prime[j] = 1;
      }
    }
  }
  prime[sz++] = 2;
  for(int i = 3; i < N * 10; i+=2){
    if(f_prime[i] == 0){
      prime[sz++] = i;
    }
  }
}

void fact(ll n){
  for(int i = 0; i < sz && (1ll * prime[i] * prime[i] <= n); i++){
    if(n % prime[i] == 0){
      int c = 0;
      while(n % prime[i] == 0){
        c++;
        n /= prime[i];
      }
      mymp[prime[i]] = c;
    }
  }
  if(n > 1){
    mymp[n] = 1;
  }
}

int main(){
  sieve();
  ll n;
  fastScan(n);
  fact(n);
  int ans = 0;
  for(auto it : mymp){
    int c = it.se;
    //cout << it.fs << " " << it.se << '\n';
    for(int i = 1; i <= c; i++){
      ans++;
      c -= i;
    }
  }
  printf("%d\n", ans);
}


Measured memory_bytes: 5064
// created by mtnshh
 
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
 
#define ll long long
#define ld long double
 
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
 
#define err() cout<<"=================================="<<endl;
#define errA(A) for(auto i:A)   cout<<i<<" ";cout<<endl;
#define err1(a) cout<<#a<<" "<<a<<endl
#define err2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define err3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl
#define err4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<endl
 
#define pb push_back
#define all(A)  A.begin(),A.end()
#define allr(A)    A.rbegin(),A.rend()
#define ft first
#define sd second
 
#define pll pair<ll,ll>
#define V vector<ll>
#define S set<ll>
#define VV vector<V>
#define Vpll vector<pll>
 
#define endl "\n"
 
const ll logN = 20;
const ll M = 1000000007;
const ll INF = 1e12;
#define PI 3.14159265
 
const ll N = 100005;

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll n;
	cin>>n;
	ll A[n];
	rep(i,0,n)	cin>>A[i];
	ll mi=M;
	ll ans=0;
	rep(i,0,n){
		if(mi>A[i]){
			mi=A[i];
			ans++;
		}
	}
	cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define rep(i,n) for(long long i=0; i<n; i++)
#define Rep(i,n) for(long long i=1; i<n; i++)
#define ll long long
#include <math.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <vector>


using namespace std;
#define PI acos(-1)
using P =pair<int,int>;

ll ketasu(ll a){
   ll num=1;
   while(a/10){
       num++;
       a/=10;
   }
   return num;
}

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 kosuu(ll a){
    ll sum=0;
    for(ll i=1;i*i<=a;i++){
        if(a%i==0){
            if(a!=1&&i*i!=a){
            sum+=2;
            }else{
             sum++;   
            }
        }
    }
    return sum;
}
ll ans=-1000000000;



int main()
{
 string s;
 cin>>s;
 vector<ll>cnt(s.size());
 ll x;
 
 rep(i,s.size()){
    ll k=0;
    ll j=i;
    if(s[i]=='L'){
        while(s[j]=='L'){
            j++;
            k++;
        }
       cnt[i]+=(k/2+k%2);
       cnt[i-1]+=(k/2);
       i+=k-1;
       continue;
    }
    if(s[i]=='R'){
        while(s[j]=='R'){
            j++;
            k++;
        }
        ll left=100000-k;
        if(left%2==0){
          cnt[j]+=(k/2+k%2);
          cnt[j-1]+=(k/2);
        }else{
          cnt[j-1]+=(k/2+k%2);
          cnt[j]+=(k/2);
        }
        i+=k-1;
        continue;
    }
 }
 rep(i,s.size())cout<<cnt[i]<<" ";
}



Measured memory_bytes: 4316