akhauriyash/Code-Regression huggingface dataset:
/*================================================================
Love China, Love YALI, Love OI!
*   
*   File Name：B.cpp
*   Author：YaliKiWi
*   Date：2019年09月11日
*   Discribe：
*
================================================================*/


#include<bits/stdc++.h>
using namespace std;
#define fo(i,s,e) for(register int i=s;i<=e;i++)
#define max_(x,y) ((x)>(y)?(x):(y))
#define min_(x,y) ((x)<(y)?(x):(y))
#define dd double
#define ull unsigned long long
#define ll long long
#define maxn 25
int o[maxn],a[maxn],c[maxn],n,tot;
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>n;
	fo(i,1,n)
		cin>>o[i];
	fo(i,1,n){
		cin>>a[i];
		tot+=a[i];
	}
	fo(i,1,n-1)
		cin>>c[i];
	fo(i,2,n){
		if(o[i-1]==o[i]-1){
			tot+=c[o[i]-1];
			//cout<<i<<"----"<<endl;
		}
	}
	cout<<tot;
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
using namespace std;
int num1[50],num2[50];
void sets(int N);
void change(int p,int c);
int main()
{
    int N,r,i,j,p,c;
    for(;scanf("%d%d",&N,&r),N+r!=0;)
    {
        sets(N);
        for(i=0;i<r;i++)
        {
            scanf("%d%d",&p,&c);
            change(p,c);
        }
        printf("%d\n",num1[0]);
    }
    return 0;
}
void sets(int N)
{
    for(int i=0,j=N;i<N;i++,j--)
    {
        num1[i]=j;
    }
}
void change(int p,int c)
{
    int i;
    for(i=0;i<p-1;i++)num2[c+i]=num1[i];
    for(i=0;i<c;i++)num2[i]=num1[p-1+i];
    for(int i=0;i<c+p-1;i++) num1[i] = num2[i];
}

Measured memory_bytes: 1028
#include<bits/stdc++.h>
using namespace std;
char x,y;
int main()
{
	cin>>x>>y;
	for(int i=1;i<=6;i++)
	{
		
		if(x-'A'+1==i&&y-'A'+1==i){cout<<"=\n";return 0;}
		if(x-'A'+1==i){cout<<"<\n";return 0;}
		if(y-'A'+1==i){cout<<">\n";return 0;}
	}
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <locale>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <vector>

const long long int INF = 1e9;
typedef long long int ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define Rep(i, n) for(int i = 1; i <= (int)(n); i++)
#define llrep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define llRep(i, n) for(ll i = 1; i <= (ll)(n); i++)

using namespace std;

struct Point{
	int x,y;
};

bool vector_finder(std::vector<ll> vec, ll number) {
    auto itr = std::find(vec.begin(), vec.end(), number);
    size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return true;
    }
  else { // 発見できなかったとき
    return false;
    }
}

ll factorial(ll N){
    ll ans = 1;
    llRep(i,N){
        ans *= i;
    }
    return ans;
}

ll extended_factorial(ll N){
    ll ans = 1;
    llRep(i,N){
        ans *= i;
        ans %= (ll)(1e9+7);
    }
    return ans;
}

vector<ll> Eratosthenes(ll N){
    bool arr[N+1];
    //initialization
    arr[0] = false;
    arr[1] = false;
	for(ll i = 2; i < N+1; i++){
		arr[i] = true;
	}
    //eratosthenes
	for(ll i = 2; i <= sqrt(N); i++){
		if(arr[i]){
			for(ll j = 0; i * (j + 2) <= N; j++){
				arr[i *(j + 2)] = false;//not prime number
			}
		}
	}
    vector<ll> prime;
    llRep(i,N){
        if (arr[i]==true){
            prime.push_back(i);
        }
    }
    return prime;
}

char alphabet[] = {
    'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'
};

// 二分探索
// llrep(i,N){
//     b = B[i];
//     auto cntA = lower_bound(A.begin(), A.end(), b);//イテレータなのでそのままllに変換とかはできない
//     auto cntC = upper_bound(C.begin(), C.end(), b);
//     ll cntA_ll = distance(A.begin(), cntA);
//     ll cntC_ll = C.size() - distance(C.begin(), cntC);
//     cnt += (cntA_ll * cntC_ll);
// }

int main(){
    int N;
    cin >> N;
    bool F[102][12];
    int P[102][12];
    // init
    // rep(i,102)rep(j,12){
    //     F[i][j] = false;
    //     P[i][j] = 0;
    // }

    rep(i,N)rep(j,10) cin >> F[i][j];
    rep(i,N) rep(j,11) cin >> P[i][j];

    int max_cand = -1e9-4;
    int n = 10;
    // {0, 1, ..., n-1} の部分集合の全探索
    bool isOpen[10];
    for (int bit = 0; bit < (1<<n); ++bit){
        /* bit で表される集合の処理を書く */
        // vector<int> S;
        bool isOpenTime=false;//最低1つの時間帯でお姉ちゃんが店を開けているか
        rep(i,10) isOpen[i]=false;//init
        for (int i = 0; i < n; ++i) {
            if (bit & (1<<i)) { // i が bit に入るかどうか
                isOpen[i] = true;
                isOpenTime = true;
            }
        }

        if(isOpenTime){
            int sum=0,c;
            rep(i,N){//全ての店について
                c=0;
                rep(j,n) if(isOpen[j] && F[i][j]) c++;
                sum += P[i][c];
            }
            max_cand = max(max_cand, sum);
        }
    }

    cout << max_cand << endl;
    return 0;
}


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

	int main(){
      int N;
      cin >> N;
      int a[N];
      for (int i=0;i<N;i++){
        cin >> a[i];
      }
      sort(a,a+N);
      cout << a[N-1]-a[0] << endl;
    }


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int i = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int i = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define MP make_pair
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1 << 30;
const ll LINF = 1LL << 61;
const int MOD = 1e9 + 7;

