akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
using namespace std;

int main() {
	long long int n,m,a,b,c,d,e;
	long double z,w;
	string str;
	char ch;
	long long int x[130]={};
	cout << fixed << setprecision(10);
	cin>>a>>b;
	if(a%b==0){cout<<0;}
	else{cout<<1;}
	
	


	cout<<endl;
} 


Measured memory_bytes: 256
attrs = Array.new
while line = $stdin.gets
  attrs << line.chomp.split
end

N, M = attrs[0].map(&:to_i)
result = {}
ac = 0
wa = 0
M.times do |i|
  p = attrs[i+1][0].to_i
  s = attrs[i+1][1]
  unless result.has_key?(p) then
    result[p] = {done: false, wa: 0}
  end
  info = result[p]
  next if info[:done] == true
  if s == 'AC' then
    info[:done] = true
    ac += 1
    wa += info[:wa]
  else
    info[:wa] += 1
  end
  result[p] = info
end
puts "#{ac} #{wa}"

Measured memory_bytes: 49404
#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s,pre="",cur="";
	cin>>s;
	int l=s.length(),i=1,cnt=1;
	pre=s[0];
	while(i<l)
	{
		cur+=s[i++];
		if(cur==pre)
		{
			if(i==l) cnt--;
			else
			cur+=s[i++];
		}
		//cout<<pre<<" "<<cur<<endl;
		pre=cur;	
		cur="";
		cnt++;
	}
	cout<<cnt;
	return 0;
}

Measured memory_bytes: 640
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <bits/stdc++.h>
using namespace std;

struct Node {
    int key;
    Node *next, *prev;
};

Node *nil;

Node* Search(int key) {
    Node *cur = nil -> next;
    while(cur != nil && cur -> key != key){
        cur = cur -> next;
    }
    return cur;
}

void Init(){
    nil = (Node*)malloc(sizeof(Node));
    nil -> next = nil;
    nil -> prev = nil;
}

void Print() {
    Node *cur = nil -> next;
    int isf = 0;
    while(1){
        if(cur == nil)  break;
        if(isf++ > 0)  printf(" ");
        printf("%d", cur -> key);
        cur = cur -> next;
    }
    cout << endl;
}

void DeleteList(Node *t) {
    if(t == nil)    return;
    t -> prev -> next = t -> next;
    t -> next -> prev = t -> prev;
    free(t);
}

void DeleteFirst() {
    DeleteList(nil -> next);
}

void DeleteLast() {
    DeleteList(nil -> prev);
}

void DeleteKey(int key) {
    DeleteList(Search(key));
}

void Insert(int key) {
    Node *x = (Node*)malloc(sizeof(Node));
    x -> key = key;
    x -> next = nil -> next;
    nil -> next -> prev = x;
    nil -> next = x;
    x -> prev = nil;
}

int main(void){
    int key, n;
    char com[20];
    scanf("%d", &n);
    Init();
    for(int i = 0; i < n; i++){
        scanf("%s%d", com, &key);
        if(com[0] == 'i'){
            Insert(key);
        }
        else if(com[0] == 'd'){
            if(strlen(com) > 6){
                if(com[6] == 'F')   DeleteFirst();
                else if(com[6] == 'L')  DeleteLast();
            }
            else{
                DeleteKey(key);
            }
        }
    }
    Print();
    
    return 0;
}



Measured memory_bytes: 34540
# ans
N = int(input())
a = list(map(int, input().split()))

ans = [0] * 100000

for i in range(len(a)):
  if a[i] != 0:
    ans[a[i]-1] += 1
  ans[a[i]] += 1
  if a[i] != 99999:
    ans[a[i]+1] += 1
  
print(max(ans))

Measured memory_bytes: 14008
#include <stdio.h>

int main(void)
{
	int a, b, e, f, k, i;

  scanf("%d %d %d", &a, &b, &k);
	e = a;
	f = b - (k-1);
  for (i = 0; i < k; i++) {
		if(e <= b){
			printf("%d\n", e);
		}
		e++;
  }

  for (i = 0; i < k; i++) {
		if(f >= e){
			printf("%d\n", f);
		}
		f++;
    }

return 0;
}


Measured memory_bytes: 128
#include "bits/stdc++.h"
#include <unordered_set>

#define _CRT_SECURE_NO_WARNINGS

#define REP(i, n) for(decltype(n) i = 0; i < (n); i++)
#define REP2(i, x, n) for(decltype(x) i = (x); i < (n); i++)
#define REP3(i, x, n) for(decltype(x) i = (x); i <= (n); i++)
#define RREP(i, n) for (decltype(n) i = (n) - 1; i >= 0; i--)

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

using namespace std;

// N, E, S, W
const int dx[4] = { 1, 0, -1, 0};
const int dy[4] = { 0, 1, 0, -1};

using LL = long long int;
using LD = long double;

