akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
using namespace std;

int main()
{
	// Variable declaration
	int m = 0, f = 0, r = 0;
	string result;

	while (1)
	{
		// Input m, f, r
		cin >> m >> f >> r;

		// Check of value
		if (m == -1 && f == -1 && r == -1)
		{
			// End of Input.
			break;
		}
		else if (m < -1 || m > 50 || f < -1 || f > 50)
		{
			continue;
		}

		// Check of value
		if (m == -1 || f == -1)
		{
			result = "F";
		}
		else if (m + f >= 80)
		{
			result = "A";
		}
		else if (m + f >= 65 && m + f < 80)
		{
			result = "B";
		}
		else if (m + f >= 50 && m + f < 65)
		{
			result = "C";
		}
		else if (m + f >= 30 && m + f < 50)
		{
			result = "D";
			if (r >= 50)
			{
				result = "C";
			}
		}
		else if (m + f < 30)
		{
			result = "F";
		}

		// Output
		cout << result << endl;
	}

	return 0;
}

Measured memory_bytes: 1188
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
#define PUTS(x) cout << (x) << endl;
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)

int main() {
    Int n, m;
    cin >> n >> m;
    vector<Int> h;
    auto flags = vector<bool>(n, true);
    rep(i, n) {
        Int x;
        cin >> x;
        h.push_back(x);
    }
    rep(i, m) {
        Int a, b;
        cin >> a >> b;
        a--;
        auto ha = h[a];
        b--;
        auto hb = h[b];
        if (ha < hb) {
            flags[a] = false;
        } else if (ha > hb) {
            flags[b] = false;
        } else {
            flags[a] = false;
            flags[b] = false;
        }
    }
    Int ans = 0;
    rep(i, n) {
        if (flags[i]) {
            ans++;
        }
    }
    PUTS(ans)
}


Measured memory_bytes: 4272
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
  
int main() {
  int H,W,M;
  cin >> H >> W >> M;
  vi hcnt(H,0),wcnt(W,0);
  set<P> s;
  rep(i,M) {
    int h,w;
    cin >> h >> w;
    h--;w--;
    s.emplace(h,w);
    hcnt[h]++;
    wcnt[w]++;
  }
  int hmax=*max_element(rng(hcnt));
  int wmax=*max_element(rng(wcnt));
  vi hg,wg;
  rep(i,H) {
    if(hcnt[i]==hmax) {
      hg.push_back(i);
    }
  }
  rep(i,W) {
    if(wcnt[i]==wmax) {
      wg.push_back(i);
    }
  }
  if(ll(sz(hg))*sz(wg)>M) {
    cout << hmax+wmax << endl;
    return 0;
  }
  for(int th:hg) {
    for(int tw:wg) {
      if(s.count(P(th,tw))) continue;
      cout << hmax+wmax << endl;
      return 0;
    }
  }
  cout << hmax+wmax-1 << endl;
  return 0;
}

Measured memory_bytes: 23756
import numpy as np

A, B = input().split()

A = np.int64(A)

B1 = np.int64(B[0])

B2 = np.int64(B[2:4])

res = (A * B1) + (A * B2) // 100

# print(A)
# print(B)

# print(B1)
# print(B2)

print(res)


Measured memory_bytes: 27128
#include<stdio.h>
#include<iostream>
#include<vector>
#include <fstream>
#include<math.h>
#include <numeric>
#include<algorithm>

using namespace std;

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

    if (s[0] == s[1] && s[1] != s[2] && s[2] == s[3]){
        cout << "Yes" << endl;
    }

    else if (s[0] == s[2] && s[1] != s[2] && s[1] == s[3]){
        cout << "Yes" << endl;
    }

    else if (s[0] == s[3] && s[0] != s[1] && s[1] == s[2]){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
summ1 = 0
answer = 0
temp = 0
summ2 = 0
summ3 = 0
for i in range(N):
    summ1 += A[i]
for l in range(N):
    summ3 += A[l]
    summ2 += A[l]*(summ1-summ3)
answer = summ2 % 1000000007
print(answer)

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

int main()
{
  int n; cin >> n;
  string s; cin >> s;
  if (n%2==1) {
    cout << "No" << endl;
    return 0;
  }
  if (s.substr(0, n/2) == s.substr(n/2, n/2)) {
    cout << "Yes" << endl;
  } else cout << "No" << endl;

  return 0;
}


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

using namespace std;

const int N = 1005;
const int MASK = 1 << 15;

int n, m, box[N];
long long cost[N], dp[N][MASK];

long long fun(int pos, int mask) {
  if (mask == (1 << n) - 1) {
    return 0;
  }
  if (pos == m) {
    return 1e9;
  }
  if(dp[pos][mask]!=-1)
      return dp[pos][mask];
  return dp[pos][mask] = min(cost[pos] + fun(pos + 1, mask | box[pos]), fun(pos + 1, mask));
}

int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> cost[i] >> x;
    while (x--) {
      int y;
      cin >> y;
      box[i] |= (1 << (y - 1));
    }
  }
  memset(dp, -1, sizeof dp);
  long long ans = fun(0, 0);
  if (ans == 1e9) ans = -1;
  cout << ans;
  return 0;
}