int main() {
    ll A[3], K;
    cin >> A[0] >> A[1] >> A[2] >> K;
    sort(A, A + 3);
    rep(i, K) { A[2] *= 2; }
    cout << A[0] + A[1] + A[2] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) // rep(i, 1, 5) --> {1,2,3,4} // rep(i, 5, 1) --> {4,3,2,1} // rep(it, end(v), begin(v)) --> *it

using namespace std;

int main()
{
    ll n, m;
    cin >> n >> m;
    vector<ll> v(n);
    ll sum = 0;
    rep(i, 0, n)
    {
        cin >> v[i];
        sum += v[i];
    }
    ll res = 0;
    rep(i, 0, n)
    {
        if (v[i] >= (sum / (float)(4*m)))
            res++;
    }
    cout << (res>=m?"Yes":"No");
    return 0;
}

Measured memory_bytes: 3572
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N=10005;
const ll p=998244353ll;
template<class IT>inline void cmin(IT &a,IT b){if(b<a)a=b;}
template<class IT>inline void cmax(IT &a,IT b){if(a<b)a=b;}
int a[N],b[N];
int main(){
	int n,t,k,i,v=2,u=3;
	scanf("%d%d",&n,&k);
	t=((n-1)*(n-2))>>1;
	if(k<=t){
		k=t-k;t=0;
		for(i=2;i<=n;++i){a[++t]=1;b[t]=i;}
		for(;k;--k){
			a[++t]=v;b[t]=u;
			if(u==n)u=(++v)+1;
			else ++u;
		}
		printf("%d\n",t);
		for(;t;--t)printf("%d %d\n",a[t],b[t]);
	}else puts("-1");
	return 0;
}

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

#define REP(i,n) for(ll i=0; i<(ll)(n); i++)
#define FOR(i,n,m) for (ll i=n; i<(ll)(m); i++)
#define pb push_back
#define INF 1000000007LL
#define all(a) (a).begin(),(a).end()
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)

typedef long long ll;
typedef pair<int,int> p;

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


#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

vector<int> G[1000000];
vector<pair<int, int> > bridge;
vector<int> articulation;
int ord[1000000], low[1000000];
bool vis[1000000];

void dfs(int v, int p, int k)
{
    vis[v] = true;
    
    ord[v] = k;
    low[v] = ord[v];
    
    bool isArticulation = false;
    int ct = 0;
    
    for (int i = 0; i < G[v].size(); i++){
        if (!vis[G[v][i]]){
            ct++;
            dfs(G[v][i], v, k+1);
            low[v] = min(low[v], low[G[v][i]]);
            if (~p && ord[v] <= low[G[v][i]]) isArticulation = true;
            if (ord[v] < low[G[v][i]]) bridge.push_back(make_pair(min(v, G[v][i]), max(v, G[v][i])));
        }
        else if (G[v][i] != p){
            low[v] = min(low[v], ord[G[v][i]]);
        }
    }
    
    if (p == -1 && ct > 1) isArticulation = true;
    if (isArticulation) articulation.push_back(v);
}

int main(){
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    REP(i,m) {
        int x, y;
        cin >> x >> y;
        G[--x].push_back(--y);
        G[y].push_back(x);
    }
    
    int k = 0;
    for (int i = 0; i < n; i++){
        if (!vis[i]) dfs(i, -1, k);
    }
    
    sort(bridge.begin(), bridge.end());
    sort(articulation.begin(), articulation.end());
    
    cout << bridge.size() << endl;
    
    return 0;
}


Measured memory_bytes: 26368
#include<bits/stdc++.h>
using namespace std;
#define debug(x)        cout<<#x<<" :"<<x<<endl;
#define ff              first
#define ar              array
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define f(i,n)          for(int i=0;i<n;i++)
#define MOD             1000000007
#define pi              3.14159265
#define umii            unordered_map<int,int>
#define umci            unordered_map<char,int>
#define umsi            unordered_map<string,int>

void k_007()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#ifndef ONLINE_JUDGE
	freopen("ip1.txt", "r", stdin);
	freopen("op1.txt", "w", stdout);
#endif
}
bool sortbysec(const pair<int, int> &a,
               const pair<int, int> &b);
int gcd(int a, int b) ;
int prime(int n);
int power(int x, int y);
int lcm(int a, int b);
bool compare(pii p1, pii p2)
{
	return p1.ff < p2.ff;
}
int32_t main()
{
	k_007();
	int n;
	cin >> n;
	bool ok = false;
	for (int i = 1; i <= 9; i++)
	{
		if (n % i == 0)
		{
			if (n / i <= 9)
			{
				ok = true;
				break;
			}
		}
	}

	if (ok) cout << "Yes\n";
	else cout << "No\n";

}

bool sortbysec(const pair<int, int> &a, const pair<int, int> &b)
{
	return (a.second < b.second);
}
int gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int prime(int n) {
	int flag = 1;
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0) {flag = 0; break;}
	}
	return flag;
}
int power(int x, int y)
{
	if (y == 0)
		return 1;
	else if (y % 2 == 0)
		return ((power(x, y / 2) % MOD) * ( power(x, y / 2) % MOD)) % MOD;
	else
		return ((x % MOD) * (power(x, y / 2) % MOD) * (power(x, y / 2) % MOD)) % MOD;
}
int lcm(int a, int b)
{
	return (a * b) / gcd(a, b);
}

Measured memory_bytes: 3644
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    R=I()
    G=I()
    print(G+(G-R))

if __name__ == '__main__':
    main()

Measured memory_bytes: 67052
def main():
    import sys
    input = sys.stdin.buffer.readline
    from heapq import heappush, heappop, heapify
    N, M = (int(i) for i in input().split())
    A = [int(i) for i in input().split()]
    BC = [[int(i) for i in input().split()] for j in range(M)]
    heapify(A)
    BC.sort(key=lambda p: p[1], reverse=True)
    j = 0
    while j < M:
        a = heappop(A)
        c = BC[j][1]
        if c <= a:
            heappush(A, a)
            break
        else:
            heappush(A, c)
            BC[j][0] -= 1
            if BC[j][0] == 0:
                j += 1
    # print(A)
    print(sum(A))


