akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >> n;
	vector<unsigned long long int>name_type(5, 0);//M:0, A:1, R:2, C:3, H:4
	for(int i = 0; i < n; i++){
		string name;
		cin >> name;
		if(name[0] == 'M'){
			name_type[0] += 1;
		}else if(name[0] == 'A'){
			name_type[1] += 1;
		}else if(name[0] == 'R'){
			name_type[2] += 1;
		}else if(name[0] == 'C'){
			name_type[3] += 1;
		}else if(name[0] == 'H'){
			name_type[4] += 1;
		}
	}

	unsigned long long int ans = 0;
	for(int i = 0; i < 5; i++){
		for(int j = 0; j < 5; j++){
			for(int k = 0; k < 5; k++){
				if(i != j && j != k && i != k 
						&& name_type[i] != 0 && name_type[j] != 0 && name_type[k] != 0){
					ans += name_type[i]*name_type[j]*name_type[k];
				}				
			}
		}
	}
	cout << ans/6 << endl;
}

Measured memory_bytes: 256
n = gets.chomp.to_i
a = gets.chomp.split.map(&:to_i)

ans = 0
n.times do |i|
  loop do
    if a[i] % 2 == 0
      a[i] /= 2
      ans += 1
    else
      break
    end
  end
end
p ans


Measured memory_bytes: 2812
while 1:
    n, x = map(int, raw_input().split())
    if n == 0 and x == 0: break

    count = 0
    for i in range(1, n+1):
        for j in range(i+1, n+1):
            for k in range(j+1, n+1):
                if i + j + k == x:
                    count += 1

    print(count)

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

using namespace std;

int main() {
  string S;
  cin >> S;
  int L = S.size();
  string ans = "AC";

  if (S[0] != 'A') {
    ans = "WA";
  }

  int cnt = 0;
  for (int i = 1; i < L; i++) {
    if (S[i] < 'a') {
      if (S[i] != 'C') {
        ans = "WA";
      } else {
        if (i > 1 && i < L - 1) {
          cnt++;
        } else {
          ans = "WA";
        }
      }
    }
  }
  if (cnt != 1) {
    ans = "WA";
  }
  cout << ans;
  return 0;
}

Measured memory_bytes: 256
const input = require("fs").readFileSync("/dev/stdin", "utf8")
;(input => {

    const lines = input.split('\n')
    const [N, X, Y] = lines[0].split(' ').map(Number)

    const f = (i, j) => {
        return Math.min(j - i, Math.abs(X - i) + Math.abs(Y- j) + 1)
    }
    const D = Array(N).fill(0)
    for (let i = 1; i < N; i++) {
        for (let j = i + 1; j <= N; j++) {
            D[f(i, j)]++
        }
    }

    for (let i = 1; i < N; i++) {
        console.log(D[i])
    }

})(input)


Measured memory_bytes: 33728
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();
    int c = sc.nextInt();
    
    int ab = a + b;
    int bc = b + c;
    int ca = c + a;
    
    int min = ab;
    if (bc <= ca && bc <= ab) {
      min = bc;
    }
    if (ca <= ab && ca <= bc) {
      min = ca;
    }
    System.out.println(min);
  }
}

Measured memory_bytes: 21712
package main

import (
	"fmt"
	"sort"
)

func main() {
	var N int
	fmt.Scan(&N)
	A := make([]int, 0)
	B := map[int]int{}
	var a int
	for i := 0; i < N; i++ {
		fmt.Scan(&a)
		B[a]++
		if B[a] == 2 || B[a] == 4 {
			A = append(A, a)
		}
	}
	sort.Ints(A)
	if len(A) >= 2 {
		fmt.Println(A[len(A)-1] * A[len(A)-2])
	} else {
		fmt.Println("0")
	}
}


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

int main()
{
    int n;
    cin >> n;
    int a[n];
    
    for(int i=0; i<n; i++) cin >> a[i];
    int dp[n+1];
    dp[0] = 0;
    dp[1] = 0;
    dp[2] = abs(a[1]-a[0]);
    for(int i=3; i<=n; i++){
        dp[i] = min(dp[i-1]+abs(a[i-1]-a[i-2]), dp[i-2]+abs(a[i-1]-a[i-3]));
    }
    cout << dp[n];
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

const ll MOD = 1e9+7;

int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];

  ll ans = 0;
  rep(i, n) ans = (ans + a[i]) % MOD;
  ans = ans * (n-1) % MOD;

  vector<ll> bc(60, 0);
  rep(i, n) rep(bi, 60) {
    if (a[i] & 1LL<<bi) ++bc[bi];
  }
  rep(bi, 60) {
    ans = ((ans - bc[bi] * (bc[bi]-1) % MOD * ((1LL<<bi) % MOD)) % MOD) % MOD;
  }
  if (ans < 0) ans += MOD;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 5596
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using pll = pair<ll,ll>;
using vb = vector<bool>;
const ll oo = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define has(c,i) ((c).find(i) != end(c))
#define FOR(i,a,b) for (int i=(a); i<(b); i++)
#define FORD(i,a,b) for (int i=int(b)-1; i>=(a); i--)

int main() {
	int n, m, k;
	cin >> n >> m >> k;
	FOR(i,0,n+1) FOR(j,0,m+1) {
		int black = i * (m - j) + j * (n - i);
		if (black == k) {
			cout << "Yes" << endl;
			//cerr << i << " " << j << endl;
			return 0;
		}
	}
	cout <<  "No" << endl;
}

Measured memory_bytes: 256
s = input()
def solve(s):
    m = int(s[:2])
    n = int(s[2:])
    u=0
    if 1<=n<=12:
        u = 1
    v=0
    if 1<=m<=12:
        v=1
    if v==1 and u==1:
        return 'AMBIGUOUS'
    if v==1 and u==0:
        return 'MMYY'
    if v==0 and u==1:
        return 'YYMM'
    return 'NA'    