Measured memory_bytes: 257664
$heap = []
def max_heapify(index)
  left = index * 2
  right = index * 2 + 1
  if left <= $size && $heap[left] > $heap[index]
    largest = left
  else
    largest = index
  end
  largest = right if right <= $size && $heap[right] > $heap[largest]

  unless largest == index
    $heap[index], $heap[largest] = $heap[largest], $heap[index]
    max_heapify largest
  end
end

def build_max_heap
  ($size).downto 1 do |index|
    max_heapify index
  end
end

$size = gets.to_i
$heap = gets.split(' ').map(&:to_i)
$heap.unshift nil
build_max_heap
$heap.shift
puts " " << $heap.join(' ')



Measured memory_bytes: 52960
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

int main() {
    int n;
    cin >> n;
    ll dp[n+1][5][5][5] = {0};
    dp[0][0][0][0] = 1;
    ll mod = 1000000007;
    for(int i = 1; i <= n; i++){
        rep(j, 5){
            rep(k1, 5){
                rep(k2, 5){
                    rep(k3, 5){
                        if(i >= 2 && k1 == 0)continue;
                        if(i >= 3 && k2 == 0)continue;
                        if(i >= 4 && k3 == 0)continue;
                        if(j==3 && k1==2 && k2==1)continue;
                        if(j==2 && k1==3 && k2==1)continue;
                        if(j==3 && k1==1 && k2==2)continue;
                        if(j==3 && k3==1 && k1==2)continue;
                        if(j==3 && k3==1 && k2==2)continue;
                        (dp[i][j][k1][k2] += dp[i-1][k1][k2][k3]) %= mod;
                    }
                }
            }
        }
    }
    ll ans = 0;
    rep(j, 5)rep(k1, 5)rep(k2, 5){
        if(j==0 || k1==0 || k2==0)continue;
        (ans += dp[n][j][k1][k2]) %= mod;
    }
    cout << ans << endl;
}

Measured memory_bytes: 384
// 20
/****************************************************
https://searleser97.gitlab.io/algorithms/template.cpp
****************************************************/

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define forr(_, x, n) for (int _ = x; _ > n; _--)
#define fos(_, x, n, s) for (int _ = x; _ < n; _ += s)
#define forn(_, x, n) fos(_, x, n, 1)
#define rep(_, n) forn(_, 0, n)
#define fi first
#define se second
#define pb push_back
#define pairii pair<int, int>
#define all(x) x.begin(), x.end()
#define cerr(s) cerr << "\033[48;5;196m\033[38;5;15m" << s << "\033[0m"
// typedef __int128_t lli;
typedef long long int li;
typedef long double ld;
// 12
void _main(int tc) {
  vector<string> cards(3);
  cin >> cards[0] >> cards[1] >> cards[2];
  vector<int> positions(3, 0);
  int player = 0;
  while (true) {

    if (player == 0) {
      if (positions[0] == cards[0].size()) break;
      else player = cards[0][positions[0]] - 'a';
      positions[0]++;
    } else if (player == 1) {
      if (positions[1] == cards[1].size()) break;
      else player = cards[1][positions[1]] - 'a';
      positions[1]++;
    } else if (player == 2) {
      if (positions[2] == cards[2].size()) break;
      else player = cards[2][positions[2]] - 'a';
      positions[2]++;
    }
    // cerr(player << " ");

    // if (cards[player].size() == positions[player]) {
    //   cout << (char)('A' + player) << endl;
    //   return;
    // }
    // player = cards[player][positions[player]] - 'a';
    // positions[player]++;
  }
  cout << (char) ('A' + player) << endl;
}

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  _main(0); return 0;
  int tc;
  cin >> tc;
  rep(i, tc) _main(i + 1);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int K,S;
  cin >> K >> S;
  long int ans;
  for(int x=0;x<K+1;x++){
    for(int y=0;y<K+1;y++){
        if((S-x-y <= K)&&(S-x-y >= 0)){
          ans++;
        }
    }
  }
  
  cout << ans;

}


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

int main(){
  int N,X;
  cin>>N>>X;
  
  vector<int>S(N);
  
  int sum=0;
  
  for(int i=0;i<N;i++){
    cin>>S.at(i);
    
    sum+=S.at(i);
  }
  
  sort(S.begin(),S.end());
  
int sum1=(X-sum)/S.at(0);
  
  cout<<N+sum1<<endl;
}

    
    
    


Measured memory_bytes: 256
n = int(input())

if n % 2 == 1:
    print(0)
else:
    flg = 0
    ans = 0
    while n >= 5:
        if flg == 0:
            ans += n // 10
            n //= 10
            flg = 1
        else:
            ans += n // 5
            n //= 5

    print(ans)

Measured memory_bytes: 3060
from copy import deepcopy
from math import ceil
if __name__ == "__main__":

    a = list(map(int, input().split()))
    n = deepcopy(a[0])
    i = 1
    if a[0] == a[1]: print(i)
    elif a[1] == 1: print(0)
    elif a[0] >= a[1]: print(i)
    else:
        while True:
            i += 1
            n += a[0] - 1
            if n >= a[1]:
                print(i)
                break

