akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P std::pair<int,int>
#define PiP std::pair<int,std::pair<int,int>>
#define all(v) v.begin(),v.end()
#define mkp std::make_pair
#define prique(T) std::priority_queue<T,vector<T>,greater<T>>
using namespace std;
template<class T> inline void chmax(T &a, T b) {
	a = std::max(a, b);
}
template<class T> inline void chmin(T &a, T b) {
	a = std::min(a, b);
}

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)
			return false;
	}
	return x != 1;
}
int gcd(int x, int y) {
	if (y == 0)
		return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i;
		res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m=mod) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)
		return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod ;
}
int get_rand(int MIN, int MAX) {
	std::random_device rnd;
	std::mt19937 mt32(rnd());
	std::uniform_int_distribution<int> engine(MIN, MAX);
	return engine(mt32);
}
/*--------Library Zone!--------*/


signed main() {
	string s,t;cin>>s>>t;
	cout<<t<<s<<endl;
}


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

#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})

#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cout << fixed << setprecision(15);

    ll A, B, C, K;
    cin >> A >> B >> C >> K;

    if (K & 1)
        cout << B - A << "\n";
    else
        cout << A - B << "\n";

    return 0;
}



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

using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); ++i)
double const PI = 3.1415926535897932384626433;
using P = pair<int, int>;

int main() {
    ll a;
    long double b;
    cin >> a >> b;
    ll ib = b * 100 + 0.5;
    a *= ib;
    a /= 100;
    printf("%lld\n", a);
    return 0;
}

Measured memory_bytes: 3760
#include "bits/stdc++.h"
using namespace std;

int main() {
	long long N, A[21][21], MOD = 1000000007;
	static long long DP[22][1 << 21] = {};
	cin >> N;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) cin >> A[i][j];
	}
	DP[0][0] = 1;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < (1 << N); j++) {
			if (DP[i][j] == 0) continue;
			for (int k = 0; k < N; k++) {
				if (A[i][k] == 1) {
					if ((j & (1 << k)) == 0) {
						DP[i + 1][j | (1 << k)] = (DP[i + 1][j | (1 << k)] + DP[i][j]) % MOD;
					}
				}
			}
		}
	}
	cout << DP[N][(1 << N) - 1] << endl;
}

Measured memory_bytes: 309504
#include <bits/stdc++.h>
#define Int int64_t

using namespace std;

struct Combination {
    vector<int64_t> fact, rfact;
	const int64_t MOD = 1000000007;

    Combination(int sz) : fact(sz + 1), rfact(sz + 1) {
        fact[0] = 1;
        for(int i = 1; i < fact.size(); i++){
            fact[i] = fact[i - 1] * i % MOD;
        }
        rfact[sz] = inv(fact[sz]);
        for(int i = sz - 1; i >= 0; i--){
            rfact[i] = rfact[i + 1] * (i + 1) % MOD;
        }
    }
    int64_t inv(int x) const {
        return pow(x, MOD - 2);
    }
    int64_t pow(int64_t x, int64_t n) const {
        int64_t ret = 1;
        while (n > 0) {
            if (n & 1) { (ret *= x) %= MOD; }
            (x *= x) %= MOD;
            n >>= 1;
        }
        return (ret);
    }

    int64_t P(int n, int r) const {
        if (r < 0 || n < r) { return 0; }
        return (fact[n] * rfact[n - r] % MOD);
    }

    int64_t C(int p, int q) const {
        if (q < 0 || p < q) { return 0; }
        return (fact[p] * rfact[q] % MOD * rfact[p - q] % MOD);
    }

    int64_t H(int n, int r) const {
        if (n < 0 || r < 0) { return 0; }
        return (r == 0 ? 1 : C(n + r - 1, r));
    }
};
Combination cb(2000020);

Int func(Int x, Int y) {
	const Int MOD = 1e9 + 7;
	if (x == 0) { return y + 1; }
	if (y == 0) { return x + 1; }
	Int ret = cb.fact[x + y + 2] * cb.rfact[x + 1] % MOD * cb.rfact[y + 1] % MOD;
	return (ret + MOD - 1) % MOD;
}

int main() {
	const Int MOD = 1e9 + 7;
	Int r1, c1, r2, c2;
	cin >> r1 >> c1 >> r2 >> c2;

	Int ans = (func(r2, c2) + func(r1 - 1, c1 - 1)) % MOD;
	ans = (ans + MOD - func(r2, c1 - 1)) % MOD;
	ans = (ans + MOD - func(r1 - 1, c2)) % MOD;
	cout << ans % MOD << endl;

	return 0;
}


Measured memory_bytes: 31616
#include<cstdio>
#include<algorithm>
using namespace std;
long long n,k,ans;
int main()
{
	scanf("%lld%lld",&n,&k);
	if(!k)printf("%lld\n",n*n);
	else
	{
		for(long long b=k+1;b<=n;b++)
		{
			long long a=n%b;
			if(a>=k)ans+=a-k+1;
			ans+=n/b*(b-k);
		}
		printf("%lld\n",ans);
	}
}


Measured memory_bytes: 128
input()
rates = sorted([int(x) for x in input().split()])
least = 0
for boundary in [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]:
    least += 1 if rates and (rates[0] <= boundary) else 0
    rates = [rate for rate in rates if rate > boundary]
print("{} {}".format((least == 0)+least, least+len(rates)))

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define mod 1000000007
#define mod998 998244353
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define mkp make_pair
typedef long long ll;
using namespace std;

int N, A, B, C, D;
string S;

