akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> ip;
typedef pair<ll,ll> lp;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

int main(){
	string s; cin>>s;
	bool ans = false;
	rep(i,8){
		string t = s.substr(0,i);
		string tt = s.substr(s.size()-7+i, 7-i);
		if(t+tt == "keyence")ans = true;
	}
	cout<<((ans)?"YES":"NO")<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define LB lower_bound
#define UB upper_bound

using namespace std;

typedef long long ll;
typedef long double DB;
typedef pair <int , int> pii;

const int N = 2010;

int d[N][N] , ps1[2*N][N] , ps2[2*N][N] , loc1[N] , loc2[N] , a[N*2];
char ch[N*2];

int main(){

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

	int n;
	cin >> n;

	for(int i = 0 ; i < 2*n ; i++){
	   cin >> ch[i] >> a[i];
	   if(ch[i] == 'W'){
		  loc1[a[i]] = i;
		  for(int j = a[i] ; j <= n ; j++)
			  ps1[i][j]++;
	   }
	   else{
		  loc2[a[i]] = i;
		  for(int j = a[i] ; j <= n ; j++)
			 ps2[i][j]++;
	   }
	}
	
	for(int i = 2*n ; i >= 0 ; i--)
		for(int j = 0 ; j <= n ; j++){
			ps1[i][j] += ps1[i+1][j] , ps2[i][j] += ps2[i+1][j];	
		}

	for(int i = n ; i >= 0 ; i--)
	   for(int j = n ; j >= 0 ; j--){
		  int t = i+j , p1 = ps1[loc2[j+1]][i] + ps2[loc2[j+1]][j] , p2 = ps1[loc1[i+1]][i] + ps2[loc1[i+1]][j];
		  if(i == j && i == n)
			 continue;
		  else if(i == n)
		  	 d[i][j] = d[i][j+1] + abs(loc2[j+1] + p1 - t);
		  else if(j == n)
			 d[i][j] = d[i+1][j] + abs(loc1[i+1] + p2 - t);
		  else
			 d[i][j] = min(d[i+1][j] + abs(loc1[i+1] + p2 - t) , d[i][j+1] + abs(loc2[j+1] + p1 - t));		  
	   }
	
	cout << d[0][0] << endl;
	return 0;
}

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


ll N;

vector<ll> A[1000]; // Aij


int main(){
	cin >> N;
	
	for ( int i = 0; i < N; i++ ){
		A[i].resize(N-1);
		for ( int j = N-2; j >= 0; j-- ){
			cin >> A[i][j];
			A[i][j]--;
		}
	}
	
	int day = 0;
	set<int> need_test;
	for ( int i = 0; i < N; i++ )
		need_test.insert(i);
	
	while ( true ){
		set<int> s;
		
		for ( auto i: need_test ){
			if ( !A[i].empty() ){
				int j = A[i].back();
				if ( !A[j].empty() && A[j].back() == i ){
					s.insert(i);
					s.insert(j);
				}
			}
		}
		need_test.clear();
		
		if ( s.empty() )
			break;
		for ( auto it : s ){
			//cout << day << ":" << A[it].back() << endl;
			A[it].pop_back();
			need_test.insert(it);
		}
		day++;
	}
	
	bool remain = false;
	for ( int i = 0; i < N; i++ ){
		if ( A[i].size() != 0 )
			remain = true;
	}
	
	if ( remain )
		cout << "-1" << endl;
	else
		cout << day << endl;
	
	return 0;
}


Measured memory_bytes: 8192
package main
  
import (
    "fmt"
)

func main() {
    var n int
    fmt.Scan(&n)
    as := make([]int, n)
    for i := range as {
        fmt.Scan(&as[i])
    }
    bs := make([]int, n)
    for i := n - 1; i >= 0; i-- {
        c := i + 1
        bs[i] = as[i]
        for t := c * 2; t <= n; t += c {
            bs[i] ^= bs[t-1]
        }
    }
    var cnt int
    for i := range bs {
        cnt += bs[i]
    }
    fmt.Println(cnt)
    for i := range bs {
        if bs[i] == 1 {
            fmt.Println(i + 1)
        }
    }
}


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

using namespace std;

//#define int long long
#define FOR(i, j, k) for(int i = j; i < (int)k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define INF (1 << 30)

typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> Pi;

const int MOD = 1e9 + 7;
const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};

template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }

struct puzzle {
    string s;
    int now, cnt;
};

map<string, int> mp;

int bfs(puzzle m) {
    queue<puzzle> que;
    que.push(m);
    const int d[] = {1, -1, 4, -4};
    while(!que.empty()) {
        puzzle p = que.front(); que.pop();
        if(mp[p.s] != 0) continue;
        mp[p.s] = p.cnt;
        rep(i, 4) {
            int next = p.now + d[i];
            if(next < 0 || next >= 8) continue;
            if((p.now == 3 && d[i] == 1) || (p.now == 4 && d[i] == -1)) continue;
            puzzle tmp = p;
            swap(tmp.s[p.now], tmp.s[next]);
            tmp.now = next; ++tmp.cnt;
            que.push(tmp);
        }
    }
}

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

    string t = "01234567";
    puzzle p = {t, 0, 0};
    bfs(p);
    char c;
    while(cin >> c) {
        int zero = 0;
        t[0] = c;
        rep(i, 7) {
            cin >> c;
            t[i + 1] = c;
            if(t[i + 1] == '0') {
                zero = i + 1;
            }
        }
        (t == "01234567") ? cout << 0 : cout << mp[t];
        cout << endl;
    }
    return 0;
}

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