Measured memory_bytes: 38384
#include<stdio.h>
#include<string>
using namespace std;
string table[]={"",".,!? ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
char str[1280];
int main(){
	int a;
	scanf("%d",&a);
	while(a--){
		scanf("%s",str);
		int renzoku=0;
		char now='0';
		for(int i=0;str[i];i++){
			if(now!=str[i]){
				if(now!='0'){
					printf("%c",table[now-'0'][(renzoku-1)%table[now-'0'].size()]);
				}
				renzoku=1;
				now=str[i];
			}else renzoku++;
		}
		printf("\n");
	}
}

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

int main(){
    int N ,M;
    cin >> N;
    string s[N];
    for(int i=0;i<N;i++){
        cin >> s[i];
    }

    cin >> M;
    string t[M];
    for(int i=0;i<M;i++){
        cin >> t[i];
    }
    int cntS,cntT,res,max;
    max=0;
    for(int i=0;i<N;i++){
        cntS=0;
        for(int j=0;j<N;j++){
            if(s[i]==s[j]){
                cntS++;
            }
        }

        cntT=0;
        for(int j=0;j<M;j++){
            if(s[i]==t[j]){
                cntT++;
            }
        }

        res = cntS - cntT;
        if(res<0) res = 0;
        if(res>max) max = res;
    }
    cout << max << endl;
}

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

public class Main {
    public static void main(String[] args) {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int W = sc.nextInt();
        int H = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int r = sc.nextInt();
        
        if(x-r>=0 && x+r<=W && y-r>=0 && y+r<=H ) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        
        

    }
}



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

typedef long long ll;
typedef long double ld;
typedef double db; //
typedef string str; //
//
typedef pair<int,int> pi;
typedef pair<ll,ll> pl; //
typedef pair<db,db> pd; //
//
typedef vector<int> vi;
typedef vector<ll> vl; //
typedef vector<db> vd; //
typedef vector<str> vs; //
typedef vector<pi> vpi;
typedef vector<pl> vpl; //
typedef vector<pd> vpd; //

#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend() //
#define rsz resize
#define ins insert //
#define ft front() //
#define bk back()
#define pf push_front //
#define pb push_back
#define eb emplace_back //
#define lb lower_bound //
#define ub upper_bound //

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

const int MOD = 1e9+7; // 998244353;
const int MX = 2e5+5; //
const ll INF = 1e18; //
const ld PI = acos((ld)-1);
const int xd[4] = {1,0,-1,0}, yd[4] = {0,1,0,-1}; //
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count()); //
//
template<class T> bool ckmin(T& a, const T& b) {
	return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { //
	return a < b ? a = b, 1 : 0; } //
constexpr int pct(int x) { return __builtin_popcount(x); } //
constexpr int bits(int x) { return 31-__builtin_clz(x); } // floor(log2(x)) //
constexpr int cdiv(int a, int b) { return a/b+!(a<0||a%b == 0); } // division of a by b rounded up, assumes b > 0 //
// IGNORE
int fstTrue(function<bool(int)> f, int lo, int hi) {
	hi ++; assert(lo <= hi); // assuming f is increasing
	while (lo < hi) { // find first index such that f is true
		int mid = (lo+hi)/2;
		f(mid) ? hi = mid : lo = mid+1;
	}
	return lo;
}
template<class T> void remDup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)),end(v)); }

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	long long t;
	cin >> t;
	cout << t + t * t + t * t * t << endl;
}

Measured memory_bytes: 3652
import java.util.*;

class Main{
    void solve(){
	Scanner sc = new Scanner(System.in);
	int h1 = sc.nextInt();
	int h2 = sc.nextInt();
	int k1 = sc.nextInt();
	int k2 = sc.nextInt();
	int a = sc.nextInt();
	int b = sc.nextInt();
	int c = sc.nextInt();
	int d = sc.nextInt();
	int hiroshi = h1*a + h2*b + (h1/10)*c + (h2/20)*d;
	int kenjiro = k1*a + k2*b + (k1/10)*c + (k2/20)*d;
	
	if ( hiroshi > kenjiro ) System.out.println("hiroshi");
	else if ( hiroshi < kenjiro ) System.out.println("kenjiro");
	else System.out.println("even");
	
    }

    public static void main(String[] args){
	new Main().solve();
    }
}



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

int64_t MOD = 1000000007;
int64_t MAX = 9223372036854775807;
double PI = 3.141592653589793;