const int INF = (1 << 30) - 1;
const LL INF64 = ((LL)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;

using pii = pair<int, int>;
using pll = pair<LL, LL>;
using pdd = pair<double, double>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vl = vector<LL>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using vd = vector<double>;
using vs = vector<string>;
using vb = vector<bool>;

//==============================================

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

	int a, b, h;
	cin >> a >> b >> h;

	cout << (a + b) * h / 2 << "\n";
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ll long long
#define inf 0x3f3f3f3f
#define fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int N = 3e5+10;
const ll mod =   1e9+7;

int main()
{  fast
char ch;
cin>>ch;
if(ch-'Z'<=0)
cout<<"A";
else
cout<<"a";

}

Measured memory_bytes: 3644
//
//  MAIN.cpp
//
//  Created by Sultan.
//  Copyright © 2017 Sultan. All rights reserved.
//

#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>

#define ll long long
#define ioi exit(0);

#define inf int(1e9)

#define f first
#define s second

#define NFS ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);

#define lb(x) lower_bound(x)
#define ub(x) upper_bound(x)

#define pb push_back
#define ppb(x) pop_back(x)

#define rep(x,y,z) for(int x=y;x<=z;x++)
#define per(x,y,z) for(int x=y;x>=z;x++)

using namespace std;

int n,m;

int main(){
    
    NFS
    
    cin >> n >> m;
    
    n = n * n;
    
    cout << n - m << endl;
    
    ioi
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <vector>
#include <algorithm>

using namespace std;

struct edge{
	int from;
	int to;
	double cost;
};

int a[10000];
int r[10000];

void init(){
	for(int i = 0;i < 10000;i++){
		a[i] = i;
		r[i] = 0;
	}
}

int find(int x){
	if(a[x] == x)
		return x;
	else
		return find(a[x]);
}

void unite(int x,int y){
	x = find(x);
	y = find(y);
	if(r[x] < r[y])
		a[x] = y;
	else{
		a[y] = x;
		if(r[x] == r[y])
			r[x]++;
	}
}

double dist(int x1,int y1,int x2,int y2){
	return sqrt((double)((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
}

/*int cmp(const void* a,const void* b){
	struct edge *ea = (struct edge *)a;
	struct edge *eb = (struct edge *)b;
	return eb->cost > ea->cost;
}*/

bool cmp(const edge& l,const edge& r){
	return l.cost > r.cost;
}

int main(void){
	int n, m, x[10000], y[10000], p, q, i, j, c;
	double s;
	struct edge one;
	vector<struct edge> e;
	scanf("%d%d",&n,&m);
	for(i = 0;i < n;i++)
		scanf("%d%d",&x[i],&y[i]);
	s = 0;
	for(i = 0;i < m;i++){
		scanf("%d%d",&p,&q);
		e.push_back(one);
		e[i].from = p - 1,e[i].to = q - 1;
		s += e[i].cost = dist(x[p - 1],y[p - 1],x[q - 1],y[q - 1]);
	}
	sort(e.begin(),e.end(),cmp);
//	qsort(e,m,sizeof(e[0]),cmp);
	c = 0;
	init();
	for(i = 0;i < n;i++)
		if(i == a[i]) c++;
	for(i = 0;i < m && c != 1;i++){
		if(find(e[i].from) != find(e[i].to)){
			unite(e[i].from,e[i].to);
			s -= e[i].cost;
		}
		c = 0;
		for(j = 0;j < n;j++)
			if(j == a[j]) c++;
	}
	printf("%.3f\n",s);
	return 0;
}

Measured memory_bytes: 1732
// {{{
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
// }}}

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;

static constexpr int mod = (int)1e9 + 7;
static constexpr int inf = 100100100;
static constexpr ll linf = 1e18;
static constexpr double eps = 1e-9;
static constexpr double pi = 3.14159265359;

#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rrep(i, n) for (ll i = n; i >= 0; --i)
#define all(c) begin(c), end(c)
#define rall(c) rbegin(c), rend(c)
#define pb push_back
#define ist insert
#define fst first
#define snd second


int main() {
    // cin.tie(0);
    // ios_base::sync_with_stdio(false);
    ll N, M;
    cin >> N >> M;
    vector<pair<ll, ll>> V;
    rep (i, N) {
        ll A, B;
        cin >> A >> B;
        V.pb({A, B});
    }
    sort(all(V));
    ll ans = 0;
    for (auto&& v : V) {
        if (M > v.snd) {
            ans += v.fst * v.snd;
            M -= v.snd;
        } else {
            ans += v.fst * M;
            break;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 2420
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

X, Y, A, B, C = map(int, readline().split())
P = sorted(map(int, readline().split()), reverse=True)
Q = sorted(map(int, readline().split()), reverse=True)
R = sorted(map(int, readline().split()), reverse=True)

Z = sorted(P[:X] + Q[:Y] + R, reverse=True)
print(sum(Z[:X + Y]))

Measured memory_bytes: 28796
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, x] = [int(input_raw[0]), int(input_raw[1])]
    input_raw = read_func().strip().split()
    A = []
    for i in range(N):
        A.append(int(input_raw[i]))

    A.sort()

    for i in range(len(A)):
        x -= A[i]
        if x == 0:
            print i + 1
            return
        if x < 0:
            print i
            return

    print len(A) - 1



if __name__ == '__main__':
    main()

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

int main() {
	long long n,m,i,ans=0;
	cin >> n >> m;
	vector<double> a(n);
	double cur;
	for(i=0; i<n; i++){
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	while(m>0 && a[n-1]+0.0001>1){
		cur=a[n-1]/2.0+0.0001;
		i=n-1;
		while(i>=0 && a[i]>cur && m>0){
				a[i]/=2.0; i--; m--;
		}
		sort(a.begin(),a.end());
	}
	for(i=0; i<n; i++){
		ans+=floor(a[i]+0.0001);
	}
	cout << ans;
	
}

Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
using namespace std;
#define rep(i,ra,re) for((i)=ra;(i)<(re);(i)++)
#define rep_(i,ra,re) for((i)=ra;(i)<=(re);(i)++)
#define put(n) cout << n << " "; 
#define puts(n) cout << n << endl;
long ans,N;
// 1 1 1->7
void dfs(int bit,long s){
	if(s>N)
		return ;
	if(bit==7)
		ans++;
	dfs(bit|1,s*10+3);
	dfs(bit|2,s*10+5);
	dfs(bit|4,s*10+7);
	return ;
}
int main(void){
		cin >> N;
	dfs(0,0);
	puts(ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  
  if (N < 1200){
    cout << "ABC" << endl;
  }
  else if (N < 2800){
    cout << "ARC" << endl;
  }
  else {
    cout << "AGC" << endl;
  }
}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define go ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
map <char,int> mp;
int main()
{
    go;
    mp['G']=1;
    mp['C']=1;
    mp['A']=1;
    mp['T']=1;
    string s;
    cin>>s;
    int n=s.size(),ans=0,cur=0;
    for(int i=0;i<n;i++)
    {
        if(mp[s[i]])
            cur++;
        else
        {
            ans=max(ans,cur);
            cur=0;
        }
    }
    ans=max(ans,cur);
    cout<<ans;
    return 0;
}


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

int main()
{
    int n,a,b,c,y,z,x,s[3];
    while(~scanf("%d %d",&a,&b))
    {
        x=-999999999;
        s[0]=a+b;
        s[1]=a-b;
        s[2]=a*b;
        for(c=0;c<3;c++)
        {
            if(s[c]>=x)
            {
                x=s[c];
            }
        }
        printf("%d\n",x);

    }
    return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)
#define REP(i,n) for (ll i=0;i<(n);i++)
#define RREP(i,n) for (ll i=(n)-1;i>=0;i--)
#define debug(x) cout<<#x<<": "<<x<<endl
#define pb push_back
#define ALL(a) (a).begin(),(a).end()

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
	EACH(x,vec) is >> x;
	return is;
}
/*
template<class... T>
ostream& operator<<(ostream& os, tuple<T...>& t) {
	for (size_t i = 0; i < tuple_size< tuple<T...> >::value; ++i) {
		if (i) os << " ";
		os << get<0>(t);
	}
	return os;
}
*/
template<typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
	REP(i,vec.size()) {
		if (i) os << " ";
		os << vec[i];
	}
	return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector< vector<T> >& vec) {
	REP(i,vec.size()) {
		if (i) os << endl;
		os << vec[i];
	}
	return os;
}

int n;
int pw;
vector<int> vw, pf, vf, th;
double f(double w) {
    double res = w * pw;
    REP(i, n) {
        double v = vw[i] * w;
        if (v < th[i]) {
            double F = (th[i]-v)/vf[i];
            res += F*pf[i];
        }
    }
    return res;
}
int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
    cout << fixed << setprecision(10);
    while (cin >> n, n) {
        vw.resize(n);
        pf.resize(n);
        vf.resize(n);
        th.resize(n);
        cin >> pw;
        REP(i, n) {
            cin >> vw[i] >> pf[i] >> vf[i] >> th[i];
        }
        // vector<double> kh; kh.pb(0);
        // REP(i, n) {
        //     if (abs(vw[i]) > 0) {
        //         kh.pb(abs((double)th[i]/vw[i]));
        //     }
        // }
        // double ans = 0;
        // REP(i, n) {
        //     if (th[i] > 0) {
        //         ans += th[i]/vf[i]*pf[i];
        //     }
        // }
        // double d = 0;
        // double ans = f(0);
        // sort( ALL(kh) );
        // REP(i, (int)kh.size()) {
        //     ans = min(ans, f(kh[i]));
        // }
        // kh.pb(linf);
        double l = 0, r = linf;
        REP(t, 200) {
            double m1 = l + (r-l)/3;
            double m2 = l + (r-l)/3*2;
            if ( f(m1) < f(m2) ) {
                r = m2;
            }
            else {
                l = m1;
            }
        }
        // cout << l <<  " " << r << endl;
        double ans = f(l);
        cout << ans << endl;
    }
}

Measured memory_bytes: 4640
#include<iostream>
using namespace std;
int main(){
	long long A,B,C,D;
   cin>>A>>B>>C>>D;
   
   long long area1=A*B;
   long long area2=C*D;
   if(area1>=area2)
   cout<<area1;
    else
    cout<<area2;
    }
   

Measured memory_bytes: 256
import java.util.*;

class Main {

	public static void main(String... args) {
  	  Scanner stdin = new Scanner(System.in);

      int args1 = stdin.nextInt();
      int args2 = stdin.nextInt();
      int args3 = stdin.nextInt();
      
      int answer = args3/args1*args2;
      
      System.out.println(answer);
	}
}

Measured memory_bytes: 22736
#include <cassert>
#include <algorithm>
#include <array>
#include <bitset>
#include <cctype>
#include <cstdint>
#include <cmath>
#include <complex>
#include <chrono>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#include <random>
#include <memory>
#include <utility>
#include <limits>
 
#define rep(i, a, b) for (long long i = (a); (i) < (b); (i)++)
#define all(i) i.begin(), i.end()
#define debug(...) std::cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

void debug_out(){std::cerr<<std::endl;}

template<typename Head,typename... Tail>
void debug_out(Head h,Tail... t){
  std::cerr<<" "<<h;
  debug_out(t...);
}
 
template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, std::pair<T1, T2> pa) {
  return os << pa.first << " " << pa.second;
}
 
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  for (std::size_t  i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}
 
template<typename T1,typename T2>
inline bool chmax(T1& a,T2 b){return a<b && (a=b,true);}
 
template<typename T1,typename T2>
inline bool chmin(T1& a,T2 b){return a>b && (a=b,true);}
 
long long pow_mod(long long a, long long b, long long mod=-1) {
  if(b==0)return 1;
  if ((a == 0)||(mod!=-1&&(a+mod)%mod==0))return 0;
  long long x = 1;
  while (b > 0) {
    if (b & 1)x = (mod!=-1)?(x * a) % mod:x*a;
    a = (mod!=-1)?(a * a) % mod:a*a;
    b >>= 1;
  }
  return x;
}

// const long long MOD = 998244353;
const long long MOD = 1e9 + 7;

using ll = long long;
using P=std::pair<long long,long long>;

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

ll term[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

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

  ll k;
  std::cin>>k;

  k--;
  std::cout<<term[k]<<"\n";

  return 0;
}



Measured memory_bytes: 256
//C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

//#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
//#endif

// C++
#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>

//#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#endif

//ここまで標準include

using namespace std;

int main() {
	string s;
	cin >> s;
	cout << (regex_match(s, regex("A?KIHA?BA?RA?")) ? "YES" : "NO") << endl;
}


Measured memory_bytes: 256
/* 
 * Created on: May 11, 2020 time: 1:20:05 PM 
 *      Author: null_ptr
 */

#include<iostream>

using namespace std;

int main()
{
	long long a,b,c,k;
	cin>>a>>b>>c>>k;
	long long ans=min(k,a);
	long long cnt=ans;
	if(cnt<k)
		cnt+=min(b,max(0LL,k-cnt));
	if(cnt<k)
		ans-=min(c,max(0LL,k-cnt));

	cout<<ans<<'\n';
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
 
int main () {
	int N,A,B,count=1,sum=0;
	cin >>N>>A;
	for(int i=0;i<N-1;++i){
		cin>>B;
		if(B==A){ 
			++count;
		}
		else {
			sum+=count/2;
			count=1;
		}
		A=B;
	}
	sum+=count/ 2;
	cout <<sum;
	return 0;
}

Measured memory_bytes: 3592
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <climits>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>

using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++ )
#define repf(i,m,n) for(int (i)=m;(i)<n;(i)++)
#define all(v) (v).begin(), (v).end()
#define ll long long
#define vec(name,num) vector<ll> name((num),0);
#define op(i) cout<<(i)<<endl;
#define ip(i) cin>>(i);
#define opN cout<<"No"<<endl;
#define opY cout<<"Yes"<<endl;
#define opP cout<<"Possible"<<endl;
#define opI cout<<"Impossible"<<endl;
#define mat(name,fnum,snum); vector<vector<ll>> name((fnum),vector<ll>((snum),0));
#define matC(name,fnum,snum); vector<vector<char>> name((fnum),vector<char>((snum),0));
#define debugP int debug_point; cin>>debug_point;
#define FI first
#define SE second
const ll MOD= 1e9 + 7;
template <typename T>
void putv(vector<T>& V){
	// cout << "The elements in the vector are: " << endl;
	for(auto x: V)
		cout << x << " ";
	cout << endl;
}
ll pow_mod(ll fi,ll se,ll mod){
  if(se==0){
    return 1;
  }
  if(se%2){
    return pow_mod(fi,se-1,mod)*fi%mod;
  }
  ll t=pow_mod(fi,se/2,mod);
  return t*t%mod;
}
template <class T>
vector<T> getv(ll n){
	vector<T> Vector_temp;
	rep(i,n){
		T input;
		cin >> input;
		Vector_temp.emplace_back(input);
	}
	return Vector_temp;
}
ll gcd(ll c,ll b){
    while(1){
        if(c%b!=0){
        ll tmp=b;
        b=c%b;
        c=tmp;
        }else{
            return b;
        }
    }
}

vector<pair<int,int>> Dir={{-1,0},{1,0},{0,1},{0,-1}};
/* <3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3*/


int main(){
  ll n;
  cin>>n;
  vec(a,n);
  rep(i,n){
    cin>>a[i];
  }
  sort(all(a));
  ll con=0;
  rep(i,n){
    if(con==0){
      if(a[i]>=0)con=1;
      else con=2;
    }else if(con==1){
      if(a[i]<0)con=3;
    }else if(con==2){
      if(a[i]>=0)con=3;
    }
  }
  ll ans=0;
  ll plus_head,minus_head;
  vector<ll> pl,mi;
  plus_head=a[n-1];
  ans+=plus_head;
  minus_head=a[0];
  ans-=minus_head;
  repf(i,1,n-1){
    if(a[i]>=0){pl.push_back(a[i]);ans+=a[i];}
    else{mi.push_back(a[i]);ans-=a[i];}
  }
  op(ans);
  rep(i,pl.size()){
    cout<<minus_head<<" "<<pl[i]<<endl;
    minus_head=(minus_head-pl[i]);
  }
  rep(i,mi.size()){
    cout<<plus_head<<" "<<mi[i]<<endl;
    plus_head=(plus_head-mi[i]);
  }
  cout<<plus_head<<" "<<minus_head<<endl;

  return 0;
}


Measured memory_bytes: 3572
#include <iostream>
#include <cstdio>
using  namespace std;
int main()
{
	int n;
	scanf("%d",&n);
	if(n==1)
	{
		printf("Hello World\n");
	}
	else 
	{
		int a,b;
		scanf("%d%d",&a,&b);
		printf("%d\n",a+b);
	}
	
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>


using namespace std;
long gcd(long m ,long n){
while(m!=n){
    if(m>n)m=m-n;
    else n=n-m;
}
return m;
}

long gcd2(long x ,long y){
long r;
if(x<y)swap(x,y);
while(y>0){
    r=x%y;
    x=y;
    y=r;
}
return x;


}

int main(){

int N;
long x;
cin >>N>>x;
long ans;
long  d[N+1];
for(int i=1;i<=N;i++){
cin >> d[i];
}
if(N>=2){
ans=gcd2(abs(x-d[1]),abs(x-d[2]));
for(int i=2;i<N;i++){

ans=gcd2(abs(x-d[i+1]),ans);
}
cout <<ans <<endl;
}
else
cout <<abs(x-d[1])<<endl;

 return 0;
}





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

using namespace std;

#define all(x) (x).begin(), (x).end()
#define pb(x) push_back(x)
#define vi vector<int>

#define ll long long int

int ctoi(char c) {return c-'0';}
int ord(char c) {return c-'a';}
int len(string s) {return s.length();}
int itoc(int i) {return i+'a';}

int main() {
int N;
cin>>N;
vector<int> p(N),q(N),p2(N),q2(N);
for(int i=0;i<N;i++) {
    cin>>p[i];
    p2[i] = i+1;
}
for(int i=0;i<N;i++) {
    cin>>q[i];
    q2[i] = i+1;
}
int c=1,c2=1;
while(p!=p2) {
    next_permutation(all(p2));
    c++;
}
while(q!=q2) {
    next_permutation(all(q2));
    c2++;
}
cout<<abs(c-c2)<<endl;
return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();
// freopen("input.txt", "r", stdin);

int main() {
    int n;
    cin >> n;
    int ans = 0;
    for(int i = n; i >= 1; i--) {
        if ((i & (-i)) == i) {
            cout << i << endl;
            return 0;
        }
    }
    return 0;
}



Measured memory_bytes: 256
from fractions import gcd
a,b = map(int, input().split())
# ans = 1
count = 2
n=gcd(a,b)

ans = set([1])
while n % 2 == 0:
    ans.add(2)
    n //= 2
f = 3
while f * f <= n:
    if n % f == 0:
        ans.add(f)
        n //= f
    else:
        f += 2
if n != 1:
    ans.add(n)
print(len(ans))


Measured memory_bytes: 5048
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define all(vec) vec.begin(), vec.end()
#define END return 0
typedef int64_t ll;
const int mod7 = 1e9 + 7;
const int mod9 = 1e9 + 9;
const int inf = 1 << 30;
const ll INF = 1LL << 60;
template<typename T> T gcd(T a, T b) {return b ? gcd(b, a % b) : abs(a);}
template<typename T> T lcm(T a, T b) {return a / gcd(a, b) * b;}
template<typename T> bool chmax(T &a, T b) {if (a < b) {a = b; return true;} return false;}
template<typename T> bool chmin(T &a, T b) {if (a > b) {a = b; return true;} return false;}
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) {fill((T*)array, (T*)(array+N), val);}

int main() {
    int n;
    string s;
    cin >> n >> s;
    int ans = 0;
    rep(i, n - 2) {
        if(s.substr(i, 3) == "ABC") ans++;
    }
    cout << ans << endl;
}

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

int t[10][10];
int power(int a, int n) { int ret = 1; for (int i = 0; i < n; i++) ret *= a; return ret; }

int getD(int id, int digit) {
	return (id / power(10, digit)) % 10;
}

int checkDigit(int id, int digitNum) {
	int row = 0;
	for (int i = digitNum - 1; i >= 0; i--) {
		int col = getD(id, i);
		row = t[row][col];
	}
	return row;
}

vector<int> getErrorId(int id) {
	int i, j;
	vector<int> ret;
	
	//alter
	for (i = 0; i < 5; i++) {
		for (j = 0; j < 10; j++) {
			int plus = (j - getD(id, i)) * power(10, i);
			if (plus == 0) continue;
			
			id += plus;
			ret.push_back(id);
			id -= plus;
		}
	}
	
	//swap
	for (i = 0; i < 4; i++) {
		int x = getD(id, i);
		int y = getD(id, i + 1);
		if (x == y) continue;
		
		int tmp = id;
		
		id -= x * power(10, i);
		id -= y * power(10, i + 1);
		id += x * power(10, i + 1);
		id += y * power(10, i);
		ret.push_back(id);
		
		id = tmp;
	}
	return ret;
}

int main() {
	int i, j;
	
	for (i = 0; i < 10; i++) for (j = 0; j < 10; j++) cin >> t[i][j];
	
	int ans = 0;
	for (i = 0; i < 10000; i++) {
		int e = checkDigit(i, 4);
		int id = i * 10 + e;
		vector<int> errorId = getErrorId(id);
		for (j = 0; j < errorId.size(); j++) {
			if (checkDigit(errorId[j], 5) == 0) {
				ans++;
				break;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3156
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using datas=pair<ll,ll>;
using ddatas=pair<double,double>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
#define For(i,a,b) for(i=a;i<(ll)b;i++)
#define bFor(i,a,b) for(i=a;i>=(ll)b;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N-1,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define endl "\n"
#define pb push_back
#define printyes cout<<"Yes"<<endl
#define printno cout<<"No"<<endl
#define output(v) do{bool f=0;for(auto outi:v){cout<<(f?" ":"")<<outi;f=1;}cout<<endl;}while(0)
const ll mod=1000000007;
const ll inf=1LL<<60;
const double PI = acos(-1);
const double eps = 1e-9;
template<class T> inline bool chmax(T& a,T b){bool x=a<b;if(x)a=b;return x;} 
template<class T> inline bool chmin(T& a,T b){bool x=a>b;if(x)a=b;return x;} 

void startupcpp(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
}

double distance(ddatas& x,ddatas& y){
  double a=x.first-y.first,b=x.second-y.second;
  return sqrt(a*a+b*b);
}

ll modinv(ll a) {
  ll b=mod,u=1,v=0,t;
  while(b){
    t=a/b;
    a-=t*b; swap(a,b);
    u-=t*v; swap(u,v);
  }
  return (u+mod)%mod;
}

ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}

vec modncrlistp,modncrlistm;

ll modncr(ll n,ll r){
  ll i,size=modncrlistp.size();
  if(size<=n){
    modncrlistp.resize(n+1);
    modncrlistm.resize(n+1);
    if(!size){
      modncrlistp[0]=modncrlistm[0]=1;
      size++;
    }
    For(i,size,n+1){
      modncrlistp[i]=modncrlistp[i-1]*i%mod;
      modncrlistm[i]=modinv(modncrlistp[i]);
    }
  }
  return modncrlistp[n]*modncrlistm[r]%mod*modncrlistm[n-r]%mod;
}

ll modpow(ll a,ll n){
  ll res=1;
  while(n){
    if(n&1)res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll gcd(ll a,ll b){if(!b)return a;return (a%b==0)?b:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

ll countdigits(ll n){
  ll ans=0;
  while(n){n/=10;ans++;}
  return ans;
}

ll sumdigits(ll n){
  ll ans=0;
  while(n){ans+=n%10;n/=10;}
  return ans;
}

int main(){
  ll N,ans=0;
  cin>>N;
  string s;
  map<string,ll> mp;
  while(N--){
    cin>>s;
    mp[s]++;
  }
  cin>>N;
  while(N--){
    cin>>s;
    mp[s]--;
  }
  for(auto x:mp){
    chmax(ans,x.second);
  }
  cout<<ans<<endl;
  return 0;
}

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


void solve(){
  int n,x,t;cin>>n>>x>>t;
  long long int ans = t*(n/x);
  if(n%x!=0)ans+=t;
  cout<<ans;
   
}


int main(){
    //ll tt;cin>>tt;
    //while(tt--){
        solve();
    //}
    return 0;
}

Measured memory_bytes: 3632
p1=complex(*list(map(float,input().split(','))))
p2=complex(*list(map(float,input().split(','))))
ans=0
def area(p,q,r):
    return ((p-r).conjugate()*(q-r)).imag/2
try:
    while True:
        p3=complex(*list(map(float,input().split(','))))
        ans+=area(p1,p2,p3)
        p2=p3
except EOFError: print(abs(ans))


Measured memory_bytes: 5588
#include<bits/stdc++.h>
using namespace std;
int main()
{int n,k,num,num1,count=0;cin>>n>>k;
 map<int ,int>f;
 for(int i=0;i<k;i++)
 {
   cin>>num;
   for(int i=0;i<num;i++)
   {cin>>num1;f[num1]++;}
 }
 for(int i=1;i<=n;i++)
 {if(f[i]==0)count++;
 }
 cout<<count;
 return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
 
#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
 
const int N = (int)2e5 + 9;
vector<int> B[N];
vector<int> R[N];
bool black[N];
int par[N];
int lay[N];
 
void dfs1(int u, int pp){ 
  par[u] = pp;
  for(auto x : B[u]){
    if(x == pp) continue;
    lay[x] = lay[u] + 1;
    dfs1(x,u);
  }
}
 
int dis[N];
 
void dfs2(int u, int pp){
  if(dis[u] >= lay[u]){
    dis[u] = (int)1e9;
  }
  for(auto x : R[u]){
    if(x == pp) continue;
    dis[x] = dis[u] + 1;
    dfs2(x,u);
  }
}
 
int main(){
  fastIO;
  int n, x, y;
  cin >> n >> x >> y;
  int u, v;
  for(int i = 1 ; i < n; i ++ ){
    cin >> u >> v;
    R[u].push_back(v);
    R[v].push_back(u);
  }
  for(int i = 1; i < n; i ++ ){
    cin >> u >> v;
    B[u].push_back(v);
    B[v].push_back(u);
  }
  dfs1(y,0);
  dfs2(x,0);
  bool check;
  for(int i = 1; i <= n; i ++ ){
    for(auto j : R[i]){
      check = true;
      if(par[j] == i || par[par[j]] == i || par[i] == j || par[par[i]] == j || par[i] == par[j]) check = false;
      if(check){
        black[i] = true;
        black[j] = true;
      }
    }
  }
  for(int i = 1; i <= n; i ++ ){
    if(black[i] && dis[i] < (int)1e9){
      cout << "-1\n";
      return 0;
    }
  }
  int res = 2;
  for(int i = 1; i <= n; i ++ ){
    if(dis[i] >= (int)1e9) continue;
    res = max(res, lay[i] * 2);
  }
  cout << res << "\n";
  return 0;
}

Measured memory_bytes: 33276
#include <bits/stdc++.h>
#define IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define DB(x) cerr << __LINE__ << ": " << #x << " = " << (x) << "\n"
using namespace std;
// using ll = long long;
#define int long long
int mod = 998244353;
int a, b, c, d, dp[3002][3002];
bool vis[3002][3002];

int expo(int a, int b) {
	int ret = 1;
	a = a % mod;
	while(b) {
		if(b & 1) ret = (ret * a) % mod;
		a = (a * a) % mod;
		b = b / 2;
	}
	return ret;
}

int mul(int a, int b) {
	a %= mod; b %= mod;
	return ((a * b) % mod);
}
int add(int a, int b) {
	a %= mod; b %= mod;
	return (a + b + mod) % mod;
}

int foo(int ro, int co) {
	if(ro == a && co == b) {
		return 1;
	}
	if(vis[ro][co]) return dp[ro][co];
	if(ro == a) {
		dp[ro][co] = mul(foo(ro, co - 1), ro);
	}
	else if(co == b) {
		dp[ro][co] = mul(foo(ro - 1, co), co);
	}
	else {
		int r1, r2, r3;
		r1 = mul(foo(ro, co - 1), ro);
		r2 = mul(foo(ro - 1, co), co);
		r3 = mul(foo(ro - 1, co - 1), mul(ro - 1, co - 1));
		// DB(r1); DB(r2); DB(r3);
		// DB(ro); DB(co);
		dp[ro][co] = add(r1, r2);
		dp[ro][co] = add(dp[ro][co], -r3);
	}
	vis[ro][co] = true;
	// DB(ro); DB(co); DB(dp[ro][co]);
	return dp[ro][co];
}

signed main() {
    IO;
    cin >> a >> b >> c >> d;
    cout << foo(c, d);
    return 0;
}

Measured memory_bytes: 83208
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)for(int i=0;i<(n);i++)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;

ll gcd(ll x, ll y) {return y ? gcd(y, x%y) : x;}
ll lcm(ll x, ll y) {return x/gcd(x,y)*y;}

ll count(ll x, ll c, ll d){
    ll res = 0;
    res += x / c;
    res += x / d;
    res -= x / lcm(c,d);
    return res;
}



int main(){
    ll a, b; cin >> a >> b;
    ll c, d; cin >> c >> d;
    ll ans = b - a + 1;
    ans = ans - (count(b,c,d) - count(a-1,c,d));
    cout << ans << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"

using namespace std;
using namespace __gnu_pbds;


#define ll long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(),a.end()

typedef tree <ll, null_type, less <ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// order_of_key(val): returns the number of values less than val
// find_by_order(k): returns an iterator to the kth largest element (0-based)
bool vis[1001][1001];
ll dist[1001][1001];
string s[1001];
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
bool poss(ll x, ll y, ll n, ll m) {
	if(x >= 0 && x < n && y >= 0 && y < m && s[x][y] == '.') {
		return true;
	}
	return false;
}
int main(void)
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll h, w, i, j;
    cin >> h >> w;
    ll x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    x1--, x2--, y1--, y2--;
    for(i = 0; i < h; i++) {
    	cin >> s[i];
    	for(j = 0; j < w; j++) {
    		dist[i][j] = 1e18;
    	}
    }
    priority_queue<pair<ll, pair<ll, ll>>, vector<pair<ll, pair<ll, ll>>>, greater<pair<ll, pair<ll, ll>>>> pq;
    pq.push({0, {x1, y1}});
    dist[x1][y1] = 0;
    while(!pq.empty()) {
    	auto temp = pq.top();
    	pq.pop();
    	ll cur = temp.ff;
    	ll x = temp.ss.ff;
    	ll y = temp.ss.ss;
    	if(vis[x][y]) {
    		continue;
    	}
    	vis[x][y] = true;
    	for(int i = 0; i < 4; i++) {
    		int new_x = x + dx[i];
    		int new_y = y + dy[i];
    		if(poss(new_x, new_y, h, w) && dist[new_x][new_y] > dist[x][y]) {
    			dist[new_x][new_y] = dist[x][y];
    			pq.push({cur, {new_x, new_y}});

    		}
    	}
    	for(int i = -2; i <= 2; i++) {
    		for(int j = -2; j <= 2; j++) {
    			int l = x + i;
    			int r = y + j;
    			if(poss(l, r, h, w) && dist[l][r] > cur + 1) {
    				dist[l][r] = cur + 1;
    				pq.push({cur + 1, {l, r}});
    			}
    		}
    	}
    }	
    if(!vis[x2][y2]) {
    	cout << "-1\n";
    } else {
    	cout << dist[x2][y2] << "\n";
    }
}

Measured memory_bytes: 13576
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e15;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
typedef pair<ll,ll> P;
typedef pair<double,double> point;
const ll MAX = 200005;
constexpr ll nx[8] = {1,0,-1,0,1,-1,1,-1};
constexpr ll ny[8] = {0,1,0,-1,1,1,-1,-1};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,a,b,c,d;
    cin >> n >> a >> b >> c >> d;
    bool y = 0;
    ll x = d-c;
    a = abs(a-b);
    rep(i,n+1){
        if ((n-i)%2 == 0) continue;
        ll l = c*i,r = d*i;
        ll m = (n-i)/2*x;
        if (l-m <= a && a <= r+m) y = 1;
    }
    if (y) PRINT("YES");
    else PRINT("NO");
}


Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    s=SI()
    if s=="ABC":print("ARC")
    else:print("ABC")

main()

Measured memory_bytes: 9068
#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr int MOD = 1e9 + 7;

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

    int n;cin>>n;
    vector<int> p(n);
    int res=0;
    for(int i=0;i<n;i++){
        cin>>p[i];
        res += p[i];
    }
    sort(p.rbegin(),p.rend());
    res -= p[0];
    res += p[0]/2;
    cout<<res<<endl;
}


Measured memory_bytes: 256
def main():
    N = int(input())
    A = [int(i) for i in input().split()]

    dp = [0]*(N+1)
    dp[0] = 1000
    for i in range(1, N+1):
        for j in range(0, i-1):
            # j日目に買ってi日目に売る
            m = A[j]
            for k in range(j, i-1):
                m = min(m, A[k])
            dp[i] = max(dp[i], dp[j]//m * A[i-1] + dp[j] % m)
        dp[i] = max(dp[i], dp[i-1])

    print(dp[N])


if __name__ == '__main__':
    main()


Measured memory_bytes: 68728
import bisect

N = int(input())
li = list(map(int, input().split()))
li.sort()

ans = 0
for i in range(N-1):
  k = li[i]
  for j in range(i+1, N):
    l = li[j]
    tmp = bisect.bisect_left(li, k+l)
    ans += tmp - j -1
    
    
print(ans)


Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define inf 1000000007
#define mod 1000000007
//#pragma GCC optimize(2)
//#define int long long
using namespace std;
template <typename T> void read(T &x){
	x=0;char ch=getchar();int fh=1;
	while (ch<'0'||ch>'9'){if (ch=='-')fh=-1;ch=getchar();}
	while (ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();
	x*=fh;
}
template <typename T> void write(T x) {
	if (x<0) x=-x,putchar('-');
	if (x>9) write(x/10);
	putchar(x%10+'0');
}
template <typename T> void writeln(T x) {
	write(x);
	puts("");
}
int a[100005];
signed main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int h,n,sum=0;
	cin>>h>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		sum+=a[i];
	}
	if(sum>=h) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}


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

typedef struct {
    long int x;
    long int y;
} Point;

int main()
{
    int N, M;
    cin >> N >> M;
    Point st[N], cp[M];
    for(auto i=0; i<N; i++) cin >> st[i].x >> st[i].y;
    for(auto j=0; j<M; j++) cin >> cp[j].x >> cp[j].y;

    long int L1min;
    for(auto i=0; i<N; i++) {
        int ans = 1;
        long int L1min = abs(st[i].x - cp[0].x) + abs(st[i].y - cp[0].y);
        for(auto j=1; j<M; j++) {
            long int L1 = abs(st[i].x - cp[j].x) + abs(st[i].y - cp[j].y);
            // マンハッタン距離の計算
            if (L1min > L1) {
                L1min = L1;
                ans = j+1;
            }
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define DEBUG fprintf(stderr, "Passing [%s] line %d\n", __FUNCTION__, __LINE__)
#define itn int
#define gI gi
#define int long long

using namespace std;

typedef long long LL;
typedef pair <int, int> PII;
typedef pair <int, PII> PIII;

inline int gi()
{
	int f = 1, x = 0; char c = getchar();
	while (c < '0' || c > '9') {if (c == '-') f = -1; c = getchar();}
	while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return f * x;
}

inline LL gl()
{
	LL f = 1, x = 0; char c = getchar();
	while (c < '0' || c > '9') {if (c == '-') f = -1; c = getchar();}
	while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return f * x;
}

const int N=2e5+5;
const int mod=998244353;
const int fx[5]={0,-1,0,1,0};
const int fy[5]={0,0,-1,0,1};

int n,k,a[N];
int f(int mid)
{
	int ret=0;
	for (int i=0;i<n;i++)
  	{
		if (a[i]==0)
    	{
			if (mid>=0)
          ret+=n-1;
			continue;
		}
		if (a[i]<0)
    	{
			int target=mid/a[i];
			if (target*a[i]>mid)
          target++;
			int idx=lower_bound(a,a+n,target)-a;
			ret+=n-idx;
			if (idx<=i)
          ret-=1;
		}
		else
      	{
			int target=mid/a[i];
			if (target*a[i]>mid)
          target--;
			int idx=upper_bound(a,a+n,target)-a-1;
			if (idx<0)
          continue;
			ret+=idx+1;
			if (idx>=i)
          ret-=1;
		}
	}
	return ret/2;
}

signed main()
{
	cin>>n>>k;
	for (int i=0;i<n;i++)
      cin>>a[i];
	sort(a,a+n);
	int lo=-1e18,hi=1e18;
	while (lo<hi)
  	{
		int mid=lo+(hi-lo)/2;
		if (f(mid)>=k)
        hi=mid;
		else
        lo=mid+1;
	}
	cout<<lo<<endl;
	return 0;
}


Measured memory_bytes: 1920
// inputに入力データ全体が入る
function Main(input) {

	// 1行目がinput[0], 2行目がinput[1], …に入る
  input = input.split("\n");
  var n = input[0];
  var n= parseInt(input[0], 10);
  
  var A = input[1].split(" ");
  var a = [];
for (var i = 0; i < n+1; i++) {
  var r= parseInt(A[i], 10); 
  a[i] = r; }
 // console.log(a);
  
   var B = input[2].split(" ");
  var b = [];
for (var i = 0; i < n; i++) {
  var r= parseInt(B[i], 10); 
  b[i] = r; }
 // console.log(b);
 
 var i = 0;
  var m = 0;
  var mon =  a[i];
  for (var i = 0;i<n;i++){if(mon>=b[i]){m = m + b[i];
                                         mon = a[i+1];}
                            else {mon = mon + a[i+1] ;
                                  if (mon>=b[i]){m = m + b[i];
                               //   console.log(m);
                                              mon = mon-b[i];}
                                              else{m= m + mon;
                                                   var mon = 0;
                                          //    console.log(m);}  
                                              }
                                              }   
                                              }  
                           
 console.log(m);
     }
  //*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
  

 
  


Measured memory_bytes: 30680
#include<iostream>
#include<algorithm>

using namespace std;

int main()
{
    long long n, a, b, c, d, e, time, p;
    time = 0;
    
    cin>>n>>a>>b>>c>>d>>e;
    p = min(a, min(b,min(c,min(d,e))));
    time = (n+p-1)/p;
    cout<<time+4;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Atcoder177
{
    class Program
    {
        static void Main(string[] args)
        {
            //int N = int.Parse(Console.ReadLine());
            var line = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

            if(line[0] <= line[1] * line[2])
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}


Measured memory_bytes: 28284
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int [] x = new int[n];
        for (int i = 0 ; i < n ; i++) {
            x[i] = sc.nextInt();
        }
        int min = 1000000000;

        for (int i = 0 ; i <= 100 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < n ; j++) {
                sum += (x[j] - i) * (x[j] - i);
            }
            min = Math.min(min, sum);
        }

        System.out.println(min);
    }

}


Measured memory_bytes: 21716