if __name__ == '__main__':
    main()


Measured memory_bytes: 82104
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#define ll long long

using namespace std;

long long MOD = 1000000007;

int main(){
    int A, B;
    cin >> A >> B;
    int cnt=1;
    if(B==1){
        cout << 0 << endl;
        return 0;
    }
    B-=A;
    while(B>0){
        B-=(A-1);
        cnt++;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
int main()
{
	int n;
   scanf("%d",& n);
    int i, N = 0;
	i = 1;
	while (i <= n)
	{
		N = N + i;
		i = i + 1;
	}
	printf("%d\n", N);
	system("pause");
}

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

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

    vector<int> x(n);
    for(int i=0; i<n; i++){
        cin >> x[i];
    }
    vector<int> y = x;
    sort(y.begin(), y.end());
    for(int i=0; i<n; i++){
        if(x[i] <  y[n/2]) cout << y[n/2] << endl;
        if(x[i] >= y[n/2]) cout << y[n/2 - 1] << endl;
    }
    return 0;
}

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

int main() {
  double a, b, c;
  
  cin >> a >> b;
  
  c = (a+b)/2;
  
  int d, e;
    d = (a+b)/2;
  
  if (c > d) {
   e = d + 1;
  }
  
  else {
    e = d;
  }
  
  cout << e << endl;
}


Measured memory_bytes: 256
n = gets.chomp
print n + ":"
n = n.to_i
k = Math::sqrt(n)
k = k.to_i
for i in 2..k
  while n%i == 0
    print " #{i}"
    n = n/i
  end
end
if n != 1
  puts " #{n}"
else
  puts ""
end

Measured memory_bytes: 8688
#include<bits/stdc++.h>
using namespace std;
 
ostream& operator<<(ostream &out, string str) {
	for(char c : str) out << c;
	return out;
}
 
template<class L, class R> ostream& operator<<(ostream &out, pair<L, R> p) {
	return out << "(" << p.first << ", " << p.second << ")";
}
 
template<class T> auto operator<<(ostream &out, T a) -> decltype(a.begin(), out) {
	out << "{";
	for(auto it = a.begin(); it != a.end(); it = next(it))
		out << (it != a.begin() ? ", " : "") << *it;
	return out << "}";
}
 
void dump() { cerr << "\n"; }
template<class T, class... Ts> void dump(T a, Ts... x) {
	cerr << a << ", ";
	dump(x...);
}
 
#ifdef DEBUG
#  define debug(...) cerr << "[" #__VA_ARGS__ "]: ", dump(__VA_ARGS__)
#else
#  define debug(...) false
#endif
 
#define REP(i, n) for(int i = 0; i < n; i++)
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define ST first
#define ND second
 
template<class T> int size(T && a) { return a.size(); }
 
using LL = long long;
using PII = pair<int, int>;

using plane = vector<vector<char>>;
vector<plane> ans = {
	{},
	{},
	{},
	{
		{'a', 'a', '.'},
		{'.', '.', 'a'},
		{'.', '.', 'a'}
	},
	{
		{'a', 'a', 'b', 'c'}, 
		{'d', 'd', 'b', 'c'}, 
		{'e', 'f', 'g', 'g'}, 
		{'e', 'f', 'h', 'h'}
	},
	{
		{'a', 'a', 'b', 'b', 'c'},
		{'d', 'd', 'e', '.', 'c'},
		{'f', 'f', 'e', 'g', 'g'},
		{'.', '.', 'h', 'i', 'j'},
		{'.', '.', 'h', 'i', 'j'}
	},
	{
		{'a', 'a', '.', 'b', 'b', 'c'},
		{'.', '.', 'a', 'e', '.', 'c'},
		{'.', '.', 'a', 'e', 'd', 'd'},
		{'b', 'b', 'c', 'a', 'a', '.'},
		{'e', '.', 'c', '.', '.', 'a'},
		{'e', 'd', 'd', '.', '.', 'a'}
	},
	{
		{'a', 'd', 'd', 'e', 'e', '.', '.'},
		{'a', '.', 'c', 'f', 'f', '.', '.'},
		{'b', 'b', 'c', '.', '.', 'e', 'e'},
		{'e', 'f', '.', '.', '.', 'f', 'f'},
		{'e', 'f', '.', '.', '.', '.', 'g'},
		{'.', '.', 'e', 'f', '.', '.', 'g'},
		{'.', '.', 'e', 'f', 'g', 'g', '.'}
	},
};

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

	int n;
	cin >> n;

	if(n == 2) {
		cout << "-1\n";
		return 0;
	}

	plane out(n, vector<char>(n, '.'));
	int pos = 0;
	auto add = [&](int k) {
		REP(i, k) REP(j, k)
			out[i + pos][j + pos] = ans[k][i][j];
		pos += k;
	};

	while(n - pos > 7) add(4);
	add(n - pos);

	REP(i, n) {
		REP(j, n) cout << out[i][j];
		cout << "\n";
	}
}


Measured memory_bytes: 2304
use proconio::{fastout, input};
#[allow(unused_mut)]
#[fastout]
fn main() {
    input! {
        n: usize,
        d: f64,
    }
    let mut res = 0;
    for i in 0..n {
        input! {
            xy: (isize,isize)
        }
        if xy.euclid_distance((0, 0)) <= d {
            res += 1;
        }
    }
    println!("{}", res);
}

trait Coordinate {
    fn euclid_distance(&self, other: Self) -> f64;
    fn manhattan_distance(&self, other: Self) -> isize;
}

