akhauriyash/Code-Regression huggingface dataset:
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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


#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    ($arg:expr) => (println!("{:?}",$arg));
}


#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}


use std::cmp;
use std::collections::HashMap;





fn main() {

    input! { 
       n: usize,
    }

    let mut prim = vec![false;55556];
    
    

    for i in 2..prim.len(){
        if(prim[i] == false){
            let mut j = i;
            while(true){
                j+=i;
                if(j>=prim.len()){break;};
                prim[j] = true;
            }
        }
    }

    //mydbg!{prim};
    let mut ans = vec![];
    for (index,x) in prim.iter().enumerate(){
        if index < 2 {continue};
        if *x== false && (index % 5 ) == 1 {
            ans.push(index);
        }
        if(ans.len() == n){
            break;
        }
    }    


    
    for item in ans{
        println!("{}",item);
    }
    


}


Measured memory_bytes: 4352
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include<cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include<iostream>
#include<list>
#include<queue>
#include<set>
#include<string>
#include<utility>
#include <vector>

#define ll long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define FORR(i,a,b) for(int i=(a);i>=(b);--i)
#define REPR(i,n)   FORR(i,n,0)

using namespace std;

int main() {
	int N, t[100001] = { 0 }, x[100001] = { 0 }, y[100001] = { 0 };
	cin >> N;
	FOR(i, 1, N + 1){
		cin >> t[i] >> x[i] >> y[i];
	}

	string Ans = "Yes";

	REP(i, N) {
		if (t[i + 1] - t[i] < abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i]) || (t[i + 1] - t[i]) % 2 != (abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i])) % 2) {
			Ans = "No";
		}
	}

	cout << Ans << endl;

	return 0;
}

Measured memory_bytes: 1408
#include <iostream>
using namespace std;
#define MAX 100005
#define NIL -1

struct Node {int p, l, r;};

Node T[MAX];
int n, D[MAX];

void print(int u) {
  int i, c;
  cout << "node " << u << ": ";
  cout << "parent = " << T[u].p << ", ";
  cout << "depth = " << D[u] << ", ";

  if (T[u].p == NIL) cout << "root, ";
  else if (T[u].l == NIL) cout << "leaf, ";
  else cout << "internal node, ";

  cout << "[";
  for (i = 0, c = T[u].l; c != NIL; i++, c = T[c].r) {
    if (i) cout << ", ";
    cout << c;
  }
  cout << "]" << endl;
}

int rec(int u, int p) {
  D[u] = p;
  if (T[u].r != NIL) rec(T[u].r, p);
  if (T[u].l != NIL) rec(T[u].l, p+1);
}

int main() {
  int i, j, d, v, c, l, r;
  cin >> n;
  for (i=0; i<n; i++) T[i].p = T[i].l = T[i].r = NIL;

  for (i=0; i<n; i++) {
    cin >> v >> d;
    for (j=0; j<d; j++) {
      cin >> c;
      if (j == 0) T[v].l = c;
      else T[l].r = c;
      l = c;
      T[c].p = v;
    }
  }
  for (i=0; i<n; i++) {
    if (T[i].p == NIL) r = i;
  }

  rec(r, 0);

  for (i=0; i<n; i++) print(i);
  return 0;
}


Measured memory_bytes: 7768
import std.stdio;
import std.conv;
import std.array;