bool slove() {
	if (D < C) {
		while (A != C) {
			if (A + 1 <= C&&S[A + 1] == '.'&&B != A + 1) {
				++A;
			}
			else if (A + 2 <= C&&S[A + 2] == '.'&&B != A + 2) {
				A += 2;
			}
			else if (B + 1 <= D&&S[B + 1] == '.') {
				++B;
			}
			else if (B + 2 <= D&&S[B + 2] == '.') {
				B += 2;
			}
			else return false;
		}
		return true;
	}
	else {
		while (A != C) {
			if (S[A + 1] == '.') {
				++A;
			}
			else if (S[A + 2] == '.') {
				A += 2;
			}
			else {
				return false;
			}
		}
		while (B != D) {
			if (S[B + 1] == '.') {
				++B;
			}
			else if (S[B + 2] == '.') {
				B += 2;
			}
			else {
				return false;
			}
		}
	}
	return true;
}

int main() {
	cin >> N >> A >> B >> C >> D >> S;
	--A;
	--B;
	--C;
	--D;
	puts(slove() ? "Yes" : "No");
}

Measured memory_bytes: 644
//#include <bits/stdc++.h>
#include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> VI;
typedef vector<VI> VVI;//例: VVI dp(10, vector<int>(10, INF);
typedef priority_queue<int, vector<int>, less<int> > QUE_int;
const int INF = 2 * pow(10, 9) + 1;//+1しないとREになるかも(out of rangeになるんかな?? )

vector<int> dx = { -1, 0, 1, 0, -1, -1, 1, 1 };
vector<int> dy = { 0, -1, 0, 1, -1, 1, -1, 1 };

ll max(ll a, ll b) { return (a > b) ? a : b; }
ll min(ll a, ll b) { return (a < b) ? a : b; }