impl Coordinate for (isize, isize) {
    fn euclid_distance(&self, other: Self) -> f64 {
        let xdis = (self.0 - other.0).abs() as f64;
        let ydis = (self.1 - other.1).abs() as f64;
        let res = (xdis * xdis + ydis * ydis).sqrt();
        res
    }

    fn manhattan_distance(&self, other: Self) -> isize {
        (self.0 - other.0).abs() + (self.1 - other.1).abs()
    }
}


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

#define pb     push_back
#define mp     make_pair
#define all(v) v.begin() , v.end()
#define allr(v) v.rbegin(), v.rend()
const int MOD = 1e9+7;
const int MAX = 2e5+5;

int n, d;
int x, pos[MAX];

int main(int argc, char const *argv[]) {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    for(int i = 0 ; i < n ; i++) {
    	cin >> x;
        x--;
    	pos[x] = i;
    }
    int ans = 1, cnt = 1;
    for(int i = 1 ; i < n ; i++) {
    	if(pos[i-1] < pos[i])
    		cnt++;
    	else
    		cnt = 1;
    	ans = max(ans, cnt);
    }
    cout << n - ans;
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <set>
#include <map>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <climits>
#include <fstream>
#include <cassert>
using namespace std;
#pragma warning(disable : 4996)
typedef long long ll;



int main() {
#ifdef _DEBUG
	freopen("input1.txt", "r", stdin);
	freopen("output1.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	ll n;
	cin >> n;
	vector<int> a(n), b(n), p(n);
	int n1 = 0, n2 = 0;
	for (int i = 0; i < n; i++)p[i] = i + 1;
	for (int i = 0; i < n; i++)cin >> a[i];
	for (int i = 0; i < n; i++)cin >> b[i];
	do {
		if (p == a)break;
		n1++;
	} while (next_permutation(p.begin(), p.end()));
	for (int i = 0; i < n; i++)p[i] = i + 1;
	do {
		if (p == b)break;
		n2++;
	} while (next_permutation(p.begin(), p.end()));
	cout << abs(n2 - n1);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
#define int         long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define sd(t)       scanf("%d",&(t))
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define hii         cout << "hii" << endl
#define okay        cout << "okay" << endl
#define hey         cout << "hey" << endl
const int INF = 1e12;
const int MOD = 1e9+7;
 
template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << v.x << ' ' << v.y; return os; }
template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.x << "=>" << i.y << ')' << ' '; return os; } 
 
 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <class Arg1> void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << endl; }
    template <class Arg1, class... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args) {
        const char* sep = strchr(names + 1, ',');
        cerr.write(names, sep - names) << " : " << arg1 << "  ";
        __f(sep + 1, args...);
    }
#else
#define trace(...) 
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#endif // ifndef ONLINE_JUDGE
 
clock_t time_p=clock();
void starboy1299()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}
 
void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("jjj.txt", "w", stdout);
    #endif
}

void solve(){
    int x;
    cin >> x;

    if(x>=30){
        cout << "Yes" << endl;
    }
    else cout << "No" << endl;
}         

int32_t main(){
    fast();
    int t = 1;
    // cin>> t;
    for(int i=1; i<=t; i++){
        // cout << "Case #" << i << ": ";
        solve();
    }
    starboy1299();
}

Measured memory_bytes: 3780
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
#define INF 1e18

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef vector < pair<int, int> > vii;
typedef long double ld;
typedef tree<pair<int,int>, null_type, less<pair<int,int> >, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

ll dp[5011][5011], n, m;
string s;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n >> s;
	m=s.length();
	dp[0][0]=1;
	const ll MOD = 1000000007;
	for(int i = 1; i <= n; i++){
		for(int j = 0; j <= n; j++){
			if(j==0){
				dp[i][j]=2*dp[i-1][j+1]+dp[i-1][j];
			}
			else{
				dp[i][j]=2*dp[i-1][j+1]+dp[i-1][j-1];
			}
			dp[i][j]%=MOD;
			if(dp[i][j]<0) dp[i][j]+=MOD;
		}
	}
	cout << dp[n][m];
	return 0;
}


Measured memory_bytes: 195968
#define MOD 1000000007
#define fast ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define foru(i, k, n) for (int i = k; i < n; i++)
#define ford(i, k, n) for (int i = k; i >= n; i--)
#define pb push_back
#define mp make_pair
#define has(set, x) set.find(x) != set.end()
#define nohas(set, x) set.find(x) == set.end()
#define inc(mpp, x) {if(has(mpp, x)) mpp[x]++; else mpp.insert(mp(x,1));}
#define decc(mpp, x) {if(has(mpp, x)) {if(mpp[x] > 1) mpp[x]--; else mpp.erase(x);}}
#define F first
#define S second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vvi vector<vi>
#define um unordered_map
#define us unordered_set
#include <iostream>
#include <list>
#include <queue>
#include <vector>
#include <map>
#include <string>
#include <unordered_map>
#include <iomanip>
#include <set>
#include <unordered_set>
#include <fstream>
#include <algorithm>
#include <chrono>
#include <bitset>
using namespace std;
const int INF = 1 << 29;
typedef long long ll;
typedef unsigned long long ull;
inline int two(int n) { return 1 << n; }
ll extgcd(ll a, ll b, ll& x, ll& y) { if (b == 0) { x = 1; y = 0; return a; } else { int g = extgcd(b, a%b, y, x); y -= a / b * x; return g; } }
ll modpow(ll a, ll b) { ll res = 1; a %= MOD; for (; b; b >>= 1) { if (b & 1)res = res * a%MOD; a = a * a%MOD; }return res; }
struct custom_hash {
	static uint64_t splitmix64(uint64_t x) {
		x += 0x9e3779b97f4a7c15;
		x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
		x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
		return x ^ (x >> 31);
	}