print(solve(s))


Measured memory_bytes: 3060
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>	
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r);
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r);
#define TYPE long long
#define MEMSET(a) memset(a,0,sizeof(a))
const int mod=(int)1e09+7;

int in(void){
	int i;scanf("%d",&i);
	return i;
}
long long llin(void){
	long long i;scanf("%lld",&i);
	return i;
}
double din(void){
	double i;scanf("%lf",&i);
	return i;
}
void chin(char s[]){
	scanf("%s",s);
}
void print(int a){
	printf("%d\n",a);
}
void llprint(long long a){
	printf("%lld\n",a);
}
void dprint(double a){
	printf("%.10f\n",a);
}
void print2(int a,int b){
	printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
	return a>b?a:b;
}
long long min(long long a,long long b){
	return a<b?a:b;
}
long long llabs(long long a){
	return a>0?a:-a;
}
double dmax(double a,double b){
	return a>b?a:b;
}
int cmp(const void *a,const void *b){
	return *(TYPE *)a-*(TYPE *)b;
}
int cmp_r(const void *a,const void *b){
	return *(TYPE *)b-*(TYPE *)a;
}
int char_cmp(const void *a,const void *b){
	return strcmp((char *)a,(char *)b);
}
int char_cmp_r(const void *a,const void *b){
	return strcmp((char *)b,(char *)a);
}
void swap(int *a,int *b){
	int t=*a;
	*a=*b;
	*b=t;
}
long long gcd(long long x,long long y){
	return x%y?gcd(y,x%y):y;
}
long long lcm(long long x,long long y){
	return x/gcd(x,y)*y;
}

long long fact_mod(long long x){
	if(x<=1)return 1;
	return x*fact_mod(x-1)%mod;
}

int main(void){
	int n=in(),s,f=0,i;
	rep(i,n){
		s=getchar();
		f|=(s=='Y');
	}
	puts(f?"Four":"Three");
	return 0;
}

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

public class Main {


  public static void main(String[] args) {

    char[] s = null;
    try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
      s = br.readLine().toCharArray();
    } catch (IOException e) {
      e.printStackTrace();
      System.exit(1);
    }

    char[] odd = new char[2];
    odd[0] = s[0];
    odd[1] = (odd[0] == '0') ? '1' : '0';

    int sum = 0;
    for (int i = 1; i < s.length; i++) {
      if ((i + 1) % 2 != 0) {
        sum = (s[i] != odd[0]) ? sum + 1 : sum;
      } else if ((i + 1) % 2 == 0) {
        sum = (s[i] != odd[1]) ? sum + 1 : sum;
      }
    }
    System.out.print(sum);
  }
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B,L,R;
string S,T;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;

typedef vector<P> vp;
typedef vector<vp> matP;

