akhauriyash/Code-Regression huggingface dataset:
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let x = read::<i64>();
    let a = x / 100;
    if x - a * 100 <= a * 5 {
        println!("1");
    } else {
        println!("0");
    }
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 4352
import sys
input = sys.stdin.readline
N, Q = map(int, input().split())
s = list(input())[: -1]
t = []
res = 0
for _ in range(Q):
  u, v = input().split()
  t.append((u, v))

def check(x):
  for i in range(Q):
    u, v = t[i]
    if s[x] == u:
      x += (-1) ** (v == "L")
    if x < 0:
      return -1
    if x >= N:
      return 1
  return 0

ok = -1
ng = N
while ng - ok > 1:
  m = (ok + ng) // 2
  if check(m) < 0:
    ok = m
  else: ng = m
res += ok + 1

ok = N
ng = -1
while ok - ng > 1:
  m = (ok + ng) // 2
  if check(m) > 0:
    ok = m
  else: ng = m
res += N - ok
print(N - res)

Measured memory_bytes: 89404
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

const int MOD = 1000000007;

int solve(const vector<int>& A, const vector<int>& B){
    const int N = A.size(), M = B.size();
    if(A.back() != N*M || B.back() != N*M) return 0;
    int idxA = N-2, idxB = M-2;
    long long res = 1;
    for(int i=N*M-1;i>=1;i--){
        if(idxA >= 0 && idxB >= 0 && A[idxA] == i && B[idxB] == i){
            --idxA; --idxB;
        } else if(idxA >= 0 && A[idxA] == i){
            res = (res * (M-1-idxB)) % MOD;
            --idxA;
        } else if(idxB >= 0 && B[idxB] == i){
            res = (res * (N-1-idxA)) % MOD;
            --idxB;
        } else {
            int valid = max(0, (M-1-idxB) * (N-1-idxA) - (N*M - i));
            res = (res * valid) % MOD;
        }
    }
    return (int)res;
}

int main(){
    int N, M;
    while(cin >> N >> M){
        vector<int> A(N), B(M);
        for(auto& t : A) cin >> t;
        for(auto& t : B) cin >> t;
        sort(A.begin(), A.end());
        sort(B.begin(), B.end());
        cout << solve(A, B) << endl;
    }
}

Measured memory_bytes: 256
import java.util.Scanner;
 
class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      
      	int D = sc.nextInt();
      	if (D == 25) {
        	System.out.println("Christmas");
        } else if (D == 24) {
        	System.out.println("Christmas Eve");
        } else if (D == 23) {
        	System.out.println("Christmas Eve Eve");
        } else {
        	System.out.println("Christmas Eve Eve Eve");
        }
    }
}

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