int main()
{
    int H, W;
    cin >> H >> W;
    vector<vector<char>> list(H, vector<char>(W));
    for (int i = 0; i < H; i++)
        for (int j = 0; j < W; j++)
            cin >> list[i][j];
    vector<bool> Hb(H, false), Wb(W, false);
    for (int i = 0; i < H; i++)
    {
        for (int j = 0; j < W; j++)
        {
            if (list[i][j] == '#')
            {
                Hb[i] = true;
                Wb[j] = true;
            }
        }
    }
    for (int i = 0; i < H; i++)
    {
        if(Hb[i])
        {
            for (int j = 0; j < W; j++)
            {
                if(Wb[j])
                    cout << list[i][j];
            }
            cout << endl;
        }
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
const int INF = 100000000;
const int MAX_N = 100;
typedef pair<int , int> P;
typedef long long ll;
 
int main () {
  string S;
  cin >> S;
  if (S == "ABC") {
    printf("ARC\n");
  } else {
    printf("ABC\n");
  }
  return 0;
}


Measured memory_bytes: 3624
#include <stdio.h>
#include <string.h>

#define MAX_N 25
#define max(a,b) (a < b ? b : a)

void setHeight(int,int,int*,int*);
int getDepth(int,int*);

int main(){
  int n,i,id,l,r,type;
  int parent[MAX_N],sib[MAX_N];
  int child[MAX_N],height[MAX_N];
  char name[3][14] = {"root","leaf","internal node"};

  memset(parent,-1,sizeof(parent));
  memset(sib,-1,sizeof(sib));

  scanf("%d",&n);
  for(i = 0 ; i < n ; i++){
    scanf("%d%d%d",&id,&l,&r);
    child[id] = 0; height[i] = 0;
    if(l >= 0){ parent[l] = id; ++child[id]; }
    if(r >= 0){ parent[r] = id; ++child[id]; }
    if(l >= 0 && r >= 0){
      sib[l] = r; sib[r] = l;
    }
  }
  for(i = 0 ; i < n ; i++){
    setHeight(i,0,height,parent);
  }
  for(i = 0 ; i < n ; i++){
    printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",
           i,parent[i],sib[i],child[i],getDepth(i,parent),height[i]);
    if(parent[i] == -1){ type = 0; }
    else if(child[i] == 0){ type = 1; }
    else{ type = 2; }
    printf("%s\n",name[type]);
  }
  return 0;
}

void setHeight(int x,int depth,int *height,int *parent){
  height[x] = max(height[x],depth);
  if(parent[x] == -1){ return; }
  setHeight(parent[x],depth+1,height,parent);
}

int getDepth(int x,int *parent){
  if(parent[x] == -1){ return 0; }
  return getDepth(parent[x],parent) + 1;
}

Measured memory_bytes: 612
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;


int main()
{
  string s;
  cin >> s;
  int c = 0;
  for ( int i=0; i < (int)s.length() / 2; ++i)
    if ( s[i] != s[s.length()-i-1] ) ++c;
  cout << c << "\n";
  return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <iterator>
#include <fstream>
#include <math.h>

#include <random>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <list>
#include <bitset>
#include <unordered_set>
#include <unordered_map>

#include <random>
#include <ctime>

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define FOR(i, from, to) for (int i = from; i < to; i++)
#define ROF(i, from, to) for (int i = from; i > to; i--)

const long double PI = 3.141592653589793238463;
const int INF = 0x3f3f3f3f;
const int INFS = 1000000000;
const ll M = 1000000007;
const ll LLINF = 1000000000000000000;
const double EPS = 1e-8;

#define int long long

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

    int n;
    cin >> n;
    vector<int> a(n);
    map<int, int> b = {};
    FOR(i, 0, n) {
        cin >> a[i];
        b[a[i]] = 0;
    }
    int tmp = 0;
    for (auto x : b)
        b[x.first] = tmp++;
    int cnt0 = 0, cnt1 = 0;
    FOR(i, 0, n) {
        if ((i % 2) != (b[a[i]] % 2)) {
            if (i % 2)
                ++cnt1;
            else
                ++cnt0;
        }
    }
    cout << max(cnt0, cnt1) << "\n";

    return 0;
}


Measured memory_bytes: 10328
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        long n = Long.parseLong(s);

        long sum = 0;
        for (int i = 0; i < s.length(); i++) {
            sum += s.charAt(i) - '0';
        }

        if (n % sum == 0) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 23892
#include<stdio.h>
#include<string.h>

int main(void){
    char a[50];
    int i,j,k=0;

    gets(a);

    for(i=0;i<strlen(a);i++){
        for(j=i+1;j<strlen(a);j++){
            if(a[i]==a[j]){
                k++;
            }
        }
    }

    if(k==0){
        printf("yes");
    }
    else{
        printf("no");
    }

    return 0;
}


Measured memory_bytes: 1536
#include <iostream>
#include <cmath>
#include <set>
#include <vector>

#define llint long long int

using namespace std;

int main(void)
{
    ios::sync_with_stdio(false);
    llint N, M;
    cin >> N >> M;
    llint H[N];
    set<long long int> A[N];
    for (llint i = 0; i < N; i++)
        cin >> H[i];
    llint a, b;
    for (llint i = 0; i < M; i++)
    {
        cin >> a >> b;
        A[a - 1].emplace(b - 1);
        A[b - 1].emplace(a - 1);
    }
    long long int ans = 0;
    long long int h;
    bool flag;
    for (llint i = 0; i < N; i++)
    {
        if (A[i].empty())
            ans++;
        else
        {
            h = H[i];
            flag = true;
            for (auto j : A[i])
            {
                if (h <= H[j])
                {
                    flag = false;
                    break;
                }
            }
            if (flag)
                ans++;
        }
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 18496
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  ll x;
  cin >> x;
  ll cnt=0;
  cnt=x/11*2;
  ll s=x%11;
  if(s==0){
    cout << cnt << endl;
  }else if(s<=6){
    cout<< cnt+1 << endl;
  }else{
    cout << cnt+2 << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan0
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














double R;
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> R;
	double ans = 2 * R * 3.14;
	printf("%.10f\n", ans);
}







Measured memory_bytes: 3808
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define Would
#define you
#define please

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

	int N, A[2][100];
	cin >> N;
	rep(i, N) cin >> A[0][i];
	rep(i, N) cin >> A[1][i];


	int saidai = 0;
	rep(i, N) {
		int kari = 0;
		rep(ii, i + 1) {
			kari += A[0][ii];
		}
		for (int ii = i; ii < N; ii++) {
			kari += A[1][ii];
		}
		saidai = max(saidai, kari);

	}

	co(saidai);

	Would you please return 0;
}

Measured memory_bytes: 256
from sys import stdin
def stdinput():
    return stdin.readline().strip()

def main():
    n = int(stdinput())
    A = list(map(int, [stdinput() for _ in range(n)]))

    A, c, G = shell_sort(A, len(A))

    print(len(G))
    print(' '.join(map(str,G)))
    print(c)
    for a in A:
        print(a)

def insertion_sort(A, n, g):
    c = 0
    for i in range(g, n):
        v = A[i]
        j = i - g
        while j >= 0 and A[j] > v:
            A[j + g] = A[j]
            j = j - g
            c += 1
        A[j + g] = v
    return c

def shell_sort(A, n):
    G = sorted(iter_g(n), reverse=True)
    c = 0
    for g in G:
        c += insertion_sort(A, n, g)
    return A, c, G

def iter_g(n):
    v = 1
    d = 3
    while v <= n:
        yield v
        v += d
        d *= 3

if __name__ == '__main__':
    main()


Measured memory_bytes: 116484
def Main(N, M, H, A, B):
#     d = {}
    d2 = {}
    for i in range(N):
#         d[i+1] = []
        d2[i+1] = 0
    ans = 0
    for i in range(M):
#         d[A[i]].append(B[i])
        d2[A[i]] = max(d2[A[i]], H[B[i]-1])
#         d[B[i]].append(A[i])
        d2[B[i]] = max(d2[B[i]], H[A[i]-1])
    for k, v in d2.items():
        if H[k-1] > v:
            ans += 1
    return ans  
    
def main():
    N, M = map(int, input().split())
    H = list(map(int, input().split()))
    A = [0]*M
    B = [0]*M
    for i in range(M):
        A[i], B[i] = map(int, input().split())
    print(Main(N, M, H, A, B))

if __name__ == '__main__':
    main()

Measured memory_bytes: 32292
def partition(A, p, r):
   x = A[r]
   i = p-1
   for j in range(p, r):
      if A[j] <= x:
         i = i+1
         A[i],A[j] = A[j],A[i]
   A[i+1],A[r] = A[r],A[i+1]
   return i+1

r = int(input())
A = list(map(int, input().split()))
p = partition(A, 0, r-1)
A = list(map(str, A))
A[p] = "[%s]"%(A[p])
print(" ".join(A))

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

int main(void) {
    int n, k, x, y;
    cin >> n >> k >> x >> y;

    if(n>k) {
        cout << k*x + (n-k)*y << endl;
    } else {
        cout << n*x << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize ("-O3")
#define ll long long  int
#define all(x) (x).begin(), (x).end()
using ld = long double;
const ll mod = 1000000007;
const ll inf = 1000000000000000000;
const ll rk = 256;
const ld PI = 3.141592653589793;
#define pb push_back
#define mp make_pair
#define vc vector
#define fs first
#define sec second
// #define pq priority_queue
#define lb lower_bound
#define ub upper_bound
#define pll pair<ll,ll>
#define pls pair<ll,string>
#define psl pair<string,ll>
#define plc pair<ll,char>
#define pcl pair<char,ll>
#define pss pair<string,string>
#define all(x) (x).begin(), (x).end()
#define tol(s) transform(s.begin(),s.end(),s.begin(),::tolower);
#define tou(s) transform(s.begin(),s.end(),s.begin(),::toupper);
#define print(a) for(auto j:a) {cout<<j<<",";} cout << "\n";
#define endl '\n'
#define FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
// getting string line
// getline(cin,word);
// -> priority_queue < int > pq; // mex_heap
// -> priority_queue < int , vector < int > , greater < int > > pq; // min_heap


ostream & operator << (ostream & os, pair <ll, ll> const& x) {
    os << x.first << "," << x.second;
    return os;
}

template <class T>
ostream & operator << (ostream & os, vector <T> const& x) {
    os << "{ ";
    for(auto& y : x) os << y << " ";
    return os << "}";
}

template <class T>
ostream & operator << (ostream & os, set <T> const& x) {
    os << "{ ";
    for(auto& y : x) os << y << " ";
    return os << "}";
}

template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) {
    os << "{ ";
    for(auto& y : x) os << y << " ";
    return os << "}";
}

template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) {
    return os << "[ " << p.first << ", " << p.second << "]" ;
}

const ll mex = 1e7;

ll arr[mex], bit[mex], last_visit[mex];

struct Query
{
    ll l, r, idx;
};

Query queries[mex];

bool cmp(Query x, Query y)
{
    return x.r < y.r;
}

void update(ll idx, ll val, ll bit[], ll n)
{
    for (; idx <= n; idx += idx & -idx)
        bit[idx] += val;
}

ll query(ll idx, ll bit[], ll n)
{
    ll sum = 0;
    for (; idx > 0; idx -= idx & -idx)
        sum += bit[idx];
    return sum;
}

int main(){
    FastIO;

    ll n,q;
    cin>>n>>q;
    for(ll i=0;i<n;i++){
        cin>>arr[i];
    }
    Query queries[q];
    for(ll i=0;i<q;i++){
        ll x,y;
        cin>>x>>y;
        x--;
        y--;
        queries[i] = {x,y,i};
    }
    sort(queries, queries+q, cmp);
    memset(last_visit,-1,sizeof(last_visit));    
    ll ans[q];
    ll cnt = 0;
    for (ll i = 0; i < n; i++){
        if (last_visit[arr[i]] != -1)
            update(last_visit[arr[i]] + 1, -1, bit, n);

        last_visit[arr[i]] = i;
        update(i + 1, 1, bit, n);

        while (cnt < q && queries[cnt].r == i)
        {
            ans[queries[cnt].idx] = query(queries[cnt].r + 1, bit, n) - query(queries[cnt].l, bit, n);
            cnt++;
        }
    }

    for (ll i = 0; i < q; i++)
        cout << ans[i] << endl;
    
    return 0;
}


Measured memory_bytes: 105436
#include <bits/stdc++.h>
using namespace std;
using ll = int_fast64_t;
const int mod = 1e9 + 7;
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
#define fast() ios::sync_with_stdio(false), cin.tie(nullptr)
#define digit(N) cout << fixed << setprecision((N))
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string &s)
{
    return '"' + s + '"';
}

string to_string(const char *s)
{
    return to_string((string)s);
}

string to_string(bool b)
{
    return (b ? "true" : "false");
}

string to_string(vector<bool> v)
{
    bool first = true;
    string res = "{";
    for (int i = 0; i < static_cast<int>(v.size()); i++)
    {
        if (!first)
        {
            res += ", ";
        }
        first = false;
        res += to_string(v[i]);
    }
    res += "}";
    return res;
}

template <size_t N>
string to_string(bitset<N> v)
{
    string res = "";
    for (size_t i = 0; i < N; i++)
    {
        res += static_cast<char>('0' + v[i]);
    }
    return res;
}

template <typename A>
string to_string(A v)
{
    bool first = true;
    string res = "{";
    for (const auto &x : v)
    {
        if (!first)
        {
            res += ", ";
        }
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p)
{
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p)
{
    return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p)
{
    return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T)
{
    cerr << " " << to_string(H);
    debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

char calc(char c, int key)
{
    char r = c;
    if (key == 0)
        return c;
    if (c == 'A')
        r = 'z';
    else if (c == 'a')
        r = 'Z';
    else
        r--;
    return calc(r, key - 1);
}

int main()
{
    int N;
    while (cin >> N)
    {
        if (N == 0)
            return 0;

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

        string s;
        cin >> s;
        int index = 0;
        for (int i = 0; i < s.size(); i++)
        {
            index %= N;
            s[i] = calc(s[i], k[index]);
            index++;
        }

        cout << s << "\n";
    }
}


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

using namespace std;
#define lli long long int
#define ff first
#define ss second
#define lld long double
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define mod 1000000007
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

typedef pair<int, int> pii;
typedef pair<long long int,long long int> pll;
const int nax=1000*1007;
#define INF 2e18
lli pow(lli x, lli y) { lli res = 1;while (y > 0) { if (y & 1) res = (res * x);  y = y >> 1; x = (x * x); } return res; } 


int main()
{
	IOS;
    string s;
    cin>>s;
    if(s.back()=='s')
        s = s+"es";
    else
    {
        s=s+"s";
    }
    cout<<s<<endl;

}

Measured memory_bytes: 3624
#!/usr/bin/env python3
import sys

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    s = input()
    if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
        print('Bad')
    else:
        print('Good')

if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#include<bits/stdc++.h>
#define title "title"
#define ll long long
#define ull unsigned ll
#define fix(x) fixed<<setprecision(x)
#define pii pair<int,int>
#define vint vector<int>
#define pb push_back
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define red(i,a,b) for(int i=(a);i>=(b);i--)
#define db double
#define ld long db
using namespace std;
void Freopen(){
	freopen(title".in","r",stdin);
	freopen(title".out","w",stdout);
}
ll read(){
	ll g=0,f=1;
	char ch=getchar();
	while(ch<'0'||'9'<ch){if(ch=='-')f=-1;ch=getchar();}
	while('0'<=ch&&ch<='9'){g=g*10+ch-'0';ch=getchar();}
	return g*f;
}
ll A,B;
signed main(){
	//freopen("a","r",stdin);
	A=read(),B=read();
	if(A==B)return cout<<1,signed();
	int d=0;red(i,62,0)if((!(A>>i&1))&&(B>>i&1)){d=i;break;}else if(A>>i&1)A^=1ll<<i,B^=1ll<<i;
	int k=-1;red(i,d-1,0)if((B>>i&1)){k=i;break;}
	ll T=1ll<<d;
	ll l1=T+A,r1=2*T-1;
	ll l2=A,r2=T-1;
	ll l3=T,r3=T+(1ll<<(k+1))-1;
	ll l4=A,r4=T+(1ll<<(k+1))-1;
	if(r4<l1)return cout<<r4+r1-l1-l4+2,signed();
	return cout<<max(r4,r1)-l4+1,signed();
}

Measured memory_bytes: 3592
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

// https://atcoder.jp/contests/abc123/tasks/abc123_d
namespace DCake123
{
    class Program
    {
        static void Main(string[] args)
        {
            // 入力の取得
            var inputs = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int x = inputs[0], y = inputs[1], z = inputs[2], k = inputs[3];

            var tastinessA = Console.ReadLine().Split().Select(long.Parse).ToArray();
            var tastinessB = Console.ReadLine().Split().Select(long.Parse).ToArray();
            var tastinessC = Console.ReadLine().Split().Select(long.Parse).ToArray();

            Array.Sort(tastinessA);
            Array.Reverse(tastinessA);
            Array.Sort(tastinessB);
            Array.Reverse(tastinessB);
            Array.Sort(tastinessC);
            Array.Reverse(tastinessC);

            var sumList = new List<long>();
            for (var i = 1; i <= tastinessA.Length; i++)
            {
                for (var j = 1; j <= tastinessB.Length; j++)
                {
                    for (var l = 1; l <= tastinessC.Length; l++)
                    {
                        if (i * j * l > k) continue;

                        var sum = tastinessA[i - 1] + tastinessB[j - 1] + tastinessC[l - 1];
                        sumList.Add(sum);
                    }
                }
            }
            var answers = sumList.OrderByDescending(sum => sum).Take(k).ToArray();

            // 解答の出力
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
            Console.Out.Flush();
        }
    }
}


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

int main(){
    int n,m;
    cin>>n>>m;
    vector<int>a(n);
    rep(i,n)cin>>a[i];
    vector<ll>sum(n+1);
    for(int i=1; i<=n; ++i){
        sum[i]=sum[i-1]+a[i-1];
    }
    map<ll,int>mp;
    ll ans=0;
    rep(i,n+1){
        ans+=mp[sum[i]%m];
        mp[sum[i]%m]++;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 8188
from collections import Counter
n, k = map(int, input().split())
A = list(map(int, input().split()))
cA = sorted(Counter(A).values())
dk = len(set(A))-k
r = 0
for i in range(n):
    if dk<1:
        break
    else:
        dk -= 1
        r += cA[i]
print(r)

Measured memory_bytes: 32556
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    int n,k;
    cin>>n>>k;
    ll arr[n+1];
    arr[0]=0;
    for(int i=1;i<=n;i++)
        cin>>arr[i];
    ll dp[n+1];
    dp[0]=0;
    dp[1]=0;
    dp[2]=abs(arr[2]-arr[1]);
    for(int i=3;i<=n;i++)
        dp[i]=1000000000000;
    for(int i=3;i<=n;i++)
    {
        for(int j=1;j<=k;j++)
        {
        if((i-j) >= 1)
        dp[i]=min(dp[i],dp[i-j]+abs(arr[i]-arr[i-j]));
        }
    }
    cout<<dp[n];
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ll n,m,ans=0;
	cin>>n>>m;
	vector<pair<ll,ll>>a(n);
	for(int i=0;i<n;i++)cin>>a[i].first>>a[i].second;
	sort(a.begin(),a.end());
	int cnt=0;
	for(int i=0;i<n;i++){
		int hoge=min(m,a[i].second);
		ans+=hoge*a[i].first;
		m-=hoge;
		if(m==0)break;

	}
	cout<<ans<<endl;

}


Measured memory_bytes: 1792
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        a: usize,
        b: usize,
        c: usize,
        d: usize,
        e: usize,
        k: usize,
    }
    let res = if (e - a) <= k { "Yay!" } else { ":(" };

    println!("{}", res);
}


Measured memory_bytes: 4352
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.Arrays;

public class Main {

    public static void main(String[] args) {
        List<Integer> excNumbers = new ArrayList<Integer>();

        Scanner in = new Scanner(System.in);
        int n, k;
        n = in.nextInt();
        k = in.nextInt();
        int x = n;
        int y = 0;
        in.nextLine();
        for (int i = 0; i< k ; i++){
            excNumbers.add(in.nextInt());
        }
        String n1 = Integer.toString(n);
        boolean flag = false ;
        if(excNumbers.size() < 10){
            for (int j = 0 ;j<n1.length();j++){

                if(excNumbers.contains(Integer.parseInt(String.valueOf(n1.charAt(j))))){
                    flag = true;
                    break;
                }
            }
            if(flag == false){
                System.out.println(n);
            }
            else{
                for (int i = 0; i< 100000; i++){
                    flag = false;
                    n++;
                    n1 = Integer.toString(n);
                    for (int j = 0 ;j<n1.length();j++){

                        if(excNumbers.contains(Integer.parseInt(String.valueOf(n1.charAt(j))) )){
                            flag = true;
                            break;
                        }
                    }
                    if(flag == false){
                        break;
                    }
                }
                if(flag == false){
                    System.out.println(n);

                }
                else {
                    System.out.println(x);

                }

            }

        }else {
            System.out.println(x);

        }


    }
}


Measured memory_bytes: 29012
#include <bits/stdc++.h>
#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)
typedef long long ll;
long long mod = 1e9 + 7;
const int iINF = 0x3f3f3f3f;
const long long INF = 1LL << 60;
using namespace std;

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 n;
  cin >> n;
  vector<int> b;
  rep(i, n)
  {
    int x;
    cin >> x;
    b.push_back(x);
  }

  vector<int> ans;
  for (;;)
  {
    int before_count = b.size();
    bool flag = true;
    for (int i = b.size() - 1; i >= 0; i--)
    {
      if (b[i] == i + 1 && flag)
      {
        b.erase(b.begin() + i);
        ans.insert(ans.begin(), i + 1);
        flag = false;
      }
    }
    int after_count = b.size();
    if (before_count == after_count)
      break;
  }

  if (b.size() == 0)
  {
    for (int i : ans)
    {
      cout << i << endl;
    }
  }
  else
  {
    cout << -1 << endl;
  }

  return 0;
}


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

int main() {

  int A, B; cin >> A >> B;
  if (A == B) {
    cout << "Draw" << endl;
  }
  else if (A == 1) {
    cout << "Alice" << endl;
  }
  else if (B == 1) {
    cout << "Bob" << endl;
  }
  else if (A > B) {
    cout << "Alice" << endl;
  }
  else {
    cout << "Bob" << endl;
  }
  
}


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

int main(){
  int kyu;
  int a = 400;
  cin >> kyu;
  
  for(int i=8;i>=1;i--){
    //cout << kyu << endl;
    if(kyu >= a && kyu < a+200){
      cout << i << endl;
      break;
    }
    a += 200;
  }
}

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

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int, int> P;

const int MOD = 1000000007;
const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;

struct Node {
    int val;
    Node* parent;
};

void ans(Node* v)
{
    string s = "";
    while (v->parent != NULL) {
        s = to_string(v->val) + s;
        v = v->parent;
    }
    cout << s << endl;
}

int main()
{
    int k;
    cin >> k;
    int cnt = 0;

    Node* origin = new Node();
    origin->val = -1;
    origin->parent = NULL;
    queue<Node*> que;
    que.push(origin);

    while (!que.empty()) {
        Node* v = que.front();
        que.pop();
        if (v->val == -1) {
            for (int i = 1; i <= 9; i++) {
                Node* nv = new Node();
                nv->val = i;
                nv->parent = v;
                que.push(nv);
                cnt++;
                if (cnt == k) {
                    cout << i << endl;
                    return 0;
                }
            }
        }

        if (v->val == 0) {
            Node* nv1 = new Node();
            nv1->parent = v;
            nv1->val = 0;
            Node* nv2 = new Node();
            nv2->parent = v;
            nv2->val = 1;
            que.push(nv1);
            cnt++;
            if (cnt == k) {
                ans(nv1);
                return 0;
            }
            que.push(nv2);
            cnt++;
            if (cnt == k) {
                ans(nv2);
                return 0;
            }
        }

        if (v->val == 9) {
            Node* nv1 = new Node();
            nv1->parent = v;
            nv1->val = 8;
            Node* nv2 = new Node();
            nv2->parent = v;
            nv2->val = 9;
            que.push(nv1);
            cnt++;
            if (cnt == k) {
                ans(nv1);
                return 0;
            }
            que.push(nv2);
            cnt++;
            if (cnt == k) {
                ans(nv2);
                return 0;
            }
        }

        if (v->val >= 1 && v->val <= 8) {
            for (int i = v->val - 1; i <= v->val + 1; i++) {
                Node* nv = new Node();
                nv->parent = v;
                nv->val = i;
                que.push(nv);
                cnt++;
                if (cnt == k) {
                    ans(nv);
                    return 0;
                }
            }
        }
    }
}

Measured memory_bytes: 3968
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(c: "List[List[int]]"):
    for b1 in range(0,101):
        for b2 in range(0,101):
            for b3 in range(0,101):
                for i in range(3):
                    if c[i][0]-b1 == c[i][1]-b2 == c[i][2]-b3:
                        continue
                    else:
                        break
                else:
                    print(YES)
                    return

    print(NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    c = [[int(next(tokens)) for _ in range(3)] for _ in range(3)]  # type: "List[List[int]]"
    solve(c)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int main(){
  int n;
  int a[110],b[110];
  int i;
  cin >> n;
  for(i=0;i<n;i++){
    cin >> a[i] >> b[i];
  }
  for(i=2;i<n;i++){
    if(a[i]==b[i] && a[i-1]==b[i-1] && a[i-2]==b[i-2]){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}

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

int main()
{
	int n, t;
	long long pre_end{}, sum{};
	scanf("%d%d", &n, &t);
	for (int i = 0; i < n; i++)
	{
		long long now;
		scanf("%lld", &now);
		if (now <= pre_end) sum += now + t - pre_end;
		else sum += t;
		pre_end = now + t;
	}
	printf("%lld\n", sum);

	return 0;
}

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

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

Measured memory_bytes: 256