void main()
{
    auto reader = readln.split;
    int N = reader[0].to!int;
    int D = reader[1].to!int;

    int range = D * 2 + 1;
    int ans = N / range;
    if (N % range > 0){
        ans++;
    }

    writeln(ans);
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define boost                         \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define ll long long int
// #define int ll
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vii vector<pii>
#define pb push_back
#define B begin()
#define E end()
#define sz(A) (ll)(A).size()
#define F first
#define S second
#define loop(z, v) for (auto &z : v)
#define sp << ' ' <<
#define sps << ' '
#define nl "\n"
// #define nl endl
#define fat 1000000007
// #define fat 998244353
#define PI_2 1.57079632679489661923


int main() {
    ll tt = 1, n, m, l, r, c, i, j, k, w, x, y;
    boost;
    
    // cin >> tt;
    ll ans = 0;

    for(int _ = 1; _ <= tt; _++) {
        // cout << "Case #" << _ << ": ";
        cin >> n >> r >> c;

        if(n <= r*c) cout << "Yes" << nl;
        else cout << "No" << nl;
    }
}

Measured memory_bytes: 3688
/*********************************************************************************\
*  _________  _      _  ________  _       _       __       ________               *
* |___   ___|| |    | ||  ______|| |     | |     /  \     |  ____  |              *
*     | |    | |    | || |______ | |_____| |    / /\ \    | |____| |              *
*     | |    | |    | ||______  ||  _____  |   / /__\ \   |  __  __|              *
*     | |    | |____| | ______| || |     | |  / ______ \  | |  \ \                *
*     |_|    |________||________||_|     |_| /_/      \_\ |_|   \_\               *
*                                                                                 *
*   Department of Computer Science & Engineering                                  *
*   Student ID : 18CSE035                                                         *
*   Bangabnadhu Sheikh Mujibur Rahman Science & Technology University,Gopalgonj.  *
*                                                                                 *
\*********************************************************************************/

//Now Write to Code ___________________________


#include <bits/stdc++.h>
using namespace std ;
 
 
typedef long long                ll;
typedef long double              ld;
typedef unsigned long long       ull;
typedef pair <int,int>           pii;
typedef pair <ll,ll>             pll;
typedef vector <int>             vi;
typedef vector <ll>              vll;
typedef vector <vector <int> >   vvi;
 
inline int Int(){int x; cin >> x; return x;}
inline ll Long(){ll x; cin >> x; return x;}
inline float Float(){float x; cin >> x; return x;}
inline double Double(){double x; cin >> x; return x;}
inline void Yes(){cout << "Yes" << endl;}
inline void No(){cout << "No" << endl;}
inline void YES(){cout << "YES" << endl;}
inline void NO(){cout << "NO" << endl;}
 
const int N             =(int)2e5 + 5;
const int maxN          =(int)1e6 + 6;
const ll  Mod           =(ll)1e9 + 7;
const int inf           =(int)2e9;
const ll  Inf           =(ll)1e18;
 
#define     T           int t,q; cin >> t; for(q=1;q<=t;q++)
#define     debug(x)    cerr << #x << " = " << x << '\n' ;
#define     rep(i,b,e)  for(__typeof(e) i=(b); i!=(e+1)-2*(b > e); i =i+1-2*(b > e))
#define     Int         Int()
#define     Long        Long()
#define     Float       Float()
#define     Double      Double()
#define     all(x)      x.begin() , x.end()
#define     sz(x)       (int)x.size()
#define     ff          first
#define     ss          second
#define     pb          push_back
#define     eb          emplace_back
#define     mem(a)      memset(a , 0 ,sizeof a)
#define     memn(a)     memset(a , -1 ,sizeof a)
 
 
int main(){

	ll A,B,C;

	cin >> A >> B;
	C = (A*B)+1;

	if(A==1 || B==1)
		cout << 1 << endl;
     
    else
	    cout << C/2 << endl;    


    return 0 ;
}
 
//...............BYE BYE................

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

int main(){
    
    int n,m,per=1;
    cin>>n>>m;
    for(int i=0;i<m;i++)per*=2;
    int x;
    x=1900*m*per+100*(n-m)*per;
    cout<<x<<endl;
   
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <string>
#include <random>
#include <stack>
using namespace std;
typedef long long ll;
const int maxn = 100005;
const int mod = 1000000007;

int p[maxn];

int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  //freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
  p[0]=1;
  for(int i=1;i<maxn;i++)p[i]=p[i-1]*2%mod;
  int n;
  string s;
  cin>>n>>s;
  vector<int>c=vector<int>(26,0);
  for(int i=0;i<n;i++)c[s[i]-'a']++;
  ll ret = 1;
  for(int i=0;i<26;i++)ret=ret*(c[i]+1)%mod;
  ret = (ret+mod-1)%mod;
  cout<<ret<<endl;
  return 0;
}

Measured memory_bytes: 896
#include <stdio.h>
int main(void)
{
	int H,W,i,j,a;
		
	while(1){
		scanf("%d %d",&H,&W);
		if(H==0 && W==0) break;
			for(i=0; i<W;i++)			putchar('#');
				putchar('\n');
				
		for(j=1; j<H-1;j++){
				putchar('#');
	    	for(i=1; i<W-1;i++)			putchar('.');
			puts("#");
		}
				for(i=0; i<W;i++)			putchar('#');
				putchar('\n');


	putchar('\n');
	}
	return 0;
}


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

/*int par[100000];

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

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

int min(int a, int b){
    if(a > b) return b;
    else return a;
}

void unite(int x, int y){
    x = find(x);
    y = find(y);
    if(x == y) return;

    par[x] = y;
}*/

int main(){
	int E,Y;
	cin>>E>>Y;
	if(E==0){
		int y=Y-1867;
		if(y<=44){
			cout<<'M'<<y<<endl;
		}
		if(y-44>0 && y-44<=14){
			cout<<'T'<<y-44<<endl;
		}
		if(y-58>0 && y-58<=63){
			cout<<'S'<<y-58<<endl;
		}
		if(y-121>0){
			cout<<'H'<<y-121<<endl;
		}
	}
		if(E==1){
			cout<<Y+1867<<endl;
		}
		if(E==2){
			cout<<Y+1911<<endl;
		}
		if(E==3){
			cout<<Y+1925<<endl;
		}
		if(E==4){
			cout<<Y+1988<<endl;
		}
	/*int H,R;
	cin>>H>>R;
	if(H>-R){
		cout<<1<<endl;
	}
	if(H==-R){
		cout<<0<<endl;
	}
	if(H<-R){
		cout<<-1<<endl;
	}*/

	/*
int W;
cin>>W;
cout<<W*32<<endl;*/

    return 0;
}


Measured memory_bytes: 3100
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define rep(i, n)   for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main(){
    ll x, k, d; cin >> x >> k >> d;
    if(x < 0)   x = -x;
    ll ans = 0;
    if(k <= x/d){
        ans = x-d*k;
    }else{
        k -= x/d;
        x = x-d*(x/d);
        if(k%2 == 0)    ans = x;
        else            ans = x-d;;
    }
    if(ans < 0) ans = -ans;
    cout << ans << endl;
}


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

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

    bool ans = false;
    for (int i = 0; i < 7; ++i) {
        if (S.substr(0, i) + S.substr(S.size()-7+i) == "keyence") ans = true;
    }

    if (ans) cout << "YES" << endl;
    else cout << "NO" << endl;
}

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

int main(){
    int n;
    ll ans=0;
    cin>>n;
    vector<int> d(n);
    rep(i,n) cin>>d[i];
    rep(i,n-1){
        rept(i+1,j,n){
            ans+=d[i]*d[j];
        }
    }
    cout<<ans<<endl;
    return 0;
}

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