	size_t operator()(uint64_t x) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		return splitmix64(x + FIXED_RANDOM);
	}
};
ll a[200000];
int n, k;
int main() {
	fast;
	cin >> n >> k;
	foru(i, 0, n)cin >> a[i];
	foru(i, k, n) {
		cout << (a[i] > a[i - k] ? "Yes" : "No") << endl;
	}
	return 0;
}

Measured memory_bytes: 4692
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

var abc [200][200]int

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(os.Stdout)

	n := getNextInt(scanner)
	m := getNextInt(scanner)
	r := getNextInt(scanner)

	rr := make([]int, r)
	for i := 0; i < r; i++ {
		rr[i] = getNextInt(scanner) - 1
	}

	for ir := 0; ir < n; ir++ {
		for il := 0; il < n; il++ {
			if il == ir {
				continue
			}
			abc[il][ir] = int(1e9 + 1)
		}
	}
	for i := 0; i < m; i++ {
		a := getNextInt(scanner) - 1
		b := getNextInt(scanner) - 1
		c := getNextInt(scanner)
		abc[a][b] = c
		abc[b][a] = c
	}
	ans := solve(n, m, r, rr)

	fmt.Fprintln(writer, ans)

	writer.Flush()
}

func solve(n, m, r int, rr []int) int {
	ans := 0
	for im := 0; im < n; im++ {
		for ir := 0; ir < n; ir++ {
			for il := 0; il < n; il++ {
				if abc[il][ir] > abc[il][im]+abc[im][ir] {
					abc[il][ir] = abc[il][im] + abc[im][ir]
				}
			}
		}
	}

	ans = rec(uint64(0), r, rr)

	return ans
}

func rec(path uint64, r int, rr []int) int {
	mask := uint64(0x1f)
	ans := 0
	n := len(rr)
	width := 5
	if r == 0 {
		for i := 0; i < n-1; i++ {
			if (rightShift(path, i, width) & mask) == 0 {
				continue
			}
			if (rightShift(path, i+1, width) & mask) == 0 {
				continue
			}
			ans += abc[rr[(rightShift(path, i, width)&mask)-1]][rr[(rightShift(path, i+1, width)&mask)-1]]
		}
		return ans
	}

	min := int(1e9 + 1)
	for i := 0; i < n; i++ {
		if (rightShift(path, i, width) & mask) > 0 {
			continue
		}
		a := rec(path|leftShift(uint64(r), i, width), r-1, rr)
		if min > a {
			min = a
		}
	}
	ans = min

	return ans
}

func leftShift(n uint64, i, width int) uint64 {
	return n << uint(i*width)
}
func rightShift(n uint64, i, width int) uint64 {
	return n >> uint(i*width)
}


Measured memory_bytes: 1536
import java.util.*;

public class Main{
    
    public static final int INF = (int)1e9+7;
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int h = sc.nextInt();
        int w = sc.nextInt();
        
        int[][] dist = new int[h][w];
        ArrayDeque<Integer> q = new ArrayDeque<>();
        
        for(int i=0; i<h; i++){
            char[] s = sc.next().toCharArray();
            for(int j=0; j<w; j++){
                if(s[j]=='#'){
                    dist[i][j] = 0;
                    q.addLast(i*w+j);
                }else{
                    dist[i][j] = INF;
                }
            }
        }
        
        int ans = 0;
        while(q.size()!=0){
            int now = q.removeFirst();
            int y = now/w;
            int x = now%w;
            ans = Math.max(ans, dist[y][x]);
            if(y+1<h && dist[y+1][x]>dist[y][x]+1){
                dist[y+1][x] = dist[y][x]+1;
                q.addLast((y+1)*w+x);
            }
            if(0<=y-1 && dist[y-1][x]>dist[y][x]+1){
                dist[y-1][x] = dist[y][x]+1;
                q.addLast((y-1)*w+x);
            }
            if(x+1<w && dist[y][x+1]>dist[y][x]+1){
                dist[y][x+1] = dist[y][x]+1;
                q.addLast(y*w+x+1);
            }
            if(0<=x-1 && dist[y][x-1]>dist[y][x]+1){
                dist[y][x-1] = dist[y][x]+1;
                q.addLast(y*w+x-1);
            }
        }
        
        System.out.println(ans);
    }
}


Measured memory_bytes: 62144
#include <bits/stdc++.h>
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
using namespace std;
typedef long long ll;
const ll INF=1e15;
ll dp[4123][4123],ar[4123][4123];
int main(){
  ios_base::sync_with_stdio(false);
  int n;
  cin>>n;
  vector<ll> w(n),sum(n+1);
  rep(i,n){
    cin>>w[i];
    sum[i+1]=sum[i]+w[i];
  }
  
  fill(dp[0],dp[0]+4123*4123,INF);
  rep(i,n){
    dp[i][i+1]=0;
    ar[i][i+1]=i;
  }
  rep(d,n+1)if(d>1){
    rep(i,n-d+1){
      for(int k=ar[i][i+d-1];k<=ar[i+1][i+d];++k)
	if(dp[i][i+d]>dp[i][k]+dp[k][i+d]){
	  ar[i][i+d]=k;
	  dp[i][i+d]=dp[i][k]+dp[k][i+d];
	}
      dp[i][i+d]+=sum[i+d]-sum[i];
    }
  }
  cout<<dp[0][n]<<endl;
  return 0;
}

