akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
typedef long long int ll;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T>
bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false;}
template<typename T>
bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false;}
// clang-format on

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int h, w, a, b;
    cin >> h >> w >> a >> b;
    REP(i, 0, b) {
        REP(j, 0, a) {
            cout << 0;
        }
        REP(j, a, w) {
            cout << 1;
        }
        cout << endl;
    }
    REP(i, b, h) {
        REP(j, 0, a) {
            cout << 1;
        }
        REP(j, a, w) {
            cout << 0;
        }
        cout << endl;
    }
    return 0;
}


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

#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ALL(x) (x).begin(), (x).end()

using namespace std;
typedef long long ll;

int main()
{
    IOS

    int n, mul500, mul5;
    cin >> n;
    mul500 = ( n / 500 );

    if ( mul500 > 0 )
    {
        n = n - ( mul500 * 500 );
    }

    mul5 = ( n / 5 );

    cout << ( mul500 * 1000 + mul5 * 5 );

    return 0;
}


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

using namespace std;

int main()
{
    int arr[100]={}, a;
    for(int i=0; i<3; i++){
        cin >> a;
        arr[a-1]++;
    }

    int cnt=0;
    for(int i=0; i<100; i++){
        if(arr[i]) cnt++;
    }

    cout << cnt << endl;

    return 0;
}


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

void call(int n){
  int i = 1;
 CHECK_NUM:
  int x = i;
  if ( x % 3 == 0 ){
    cout << " " << i;
    goto END_CHECK_NUM;
  }
 INCLUDE3:
  if ( x % 10 == 3 ){
    cout << " " << i;
    goto END_CHECK_NUM;
  }
  x /= 10;
  if ( x ) goto INCLUDE3;
 END_CHECK_NUM:
  if ( ++i <= n ) goto CHECK_NUM;

  cout << endl;
}

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

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

int main(){
	vector<int> dice(6);
	int n;
	for(auto &a: dice){
		cin >> a;
	}
	cin >> n;
	int tmp;
	for(int i = 0; i < n; i++){
		int top,front;
		cin >> top >> front;
		while (1){
			if (dice[0] == top) break;
			tmp =dice[0];
			dice[0] =dice[1];
			dice[1] =dice[5];
			dice[5] =dice[4];
			dice[4] = tmp;
			if (dice[0] == top) break;
			tmp =dice[0];
			dice[0] =dice[1];
			dice[1] =dice[5];
			dice[5] =dice[4];
			dice[4] = tmp;
			if (dice[0] == top) break;
			tmp =dice[0];
			dice[0] =dice[3];
			dice[3] =dice[5];
			dice[5] =dice[2];
			dice[2] = tmp;
			if (dice[0] == top) break;
			tmp =dice[0];
			dice[0] =dice[3];
			dice[3] =dice[5];
			dice[5] =dice[2];
			dice[2] = tmp;
		}
		while (dice[1] != front){
            tmp =dice[1];
			dice[1] =dice[2];
			dice[2] =dice[4];
			dice[4] =dice[3];
			dice[3] = tmp;
        }
	cout << dice[2] << endl;	
	}
	return 0;
}	

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

#define ARG4(_1, _2, _3, _4, ...) _4
#define rep(...) ARG4(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define REP(i, a) FOR(i, 0, a)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define rrep(...) ARG4(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define RREP(i, a) RFOR(i, 0, a)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (int)(a); --i)
#define ALL(c) (c).begin(), (c).end()
#define TEN(n) ((ll)(1e##n))
#define pb emplace_back
#define mp make_pair
#define fi first
#define se second
#define let const auto
#define USE_T template <typename T>
#define USE_Ti template <typename T = int>
#define USE_TU template <typename T, typename U>

USE_Ti using duo = std::pair<T, T>;
USE_Ti using vec = std::vector<T>;
using ll = long long;
// clang-format off
USE_TU inline bool chmax(T&x,U a){return x<a&&(x=a,1);}
USE_TU inline bool chmin(T&x,U a){return a<x&&(x=a,1);}
USE_Ti inline T in(){T x;std::cin>>x;return x;}
USE_Ti inline vec<T> in(int n){vec<T> v;v.reserve(n);rep(i,n)v.pb(in<T>());return v;}
USE_T inline void in(T*x,int n){rep(i,n)x[i]=in<T>();}
struct IoSetup {
  IoSetup(){
    using namespace std;
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<setprecision(10);
    cerr<<setprecision(10);
  }
} iosetup;
// clang-format on
// }}}
using namespace std;
const int inf = 1001001001;
const ll infll = 1001001001001001001ll;
const int dd[] = {0, 1, 0, -1, 0};

int sum(const vec<int>& v, int l, int r, int M) {
  int s = 0;
  rep(i, l, r) { s += v[i]; }
  return M * (r - l) - s;
}

signed main() {
  int N = in(), M = in();
  vec<int> W(N), R(N), B(N);
  REP(i, N) {
    string s;
    cin >> s;
    W[i] = std::count(ALL(s), 'W');
    R[i] = std::count(ALL(s), 'R');
    B[i] = std::count(ALL(s), 'B');
  }
  int ans = inf;
  rep(i, 1, N) {
    rep(j, i + 1, N) {
      int w = sum(W, 0, i, M);
      int b = sum(B, i, j, M);
      int r = sum(R, j, N, M);
      chmin(ans, w + b + r);
    }
  }
  cout << ans << endl;
  return 0;
}

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

int value[100];
int weight[100];
int memo[100][10001];
int max_value(int k, int w) {
  if(k == -1) return 0;

  int &res = memo[k][w];
  if(res != -1) return res;

  if(w >= weight[k]) res = max(res, value[k] + max_value(k - 1, w - weight[k]));
  res = max(res, max_value(k - 1, w));
  // cerr << "k = " << k << ", w = " << w << ", res = " << res << endl;
  return res;
}

int main() {
  ios::sync_with_stdio(false);
  memset(memo, -1, sizeof(memo));
  int n, W; cin >> n >> W;
  for(int i = 0; i < n; i++) {
    cin >> value[i] >> weight[i];
  }
  cout << max_value(n - 1, W) << endl;
}

Measured memory_bytes: 5112
// AOJ Volume 0 Problem 0064