int main(void){
    int N;
    int num;
    int ans;

    scanf("%d",&N);
    for(int i=0;i<N;i++){
        scanf("%d",&num);
        if(num%2==0){
            if(num%3==0||num%5==0){

            }else{
                printf("DENIED");
                return 0;
            }
        }
    }

    printf("APPROVED");

    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
#define mod 1000000007
#define INF 1000000000

#define mp make_pair
#define pb push_back
#define mt make_tuple
#define eb emplace_back
#define all(x) begin(x), end(x)
#define len(x) ((int)(x).size())
#define contains(a, x) (a.find(x) != end(a))
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define F(i,a,b) for(int i = (int)(a); i < (int)(b); ++i)
#define RF(i,a,b)for(int i = (int)(a); i >= (int)(b); --i)

using dbl = double;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvl = vector<long long>;
using pi = pair<int,int>;

#define fast() {ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
#define log(x) cout << x << endl;


// ll brute(ll s, ll c) {
// 	int x = 0;
// 	while (s*2 < c) {
// 		s += 1;
// 		c -= 2;
// 	}
// 	return min(s, c>>1);
// }

ll solve(ll s, ll c) {
	if (s*2 >= c) {
		return min(s, c>>1);
	}
	ll x = round((c-2*s)/4);
	s += x, c -= 2*x;
	if (s*2 < c) s+=1, c-=2;
	return min(s, c>>1);
}


int main() {

	ll s, c;
	cin >> s >> c;
	log(solve(s, c))

	return 0;
}





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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define pb push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define print(obj) cout << obj << endl
#define scan(obj) cin >> obj

typedef long long ll;

using namespace std;

int main(void){
    string n;
    cin >> n;
    if(n[0] == '9' || n[1] == '9'){
        print("Yes");
        return 0;
    }
    print("No");
}

Measured memory_bytes: 256
mod = 10**9 + 7
def solve():
    n = int(input())
    a = list(map(int, input().split()))
    s = 0
    ans = 0
    for i in range(n):
        ans = (ans + s * a[i]) % mod
        s += a[i]
    print(ans)
t = 1
while t > 0:
    solve()
    t -= 1

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

using namespace std;

using ll = long long;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

int main () {
  cin.tie(0);
  cout << fixed << setprecision(10);

  int n, m; cin >> n >> m;
  vector<int> a1(n), a2(n), b(m);
  int cntev1 = 0, cntod1 = 0;
  for(int i=0;i<n;++i) {
    cin >> a1[i];
    a2[i] = a1[i];
    if(a1[i]) {
      cntod1++;
    } else {
      cntev1++;
    }
  }

  int cntev2 = 0, cntod2 = 0;
  bool ev = true;
  for(int i=0;i<m;++i) {
    cin >> b[i];
    if(ev) {
      cntev2 += b[i];
    } else {
      cntod2 += b[i];
    }
    ev = !ev;
  }

  vector<int> s1, s2;
  int nx1 = 0, nx2 = 1;
  if(cntev1 != cntev2 || cntod1 != cntod2) {
    nx1 = -1;
  } else if(cntev1 != cntod2 || cntod1 != cntev2) {
    nx2 = -1;
  }
/*   cout << cntev1 << ":" << cntod1 << endl;
  cout << cntev2 << ":" << cntod2 << endl; */

  for(int i=0;i<m;++i) {
    for(int j=0;j<b[i];++j) {
      if(nx1 != -1) s1.push_back(nx1);
      if(nx2 != -1) s2.push_back(nx2);
    }
    if(nx1 != -1) nx1 = !nx1;
    if(nx2 != -1) nx2 = !nx2;
  }


  // cout << "A" << endl;

  int cnt1 = 0;
  if(nx1 != -1) {
    for(int i=0;i<n;++i) {
      if(a1[i] != s1[i]) {
        int pos = i;
        while(a1[pos] != s1[i]) {
          pos++;
        }
        cnt1 += pos - i;
        int tmppos = a1[pos];
        a1.erase(a1.begin() + pos);
        a1.insert(a1.begin() + i, tmppos);
      }
    }
  } else {
    cnt1 = INF;
  }

  int cnt2 = 0;
  if(nx2 != -1) {
    for(int i=0;i<n;++i) {
      if(a2[i] != s2[i]) {
        int pos = i;
        while(a2[pos] != s2[i]) {
          pos++;
        }
        cnt2 += pos - i;
        int tmppos = a2[pos];
        a2.erase(a2.begin() + pos);
        a2.insert(a2.begin() + i, tmppos);
      }
    }
  } else {
    cnt2 = INF;
  }

  cout << min(cnt1, cnt2) << endl;
}



Measured memory_bytes: 3160
#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define P pair<int,int>
#define vp vector<P>
#define PP pair<P,int>
#define vpp vector<PP>
#define fi first
#define se second
#define INF (1<<30)
#define MOD 1000000007
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(x) (x).begin(),(x).end()
int main(){
    string a,b;
    cin>>a>>b;
    string ans=string(a.length(),'z');
    bool t=false;
    REP(i,a.length()){
        if(i+b.length()-1>a.length())break;
        bool f=true;
        REP(j,b.length()){
            if(a[i+j]=='?'||a[i+j]==b[j])continue;
            f=false;
        }
        if(f){
            string now;
            REP(j,a.length()){
                if(i<=j&&j<i+b.length()){
                    now+=b[j-i];
                }else if(a[j]=='?'){
                    now+='a';
                }else{
                    now+=a[j];
                }
            }
            ans=min(ans,now);
            t=true;
        }
    }
    if(t)cout<<ans<<endl;
    else cout<<"UNRESTORABLE"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int w,a[100001],t[100001]={};
  cin>>w;
  for(int i=0;i<w;i++)cin>>a[i];

  int f=0,m=1e9;
  for(int i=0;i<w;i++,m--){
    if(a[i]==0)f=1,m=1e9;
    if(a[i]<0)m=min(m,-a[i]);
    if(f&&a[i]>0)t[i]=max(0,min(a[i],m));
  }


  f=0,m=1e9;
  for(int i=w-1;i>=0;i--,m--){
    if(a[i]==0)f=1,m=1e9;
    if(a[i]<0)m=min(m,-a[i]);
    if(f&&a[i]>0)t[i]=max(t[i],min(a[i],m));
  }

  int ans=0;
  for(int i=0;i<w;i++)ans+=t[i];
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3852
#include <bits/stdc++.h>
using namespace std;
 
const int MAXN = 2e5 + 10;
 
long long a[MAXN], b[MAXN];
 
int main() {
    int n, m, k;
    cin >> n >> m >> k;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        a[i] += a[i - 1];
    }
    for (int i = 1; i <= m; i++) {
        cin >> b[i];
        b[i] += b[i - 1];
    }
    int ans = 0;
    int w = m;
    for (int i = 0; i <= n; i++) {
        if (a[i] > k) {
            break;
        }
        while (a[i] + b[w] > k) {
            w--;
        }
        ans = max(ans, i + w);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 6700
#include<iostream>
#include<string>
using namespace std;
int main()
{
  string s;
  int m=0;
  cin >> s;
  for(int a=0;a<s.size();a++)
  {
    if(s[a]=='o')
      m++;
  }
  cout << 700 + (m*100);
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define sz(arr) (int)arr.size()
#define all(arr) arr.begin(), arr.end()

using namespace std;
typedef long long ll;

void _cin() {}
template <class Head, class... Tail>
void _cin(Head&& head, Tail&&... tail) {
  cin >> head;
  _cin(forward<Tail>(tail)...);
}

#define Cin(T, ...) \
  T __VA_ARGS__;    \
  _cin(__VA_ARGS__)

int main() {
  Cin(ll, a, b, x);

  auto f = [&](ll n) {
    ll ret = (n < 0 ? 0 : n / x + 1);
    return ret;
  };

  cout << f(b) - f(a - 1) << endl;

  return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#include<functional>
using namespace std;
int main(void)
{
	int n,i,j,cnt,sum;
	scanf("%d",&n);
	sum=0;
	for(i=3;i<=n;i+=2)	{
		cnt=0;
		for(j=1;j<=i;j++)	{
			if(i%j==0)	cnt++;
		}
		if(cnt==8)	sum++;
	}
	printf("%d\n",sum);
	return 0;
}

Measured memory_bytes: 128
x = int(input())
if x < 600:
    print(8)
elif x < 800:
    print(7)
elif x < 1000:
    print(6)
elif x < 1200:
    print(5)
elif x < 1400:
    print(4)
elif x < 1600:
    print(3)
elif x < 1800:
    print(2)
else:
    print(1)

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

struct stu{
	int t;
	int h;
} s[100010];

int cmp(stu a,stu b)
{
	return a.t<b.t; 
}
int main()
{
	 int n;
	 cin>>n;
	 for(int i=0;i<n;i++)
	 {
	 	cin>>s[i].t;
	 	s[i].h=i;
	 }
	 sort(s,s+n,cmp);
	 for(int i=0;i<n;i++)
	 {
	 	cout<<s[i].h+1<<' '; 
	 }
	return 0;
}

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

using namespace std;

int main()
{
	
	int h,w,n,max;
	
	cin>>h>>w>>n;
	
	if(h>w){
	
		max=h;
	}
	else{
	
		max=w;
	}
	
	if(n%max!=0){
		cout<<(n/max)+1<<endl;
	}
	else{
		cout<<n/max;
	}
	return 0;
}

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

int main(){
  int N;
  cin >> N;
  int p[N];
  for(int i = 0; i < N; i++){
    cin >> p[i];
  }
  int total = 0;
  int max = 0;
  for(int i = 0; i < N; i++){
    if(max < p[i]){
      total += max/2;
      max = p[i];
      total += max / 2;
    } else {
      total += p[i];
    }
  }  
  cout << total << endl;
  return 0;
  
}

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

int main(){
    std::string str;
    std::queue<char> que;
    std::cin >> str;
    const int size = str.size();
    for(int i = 0; i < size; ++i){
        que.push(str.back());
        str.erase(str.size() - 1, 1);
    }
    for(int i = 0; i < size; ++i){
        if(i != size - 1){
            std::cout << que.front();
            que.pop();
        }else{
            std::cout << que.front() << std::endl;
        }
    }
    return 0;
}

Measured memory_bytes: 1184
#include<functional>
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<cstring>
#include<cstdlib>
#include<utility>
#include<string>
#include<cstdio>
#include<vector>
#include<bitset>
#include<cmath>
#include<ctime>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
using namespace std;
const int inf=2147483647,dx[]={-1,0,1,0},dy[]={0,-1,0,1};// 上 左 下 右
const int N=100005,M=1000005,K=200005,mod=1000000007;
const long long llinf=9223372036854775807ll;
//int & long long
int n,m,s[10],c[10],x[10];
bool ok;
int main(){
	cin>>n>>m;
	ok=true;
	for(int i=1;i<=3;i++)
		x[i]=-1;
	for(int i=1;i<=m;i++)
	{
		cin>>s[i]>>c[i];
		if(x[s[i]]==-1)
			x[s[i]]=c[i];
		else
		{
			if(x[s[i]]!=c[i])
				ok=false;
		}
	}
	if(x[1]==0&&n>1)
	{
		cout<<-1;
		return 0;
	}
	if(!ok)
	{
		cout<<-1;
		return 0;
	}
	if(x[1]!=-1)
		cout<<x[1];
	else
	{
		if(n>1) 
			cout<<1;
		else
			cout<<0;
	}
	if(n>1)
	{
		if(x[2]!=-1)
			cout<<x[2];
		else
			cout<<0;
	}
	if(n>2)
	{
		if(x[3]!=-1)
			cout<<x[3];
		else
			cout<<0;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
#include <iomanip>
//cout << fixed << setprecision(20) << *** << endl;
#define rep(i,N) for(int i=0;i<(int)N;++i)
typedef long long ll;
using namespace std;
int main()
{
	string s;
	cin>>s;
	s.pop_back();
	s.pop_back();
	s.pop_back();
	s.pop_back();
	s.pop_back();
	s.pop_back();
	s.pop_back();
	s.pop_back();
	cout<<s<<endl;
}

Measured memory_bytes: 256
#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 pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

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


	int N = getint();
	pair<int, int> P[200000];
	rep(i, N) {
		int a = getint(), b = getint();
		P[i] = mp(b, a);
	}
	sort(P, P + N);

	ll time = 0;
	bool OK = true;
	rep(i, N) {
		time += P[i].second;
		if (time > P[i].first) OK = false;
	}

	if (OK) co("Yes");
	else co("No");

	Would you please return 0;
}

Measured memory_bytes: 1920
#include<bits/stdc++.h>
using namespace std;
int const nax = 3e5 + 10, inf = 1e9;
int n , k ,s;


int main(){
    scanf("%d %d %d", &n, &k, &s);
    for(int i = 1 ;i <= k; i ++){
        printf("%d ", s);
    }
    int res = (s == inf) ? inf - 1 : inf;
    for(int i = 1 ; i <= n - k ;i ++){
        printf("%d ", res);
    }
}
/*
    Good Luck
        -Lucina
*/


Measured memory_bytes: 1280
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools

#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

N = int(input())
P = [int(i) for i in input().split()]
Q = [int(i) for i in input().split()]
ans = 0
a = 0
b = 0
ac = 0
bc = 0
NL = [0]*N
for i in range(N):
    NL[i] = i+1

N_list = list(itertools.permutations(NL, N))

for i in range(math.factorial(N)):
    for j in range(N):
        if(N_list[i][j]==P[j]):
            ac += 1
        if(N_list[i][j]==Q[j]):
            bc += 1
    if(ac == N):
        a = i+1
    if(bc == N):
        b = i+1
    ac = bc = 0
#print(a,b)
ans = abs(a-b)


print(ans)


Measured memory_bytes: 47724
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int n, a[110];

int main(void){
    cin >> n;

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

    int mem;
  /*  for(int i = 0; i < n; i++){
        for(int j = i; j < n; j++){
            if(a[j] > a[i]){
                mem = a[i];
                a[i] = a[j];
                a[j] = mem;
            }
        }
    }*/
  
  	sort(a, a+n, greater<int>());

    int alsum,bosum;

    for(int i = 0; i < n; i++){
        //cout << a[i] << endl;
        if(i % 2 == 0){
            alsum += a[i];
        }else{
            bosum += a[i];
        }
    }

    int out = alsum -bosum;
  
  	cout << out << endl;
}


Measured memory_bytes: 256
#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()
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};

int n = 3;
vector<int> a(3, INF);
vector<int> b(3, INF);

void solve() {
  vector<vector<int>> v(3, vector<int>(3));
  rep(i,n) rep(j,n) cin >> v[i][j];
  rep(i,n) rep(j,n) {
    if (a[i] == INF && b[j] == INF) {
      a[i] = 0;
      b[j] = v[i][j];
    } else {
      if (b[j] == INF) {
        b[j] = v[i][j] - a[i];
      } else if (a[i] == INF) {
        a[i] = v[i][j] - b[j];
      } else {
        if (a[i] + b[j] == v[i][j]) continue;
        cout << "No" << endl;
        return;
      }
    }
  }
  cout << "Yes" << endl;
}

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

Measured memory_bytes: 3636
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
using namespace std;
#define INF 100000000

typedef long long ll;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};

const int MAXV = 100100;

vector<int>G[MAXV];
int parent[MAXV];
int ord[MAXV];
int lowest[MAXV];
bool visit[MAXV];
int order = 0;
vector<int> ans;

void dfs(int v, int p) {
    parent[v] = p;
    ord[v] = order;
    lowest[v] = order;
    order++;
    visit[v] = true;
    int cnt = 0;
    for (int i = 0; i < G[v].size(); i++) {
        int next = G[v][i];
        if (!visit[next]) {
            dfs(next, v);
            lowest[v] = min(lowest[v], lowest[next]);
            cnt++;
        } else if (v != p) {
            lowest[v] = min(lowest[v], ord[next]);
        }
    }
    if (p != 0 && v != 0) {
        if (ord[p] <= lowest[v]) ans.push_back(p);
    }
    if (v == 0) {
        if (cnt > 1) ans.push_back(0);
    }
}

int main(void) {
    int V, E;
    cin >> V >> E;
    for (int i = 0; i < E; i++) {
        int s, t;
        cin >> s >> t;
        G[s].push_back(t);
        G[t].push_back(s);
    }
    // 0からdfsして木を形成する
    dfs(0, -1);
    sort(ans.begin(), ans.end());
    ans.erase(unique(ans.begin(), ans.end()), ans.end());
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 5260
#include <iostream>

using namespace std;

int main()
{
    int a, b, c, d; cin >> a >> b >> c >> d;

    if (a <= c) {
        if (b <= c) {
            cout << 0 << endl;
        } else {
            if (d <= b) cout << d - c << endl;
            else        cout << b - c << endl;
        }
    } else {
        if (d <= a) {
            cout << 0 << endl;
        } else {
            if (b <= d) cout << b - a << endl;
            else        cout << d - a << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <functional>
#include <climits>
#include <math.h>
#include <iomanip>
#include <fstream>
#include <random>
#include <queue>
#include <complex>

using namespace std;

inline void InitRand()
{
    srand((unsigned int)time(NULL));
}
int main() {
     InitRand();
    //cin.tie(0);
    //ios::sync_with_stdio(false);
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());
    int n;
    const double pi=3.1415926535898;
    cin>>n;
    double x[102];
    double y[102];
    for(int i=0;i<n;++i){
        cin>>x[i]>>y[i];
    }
    double angle;
    double ans[102]={};
    double tmp[3]={};
    for(int i=0;i<n;++i){
        ans[i]=0.5;
    }
    for(int i=0;i<n;++i){
        for(int j=0;j<n;++j){
            if(i==j){goto end1;}
            for(int k=0;k<n;++k){
                if(i==k||j==k){goto end2;}
                
                angle=acos(((x[j]-x[i])*(x[k]-x[i])+(y[j]-y[i])*(y[k]-y[i]))/sqrt((x[j]-x[i])*(x[j]-x[i])+(y[j]-y[i])*(y[j]-y[i]))/sqrt((x[k]-x[i])*(x[k]-x[i])+(y[k]-y[i])*(y[k]-y[i])));
                angle=pi-angle;

                if(ans[i]>=angle/2/pi){ans[i]=angle/2/pi;}
            end2:;
            }
        end1:;
        }
    }
    for(int i=0;i<n;++i){
        for(int j=0;j<n;++j){
            if(i==j){goto endd1;}
            for(int k=0;k<n;++k){
                if(i==k||j==k){goto endd2;}
                for(int l=0;l<n;++l){
                    if(i==l||j==l||k==l){goto endd3;}
                    tmp[0]=(x[k]-x[j])*(y[i]-y[j])-(y[k]-y[j])*(x[i]-x[j]);
                    tmp[1]=(x[l]-x[k])*(y[i]-y[k])-(y[l]-y[k])*(x[i]-x[k]);
                    tmp[2]=(x[j]-x[l])*(y[i]-y[l])-(y[j]-y[l])*(x[i]-x[l]);
                    if(tmp[0]<0&&tmp[1]<0&&tmp[2]<0){ans[i]=0;}
                endd3:;
                }
            endd2:;
            }
        endd1:;
        }
    }
    for(int i=0;i<n;++i){
        std::cout << std::setprecision(12)<<ans[i]<<endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define FOR(i,j,n,m) for(int i=j;i<n;i+=m)
#define RST(i,n) memset(i,n,sizeof i)
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(),a.end()
#define X first
#define Y second
#define mkp make_pair
#define pb push_back
#define pob pop_back
#ifdef cold66
#define debug(...) do{\
    fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<" ,";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.F<<","<<_p.S<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
#else
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#endif // cold66
//}

template<class T> inline bool chkmax(T &a, const T &b) { return b > a ? a = b, true : false; }
template<class T> inline bool chkmin(T &a, const T &b) { return b < a ? a = b, true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;

const ll MAXn=2e5+5,MAXlg=__lg(MAXn)+2;
const ll MOD=1000000007;
const ll INF=(ll)1e18;

ll d[MAXn];
ll n;
lf cal(lf b){
  ll ret = 0;
  REP(i,n) ret+=abs(d[i]-(b+i+1));
  return ret;
}
int main(){
  IOS();
  cin>>n;
  ll tp = 0;
  REP(i,n){
    cin>>d[i];
    chkmax(tp,d[i]);
  }
  lf l=-1e9,r=1e9;
  while(r-l>1e-6){
    debug("hi");
    lf m1=(2*l+r)/3,m2=(l+2*r)/3;
    lf x=cal(m1),y=cal(m2);
    if(x==y) l=m1,r=m2;
    else if(x>y) l=m1;
    else r=m2;
  }
  debug(l,r);
  ll ans = (ll)min({cal((ll)l),cal((ll)l+1),cal((ll)l-1)});
  cout<<ans<<endl;
}


Measured memory_bytes: 1792
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = Long.parseLong(sc.next());
		//String t = sc.next();
//		String buff="";
		long b = Long.parseLong(sc.next());
		int c = Integer.parseInt(sc.next());
		//int n = Integer.parseInt(sc.next());
		//long res=n;
		//int l = Integer.parseInt(sc.next());
		//int sum=0;
		//String s = sc.next();
		//String t = sc.next();
		//String b = sc.next();
		//int a = Integer.parseInt(sc.next());
		//String t = sc.next();

		if(b-a==c-b) {//a、e、i、o、u
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
		/*for(int i=0;i<t.length();i++) {
			if(t.substring(i,i+1).equals(",")) {
				buff+=" ";
			}else {
				buff+=t.substring(i, i+1);
			}
		}*/
		//System.out.println(a*800-(a/15)*200);
	}
}




Measured memory_bytes: 23124
#include<bits/stdc++.h>
using namespace std;
const int N = 1000005;
long long a[N];
int num[N]={0};
int main(){
	int time;
//	scanf("%d",&time);
//	while(time--){		
//	}
    int n;
    scanf("%d",&n);
	if(n==22) 
		printf("Christmas Eve Eve Eve\n");
	if(n==23)
	    printf("Christmas Eve Eve\n");
	if(n==24)
	    printf("Christmas Eve\n");
	    if(n==25)
	    printf("Christmas\n");
//	}
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
const int N=100+10;
const int M=1e5+10;
int a[N],f[M],n,m;
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	for(int i=0;i<=m;i++)
		for(int j=1;j<=n;j++)
			if(i+a[j]>m)break;
			else if(!f[i])f[i+a[j]]=1;
	puts(f[m]?"First":"Second");
	return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstdio>
#define ll long long
#define INF 1000000000000000001
#define MOD 1000000007
using namespace std;

int main(){
    int N, M, T;
    cin >> N >> M >> T;
    
    int ans=0;
    int a[100];
    for(int i=0; i<N; i++){
        cin >> a[i];
    }
    int cnt_a=0;
    
    int flag=0;
    for(int i=0; i<T; i++){
        if(cnt_a<N-1 && i>=a[cnt_a+1]-M){
            cnt_a++;
        }
        
        if(a[cnt_a]-M<=i && i<a[cnt_a]+M){
            flag=1;
        }else{
            if(flag){
                flag=0;
            }
            ans++;
        }
        

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






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

int main(){
    string S;
    string T;
    cin >> S >> T;
    map<char,int> s1,t1;
    for(int i=0;i<S.size();i++){
        s1[S[i]]++;
        t1[T[i]]++;
    }
    vector<int> s2,t2;
    map<char,int>::iterator it;
    for(it=s1.begin();it!=s1.end();it++){
        s2.push_back(it->second);
    }
    for(it=t1.begin();it!=t1.end();it++){
        t2.push_back(it->second);
    }
    sort(s2.begin(),s2.end());
    sort(t2.begin(),t2.end());
    if(s2.size()!=t2.size()){
        cout << "No" << endl;
        return 0;
    }else{
        for(int i=0;i<s2.size();i++){
            if(s2[i]!=t2[i]){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
}

Measured memory_bytes: 776
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

const int L=100;

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

  int N;
  cin>>N;

  vector<int> ans(N+1,0);
  for(int x=1;x<=L;x++) for(int y=1;y<=L;y++) for(int z=1;z<=L;z++){
    int res=(x+y)*(x+y)+(y+z)*(y+z)+(z+x)*(z+x);
    if(res%2||res>2*N) continue;
    ans[res/2]++;
  }

  for(int i=1;i<=N;i++) cout<<ans[i]<<"\n";

  return 0;
}


Measured memory_bytes: 3656
#include<cstdio>
#include<cassert>
using namespace std;
typedef long long ll;
const int maxn = 3e6 + 10;
const ll mod = 998244353;



ll inv[maxn] ,fac[maxn];


void prec(int n){
	inv[0] = 1;inv[1] = 1;fac[1] = 1;fac[0]= 1;
	for(int i = 2;i <= n;i++) inv[i] = mod - inv[mod % i] * (mod / i) % mod ;
	for(int i = 2;i <= n;i++) inv[i] = (inv[i] * inv[i - 1]) % mod,fac[i] = (fac[i - 1] * i) % mod;
}
ll C(ll n,ll m){ if(n < m) return 0;return inv[m] * inv[n - m] % mod * fac[n] % mod;	}

int main(){
	ll n,A,B,k;
	prec(maxn - 1);
	scanf("%lld%lld%lld%lld",&n,&A,&B,&k);
	ll ans = 0;
	for(ll a = 0;a <= n;a++){
		ll x = k - a * A;
		if(x < 0) continue;
		if(x % B) continue;
		ll b = x / B;
		if(b > n || b < 0 ) continue; 
		ans = (ans + C(n,a) * C(n,b) % mod) % mod;
	}	
	printf("%lld\n",ans);
}

Measured memory_bytes: 46976
#pragma region include
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <cstdio>
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define MOD 1000000007
#define INF 1000000000
#define LLINF 4000000000000000000
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
#pragma endregion

//#define __DEBUG__
#ifdef  __DEBUG__
#define dump(x) cerr << #x << " = " << (x) << " [" << __LINE__ << ":" << __FUNCTION__ << "] " << endl;
// vector出力
template<typename T>
ostream& operator << (ostream& os, vector<T>& v) {
    os << "{";
    REP(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); }
    os << "}";
    return os;
}
// pair出力
template<typename T, typename U>
ostream& operator << (ostream& os, pair<T, U>& p) {
    return os << "(" << p.first << ", " << p.second << ")";
}
// map出力
template<typename T, typename U>
ostream& operator << (ostream& os, map<T, U>& map_var) {
    os << "{";
    for (auto itr = map_var.begin(); itr != map_var.end(); itr++) {
        os << "(" << itr->first << ", " << itr->second << ")";
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set 出力
template<typename T>
ostream& operator << (ostream& os, set<T>& set_var) {
    os << "{";
    for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {
        os << *itr;
        ++itr;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
#endif

int main() {
    cin.tie(0); ios::sync_with_stdio(false);
    int N, K;
    string S;
    cin >> N >> K >> S;
    S[K-1] = (char)(S[K-1] - 'A' + 'a');
    cout << S << endl;
    getchar(); getchar();
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){
  int ih,im,is;
  int oh,om,os;
  int o3h,o3m,o3s;

  while(1){
    scanf("%d %d %d",&ih,&im,&is);
    if(ih<0 && im<0 && is<0)break;

    oh = 2 - ih;
    om = 0 - im;
    os = 0 - is;

    if(os<0){
      os += 60;
      om--;
    }

    if(om<0){
      om += 60;
      oh--;
    }

    o3h = 3*oh;
    o3m = 3*om;
    o3s = 3*os;

    while(o3s>=60){
      o3s -= 60;
      o3m++;
    }

    while(o3m>=60){
      o3m -= 60;
      o3h++;
    }

    if(oh<10)printf("0%d:",oh);
    else printf("%d:",oh);
    if(om<10)printf("0%d:",om);
    else printf("%d:",om);
    if(os<10)printf("0%d\n",os);
    else printf("%d\n",os);
    if(o3h<10)printf("0%d:",o3h);
    else printf("%d:",o3h);
    if(o3m<10)printf("0%d:",o3m);
    else printf("%d:",o3m);
    if(o3s<10)printf("0%d\n",o3s);
    else printf("%d\n",o3s);
  }

  return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
const int N = 100010;

struct point
{
	int num, first, left, right;
	bool visited, odd;
};

struct edge
{
	int next, to;
};

int cnt = 1, n, k;
edge e[N << 1];
point p[N];

void addedge(int u, int v)
{
	e[++ cnt].next = p[u].first;
	p[u].first = cnt;
	e[cnt].to = v;
	e[++ cnt].next = p[v].first;
	p[v].first = cnt;
	e[cnt].to = u;
}

void dfs1(int i)
{
	p[i].visited = true;
	if (~p[i].num && p[i].odd != (p[i].num & 1))
	{
		printf("No\n");
		exit(0);
	}
	for (int j = p[i].first; j; j = e[j].next)
	{
		int x = e[j].to;
		if (p[x].visited)
			continue;
		p[x].odd = !p[i].odd;
		dfs1(x);
		p[i].left = max(p[i].left, p[x].left - 1);
		p[i].right = min(p[i].right, p[x].right + 1);
	}
	if (p[i].left > p[i].right)
	{
		printf("No\n");
		exit(0);
	}
}

void dfs2(int i)
{
	p[i].visited = true;
	for (int j = p[i].first; j; j = e[j].next)
	{
		int x = e[j].to;
		if (p[x].visited)
			continue;
		if (p[i].num - 1 >= p[x].left && p[i].num - 1 <= p[x].right)
			p[x].num = p[i].num - 1;
		else
			p[x].num = p[i].num + 1;
		dfs2(x);
	}
}
		
int main()
{
	scanf("%d", &n);
	for (int i = 1; i <= n; i ++)
	{
		p[i].num = -1;
		p[i].left = -1e9;
		p[i].right = 1e9;
	}
	for (int i = 0, u, v; i < n - 1; i ++)
	{
		scanf("%d%d", &u, &v);
		addedge(u, v);
	}
	scanf("%d", &k);
	int root;
	for (int i = 0, x, num; i < k; i ++)	
	{
		scanf("%d%d", &x, &num);
		p[x].num = num;
		p[x].left = num;
		p[x].right = num;
		root = x;
	}
	p[root].odd = p[root].num & 1;
	dfs1(root);
	for (int i = 1; i <= n; i ++)
		p[i].visited = false;
	dfs2(root);
	printf("Yes\n");
	for (int i = 1; i <= n; i ++)
		printf("%d\n", p[i].num);
	return 0;
}

Measured memory_bytes: 9088
#include<stdio.h>
int main(void){
    int a,b[11]={-1},i;
    while(scanf("%d",&a)!=EOF){
        if(a==0){
            for(i=10;i>=0;i--){
                if(b[i]!=0){
                    printf("%d\n",b[i]);
                    b[i]=0;
                    break;
                }
            }
        }else{
            for(i=10;i>=0;i--){
                if(b[i]!=0){
                    b[i+1]=a;
                    break;
                }
            }
        }
    }
    return 0;
}

Measured memory_bytes: 600
# -*- coding: utf-8 -*-
"""
C - Many Medians
https://beta.atcoder.jp/contests/abc094/tasks/arc095_a

"""
import sys
from sys import stdin
input = stdin.readline


def solve(N, numbers):
    tmp = numbers[:]
    tmp.sort()
    s = tmp[(N-1)//2]
    l = tmp[N//2]

    ans = []
    for n in numbers:
        if n > s:
            ans.append(s)
        else:
            ans.append(l)
    return ans


def main(args):
    N = int(input())
    numbers = [int(x) for x in input().split()]
    ans = solve(N, numbers)
    print(*ans, sep='\n')


if __name__ == '__main__':
    main(sys.argv[1:])
    


Measured memory_bytes: 25640
N = int(input())

tprev = 0
xprev = 0
yprev = 0

result = 'Yes'

for i in range(N):
    t, x, y = map(int, input().split())

    xlen = abs(x - xprev)
    ylen = abs(y - yprev)
    
    time = t - tprev

    length = xlen + ylen

    if time%2 == length%2 and time >= length:
        tprev = t
        xprev = x
        yprev = y

    else:
        result = 'No'
        break
print(result)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
const int inf = 1001001001;
const int mod = 1000000007;


//yet solved 2020/8/15

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

  vector<int> cum(n+2);
  // com = {0,0,1,3,...}index 1~n+1
  rep(i,n) {
    cum[i+2] = cum[i+1] + i+1;
    cum[i+2] %= mod;
  }

  int ans = 0;
  for(int i = k; i <= n+1; i++){
    int mx = cum[n+1]-cum[n+1-i];
    int mn = cum[i]-cum[0];
    mx %= mod;
    mn %= mod;
    ans += (mx - mn + 1 + mod)%mod;
    ans %= mod;
  }
  cout << ans << endl;
}

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

using namespace std;

using ll = long long;
using vll = vector<ll>;
using vii = vector<int>;
using pii = pair<int, int>;
template <typename T = vii>
using vec = vector<T>;

const ll INF = 1e18, MOD = 1e9 + 7;

const int MAX = 1e6;

int main() {
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
    // freopen("in.in", "r", stdin);

    int n, m;
    cin >> n >> m;
    vec<pii> v(n);
    for (pii &p : v) {
        cin >> p.first >> p.second;
    }
    sort(v.begin(), v.end());
    ll res = 0;
    {
        auto it = v.begin();
        priority_queue<int> q;
        for (int i = 1; i <= m; i++) {
            while (it != v.end() and it->first <= i) {
                q.push(it->second);
                it++;
            }
            if (not q.empty()) {
                res += q.top();
                q.pop();
            }
        }
    }
    cout << res << '\n';
}

Measured memory_bytes: 1660
#include <iostream>
#include <string>
#define FOR(i,k,n) for (int (i)=(k);(i)<(n);(i)++)
using namespace std;

int main()
{
  long x, n, q;
  int r;
  cin >> x;

  q = x / 11;
  r = x % 11;
  if (r == 0) n = 2*q;
  else if (r <= 6) n = 2*q+1;
  else n = 2*q+2;

  cout << n << endl;
  return 0;
}


Measured memory_bytes: 256
//
// Created by yuu on 2019-08-04.
//

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <utility>
#include <math.h>
#include <stack>
#include <queue>
#include <cstdio>

using namespace std;

long long H[100010];
int main(void){
    int N;
    cin>>N;

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

    bool flag = true;

    for (int i = 0; i < N-1; ++i) {
        if(H[i+1]-H[i]>0){
            H[i+1]--;
        }
    }


    for (int i = 0; i < N-1; ++i) {
        if(H[i+1]-H[i]>=0){

        }else{
            flag = false;
            break;
        }
    }


    if(flag){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }

    return 0;
}

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

using namespace std;

int main(){
	int A,B,C,K;
	int ans = 0; // 0...No 1...Yes
	int count = 0;
	cin >> A >> B >> C >> K;

	for (int i=K; i > 0; i--) {
		if(B > A){
			count = i;
			break;
		}
		B *= 2;		
	}

	// cout << "couunt = "  << count << "\n";

	for (int i = 0; i < count; i++) {
		if(C > B){
			break;
		}		
		C *= 2;
	}
	
	// cout << "A = " << A << "\n";
	// cout << "B = " << B << "\n";
	// cout << "C = " << C << "\n";
	
	if(B > A && C > B) {
		cout << "Yes\n";
	}
	else {
		cout << "No\n";
	}
	return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 1000000007
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main()
{
    int x;
    int c = 0;
    string s;
    string abc = "ABC";
    cin >> x;
    cin >> s;
    int pos = s.find(abc);

    while (pos != string::npos)
    {
        c++;
        pos = s.find(abc, pos + 3);
    }

    cout << c << endl;
}

Measured memory_bytes: 3612
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <set>
#include <sstream>
using namespace std;
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
#define chmax(a, b) a = (((a)<(b))?(b):(a))
#define chmin(a, b) a = (((a)<(b))?(a):(b))

const int INF = 1001001001;
const ll MOD = 1e9+7;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){std::fill((T*)array, (T*)(array+N),val);}

class CompareDist
{
public:
    bool operator()(PLL n1,PLL n2) {
				if(n1.first!=n2.first) return n1.first<n2.first;
				else return n1.second<n2.second;
    }
};

#define lengthof(x) (sizeof(x) / sizeof(*(x)))


__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

ll mpow(ll a, ll b){
  if(b==0) return 1;
  else if(b%2==0){ll memo = mpow(a,b/2); return memo*memo%MOD;}
  else return mpow(a,b-1) * a % MOD;
}

signed main(){
  int n; cin>>n;
  VI a(n); rep(i,n) cin>>a[i];
  sort(ALL(a));
  int cnt = 1;
  int ans = 0;
  reps(i,n-1){
    if(a[i-1]==a[i]) cnt++;
    else{
      if(a[i-1]<=cnt) ans += cnt-a[i-1];
      else ans += cnt;
      cnt = 1;
    }
  }
  if(a[n-1]!=cnt){
    if(a[n-1]<cnt) ans += cnt-a[n-1];
    else ans += cnt;
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int dx[4]={1,0,-1,0} , dy[4]={0,1,0,-1} ;
struct BIT{
private:
   int sz;
   vector<ll> node;
public:
   BIT(int n):sz(n),node(n+1){};
   void add(int k,ll x){
       k++;
       while(k<=sz){
           node[k]+=x;
           k+=k&-k;
       }
   }
   ll sum(int k){
       k++;
       ll ret=0;
       while(k>0){
           ret+=node[k];
           k-=k&-k;
       }
       return ret;
   }
   ll sum(int l,int r){
       return sum(r-1)-sum(l-1);
   }
   ll get(int k){
       return sum(k,k+1);
   }
};
int main(){
   int n,m;
   cin>>n>>m;
   pair<int,pint> p[n+m];
   rep(i,n){
       int l,r;
       cin>>l>>r;
       p[i]={r-l,{l,r}};
   }
   rep(i,m)p[n+i]={i+1,{0,0}};
   sort(p,p+n+m);
   BIT bit(m+1);
   int cnt=n;
   rep(i,m+n){
       if(p[i].second.first){
           bit.add(p[i].second.first,1);
           bit.add(p[i].second.second+1,-1);
           --cnt;
       }
       else{
           int ret=cnt;
           for(int j=p[i].first;j<=m;j+=p[i].first){
               ret+=bit.sum(j);
           }
           cout<<ret<<endl;
       }
   }
   return 0;
}

Measured memory_bytes: 6400
#include"bits/stdc++.h"
using namespace std;
int a,b;
int main(){
    cin>>a>>b;if(a>0)cout<<"Positive";else if(a==0||(a<0&&b>0))cout<<"Zero";else if((abs(b)-abs(a))%2!=0)cout<<"Positive";else cout<<"Negative";
    return 0;
}

Measured memory_bytes: 256
n,x,y = map(int,input().split())
mid = (x + y) // 2
# indと距離が同じ
num_roots = [0] * n
for start in range(1,n):
    for goal in range(start + 1,n+1):
        if start <= mid:
            if goal <= mid:
                d = goal - start
            else:
                d = min(goal - start, abs(x - start) + 1 + abs(goal - y))
        else:
            d = goal - start
        num_roots[d] += 1
for i in range(1,n):
    print(num_roots[i])


Measured memory_bytes: 3444
#include<iostream>
#include<string>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<vector>
#include<iomanip>
#include<map>
#include<set>
#include<utility>
#include<iterator>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
//#define t ll t;cin>>t;while(t--)
#define nn cout<<endl;
#define ff(a,n) for(ll i=a;i<n;i++)
#define cY cout<<"YES\n"
#define cN cout<<"NO\n"
#define cy cout<<"Yes\n"
#define cn cout<<"No\n"
#define sc second
#define fs first
#define c(a) cout<<a<<endl

void solve()
{
	ll x, k, d; cin>>x>>k>>d;
	x=abs(x);
	if(x>0&&(x/d)>=k)
	{
		ll y=x-(k*d);
		cout<<y;
		return;
	} 
	else
	{
		ll y=x/d;
		k-=y;
		x-=(y*d);
		if(k%2==0)cout<<abs(x);
		else cout<<min(abs(x-d), abs(x+d));
	} 
}

int main()
{
	solve();
}
/*




*/


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

public class AtCoderA
{
    static void Main()
    {
        string s = Console.ReadLine();

        if ("Sunny".Equals(s))
        {
            Console.WriteLine("Cloudy");
        }
        else if ("Cloudy".Equals(s))
        {
            Console.WriteLine("Rainy");
        }
        else
        {
            Console.WriteLine("Sunny");
        }
    }
}

Measured memory_bytes: 11092
a,b = map(int,input().split())

t = b//1000

f = False

for i in range(t//10+1):
    for j in range((t-i*10)//5+1):
        if a == t - i*9 - j*4 and b == i*10000+j*5000+(a-i-j)*1000 and a-i-j>=0:
            f = True
            break
    if f:
        break

if f:
    print(i,j,a-i-j)
else:
    print(-1,-1,-1)


Measured memory_bytes: 3188
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, a, n) for (int i = (a); i < (n); i++)
#define repr(i, n, a) for (int i = (n)-1; i >= (a); i--)
#define repit(it, v) for (auto(it) = (v).begin(); (it) != (v).end(); (it)++)
#define sortt(v) sort((v).begin(), (v).end())
#define sortr(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(), (v).end()
#define co(x) cout << (x)
#define con(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define mkp make_pair
#define mkt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/******* Variable ***********************************/
const int maxn = 1e6 * 50;
const double inf = 0x3f3f3f3f3f;
/******* Function ***********************************/
void out(const vector<int> A) {
  rep(i, 0, A.size()) { cout << A[i] << ((i != A.size() - 1) ? " " : "\n"); }
}

/******* Main ****************************************/
int main() {
  int a, b, c;
  int ans = 0;
  cin >> a >> b >> c;
  vector<int> div;
  rep(i, 1, c + 1) {
    if (c % i == 0) div.pub(i);
  }
  rep(i, a, b + 1) {
    for (auto &d : div) {
      if (i == d) ans++;
    }
  }
  con(ans);
  return 0;
}


Measured memory_bytes: 3140
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define Sort(a) sort(a.begin(), a.end())
const int INF = 1 << 30;
const ll MOD = 1000000007;
int A, B, K;
int main(void) {
  cin >> K;
  cin >> A >> B;
  for (int i = A; i <= B; i++) {
    if (i % K == 0) {
      cout << "OK" << endl;
      return 0;
    }
  }
  cout << "NG" << endl;
  return 0;
}

Measured memory_bytes: 3632