Measured memory_bytes: 213904
#include<iostream>
#include<cstdio>
#include<stack>
#include<queue>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<math.h>
#include<tuple>
#include<string.h>
#include <numeric> 
#include<unordered_map>
using namespace std; 
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define pp(...) "\033[94m [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "]\033[0m"
#define pp1(...) "\033[1;47;35m" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "]\033[0m"
#define dg(x) debug() << pp1(x)
#define dg1(x) debug() << "[line : " << __LINE__ <<"]"<< pp(x)
#define dg2(x,y) debug() << "[line : " << __LINE__ <<"]"<< pp(x) pp(y)
#define dg3(x,y,z) debug() << "[line : " << __LINE__ <<"]"<< pp(x) pp(y) pp(z)
#define dg4(w,x,y,z) debug() << "[line : " << __LINE__ <<"]"<< pp(w) pp(x) pp(y) pp(z)
#define int long long
#define all(x) x.begin() , x.end()
#define clr(x , y) memset(x , y , sizeof x);
#define sz(x) (int)x.size()
template<typename T> void db(T x ){ debug() <<">>> " <<  x; }
template<typename T> void db(T x , T y){ debug() <<">>> " <<  x <<" , "<< y; }
template<typename T> void db(T x , T y , T z){ debug() <<">>> "<< x <<" , "<< y <<" , "<< z; }
template<typename T> void db(T x , T y , T z , T a){ debug() <<">>> "<< x <<" , " << y <<" , "<< z <<" , "<< a; }
const int xx = 2e5;
const int Mod = 1e9 + 7;
const int inf = 1e18;
const int Maxn = 20010;

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n;
  cin >> s;
  s += '#';
  int cnt = 0;
  for(int i = 0; i < n; i++) {
    if(s[i] != s[i + 1]) cnt++;
  }
  cout << cnt << '\n';

}

Measured memory_bytes: 3728
#include<iostream>
#include<vector>
#include<algorithm>
#include<iterator>
using namespace std;

int main(){
  int n;
  vector<int> s;
  vector<int> t;
  vector<int> ans;

  cin >> n;
  for(int i=0;i<n;i++){
    int x;
    cin >> x;
    auto it = find_if(s.begin(), s.end(),
                      [x](int a){return (x <= a);});
    if(it == s.end()){
      s.push_back(x);
    }else{
      s.insert(it,x);
    }
  }
  cin >> n;
  for(int i=0;i<n;i++){
    int x;
    cin >> x;
    auto it = find_if(t.begin(), t.end(),
                      [x](int a){return (x <= a);});
    if(it == t.end()){
      t.push_back(x);
    }else{
      t.insert(it,x);
    }
  }

  set_intersection(s.cbegin(),s.cend(),
                   t.cbegin(),t.cend(),
	           back_inserter(ans));

  cout << ans.size() << endl;  
}


Measured memory_bytes: 3168
N = int(input())
A, B = list(map(int, input().split()))
P = list(map(int, input().split()))
P.sort()

count = 0
sel_P_idx = []
for i in range(len(P)-2):
    for j in range(i+1, len(P)-1):
        for k in range(j+1, len(P)):
            if i in sel_P_idx or j in sel_P_idx or k in sel_P_idx:
                continue

            q1 = P[i]
            q2 = P[j]
            q3 = P[k]

            if q1 <= A and A+1 <= q2 <= B and q3 >= B+1:
                count += 1
                sel_P_idx.append(i)
                sel_P_idx.append(j)
                sel_P_idx.append(k)
print(count)


Measured memory_bytes: 3064
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int A = scn.nextInt();
		int B = scn.nextInt();
		int X = scn.nextInt();
		System.out.println(A<=X && X <= A+B?"YES":"NO");
	}

}


Measured memory_bytes: 23892
#include<bits/stdc++.h>
#define sz 100002
#define pb push_back
#define ff first
#define ss second
#define ll long long
#define P push
#define VEC(n) ll int x; vector<ll int>v;for(int i=0;i<n;i++){cin>>x;v.pb(x);}
#define TEST() int test;cin>>test; while(test--)
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
//ll int LCM(ll int a,ll int b) { ll int gcd=__gcd(a,b);ll int lcm=a*b/gcd;return lcm;}
//ll int bigmod(ll int b, ll int p, ll int m){if(p==0)return 1;if(p%2!=0) return b%m*fun(b,p-1,m)%m;if(p%2==0){ ll int res=fun(b,p/2,m);return (res%m*res%m)%m;}}
//void seive() { prime[np++]=2;for(i=3; i<=sz; i+=2){if(mark[i]==0){ prime[np++]=i;for(j=i*i; j<=sz; j+=i) mark[j]=1; } }}
//string add(string s1,string s2) {string s;int j=s1.size()-1,c=0,m; for(int i=s2.size()-1; i>=0; i--) {if(j>=0)m=s2[i]-'0'+s1[j]-'0'+c;else m=s2[i]-'0'+c; if(m>9) { s+=m%10+'0';c=m/10; } else {  c=0;s+=m+'0'; }j--; } if(c!=0) {s+=c+'0'; }reverse(s.begin(),s.end());return s;}
//int pos;string mul(int n) {string s;for(int i=0; i<pos; i++) { s+="0"; }pos++;int c=0,m; for(int i=s1.size()-1; i>=0; i--) { m=(s1[i]-'0')*n+c;if(m>9) { s+=m%10+'0';c=m/10;} else { c=0; s+=m+'0';} }while(c!=0) { s+=c%10+'0';c=c/10;}    reverse(s.begin(),s.end());return s;}

int main()
{
    FAST();
    ll int a,b,c,res,k;
    cin>>a>>b>>c>>k;
    while(k)
    {
        if(b<=a)
            b=b*2;
        else
            c=c*2;
        k--;

    }
    if(a<b&&b<c)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;


}



Measured memory_bytes: 3648
import java.io.*;
import java.util.*;