int main(){
    cin>>N;
    map<string, ll> card;
    rep(i,N){
        cin>>S;
        ++card[S];
    }
    cin>>M;
    rep(i,M){
        cin>>S;
        --card[S];
    }
    ll ans = 0;
    for(auto ite = card.begin(); ite != card.end(); ++ite){
        ans = max(ans, ite->second);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define LLI long long int
#define FOR(v, a, b) for(LLI v = (a); v < (b); ++v)
#define FORE(v, a, b) for(LLI v = (a); v <= (b); ++v)
#define REP(v, n) FOR(v, 0, n)
#define REPE(v, n) FORE(v, 0, n)
#define REV(v, a, b) for(LLI v = (a); v >= (b); --v)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define ITR(it, c) for(auto it = (c).begin(); it != (c).end(); ++it)
#define RITR(it, c) for(auto it = (c).rbegin(); it != (c).rend(); ++it)
#define EXIST(c,x) ((c).find(x) != (c).end())
#define fst first
#define snd second
#define popcount __builtin_popcount
#define UNIQ(v) (v).erase(unique(ALL(v)), (v).end())
#define bit(i) (1LL<<(i))

#ifdef DEBUG
#include <misc/C++/Debug.cpp>
#else
#define dump(...) ((void)0)
#endif

#define gcd __gcd

using namespace std;
template <class T> constexpr T lcm(T m, T n){return m/gcd(m,n)*n;}

template <typename I> void join(ostream &ost, I s, I t, string d=" "){for(auto i=s; i!=t; ++i){if(i!=s)ost<<d; ost<<*i;}ost<<endl;}
template <typename T> istream& operator>>(istream &is, vector<T> &v){for(auto &a : v) is >> a; return is;}
template <typename T, typename U> istream& operator>>(istream &is, pair<T,U> &p){is >> p.first >> p.second; return is;}

template <typename T, typename U> bool chmin(T &a, const U &b){return (a>b ? a=b, true : false);}
template <typename T, typename U> bool chmax(T &a, const U &b){return (a<b ? a=b, true : false);}
template <typename T, size_t N, typename U> void fill_array(T (&a)[N], const U &v){fill((U*)a, (U*)(a+N), v);}

template <typename T> struct LinearImos1D{
  vector<T> vec_a, vec_a_end, vec_b, vec;
  int n;

  LinearImos1D(int n): vec_a(n+1), vec_a_end(n+1), vec_b(n+1), vec(n+1), n(n){}

  void add(int s, int t, const T &a, const T &b){ // x∈[s,t)にax+bを加算する。
    vec_a[s+1] += a;
    vec_a[t] -= a;
    
    vec_a_end[t] -= a*(t-s-1);

    vec_b[s] += a*s+b;
    vec_b[t] -= a*s+b;
  }

  void calc(){
    REP(i,n) vec_a[i+1] += vec_a[i];
    REPE(i,n) vec_a[i] += vec_a_end[i];
    REP(i,n) vec_a[i+1] += vec_a[i];

    REP(i,n) vec_b[i+1] += vec_b[i];

    REPE(i,n) vec[i] = vec_a[i] + vec_b[i];
  }

  inline const T operator[](size_t i) const {return vec[i];}
};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n,m;
  while(cin >> n >> m){
    vector<LLI> a(n); cin >> a;
    for(auto &x : a) --x;

    LinearImos1D<LLI> imos(2*m);

    REP(i,n-1){
      if(a[i] < a[i+1]){
        imos.add(a[i]+1,a[i+1]+1,1,-(a[i]+1));
      }else{
        imos.add(a[i]+1,a[i+1]+1+m,1,-(a[i]+1));
      }
    }

    imos.calc();

    LLI b = 0;
    REP(i,n-1){
      if(a[i] < a[i+1]) b += a[i+1]-a[i];
      else b += a[i+1]+1+(m-a[i]-1);
    }

    LLI ans = LLONG_MAX;
    REP(i,m){
      chmin(ans, b-imos[i]-imos[i+m]);
    }

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


Measured memory_bytes: 7296
#include <iostream>
#include <algorithm>
//#include <cstdio>
//#include <map>
//#include <cmath>
#include <vector>
using  namespace std;
int main() {
    int  n;
    cin>>n;

    int temp;
    cin>>temp;
    int min=temp;
    int cnt=1;
    for (int i = 0; i < n-1; ++i) {
        cin>>temp;
        if(temp<=min){
            cnt++;
            min=temp;
        }
    }
    cout<<cnt<<endl;
    return 0;
}

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

int main() {
    const int MOD = 1e9 + 7;
    int n;
    cin >> n;

    ll ans = 1;
    for (int i = 1; i <= n; i++) {
        ans = (ans * i) % MOD;
    }

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


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<algorithm>
#include<string>

using namespace std;

const int MAX = 101;

int main(){
  int N,M;
  int x[MAX],y[MAX];

  cin >> N >> M >> x[0] >> y[0];
  for(int i = 1;i <= N;i++){
    cin >> x[i];
  }
  for(int i = 1;i <= M;i++){
    cin >> y[i];
  }

  sort(x,x+N+1);
  sort(y,y+M+1);

  if(x[N] < y[0])cout << "No War" << endl;
  else cout << "War" << endl;
  
  return 0;
}


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

int main() {
  int n, k;
  cin >> n >> k;
  vector<long long> v(n);
  for(int i=0; i < n; i++) cin >> v[i];
  sort(v.rbegin(), v.rend());
  
  if(n <= k) cout << 0 << endl;
  else {
    long long total = 0;
    for(int i=k; i < v.size(); i++) total += v[i];
    cout << total << endl;
  }
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
int main(int argc, char* argv[]) {
    double h,a;
    cin >> h >> a;
    cout << ceil(h/a) << endl;
    return 0;
}


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



Measured memory_bytes: 2044
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define LLINF 1000000000000000ll
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
#define dmp(x) cerr << __LINE__ << " " << #x << " " << x << 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;}
template<class T,class U>
ostream& operator << (ostream& os,pair<T,U>& p){
	os << p.fi << ',' << p.sec; return os;
}
template<class T,class U>
istream& operator >> (istream& is,pair<T,U>& p){
	is >> p.fi >> p.sec; return is;
}
template<class T>
ostream& operator << (ostream &os,const vector<T> &vec){
	for(int i=0;i<vec.size();i++){
		os << vec[i];
		if(i+1<vec.size())os << ' ';
	}
	return os;
}
template<class T>
istream& operator >> (istream &is,vector<T>& vec){
	for(int i=0;i<vec.size();i++)is >> vec[i];
	return is;
}
void fastio(){
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout<<fixed<<setprecision(20);
}
int N;
string s;
int x = 0, y = 0;
int main(){
	cin >> N;
	cin >> s;
	for(int i=0;i<N;i++){
		if('A'<=s[i]&&s[i]<='M')x++;
		if('N'<=s[i]&&s[i]<='Z')x--;
		if('a'<=s[i]&&s[i]<='m')y++;
		if('n'<=s[i]&&s[i]<='z')y--;
	}
	cout << abs(x)+abs(y) << endl;
	for(int i=0;i<x;i++){
		cout << 'A';
	}
	for(int i=0;i<-x;i++){
		cout << 'N';
	}
	for(int i=0;i<y;i++){
		cout << 'a';
	}
	for(int i=0;i<-y;i++){
		cout << 'n';
	}
	cout << endl;
	return 0;
}



Measured memory_bytes: 3340
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

//#define LOCAL 0
//#ifdef LOCAL
//#define DEBUG(s) cout << (s) << endl
//#define dump(x)  cerr << #x << " = " << (x) << endl
//#define BR cout << endl;
//#else
//#define DEBUG(s) do{}while(0)
//#define dump(x) do{}while(0)
//#define BR
//#endif


//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30)
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007
//ここから編集する
int W, H;

bool check(int w, int h) {
    return w >= 0 && h >= 0 && w < W && h < H;
}

void dfs(int w, int h, vector<vector<int> > &v) {
    if (check(w, h)) {
        if (v[h][w] != 1) return;
        v[h][w] = 2;
//        dfs(w+1,h,v);
//        dfs(w,h+1,v);
//        dfs(w-1,h,v);
//        dfs(w,h-1,v);
        for (int i = h - 1; i <= h + 1; i++) {
            for (int j = w - 1; j <= w + 1; j++) {
                dfs(j, i, v);
            }
        }
    } else {
        return;
    }
}

void solve(int w, int h) {
    W = w;
    H = h;
    vector<vector<int> > v(h, vector<int>(w, 0));
    rep(i, 0, h) {
        rep(j, 0, w) {
            cin >> v[i][j];
        }
    }
    int ans = 0;
    rep(i, 0, h) {
        rep(j, 0, w) {
            if (v[i][j] == 1) {
                ans++;
                dfs(j, i, v);
            }
        }
    }
    cout << ans << endl;
}

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

    while (true) {
        int w, h;
        cin >> w >> h;
        if (w == 0) break;
        solve(w, h);
    }


    return 0;
}



Measured memory_bytes: 3280
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
const ll INF = 1e9 + 7;
typedef pair<int,int> P;// pair型は２つの値の組を表せる

int main(){
    int N; cin >> N;
    vector <int> A(N);
    int tmp=0;
    int ans=0;
    rep(i,N){
        cin >> A[i];
        if (A[i]%2==0){
            tmp++;
            if (A[i]%3==0 || A[i]%5==0) ans++;
        }
    }
    if (tmp==ans) cout << "APPROVED";
    else cout << "DENIED";
}

Measured memory_bytes: 256
n = int(input())
s = input()
def kinds(x,y):
    cnt = {}
    res = 0
    for s in x:
        if s not in cnt:cnt[s] = 1
        else:cnt[s]+=1
    c = {}
    for s in y:
        if s not in c and s in cnt:
            res+=1
            c[s] = 1
    return res
ans = 0
for i in range(n-1):
    ans = max(ans,kinds(s[:i+1],s[i+1:]))
    
    
print(ans)

Measured memory_bytes: 3064
#include<stdio.h>
#include<math.h>

int main(void){
	double pi,a,b,c,s,l,h,rad,x;
	scanf("%lf %lf %lf",&a,&b,&c);
	pi=acos(-1);
	rad=(c/(double)180)*pi;
	s=a*b*sin(rad)*0.5;
	x=sqrt(a*a+b*b-(double)2*a*b*cos(rad));
	l=a+b+x;
	h=(double)2*(s/a);
	printf("%f\n%f\n%f\n",s,l,h);
return 0;
}

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

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

  vector<int> h(n);
  int count = 0, temp = 0;
  cin >> h.at(0);
  for (int i = 1; i < n; i++) {
    cin >> h.at(i);
    if (h.at(i) <= h.at(i-1)) {
      count++;
    }
    else {
      temp = max(temp, count);
      count = 0;
    }
  }
  temp = max(temp, count);

  cout << temp << endl;
}


Measured memory_bytes: 640
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

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

const ll INF=1e18;

int main(){
    ll x,t;
    cin >> x >> t;
    cout << max(x-t,0LL) << endl;
}

Measured memory_bytes: 3560
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double db;
#define fi first
#define se second
#define pi pair<ll,ll>
#define pii pair<ll,pi>
#define pb push_back
#define mk make_pair
int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin >> n;
	vector<double>v(n + 1);
	for (int i = 1; i <= n; i++) {
		cin >> v[i];
	}
	vector<vector<double>>dp(n + 1, vector<double>(n + 1, 0));
	//dp[i][j] ->gettin j head with first i coin;
	dp[0][0] = 1.0;
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j <= i; j++) {
			if (j == 0)
				dp[i][j] = (1 - v[i]) * dp[i - 1][j];
			else {
				dp[i][j] = dp[i - 1][j] * (1.0 - v[i]) + dp[i - 1][j - 1] * v[i];
			}
		}
	}
	double ans = 0.0;
	for (int i = 0; i <= n; i++) {
		if (i > (n - i))
			ans += dp[n][i];
	}
	cout << fixed << setprecision(10) << ans << endl;
}