#define INF 1000010000
#define nl '\n'
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define pdd pair<double,double>
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))
#define sz(c) (c).size()
#define rep(i,n) for( int i = 0; i < n; ++i )
#define repi(i,n) for( int i = 1 ; i <= n; ++i )
#define repn(i,n) for( int i = n - 1 ; i >= 0 ; --i )
#define repf(j,i,n) for( int j = i ; j < n ; ++j )
#define die(s) {std::cout << s << nl;}
#define dier(s) {std::cout << s; return 0;}
#define dbg(var) {std::cout << #var << "  = " << var << nl;}
#define vi vector<int>
typedef long long ll;

using namespace std;

constexpr int MAXN = 101010;

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

	int n , k;
	cin >> n >> k;
	
	vi can(istream_iterator<int>{cin} , istream_iterator<int>());
	SORT(can);
	
	std::function<int(const set<int>&)> mex = [](const set<int>& grundy)
	{
		int mex = 0;
		while(grundy.find(mex) != end(grundy))
			++mex;
		return mex;
	};
	
	vi dp(k + 1 , -1);
	
	std::function<int(int)> rec = [&](int cur)
	{
		if(cur <= 0)
			return 0;
		
		if(dp[cur] != -1)
			return dp[cur];
			
		set<int> grundy;
		for(const auto& el : can)
		{
			if(el <= cur)
				grundy.insert(rec(cur - el));
			else
				break;
		}
		
		return dp[cur] = mex(grundy);
	};
	
	cout << (rec(k) ? "First" : "Second") << endl;
	
	

	return 0;
}

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

using namespace std;