public class Main {
	Scanner sc = new Scanner(System.in);
	public static void main(String[] args){
		new Main();
	}
	public Main(){
		new A().doIt();
	}
	class A{
		void doIt(){
			int n = sc.nextInt();
			int m = sc.nextInt();
			UnionFind u = new UnionFind(n);
			for(int i = 0;i < m;i++){
				int num = sc.nextInt();
				if(num == 0)u.unite(sc.nextInt(), sc.nextInt());
				else System.out.println(u.same(sc.nextInt(), sc.nextInt()) ? 1:0);
			}
		}
		class UnionFind{
			int [] par, rank; // par -> rootnumber, rank -> height 
			int num; // ?????¨???????????????????????°
			public UnionFind(int n) {
				par = new int[n];
				rank = new int[n]; for(int i=0;i<n;i++){
					par[i] = i;
		            //rank[i] = 0;
				}
				num=n; 
			}
			int find(int x){ //?????????????????????????????¢??? 
				if(par[x] == x)return x;
				else return par[x] = find(par[x]);
			}
			void unite(int x, int y){ //????????????
				x = find(x);
				y = find(y);
				if(x == y) return ;
				if(rank[x] < rank[y]) par[x] = y;
				else{
					par[y] = x;
					if(rank[x] == rank[y]) rank[x]++;
				}
				num--; 
			}
			boolean same(int x, int y){ //????????????????????????????????¨?????????????????? 
				return find(x) == find(y);
			} 
		}
	}
}

Measured memory_bytes: 99016
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using vb=vector<bool>;
using vvb=vector<vb>;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pll = pair<ll,ll>;
using vpii = vector<pii>;
using vpli = vector<pli>;
using vpll = vector<pll>;

#define rep(i, n) for(int i=0;i<(int)n;i++)
#define rep2(i, s, n) for(int i=(s);i<(int)n;i++)
int INF=1e9+7;

int main() {
  ll N;
  cin >> N;
  N--;
  vi x;
  while(N>=0) {
    x.push_back(N%26);
    N/=26;
    N--;
  }
  reverse(x.begin(),x.end());
  
  rep(i,x.size()) cout << (char)(x[i]+'a');
  cout << endl;
}

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

#define MAX 100002

int n;
long long int l;
long long int t;

vector<pair<long long int, int> > v;

int mint1;
int mint2;

vector < pair<long long int, int> > dist;

deque<long long int> d;

int anss[MAX];


int main(){
	mint1 = mint2 = INT_MAX;
	cin >> n >> l >> t;
	for (int i = 0; i < n; i++){
		int x, w;
		scanf("%d%d", &x, &w);
		v.push_back(make_pair(x, w));
		if (w == 1){
			mint1 = min(mint1, x);
		}
		else{
			mint2 = min(mint2, x);
		}
	}
	if (mint1 == INT_MAX){
		for (int i = 0; i < v.size(); i++){
			v[i].first -= (t%l);
			v[i].first += l;
			v[i].first %= l;
			printf("%lld\n", v[i].first);
		}
		return 0;
	}
	if (mint2 == INT_MAX){
		for (int i = 0; i < v.size(); i++){
			v[i].first += t;
			v[i].first %= l;
			printf("%lld\n", v[i].first);
		}
		return 0;
	}
	for (int i = 0; i < v.size(); i++){
		if (v[i].second == 2){
			dist.push_back(make_pair((v[i].first + l - mint1) % l, i));
		}
	}
	sort(dist.begin(), dist.end());
	long long int tmp_t = t;
	t *= 2LL;
	long long int las = dist.size()*(t / l);
	t %= l;
	for (int i = 0; i < dist.size(); i++){
		if (t >= dist[i].first){
			las++;
		}
	}
	las %= n;
	las += find(v.begin(), v.end(), make_pair((long long int)(mint1), 1))-v.begin();
	las %= n;
	t = tmp_t;
	for (int i = 0; i < v.size(); i++){
		if (v[i].second == 1){
			d.push_back((v[i].first + t) % l);
		}
		else{
			d.push_back((v[i].first + l - (t%l)) % l);
		}
	}
	sort(d.begin(), d.end());
	long long int pos = mint1 + t;
	pos %= l;
	while (d.front() != pos){
		d.push_back(d.front());
		d.pop_front();
		if (d.front() == pos&&d.size() > 1 && d[1] == pos){
			d.push_back(d.front());
			d.pop_front();
		}
	}
	for (int i = 0; i < d.size(); i++){
		anss[las] = d[i];
		las++;
		las %= n;
	}
	for (int i = 0; i < n; i++){
		printf("%d\n", anss[i]);
	}
	return 0;
}

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

using namespace std;

int main()
{
  int r, D, x;
  cin >> r;
  cin >> D;
  cin >> x;

  for (int i = 1; i <= 10; i++) {
    x = r * x - D;
    cout << x << endl;
  }

  return 0;
}


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