int main(){
    int n; cin >> n;
    if(n == 1){cout << "Yes" << endl;return 0;}
    vector<long long int > a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    a[0] -= 1;
    for(int i = 0 ; i < n-1; i++){
        long long int mid = a[i+1] - a[i];
        if(mid >= 1){
            a[i+1] -= 1;
        }else if(mid == 0){
        }else{
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin >> s;
    string t;
    cin >> t;
    int a,b;
    cin >> a >> b;
    string u;
    cin >> u;
    if(u==s){
        a--;
    }else if(u==t){
        b--;
    }
    cout << a <<" " << b << endl;
}




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

#define REP(i, n) for(int64_t i = 0; i < n; i++)
#define REPR(i, n) for(int64_t i = n; i >= 0; i--)
#define FOR(i, m, n) for(int64_t i = m; i < n; i++)
#define FORR(i, m, n) for(int64_t i = m; i >= n; i--)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill( (T*)array, (T*)(array+N), val );
}
template<class T>
inline bool chmax(T &a, T b) {if(a < b) {a = b;return true;}return false;}
template<class T>
inline bool chmin(T &a, T b) {if(a > b) {a = b;return true;}return false;}
const ll INF= 1ll << 60;
const ll MOD = 1000000007;
double EPS = 1e-10;
//----------------------------------------------------------

ll n;
ll a[200005];

int main(){
    cin >> n;
    map<ll,ll> v;
    FOR(i,1,n+1)
    {
        cin >> a[i];
        v[a[i]]++;
    }
    ll t=0;
    for(auto it=v.begin();it!=v.end();it++)
    {
        if((*it).second!=0)
            t+=(*it).second*((*it).second-1)/2;
    }
    FOR(i,1,n+1)
    {
        ll ans=t-v[a[i]]*(v[a[i]]-1)/2;
        if(v[a[i]]>1)
            ans += (v[a[i]]-1)*(v[a[i]]-2)/2;
        cout << ans << endl;
    }
    return 0;
}

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

#define step(i, s, n, d) for(int i=s; i<n; i+=d)
#define FOR(i,s,n) step(i,s,n,1)
#define rep(i,n) FOR(i,0,n)
#define gets(x) x; cin >> x;
#define puts(x) x; cout << x << endl;
#define list_input(x, n) x[n]; rep(i,n){ gets(x[i]);}
#define ll long long

int main(){
  string a[3];
  cin >> a[0] >> a[1] >> a[2];
  cout << a[0][0] << a[1][1] << a[2][2] << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
using namespace std; 
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
const int INF = 1<<29;
typedef long long int ll;
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n>>b)&1; }
inline void set_bit(int & n, int b) { n |= two(b); }
inline void unset_bit(int & n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) { int res = 0; while(n && ++res) n-=n&(-n); return res; }
template<class T> void chmax(T & a, const T & b) { a = max(a, b); }
template<class T> void chmin(T & a, const T & b) { a = min(a, b); }
const int MOD=1000000007;

bool isPowerOfTwo (ll x)  
{  
    return x && (!(x&(x-1)));  
}
bool isPrime(int n) 
{ 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (int i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}
int highestPowerof2(unsigned int n) 
{ 
    // Invalid input 
    if (n < 1) 
        return 0; 
  
    int res = 1;
    for (int i=0; i<8*sizeof(unsigned int); i++) 
    { 
        int curr = 1 << i; 
        if (curr > n) 
           break; 
  
        res = curr; 
    } 
  
    return res; 
} 
long long binpow(long long a, long long b) {
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
const int dx[] = {1,0,-1,0,1,1,-1,-1};
const int dy[] = {0,-1,0,1,1,-1,-1,1};
/*lcm(gcd(N1, M), gcd(N2, M), ..., gcd(Nk, M)) = gcd(lcm(N1, ..., Nk), M)
gcd(lcm(N1, M), lcm(N2, M), ..., lcm(Nk, M)) = lcm(gcd(N1, ..., Nk), M).

If gcd(N1, N2) = 1, then
gcd(N1·N2, M) = gcd(N1, M)·gcd(N2, M)
lcm(N1·N2, M) = lcm(N1, M)·lcm(N2, M)/M.

lcm(M, N, P) · gcd(M, N) · gcd(N, P) · gcd(P, M) = NMP · gcd(N, M, P).
*/
////////////////////////////////////////////////////////////////////
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);  
  cout.tie(NULL);
  int t=1;
  while(t--)
  {
    ll a,b;
    cin>>a>>b;
    ll x=__gcd(a,b);
    ll ans=0;
    for(ll i=2;i*i<=x;i++)
    {
        if(x % i)continue;
        ans++;
        while(!(x % i))x /= i;
    }
    if(x!=1)ans++;
    //for(auto i:ans)
    //cout<<i<<"\n";
    cout<<ans+1;
  }  
  return 0;
}
/* Look for:
* the exact constraints (multiple sets are too slow for n=10^6 :( )
* special cases (n=1?)
* 1LL<<i and not 1<<i
* overflow (int vs ll?)
* array bounds
* if you have no idea just guess the appropriate well-known algo instead of doing nothing :/
*/

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <vector>

typedef long long ll;
using namespace std;

int main()
{
    int n, sum = 1, k = 0;
    cin >> n;
    vector <int> h(n, 0);
    for (int i = 0; i < n; i++) cin >> h[i];
    for (int i = 1; i < n; i++) {
        k = 0;
        for (int j = 0; j < i; j++){
            if (h[j] > h[i]) k++;
        }
        if (k == 0) sum++;
    }
    cout << sum << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k;
    cin>>n>>k;
    char c[n];
    for(int i=0;i<n;i++)
    cin>>c[i];
    int i=k-1;
    c[i]=(char)c[i]+32;
    for(int i=0;i<n;i++)
        cout<<c[i];
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int s,n,sum=0;
  scanf("%d", &n)==1;
  int a[n],b[n];
  for(int i=0;i<n;i++){ 
    scanf("%d", &a[i])==1; 
  }
  for(int i=0;i<n;i++){ 
    scanf("%d", &b[i])==1; 
  }
  for(int i=0;i<n;i++){
    if(a[i] > b[i])
      sum += a[i] - b[i];
  }
  printf("%d", sum);
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
// using namespace atcoder;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define repr(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
using ll = long long;
using Graph = vector<vector<int>>;
// using P = pair<ll, ll>;
const int dx[] = {0, 1, -1, 0};
const int dy[] = {1, 0, 0, -1};
const ll mod = 1e9 + 7;
const ll INF = 1e9;
const ll LINF = 1LL << 60;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //////////////////////////////////////
  ll a, b;
  string s;
  cin >> a >> s;
  b = (s[0] - '0') * 100 + (s[2] - '0') * 10 + s[3] - '0';
  cout << a * b / 100 << endl;
  return 0;
}