#define all(c) (c).begin(), (c).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int N;
int a[100005];
int main() {
    cin >> N;
    rep(i, N) cin >> a[i];

    int cnt[3] = {};
    rep(i, N) {
        if (a[i] % 4 == 0)
            cnt[0]++;
        else if (a[i] % 2 == 0)
            cnt[1]++;
        else
            cnt[2]++;
    }
    if (cnt[0] >= cnt[2]) {
        cout << "Yes" << endl;
        return 0;
    }
    if (cnt[1] == 0) {
        if (cnt[0] + 1 >= cnt[2]) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 640
import java.io.IOException;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.io.PrintWriter;

import java.util.Arrays;

@SuppressWarnings("unchecked")
public class Main {
    public static void main(String[] args) throws IOException {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        PrintWriter out = new PrintWriter(System.out);

        final String[] sl = s.split(" ");
        int X = Integer.parseInt(sl[0]);
        int Y = Integer.parseInt(sl[1]);

        out.println(X + Y / 2);

        out.flush();
    }
}


Measured memory_bytes: 22228
from sys import stdin
a = int(stdin.readline().rstrip())
b = len(str(a))
c = b//2
d = 0
if b == 1:
    print(a)
elif b % 2 == 0:
    for i in range(c):
        d += (10**(2*i+1)-10**(2*i))
    print(d)
else:
    for s in range(c):
        d += (10**(2*s+1)-10**(2*s))
    d += a-(10**(2*c))+1
    print(d)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> h(n);
  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }
  int ans = 1;
  int m = h[0];
  for (int i = 1; i < n; i++) {
    m = max(h[i - 1], m);
    if (h[i] >= m) {
      ans += 1;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(auto i=0;i<n;++i)
#define REPR(i,n) for(auto i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(auto i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(n,v) {int tmp;for(int i=0;i<n;++i){scanf("%d",&tmp);v.push_back(tmp);}}

int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

using namespace std;

typedef pair<int,int> pii;

int main(){

 
  llong n, x, y;
  cin >> n >> x >> y;
  x--; y--;

  vector<vector<llong>> v(n, vector<llong>(n));
  REP(i,n){
    for(int j = i; j <n; ++j){
      v[i][j] = j - i;
    }
  }

  map<llong, llong> mp;
  REP(i,n){
    for(int j = i; j < n; ++j){
      v[i][j] = min(v[i][j], 1 + min(llabs(i - x), llabs(i - y)) + min(llabs(j - x), llabs(j - y)));
      mp[v[i][j]]++;
    }
  }
  FOR(i,1,n){
    cout << mp[i] << endl;
  }

  return 0;

}





Measured memory_bytes: 34492
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()

def resolve():
    import sys
    input = sys.stdin.readline

    n = int(input().rstrip())

    l_map = {}
    for l in input().rstrip().split(" "):
        l = int(l)
        if l not in l_map:
            l_map[l] = 0
        l_map[l] += 1
    ans = 0
    import itertools
    for c in list(itertools.combinations(l_map.keys(), 3)):
        if max(c) >= sum(c) - max(c):
            continue
        ans += l_map[c[0]] * l_map[c[1]] * l_map[c[2]]
    print(ans)


if __name__ == "__main__":
    resolve()


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

int N;
int a[112345];
int main () {
    cin >> N;
    for(int i=0; i<N; i++) {
        int x;
        cin >> x;
        x++;
        a[x-1]++;
        a[x]++;
        a[x+1]++;
    }
    int ans = 0;
    for(int i=0; i<100009; i++) ans = max( ans, a[i]);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 640
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/math/common_factor_rt.hpp>  // https://boostjp.github.io/tips/math.html
#include <boost/dynamic_bitset.hpp>  // https://boostjp.github.io/tips/dynamic_bitset.html

constexpr int64_t DIV1097 = 1000000007LL;

using namespace std;

int main()
{
    int64_t N, K;
    std::cin >> N >> K;

    struct E {
        int64_t a;
        int64_t b;
    };

    std::vector<E> e;
    for (int64_t i = 0; i < N; ++i) {
        int64_t a, b;
        std::cin >> a >> b;
        e.push_back({a, b});
    }

    std::sort(std::begin(e), std::end(e),
              [](const auto& a, const auto& b) {
                  return a.a < b.a;
              });

    for (auto i: e) {
        K -= i.b;
        if (K <= 0) {
            std::cout << i.a << std::endl;
            return 0;
        }
    }

    return 0;
}


Measured memory_bytes: 2420
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)

int ans;
void dfs(vector<vector<int> > &a,vector<int> &win,vector<int> &lose){
    int z = 0;
    rep(i,a.size())rep(j,i)if(a[i][j] == 0){
        z++;
        if(win[i] && lose[j]){
            a[i][j]++;
            win[i]--;
            lose[j]--;
            dfs(a,win,lose);
            a[i][j]--;
            win[i]++;
            lose[j]++;
        }
        if(lose[i] && win[j]){
            a[i][j]--;
            win[j]--;
            lose[i]--;
            dfs(a,win,lose);
            a[i][j]++;
            win[j]++;
            lose[i]++;
        }
        return;
    }
    ans++;
}


int main(){
    int n,m;
    while(cin >> n,n){
        vector<vector<int> > a(n,vector<int>(n,0));//1:win, -1;lose
        vector<int> win,lose;//残りの数
        win = lose = vector<int>(n,n/2);
        cin >> m;
        bool c = true;
        rep(i,m){
            int x,y;
            cin >> x >> y;
            x--,y--;
            win[x]--;
            lose[y]--;
            a[x][y]++;
            a[y][x]--;
            if(win[x] < 0 || lose[y] < 0)c = false;
        }
        ans = 0;
        if(c)rep(i,n)rep(j,i)if(a[i][j] == 0){
            dfs(a,win,lose);
            i = n;break;
        }
        cout << ans << endl;
    }
}



Measured memory_bytes: 3092
def main():
    N, T = map(int, input().split())
    path = [[int(a) for a in input().split()] for i in range(N) ]
    minc = 10000
    for [c, t] in path:
        if t <= T :
            if minc > c:
                minc = c
    if minc == 10000:
        print("TLE")
    else:
        print(minc)
main()

Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstring>
#include <climits>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

constexpr ll INF = 1e18;
constexpr ll MOD = 1e9 + 7;
constexpr double PI = 3.14159265358979323846;
constexpr int di[] = {0, 0, 1, -1};
constexpr int dj[] = {1, -1, 0, 0};

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

    int n;
    V c;

    ll a[212345];
    fill(a, a + 210000, 0);

    cin >> n;

    c.push_back(0);

    REP(i, n)
    {
        int tmp;
        cin >> tmp;

        if (tmp != c[c.size() - 1])
            c.push_back(tmp);
    }

    ll dp[212345];

    dp[0] = 0;

    for (int i = 1; i < c.size(); i++)
    {
        dp[i] = dp[i - 1];
        if (a[c[i]] > 0)
            dp[i] += (dp[a[c[i]]] + 1);
        dp[i] %= MOD;

        a[c[i]] = i;
    }

    cout << dp[c.size() - 1] + 1 << endl;

    return 0;
}

Measured memory_bytes: 4600
#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 w, h, x, y, r;
  cin >> w >> h >> x >> y >> r;
  bool ok = true;
  if (x - r < 0 || x + r > w)
    ok = false;
  if (y - r < 0 || y + r > h)
    ok = false;
  cout << ((ok) ? "Yes" : "No") << endl;
  return 0;
}


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

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

  if (X % 7 == 4) cout << "mon" << endl;
  else if (X % 7 == 5) cout << "tue" << endl;
  else if (X % 7 == 6) cout << "wed" << endl;
  else if (X % 7 == 0) cout << "thu" << endl;
  else if (X % 7 == 1) cout << "fri" << endl;
  else if (X % 7 == 2) cout << "sat" << endl;
  else cout << "sun" << endl;

  return 0;
}


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

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define fst first
#define snd second

const int N = 1e5 + 1;
int WA[N];
bool AC[N];

int main()
{
    int n, m;
    cin >> n >> m;
    for(int i = 1; i <= n; i++)
    {
        WA[i] = 0;
        AC[i] = false;
    }

    int corAnswers = 0, penalties = 0;
    for(int i = 0; i < m; i++)
    {
        int p;
        cin >> p;
        string s;
        cin >> s;
        if(AC[p])
            continue;
        if(s == "AC")
        {
            corAnswers++;
            penalties += WA[p];
            AC[p] = true;
        }
        else
            WA[p]++;
    }

    cout << corAnswers << " " << penalties;

    return 0;
}


Measured memory_bytes: 768
N = int(input())
A = list(map(int, input().split()))

buka = {i: 0 for i in range(N)}

import collections

buka_count = collections.Counter(A)

for i in range(1, N+1):
    if i in buka_count:
        print(buka_count[i])
    else:
        print(0)

Measured memory_bytes: 146308
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main() {
  int N;
  cin>>N;
  long long ans[N];
  
  ans[0]=2;
  ans[1]=1;
  for(int i=2;i<=N;i++){
    ans[i]=ans[i-1]+ans[i-2];
  }
  cout<<ans[N]<<endl;
  
}



Measured memory_bytes: 256
from collections import defaultdict

n = int(input())

for i in range(2, 450):
    if n == i * (i - 1) // 2:
        break