Measured memory_bytes: 73760
S = input().strip()
K = int(input())

counts = []
prev = S[0]
count = 1
for c in S[1:]:
	if prev == c:
		count += 1
	else:
		counts.append(count)
		count = 1
	prev = c
if count > 0:
	counts.append(count)

total = 0
if len(counts) == 1:
	total += (counts[0] * K) // 2
elif K > 1 and S[0] == S[-1]:
	for count in counts[1:-1]:
		total += (count // 2) * K
	total += counts[0] // 2
	total += counts[-1] // 2
	total += ((counts[0] + counts[-1]) // 2) * (K - 1)
else:
	for count in counts:
		if count > 1:
			total += (count // 2) * K
print(total)



Measured memory_bytes: 3064
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <assert.h>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main(){
  ll n;
  cin>>n;
  string s;
  while(n>0){
    n--;
    s += n%26+'a';
    n/=26;
  }
  reverse(all(s));
  cout << s << endl;
  return 0;
}

Measured memory_bytes: 3632
#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 rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a)  memset(a, 0, sizeof (a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

void pre(){


}

void solve(){


}

int main() {
	cin.sync_with_stdio(0); cin.tie(0);
	cin.exceptions(cin.failbit);
	pre();
	string s;cin>>s;
	trav(i,s) if(i=='?') i='D';
	cout<<s;
	return 0;
}



Measured memory_bytes: 3748
#include<iostream>
#include<vector>
using namespace std;
long long INF=100000000000000;

int main(){

  long long N, W, i, j, Vsum=0;
  cin>>N>>W;
  vector<long long> v(N), w(N);
  for(i=0; i<N; i++){
    cin>>w[i]>>v[i];
    Vsum+=v[i];
  }
  vector<vector<long long>> dp(N+1, vector<long long>(Vsum+1, INF));

  dp[0][0]=0;
  for(i=0; i<N; i++){
    for(j=0; j<Vsum+1; j++){
      if(j+v[i]<=Vsum){
        dp[i+1][j+v[i]]=min(dp[i+1][j+v[i]], dp[i][j]+w[i]);
        dp[i+1][j]=min(dp[i][j], dp[i+1][j]);
      }else{
        dp[i+1][j]=min(dp[i][j], dp[i+1][j]);
      }
    }
  }
  
  long long ans=Vsum;
  while(dp[N][ans]>W)ans--;
  cout<<ans<<endl;
  
  return 0;
}

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

int main()
{
    int N;
    cin >> N;
    int ans = 0;
    for (int C = 1; C <= N; C+=2){
        int num=0;
        for (int X = 1; X <= C; ++X){
            if( C%X == 0){
                ++num;
            }
        }
        if( num == 8 ){
            ++ans;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<string>
#include<map>
#include<vector>
using namespace std;
typedef long long ll;
const int maxn = 15;
const int inf = 0x3f3f3f3f;
int a[maxn];
int n, k;
bool check(int n) 
{
	for (int i = 1; i <= k; ++i)
		if (n == a[i])
			return false;
	return true;
}
int main() 
{
	scanf("%d %d", &n, &k);
	for (int i = 1; i <= k; ++i)
		scanf("%d", &a[i]);
	for (int i = n;; ++i) 
	{
		int j = i;
		int aa;
		while (j > 0) {
			aa = j % 10;
			if (!check(aa))
			{
				break;
			}
			j /= 10;
		}
		if (j == 0) 
		{
			printf("%d\n", i);
			break;
		}
	}

	return 0;
}

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

using namespace std;
int main() {
    int n,r;
    cin>>n>>r;
    if(n>=10)
        cout<<r;
    else{
        int c=(10-n)*100;
        c+=r;
        cout<<c;
    }
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  char c;
  cin >> c;
  
  if(c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o')
    cout << "vowel" << endl;
  
  else
    cout << "consonant" << endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 13 13:52:16 2020

@author: Kanaru Sato
"""

n = int(input())
a = []
proof = []

for i in range(n):
    a.append(int(input()))
    p = [list(map(int, input().split())) for j in range(a[-1])]
    proof.append(p)

honest = 0

for state in range(2**n):   #状態stateを用意
    flag = 0
    for j in range(n):
        if flag == 1:
            break
        if state&(0b1<<j):    #状態stateにおいてj人目が正直か判定
            for k in range(a[j]):
                proofee = proof[j][k][0]-1
                if bool(state&(0b1<<proofee)) != (proof[j][k][1]):   #j人目のK番目の証言について、stateと一致しなければ次のstateへ移る
                    flag = 1    #不成立フラグ
                    break
    if flag == 0:
        count = 0
        for i in range(n):
            count += (state>>i)&0b1
        if honest <= count:
            honest = count
print(honest)


Measured memory_bytes: 3188
X, Y, A, B, C = map(int, input().split())
red = list(map(int,input().split()))
green = list(map(int,input().split()))
trans = list(map(int,input().split()))

red.sort(reverse=True)
green.sort(reverse=True)
trans.sort(reverse=True)
apple = red[:X] + green[:Y]
apple.sort()

j = 0
for i in range(X + Y):
    if apple[i] < trans[j]:
        apple[i] = trans[j]
        j = j + 1
        if j == C:
            break
    else:
        continue
print(sum(apple))

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define sf scanf
#define pf printf
#define pb push_back
#define mp make_pair
#define PI ( acos(-1.0) )
#define mod 998244353LL
#define IN freopen("C.in","r",stdin)
#define OUT freopen("output.txt","w",stdout)
#define FOR(i,a,b) for(i=a ; i<=b ; i++)
#define DBG pf("Hi\n")
#define INF 1000000000
#define i64 long long int
#define eps (1e-8)
#define xx first
#define yy second
#define ln 17
#define off 2

using namespace __gnu_pbds;
using namespace std ;

typedef tree< i64, null_type, less<i64>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef pair<i64, i64> pii;

#define maxn 1000005
const int N = 1000000 ;

multiset<int> ms ;

int solve( vector <int> v )
{
    if( v.size() == 0  ) return 0 ;
    ms.clear() ;
    vector <int> toSend ;
    for(int i=0 ; i<v.size() ; i++)
    {
        if( v[i]%2==1 ) ms.insert(  v[i] ) ;
        else toSend.pb( v[i]/2 ) ;
    }
    int ans = 0 ;

    while( !ms.empty() )
    {
      multiset<int> :: iterator it = ms.end() ;
      it-- ;
      int val = *it ;
      ms.erase(it) ;
      if( ms.empty() ) break ;
      int p = 1 ;
      while( 1 )
      {
          if( p <= val )
          {
              p *= 2 ;
              continue ;
          }
          if( ms.find( p-val ) != ms.end() )
          {
              ans++ ;
              ms.erase( ms.find( p-val ) ) ;
          }
          break ;
      }
    }
    ans += solve(toSend) ;
    return ans ;
}

int main()
{
    int i , j , k , l , m , n ;

    vector <int> v ;

    scanf("%d",&n) ;
    for(i=1 ; i<=n ; i++)
    {
        scanf("%d",&m) ;
        v.pb(m) ;
    }

    int ans = solve(v) ;

    printf("%d\n",ans) ;

    return 0 ;
}


Measured memory_bytes: 56692
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <iostream>
#include <algorithm>

typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;
typedef double              DOUBLE;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
#define rep(i,a,b) for(int (i)=int(a);(i)<int(b);(i)++)

#define INF = 1e9;
#define MOD = 1e9+7;
#define INF64 = 1e18;


using namespace std;

int main() {

	SINT32 A,B,C;
	SINT32 X,Y;
	SINT32 ANS;

	cin >> A>>B>>C;
	cin >> X>>Y;

	ANS = A*X + B*Y;

	if (X>Y) {
		ANS = MIN(ANS, (X-Y)*A + 2*Y*C);
		ANS = MIN(ANS, 2*X*C);

	} else {
		ANS = MIN(ANS, (Y-X)*B + 2*X*C);
		ANS = MIN(ANS, 2*Y*C);
	}
	

	cout << ANS << endl;
	return 0;
}

//	sort(DATA.begin(),DATA.end());
//	sort(DATA.begin(),DATA.end(),std::greater<SINT32>());
//	__gcd(ANS,DATA[i]);

//	// DATA.emplace_back(BUF);	//後ろに追加

//  DATA.erase(std::unique(DATA.begin(), DATA.end()), DATA.end());

//	DATA.insert(DATA.begin() + X, 0);	//X番目の要素に0を挿入


//	vector<vector<SINT32>> DP(N,vector<SINT32>(3));　//2次元配列

/*
	SINT32 M = 3;
	vector<pair<SINT32,SINT32>> DATA2(M);
	for (SINT32 i = 0; i < M; i++) {
		cin >> DATA2[i].first;
		cin >> DATA2[i].second;
	}
	sort(DATA2.begin(),DATA2.end());
	cout << DATA2[0].first << endl;
	cout << DATA2[0].second << endl;
*/

// 	vector<pair<int,pair<int,int>>> DATA(M);
//	cin >> DATA[i].first;
//	cin >> DATA[i].second.first;
//	cin >> DATA[i].second.second;


//		APOSI = lower_bound(ADATA.begin(),ADATA.end(),QDATA[i]) - ADATA.begin();
//		BPOSI = lower_bound(BDATA.begin(),BDATA.end(),QDATA[i]) - BDATA.begin();


/* 文字列回転
	string N;
	cin >> N;
	N = N[N.length()-1] + N.substr(0,N.length()-1);
*/

/* SET コンテナ
	set<SINT32> DATA;
	for (SINT32 i = 0; i < N; i++) {
		SINT32 buf;
		cin >> buf;
		DATA.insert(buf);
	}

	//全表示
    set<string>::iterator it; //  イテレータを用意
    for(it = DATA.begin(); it != DATA.end(); it++) {
        cout << *it << endl;
    }

	//N番目を一部表示
	set<string>::iterator it; //  イテレータを用意
	it = DATA.begin();
	rep (i,0,N) {
		it++;
	}
	cout << *it << endl;
*/

/* map
	map<string,SINT32> mp;
	SINT32 N = 0;
	SINT32 mx = 0;

	cin >> N;
	for (SINT32 i = 0; i < N; i++) {
		string s;
		cin >> s;
		mp[s]++;
	}
	for(auto it=mp.begin();it!=mp.end();it++) {
		mx=max(mx,it->second);
	}

*/

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

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

int h, w;
int arr[100000];
vector<string> v;
int cnt=0;
int main() {
    int n; cin >> n;
    vector<int> v;
    for(int i=0; i<n; ++i){
        int a; cin >> a;
        v.push_back(a);
       
    }
    if(n%2==0){
        for(int i=n-1; i>=0; i-=2){
            cout << v[i] << " ";
        }
        for(int i=0; i<n; i+=2){
            cout << v[i] << " ";
        }
        cout << endl;
    }else{
        for(int i=n-1; i>=0; i-=2){
            cout << v[i] << " ";
        }
        for(int i=1; i<n; i+=2){
            cout << v[i] << " ";
        }
        cout << endl;
    }
    return 0;
}


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

A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

score = 0
prev_d = -1

for i in range(N):
    d = A[i] - 1
    score = score + B[d]

    if (prev_d >= 0) and (d - prev_d == 1):
        score = score + C[d-1]

    prev_d  = d

print(score)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define MAXN (100010)
using namespace std;
int n;
bool flag1 = true, flag2 = true;
int cnt1[MAXN], cnt2[MAXN];
vector<pair<int,int>> v1, v2;
int vv1[MAXN], vv2[MAXN];

bool cmp(const pair<int, int> &a, const pair<int, int> &b) {
    return a > b;
}

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) {
        if (i % 2) {
            scanf("%d", &vv1[i / 2]);
            cnt1[vv1[i / 2]]++;
            if (i > 1 && vv1[i / 2] != vv1[i / 2 - 1]) {
                flag1 = false;
            }
        } else {
            scanf("%d", &vv2[i / 2 - 1]);
            cnt2[vv2[i / 2 - 1]] ++;
            if (i > 2 && vv2[i / 2 - 1] != vv2[i / 2 - 2]) {
                flag2 = false;
            }
        }
    }
    if (flag1 && flag2) {
       if (vv1[0] == vv2[0]) {
           printf("%d", n / 2);
           return 0;
       } else {
           printf("0");
           return 0;
       }
    } else {
        for (int j = 0; j < MAXN; ++j) {
            if (cnt1[j]) {
                v1.emplace_back(cnt1[j], j);
            }
            if (cnt2[j]) {
                v2.emplace_back(cnt2[j], j);
            }
        }
        sort(v2.begin(), v2.end(), cmp);
        sort(v1.begin(), v1.end(), cmp);
        if (v1[0].second == v2[0].second) {
            printf("%d\n", min(n - v1[0].first - v2[1].first, n - v1[1].first - v2[0].first));
            return 0;
        } else {
            printf("%d\n", n - v1[0].first - v2[0].first);
            return 0;
        }
    }

    return 0;
}
/*
 12
 3 3 3 3 3 3 2 1 2 1 1 1
 */


Measured memory_bytes: 2428
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <iomanip>
using namespace std;
 
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
typedef long long ll;

struct LowLink {
    
    vector < vector < int > > G;
    vector < int > ord, low;
    vector < bool > used;
    vector < pair < int, int > > bridge;
    vector < int > articulation_point;
    const int INF = 1145141919;
    
    LowLink (int n) : G(n), ord(n), low(n), used(n) {}
    
    void add_edge(int a, int b) {
        G[a].push_back(b);
        G[b].push_back(a);
    }
    
    void build(int root) {
        fill(low.begin(), low.end(), INF);
        fill(used.begin(), used.end(), false);
        dfs(root, -1, 1);
    }
    
    int dfs(int v, int prev, int cnt) {
        used[v] = true;
        low[v] = ord[v] = cnt;
        int min_low = cnt;
        int route = 0;
        bool isArticulation = false;
        for (int i = 0; i < G[v].size(); i++) {
            if (!used[G[v][i]]) {
                route++;
                int low_nxt = dfs(G[v][i], v, cnt + 1);
                min_low = min(min_low, low_nxt);
                if (ord[v] < low_nxt) {
                    bridge.push_back(make_pair(v, G[v][i]));
                }
                if (prev != -1 && G[v].size() >= 2 && low_nxt >= cnt) {
                    isArticulation = true;
                }
            } else if (G[v][i] != prev) {
                min_low = min(min_low, low[G[v][i]]);
            }
        }
        if (prev == -1 && route > 1) isArticulation = true;
        if (isArticulation) articulation_point.push_back(v);
        return low[v] = min_low;
    }
    
};


int main() {

    int V,E; cin >> V >> E;
    LowLink inst(100010);

    REP(i,E) {
        int a,b; cin >> a >> b;
        inst.add_edge(a, b);
    }

    inst.build(0);

    sort(inst.articulation_point.begin(), inst.articulation_point.end());

    REP(i,inst.articulation_point.size()) {
        cout << inst.articulation_point[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 7280
n = int(input())
xy = []

for _ in range(n):
    x, y = map(int, input().split())
    xy.append([x, y])

dist = 0

for i in range(n):
    for j in range(n):
        if i != j:
            dist += (((xy[i][0] - xy[j][0])**2 + (xy[i][1] - xy[j][1])**2)**0.5)/n

print(dist)

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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

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

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

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

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

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

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

int main(){
    string s;
    cin >> s;
    string ans;
    if (s=="ABC") ans = "ARC";
    else ans = "ABC";
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Vec = vector<ll>;
#define REP(i, m, n) for(ll i = (m); i < (n); ++i)
#define rep(i, n) REP(i, 0, n)
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}
constexpr ll LINF = 1e18+1;
constexpr ll MOD = 1e9+7;

int main(void) {
	ll n, m;
	while(true){
	cin >> n >> m;
	if(n == 0 && m == 0) break;
	Vec a(n);
	rep(i, n) cin >> a[i];
	sort(a.begin(), a.end());

	ll ans = 0;
	rep(i, n){
		if(a[i] > m) break;
		auto p = upper_bound(a.begin(), a.end(), m - a[i]) - a.begin();
		if(p == 0) continue;
		--p;
		if(i == p) continue;
		chmax(ans, a[i] + a[p]);
	}
	if(ans != 0) cout << ans << endl;
	else cout << "NONE" << endl;
	}

	return 0;
}



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

// ------------ Extended Euclid Algorithm (Update 8/7) ------------ //
template<class T>
inline void extgcd(long long a, long long b, T &x, T &y) {
	long long r0 = a, r1 = b, r2;
	long long a0 = 1, a1 = 0, a2;
	long long b0 = 0, b1 = 1, b2;
	long long q1;
	while (r1 > 0) {
		q1 = r0 / r1;
		r2 = r0 - q1 * r1;
		a2 = a0 - q1 * a1;
		b2 = b0 - q1 * b1;
		r0 = r1, r1 = r2;
		a0 = a1, a1 = a2;
		b0 = b1, b1 = b2;
	}
	x = a0;
	y = b0;
}

int a, b, x, y;
int main() {
	cin >> a >> b;
	extgcd(a, b, x, y);
	cout << x << ' ' << y << endl;
	return 0;
}

Measured memory_bytes: 3076
#include <stdio.h>

void init(int* h, int* w, int c[][10], int a[][210]) {
  int i, j;
  scanf("%d%d", h, w);
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      scanf("%d", &c[i][j]);
    }
  }
  for (i = 0; i < *h; i++) {
    for (j = 0; j < *w; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  return;
}

void warshall_floyd(int c[][10]) {
  int k, i, j;
  for (k = 0; k < 10; k++) {
    for (i = 0; i < 10; i++) {
      for (j = 0; j < 10; j++) {
	if (c[i][j] > c[i][k] + c[k][j]) {
	  c[i][j] = c[i][k] + c[k][j];
	}
      }
    }
  }
  return;
}

void ans(int h, int w, int c[][10], int a[][210]) {
  int i, j;
  int ans = 0;
  for (i = 0; i < h; i++) {
    for (j = 0; j < w; j++) {
      if (a[i][j] != -1) {
	ans += c[a[i][j]][1];
      }
    }
  }
  printf("%d\n", ans);
  return;
}

void solve() {
   int h, w, i, j;
   int c[10][10];
   int a[210][210];
   init(&h, &w, c, a);
   warshall_floyd(c);
   ans(h, w, c, a);
   return;
}

int main() {
  solve();
}

/*
2 4
0 9 9 9 9 9 9 9 9 9
9 0 9 9 9 9 9 9 9 9
9 9 0 9 9 9 9 9 9 9
9 9 9 0 9 9 9 9 9 9
9 9 9 9 0 9 9 9 9 2
9 9 9 9 9 0 9 9 9 9
9 9 9 9 9 9 0 9 9 9
9 9 9 9 9 9 9 0 9 9
9 9 9 9 2 9 9 9 0 9
9 2 9 9 9 9 9 9 9 0
-1 -1 -1 -1
8 1 1 8

5 5
0 999 999 999 999 999 999 999 999 999
999 0 999 999 999 999 999 999 999 999
999 999 0 999 999 999 999 999 999 999
999 999 999 0 999 999 999 999 999 999
999 999 999 999 0 999 999 999 999 999
999 999 999 999 999 0 999 999 999 999
999 999 999 999 999 999 0 999 999 999
999 999 999 999 999 999 999 0 999 999
999 999 999 999 999 999 999 999 0 999
999 999 999 999 999 999 999 999 999 0
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1

3 5
0 4 3 6 2 7 2 5 3 3
4 0 5 3 7 5 3 7 2 7
5 7 0 7 2 9 3 2 9 1
3 6 2 0 2 4 6 4 2 3
3 5 7 4 0 6 9 7 6 7
9 8 5 2 2 0 4 7 6 5
5 4 6 3 2 3 0 5 4 3
3 6 2 3 4 2 4 0 8 9
4 6 5 4 3 5 3 2 0 8
2 1 3 4 5 7 8 6 4 0
3 5 2 6 1
2 5 3 2 1
6 9 2 5 6

*/


Measured memory_bytes: 384
from sys import stdin
import math


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  # type:int
    S_arr = []
    for i in range(N):
        S = _in[i+1]   # type:str
        S_arr.append(S)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(len(set(S_arr)))


Measured memory_bytes: 124196
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>

using namespace std;

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

    int even = (n*(n-1)) / 2;
    int odd = (m*(m-1) / 2);

    cout << even +  odd << endl;

}

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

#define readv(v) for(auto& var : v) cin >> var;
#define printv(v) for (int var = 0; var < v.size(); var++) cout << (var==0 ? "" : " ") << v[var]; cout << endl;
#define queries(var) int var; cin >> var; while (var--) 
#define use_fast ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)

using ll = long long int;
using vi = vector<ll>;
using vvi = vector<vi>;

int main(){
    int x = 1e6, ans = 0;
    queries(N) {
        int p; cin >> p;
        if (p <= x) {
            x = p;
            ans++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int (i)=0;(i) < (N); (i)++)
#define all(V) V.begin(), V.end()
using i64 = int_fast64_t;
using P = pair<i64,i64>;



int main(){
    vector<int> e(12);
    rep(i,12) cin >> e[i];

    sort(all(e));
    bool ok = true;
    
    auto check = [&](int a, int b){
        for(int i=a;i<b;i++) {
            if(e[i] != e[a]) return false;
        }
        return true;
    };

    ok &= check(0,4);
    ok &= check(4, 8);
    ok &=  check(8, 12);

    if(ok) cout << "yes" << endl;
    else cout << "no" << endl;
}



Measured memory_bytes: 3144
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;

int main(){
  int n,k;
  cin >> n >> k;
  vi a(n);
  rep(i,n) cin >> a[i];
  int ans=300000005;
  rep(i,n-k+1){
    if(a[i]<0){
      if(a[i+k-1]<0){
        ans=min(ans,-1*a[i]);
      }
      else{
        int m=min(-1*a[i],a[i+k-1]),M=max(-1*a[i],a[i+k-1]);
        ans=min(ans,2*m+M);
      }
    }else{
      ans=min(ans,a[i+k-1]);
    }
  }
  cout << ans;
  return 0;
}

Measured memory_bytes: 3660
#include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

int N;
vector<vector<int>>rems;

int dy[6] = { 0,1,1,0,-1,-1 };
int dx[6] = { -1,0,1,1,0,-1 };

bool breath(const vector<vector<int>>&tri, const int y, const int x,const int num) {
	if (tri[y][x] == 0)return false;
	if (tri[y][x] != num)return true;
	if (rems[y][x] == -2)return true;
	if (rems[y][x] != -1)return rems[y][x];
	int pre = rems[y][x];
	rems[y][x] = -2;
	bool rem = true;
	for (int i = 0; i < 6; ++i) {
		int ny = y + dy[i]; int nx = x + dx[i];
		if (ny >= 0 && ny < N&&nx >= 0 && nx <= ny) {
			rem &= breath(tri, ny, nx, num);
		}
	}
	rems[y][x] = pre;
	return rem;
}

vector<int>check(const vector<vector<int>>&tri) {
	rems.clear();
	rems.resize(N);
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < i + 1; ++j) {
			rems[i].push_back(-1);
		}
	}

	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < i + 1; ++j) {
			if (rems[i][j] == -1&&tri[i][j]) {
				rems[i][j]=breath(tri,i,j,tri[i][j]);
			}
		}
	}
	vector<int>remnum(10);
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < i + 1; ++j) {
			if (rems[i][j] == 1) {
				remnum[tri[i][j]]++;
			}
		}
	}
	return remnum;
}

int main() {
	while (1) {
		int C; cin >> N >> C;
		if (!N)break;
		vector<vector<int>>tri(N);
		for (int i = 0; i < N; ++i) {
			for (int j = 0; j < i + 1; ++j) {
				int a; cin >> a;
				tri[i].push_back(a);
			}
		}
		int ans = -9999;
		for (int i = 0; i < N; ++i) {
			for (int j = 0; j < i + 1; ++j) {
				if (tri[i][j]) {

				}
				else {
					tri[i][j] = C;
					vector<int>rems(check(tri));
					int nowans = 0;
					for (int i = 0; i < rems.size(); ++i) {
						if (i == C)nowans -= rems[i];
						else nowans += rems[i];
					}
					ans = max(ans, nowans);

					tri[i][j] = 0;
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}

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

int main(){
  int N;
  cin >> N;
  vector<string> S(N);
  
  for(int i = 0; i<N;i++){
    cin >> S[i];
    if(i > 0){
      if(S[i-1][S[i-1].size()-1] != S[i][0]){
        cout << "No" << endl;
        return 0;
      }
    }
  }
  
 
  sort(S.begin(),S.end());
  S.erase(unique(S.begin(), S.end()), S.end());
  
  if(N != S.size()){
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
  
}

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

int main() {
  int n, m; cin >> n >> m;
  vector<string> a(n), b(m);
  for (auto& e: a) cin >> e;
  for (auto& e: b) cin >> e;

  for (int i = 0; i <= n - m; i++) {
    for (int j = 0; j <= n - m; j++) {
      bool isInclude = true;
      for (int k = 0; k < m; k++) {
        if (a.at(i + k).substr(j, m) != b.at(k)) isInclude = false;
      }
      if (isInclude) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 256