Measured memory_bytes: 3660
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <math.h>
#include <iomanip>
using namespace std;
typedef long long int ll;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n, a, cnt[100010] = {}, ans = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a;
		if (a > 100000)ans++;
		else cnt[a]++;
	}
	for (int i = 1; i <= 100000; i++) {
		if (cnt[i] >= i)ans += cnt[i] - i;
		else ans += cnt[i];
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1024
while True:
    a,op,b=input().split()
    a=int(a)
    b=int(b)
    
    if op=="+":
        print(a+b)
    elif op=="-":
        print(a-b)
    elif op=="*":
        print(a*b)
    elif op=="/":
        print(a//b)
    else:
        break


Measured memory_bytes: 5596
n, m = map(int, input().split())
S = ["a" for i in range(n)]
r = True
for _ in range(m):
    s, c = map(int, input().split())
    if (S[s - 1] != str(c) and S[s - 1] != "a") or (s == 1 and c == 0 and n != 1):
        r = False
    else:
        S[s - 1] = str(c)
if S[0] == "a" and n != 1:
    S[0] = "1"
if S[0] == "a" and n == 1:
    S[0] = "0"
for i in range(1, n):
    if S[i] == "a":
        S[i] = "0"
print("".join(S)) if r else print(-1)


Measured memory_bytes: 3064
#include<iostream>
#include<cmath>
#include<string>
#include<cctype>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
        for(;;){
                int n,x;
                int a=0;
                scanf("%d %d",&n,&x);
                if(!n) break;
                for(int i=1;i<n-1;i++){
                        for(int j=i+1;j<n;j++){
                                int c=x-i-j;
                                if(c>j && c<=n) a+=1;
                        }
                }
                printf("%d\n",a);
        }
        return 0;
}

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

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

const int NMAX = 200200;

struct segtree {
	vector<ll> t;
	int n, h;
	segtree() {}
	segtree(int sz) {
		h = sizeof(int)*8-__builtin_clz(sz);
		n = 1<<h;
		t = vector<ll>(n<<1, 0);
	}
	void change(int l, int r, ll v) {
		for(l+=n,r+=n;l<r;l/=2,r/=2) {
			if(l%2) {t[l] = max(t[l], v); ++l;}
			if(r%2) {--r; t[r] = max(t[r], v);}
		}
	}
	ll query(int x) {
		ll v = 0;
		for(x+=n;x>0;x/=2) {
			v = max(v, t[x]);
		}
		return v;
	}
};

segtree st;
segtree hmax;
int h[NMAX];
ll a[NMAX];
ll dp[NMAX];

int N;

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0);
	cin >> N;
	st = segtree(N+1);
	hmax = segtree(N+1);
	for(int i=1;i<=N;++i) {
		cin >> h[i];
	}
	for(int i=1;i<=N;++i) {
		cin >> a[i];
	}
	for(int i=1;i<=N;++i) {
		ll v = hmax.query(h[i])+a[i];
		hmax.change(h[i], N+1, v);
	}
	cout << hmax.query(N) << endl;
	return 0;
}


