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

using namespace std;

typedef long long ll;

double getTime() {
  return clock() / (double) CLOCKS_PER_SEC;
}

void read() {};

template<typename T, typename... Args>
void read(T& a, Args&... args) {
  cin >> a;
  read(args...);
}

void print() {};

template <typename T, typename... Args>
void print(T a, Args... args) {
  cout << a << " \n"[sizeof...(args) == 0];
  print(args...);
}


int main() {
  string S, T; read(S, T);
  int A, B; read(A, B);
  string U; read(U);
  if(U == S) A--;
  else B--;
  print(A, B);
}

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

int main()
{
    string s;
    cin >> s;
    int sum = 700;
    for(int i=0; i<s.length(); i++) {
        if(s[i]=='o') { sum += 100; }
        else { continue;}
    }
    cout << sum << endl;
    return 0;
}



Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <bitset>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back

typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<bool> VB;

int main() {
	int n;
	cin >> n;
	VI l(n);
	rep(i, n)cin >> l[i];
	int sum = accumulate(all(l), 0);
	int max = *max_element(all(l));
	if (sum - max > max)puts("Yes");
	else puts("No");
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int N, t[55], ans;
string s[55], X;
 
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> s[i] >> t[i];
  }
  cin >> X;
  for (int i = N - 1; i >= 0; i--) {
    if (s[i] == X) break;
    ans += t[i];
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
H = int(input())
W = int(input())
N = int(input())
O = 0
P = 0

while P < N:
    # if H <= W:
    #     P = P + W
    #     W -= 1
    #     O += 1
    # else:
    #     P = P + H
    #     H -= 1
    #     O += 1
    if H >= W:
        P += H
        O += 1
    else:
        P += W
        O += 1

print(O)

Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <numeric>
#include <set>
#include <list>
#include <bitset>
#include <cstdlib>
using namespace std;

int main()
{
    int N;
    cin >> N;
    vector<pair<long double, string>> A(N);
    long double ans = 0;
    for (int i = 0; i < N; i++)
    {
        cin >> A[i].first >> A[i].second;
        if (A[i].second == "BTC")
        {
            ans += A[i].first * 380000.0;
        }
        else
        {
            ans += A[i].first;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

antena=[a,b,c,d,e]
antena.sort()

if antena[4]-antena[0]>k:
    print(":(")
else:
    print("Yay!")

Measured memory_bytes: 3064
(setq a(read))
(setq b(read))
(setq c(read))
(setq d(read))
(setq e(read))
(setq f(read))
(setq g(read))
(setq h(read))
(setq i(read))
(setq x(+ a (* c -15) (* b 14)))
(setq y(+ d (* f -15) (* e 14)))
(setq z(+ g (* i -15) (* h 14)))
(princ(if(= x y z)"Yes""No"))

Measured memory_bytes: 24212
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> v(n);
    for (int i = 0; i < n; i++)cin >> v[i];
    reverse(v.begin(), v.end());

    multiset<int> se;
    for (int i = 0; i < n; i++) {
        auto p = se.upper_bound(v[i]);
        if (p != se.end()) se.erase(p);

        se.insert(v[i]);
    }

    cout << se.size() << endl;
    return 0;
}

Measured memory_bytes: 5376
#include<time.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
using namespace std;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

template<typename ...Ts>
void show(Ts... ts){
  cout<<"#:";
  auto print=[](auto v){cout<<v<<" ";};
  initializer_list<int>{(void(print(ts)),0)...};
  cout<<endl;
}

int main(void){
    int n;
    string s;
    cin>>s;
    n=s.size();
    bool fl=false;
    string ans="AC";
    if (s[0]!='A')ans="WA";
    REP(i,2,n){
        if (s[i]=='C'){
            if (fl==true or i==n-1){
                ans="WA";
            }else{
                fl=true;
            }
        }else{
            if('a'<=s[i] and s[i]<='z'){
                0;
            }else{
                ans="WA";
            }
        }
    }
    if (fl==false or s[1]<'a' or 'z'<s[1]){
        ans="WA";
    }
    cout<<ans;
}






Measured memory_bytes: 256
#include <bits/stdc++.h>
#define Phuong_ ios_base::sync_with_stdio(0); cin.tie(0);
#define pb push_back
#define mp make_pair

/// easy access -------------
using namespace std;
using ll = long long;
using ld = long double;
typedef pair<int,int> pii;
///-------------------------

int main()
{
    Phuong_; /// <3
    int n;
    cin >> n;
    if (n&1) cout << 2*n; else cout << n;
    return 0;
}



Measured memory_bytes: 256
//Daniel Grzegorzewski
#include <bits/stdc++.h>
#pragma GCC optimize("O3")

#define MP make_pair
#define PB push_back
#define ST first
#define ND second
#define int long long

using namespace std;

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef long long LL;

void init_ios() {
     ios_base::sync_with_stdio(0);
     cin.tie(0);
}

const int N = 2*(int)1e5 + 3;
const int MOD = (int)1e9 + 7;

int n, cc[N], c[N], dp[N];
VI ind[N];
VI v;

signed main() {
  init_ios();
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> cc[i];
    if (i == 1 || v.back() != cc[i])
      v.PB(cc[i]);
  }
  n = v.size();
  for (int i = 0; i < n; ++i) {
    c[i+1] = v[i];
    ind[v[i]].PB(i+1);
  }
  dp[n+1] = 1;
  for (int i = n; i >= 1; --i) {
    dp[i] = dp[i+1];
    auto it = upper_bound(ind[c[i]].begin(), ind[c[i]].end(), i) - ind[c[i]].begin();
    if (it == ind[c[i]].size())
      continue;
    int nxt = ind[c[i]][it];
    dp[i] = (dp[i]+dp[nxt])%MOD;
  }
  cout<<dp[1]<<"\n";
}

Measured memory_bytes: 17392
n = int(input())
hs = list(map(int, input().split()))
max = hs[0]
prev = -1
flag = False
for v in hs:
    if v <= prev - 1 and v < max - 1:
        flag = True
        break
    if v > max:
        max = v
    prev = v
if flag:
    print('No')
else:
    print('Yes')


Measured memory_bytes: 14224
#include<iostream>
using namespace std;;
int main(void){
  int n,x;
  cin>>n>>x;
  if(x%2!=0||x<2*n){
    cout<<"No";
  }
  else{
    if(4*n<x){
      cout<<"No";
    }
    else{
      cout<<"Yes";
    }
  }
  return 0;
}
    

Measured memory_bytes: 3644
#include<iostream>
#include<vector>
int main(){
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  int n;
  std::cin >> n;
  std::vector<int> cnt(n + 1), sum(n + 1), ans(n);
  for(int i = 0; i != n; ++i){
    int a;
    std::cin >> a;
    ++sum[cnt[a]++];
  }
  int it = 0, acc = 0;
  for(int t = n; t != 0; --t){
    while(acc >= it * t)
      acc += sum[it++];
    ans[t - 1] = it - 1;
  }
  for(const int e : ans)
    std::cout << e << '\n';
}


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

using namespace std;

int main() {
	int N;
	cin >> N;
	int t = N;
	int s = 0;

	while(t > 0) {
		s += t % 10;
		t /= 10;
	}

	if (N % s == 0) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;		
	}


	return 0;
}

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

int main() {
  //"SUN","MON","TUE","WED","THU","FRI","SAT" 

  string S; cin >> S;

  if ("SUN" == S) { cout << 7 << endl; }
  else if ("MON" == S) { cout << 6 << endl; }
  else if ("TUE" == S) { cout << 5 << endl; }
  else if ("WED" == S) { cout << 4 << endl; }
  else if ("THU" == S) { cout << 3 << endl; }
  else if ("FRI" == S) { cout << 2 << endl; }
  else { cout << 1 << endl; }
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

int n, m;
int p[1003];
void solve() {
    sort(p, p + n);
    reverse(p, p+n);
    int ans = 0;

    rep(i, n) ans += p[i];
    for (int i = 0; i + m - 1 < n; i += m) {
        ans -= p[i + m - 1];
    }
    cout << ans << endl;
}
int main() {
    while (cin >> n >> m) {
        rep(i, n) cin >> p[i];
        if (n == 0 && m == 0) break;
        solve();
    }
    return 0;
}

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

int main() {
  string s,t;
  cin>>s>>t;
  
  if (s[0]==t[2] && s[1]==t[1] && s[2]==t[0]){
    cout << "YES" << endl;
  }
  else {
    cout << "NO" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <atcoder/math>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}
 
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=std::sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}
 
long long gcd_(long long a, long long b){
  if(a<b){
    std::swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
//using namespace std;
//using namespace boost::multiprecision;
//using namespace __gnu_pbds;

int main(){
  using namespace std;
  using namespace atcoder;
  
  int k;
  cin>>k;
  string ans = "";
  REP(_, k) ans += "ACL";
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3724
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
const long long MOD = 1000000007LL;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
int main(){
    int n,d;
    cin >> n >> d;
    int ans=0;
    while(n>0){
        n-=(2*d+1);
        ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/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;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
ll ans=0;llfor;///////////////////////////////////////////////////////////
int main(){
 ll n;sc(n);
 ll t[n+10];
 rep(i,0,n){
  sc(t[i]);
  t[0]=lcm(t[0],t[i]);
 }
 pr(t[0]);
return 0;}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
const int maxn=2e5;
int a[maxn+5];
int k,n;
int main()
{

    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>k>>n;
    for(int i=1;i<=n;++i) cin>>a[i];
    int ans=a[n]-a[1];
    for(int i=1;i<n;++i) ans=min(ans,k-(a[i+1]-a[i]));
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1024
N,A=map(int,input().split())
x=list(map(int,input().split()))
x=list(map(lambda x:x-A,x))
dp=[]
MX=50*50
for i in range(N+1):
    dp.append([0 for j in range(2*MX+2)])
dp[0][MX]=1
for i in range(N):
    for j in range(2*MX+2):
        dp[i+1][j]+=dp[i][j]
        if 0<=j+x[i]<=2*MX+1:
            dp[i+1][j+x[i]]+=dp[i][j]
print(dp[N][MX]-1)

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

int main(){
  int N,K;
  string S;
  cin >> N >> K >> S;
  
  S.at(K-1) = (char)(S.at(K-1) - 'A' + 'a');
  
  cout << S << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
 
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define aut(r,v) __typeof(v) r = (v)
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL-1
using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
const ll mod = 1e9 + 7;
 

 
int main(void){
	int N;
	cin>>N;
	vector<ll> a;
	ll x,y;
	for(int i=0;i<N;i++){
		cin>>x;
		if(i>0){
			if(y!=x)a.pb(x);
		}else{
			a.pb(x);
		}
		y=x;
	}
	int ans=1;
	//cout<<a.size()<<endl;
	/*for(int i=0;i<a.size();i++)cout<<a[i]<<" ";
	cout<<endl;*/
	for(int i=1;i<(a.size()-1);i++){
		if(a[i-1]<a[i]&&a[i]>a[i+1])ans++,i++;
		else if(a[i-1]>a[i]&&a[i]<a[i+1])ans++,i++;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 1400
#include <bits/stdc++.h>
#define rep(i,n)  for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define fast_io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
typedef long double ld;

const ld PI = acos(-1);

int main(){
    fast_io();
    ld R; cin >> R;
    cout << 2 * PI * R;
    
    return 0;
}


Measured memory_bytes: 3804
const MOD: i64 = 1000000007;

fn main() {
	let mut s = String::new();
	std::io::stdin().read_line(&mut s).unwrap();
	let mut s = s.split_whitespace();
	let n: usize = s.next().unwrap().parse().unwrap();
	let k: usize = s.next().unwrap().parse().unwrap();

	let mut pattern = vec![];
	for i in (1..).take_while(|&i| i * i <= n) {
		pattern.push((i, 0));
		pattern.push((n / i, 0));
	}
	pattern.sort();
	pattern.dedup();
	for i in 0..pattern.len() - 1 {
		let l = n / pattern[i + 1].0;
		let r = n / pattern[i].0;
		pattern[i].1 = r - l;
	}
	pattern.last_mut().unwrap().1 = 1;

	let get_index = |n| pattern.binary_search_by_key(&n, |p| p.0).unwrap();

	let mut dp = vec![vec![0; pattern.len()]; k + 1];
	dp[0][get_index(n)] = 1;
	for i in 0..k {
		for j in (0..pattern.len() - 1).rev() {
			dp[i][j] = (dp[i][j] + dp[i][j + 1]) % MOD;
		}
		for j in 0..pattern.len() {
			dp[i + 1][j] = (dp[i + 1][j] + dp[i][get_index(n / pattern[j].0)] * pattern[j].1 as i64) % MOD;
		}
	}
	let mut ans = (0..pattern.len()).fold(0, |r, i| (r + dp[k][i]) % MOD);
	println!("{}", ans);
}


Measured memory_bytes: 73980
#bit探索
s=input()

for i in range(2**3):
    t=["-"]*3
    for j in range(3):
        if((i>>j)&1)==1:
            t[2-j]="+"
    fomula=s[0]+t[0]+s[1]+t[1]+s[2]+t[2]+s[3]
    if eval(fomula)==7:
        print(fomula+"=7")
        break

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

using namespace std;
#define rep(i,n) for(ll i=0; i<n; i++)
typedef long long ll;
typedef long long unsigned int llu;
ll MOD = 1000000007;
ll INF = 1000000009;

/*
xorの性質
・交換・結合法則が成り立つ
・単位元は0
・逆元は自分自身
・要するに、任意のaでa^a=0

左右x,zについて、x^z=yであるから、これはx^y^z=0と同値
4つの連続する数a,b,c,dについて、
a^b^c=b^c^d
a=b^c^d^c^b
 =b^b^c^c^d
 =d
よって、a[i]が３つの同じ数で構成されていればいい
例えばn=4の時、
a b c d
a=d、b=a、c=bよりa=b=c=d
nが3の倍数でないのなら、全部同じ数
かつ、a^a=0だから全部0
3の倍数の時、
・全部0
・2種類の数があり、そのうち１つがもう１つのちょうど2倍の数存在する
・3種類の数があり、全部同数
2つめの場合について、a a b a a b...なので、b=0

110
010
100
*/

void solve(){
    int n;
    cin >> n;
    int a[n+10];
    bool judgeall0 = true;
    bool double2 = true;
    bool triplesame = true;
    rep(i,n){
        cin >> a[i];
        if(a[i]!=0) judgeall0 = false;
    }
    sort(a,a+n);
    int p,q,r;
    p=a[0];
    q=a[n/3];
    r=a[n-1];
    int nump=0;
    int numq=0;
    int numr=0;
    rep(i,n){
        bool flag = false;
        if(a[i]==p) {
            nump++;
            flag=true;
        }
        if(a[i]==q) {
            numq++;
            flag=true;
        }
        if(a[i]==r) {
            numr++;
            flag=true;
        }
        if(!flag) {
            double2=false;
            triplesame=false;
            //cout << "!" << endl;
        }
        //cout << "a[i]" << a[i] << endl;
    }
    //cout << p << r << nump << numr << endl;
    if(nump!=numq || numq!=numr) triplesame=false;
    if(nump==numq&&numq==numr){
        if(p==q) triplesame=false;
        if(q==r) triplesame=false;
        if(p==r) triplesame=false;
        int x,y,z;
        x=p^q;
        y=q^r;
        z=r^p;
        if(x!=r&&y!=p&&z!=q) triplesame=false;
    }
    if(nump*2!=numr) double2=false;
    if(nump*2==numr&&p!=0) double2=false;
    if(nump*2==numr&&p==r) double2=false;

    if(n%3!=0) {
        if(!judgeall0) cout << "No" << endl;
        else cout << "Yes" << endl;
    }
    else{
        if(judgeall0 || triplesame || double2) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}

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


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


int main() {
    string S;
    cin >> S;

    Int N = S.size(); 
    
    vector<Int> dp1(N), dp2(N);

    if (S[0] - '0' <= 5) {
        dp1[0] = S[0] - '0';
    }
    else {
        dp1[0] = 11 - (S[0] - '0');
    }

    if (S[0] - '0' < 5) {
        dp2[0] = (S[0] - '0') + 1;
    }
    else {
        dp2[0] = 10 - (S[0] - '0');
    }

    rep1(i,N-1) {
        int now = S[i] - '0';
        dp1[i] = min(dp1[i-1]+now, dp2[i-1]+(10-now));
        dp2[i] = min(dp1[i-1]+now+1, dp2[i-1]+(9-now));
    }

    cout << dp1[N-1] << endl;
}

Measured memory_bytes: 17028
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main { 
	static Scanner scan = new Scanner(System.in);

    public static void main(String[] args) { 

    	int n = scan.nextInt();
    	String str = "";
    	
    	for(int i=0; i<n; i++) {
    		str += scan.nextInt();	//WARNING
    		if (i != n-1) str += " ";
    	}
    	
    	String str2 = "";
    	List<String> list = new ArrayList<String>();
    	for(int i=1; i<n+1; i++) {
    		str2 += i;
    	}
    	list =permutation(list, str2, "");
    	
    	int a = -1;
    	for(int i=0; i<list.size(); i++) {
    		if(list.get(i).equals(str)) {
    			a = i;
    			break;
    		}
    	}
    	if(a != 0) {
    		System.out.println(list.get(a - 1));
    	}
    	System.out.println(list.get(a));
    	if(a != list.size()-1) System.out.println(list.get(a + 1));
    }
	
    public static List<String> permutation(List<String> list, String q, String ans){
    	if(q.length() <= 1) {
    		list.add(ans + q);
    	}else {
    		for (int i = 0; i < q.length(); i++) {
    			permutation(list, q.substring(0, i) + q.substring(i + 1), ans + q.charAt(i) + " ");
    		}
    	}
    	return list;
    }    	
}


Measured memory_bytes: 175788
# -*- coding: utf-8 -*-
import io, sys

def main():
    S = sys.stdin.readline().rstrip()
    
    prev = ""
    cnt = 0
    cnt_max = 0

    for char in S:
        if char == "R":
            cnt += 1
        elif char == "S":
            cnt = 0
        
        cnt_max = max(cnt_max, cnt)
    
    print(cnt_max)


if __name__ == "__main__":
    main()


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

using namespace std;
 
#define IOS		    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ld 		    long double
#define ll 		    long long int
#define ull 	   	    unsigned long long int
#define pb		    push_back
#define mp		    make_pair
#define F		    first
#define S		    second
#define lb		    lower_bound
#define ub		    upper_bound
#define deb(x)      	    cout<<"#x "<<x<<"\n";
#define trace(x,y)  	    cout<<"#x "<<x<<" #y "<<y<<"\n";
#define cn          	    cout<<"\n";


bool SBF(const pair <int,int>& a, const pair<int,int>& b){return a.F<b.F;}
bool SBS(const pair <int,int>& a, const pair<int,int>& b){return a.S<b.S;}


const long double PI  = 3.1415926535;
const long long   mod = 1e9+ 7; 
const int 	  mxN = 1000;
const long long   INF = 1e9;









int n , a, b;


void solve(){
     cin >> n >> a >> b;
     ll dis[n];

     ll sum = 0;
     for(int i=0;i<n;i++)cin >> dis[i];
     for(int i=0;i<n-1;i++){
	     sum = min(sum + (dis[i+1]-dis[i])*a , sum + b);
     }
     cout<<sum<<"\n";
     return ;

}

int main(){
	solve();
	return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>
#include <math.h>
#include <iostream>
using namespace std;

#define EPS (1e-10)
#define equals(a, b) (fabs(a - b) < EPS)

class Point{
public:
    double x, y;

    Point(double x_ = 0, double y_ = 0){
        x = x_;
        y = y_;
    }

    Point operator+ (Point p){
        return Point(x + p.x, y + p.y);
    };

    Point operator- (Point p){
        return Point(x - p.x, y - p.y);
    };

    Point operator* (double k){
        return Point(x * k, y * k);
    }

    Point operator/ (double k){
        return Point(x / k, y / k);
    }

    double norm(){
        return x * x + y * y;
    }

    double abs(){
        return sqrt(norm());
    }

    bool operator == (const Point &p) const{
        return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
    }
};

typedef Point Vector;

double dot(Vector a, Vector b){
    return a.x * b.x + a.y * b.y;
}

double cross(Vector a, Vector b){
    return a.x * b.y - a.y * b.x;
}

int decide(Point p0, Point p1, Point p2, Point p3){
    Vector v0 = p1 - p0;
    Vector v1 = p3 - p2;

    if(fabs(dot(v0, v1)) < EPS){
        return 1;
    }else if(fabs(cross(v0, v1)) < EPS){
        return 2;
    }else{
        return 0;
    }
}

int main(){
    int q;
    scanf("%d", &q);

    for(int i = 0; i < q; i++){
        int xp0, yp0, xp1, yp1, xp2, yp2, xp3, yp3;
        scanf("%d", &xp0);
        scanf("%d", &yp0);
        scanf("%d", &xp1);
        scanf("%d", &yp1);
        scanf("%d", &xp2);
        scanf("%d", &yp2);
        scanf("%d", &xp3);
        scanf("%d", &yp3);
        
        Point p0 = Point(xp0, yp0);
        Point p1 = Point(xp1, yp1);
        Point p2 = Point(xp2, yp2);
        Point p3 = Point(xp3, yp3);

        printf("%d\n", decide(p0, p1, p2, p3));
    }
}




Measured memory_bytes: 3204
#include <iostream>
#include <set>
#define endl '\n'

using namespace std;

int main() {
  set<string> s;

  int n = 0;
  cin >> n;

  string temp;

  for (int i = 0; i < n; i++) {
    cin >> temp;
    s.insert(temp);
  }

  cout << s.size();

  return 0;
}

Measured memory_bytes: 15724
#include <bits/stdc++.h>
#define st first
#define nd second

using namespace std;

void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"

const int N = 1010;
int n, h, w, last;
string s[N];

int main() {
	ios_base::sync_with_stdio(false);
	cin >> h >> w;
	
	string ss = string(w, '.');
	// dbg(ss);

	for(int i = 0; i < h; i++) {
		cin >> s[i];
		if(s[i] != ss) last = i;
		s[i][0] = '#';
	}


	for(int i = 0; i < h; i++) {
		if(i % 2 == 0) cout << string(w - 1, '#') + "." << '\n';
		else cout << s[i] << '\n';

		s[i][0] = '.';
		s[i][s[i].size() - 1] = '#';
	}
	cout << '\n';

	for(int i = 0; i < h; i++) {
		if(i % 2) cout << "." + string(w - 1, '#') << '\n';
		else cout << s[i] << '\n';
	}

}	

	

Measured memory_bytes: 1024
#include<cstdio>
#include<cstring>
#include<iostream>
#include<string>
#include<map>
#include<vector>
#include<queue>
#include<set>
#include<sstream>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
const int N=2000+10,INF=0x3f3f3f3f,dx[]={1,1},dy[]={-1,1};
ll a,b;
int main()
{
    while(~scanf("%lld%lld",&a,&b)){
        int sum=0;
        while(b>=a){
           a*=2;
           sum++;
        }
        printf("%d\n",sum);
    }

    return 0;
}




Measured memory_bytes: 256
import java.util.Scanner;
import java.util.*;

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

                int[] a = new int[h];
                int[] b = new int[h];
                int[] c = new int[h-1];

                for(int i = 0; i < h; i++){
                  a[i] = scan.nextInt();

                  
                // System.out.println(a[i]);
                }

                for(int i = 0; i < h; i++){
                  b[i] = scan.nextInt();
                }

                for(int i = 0; i < h - 1; i++){
                  c[i] = scan.nextInt();
                }

                int sum = 0;
               
               sum = b[a[0] - 1]; 
                for(int i = 1; i < h; i++){
                  sum += b[a[i] - 1];
                  if(a[i - 1] + 1 == a[i]){
                    sum += c[a[i - 1] - 1];
                  }
                }

                System.out.println(sum);
    }
}


Measured memory_bytes: 22228
#include "bits/stdc++.h"
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

typedef long long ll;

int main() {
    int N;
    cin >> N;
    vector<int> a(N - 1), b(N - 1);
    vector<vector<int>> edge(N, vector<int>(0));
    map<pair<int, int>, int> color;
    rep(i, N - 1) {
        cin >> a[i] >> b[i];
        a[i]--;
        b[i]--;
        edge[a[i]].push_back(b[i]);
        edge[b[i]].push_back(a[i]);
        color[make_pair(a[i], b[i])] = -1;
        color[make_pair(b[i], a[i])] = -1;
    }
    int ans = 0;
    rep(i, N) {
        vector<bool> done(N - 1, false);
        int k = 0;
        rep(j, edge[i].size()) {
            int c = color[make_pair(i, edge[i][j])];
            if (c > -1) done[c] = true;
        }
        rep(j, edge[i].size()) {
            while (done[k]) k++;
            int c = color[make_pair(i, edge[i][j])];
            //cout << "i=" << i << " j=" << j << " edge[i][j]=" << edge[i][j] << " c=" << c << endl;
            if (c == -1) {
                color[make_pair(i, edge[i][j])] = k;
                color[make_pair(edge[i][j], i)] = k;
                k++;
            }
        }
        ans = max(ans, k);
    }
    cout << ans << endl;
    rep(i, N - 1) {
        cout << color[make_pair(a[i], b[i])] + 1 << endl;
    }
}

Measured memory_bytes: 19328
a=input().split()
a=[int(i) for i in a]
b=input().split()
b=[int(i) for i in b]
time=int(input())

if a[0]<b[0]:
  ans=a[0]+a[1]*time-b[0]-b[1]*time
else:
  ans=b[0]-b[1]*time-a[0]+a[1]*time

if ans>=0:
  print("YES")
else:
  print("NO")

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

using namespace std;

int main()
{
	string s, t, u;
	int a, b;
	cin>>s>>t;
	cin>>a>>b;
	cin>>u;
	if (u == s) a --;
	if (u == t) b --;
	cout<<a<<" "<<b<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace::std;
inline vector<int64_t> range(int64_t n){vector<int64_t>v(n);iota(v.begin(),v.end(),0LL);return v;}
inline vector<int64_t> range(int64_t a,int64_t b){vector<int64_t>v(b-a);iota(v.begin(),v.end(),a);return v;}
inline vector<int64_t> range(int64_t a,int64_t b,int64_t c){vector<int64_t>v((b-a+c-1)/c);for(int i=0;i<(int)v.size();++i)v[i]=i?v[i-1]+c:a;return v;}
inline auto reversed(auto v){reverse(v.begin(),v.end());return v;}

int main(){
    int n;
    cin>>n;
    int64_t ans=0;
    for(auto i:range(1,n+1))for(auto j:range(i,n+1,i)){
        ans+=j;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 159536
from collections import defaultdict
n,c=map(int,input().split())
s=[list(map(int,input().split())) for _ in range(n)]

dd=defaultdict(lambda: [0]*(10**5+1))
for s,t,ch in s:
  for i in range(s,t+1):
    dd[ch][i]=1
ans=0
for i in range(10**5+1):
  cnt=0
  for ch in range(c+1):
    if dd[ch][i]==1:
      cnt+=1
  ans=max(ans,cnt)
print(ans)
  
  

Measured memory_bytes: 50940
import java.util.*;
public class Main {
    public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int Edge[][] = new int[n][n];
        for(int i=0;i<n;i++){
            int v = sc.nextInt();
            int k= sc.nextInt();
            Arrays.fill(Edge[v-1],0);
            for(int j=0;j<k;j++){
                int num = sc.nextInt();
                Edge[v-1][num-1]=1;
            }
        }
        int D[] = new int[n];
        Arrays.fill(D,-1);
        D[0] = 0;
        BFS(Edge,D,0);
        for(int i=0;i<n;i++) System.out.println(i+1+" "+D[i]);
    }
    public static void BFS(int [][] E,int D[],int v){
        Deque<Integer> L = new ArrayDeque<>();
        L.add(v);
        while(L.size()!=0){
            int v2 = L.poll();
            int d = D[v2];
            for(int i=0;i<E[v2].length;i++){
                if(D[i]==-1&&E[v2][i]==1){
                    L.add(i);
                    D[i] = d+1;
                }
            }
        }
    }
}


Measured memory_bytes: 28300
import java.util.Scanner;

public class Main {
	private Scanner sc;

	public static void main(String[] args) {
		new Main();
	}
	
	public Main() {
		sc = new Scanner(System.in);
		
		while (sc.hasNextLine()) {
			int n = Integer.parseInt(sc.nextLine());
			if (n == 0) break;
			
			int[][] map = new int[n][n];
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					map[i][j] = 0;
				}
			}
			
			int y = n / 2 + 1;
			int x = n / 2;
			
			for (int i = 0; i < (n * n); i++) {
				if (map[y][x] == 0) {
					map[y][x] = (i + 1);
					
					x++;
				} else {
					x--;
					i--;
				}
				y++;
				
				if (x >= n) x = 0;
				if (x < 0) x = (n - 1);
				if (y >= n) y = 0;
			}
			
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					System.out.print(String.format("%4s", map[i][j]));
				}
				System.out.println();
			}
		}
	}
}

Measured memory_bytes: 27696
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef pair<ll, ll> PP;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define all(v) v.begin(), v.end()
bool chmin(ll & a, ll  b) { if (b < a) { a = b; return 1; } return 0; }
bool chmax(ll & a, ll b) { if (b > a) { a = b; return 1; } return 0; }
const ll INF = 999999999999999;
const ll MOD = 1000000007;
const ll MAX_N=500010;
ll a, b, c, d, e, f, p, t, x, y, z, q, m, n, r, h, k, w, l, ans;
int main() {
    double a,b,x;
    cin>>a>>b>>x;
    x=x/a;
    if(x>a*b/2){
    	x=a*b-x;
        x=x*2/(a*a);
        cout<<setprecision(10)<<atan(x)/acos(-1)*180<<endl;
    }
    else{
        x=x*2/(b*b);
        cout<<setprecision(10)<<90-atan(x)/acos(-1)*180<<endl;
    }
}

Measured memory_bytes: 256
//69行目から編集
#include <iostream>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <cassert>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define repn for(int i = 0;i < n;i++)
#define ain(a) for(auto& i : a)cin >> i;
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x.size())
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define cont continue

//Simple Array Input
#define SAI int n;cin >> n;vi a(n);ain(a)
//Simple Graph Input
#define SGI(m) for(int i=0;i<m;i++){int a,b;cin >> a >> b;g[--a].pb(--b);g[b].pb(a);}
//Simple Tree Input
#define STI SGI(n-1)

typedef long long ll;
typedef long long integer;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<int> > vvi;
typedef vector<vector<ll> > vvl;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;

template<class T> bool chmin(T& a,T b){if(a > b){a = b;return true;}else return false;}
template<class T> bool chmax(T& a,T b){if(a < b){a = b;return true;}else return false;}
template<class T> void print(std::vector<T> a){
    for(int i=0;i<a.size();i++)cout << a[i] << (i < a.size()-1 ? ' ' : '\n');
}
///////////////////////////////////////////////////////////

int main(int argc, char const *argv[])
{
	cin.tie(0);ios::sync_with_stdio(false);
//	cout<<fixed<<setprecision(20);

	string s;cin >> s;
	reverse(all(s));
	int n = s.size();

	vector<vector<ll>> dp(n+1,vector<ll>(2,1e18));
    dp[0][0] = 0;
	rep(i,n){
		//j == 1
		{
			chmin(dp[i+1][1],dp[i][1] + 10 - (s[i] - '0' + 1));
			chmin(dp[i+1][0],dp[i][1] + (s[i] - '0' + 1));
		}

		//j == 0
		{
			chmin(dp[i+1][1] , dp[i][0] + 10 - (s[i] - '0'));
			chmin(dp[i+1][0] , dp[i][0] + (s[i] - '0'));	
		}
	}
	cout << min(dp[n][0],dp[n][1] + 1) << '\n';
	return 0;
}

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

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

  vector<long long> l(90);
  l[0]=2;
  l[1]=1;
  for (int i = 2; i < 90; i++)
  {
    l[i] = l[i-1] + l[i-2];
  }

  cout << l[n] << endl;
  
}

Measured memory_bytes: 256
N = int(input())
*P, = map(int, input().split())

ans = 0
for i in range(N-1):
    if P[i]==(i+1):
        temp = P[i]
        P[i] = P[i+1]
        P[i+1] = temp
        ans = ans + 1
if P[N-1]==(N):
    ans = ans + 1
print(ans)

Measured memory_bytes: 14008
#include <bits/stdc++.h>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <iostream>

#include <bitset>
#include <cassert>
#include <queue>
#include <random>
#include <stack>
#include <iomanip>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n;i++)
#define repf(i, a, b) for (int (i) = (int)a; (i) < (int)b;(i)++)
#define repv(x, arr) for (auto& x:arr)
#define all(v) (v).begin(), (v).end()
#define vec(name, num) vector<ll> name((num), 0);
#define mp(a,b) make_pair(a,b)
#define op(i) cout << (i) << endl;

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




int main(){
    int A, B, C;
    cin >> A >> B >> C;
    if (A == 7 && B == 5 && C == 5)
    {
        cout << "YES" << endl;
    }
    else if (A == 5 && B == 7 && C == 5)
    {
        cout << "YES" << endl;
    }
    else if (A == 5 && B == 5 && C == 7)
    {
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
        using namespace std;
   #define int long long
const int MAX = 510000;
const int MOD =  998244353;
const int  Inv2 = (MOD+1)/2;

     signed main(){
  int n,m;
  cin>>n>>m;
  int a[n];
  for(int i=0;i<n;i++)cin>>a[i];

  int ans1=0,ans2=0;
  
  for(int i=0;i<n;i++)ans1+=a[i];
int t=0;for(int i=0;i<n;i++)if(4*m*a[i]>=ans1)t++;
if(t>=m)cout<<"Yes";
else cout<<"No";

      
      
      }

        


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

int main() {
    
    string S;
    cin >> S;
    
    if (S == "hi" || S == "hihi" || S == "hihihi" || S == "hihihihi" || S == "hihihihihi") {
        cout << "Yes" << endl;
    }
    
    else {cout << "No" << endl;
         }
        
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()
#define INF 1<<25
#define CW -1
#define CH +1

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll,int> LI;



int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll W, H; cin >> W >> H;
	vector<LI> edges(W + H);
	rep (i, W){
		ll p; cin >> p;
		edges[i].first = p;
		edges[i].second = CW;
	} // end rep

	rep (j, H){
		ll q; cin >> q;
		edges[j + W].first = q;
		edges[j + W].second = CH;
	} // end rep

	sort (ALL (edges));

	int currW = W + 1;
	int currH = H + 1;

	ll res = 0LL;
	rep (i, W + H){
		if (edges[i].second == CH){
			if (currH > 0){
				--currH;
				res += edges[i].first * (ll)currW;
		   	} // end if
		}else{ // if (edges[i].second == CW)
			if (currW > 0){
				--currW;
				res += edges[i].first * (ll)currH;
			} // end if
		} // end if
	} // end rep

	cout << res << endl;

	return 0;
}

Measured memory_bytes: 3456
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
#include<limits.h>
#include<unordered_map>
#include<unordered_set>
#include<deque>
#include<cstdio>
typedef long long int ll;
const int INF = 1 << 30;
using namespace std;
#define pp pair<int,int>
#define FOR(i,a,n) for(int i=(ll)a;i<(ll)n;++i)
#define TFOR(i,n)FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
int main() {
	int a, b, c, d, e,ans;
	string s, ss, sss;
	cin >>  a>>b>>c>>d;
	if(a+b<c+d)cout<<"Right"<<endl;
	else if (a + b > c + d)cout << "Left" << endl;
	else cout << "Balanced" << endl;
	return 0;
}

Measured memory_bytes: 764
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
#include<limits.h>
#include<unordered_map>
#include<unordered_set>
#include<deque>
#include<cstdio>
typedef long long int ll;
using namespace std;
#define FOR(i,a,n) for(int i=(ll)a;i<(ll)n;++i)
#define TFOR(i,n)FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
const int INF = 1LL << 30;
const ll LLINF = 1LL << 60;
int main() {
	int n, k, v[200010] = {};
	cin >> n >> k;
	int ct = 0;
	int ans = 0;
	TFOR(i, n) {
		int m; cin >> m;
		if (v[m-1] == 0)++ct;
		v[m-1]++;
	}
	sort(v, v + n);
	int st;
	TFOR(i, n) {
		if (v[i] != 0) { st = i; break; }
	}
	TFOR(i, ct-k) {
		ans += v[st + i];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#coding:utf-8

from collections import defaultdict

N = int(input())
a = map(int, input().split(" "))
a_list = list(a)

dic = defaultdict(int)
for n in a_list:
    dic[n] += 1

max_count = 0
res = 0
for n in set(a_list):
    val = dic[n-1] + dic[n] + dic[n+1]

    if val > max_count:
        max_count = val

print (max_count)


Measured memory_bytes: 21472
fun main(args: Array<String>) {
    val (h, w) = readLine()!!.split(" ").map(String::toInt)

    val map = mutableListOf<String>()

    for (i in 1..h) {
        readLine()!!.let {
            if (it.any { c -> c == '#' }) {
                map.add(it)
            }
        }
    }

    val printRows = mutableListOf<Int>()
    for (i in 0 until w) {
        var dotOnly = true
        for (line in map) {
            if (line.substring(i, i+1) == "#") {
                dotOnly = false
            }
        }
        if (dotOnly) {
            printRows.add(i)
        }
    }

    for (line in map) {
        for ((index, c) in line.withIndex()) {
            if (!printRows.contains(index)) {
                print(c)
            }
        }
        println()
    }

}


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

using namespace std;

#define lli long long int
#define MOD 1000000007
#define DEBUG 1
#define REP(i,n) for(int i=0;i<n;i++)
#define REP2(i,n) for(lli i=1;i<=n;i++)

vector<lli> makePrimeList(lli n){
	vector<lli> primeNums;
	bool isMultiple;
	for(lli i=2;i<=n;i++){
		isMultiple = false;
		lli size = primeNums.size();
		for(lli j=0;j<size;j++){
			if(i%primeNums[j]==0){
				isMultiple=true;
				break;
			}
		}
		if(!isMultiple){
			primeNums.push_back(i);
		}
	}
	return primeNums;
}

int main(){

	vector<lli> v;
	v = makePrimeList(60000);
	lli n;
	cin>>n;

	vector<lli> ans;
	lli j=0;
	for(lli i=0;i<n;i++){
		while(1){
			if(v[j]%5==1){
				ans.push_back(v[j]);
				j++;
				break;
			}
			j++;
		}
	}
	REP(i,n){
		cout<<ans[i]<<" ";
	}
	cout<<endl;

	return 0;
}



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

#define ff first
#define ss second
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define check(x) cout << #x << " : " << (x) << endl
#define inf LLONG_MAX
#define all(v) v.begin(),v.end() 
#define allr(v) v.rbegin(),v.rend() 
//#define endl '\n'  
#define mod 998244353
typedef  long long ll; 
typedef  unsigned long long ull; 
//using u64 = uint64_t; 
//using u128 = __uint128_t;
typedef vector< ll > edge; 
typedef pair< ll , ll > mypair;
typedef priority_queue <ll> max_heap;
typedef priority_queue <ll, vector<ll>, greater<ll> > min_heap;
const ll N=2000+10;
int main()
{
	boost;
	ll n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	k--;
	s[k]=s[k]-('A'-'a');
	cout<<s;

	return 0;
}

Measured memory_bytes: 256
mod = 998244353

def comb(n, r):
    if 2 * r > n: return comb(n, n-r)
    return fac[n] * inv[r] * inv[n-r] % mod

n, a, b, k = map(int, input().split())

fac = [1] * (n+2)
inv = [1] * (n+2)
for i in range(2, n+1):
    fac[i] = fac[i-1] * i % mod
inv[n] = pow(fac[n], mod - 2, mod)
for i in range(n-1, 1, -1):
    inv[i] = inv[i + 1] * (i + 1) % mod

ans = 0
for i in range(n+1):
    Num = (k-a*i)
    if (0 <= Num//b) and (Num//b <= n) and (Num%b == 0):
      j = Num//b 
      ans += comb(n, i) * comb(n, j) 
print(ans%mod)

Measured memory_bytes: 26740
#include<iostream>
using namespace std;
int N;
int A[210];

int main(){
  cin >> N;
  for (int i=0; i<N; ++i) cin >> A[i];
  
  int count = 0;
  
  while (true){
    bool exist_odd = false;
    for (int i=0; i<N; ++i){
      if (A[i]%2!=0) exist_odd = true;
    }
    if (exist_odd) break;
    
    for (int i=0; i<N; ++i){
      A[i] = A[i] / 2;
    }
    count++;
  }
  cout << count << endl;
  return 0;
}

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

namespace ABC
{
    class ProgramB
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine();
            var result = 0;

            for (var i = 0; i < s.Length / 2; i++)
            {
                if (s[i] != s[s.Length - i - 1])
                {
                    result++;
                }
            }
            Console.WriteLine(result);
        }
    }
}


Measured memory_bytes: 25636
#include<iostream>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<iomanip>
using namespace std;
int main()
{
	int n;
	int ans=0;
	cin>>n;
	for(int i=1;i<=n;i++)
	   ans+=i;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int [] v = new int[n];
        int [] c = new int[n];
        
            for(int i = 0; i<n; i++){
                v[i] = sc.nextInt();
            }
            
            for(int i = 0; i<n; i++){
                c[i] = sc.nextInt();
            }
            
            int x = 0;
            int y = 0;
            
            for(int i = 0; i<n; i++){
                if(v[i] - c[i] > 0){
                    x += v[i];
                    y += c[i];
                }
            }
            
            System.out.println(x-y);
    }
}


Measured memory_bytes: 23764