#include <stdio.h>
#include <string.h>

int main(void)
{
    char in_str[81];
	int sum;
	int num;
	int i;
	
	sum = 0;
	while (scanf("%s", &in_str) != EOF){
		i = 0;
		num = 0;
		while (in_str[i] != '\0'){
			if ('0' <= in_str[i] && in_str[i] <= '9'){
				num = num * 10 + in_str[i] - '0';
			}
			else {
				sum += num;
				num = 0;
			}
			i++;
		}
		sum += num;
	}

	printf("%d\n", sum);
	
	return (0);
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define mset(a, b) memset(a, b, sizeof(a))
#define mcpy(a, b) memcpy(a, b, sizeof(a))
using namespace std;
typedef long long LL;
const int MAXN = 1000006;

template <typename T> inline void read(T &AKNOI) {
	T x = 0, flag = 1;
	char ch = getchar();
	while (!isdigit(ch)) {
		if (ch == '-') flag = -1;
		ch = getchar();
	}
	while (isdigit(ch)) {
		x = x * 10 + ch - '0';
		ch = getchar();
	}
	AKNOI = flag * x;
}

template <typename T> inline void cmin(T &x, T y) {
	if (x > y) x = y;
}

template <typename T> inline void cmax(T &x, T y) {
	if (x < y) x = y;
}

char s[MAXN];
int n, a[MAXN];

inline bool C(int x, int y) {
	return ((x & y) == y);
}

void init() {
	read(n);
	scanf("%s", s + 1);
	for (int i = 1; i <= n; ++i) {
		a[i] = s[i] - '0' - 1;
	}
}

void solve() {
	if (n == 2) {
		printf("%d\n", abs(a[1] - a[2]));
		return;
	}
	int ans = 0, h1 = 0;
	for (int i = 1; i <= n; ++i) {
		if (a[i] == 1) {
			ans ^= C(n - 1, i - 1);
			h1 = 1;
		}
	}
	if (ans) {
		printf("1\n");
		return;
	}
	if (h1) {
		printf("0\n");
		return;
	}
	ans = 0;
	for (int i = 1; i <= n; ++i) {
		if (a[i] == 2) {
			ans ^= C(n - 1, i - 1);
		}
	}
	printf("%d\n", ans * 2);
}

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


Measured memory_bytes: 5120
def main():
    a, b, c, d = (int(i) for i in input().split())

    def gcd(x, y):
        if y == 0:
            return x
        while y != 0:
            x, y = y, x % y
        return x

    def lcm(x, y):
        return x*y//gcd(x, y)

    def f(x):
        p = x//c
        q = x//d
        r = x//lcm(c, d)
        return x - p - q + r

    print(f(b) - f(a-1))


if __name__ == '__main__':
    main()


Measured memory_bytes: 38384
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int Ans=0;
  long long X;
  cin>>X;
  long long Tmp=100;
  while(Tmp<X)
  {
    Ans++;
    Tmp=Tmp+Tmp/100;
  }
  cout<<Ans<<endl;
  return 0;
}

Measured memory_bytes: 3632
# include <iostream>
# include <cmath>
# include <algorithm>
# include <stdio.h>
# include <cstdint>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <random>
# include <deque>
# include <functional>
# include <iomanip>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <immintrin.h>
# include <cassert>
# include <array>
# include <tuple>
# include <unordered_map>
# include <unordered_set>
# include <thread>

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using ui32 = unsigned int;
constexpr ll INFLL = 1e18;