Measured memory_bytes: 10752
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
int32_t main()
{
   IOS;
	ll n,cnt=0,i,t,d;
	cin>>n;
	ll a[n];
	for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    t=a[(n/2)-1];
    d=a[n/2];
    cout<<d-t;




        return 0;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;

long long mod_pow(long long x,long long n){
    if(n==0) return 1;
    long long res = mod_pow(x*x % mod, n/2);
    if(n & 1) res = res*x % mod;
    return res;
}
long long fact[1000010];//書き換えよう!
long long get_nCk(long long n, long long k){
    if(fact[0] == 0){
        fact[0] = 1;
        for(int i = 1; i < 1000010; i++) fact[i] = fact[i-1] * i % mod;
    }
    if(k < 0 || k > n) return 0;
    return fact[n] * mod_pow(fact[k], mod - 2) % mod * mod_pow(fact[n - k], mod - 2) % mod;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    get_nCk(1, 1);
    int n;
    cin >> n;
    if(n == 2){
        cout << 1 << endl;
        return 0;
    }
    int ans = 0;
    rep(k, (n + 1) / 2, n){
        int tmp = fact[k] * fact[n - 1 - k] % mod * get_nCk(k - 1, n - 1 - k) % mod;
        int tmp2 = fact[k - 1] * fact[n - k] % mod * get_nCk(k - 2, n  -  k) % mod;
        int tmp3 = (tmp - tmp2 + mod) % mod * k % mod;
        (ans += tmp3) %= mod;
    }
    cout << ans << endl;
}

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

#include "bits/stdc++.h"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/rope"

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for(int i = 0; i < (a); ++i)
#define pb push_back
#define mp make_pair
#define sz(x) (int)x.size()
#define f first
#define s second

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

struct custom_hash 
{
    static uint64_t splitmix64(uint64_t x) 
    {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const 
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
const ll MOD = 2019;

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll l, r;
    cin >> l >> r;
    vector<bool> pos (2019 * 2 + 1, false);
    r -= l;
    l %= MOD;
    F0R(i, 2019 * 2 + 1)
    {
        if(i > r) break;
        pos[i] = true;
    }
    ll res = 2020;
    F0R(i, sz(pos))
    {
        if(!pos[i]) continue;
        FOR(j, i + 1, sz(pos))
        {
            if(!pos[j]) continue;
            res = min(res, ((i + l)% MOD) * ((j + l)%MOD) % MOD);
        }
    }
    cout << res;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <deque>
#include <queue>
#include <cmath>
#include <algorithm>
#include <utility>
#include <functional>
#include <fstream>
#define debug(x) cout << #x << " = " << x << endl
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define repr(i,n) for(int i = (n); i > -1; i--)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const double EPS = 1e-9;


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

  ll x, y;
  cin>>x>>y;
  ll ans = 1;
  while(true) {
    x *= 2;
    if(x <= y) {
      ans++;
    } else {
      break;
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#include<random>
using namespace std;
typedef long long int lint;
typedef pair<lint, lint> plint;
typedef pair<double long, double long> pld;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for(lint i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(lint i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<typename T1, typename T2> pair<T1, T2> operator+(const pair<T1, T2>& l, const pair<T1, T2>& r) { return make_pair(l.first + r.first, l.second + r.second); }
template<typename T1, typename T2> pair<T1, T2> operator-(const pair<T1, T2>& l, const pair<T1, T2>& r) { return make_pair(l.first - r.first, l.second - r.second); }
const lint MOD = 1e9 + 7, INF = 1e16;


template <std::int_fast64_t Modulus>
class modint
{
	using u64 = std::int_fast64_t;

public:
	u64 a;
	constexpr modint(const u64 x = 0) noexcept : a(x% Modulus) {}
	constexpr u64& value() noexcept { return a; }
	constexpr const u64& value() const noexcept { return a; }
	constexpr modint operator+(const modint rhs) const noexcept
	{
		return modint(*this) += rhs;
	}
	constexpr modint operator-(const modint rhs) const noexcept
	{
		return modint(*this) -= rhs;
	}
	constexpr modint operator*(const modint rhs) const noexcept
	{
		return modint(*this) *= rhs;
	}
	constexpr modint operator/(const modint rhs) const noexcept
	{
		return modint(*this) /= rhs;
	}
	constexpr modint& operator+=(const modint rhs) noexcept
	{
		a += rhs.a;
		if (a >= Modulus)
		{
			a -= Modulus;
		}
		return *this;
	}
	constexpr modint& operator-=(const modint rhs) noexcept
	{
		if (a < rhs.a)
		{
			a += Modulus;
		}
		a -= rhs.a;
		return *this;
	}
	constexpr modint& operator*=(const modint rhs) noexcept
	{
		a = a * rhs.a % Modulus;
		return *this;
	}
	constexpr modint& operator/=(modint rhs) noexcept
	{
		u64 exp = Modulus - 2;
		while (exp)
		{
			if (exp % 2)
			{
				*this *= rhs;
			}
			rhs *= rhs;
			exp /= 2;
		}
		return *this;
	}
};
typedef modint<MOD> ModInt;

ModInt mod_pow(ModInt x, ModInt n) {
	ModInt ret = 1;
	while (n.a > 0) {
		if (n.a & 1) (ret *= x);
		(x *= x);
		n.a >>= 1;
	}
	return ret;
}

ModInt func[2000001];
void funcinit(int N)
{
	func[0] = 1;
	for (int i = 1; i <= N; i++)
	{
		func[i] = func[i - 1] * i;
	}
}
ModInt comb(ModInt n, ModInt r)
{
	if (n.a <= 0 || n.a < r.a)
	{
		return 1;
	}
	return func[n.a] / (func[r.a] * func[(n - r).a]);
}
lint r1, r2, c1, c2;
int main() {
	cin >> r1 >> c1 >> r2 >> c2;
	ModInt ans = 0;
	ModInt sum = 0;
	funcinit(2000002);
	REP(i, r2 - r1 + 1) {
		sum += comb((c2 - c1 - 1) + i + 2, (c2 - c1));
		ans += comb((c1 - 1) + (r2 - i), (r2 - i)) * sum;
	}
	sum = 0;
	REP(i, c2 - c1 + 1) {
		sum += comb((r2 - r1 - 1) + i + 2, (r2 - r1));
		ans += comb((r1 - 1) + (c2 - i), (c2 - i)) * sum;
	}
	cout << ans.a << endl;
}


Measured memory_bytes: 19168
#include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
#include <cassert>
#include <utility>
#include <iomanip>
#include <chrono>
#include <random>
#include <bitset>

using namespace std;

#define sz(x) (int) x.size()
#define unique(x) x.erase(unique(x.begin(), x.end()), x.end())
#define all(a) a.begin(), a.end()
#define sqr(x) ((x) * (x)) 
#define y1 aksjdaskdjksjfksdjf
#define left kdnvldvoiwejifejg
#define right lkdsjflksdjfdjfk
#define prev asdasfsadjkjsdfjs
#define tm aklsjdasjdasjdkdjjf
#define lcm hddalkwjeidjjhasda
#define random_shuffle asdasdd

const int MAXN = 500;

int n, cn;
int c[MAXN][MAXN];
int d[MAXN][MAXN];
int cost[3][100];
int ans = 1e9;

int main() { 

  scanf("%d %d", &n, &cn);
  for (int i = 0; i < cn; i++) {
    for (int j = 0; j < cn; j++) {
      scanf("%d", &d[i][j]);
    }
  }

  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &c[i][j]);
    }
  }

  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int cur = (i + j) % 3;
      for (int k = 0; k < cn; k++) {
        cost[cur][k] += d[c[i][j] - 1][k];
      }
    }
  }

  for (int i = 0; i < cn; i++) {
    for (int j = 0; j < cn; j++) {
      for (int k = 0; k < cn; k++) {
        if (i == j || i == k || j == k) {
          continue;
        }
        ans = min(ans, cost[0][i] + cost[1][j] + cost[2][k]);
      }
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1280
#include <iostream>
#include <vector>

void dfs(std::vector<std::vector<int> >& map, std::vector<std::vector<int> >& visited, int& island, int x, int y, int w, int h)
{
	visited.at(x).at(y) = island;
	int dx[8] = {1, 1, 0, -1, -1, 0, 1, -1};
	int dy[8] = {1, 0, 1, -1, 0, -1, -1, 1};
	for (int i = 0; i < 8; i++)
	{
		int nex = dx[i] + x;
		int ney = dy[i] + y;
		if (nex < 0 || nex >= w || ney < 0 || ney >= h)
			continue;
		if (map.at(nex).at(ney) == 1 && visited.at(nex).at(ney) != island)
		{	
			dfs(map, visited, island, nex, ney, w, h);
		}
	}
}


int main()
{
	std::vector<int> I;
	while (true)
	{
		int w, h;
		std::cin >> w >> h;
		if (w == 0 && h == 0)
			break;
		std::vector<std::vector<int> > map(h, std::vector<int> (w));
		std::vector<std::vector<int> > visited(h, std::vector<int> (w, 0));
		for (int i = 0; i < h; i++)
		{
			for (int j = 0; j < w; j++)
			{
				std::cin >> map.at(i).at(j);
			}
		}
		int island = 1;
		for (int i = 0; i < h; i++)
		{
			for (int j = 0; j < w; j++)
			{
				if (map.at(i).at(j) == 1 && visited.at(i).at(j) == 0)
				{
					dfs(map, visited, island, i, j, h, w);
					++island;	
				}
			}
		}
		I.push_back(island - 1);
	}
	for (std::vector<int>::iterator i = I.begin(); i != I.end(); i++)
		std::cout << *i << '\n';

	return 0;
}


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

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define spa << " " <<
ll MOD = 1e9+7;
void chmin(ll &a, ll b) { if (a > b) a = b; }
void chmax(ll &a, ll b) { if (a < b) a = b; }

int main(){
  ll i, j;
  ll a[5];
  cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4];
  vector<ll> b(5);
  ll result = 0;
  for(i = 0; i < 5; i++){
    b[i] = a[i] % 10;
    if(b[i] != 0)
      b[i] = 10 - b[i];
  }
  result -= *max_element(ALL(b));
  for(i = 0; i < 5; i++){
    if(a[i] % 10 == 0)
      result += a[i];
    else
      result += a[i] + (10 - a[i] % 10);
      
  }
  cout << result << endl;
  return 0;
}

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

#define ll long long
#define mod 1000000007
#define pll pair<long long,long long>
#define pdd pair<long double,long double>
#define vll vector<ll>
#define rep(i,j,n) for(int i=j;i<n;i++)
#define mp make_pair
#define pb push_back
#define pf push_front
#define inf 1e17
#define N 100010
priority_queue<pll,vector<pll>,greater<pll> >pq;
priority_queue<ll,vector<ll>,greater<ll> >pq1;

ll result(ll a, ll b, ll p){
    ll ans=1;
    if(b==(-1))
        b=p-2;
    while(b){
        if(b&1){
            ans=(ans*a)%p;
        }
        a=(a*a)%p;
        b>>=1;
    }
    return ans;
}

ll T,n,m;

int main(){
    if(fopen("input.txt", "r"))
    freopen("input.txt", "r", stdin),
    freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin >> n;
    ll ans = 0;
    for(ll i=1;i<=n;i++){
        for(ll j=1;j<=n;j++){
            for(ll k=1;k<=n;k++){
                ans += __gcd(i,__gcd(j,k));
            }
        }
    }
    cout << ans;

    return 0;
}


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

using namespace std;

int wall[5010][5010];

int main(void){
    int n,m,a,b,x,i,j,ans=0;
    fill(wall[0],wall[5010],0);
    scanf("%d%d",&n,&m);
    for(i=0; i<m; i++){
	scanf("%d%d%d",&a,&b,&x);
	wall[a][b]++;
	wall[a][b+1]--;
	wall[a+x+1][b]--;
	wall[a+x+1][b+x+2]++;
	wall[a+x+2][b+1]++;
	wall[a+x+2][b+x+2]--;
    }
    n+=3;
    for(i=1; i<=n; i++){
	for(j=1; j<=n; j++){
	    wall[i][j]+=wall[i][j-1];
	}
    }
    for(i=1; i<=n; i++){
	for(j=1; j<=n; j++){
	    wall[i][j]+=wall[i-1][j];
	}
    }
    for(i=1; i<=n; i++){
	for(j=1; j<=n; j++){
	    wall[i][j]+=wall[i-1][j-1];
	}
    }
    n-=3;
    for(i=1; i<=n; i++){
	for(j=1; j<=i; j++){
	    if(wall[i][j]!=0){
		ans++;
	    }
	}
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 99236
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1e9 + 7;
//constexpr ll MOD = 998244353;
//constexpr ll MOD = ;
ll mod(ll A, ll M) {return (A % M + M) % M;}
constexpr ll INF = 1LL << 60;
template<class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
ll divceil(ll A, ll B) {return (A + (B - 1)) / B;}
#define FINALANS(A) do {cout << (A) << '\n'; exit(0);} while (false)

int main()
{
  ll X, A;
  cin >> X >> A;

  cout << ((X < A) ? 0 : 10) << endl;
}

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

int Mdist(int x, int y, vector<vector<bool>> &V, int H, int W){
  vector<vector<int>> D(H+2,vector<int>(W+2,-1));
  D[x][y] = 0;
  queue<pair<int,int>> Q;
  Q.push(make_pair(x,y));
  while(!Q.empty()){
    pair<int,int> p = Q.front();
    Q.pop();
    int vx = p.first, vy = p.second;
    if(V[vx+1][vy] && D[vx+1][vy]==-1){
      D[vx+1][vy] = D[vx][vy]+1;
      Q.push(make_pair(vx+1,vy));
    }
    if(V[vx][vy+1] && D[vx][vy+1]==-1){
      D[vx][vy+1] = D[vx][vy]+1;
      Q.push(make_pair(vx,vy+1));
    }
    if(V[vx-1][vy] && D[vx-1][vy]==-1){
      D[vx-1][vy] = D[vx][vy]+1;
      Q.push(make_pair(vx-1,vy));
    }
    if(V[vx][vy-1] && D[vx][vy-1]==-1){
      D[vx][vy-1] = D[vx][vy]+1;
      Q.push(make_pair(vx,vy-1));
    }
  }
  
  int res=0;
  for(int i=1;i<=H;i++){
    for(int j=1;j<=W;j++){
      res = max(D[i][j],res);
    }
  }
  return res;
}

int main() {
  int H,W;
  cin >> H >> W;
  vector<vector<bool>> V(H+2,vector<bool>(W+2,false));
  for(int i=1;i<=H;i++){
    string s;
    cin >> s;
    for(int j=1;j<=W;j++){
      if(s[j-1]=='.') V[i][j] = true;
    }
  }
  
  int ans = 0;
  for(int i=1;i<=H;i++){
    for(int j=1;j<=W;j++){
      if(V[i][j]) ans = max(Mdist(i,j,V,H,W),ans);
    }
  }
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
a,b = [int(x) for x in input().split()]
j = [2,3,4,5,6,7,8,9,10,11,12,13,1]
if j.index(a) > j.index(b):
  print('Alice')
elif j.index(a) < j.index(b):
  print('Bob')
else:
  print('Draw')


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

/* debug macros */
#ifdef WAFDAYO
#define DBG_LINE() {std::cerr<<"\e[2m[L"<<__LINE__<<"]\e[m ";}
#define DBG_PRINT(s,t,u) {std::cerr<<(s)<<" \e[2m=\e[m \e[1m"<<(t)<<"\e[m"<<(u);}
#define SELECT_7TH(x1,x2,x3,x4,x5,x6,x7,...) x7
#define dbg1(x1) DBG_PRINT(#x1,x1,std::endl)
#define dbg2(x1,x2) DBG_PRINT(#x1,x1,", ")dbg1(x2)
#define dbg3(x1,x2,x3) DBG_PRINT(#x1,x1,", ")dbg2(x2,x3)
#define dbg4(x1,x2,x3,x4) DBG_PRINT(#x1,x1,", ")dbg3(x2,x3,x4)
#define dbg5(x1,x2,x3,x4,x5) DBG_PRINT(#x1,x1,", ")dbg4(x2,x3,x4,x5)
#define dbg6(x1,x2,x3,x4,x5,x6) DBG_PRINT(#x1,x1,", ")dbg5(x2,x3,x4,x5,x6)
#define dbg(...) DBG_LINE()\
SELECT_7TH(__VA_ARGS__,dbg6,dbg5,dbg4,dbg3,dbg2,dbg1)(__VA_ARGS__)
#else
#define dbg(...) {}
#endif

/* utility functions */
struct read_item{read_item(){};
template<class T>operator T(){T t;std::cin>>t;return t;}};
char splf(int i,int n){return(i+1<n)?' ':'\n';};
template<bool up>
struct _RI{int i;_RI(int a):i(a){}
int operator*(){return i;}void operator++(){i+=(up?1:-1);}
bool operator!=(const _RI& r){return up?i<r.i:i>=r.i;}};
template<bool up>
struct _RX{_RI<up> x,y;_RI<up> begin(){return x;}_RI<up> end(){return y;}
_RX(int a,int b):x(up?a:(a-1)),y(b){}_RX(int a):_RX(up?0:a,up?a:0){}};
typedef _RX<true> range;
typedef _RX<false> revrange;

/* types and constants */
typedef int64_t i64;
typedef uint64_t u64;
// const i64 inf = (i64)1.05e18;
// const int inf = (int)1.05e9;

using namespace std;

int main() {

	const i64 a = read_item();
	const i64 b = read_item();
	const i64 c = read_item();

	const i64 r = c - (a + b);
	if(r < 0) {
		printf("No\n");
		return 0;
	}

	if(r * r > 4 * a * b) {
		printf("Yes\n");
	} else {
		printf("No\n");
	}

	return 0;
}

/* wafdayo~~~ */


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl
#define sset(s) cout<<#s<<":";each(kbrni,s)cout<<" "<<kbrni;cout<<endl
#define smap(m) cout<<#m<<":";each(kbrni,m)cout<<" {"<<kbrni.first<<":"<<kbrni.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;

const int MAX_N = 100005;

struct edge
{
    int to;
    ll cost;
};

vector<int> G[MAX_N];
vector<edge> graph[MAX_N];
int par[MAX_N];
int st[MAX_N];
ll sma;

void dfs(int u,int p)
{
    par[u] = p;
    st[u] = 1;
    rep(i,len(G[u])){
        if(G[u][i] != p){
            dfs(G[u][i],u);
            st[u] += st[G[u][i]];
        }
    }
}

void redfs(int u,int p,ll dist)
{
    sma += dist;
    rep(i,len(graph[u])){
        if(graph[u][i].to != p){
            redfs(graph[u][i].to,u,dist+graph[u][i].cost);
        }
    }
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vp vec(n-1);
    rep(i,n-1){
        int a,b;
        cin >> a >> b;
        --a,--b;
        vec[i] = P(a,b);
        G[a].pb(b),G[b].pb(a);
    }
    vl sm(n);
    rep(i,n){
        cin >> sm[i];
    }
    dfs(0,-1);
    vl ans(n-1);
    int flag = -1;
    rep(i,n-1){
        int a = vec[i].fi,b = vec[i].se;
        if(par[a] != b){
            if(n == 2*st[b]){
                flag = i;
                continue;
            }
            ans[i] = (sm[b]-sm[a])/(n-2*st[b]);
        }else{
            if(n == 2*st[a]){
                flag = i;
                continue;
            }
            ans[i] = (sm[a]-sm[b])/(n-2*st[a]);
        }
    }
    if(flag >= 0){
        rep(i,n-1){
            int a = vec[i].fi,b = vec[i].se;
            if(flag == i){
                graph[a].pb((edge){b,0LL}),graph[b].pb((edge){a,0LL});
            }else{
                graph[a].pb((edge){b,ans[i]}),graph[b].pb((edge){a,ans[i]});
            }
        }
        int a = vec[flag].fi, b = vec[flag].se;
        sma = 0;
        if(par[a] != b){
            redfs(a,-1,0);
            ans[flag] = (sm[a]-sma) / st[b];
        }else{
            redfs(b,-1,0);
            ans[flag] = (sm[b]-sma) / st[a];
        }
    }
    rep(i,n-1){
        cout << ans[i] << "\n";
    }
    return 0;
}


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

using namespace std;

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

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

    int a,b;cin>>a>>b;
    cout<<(a-1)*(b-1)<<endl;
}


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

using namespace std;

int main()
{
	int m,n,p,sum;
	while(cin>>m>>n)
	{
		sum=m+n;
		p=0;
		for(;sum!=0;sum=sum/10)
		{
			p++;
		}
		cout<<p<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long
#define ALL(a) (a).begin(), (a).end()

using namespace std;

int main() {
  vector<int> works[100002];

  int n, m;
  scanf("%d %d", &n, &m);

  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d %d", &a, &b);

    works[a].emplace_back(b);
  }

  priority_queue<int, std::vector<int>, std::less<int>> pq;

  ll sum = 0;
  for (int d = 1; d <= m; d++) {
    for (int i = 0; i < works[d].size(); i++) {
      pq.push(works[d][i]);
    }

    if (pq.size() >= 1) {
      sum += pq.top();
      pq.pop();
    }
  }

  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 5632
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
#include <map>
using namespace std;

typedef long long ll;
const ll inf = 1e15;

int main() {
    int n;
    scanf("%d",&n);
    vector<pair<int,int>> ps;
    for (int i = 0; i < n; i++) {
        int tmp;
        scanf("%d",&tmp);
        ps.emplace_back(tmp,i+1);
    }
    sort(ps.begin(),ps.end());
    for (int i = 0; i < n; i++) {
        printf("%d ",ps[i].second);
    }
    printf("\n");
}

Measured memory_bytes: 1780
#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
//#define MOD (1000000007)
#define MOD (998244353)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
//ifstream cinn("input.txt");ofstream coutt("output.txt");

vi adj[2005];
int n,x,y,dp[2005];
int dis[2005][2005];

void bfs(int src){
    for(int i=1;i<=n;i++)dis[src][i]=INF;
    
    queue<int> q;
    q.push(src);
    dis[src][src]=0;
    
    while(!q.empty()){
        int cur=q.front();
        q.pop();
        for(int ch:adj[cur]){
            if(dis[src][ch]==INF){
                dis[src][ch]=1+dis[src][cur];
                q.push(ch);
            }
        }
    }
    
    for(int i=1;i<=n;i++){
        dp[dis[src][i]]++;
    }
}

signed main(){
    FASTER;
    cin>>n>>x>>y;
    
    for(int i=1;i<=n-1;i++){
        adj[i].push_back(i+1);
        adj[i+1].push_back(i);
    }
    adj[x].push_back(y);
    adj[y].push_back(x);
    for(int i=1;i<=n;i++)bfs(i);
    
    for(int k=1;k<=n-1;k++){
        cout<<dp[k]/2<<"\n";
    }
    
}

Measured memory_bytes: 31744
#include <iostream>
#include <cstdio>
#include <cstring>

int main()
{
    char str[101];
    bool flg = true;

    scanf("%s", str);
    for (int i = 0; i < strlen(str); i += 2) {
        if (str[i] == 'L') {
            flg = false;
            break;
        }
    }

    for (int i = 1; i < strlen(str); i += 2) {
        if (str[i] == 'R') {
            flg = false;
            break;
        }
    }

    if (flg) {
        std::cout << "Yes" << std::endl;
    } else {
        std::cout << "No" << std::endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(int (i)=(n);(i)>=0;(i)--)
#define INF (1ll<<60)
typedef long long lint;
const lint MOD =1000000007;

int main(){
lint N,ans=0;
string s;
cin>>N>>s;
rep(i,N){
  if(s[i]==s[i+1]){
    if(i==(N-1))ans++;
    continue;
  }
  ans++;
}
cout<<ans;
}

Measured memory_bytes: 512
//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const int INF= 1e9+5;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
int main(){
  ll x,y;
  cin>>x>>y;
  ll count=0;
  while(x<=y){
    x*=2;
    count++;
  }
  cout<<count<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  vector<int> ret(n + 1);
  for (int k = n; k >= 1; k--) {
    for (int i = k; i >= 1; i--) {
      if (a[i] > i) {
        cout << -1 << '\n';
        return 0;
      } else if (a[i] == i) {
        ret[k] = i;
        a.erase(a.begin() + i);
        break;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << ret[i] << '\n';
  }
  return 0;
}

Measured memory_bytes: 256
using System;
using System.Text;

public class Test
{
	static public void Main( )
	{
		string strs = Console.ReadLine();
		StringBuilder output = new StringBuilder();
		for( var i=0; i<strs.Length; i++ ) {
			if( char.IsUpper( strs[i] ) ) {
				output.Append( char.ToLower( strs[i] ) );
			} else {
				output.Append( char.ToUpper( strs[i] ) );
			}
		}
		Console.WriteLine( output );
	}
}

Measured memory_bytes: 9256
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define reps(i, n) for (int i = 1, i##_len = (int)(n); i <= i##_len; i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define repi(i, x) \
	for (auto i = (x).begin(), i##_fin = (x).end(); i != i##_fin; i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a) ? "Yes" : "No")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int, int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long, long long> P;
typedef vector<P> VP;
template <class T>
inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return 1;
	}
	return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return 1;
	}
	return 0;
}
const long long INFLL = 1LL << 60;
const int INF         = 1 << 30;
const double PI       = acos(-1);
int main() {
	int n;
	int ans = 0;
	cin >> n;
	int sum = (n % 2 == 0) ? n + 1 : n;

	vector<pair<int, int>> path;
	for (int i = 1; i <= n; i++) {
		for (int j = i + 1; j <= n; j++) {
			if (sum - i != j) {
				path.push_back(mp(i, j));
			}
		}
	}

	cout << path.size() << endl;
	repi(itr, path) { printf("%d %d\n", itr->F, itr->S); }
}
/*
1=2 3 (1 4)
2=1 4 (2 3)
3=1 4 (2 3)
4=2 3 (1 4)

1=2 (3)
2=1 (3)
3=1 2

1=2 3 5(1 4)=10
2=1 4 5(2 3)=10
3=1 4 5(3 2)=10
4=2 3 5(4 1)=10
5=1 2 3 4=10
15 *2 = 30 (6)
*/

Measured memory_bytes: 3828
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define MAX 20

struct data{
  int id,cnt,sum;
  int p[MAX];
  void init(int x){
    id=x;
    cnt=sum=0;
    for(int i=0;i<MAX;i++)p[i]=0;
  }
  bool operator < (const data &p)const{
    if(cnt!=p.cnt)return cnt < p.cnt;
    if(sum!=p.sum)return sum > p.sum;
    return id > p.id;
  }
};

int T,P,R;
data t[100];

int main(){
  while(1){
    cin>>T>>P>>R;
    if(T==0&&P==0&&R==0)break;
    for(int i=0;i<T;i++)t[i].init(i+1);
    for(int i=0;i<R;i++){
      int a,b,c;
      string str;
      cin>>a>>b>>c>>str;
      a--,b--;
      if(str=="WRONG"){
	t[a].p[b]++;
      }else{
	t[a].cnt++;
	t[a].sum+=(t[a].p[b]*1200+c);
      }
    }

    sort(t,t+T);
    reverse(t,t+T);
    for(int i=0;i<T;i++){
      cout<<t[i].id<<' '<<t[i].cnt<<' '<<t[i].sum<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 1252
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
using ll = long long;
using ull = unsigned long long;
using namespace std;
#define int long long
#define CONTAINS_VEC(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
#define CONTAINS_SET(m, a) (m).find((a)) != m.end()
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }

signed main()
{
	int N, A, B;
	cin >> N;
	if (N == 1)
	{
		cout << "Hello World" << endl;
	}
	else
	{
		cin >> A >> B;
		cout << A + B << endl;
	}
}



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

int main(){
    long long N;
    cin >> N;
    string S;
    const char *s = NULL;
    cin >> S;
    s = S.c_str();
    long long rgb[N+1];
    long long i;
    for(i = 1; i <= N; i++){
        if(s[i-1] == 'R'){
            rgb[i] = 0;
        }
        if(s[i-1] == 'G'){
            rgb[i] = 1;
        }
        if(s[i-1] == 'B'){
            rgb[i] = 2;
        }
    }
    long long sum[N+1][3];
    sum[N][0] = 0;
    sum[N][1] = 0;
    sum[N][2] = 0;
    long long j;
    for(j = 0; j <= 2; j++){
        for(i = N; i >= 2; i--){
            sum[i-1][j] = sum[i][j] + (rgb[i] == j);
        }
    }
    long long ans = 0;
    for(i = 1; i <= N-2; i++){
        if(rgb[i] == 0){
            for(j = i+1; j <= N-1; j++){
                if(rgb[j] == 1){
                    ans += sum[j][2];
                    if(j + (j-i) <= N){
                        if(rgb[j+(j-i)] == 2){
                            ans -= 1;
                        }
                    }
                }
                if(rgb[j] == 2){
                    ans += sum[j][1];
                    if(j + (j-i) <= N){
                        if(rgb[j+(j-i)] == 1){
                            ans -= 1;
                        }
                    }
                }
            }
        }
        if(rgb[i] == 1){
            for(j = i+1; j <= N-1; j++){
                if(rgb[j] == 0){
                    ans += sum[j][2];
                    if(j + (j-i) <= N){
                        if(rgb[j+(j-i)] == 2){
                            ans -= 1;
                        }
                    }
                }
                if(rgb[j] == 2){
                    ans += sum[j][0];
                    if(j + (j-i) <= N){
                        if(rgb[j+(j-i)] == 0){
                            ans -= 1;
                        }
                    }
                }
            }
        }
        if(rgb[i] == 2){
            for(j = i+1; j <= N-1; j++){
                if(rgb[j] == 0){
                    ans += sum[j][1];
                    if(j + (j-i) <= N){
                        if(rgb[j+(j-i)] == 1){
                            ans -= 1;
                        }
                    }
                }
                if(rgb[j] == 1){
                    ans += sum[j][0];
                    if(j + (j-i) <= N){
                        if(rgb[j+(j-i)] == 0){
                            ans -= 1;
                        }
                    }
                }
            }
        }
    }
    cout << ans << endl;
    system("pause");
    return 0;
}

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

int main(){
  int n;
  int red=0,blue=0;
  string s;
  cin >> n >> s;
  
  for(int i=0; i<n; i++){
    if(s.at(i) =='R'){
      red++;
    }else{
      blue++;
    }
  }
  
  if(red > blue){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256