////////////////////////////////////////////////////////////////

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = pow(10, 9) + 7;
struct mint {
	ll x; // typedef long long ll;
	mint(ll x = 0) :x((x%mod + mod) % mod) {}
	mint operator-() const { return mint(-x); }
	mint& operator+=(const mint a) {
		if ((x += a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator-=(const mint a) {
		if ((x += mod - a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator*=(const mint a) {
		(x *= a.x) %= mod;
		return *this;
	}
	mint operator+(const mint a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint a) const {
		mint res(*this);
		return res *= a;
	}
	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime mod
	mint inv() const {
		return pow(mod - 2);
	}
	mint& operator/=(const mint a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint a) const {
		mint res(*this);
		return res /= a;
	}
};
// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
	vector<mint> fact, ifact;
	combination(int n) :fact(n + 1), ifact(n + 1) {
		assert(n < mod);
		fact[0] = 1;
		for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
		ifact[n] = fact[n].inv();
		for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
	}
	mint operator()(int n, int k) {
		if (k < 0 || k > n) return 0;
		return fact[n] * ifact[k] * ifact[n - k];
	}
};


////////////////////////////////////////////////////////////////

int main(void) {
	
	int A, B , C;
	cin >> A >> B >> C;
	int tmp = A;
	A = B;
	B = tmp;

	int tmp2 = A;
	A = C;
	C = tmp2;

	cout << A <<" "<<  B <<" " <<  C << endl;


}




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

int main() {
	int n;
	cin >> n;
	pair<int,int> p[n];
	int a, b;
	for (int k = 0; k < n; k++) {
		cin >> a >> b;
		p[k] = make_pair(a,b);
	}
	sort(p, p + n);
	cout << p[n-1].first + p[n-1].second << endl;
	return 0;
}

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

struct SCC{
  int V;
  vector<vector<int> > G,rG;
  vector<int> vs,used,cmp;
  SCC(){}
  SCC(int sz):V(sz),G(sz),rG(sz),used(sz),cmp(sz){}
  void add(int from,int to){
    G[from].push_back(to);
    rG[to].push_back(from);
  } 
  void dfs(int v){
    used[v]=1;
    for(int i=0;i<G[v].size();i++)
      if(!used[G[v][i]])dfs(G[v][i]);
    vs.push_back(v);
  }
  void rdfs(int v,int k){
    used[v]=1;
    cmp[v]=k;
    for(int i=0;i<rG[v].size();i++)
      if(!used[rG[v][i]])rdfs(rG[v][i],k);
  }
  int build(){
    fill(used.begin(),used.end(),0);
    vs.clear();
    for(int v=0;v<V;v++)
      if(!used[v])dfs(v);
    fill(used.begin(),used.end(),0);
    int k=0;
    for(int i=vs.size()-1;i>=0;i--)
      if(!used[vs[i]])rdfs(vs[i],k++);
    return k;
  }
  int be(int x){
    return cmp[x];
  }
};
int main(){
  int e,n;
  cin>>n>>e;
  SCC S(n);
  while(e--){
    int p1,p2;
    cin>>p1>>p2;
    S.add(p1,p2);
  }
  S.build();
  cin>>e;
  while(e--){
    int p1,p2;
    cin>>p1>>p2;
    if(S.be(p1)==S.be(p2))cout<<1<<endl;
    else cout<<0<<endl;
  }
}


Measured memory_bytes: 4476
#include <iostream>
#include <vector>
#include <map>
using namespace std;
typedef long long ll;

ll gcd(ll n,ll m){
    if(n%m==0) return m;
    else return gcd(m,n%m);
}

int main(){
    ll A,B;
    cin >> A >> B;
    ll g = gcd(A,B);
    map<ll,ll> m;
    ll n = g;
    for(ll i=2;i*i<=g;i++){
        while(n%i==0){
            m[i]++;
            n /= i;
        }
    }
    if(n!=1) m[n]++;
    cout << (int) m.size()+1 << endl;
}

Measured memory_bytes: 256
fn main() {
    let nk: Vec<i32> = read_vec();
    let n: i32 = nk[0];
    let k: i32 = nk[1];

    println!("{}", (n + k - 3) / (k - 1));
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

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

int main() {
  char x;
cin >> x;
if(x =='A' ||x=='B'||x=='C'||x=='D'||x=='E'||x=='F'||x=='G'||x=='H'||x=='I'||x=='J'||x=='K'||x=='L'||x=='M'||x=='N'||x=='O'||x=='P'||x=='Q'||x=='R'||x=='S'||x=='T'||x=='U'||x=='V'||x=='W'||x=='X'||x=='Y'||x=='Z')
cout << "A" << endl;
if(x =='a' ||x=='b'||x=='c'||x=='d'||x=='e'||x=='f'||x=='g'||x=='h'||x=='i'||x=='j'||x=='k'||x=='l'||x=='m'||x=='n'||x=='o'||x=='p'||x=='q'||x=='r'||x=='s'||x=='t'||x=='u'||x=='v'||x=='w'||x=='x'||x=='y'||x=='z')
  cout << "a" << endl;
}

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

N, M = map(int, input().split())

# 各都市の道路数を集計するリスト
cities = [0 for i in range(N)]

# 道路の数ループで各都市の道路数を数えていく
for i in range(M):
    a, b = map(int, input().split())
    cities[a-1] += 1
    cities[b-1] += 1

# 集計した各都市の道路数を出力
for i in range(N):
    print(cities[i])

Measured memory_bytes: 3060
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define int long long

struct Setup {
    Setup() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} SETUP;

template <class T>
void chmax(T &a, T b) {
    if (a < b)
        a = b;
}

signed main() {
    int n;
    cin >> n;
    vector<vector<int>> v(2, vector<int>(n));
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < n; j++) {
            int a;
            cin >> a;
            v[i][j] = a;
        }
    }

    int ans = 0;
    for (int i = 0; i < n; i++) {
        int sum = 0;
        int col = 0;
        while (col <= i) {
            sum += v[0][col];
            col++;
        }
        col--;
        while (col < n) {
            sum += v[1][col];
            col++;
        }
        chmax(ans, sum);
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#! /usr/bin/python3
# AtCoDeerくんとペンキ / AtCoDeer and Paint Cans

"""
1≦a,b,c≦100
"""

a, b, c = map(int, input().split())
variety = 3

if a == b:
    variety -= 1
if a == c:
    variety -= 1
elif b == c:
    variety -= 1
print(variety)


Measured memory_bytes: 2940
#include<cstdio>
#include<iostream>

using namespace std;

int main(void){

	int card[1000][20]={0};
	int n,l;
	char m;

	cin>>n;

	for(int i=0;i<n;i++){
		cin>>m>>l;
		card[(int)m][l]=1;
	}

	for(int i=1;i<=13;i++){
		if(card[(int)'S'][i]==0) cout<<"S "<<i<<endl;
	}
	for(int i=1;i<=13;i++){
		if(card[(int)'H'][i]==0) cout<<"H "<<i<<endl;
	}
	for(int i=1;i<=13;i++){
		if(card[(int)'C'][i]==0) cout<<"C "<<i<<endl;
	}
	for(int i=1;i<=13;i++){
		if(card[(int)'D'][i]==0) cout<<"D "<<i<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 1244
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <stdio.h>
#include <vector>
#include <map>

using namespace std;
typedef long long ll;

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

int main() {

    ll H,W;
    cin >> H >> W;
    string A[H];
    ll B[H][W];
    rep(i,H){
        rep(j,W) B[i][j] = 0;
    }
    rep(i,H){
        cin >> A[i];
    }
    string out = "Possible";
    ll h = 0;
    ll w = 0;
    while(h<H-1||w<W-1){
        if(h==H-1){
            if(A[H-1][w+1]=='#'){
                B[h][w] = 1;
                w++;
            }
            else{
                out = "Impossible";
                break;
            }
        }else if(w==W-1){
            if(A[h+1][W-1]=='#'){
                B[h][w] = 1;
                h++;
            }
            else{
                out = "Impossible";
                break;
            }
        }else{
            if(A[h][w+1]=='#'&&A[h+1][w]=='.'){
                B[h][w] = 1;
                w++;
            }
            else if (A[h][w+1]=='.'&&A[h+1][w]=='#'){
                B[h][w] = 1;
                h++;
            }
            else{
                out = "Impossible";
                break;
            }
        }
    }
    if(out=="Possible"){
        B[H-1][W-1] = 1;
        rep(i,H){
            rep(j,W){
                if(B[i][j]==0&&A[i][j]=='#'){
                    out = "Impossible";
                    break;
                }
            }
        }
    }
    cout << out << endl;
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define ifaxb(a, x, b) if (a < x && x < b)  // 比較は昇順
#define vi vector<int>
#define vii vector<vi>
#define vs vector<string>
#define vss vector<vs>
#define all(x) x.begin(), x.end()
#define pi 3.1415926536
#define ff first
#define ss second
#define pq priority_queue
#define ipair pair<int, int> s
#define lpair pair<LL, LL>
#define MP make_pair
#define INF 2147483647
#define _INF -2147483647
#define MM multimap
#define PB push_back
#define MAXN 100004
using namespace std;
typedef long long ll;

int main() {
    int a, b, c;
    vi ans(3);
    rep(i, 0, 3) {
        cin >> ans[i];
    }
    sort(all(ans));
    cout << ans[0] + ans[1] << endl;
    return 0;
}

Measured memory_bytes: 256
#pragma GCC target ("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pint = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;

void pop_push(vec& v) {
    int n = v.size();
    int front = v[0];
    v.erase(v.begin());
    v.push_back(front);
}

int main() {
    vec a(5);
    rep(i, 5) cin >> a[i];
    int res = INF;

    rep(_, 5) {
        int s = 0;
        rep(i, 4) {
            int t = 0;
            while (t < a[i]) t += 10;
            s += t;
        }
        s += a[4];
        res = min(res, s);
        pop_push(a);
    }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair < ll, ll > PLL;
#define rep(i,n) for (int i = 0; i < (n); ++i)
int main() {
    int n;
    cin >> n;
    vector<tuple<int, int, int>> txy(n);
    rep(i, n) {
        int tmp_t, tmp_x, tmp_y;
        cin >> tmp_t >> tmp_x >> tmp_y;
        txy[i] = make_tuple(tmp_t, tmp_x, tmp_y);
    }
    bool ok = true;
    rep(i, n) {
        int d, t;
        if ( i == 0 ) {
            d = get<1>(txy[i]) + get<2>(txy[i]);
            t = get<0>(txy[i]);
        }
        else {
            d = abs(get<1>(txy[i]) - get<1>(txy[i-1]) ) + abs(get<2>(txy[i]) - get<2>(txy[i-1]));   
            t = get<0>(txy[i]) - get<0>(txy[i-1]);
        }
//        cout << i << " " << d << endl;
//        cout << i << " " << get<0>(txy[i]) << endl;
        if ( t < d ) {
            ok = false;
            break;
        }
        else if ( ( t - d ) % 2 != 0 ) {
            ok = false;
            break;
        }  
    }
    if ( ok ) cout << "Yes" << endl;
    else      cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 1408
n, k = map(int, input().split())
p = list(map(int, input().split()))

max_x = 0
idx = 0
x = 0

if n == k:
    print((sum(p) + k) / 2)
    exit()

for i in range(n-k):
    x += p[i+k] - p[i]
    if max_x < x:
        max_x = x
        idx = i+1

ans = (sum(p[idx:idx+k]) + k) / 2
print(ans)

Measured memory_bytes: 24552
while True:
	N = int(input())
	if N == 0:
		break
	S = list(map(float, input().split()))

	avg = sum(S) / N
	bunsan = 0
	for s in S:
		bunsan += (s - avg)** 2
	bunsan /= N
	print(bunsan ** 0.5)



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

#define ll long long
#define pb push_back

const int maxn = 3e5 + 20;

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

	string s;
	cin >> s;

	int n = s.size();
	for(int i = 0; i < n; i += 2)
	{
		if(s[i] == 'L')
			return cout << "No" << endl , 0;
	}

	for(int i = 1; i < n; i += 2)
	{
		if(s[i] == 'R')
			return cout << "No" << endl , 0;
	}

	cout << "Yes" << endl;
}










 


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <sstream>
using namespace std;


int main() {
	long long M,rD,rR,cD,cR;
	cin >> M >> rD >> rR >> cD >> cR;
	
	long long w1 = (100*cD+rD-1)/ rD;
	long long w2 = (100*cR+rR-1)/ rR;
	if( M < w1+w2 ){
		cout << -1 << endl;
	}else{
		cout << M-(w1+w2) << endl;
	}
}

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

int main() {
  vector<int> pasta(3, 0);
  vector<int> juice(2, 0);

  for(int i = 0; i < 3; i++) {
    cin >> pasta[i];
  }
  for(int i = 0; i < 2; i++) {
    cin >> juice[i];
  }

  sort(pasta.begin(), pasta.end());
  sort(juice.begin(), juice.end());

  cout << pasta[0]+juice[0]-50 << endl;

  return 0;
}



Measured memory_bytes: 3148
#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<stdbool.h>
#include<math.h>
#include<sstream>
#include<math.h>
#include<vector>
#include<functional>
#include<queue>
#include<utility>
#include<bitset>
typedef long long ll;
#define N (1000000000+7)
#define INF 1e10
using namespace std;
typedef pair<ll, ll> P;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

int main(void){
	int a, b;
	cin >> a >> b;
	int ans = a - b;
	ans = max(ans, a + b);
	ans = max(ans, a*b);
	cout << ans << endl;
	return 0;
}

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

namespace AtCoderWorkspace
{
    public class Solver
    {
        public void Solve()
        {
            var cin = new Scanner();
            var a = cin.next();
            var b = cin.next();
            Console.WriteLine(a == b?"H":"D");
        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return next();
            i = 0;
            return s[i++];
        }

        public int nextInt()
        {
            return int.Parse(next());
        }
        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt() + add;
            }
            return Array;
        }

        public int[] DPArrayInt(int N, int ex)
        {
            int[] Array = new int[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt();
            }
            return Array;
        }

        public long nextLong()
        {
            return long.Parse(next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong() + add;
            }
            return Array;
        }

        public long[] DPArrayLong(int N, int ex)
        {
            long[] Array = new long[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong();
            }
            return Array;
        }

        public double nextDouble()
        {
            return double.Parse(next());
        }


        public double[] ArrayDouble(int N, double add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextDouble() + add;
            }
            return Array;
        }
    }

    class Program
    {
        static void Main(string[] s) => new Solver().Solve();
    }
}

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

#define ll long long
#define ull unsigned long long
#define mod 1e9+7
#define INF 1 << 30
#define MAX (1 << 20)
#define NINF (-(1 << 30))
#define Point pair<int, int>
#define triplet pair<pair<int, int>, int>

const int maxs = 2000;
ll fact[maxs];

ll power(ll base, ll p, ll pr){
    ll ans = 1;

    if(base == 1)
        return 1;

    if(base == 0)
        return 0;

    while(p){
        if(p&1)
            ans = (ans*base)%pr;

        base = (base*base)%pr;
        p >>= 1;
    }

    return ans;
}

ll invMod(ll num) {
    return power(num, mod-2, mod);
}

ll nCk(ll n, ll k) {
    return (fact[n] * invMod((fact[n-k] * fact[k]) % ( (ll) mod))) % ( (ll) mod);
}

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

    int n;

    cin >> n;

    vector<Point> points(n);

    while (n--) {
        cin >> points[n].first >> points[n].second;
    }

    sort(points.begin(), points.end(), [](Point p1, Point p2){return (p1.first + p1.second) < (p2.first + p2.second);});

    ll ans = abs((points[0].first + points[0].second) - (points.back().first + points.back().second));

    //cout << "max: " << (points[0].first + points[0].second) << endl;
    
    sort(points.begin(), points.end(), [](Point p1, Point p2){return (p1.first - p1.second) < (p2.first - p2.second);});

    ll tmp = abs((points[0].first - points[0].second) - (points.back().first - points.back().second));

    cout << max(tmp, ans) << endl;
    return 0;
}

Measured memory_bytes: 4760
#include <stdio.h>
#define MAX 500000

int left(int);
int right(int);
void maxHeapify(int);
void buildMaxHeap(void);
  
int A[MAX],H;

int main() {
  
  int i;
  
  scanf("%d",&H);
  for(i = 1; i < H+1; i++)
    scanf("%d",&A[i]);

  buildMaxHeap();

  for(i = 1; i < H+1; i++)
  printf(" %d",A[i]);
  printf("\n");
  return 0;
}

int left(int i)
{
  return 2*i;
}

int right(int i)
{
  return 2*i + 1;
}

void maxHeapify(int i)
{
  int l,r,largest,temp;
  l = left(i);
  r = right(i);

  if(l <= H && A[l] > A[i])
    largest = l;
  else
    largest = i;
  
  if(r <= H && A[r] > A[largest])
    largest = r;

  if(largest != i) {
    temp = A[i];
    A[i] = A[largest];
    A[largest] = temp;
    maxHeapify(largest);
  }
  
}

void buildMaxHeap(void)
{
  int i;
  for(i = H/2; i > 0; i--)
    maxHeapify(i);
}



Measured memory_bytes: 3720
#include <bits/stdc++.h>
#define L long long

using namespace std;

char str[10];
L n;

L f(L x){
	x%=n;
	printf("%lld\n",x);
	fflush(stdout);
	scanf("%s",&str);
	if(str[0]=='V') exit(0);
	else if(str[0]=='M') return 1;
	else return 2;
}

L ok(L S,L E,L lef,L rig){
	return (S+E+lef+rig)%2==0;
}

void bin(L S,L E,L lef,L rig){
	L mid=(S+E)/2;
	L temp=f(mid);
	if(!ok(S,mid,lef,temp)) bin(S,mid,lef,temp);
	else bin(mid,E,temp,rig);
}

int main()
{
	scanf("%lld",&n);
	L res1,res2,st,ed,lef,rig;
	res1=f(0);
	res2=f(n/2);
	if(!ok(0,n/2,res1,res2))
	{
		st=0;
		ed=n/2;
		lef=res1;
		rig=res2;
	}
	else
	{
		st=n/2;
		ed=n;
		lef=res2;
		rig=res1;
	}
	bin(st,ed,lef,rig);
}

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

int main() {
        int n;
        while(cin >> n, n) {
                vector<int> score;
                for(int i=0; i<n; i++) {
                        int k;
                        cin >> k;
                        score.push_back(k);
                }
                sort( score.begin(), score.end() );
                int res = 0;
                for(int i=1; i<n-1; i++) {
                        res += score[i];
                }
                cout << res/(n-2) << endl;
        }
        return 0;
}

Measured memory_bytes: 1220
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <utility>
#include <algorithm>
#include <string>
#include <set>
#include <random>
using namespace std;

int main() {
  int N;
  cin >> N;
  int ans = 1e9;
  for (int i = 1; i < N; i++) {
	  int ds = 0;
	  int a  = i;
	  int b  = N - i;
	  while (a > 0) {
		  ds += a % 10;
		  a  /= 10;
		}
	  while (b > 0) {
		  ds += b % 10;
		  b  /= 10;
		}
	  ans = min(ans, ds);
	}
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int h,w,i=0,j,c=0;
    string n,t;
    
    cin >> n >> t;
    c=n.size();

    if(n==t.erase(c))
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    
    return 0;

}


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

int comp(const void *i, const void *j) {
    if (*(int *)i == *(int *)j) {
        return 0;
    } else if (*(int *)i > *(int *)j) {
        return -1;
    } else {
        return 1;
    }
}

int main(void) {
    int i;
    int h[10];
    for (i=0; i< 10; i++) {                                                     
        scanf("%d", &h[i]);
    }
    qsort(h, 10, sizeof(int), comp);
    for (i=0; i< 3; i++) {
        printf("%d\n", h[i]);
    }
    return 0;
}

Measured memory_bytes: 0
#include <stdio.h>

int main(void){
    int n;scanf("%d",&n);
    char str[300000];
    int r[300000],l[300000];
    scanf("%s",str);
    int i;
    int cnt=0;
    for(i=0;i<n;i++){
        if(str[i]=='W')
            cnt++;
        r[i]=cnt;
    }
    cnt=0;
    for(i=n-1;i>=0;i--){
       if(str[i]=='E')
           cnt++;
        l[i]=cnt;
    }
    //k  r[k-1]+l[k+1]
    int min=r[n-2];
    for(i=0;i<n;i++){
        int a;
        if(i==0)
            a=l[1];
        else if(i==n-1)
            a=r[n-2];
        else
            a=r[i-1]+l[i+1];
        if(min>a)
            min=a;
    }
    
    
    
    
    printf("%d",min);
    
    
}


Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,A,B;
  cin >> N >> A >> B;
  vector<int> P(110);
  for(int i=0;i<N;i++){cin >> P[i];}
  int a=0; int b=0; int c=0;
  for(int i=0;i<N;i++){
    if(P[i]<=A){a++;}
    else if(P[i]>=B+1){c++;}
    else{b++;}
  }
  cout << min({a,b,c}) << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <queue>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <complex>

using ll = long long int;
using namespace std;

int main(){
  
  ll N, tmp;
  vector<ll> A;
  cin >> N;
  for(ll i = 0; i < N; i++){
    cin >> tmp;
    A.push_back(tmp);
  }

  vector<ll> count(2e5);
  for(ll i = 0; i < N; i++){
    count[A[i]-1]++;
  }
  ll tot_count = 0;
  for(ll i = 0; i < 2e5; i++){
    tot_count += (count[i] * (count[i]-1))/2;
  }

  cerr << "Answer: " << endl;
  ll ans;
  for(ll i = 0; i < N; i++){
    ans = tot_count -  (count[A[i]-1]-1);
    cout << ans << " ";
  }

  return 0;

}


Measured memory_bytes: 5872
#include "bits/stdc++.h"
#include <set>

using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define int long long
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
#define mod 1000000007
#define INF 10e10
template <typename T>

void print(T x)
{
	std::cout << x << " ";
}

template <typename T>

void println(T x)
{
	std::cout << x << "\n";
}


signed main(void) {
	int x, t;
	cin >> x >> t;
	int ans = max(x - t, (int)0);
	print(ans);
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
char s[500000],c[500000];
long long sum[30];
int main() {
	scanf("%s",s);
	long long  n=strlen(s),ans=n*(n-1)/2+1;
	for(int j=0;j<n;j++)
		sum[s[j]-'a'+1]++;
	for(int i=1;i<=26;i++)
		ans-=sum[i]*(sum[i]-1)/2;
	cout<<ans;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,n,m) for(ll i=(n);i<(m);i++)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) for(ll i=(n);i>=0;i--)
#define all(vec) vec.begin(),vec.end()
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using P=pair<ll,ll>;
using PP=pair<ll,P>;
using vp=vector<P>;
using vpp=vector<PP>;
using vs=vector<string>;
#define fi first
#define se second
#define pb push_back
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
const ll MOD=1000000007LL;
const int INF=1<<30;
const ll LINF=1LL<<60;
int main(){
    int a,b;
    cin>>a>>b;
    if(a>8||b>8){
        cout<<":("<<endl;
    }else{
        cout<<"Yay!"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main(){
    int q, operate, x, y;
    vector<int> A;
    cin >> q;
    
    for(int i = 0; i < q; i++){
        cin >> operate;
        if(operate == 0){
            cin >> x;
            A.push_back(x);
        }
        else if(operate == 1){
            cin >> y;
            cout << A.at(y) << endl;
        }
        else{
            A.pop_back();
        }
    }
}


Measured memory_bytes: 3900
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>


#define ll long long


//gcdやり直す

void swap (int *x, int *y) {
  int temp;    

  temp = *x;
  *x = *y;
  *y = temp;
}




/***
* pivotを決め、
* 全データをpivotを境目に振り分け、
* pivotの添え字を返す
***/
int partition (int array[], int left, int right) {
  int i, j, pivot;
  i = left;
  j = right + 1;
  pivot = left;   // 先頭要素をpivotとする

  do {
    do { i++; } while (array[i] < array[pivot]);
    do { j--; } while (array[pivot] < array[j]);
    // pivotより小さいものを左へ、大きいものを右へ
    if (i < j) { swap(&array[i], &array[j]); }
  } while (i < j);

  swap(&array[pivot], &array[j]);   //pivotを更新

  return j;
}

/* クイックソート */
void quick_sort (int array[], int left, int right) {
  int pivot;

  if (left < right) {
    pivot = partition(array, left, right);
    quick_sort(array, left, pivot-1);   // pivotを境に再帰的にクイックソート
    quick_sort(array, pivot+1, right);
  }
}






/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/

int main(void){
  int n;
  scanf("%d",&n);
  int ac=0;
  int wa=0;
  int tle=0;
  int re=0;
  for(int i=0;i<n;i++){
    char s[100];
    scanf("%s",s);
    if(s[0]=='A'){
      ac++;
    }
    if(s[0]=='W'){
      wa++;
    }
    if(s[0]=='T'){
      tle++;
    }
    if(s[0]=='R'){
      re++;
    }
  }

  printf("AC x %d\n",ac);
  printf("WA x %d\n",wa);
  printf("TLE x %d\n",tle);
  printf("RE x %d\n",re);
}

Measured memory_bytes: 1728
#include<iostream>
#include<iomanip>
#include<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cassert>
#include<ctime>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<vector>
#include<functional>

using namespace std;

#ifdef DEBUG
#define dprintf      printf
#define dout(x)      cout<<#x" = "<<(x)<<endl
#define darray(x,n)  {int i;rep(i,n)cout<<#x"["<<i<<"] = "<<*((x)+i)<<endl;}
#define dloop(i,s,g) for(int (i)=(s);(i)<(g);(i)++)
#define drep(i,n)    for(int (i)=0;(i)<(n);(i)++)
#define dstop()      scanf("%*c")
#else
#define dprintf      (1)?0:printf
#define dout(x)
#define darray(x,n)
#define dloop(i,s,g) if(int i=0){}else
#define drep(i,n)    if(int i=0){}else
#define dstop()
#endif

#define F    first
#define S    second
#define pb   push_back
#define mp   make_pair

#define loop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define rep(i,n)    for((i)=0;(i)<(n);(i)++)
#define all(x)      (x.begin(),x.end())
#define in(T,...) T __VA_ARGS__; impl(__VA_ARGS__)
#define array(T,id,n) T id[(n)]; for(int i=0;i<(n);i++)cin>>id[i]
#define putv(n)     cout<<(n)<<endl

//#define int long long;
#ifndef int
#define INF (0x7fffffff)
#else
#define INF (0x7fffffffffffffff)
#endif

typedef  long long           ll;
typedef  unsigned            ui;
typedef  unsigned long long  ull;
typedef  pair<int,int>       i_i;
typedef  pair<ll,int>        ll_i;
typedef  pair<ll,ll>         ll_ll;
typedef  pair<double,int>    d_i;
typedef  pair<double,double> d_d;

void impl(){};
template <typename T,typename... TS >
void impl(T &head,TS &... tail)
{
  cin>>head;
  impl(tail ...);
}

signed main(void)
{
  in(int,n);
  if(n%10==9||n/10==9)
    cout<<"Yes"<<endl;
  else
    puts("No");
  return 0;
}


Measured memory_bytes: 256
import java.io.IOException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		int mod = (int) 1E9 + 7;
		Scanner in = new Scanner(System.in);
		char[] s = in.next().toCharArray();

		// i文字目までを13で割った余りがｊであるものの個数を格納する
		long dp[][] = new long[s.length][13];

		// 初期値
		if ( s[0] == '?' ) {
			for ( int n = 0; n < 10; n++ ) {
				dp[0][n] = 1;
			}
		} else {
			dp[0][s[0] - '0'] = 1;
		}

		// 1文字づつ見る
		for ( int i = 1; i < s.length; i++ ) {
			// 前回の余りrごとに見る
			for ( int r = 0; r < 13; r++ ) {
				
				if ( s[i] == '?' ) {
					for ( int now = 0; now < 10; now++ ) {
						dp[i][(r * 10 + now) % 13] += dp[i - 1][r];
					}

				} else {
					int now = s[i] - '0';
					dp[i][(r * 10 + now) % 13] += dp[i - 1][r];
				}
			}
			// %mod
			for ( int t = 0; t < 13; t++ ) {
				dp[i][t] %= mod;
			}
		}

		System.out.println(dp[s.length - 1][5]);
		in.close();
	}
}

Measured memory_bytes: 39100
#include <stdio.h>
int main(void){
    /* 変数宣言，ちゃんと初期化しよう */
    int A = 0;
    int B = 0;
    int ans = 0;
    /* 変数宣言終わり */
    
    /* 入力を受け付ける部分*/
    
    // %dはdecimalの略．つまり，入力を10進数として扱うよという意味．
    scanf("%d %d", &A, &B);
    
    /* 入力を受け付ける部分終わり*/
    
    
    /* 何か処理*/
    ans = (A-1)*(B-1);
    
    if(1 == 0){
      /* 真の場合の処理 */
      
    }else{
      /* 偽の場合の処理 */
      
    }
    
    for(int i = 0; i < 10; i++){ 
      // i = 0,1,2,3,4,5,6,7,8,9のとき処理される
      
    }
    
    /* 何か処理終わり*/
    
    
    /* 出力する部分*/
    
    printf("%d", ans); // %dの部分にansの値が表示される
    
    /* 出力する部分*/
    
    
    
    return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<cstdio>
#include<map>
#include<algorithm>

using namespace std;

#define PII pair<int , int>


int main()
{
	int n;
	int k;
	PII tile;
	int color;

	cin >> n;
	cin >> k;

	for (int i = 0; i < k; i++)
	{
		cin >> tile.first >> tile.second;

		int _min = min(tile.first - 1 , tile.second - 1);
		_min = min(_min , min(n - tile.first , n - tile.second));

		switch(_min % 3)
		{
		case 0:
			cout << "1" << endl;
			break;
		case 1:
			cout << "2" << endl;
			break;
		case 2:
			cout << "3" << endl;
			break;
		}
	}

	return 0;
}

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

int main() {
	int n, buf, cnt, ans1, ans2;
	cnt = 0;
	int b[9];
	for (int i = 0; i < 9; i++) {
		b[i] = 0;
	}
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> buf;
		if (buf < 400) {
			b[0]++;
		} else if (buf < 800) {
			b[1]++;
		} else if (buf < 1200) {
			b[2]++;
		} else if (buf < 1600) {
			b[3]++;
		} else if (buf < 2000) {
			b[4]++;
		} else if (buf < 2400) {
			b[5]++;
		} else if (buf < 2800) {
			b[6]++;
		} else if (buf < 3200) {
			b[7]++;
		} else if (buf >= 3200) {
			b[8]++;
		}
	}
	for (int i = 0; i < 8; i++) {
		if (b[i] != 0) cnt++;
	}
	ans1 = cnt;
	ans2 = cnt + b[8];
	ans1 = max(1, ans1);
	cout << ans1 << " " << ans2 << endl;
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
int n;
double x[1005], y[1005], X, Y, d, e;
double dist(double a, double b) {
	return a*a + b*b;
}
int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lf%lf", &x[i], &y[i]);
		X += x[i]; Y += y[i];
	}
	X /= n; Y /= n;
	double P = 0.01;
	for (int i = 0; i < 30000; i++) {
		int f = 0;
		d = dist(X - x[0], Y - y[0]);
		for (int j = 1; j < n; j++) {
			e = dist(X - x[j], Y - y[j]);
			if (d < e) { d = e; f = j; }
		}
		X += (x[f] - X)*P;
		Y += (y[f] - Y)*P;
		P *= 0.999;
	}
	printf("%.9lf", sqrt(d));
}

Measured memory_bytes: 2176
# 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>
using namespace std;
using LL = long long;
constexpr int MOD = 1000000000 + 7;
constexpr int INF = 2000000000;
const double PI = acos(-1);

int V;
int E;
struct edge { int from, to, cost; };

typedef pair<int, int> PP;

vector<edge> e;

int Par[100000];
int Rank[100000];

void init(int n) {
	for (int i = 0; i < n; i++) {
		Par[i] = i;
		Rank[i] = 0;
	}
}

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

void unite(int  x, int y) {
	x = find(x);
	y = find(y);
	if (x == y) return;
	if (Rank[x] < Rank[y]) {
		Par[x] = y;
	}
	else {
		Par[y] = x;
		if (Rank[x] == Rank[y])Rank[x]++;
	}
}

bool same(int x, int y) {
	return find(x) == find(y);
}

// ??????????????????????????????????????¢??° 
bool comp(const edge& e1, const edge& e2) {
	return e1.cost < e2.cost;
}

int kruskal() {
	init(V);
	sort(e.begin(), e.end(), comp);
	int ans = 0;
	for (int i = 0; i < E; i++) {
		if (!same(e[i].from, e[i].to)) {
			unite(e[i].from, e[i].to);
			ans += e[i].cost;
		}
	}
	return ans;
}

int main() {
	while (cin >> V&&V) {
		e.erase(e.begin(), e.end());
		cin >> E;
		int a, b, c;
		char C;
		for (int i = 0; i < E; i++) {
			cin >> a >> C >> b >> C >> c;
			e.push_back(edge{ a,b,c });
		}
		cout << kruskal() / 100 - V + 1 << endl;
	}
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<P> VP;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF=1e18+18;
const ll MAX=100005;
const ll MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n,m,arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n,arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define dbgmint(n,arr) rep(i,n){cerr<<arr[i].x<<" ";}cerr<<endl;
#define out(a) cout<<a<<endl
#define out2(a,b) cout<<a<<" "<<b<<endl
#define vout(v) rep(i,v.size()){cout<<v[i]<<" ";}cout<<endl
#define Uniq(v) v.erase(unique(v.begin(), v.end()), v.end())
#define fi first
#define se second

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

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,v.size())i>>v[j];return i;}

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<std::setprecision(10);

    string s;
    cin>>s;
    ll n = s.length();
    string x;
    rep(i,n){
        if(s[i]=='A'){
            x += 'o';
        }else if(s[i]=='B'){
            if(i==n-1)continue;
            if(s[i+1]=='C'){
                x += 'x';
                i++;
            }else{
                x += 'B';
            }
        }else{
            x += 'C';
        }
    }
    ll ans = 0;
    ll cnt = 0;
    rep(i,x.length()){
        if(x[i]=='o'){
            cnt ++;
        }else if(x[i]=='x'){
            ans += cnt;
        }else{
            cnt = 0;
        }
    }
    out(ans);
    return  0;
}


Measured memory_bytes: 916
#include <iostream>
#include <iomanip>
#include <cmath>
#include <functional>
#include <algorithm>
#include <numeric>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/container/static_vector.hpp>
#include <boost/utility/string_ref.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/math/common_factor_rt.hpp>

template <class... Args>
struct tuple_input_impl;
template <std::size_t i, std::size_t... tail>
struct tuple_input_impl<std::index_sequence<i, tail...>>
{
    template <class... Args>
    static void f(std::tuple<Args...>& x)
    {
        std::cin >> std::get<i>(x);
        tuple_input_impl<std::index_sequence<tail...>>::f(x);
    }
};
template <>
struct tuple_input_impl<std::index_sequence<>>
{
    static void f(...) {}
};

template <class... Args>
std::istream& operator>>(std::istream& in, std::tuple<Args...>& x)
{
    tuple_input_impl<std::index_sequence_for<Args...>>::f(x);
    return in;
}
template <class T1, class T2>
std::istream& operator>>(std::istream& in, std::pair<T1, T2>& x) { return in >> x.first >> x.second; }

template <class T>
T read()
{
    T res;
    std::cin >> res;
    return res;
}
template <class T>
std::vector<T> read(std::size_t n)
{
    std::vector<T> res(n);
    for (std::size_t i = 0; i < n; ++i) std::cin >> res[i];
    return res;
}

template <class T>
void out_impl(T&& v) { std::cout << std::forward<T>(v); }
template <class T, class... Args>
void out_impl(T&& v, Args&&... args)
{
    std::cout << std::forward<T>(v) << ' ';
    out_impl(std::forward<Args>(args)...);
}
template <class... Args>
void out(Args&&... args)
{
    out_impl(std::forward<Args>(args)...);
    std::cout << '\n';
}
template <class... Args>
void out_noreturn(Args&&... args) { out_impl(std::forward<Args>(args)...); }

template <class T>
void print(const T& container)
{
    bool first = true;
    for (auto&& x : container) {
        if (!first) std::cout << ' ';
        std::cout << x;
        first = false;
    }
    std::cout << '\n';
}

void prog()
{
    int n = read<int>();
    std::vector<std::tuple<std::string, int, int>> r;
    for (auto rr : read<std::tuple<std::string, int>>(n)) {
        r.push_back(std::tuple_cat(rr, std::make_tuple(r.size() + 1)));
    }
    std::sort(std::begin(r), std::end(r), [](auto a, auto b) {
        if (std::get<0>(a) == std::get<0>(b)) return std::get<1>(a) > std::get<1>(b);
        return std::get<0>(a) < std::get<0>(b);
    });
    for (auto rr : r) {
        out(std::get<2>(rr));
    }
}

int main()
{
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    prog();
    return 0;
}


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

long long gcd(long x, long y)
{    if (y == 0)
        return x;
    return gcd(y, x % y);}
long long lcm(long x, long y){ return x * y / gcd(x, y);}

int ctoi(char c)
{
    if (c >= '0' && c <= '9')
    {
        return c - '0';
    }
    return 0;
}


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

    for(int i=0;i<=N;i++){
        for(int j=0;j<=M;j++){

            int a=(N-i)*j+i*(M-j);

            if(K==a||K==(N*M-a)){
                cout<<"Yes"<<endl;
                return 0;
            }
        }
    }

    cout<<"No"<<endl;

    return 0;
}

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

int main(int argc, const char * argv[]) {
    // insert code here...
    for (int i = 1; i <= 5; i++) {
        int x;
        cin >> x;
        if (x == 0) {
            cout << i << endl;
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 3632