else:
    print("No")
    exit()

num_apexes = i

edge_dict = defaultdict(list)

for i in range(num_apexes):
    for j in range(num_apexes):
        if i == j:
            continue
        edge_dict[i].append(j)

used = set([])
sets = defaultdict(list)
count = 1
for s in edge_dict.keys():
    for e in edge_dict[s]:
        if (s, e) in used or (e, s) in used:
            sets[s].append(str(count))
            sets[e].append(str(count))
            count += 1
        else:
            used.add((e, s))

print('Yes')
print(num_apexes)
for i in sets.keys():
    words = [str(len(sets[i])),] + sets[i]
    print(' '.join(words))



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

using namespace std;

int main()
{   long long int n,s=1,mod=1e9+7;//100000000+7
  cin>>n;
   for(long long int i=1;i<=n;i++)
   {
         s=s*(1*i);
       s=s%mod;
   }
   cout<<s<<"\n";
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static int max(int v[], int e) {
		int max = 0;
		for (int i = 1; i < v.length; ++i) {
			if (i != e) {
				if (v[max] < v[i]) {
					max = i;
				}
			}
		}
		return max;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n, s1, s2, s3, s4, count = 0, count3 = 0;
		int v[];
		int count1[], count2[];
		count1 = new int[100001];
		count2 = new int[100001];

		n = sc.nextInt();

		v = new int[n + 1];
		for (int i = 1; i <= n; ++i) {
			v[i] = sc.nextInt();
			if (i % 2 != 0) {
				++count1[v[i]];
			} else {
				++count2[v[i]];
			}
		}

		s1 = max(count1, 0);
		s3 = max(count1, s1);
		s2 = max(count2, 0);
		s4 = max(count2, s2);

		if (s1 != s2) {
			for (int i = 1; i <= n; ++i) {
				if (i % 2 != 0) {
					if (v[i] != s1) {
						++count;
					}
				} else {
					if (s2 > 0) {
						if (v[i] != s2) {
							++count;
						}
					}
				}
			}
		} else {
			for (int i = 1; i <= n; ++i) {
				if (i % 2 != 0) {
					if (v[i] != s3) {
						++count;
					}
				} else {
					if (s2 > 0) {
						if (v[i] != s2) {
							++count;
						}
					}
				}
			}
			for (int i = 1; i <= n; ++i) {
				if (i % 2 != 0) {
					if (v[i] != s1) {
						++count3;
					}
				} else {
					if (s2 > 0) {
						if (v[i] != s4) {
							++count3;
						}
					}
				}
			}

			if (count3 < count) {
				count = count3;
			}
		}

		System.out.println(count);
		sc.close();
	}

}


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

int main(){
  int n;
  cin >> n;
  for(int i=0; i<n; i++){
    int gx, gy;
    cin >> gx >> gy;
    int p;
    cin >> p;
    int Vert[100][100]={0};
    int Horiz[100][100]={0};
    int T[100][100]={0};

    //????????????????????±????????????????´?
    for(int j=0; j<p; j++){
      int x1, y1, x2, y2;
      cin >> x1 >> y1 >> x2 >> y2;
      if(x1==x2){
	Vert[x1][max(y1,y2)]=1;
      }
      if(y1==y2){
	Horiz[max(x1,x2)][y1]=1;
      }
    }

    T[0][0] = 1; /* (x,y)=(0,0)?????¨???*/
    //????????????, ???????????????????????¨????????±????????????
    for(int j=0; j<=gy; j++){
      for(int k=0; k<=gx; k++){
	if(k==0){
	  Horiz[k][j]=1;
	}
	if(j==0){
	  Vert[k][j]=1;
	}
	
        if(Vert[k][j]==0){
	  T[k][j] += T[k][j-1]; /*?????????????????????????????´??????????????????????????°????¶????*/
	}
	if(Horiz[k][j]==0){
	  T[k][j] += T[k-1][j]; /*?????????????????????????????´??????????????????????????°????¶????*/
	}
      }
    }

    if(T[gx][gy]==0){
      cout << "Miserable Hokusai!" << endl;
    }
    else{
      cout << T[gx][gy] << endl;
    }
  } 
}

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

using ll = long long;
using pii = pair<int, int>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i, n) rep2(i, 0, n)
#define rep2(i, m, n) for (int i = m; i < (n); i++)
#define per(i, b) per2(i, 0, b)
#define per2(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define ALL(c) (c).begin(), (c).end()
#define SZ(x) ((int)(x).size())

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }

template <class T, class U>
void chmin(T& t, const U& u) {
    if (t > u) t = u;
}
template <class T, class U>
void chmax(T& t, const U& u) {
    if (t < u) t = u;
}

template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    os << "(" << p.first << "," << p.second << ")";
    return os;
}

template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "{";
    rep(i, v.size()) {
        if (i) os << ",";
        os << v[i];
    }
    os << "}";
    return os;
}

#ifdef LOCAL
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << H;
    debug_out(T...);
}
#define debug(...) \
    cerr << __LINE__ << " [" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define dump(x) cerr << __LINE__ << " " << #x << " = " << (x) << endl
#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif

int main() {
    int N, K;
    cin >> N >> K;
    V<double> prf(N + 1);
    rep(i, N) {
        int p;
        cin >> p;
        prf[i + 1] = prf[i] + (1 + p) / 2.0;
    }
    double ans = 0.0;
    rep(i, N - K + 1) { chmax(ans, prf[i + K] - prf[i]); }
    cout << fixed << setprecision(8) << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
//https://atcoder.jp/contests/panasonic2020/tasks/panasonic2020_b
//B - Bishop
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
const ll LINF = 0x1fffffffffffffff;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
template<class T>bool chmax(T &a, const T &b) {if (a<b) { a=b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) {if (b<a) { a=b; return 1; } return 0;}
int main() {
  ll H,W; cin>>H>>W;
#if 01
  ll ans=(H*W+1)/2;
  if(H==1||W==1) ans=1;
  cout<<ans<<endl;
#else
  ll x0=(H+1)/2;
  ll x1=(H)/2;
  ll y0=(W+1)/2;
  ll y1=(W)/2;  
  ll ans=x0*y0+x1*y1;
  if(H==1||W==1) ans=1;
  cout<<ans<<endl;
#endif
  return 0;
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(4100000)

import logging

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)


# @profile
def resolve():
    N = [int(x) for x in sys.stdin.readline().split()][0]
    a_list = [int(x) for x in sys.stdin.readline().split()]

    logger.debug('{} {}'.format(N, a_list))

    box_list = [0 for _ in range(N)]

    for i in reversed(range(N)):
        suma = sum(box_list[i:N:i+1])

        r = suma % 2
        if r != a_list[i]:
            box_list[i] = 1

    s = sum(box_list)
    print(s)

    if s > 0:
        print(' '.join(
            [str(i + 1) for i in range(len(box_list)) if box_list[i]]))


if __name__ == "__main__":
    resolve()

# AtCoder Unit Test で自動生成できる, 最後のunittest.main は消す
# python -m unittest template/template.py で実行できる
# pypy3 -m unittest template/template.py で実行できる

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """3
1 0 0"""
        output = """1
1"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """5
0 0 0 0 0"""
        output = """0"""
        self.assertIO(input, output)

Measured memory_bytes: 16148
#include <cstdio>
#include <cmath>
#include <algorithm>
typedef long long ll;
#define int ll

using namespace std;

int N,x[301],y[301];

double get_r(double X, double Y){
    double ret = 0;
    
    for(int i = 0;i < N;++i)
        ret = max(ret,(X - x[i]) * (X - x[i]) + (Y - y[i]) * (Y - y[i]));
    
    return ret;
}

double searchY(double X){
    double lo = 0,hi = 1000;
    
    for(int it = 0;it < 300;++it){
        double a = (2 * lo + hi) / 3;
        double b = (lo + 2 * hi) / 3;
        
        double ra = get_r(X,a);
        double rb = get_r(X,b);
        
        if(ra < rb) hi = b;
        else lo = a;
    }
    
    return get_r(X,lo);
}

double searchX(){
    double lo = 0,hi = 1000;
    
    for(int it = 0;it < 300;++it){
        double a = (2 * lo + hi) / 3;
        double b = (lo + 2 * hi) / 3;
        
        double ra = searchY(a);
        double rb = searchY(b);
        
        if(ra < rb) hi = b;
        else lo = a;
    }
    
    return searchY(lo);
}

signed main(){
    scanf("%lld",&N);
    
    for(int i = 0;i < N;++i)
        scanf("%lld %lld",&x[i],&y[i]);
    
    printf("%.12f\n",sqrt(searchX()));
    
    return 0;
}

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

struct StDtl
{
  int m_nLeft;

  StDtl(int nLeft) :
    m_nLeft(nLeft)
  { }
};

struct StSum
{
  int m_nLeft;
  int m_nRight;
  int m_nArea;

  StSum(int nLeft, int nRight, int nArea) :
    m_nLeft(nLeft), m_nRight(nRight), m_nArea(nArea)
  { }
};

void fnCroSecSet(stack<StDtl>& rskoDtl, vector<StSum>& rvoSum, int& rnTotalArea)
{
  string sCrossSect;
  cin >> sCrossSect;

  for (int i = 0; i < sCrossSect.size(); i++)
  {
    if (sCrossSect[i] == '\\')
    {
      StDtl oDtl(i);
      rskoDtl.push(oDtl);
    }
    else if (sCrossSect[i] == '/')
    {
      if (rskoDtl.size() > 0)
      {
        int nLeft = rskoDtl.top().m_nLeft; rskoDtl.pop();
        int nSum = i - nLeft; 
        rnTotalArea += nSum;

        while (rvoSum.size()  &&
               nLeft < rvoSum.back().m_nLeft  &&
               rvoSum.back().m_nRight < i       )
        {
          nSum += rvoSum.back().m_nArea;
          rvoSum.pop_back();
        }
        StSum oSum(nLeft, i, nSum);
        rvoSum.push_back(oSum);
      }
      else;
    }
  }
}

void  fnCroSecGet(const vector<StSum>& cnrvoSum, int nTotalArea)
{
  cout << nTotalArea << endl;
  cout << cnrvoSum.size();
  if (cnrvoSum.size() > 0)
  {
    cout << " ";
    for (auto itvoSum = begin(cnrvoSum); itvoSum != end(cnrvoSum); ++itvoSum)
    {
      if (itvoSum != begin(cnrvoSum)) cout << " ";
      cout << itvoSum->m_nArea;
    }
  }
  cout << endl;
}

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

  stack<StDtl> skoDtl;
  vector<StSum> voSum;
  int nTtlAra = 0;

  fnCroSecSet(skoDtl, voSum, nTtlAra);
  fnCroSecGet(voSum, nTtlAra);

  return 0;
}



Measured memory_bytes: 3344
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <cmath>
#include <tuple>
#include <bitset>
#include <utility>
#include <climits>
#include <iomanip>

#define push emplace_back
#define each(i, x) for (auto i=0; i < x; i++)
using ull = unsigned long long;
constexpr auto mod = 1000000007;
constexpr auto INF = ULLONG_MAX;

using namespace std;
template <typename T> inline void dump(const T& x) { cout << "[" << x << "]" << endl; }
template <typename T> inline void dump(const vector<T>& x) { for (const auto v : x) { cout << v << " "; } cout << endl; }
template <typename T> inline void sort_asc(vector<T>& x) { std::sort(x.begin(), x.end()); }
template <typename T> inline void sort_desc(vector<T>& x) { std::sort(x.begin(), x.end(), greater<T>()); }
template <typename T> inline T max_value(vector<T>& x) { return *max_element(x.begin(), x.end()); }
template <typename T> inline T min_value(vector<T>& x) { return *min_element(x.begin(), x.end()); }
template <typename T> inline T sum_value(vector<T>& x) { return accumulate(x.begin(), x.end(), 0ULL); }

int main() {
  ull n;
  cin >> n;
  vector<ull> w;

  each(i, n) {
    ull tmp;
    cin >> tmp;
    w.push(tmp);
  }

  vector<ull> res1;
  vector<ull> res2;
  each(i, n) {
    ull r1 =0;
    ull r2 =0;
    for (auto j=0; j <= i; j++) {
      r1 += w[j];
    }
    for (auto j=i+1; j < n; j++) {
      r2 += w[j];
    }

    res1.push(r1);
    res2.push(r2);
  }

  vector<ull> res;
  each(i, n) {
    if (res1[i] > res2[i]) {
      res.push(res1[i] - res2[i]);
    } else {
      res.push(res2[i] - res1[i]);
    }
  }

  cout << min_value(res) << endl;

  return 0;
}


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

int main(){
    int k, a, b;
    cin >> k >> a >> b;
    bool ans = false;

    if(b - a  >= k){
        ans = true;
    }else{
        for(int i = a; i <= b; i++){
            if(i % k == 0){
                ans = true;
            }
        }
    }
  
    if(ans) cout << "OK" << endl;
    else{ cout << "NG" << endl; }
    return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mod 163577857
#define w(t) int t; cin>>t;while(t--)
int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt" , "r", stdin);
    //freopen("output.txt" , "w", stdout);
#endif

    int n , k;
    cin >> n >> k;
    set<int>s;
    while (k--) {
        int d;
        cin >> d;
        int arr[d];
        for (int i = 0; i < d; i++) {
            cin >> arr[i];
            s.insert(arr[i]);
        }

    }
    cout << n - s.size() << "\n";
    return 0;

}





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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef vector<long long> vl;
typedef pair<long long, long long> pl;
typedef vector<vector<long long>> matrix;

#define F 						first
#define S 						second
#define PB 						push_back
#define MP 						make_pair
#define all(c) 					c.begin(), c.end()
#define f(i,a,b) 				for(ll i=a; i<b; i++)
#define rep(i,n) 				f(i,0,n)
#define tr(c,i) 				for(typeof(c).begin() i = c.begin(); i != c.end(); i++)
#define present(c,x) 			(c.find(x) != c.end())	//for set and map
#define cpresent(c,x) 			(find(all(c),x) != c.end())	//for vectors
#define w(t)					ll t; cin>>t; while(t--)
#define epsilon 				1e-9
#define MOD						(ll)1e9

void doublade() {
	ios::sync_with_stdio(false); cin.tie(0); cout.precision(10);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
}

int main() {
	doublade();
	// w(t) {
		ll n;
		cin >> n;
		vl a(n);
		rep(i, n) {
			cin>>a[i];
		}
		ll rs = 0;
		f(i, 1, n) {
			if(a[i]<a[i-1]) {
				rs += a[i-1] - a[i];
				a[i] = a[i-1];
			}
		}
		cout<<rs<<"\n";
	// }
	return 0;
}

Measured memory_bytes: 4780
#include<bits/stdc++.h>
#define mp make_pair
#define ss second
#define ff first
#define ll long long
#define tcase ll t;cin>>t;while(t--)
#define sz(a) int((a).size())
#define pb push_back
#define YES cout<<"YES\n";
#define NO cout<<"NO\n";
#define Yes cout<<"Yes\n";
#define No cout<<"No\n";
#define yes cout<<"yes\n";
#define no cout<<"no\n";
#define f(i,a,b) for(int i=a;i<b;i++)
#define in insert
#define matrix vector<vector<ll> >
#define E cout<<"\n";
#define I(x) cin>>x;
#define O(x) cout<<x;
#define all(a) a.begin(),a.end()
const ll M=1000000007;

using namespace std;

//ll modexpo(ll a,ll b,ll p)
//{
//    ll ans=1;
//      a=a%p;  // update a if(a>=p)
//
//        if(a==0)
//            return 0;
//
//                while(b!=0)
//                {
//                    if(b%2==1)
//                        ans=(ans*a)%p;
//
//                    a=a*a;
//                    b=b/2;
//
//                }
//                return ans;
//}

//ll countbit(ll n)
//{
//    ll c=0,x=0;
//    while(n!=0)
//    {
//        c+=n&1;
//        n>>=1;
//        x++;
//    }
//    return c==x;
//}



/*  vector<int> prime1;
  int prime[10000001];

void sieve(int n)
{
       for(long long i=2;i<=n;i++)
       {
         if(prime[i]==0)
         {  prime[i]=i;
            prime1.pb(i);
         }

            for(long long j=0;j<sz(prime1) && prime1[j]<=prime[i] && i*prime1[j]<=n;j++)
            {

                   prime[i*prime1[j]]=prime1[j];


            }


      }

 return ;
}*/

void fastio()
{
       ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   cout.tie(NULL);

}


int main()
{
    fastio();

    int a,b,c,k;
    cin>>a>>b>>c>>k;
    if(a<b && b<c)
        Yes
    else
    {
        while(1)
        {   if(k==0)
            break;
            if(b>a)
                break;

            b=b*2;
            k--;
        }
        while(1)
        {
            if(k==0)
                break;
            if(c>b)
                break;

            c=c*2;
            k--;
        }

        if(a<b && b<c)
            Yes
         else
            No
    }

   return 0;
}


Measured memory_bytes: 3652
function main(input) {
  const inputs =input.split('\n')
  const [N] = inputs[0].split(' ').map(Number)
  const P = inputs[1].split(' ').map(Number)

  let min = P[0]
  let count = 1
  for(let i = 1; i < N; i++) {
    if (min > P[i]) {
      min = P[i]
      count++
    }
  }
  console.log(count)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8').trim())


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

using namespace std;
long long a[100000+5];
int main() {
    int n,m;
    cin>>n>>m;
    for(int i = 0;i < n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    long long minx = 0x3f3f3f3f;
    for(int i = 0;i < n - m + 1;i++){
        minx = min(a[i+m-1]-a[i],minx);
    }
    cout<<minx<<endl;
}


Measured memory_bytes: 1024
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    v = A[i]
    if v >= A[0]:
        j = 0
        while v >= A[j] and j < i:
            j = j + 1
        if j < i:
            for k in reversed(range(j, i)):
                A[k + 1] = A[k]
            A[j] = v
            print(' '.join([str(a) for a in A]))
        else:
            print(' '.join([str(a) for a in A]))

    else:
        for l in reversed(range(i)):
            A[l+1]=A[l]
        A[0]=v
        print(' '.join([str(a) for a in A]))




Measured memory_bytes: 5608
# coding: utf-8

# https://atcoder.jp/contests/abc106
# -12:47 done


def main():
    N, M, Q = map(int, input().split())
    L = [None] * M
    R = [None] * M
    p = [None] * Q
    q = [None] * Q

    for i in range(M):
        L[i], R[i] = map(int, input().split())
        L[i] -= 1
        R[i] -= 1

    for i in range(Q):
        p[i], q[i] = map(int, input().split())
        p[i] -= 1
        q[i] -= 1

    dp = [[0]*N for _ in range(N)]
    for i in range(M):
        dp[L[i]][R[i]] += 1

    for i in range(N-2, -1, -1):
        for j in range(1, N):
            dp[i][j] = dp[i][j-1] + dp[i+1][j] - dp[i+1][j-1] + dp[i][j]

    for i in range(Q):
        print(dp[p[i]][q[i]])


main()


Measured memory_bytes: 23624
#include <stdio.h>

using namespace std;

int main(){
	int a,b;
	scanf("%d %d",&a,&b);
	if(a > b){
		printf("a > b\n");
	}else if(a < b){
		printf("a < b\n");
	}else{
		printf("a == b\n");
	}
}

Measured memory_bytes: 1008
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;
int main() {
	int N;
	int m;
	cin >> N;
	m = (N % 100) / 5;
	if ((N % 100) % 5 != 0)m++;
	if (N == 100 || N == 101 || N == 102 || N == 103 || N == 104 || N == 105) cout << 1 << endl;
	else if (N < m  * 100)cout << 0 << endl;
	else cout << 1 << endl;

	return 0;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
#include <typeinfo>
#include <cxxabi.h>
#ifdef LOCAL
#include "dbgtoki.hpp"
#define DUMP(i) dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i) 
#else
#define DUMP(i)
#endif

using namespace std;
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(s) (s).begin(), (s).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()) , v.end());
#define dis distance
#define so sort
#define rev reverse
#define pub push_back
#define sec second
#define fir first

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector <int> > vvi;
const int EPS = 1e-9;
const int MOD = 1e9+7;

int main (){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    if(abs(n-m) > 1){
        cout << 0 << endl;
        return 0;
    }
    ll ans = 1;
    ll nkaijo = 1;
    REP(i,n){
        nkaijo = (nkaijo * (i+1)) % MOD;
    }
    ll mkaijo = 1;
    REP(i,m){
        mkaijo = (mkaijo * (i+1)) % MOD;
    }
    ans = (nkaijo * mkaijo) % MOD;
    if(n == m)ans = (ans*2)%MOD;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
long long inf = 1e18L + 5;
long long dp [100001];
int main ()
{
    int n, w;
    cin >> n >> w;
    pair<long long, long long> arr [n + 1];
    arr[0] = make_pair(0, 0);
    int sum = 0;
    for (int i = 1; i <= n; ++i)
    {
        long long a, b;
        cin >> a >> b;
        sum += b;
        arr[i] = make_pair(a, b);
    }
    for (int i = 0; i <= sum; ++i) {
        dp[i] = inf;
    }
    dp[0] = 0;

    for (int i = 1; i <= n; ++i) {
        for (int j = sum; j >= 0; --j) {
            if (j - arr[i].second >= 0) {
                dp[j] = min (dp[j], dp[j - arr[i].second] + arr[i].first);
            } else {
                break;
            }
        }
    }
    for (int i = sum; i >= 0; --i) {
        if (dp[i] <= w) {
            cout << i << endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 1024