int main() {
	int N,ans = 0 ; cin >> N;
	vector<int> A(N);
	for(int &Y : A) cin >> Y;
	for(int i = 0 ; i < N ; i++){
		while(A[i] % 2 == 0){
			ans++;
			A[i]/=2;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define Boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

void Crack() {
	long d,t,s;
    cin >> d >> t >> s;
    if(d<=s*t) cout << "Yes" << endl;
    else cout << "No" << endl;
}

int main() {
	Boost;
    Crack();
	return 0;
}

Measured memory_bytes: 3632
a = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
# print(a)
# print(a[0])
# print(a[0][1])
# print(a[0][1][2])

n = int(input())
for i in range(0, n):
	b, f, r, v = map(int, input().split())
	a[b - 1][f - 1][r - 1] += v

for j in range(0, len(a)):
	for k in range(0, len(a[j])):
		for l in range(0, len(a[j][k])):
			print(' {0}'.format(a[j][k][l]), end='')
		print()
	if j != len(a) - 1:
		print('#' * 20)

# for j in a:
#	for k in j:
#		for l in k:
#			print(l, end=' ')
#		print()
#	print('#'*20)



Measured memory_bytes: 5624
mod = 10 ** 9 + 7
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
comb = [1] * (n - k + 1)
for i in range(n - k):
    comb[i + 1] = (comb[i] * (k + i) * pow(i + 1, mod - 2, mod)) % mod
ans = 0
for i in range(n - k + 1):
    ans = (ans + a[k + i - 1] * comb[i]) % mod
    ans = (ans - a[i] * comb[-1 - i]) % mod
print(ans)

Measured memory_bytes: 84556
import numpy as np

N = int(input())
a = []
for i in range(N):
    a.append(list(map(int, input().split())))
leng = 0
for i in range(N):
    for j in range(i+1, N):
        leng += np.sqrt((a[i][0]-a[j][0])**2 + (a[i][1]-a[j][1])**2)
print(2*leng/N)


Measured memory_bytes: 13772
#include<stdio.h>
int ball(int n, int k){
    if(n==0) return 1;
    else return k*ball(n-1,k);
}
int main(void){
    int n,k;
    scanf("%d %d",&n,&k);
    printf("%d",k*ball(n-1,k-1));
    printf("\n");
    return 0;
}

Measured memory_bytes: 1712
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P  = pair<int,int>;
using v  = vector<int>;
using vv = vector<v>;
//const int MOD = 1000000007;
const int MOD = 998244353;
const int INF = 1001001001;

int main(){
    string s;
    cin >> s;
    if(s.size()<15){
        for(int i=s.size(); i<=15; i++){
            s.push_back('o');
        }
    }
    
    map<char,int> m;
    rep(i,15)m[s[i]]++;
    
    if(m['o']>=8)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
    
    return 0;
}

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

int main() {
	string s;
	cin >> s;
	
	s[3] = '8';
	cout << s << endl;
	
}

Measured memory_bytes: 3604
import java.util.Scanner;

class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		int b = sc.nextInt();
		
		if (a < b) {
			System.out.println("a < b");
		} else if (a > b){
			System.out.println("a > b");
		} else {
			System.out.println("a == b");
		}
		sc.close();
	}
}


Measured memory_bytes: 26316
#include <bits/stdc++.h>
#define ll long long

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int n;
    cin>>n;
    if(n % 1000)
        cout<<(1000 - n%1000)<<endl;
    else
        cout<<0<<endl;
    return 0;
}

Measured memory_bytes: 3652
#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int n, a[100000+10];
int main() {
    scanf("%d", &n);
    int ok = 1;
    for(int i=1;i<=n;i++) {
        scanf("%d", &a[i]);
        if(a[i] != n-1) {
            ok = 0;
        }
    }
    if(ok) {
        printf("Yes\n");
        return 0;
    }
    int c = *max_element(a+1, a+1+n);
    
    int cnt = 0;
    for(int i=1;i<=n;i++) {
        if(c - a[i] >= 2) {
            printf("No\n");
            return 0;
        }

        if(c - a[i] == 1) {
            cnt ++;
        }
    }

    if((n-cnt) < 2*(c-cnt) || (cnt >= c)) {
        printf("No\n");
    } else {
        printf("Yes\n");
    }
}

Measured memory_bytes: 760
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define reprl(i, n) for(ll i = n; i >= 0; i--)
#define fori(i, m, n) for(int i = m; i < (int)n; i++)
#define forl(i, m, n) for(ll i = m; i < (ll)n; i++)
#define all(v) v.begin(), v.end()
ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}
const string btos(bool ans){
  return (ans?"Yes":"No");
}
int main() {
  int n,a,b;cin>>n>>a>>b;
  int ans=min(n*a,b);
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.TreeSet;
 
 
 
public class Main {
  public static void main(String[] args) {
    InputReader sc = new InputReader(System.in);
 
 
    int[] nums = new int[4];
    for(int i = 0; i < 4; i++){
      nums[i] = 0;
    }

    for(int i = 0; i < 6; i++){
      int point = sc.nextInt();
      nums[point-1]++;
    }

    Arrays.sort(nums);

    if(nums[3] == 2){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }
 
  }
 
 //ここからテンプレ
  static class InputReader {
      private InputStream stream;
      private byte[] buf = new byte[1024];
      private int curChar;
      private int numChars;
      private SpaceCharFilter filter;
 
      public InputReader(InputStream stream) {
          this.stream = stream;
      }
 
      public int next() {
          if (numChars == -1)
              throw new InputMismatchException();
          if (curChar >= numChars) {
              curChar = 0;
              try {
                  numChars = stream.read(buf);
              } catch (IOException e) {
                  throw new InputMismatchException();
              }
              if (numChars <= 0)
                  return -1;
          }
          return buf[curChar++];
      }
 
      public String nextStr() {
        int c = next();
        while(isSpaceChar(c)){c = next();}
        StringBuffer str = new StringBuffer();
        do{
          str.append((char)c);
          c = next();
        }while(!isSpaceChar(c));
        return str.toString();
      }
 
      public char nextChar() {
        int c = next();
        while(isSpaceChar(c)){c = next();}
        char ret;
        do{
          ret = (char)c;
          c = next();
        }while(!isSpaceChar(c));
        return ret;
      }
 
      public int nextInt() {
          int c = next();
          while (isSpaceChar(c))
              c = next();
          int sgn = 1;
          if (c == '-') {
              sgn = -1;
              c = next();
          }
          int res = 0;
          do {
              if (c < '0' || c > '9')
                  throw new InputMismatchException();
              res *= 10;
              res += c - '0';
              c = next();
          } while (!isSpaceChar(c));
          return res * sgn;
      }
 
      public boolean isSpaceChar(int c) {
          if (filter != null)
              return filter.isSpaceChar(c);
          return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
      }
 
      public interface SpaceCharFilter {
          public boolean isSpaceChar(int ch);
      }
  }
}

Measured memory_bytes: 22740
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
using pint = pair<int, int>;
using pll = pair<ll,ll>;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define COUT(x) cout<<(x)<<"\n"

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int h,n;
    cin >> h >> n;
    vector<int> a(n),b(n);
    REP(i,n){
        cin >> a[i] >> b[i];
    }
    vector<int> dp(20050,INF);
    dp[0]=0;
    for(int i=0;i<20050;i++){
        REP(j,n){
            int tes = min(h,i+a[j]);
            dp[tes]=min(dp[i]+b[j],dp[tes]);
        }
    }
    COUT(dp[h]);
    return 0;
}

Measured memory_bytes: 384