#define CHECK_IMPL1(cond)              \
if (!(cond)) {                         \
    DEBUG("expected cond: " << #cond); \
    assert(cond);                      \
}

#define CHECK_IMPL2(cond, message)                                            \
if (!(cond)) {                                                                \
    DEBUG("expected cond: " << #cond << " failed with message: " << message); \
    assert(cond);                                                             \
}
#define CHECK_IMPL(_1, _2, NAME, ...) NAME
#define CHECK(...) CHECK_IMPL(__VA_ARGS__, CHECK_IMPL2, CHECK_IMPL1, CHECK_IMPL0)(__VA_ARGS__)

#ifdef __APPLE__
#define DEBUG(message) std::cerr << message << std::endl;
#else
#define DEBUG(message)
#endif

class DFS {
 public:
  DFS(vector<vector<int>>& g, int n) : g_(g), used_(n, 0) {
    int color = 1;
    for (int i = 0; i < n; i++) {
      if (!used_[i]) {
        Run(i, color);
        ++color;
      }
    }
  }

  void Run(int v, int color) {
    used_[v] = color;
    for (auto u : g_[v]) {
      if (used_[u]) {
        continue;
      }
      Run(u, color);
    }
  }

  const vector<int>& GetColors() const {
    return used_;
  }

 private:
  vector<vector<int>>& g_;
  vector<int> used_;
};

void solve() {
  int n, k, l;
  cin >> n >> k >> l;
  vector<vector<int>> g(n);
  for (int i = 0; i < k; i++) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  auto dfs = DFS(g, n);
  g.clear();
  g.resize(n);
  for (int i = 0; i < l; i++) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  auto dfs1 = DFS(g, n);
  auto color1 = dfs.GetColors();
  auto color2 = dfs1.GetColors();
  map<pair<int, int>, int> cnt;
  for (int i = 0; i < n; i++) {
    cnt[{color1[i], color2[i]}] += 1;
  }
  for (int i = 0; i < n; i++) {
    cout << cnt[{color1[i], color2[i]}] << " ";
  }
  cout << "\n";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
#ifdef __APPLE__
  freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
#endif
  int t = 1;
//  cin >> t;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}


Measured memory_bytes: 21760
def get_int(s, si, ei=None):
    #print(f'get_int: s={s}, si={si}, ei={ei}')
    if ei is None:
        value = int(s[si:])
    else:
        value =  int(s[si:ei])
    #print(f'value={value}')
    return value


BIT = 1

str_s = input()
s = int(str_s)
slen = len(str_s)

result = 0
for i in range(2 ** (slen - 1) ):
    #print(f'======= i={bin(i)} ========')
    s_index = 0
    for k in range(slen - 1):
        bit = (i >> k) & BIT        
        if bit == 0:
            continue
        e_index = k + 1
        value = get_int(str_s, s_index, e_index)
        result += value
        s_index = e_index
    value = get_int(str_s, s_index)
    result += value

print(result)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);++(i))
#define all(x) (x).begin(),(x).end()
#define dump(x) cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define yes(n) cout << ((n) ? "yes" : "no") << endl

using namespace std;
using ll = long long;
using P = pair<int, int>;

const int INF = 1001001001;
const vector<int> di = {-1,  0, 1, 0};
const vector<int> dj = { 0, -1, 0, 1};

void chmin(int &a, int b) { if (a > b) a = b; }

ll GCD(ll a, ll b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}
ll LCM(ll a, ll b) {
    ll g = GCD(a, b);
    return a / g * b;
}


int main() {
    int n; cin >> n;
    vector<int> a(n);
    vector<pair<int, int>> p;
    rep(i, n) {
        int b; cin >> b;
        p.emplace_back(b, i + 1);
    }
    sort(all(p));

    rep(i, n) cout << p[i].second << " ";
    cout << endl;
}

Measured memory_bytes: 2164
/*  ex3_3
    UMAboogie */
#include <stdio.h>

int main(void){
  int num,base;
  int digit = 1; //桁数の初期状態を1とする
  scanf("%d %d",&num,&base); //整数と何進法にするかを入力
  while(num >= base){ //もしnumがまだbaseで割れる時、
    num = num / base; //numをbaseで割った整数値をnumに代入
    digit += 1;  //桁数を1大きくする
  }
  printf("%d\n",digit); //桁数を出力

  return 0;
}


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

int main() {
    int n; cin >> n;
    if(n % 2 == 0){
        double a = 1 / 2.0;
        cout << a << endl;
    } else {
        double a = ((n + 1) / 2.0 ) / n;
        cout << a << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()




int main(){
    long double a,b; cin>>a>>b;
    ll ans=floor(a*b);
    cout<<ans<<endl;
}

Measured memory_bytes: 3724
#include <iostream>
#include <algorithm>
#include <string>
#define flush fflush(stdout)
using namespace std;
typedef long long ll;
typedef pair<ll, int> P;
const int mod = (int)2019, INF = (int)1e9;
const int di[4] = { 1,0,-1,0 }, dj[4] = { 0,1,0,-1 };


int main(void) {
	int n, i, mr[2020] = {};
	ll r, dd, k[200003] = {}, ans;
	string s;

	cin >> s;

	n = s.size();

	r = 0;
	dd = 1;
	for (i = n - 1; i >= 0; i--) {
		r = (r + (s[i] - '0') * dd % mod) % mod;
		dd = dd * 10 % mod;
		k[i] = r;
	}

	mr[0] = 1;
	for (i = 0; i < n; i++) {
		mr[k[i]]++;
	}

	ans = 0;
	for (i = 0; i < 2019; i++) {
		ans += mr[i] * (mr[i] - 1) / 2;
	}

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

	return 0;
}

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


Measured memory_bytes: 5600
n=int(input())
s=list(input())
li_and=[]
for i in range(n):
    s_a=s[0:i+1]
    s_b=s[i+1:n]
    s_and = len(list(set(s_a) & set(s_b)))
    li_and+=[s_and]
print(max(li_and))

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

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007
#define INF (1 << 30)
#define REP(i, m, n) for(int i = (int)m; i < (int)n; ++i)
#define rep(i, n) REP(i, 0, n)


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

    int n; cin >> n;
    int ans = 0;
    rep(i, n) {
        int l, r; cin >> l >> r;
        ans += (r-l)+1;
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <numeric>

using namespace std;

inline int ctoi(const char c)
{
	return c >= '0'&&c <= '9' ? c - '0' : -1;
}

int main()
{
	int i;

	int n;
	cin >> n;

	int cnt = 0;

	vector<int> a(n);
	for (i = 0; i < n; i++) {
		cin >> a[i];
	}

	int push = 0;
	for (i = 0; i < n; i++) {
		if (a[push] == 2) {
			cout << i + 1 << endl;
			return 0;
		}
		else {
			push = a[push] - 1;
		}
	}
	cout << -1 << endl;
	return 0;
}


Measured memory_bytes: 640
/*
Author: Racer5x
 ***************************************   UNAUTHORISED COPYING OF CODE PROHIBITED   **********************************
*/
 
// #pragma GCC optimize("O3")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#include<bits/stdc++.h>
#define int         long long
#define double      long double
#define pb          emplace_back
#define pf          emplace_front
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
#define x           first
#define y           second
#define endl        '\n'
#define hell        998244353 
#define PI          3.141592653589
#define tezz        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define MAX         2000000000000000000
#define M           1000000007
using namespace std;
 
signed main()
{
    tezz
    
    int n, m;
    cin>>n>>m;

    int mat[n][m];
    memset(mat, 0, sizeof(mat));

    int nn;
    cin>>nn;

    vi v(nn);
    for(int &x:v) cin>>x;

    int curr = 1, id = 0;
   	for(int i=0;i<n;i++){
   		if(i&1){
   			for(int j=m-1;j>=0;j--){
   				mat[i][j] = curr;
   				id++;
   				if(id == v[curr-1]) curr++, id = 0;
   			}
   		}
   		else{
   			for(int j=0;j<m;j++){
   				mat[i][j] = curr;
   				id++;
   				if(id == v[curr-1]) curr++, id = 0;
   			}
   		}
   	}

   	for(int i=0;i<n;i++){
   		for(int j=0;j<m;j++) cout<<mat[i][j]<<' ';
   			cout<<endl;
   	}
} 

Measured memory_bytes: 512
#include <cstdio>
#include <vector>
#include <stack>
#include <iostream>
#include <string>
#include <tuple>
#include <random>
#include <map>
#include <queue>
#include <set>
#include <complex>
#include <algorithm>
#include <cassert>
#include <iterator>
#include <numeric>
#include <chrono>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;

const ll INF = 1e15;


int main() {
	ll N;
	cin >> N;
	vector<ll> D(N);
	vector<ll> Dc(20);
	Dc[0]=1;
	ll bigc = 0;
	for (int i = 0;i < N;i++) {
		cin >> D[i];
		Dc[D[i]]++;
		bigc = max(bigc, Dc[D[i]]);
	}
	if (N >= 24) {
		cout << "0" << endl;
		return 0;
	}
	if (N >= 12) {// 0~1
		if (bigc >= 3)
			cout << "0" << endl;
		else
			cout << "1" << endl;
		return 0;
	}
	ll ans = 0;
	for (ll i = 0;i < (ll)1 << N; i++) {
		vector<ll> v(1, 0);
		for (ll k = 0;k < N;k++) {
			ll now = 1 << k;
			if ((i&now) != 0)
				v.push_back(D[k]);
			else
				v.push_back(24 - D[k]);
		}
		ll nowans = INF;
		sort(v.begin(), v.end());
		for (int j = 0;j <= N;j++)
			nowans = min(nowans, (v[(j+1)%(N+1)] - v[j] + 24)%24);
		ans = max(ans, nowans);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
n, t = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]

ans = 0
til = 0

for i in range(n):
    if A[i] >= til:
        ans += t
    else:
        ans += A[i] - A[i - 1]
    til = A[i] + t


print(ans)


Measured memory_bytes: 103848
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
	int x;
	cin >> x;
	if (x >= 30) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

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

using namespace std;

int main(void) {
  int q;
  cin >> q;
  vector<int> v;

  for(int i = 0; i < q; i++) {
    int command, x, p;
    cin >> command;
    switch(command) {
      case 0: 
        cin >> x;
        v.push_back(x);
        break;
      case 1:
        cin >> p;
        cout << v[p] << endl;
        break;
      case 2:
        v.pop_back();  
        break;
    }
  }
  
}


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

void Main() {
  int x;
  cin >> x;
  vector<int> sosu;
  sosu.push_back(2);
  if (x == 2) {
    cout << 2 << endl;
    return;
  }
  for (int i = 3; ; i++) {
    bool ans = true;
    for (int p: sosu) {
      if (i % p == 0) {
        ans = false;
        break;
      }
    }
    if (ans) {
      sosu.push_back(i);
      if (i >= x) {
        cout << i << endl;
        return;
      }
    }
  }
}

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


Measured memory_bytes: 384
import sys

if sys.subversion[0] == "PyPy":
    import io, atexit

    sys.stdout = io.BytesIO()
    atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

    sys.stdin = io.BytesIO(sys.stdin.read())
    input = lambda: sys.stdin.readline().rstrip()
RS = raw_input
RA = lambda x=int: map(x, RS().split())
RN = lambda x=int: x(RS())


def solve():
    if ord(a) > ord("Z"):
        print "a"
    else:
        print "A"
    return




a = RS()
solve()


Measured memory_bytes: 85932
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;

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

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

int main() {
  int a, b;
  cin >> a >> b;
  cout << (a - 1) + (b >= a) << endl;
}

Measured memory_bytes: 256
import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

void readV(T...)(ref T t){auto r=readln.splitter;foreach(ref v;t){v=r.front.to!(typeof(v));r.popFront;}}

void main()
{
  int n, m; readV(n, m);
  auto t = 1900*m + 100*(n-m);
  writeln(t*2^^m);
}


Measured memory_bytes: 256
import sys
N, A, B, C = map(int, input().split())
length = [int(input()) for _ in range(N)]
INF = 10 ** 9


def dfs(cur, a, b, c):
    if cur == N:
        # INFが返ってくるのは，A，B，Cいずれかの材料が1本も存在しない時（棄却する）
        ret = abs(a - A) + abs(b - B) + abs(c - C) if min(a, b, c) > 0 else INF
        return abs(a - A) + abs(b - B) + abs(c - C) if min(a, b, c) > 0 else INF
    # 合成するたびに10必要になる
    ret1 = dfs(cur + 1, a + length[cur], b, c) + (10 if a else 0)
    ret2 = dfs(cur + 1, a, b + length[cur], c) + (10 if b else 0)
    ret3 = dfs(cur + 1, a, b, c + length[cur]) + (10 if c else 0)
    # 使わない
    ret0 = dfs(cur + 1, a, b, c)
    return min(ret0, ret1, ret2, ret3)


print(dfs(0, 0, 0, 0))


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <unordered_set>
#include <queue>

using namespace std;
typedef long long ll;

int main(){
    ll n, m;
    cin >> n >> m;
    vector<ll> p(n);
    for(int i = 0; i < n; ++i){
        cin >> p.at(i);
        p.at(i)--;
    }
    vector<vector<ll>> net(n);
    for(int i = 0; i < m; ++i){
        ll x, y;
        cin >> x >> y;
        x--; y--;
        net.at(x).push_back(y);
        net.at(y).push_back(x);
    }

    ll ans = 0;
    vector<bool> visited(n, false);
    for(int i = 0; i < n; ++i){
        if(visited.at(i)){ continue; }
        queue<ll> q;
        unordered_set<ll> np, ni;
        q.push(i);
        np.insert(p.at(i));
        ni.insert(i);
        while(!q.empty()){
            ll j = q.front();
            q.pop();
            visited.at(j) = true;
            np.insert(p.at(j));
            ni.insert(j);
            for(ll k : net.at(j)){
                if(visited.at(k)){ continue; }
                q.push(k);
            }
        }
        for(ll x : ni){
            if(np.count(x)){ ans++; }
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 14400
def get_answer(input_list):
    c_list = [int(v) for v in input_list[0].split(" ")]
    n = c_list[0]
    k = c_list[1]
    q = c_list[2]
    a = [int(v) for v in input_list[1:]]
    ns = [k - q] * n
    for aa in a:
        index = aa - 1
        ns[index] += 1
        """
        for i in range(len(ns)):
            if i != index:
                ns[i] -= 1
        """

    nr = [""] * n
    for i in range(len(ns)):
        if ns[i] <= 0:
            nr[i] = "No"
        else:
            nr[i] = "Yes"

    return nr



if __name__ == "__main__":
    input_list = []
    while True:
        try:
            input1 = input()
            if not input1:
                break
            if len(input1) == 0:
                break
            input_list.append(input1)
        except EOFError:
            break
    for a in get_answer(input_list):
        print(a)


Measured memory_bytes: 16792
#include <bits/stdc++.h>
using namespace std;
#define arep(i, x, n) for (int i = int(x); i < (int)(n); i++)
#define rep(i, n) for (long long i = 0; i < n; ++i)
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9 + 7
using ll = long long;

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

    vector<ll> a(n);

    rep(i, n) { cin >> a.at(i); }

    sort(a.begin(), a.end(), greater<ll>());
    ll aScore = 0;
    ll vScore = 0;

    rep(i, n) {
        if (i % 2 == 0) {
            aScore += a[i];
        } else {
            vScore += a[i];
        }
    }

    cout << aScore - vScore << endl;
}

Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <string>

#define INPUT_FROM_FILE (0)
#if INPUT_FROM_FILE
#include <fstream>
#endif

#define ROOT (0)
#define INTERNAL_NODE (1)
#define LEAF (2)

class Node{
public:
	int parent;
	int left;
	int right;

	Node() : parent(-1), left(-1), right(-1){
		return;
	}

	~Node(){
		return;
	}

	int get_type(){
		if(parent == -1){
			return ROOT;
		}
		else if(left != -1 || right != -1){
			return INTERNAL_NODE;
		}
		else{
			return LEAF;
		}
	}

};

int get_root(const std::vector<Node> &nodes, int i){
	int root = -1;
	for(unsigned int i = 0; i < nodes.size(); i++){
		if(nodes[i].parent == -1){
			root = i;
			break;
		}
	}
	return root;
}

void print_preorder(const std::vector<Node> &nodes, int i){
	int lid = nodes[i].left;
	int rid = nodes[i].right;

	std::cout << " " << i;
	
	if(lid >= 0){
		print_preorder(nodes, lid);
	}
	if(rid >= 0){
		print_preorder(nodes, rid);
	}
	
}

void print_inorder(const std::vector<Node> &nodes, int i){
	int lid = nodes[i].left;
	int rid = nodes[i].right;

	if(lid >= 0){
		print_inorder(nodes, lid);
	}

	std::cout << " " << i;

	if(rid >= 0){
		print_inorder(nodes, rid);
	}
}

void print_postorder(const std::vector<Node> &nodes, int i){
	int lid = nodes[i].left;
	int rid = nodes[i].right;

	if(lid >= 0){
		print_postorder(nodes, lid);
	}
	if(rid >= 0){
		print_postorder(nodes, rid);
	}
	std::cout << " " << i;
}

int main(int argc, char **argv){
#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
#endif
	int n = 0;
	std::vector<Node> node_vec;
	int root = 0;

#if INPUT_FROM_FILE
	ifs >> n;
#else
	std::cin >> n;
#endif

	node_vec.resize(n);

	for(int i = 0; i < n; i++){
		int id = -1;
		int left = -1;
		int right = -1;

#if INPUT_FROM_FILE
		ifs >> id >> left >> right;
#else
		std::cin >> id >> left >> right;
#endif
		node_vec[id].left = left;
		node_vec[id].right = right;
		
		if(left >= 0){
			node_vec[left].parent = id;
		}
		if(right >= 0){
			node_vec[right].parent = id;
		}
	}

	root = get_root(node_vec, 0);

	std::cout << "Preorder" << std::endl;
	print_preorder(node_vec, root);
	std::cout << std::endl;

	std::cout << "Inorder" << std::endl;
	print_inorder(node_vec, root);
	std::cout << std::endl;

	std::cout << "Postorder" << std::endl;
	print_postorder(node_vec, root);
	std::cout << std::endl;
	return 0;
}


Measured memory_bytes: 3108
#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair<ll, ll>
#define F first
#define S second
const int MOD = 1000000007;
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; }
//sort(all(x))とするとソートできるよ
// 10^x は pow(10,(x)) 
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)


// DAGなので、トポロジカルソート後の入次数0の頂点から右に進んで、dp[i]:= 頂点iが終点としたときにの最長の長さ　とおけば、
// chmax(dp[nv],dp[v]+1) とすればいい。　(nvは頂点vから刺さる先の頂点)
// これを考えてみると、vからスタートすると、vは0、nvは１になって・・・・・・と更新が続いていく。
// 結局、入次数0 の頂点からスタートして、進むごとに辺を消去していくので入次数0の頂点を次々と始点としてループしていけば、いずれすべてのルートを通りつくす。
// このとき、一度通った流れはdpに記録されているので、その経路を別から通った時には大きくなるほうにchangeしていく。
// 例としては、 0→1→2→3→4 5→6   h[]は入り次数
//             ↓→→→→→↑ ↓→→→↑
// とあったら、０から始まって、dp[1] = 1 , dp[3] = 1, h[1] = 0 →　dp[2] = 2 h[2] = 0 → chmax(dp[3],dp[2]+1) で dp[3] = 1, dp[2]+1 = 3　なので dp[3] = 3に更新
//                          dp[4] = dp[3]+1 = 4 , dp[6] = dp[4]+1 = 5, chmax(dp[6],dp[5]+1) だけど、dp[5]+1 = 1 なので、dp[6] = 5 が採用。
// よって、dpは [1] = 1
//             [2] = 2
//             [3] = 3
//             [4] = 4
//             [5] = 1
//             [6] = 5
// となる。
// なので、repなり、max_elementなりすれば ans = 5 となる。
// つまり、上の矢印のDAGを作ったあとは、chmaxの回数は結局辺の数になっている。
// よって、トポロジカルソートはO(V+E)なので、全体での計算量は O(V+E+E)になっているような気がする。

// トポロジカルソートをしないと、
//             ↓←←←←←←←←←↑
// 例としては、 0→1→2→3→4 5→6   
//             ↓→→→→→↑ ↓→→→↑

// みたいに、後ろに戻っちゃうやつがでてきたら困るから？こうなると、DPを頭からやっていって答えが一意になる保証がなくなる。
// 仮に上の例だと、トポロジカルソートすると、
//             ↑→→→→→→→→→→→↓
//             5→0→1→2→3→4→6
//               ↓→→→→→↑
// みたいになって確かに、DPしていける感じになる。


int main(){
    int N,M;cin >> N >> M;
    vector<vector<int>> G(N,vector<int>());           // ここをvector<int> G(N+1) にしたら alloc関連のバグが出た。これって、あらかじめ二次元配列ですって宣言しておくと回避できたってこと？
    vector<int> h(N);

    //グラフ化と入次数
    rep(i,M){
        int a,b;cin >> a >> b;
        a--; b--;   //0-index化
        G[a].push_back(b);
        h[b]++;
    }

    //入0のキュー           // スタックで作ったらWAでまくった。おそらく、
    stack<int> zero;

    //zero作成
    rep(i,N)if(h[i] == 0)zero.push(i);

    // BFS
    vector<int> dp(N);
    while(zero.size()){
        int v = zero.top();zero.pop();
        for(auto nv : G[v]){
            h[nv]--; // 辺を破壊する
             chmax(dp[nv],dp[v]+1); 
            if(h[nv] == 0){
                zero.push(nv);  //  入次数0になったのでスタックにつっこむ
                // この時、トポロジカルソートは頂点nvの周りでは完了していると考えられるので、同時並行でDPテーブルを作っちゃう。 ※1
            }
        }
    }

    int res = 0;
    rep(i,N)chmax(res,dp[i]);
    cout << res << endl;

}

// push_back() した時の alloc バグの原因がここにきて2か月ぶりくらいにやっと解明された感ある。

Measured memory_bytes: 6528
#設定
import sys
input = sys.stdin.buffer.readline

#ライブラリインポート
from collections import defaultdict
import itertools

#Binary Indexed Tree
#O(logN)でtに1点加算、t以下の合計を得る

class BIT:
	def __init__(self, N):
		self.size = N
		self.tree = [0] * (N + 1)

	def sum(self, t):
		s = 0
		while t > 0:
			s += self.tree[t]
			t -= t & -t
		return s

	def add(self, t, x):
		while t <= self.size:
			self.tree[t] += x
			t += t & -t

#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	#入力処理
	N = int(input())
	A = getlist()
	B = getlist()
	omote = []
	ura = []
	for i in range(N):
		if i % 2 == 0:
			omote.append([A[i], i])
			ura.append([B[i], i])
		else:
			omote.append([B[i], i])
			ura.append([A[i], i])

	#半分全列挙
	seq = [i for i in range(N)]
	alllist = list(itertools.combinations(seq, int((N + 1) // 2)))
	M = len(alllist)
	#print(alllist)
	ans = float("inf")
	for i in range(M):
		lis = alllist[i]
		USE = [0] * N
		for j in lis:
			USE[j] = 1 #1:表 0:裏
		X = []
		Y = []
		for j in range(N):
			if USE[j] == 1:
				X.append(omote[j])
			else:
				Y.append(ura[j])
		X = sorted(X)
		Y = sorted(Y)
		sequence = []
		for j in range(N):
			if j % 2 == 0:
				sequence.append(X[int(j // 2)])
			else:
				sequence.append(Y[int(j // 2)])
		#print(sequence)
		judge = "Yes"
		for j in range(N - 1):
			if sequence[j][0] > sequence[j + 1][0]:
				judge = "No"
				break
		if judge == "Yes":
			bit = []
			for j in range(N):
				bit.append(sequence[j][1] + 1)
			# print(bit)
			val = 0
			calc = BIT(50)
			for j in range(N):
				calc.add(bit[j], 1)
				val += j + 1 - calc.sum(bit[j])
			# print(val)
			ans = min(ans, val)

	if ans == float("inf"):
		print(-1)
	else:
		print(ans)


# N = int(input())
# M = int(input())
# A = getlist()

# bit = BIT(M)
# for i in range(N):
# 	bit.add(A[i], 1)
# 	ans += i + 1 - bit.sum(A[i])

# print(ans)


if __name__ == '__main__':
	main()

Measured memory_bytes: 52204
def main():
    n = int(input())

    t0, a0 = 1, 1
    v1, v2 = 1, 1
    for i in range(n):
        t, a = map(int, input().split())

        if t != t0 or a != a0:
            x = max((v1+t-1)//t, (v2+a-1)//a)
            v1, v2 = x * t, x * a

        t0, a0 = t, a

    print(v1+v2)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;

int main(){
    int n, k;
    cin >> n >> k;
    ll a = 0LL, b = 0LL;
    for (int i = 1; i <= n; i++){
        if (i % k == 0){
            a++;
        }else if (i % k == k / 2){
            b++;
        }
    }

    ll ans = a * a * a;
    if (k % 2 == 0){
        ans += b * b * b;
    }

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

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#define dlog(str) cout << "====" << str << endl;
#else
#define dlog(str)
#endif
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(int i = 0, i##_l = (n); i < i##_l; i++)
#define FOR(i, s, e) for(int i = s, i##_l = (e); i < i##_l; i++)
#define LLI long long int
#define _min(a,b) ((a<b)?a:b)
#define _max(a,b) ((a<b)?b:a)
#define chmax(a, b) a = _max(a, b)
#define chmin(a, b) a = _min(a, b)
#define bit(a, shift) ((a>>shift)&1))
#define pm(a) ((a)?1:-1)
#define SORT(v) sort(v.begin(),v.end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
// int 2.14E±9    lli 9.2E±18    double 1.7E±380


int main()
{
	cout << fixed << setprecision(10);
	int a, b, c, d;
	cin >> a >> b >> c >> d;

	while (0 < a || 0 < c)
	{
		c -= b;
		if (c <= 0)
		{
			cout << "Yes";
			break;
		}

		a -= d;
		if (a <= 0)
		{
			cout << "No";
			break;
		}

	}

	return 0;
}

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

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

    vector<int> A(N);

    rep(i,N) {
        cin>>A[i];
    }

    int goal,ans=0;
    int c,a;
    c=A[0];
    goal=c; //現在のボタン

    rep(i,N) {
        ans++;

        if (goal==2) {
            cout<<ans<<endl;
            break;
        }
        else {
            goal=A[goal-1];
            
        }
    }

    if (goal != 2) {
        cout<<-1<<endl;
    }
}

Measured memory_bytes: 3720
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
//#include "library/debug.cpp"

struct UnionFind {
    vector<int> par;
    UnionFind(int n)
        : par(n, -1) {}

    int find(int x) {
        if (par[x] < 0)
            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 (par[x] > par[y])
            swap(x, y);
        par[x] += par[y];
        par[y] = x;
    }

    int size(int x) {
        return -par[find(x)];
    }

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

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

    int n, k, l;
    cin >> n >> k >> l;
    UnionFind p(n + 1), q(n + 1);
    rep(i, 0, k) {
        int s, t;
        cin >> s >> t;
        p.unite(s, t);
    }
    rep(i, 0, l) {
        int s, t;
        cin >> s >> t;
        q.unite(s, t);
    }
    vector<tuple<int, int, int>> v;
    rep(i, 1, n + 1) {
        v.emplace_back(p.find(i), q.find(i), i);
    }
    sort(v.begin(), v.end());
    vector<pair<int, int>> x(n);
    rep(i, 0, n) x[i] = {get<0>(v[i]), get<1>(v[i])};
    vector<int> ans(n + 1);

    rep(i, 0, n) {
        ans[get<2>(v[i])] = upper_bound(x.begin(), x.end(), x[i]) - lower_bound(x.begin(), x.end(), x[i]);
    }

    rep(i, 1, n + 1) cout << ans[i] << ' ';
    cout << endl;
    return 0;
}

Measured memory_bytes: 7024
/* 
 * Project: AISing programing Contest A - Number of Multiples
 * Author: toms74209200 <https://github.com/toms74209200>
 *
 * Created on 2020/07/11
 * Copyright (c) 2020 toms74209200
 * 
 * This software is released under the MIT License.
 * http://opensource.org/licenses/mit-license.php
 */
#include <cstdio>
using namespace std;

int l, r, d;

void solve() {

    int cnt = 0;
    for (int i=l;i<=r;i++) {
        if (i%d == 0)
            cnt++;
    }

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

}

int main() {

    scanf("%d", &l);
    scanf("%d", &r);
    scanf("%d", &d);

    solve();

}

Measured memory_bytes: 3240
/*In the name of ALLAH, Most Gracious, Most Merciful*/
#include<bits/stdc++.h>

#define ll                      long long int
#define ull                     unsigned long long int
#define PI                      2*acos(0.0)
#define sqr(x)                  (x)*(x)
#define EPS                     10E-10
#define MOD                     1000000007
#define longlimit               92233720368547758
#define infinity                (1<<28)
#define setbits                 __builtin_popcount
#define zerobits                __builtin_ctzll
#define pb(a)                   emplace_back(a)
#define mp                      make_pair
#define ff                      first
#define ss                      second
#define gcd(a, b)               __gcd(a,b)
#define lcm(a, b)               ((a)*(b))/gcd(a,b)
#define watch(x)                cout << (#x) << " is " << (x) << endl
#define TEST_CASES()            ll t;cin>>t;while (t--)
#define all(a)                  (a.begin()),(a.end())
#define UNIQUE(X)               (X).erase(unique(all(X)),(X).end())
#define DELETE(X)               (X).erase (remove (all(X)),(X).end())
#define SORT_UNIQUE(c)          (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
using namespace std;

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

    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

   ll n,sum=0;
   cin>>n;
   for (int i=1;i<=n;i++)
   {
       for (int j=1;j<=n;j++)
       {
           for (int k=1;k<=n;k++)
           {
               sum+=gcd(gcd(i,j),k);
           }

       }
   }
   cout<<sum<<endl;


}


Measured memory_bytes: 3652
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args){

		solve_abc158_a();
	}
  
  	public static void solve_abc158_a(){

		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		
		boolean a = false;
		boolean b = false;
		
		for(int i=0;i<3;i++){
			
			if(s.charAt(i) == 'A') a = true;
			if(s.charAt(i) == 'B') b = true;
		}

		if(a && b) System.out.println("Yes");
		else System.out.println("No");

		

		sc.close();
	}
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    string a, b, c;
    cin >> a >> b >> c;
  int A = a[0] - 'a';
  int B = b[0] - 'a';
  int C = c[0] - 'a';
    cout << (char)('A' + A) << (char)('A' + B)<<(char)('A' + C)<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<iostream> 
using namespace std;
int N,H,W;
int main(){
	scanf("%d%d%d",&N,&H,&W);
	int ans=0;
	while(N--){
		int a,b;
		scanf("%d%d",&a,&b);
		if(a>=H&&b>=W){
			ans++; 
		}
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<math.h>
#define ll long long



int main(void){
	int n;
	scanf("%d",&n);
	int A[n],B[n];
	for(int i=0;i<n;i++)scanf("%lld%lld",&A[i],&B[i]);
	ll ans=0;
	for(int i=n-1;i>=0;i--){
		if((A[i]+ans)%B[i]==0)continue;
		ans += B[i]-((A[i]+ans)%B[i]);
	}
	printf("%lld",ans);
	return 0;
}

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

#define REP(i, n) for(int (i)=0;(i)<(n);++(i))
#define REPV(iter, v) for(auto (iter)=(v).begin(); (iter)!=(v).end();++(iter))
#define ALL(v) (v).begin(),(v).end()

#define MOD 1000000007

using namespace std;

typedef long long ll;

int main()
{
    ll N;
    cin >> N;
    string ans;
    ll res = N % 10;
    if (res == 2 || res == 4 || res == 5 || res == 7 || res == 9)
    {
        ans = "hon";
    }
    else if (res == 0 || res == 1 || res == 6 || res == 8)
    {
        ans = "pon";
    }
    else
    {
        ans = "bon";
    }
    
    cout << ans << endl;
}


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

#define rep(i,n) for(int i = 0 ; i < n ; i++) 
#define MAX 300
typedef pair<int,int> P;

class Dice{
private:
  int tmp;
public:
  int d[6];

  Dice(){
    rep(i,6){
      d[i] = i+1;
    }
  } 

  void rollN(){
    tmp = d[0];
    d[0] = d[1];
    d[1] = d[5];
    d[5] = d[4];
    d[4] = tmp;
  }
  
  void rollE(){
    tmp = d[0];
    d[0] = d[3];
    d[3] = d[5];
    d[5] = d[2];
    d[2] = tmp;
  }
 
  void rollS(){
    tmp = d[0];
    d[0] = d[4];
    d[4] = d[5];
    d[5] = d[1];
    d[1] = tmp;
  }
 
  void rollW(){
    tmp = d[0];
    d[0] = d[2];
    d[2] = d[5];
    d[5] = d[3];
    d[3] = tmp;
  }

  void rotation(){
    tmp = d[1];
    d[1] = d[3];
    d[3] = d[4];
    d[4] = d[2];
    d[2] = tmp;
  }

  void change(int top,int front){
    rep(i,3){
      rollN();
      if(top == d[0]){
        break;
      }
      rollW();
      if(top == d[0]){
        break;
      }
    }
    rep(i,3){
      if(front == d[1]){
        break;
      }
      rotation();
    }
  }
};

map<P,int> num;
int field[MAX][MAX];

void init(){
  num.clear();
  for(int i = 0 ; i < MAX ; i++){
    for(int j = 0 ; j < MAX ; j++){
      field[i][j] = -1;
    }
  }
}

bool check(P a, P b){
  return num[a] > num[b];
}

int main(){
  int N;
  const int dx[] = {0,1,-1,0};
  const int dy[] = {1,0,0,-1};
  while(cin >> N, N){
    int t, f;
    Dice dice;
    init();
    rep(i,N){
      int x = 150, y = 150;
      cin >> t >> f;
      dice.change(t, f);
      if(i == 0){
        num[P(y,x)]++;
        field[y][x] = dice.d[0];
      }else{
        while(true){
          int pos = 0, max = 0;
          for(int j = 1 ; j < 5 ; j++){
            if(dice.d[j] < 4) continue;
            int nx = x + dx[j-1];
            int ny = y + dy[j-1];
            if(max < dice.d[j] && check(P(y,x),P(ny,nx))){
              max = std::max(max,dice.d[j]);
              pos = j-1;
            }
          }
          if(max == 0){
            num[P(y,x)]++;
            field[y][x] = dice.d[0];
            break;
          }

          x += dx[pos];
          y += dy[pos];

          switch(pos){
          case 0:
            dice.rollS();
            break;
          case 1:
            dice.rollE();
            break;
          case 2:
            dice.rollW();
            break;
          case 3:
            dice.rollN();
            break;
          }
        }
      }
    }
    int cnt[6] = {0};
    rep(i,MAX){
      rep(j,MAX){
        if(field[i][j] != -1){
          cnt[field[i][j]-1]++;
        }
      }
    }
    rep(i,6){
      if(i == 5) cout << cnt[i] << endl;
      else cout << cnt[i] << " ";
    }
  }

  return 0;
}

Measured memory_bytes: 1548
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#define INF          1e9
#define INFLL        1e18
#define EPS          1e-9
#define MOD          1000000007
#define REP(i,n)     for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)    for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)    for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)   for(ll i=(n);i>0;--i)
#define REPC(i,obj)  for(auto i:obj)
#define ALL(obj)     (obj).begin(),(obj).end()
#define SETP(n)      cout<<fixed<<setprecision(n)
#define VV(T,h,w)    vector<vector<T>>(h,vector<T>(w))
#define VVI(T,h,w,i) vector<vector<T>>(h,vector<T>(w,i))
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

ll calc(deque<ll>d, ll rem)
{
    if (d.empty()) {
        return 0;
    } else {
        sort(ALL(d));
        REP(i, rem) {
            if (d.front() >= 0 || d.empty())break;
            d.pop_front();
        }
        if (d.empty()) {
            return 0;
        } else {
            return accumulate(ALL(d), 0LL);
        }
    }
}
int main()
{
    ll n = in(), k = in();
    deque<ll>v; REP(i, n)v.push_back(in());

    ll ans = 0;

    REP(i, k + 1) {
        if (i > n)break;
        deque<ll>tmp(v.begin(), v.begin() + i);
        REP(j, i) {
            ans = max(ans, calc(tmp, k - i));
            tmp.pop_back();
            tmp.push_front(*(v.rbegin() + j));
        }
        ans = max(ans, calc(tmp, k - i));
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int N;
	cin >> N;

	vector<Int> a(N);
	for (Int i = 0; i < N; i++) {
		cin >> a[i];
	}

	vector<vector<Int>> dp(N+1, vector<Int>(N+1,INF));//dp[i][j]:区間[i,j)を合体させるのに必要な最小コスト
	for (Int i = 0; i < N; i++) {
		dp[i][i + 1] = 0;
	}

	vector<Int> s(N + 1);//累積和
	for (Int i = 0; i < N; i++) {
		s[i + 1] = s[i] + a[i];
	}

	//dp
	for (Int len = 2; len <= N; len++) {
		for (Int i = 0; i+len <= N; i++) {
			Int j = i + len;
			for (Int k = i+1; k < j; k++) {
				dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j] + s[j] - s[i]);
			}
		}
	}

	cout << dp[0][N] << "\n";
}


Measured memory_bytes: 1536
#include<iostream>
using namespace std;
int main(){
	int m, f, r;
	
	while(1){
		cin>>m>>f>>r;
		if(m == -1 && f == -1 && r == -1) break;
		else if(m == -1 || f == -1) cout<<"F"<<endl;
		else if(80 <= m + f) cout<<"A"<<endl;
		else if(65 <= m + f && m + f < 80) cout<<"B"<<endl;
		else if(50 <= m + f && m + f < 65) cout<<"C"<<endl;
		else if(30 <= m + f && m + f< 50){
			if(r >= 50) cout<<"C"<<endl;
			else cout<<"D"<<endl;
		} else if(m + f < 30) cout<<"F"<<endl;
	}
	return 0;
}


Measured memory_bytes: 3116
#include <bits/stdc++.h>
using namespace std;
#define Fast_IO ios_base::sync_with_stdio(false);cin.tie(NULL);

int32_t main()
{    
    Fast_IO
    #ifdef _WIN32 
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w",stdout);
    #endif
    int n;cin>>n;
    vector<int> a(n);
    for(int &x : a){
        cin>>x;
    }
    vector<int> dp(n,INT_MAX);
    dp[0]=0;
    for(int i=0;i<n;i++){
        for(int j : {i+1,i+2}){
            if(j<n){
                dp[j] = min(dp[j],dp[i] + abs(a[i] - a[j]));
            }
        }
    }
    cout<<dp[n-1];


}

Measured memory_bytes: 1024