akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	int N, M;
	cin >> N >> M;
	int K = 0;
	vector<int> A(M + 1);
	for (int i = 0; i < N; i++) {
		cin >> K;
		for (int j = 0; j < K; j++) {
			int rec = 0;
			cin >> rec;
			A[rec]++;
		}
	}
	int count = 0;
	for (int i = 0; i < M + 1; i++) {
		if (A[i] == N) {
			count++;
		}
	}
	cout << count << endl;
	return 0;
}

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

using namespace std;

int main() {
	long long H, W;
	cin >> H >> W;

	if (H == 1 || W == 1) {
		cout << 1 << endl;
		return 0;
	}

	if (W % 2 == 0) {
		cout << H * (W / 2) << endl;
	} else {
		long long res = H * ((W-1) / 2);
		res += ceil(H / 2.0);
		cout << res << endl;
	}
}


Measured memory_bytes: 256
import std.algorithm;
import std.array;
import std.ascii;
import std.bigint;
import std.complex;
import std.container;
import std.conv;
import std.functional;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

auto readInts() {
	return array(map!(to!int)(readln().strip().split()));
}
auto readInt() {
	return readInts()[0];
}
auto readLongs() {
	return array(map!(to!long)(readln().strip().split()));
}
auto readLong() {
	return readLongs()[0];
}

void readlnTo(T...)(ref T t) {
    auto s = readln().split();
    assert(s.length == t.length);
    foreach(ref ti; t) {
        ti = s[0].to!(typeof(ti));
        s = s[1..$];
    }
}

const real eps = 1e-10;

void main(){
    long n, t;
    readlnTo(n, t);
    auto a = readLongs();
    auto point = 0L;
    auto aMin = long.max;
    foreach(ai; a) {
        point = max(point, ai - aMin);
        aMin = min(ai, aMin);
    }
    long[long] b;
    foreach(i; iota(a.length)) {
        b[a[i]] = i;
    }
    long ans;
    foreach(i; iota(a.length)) {
        if(a[i] + point in b && b[a[i] + point] > i) {
            ++ans;
        }
    }
    writeln(ans);
}



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

using namespace std;
using ll = __int128_t;

ostream &operator<<(ostream &dest, __int128_t value) {
  ostream::sentry s(dest);
  if (s) {
    __uint128_t tmp = value < 0 ? -value : value;
    char buffer[128];
    char *d = std::end(buffer);
    do {
      --d;
      *d = "0123456789"[tmp % 10];
      tmp /= 10;
    } while (tmp != 0);
    if (value < 0) {
      --d;
      *d = '-';
    }
    int len = std::end(buffer) - d;
    if (dest.rdbuf()->sputn(d, len) != len) {
      dest.setstate(ios_base::badbit);
    }
  }
  return dest;
}
 
__int128 parse(string &s) {
  __int128 ret = 0;
  for (int i = 0; i < (int)s.length(); i++)
    if ('0' <= s[i] && s[i] <= '9')
      ret = 10 * ret + s[i] - '0';
  return ret;
}

istream &operator>>(istream &is, __int128_t &a){
    string s;
    is>>s;
    a = parse(s);
    return (is);
}

ll powll(ll base,ll exp) { ll res = 1; while(exp>0){ if(exp & 1)res = res * base; base = base * base; exp >>= 1; } return res;}
ll mod_pow(ll base,ll exp, ll mod) { ll res = 1; while(exp>0){ if(exp & 1)res = res * base % mod; base = base * base % mod; exp >>= 1; } return res % mod;}

int main()
{
    ll a, n, m;
    cin >> a >> n >> m;


    int cnt = 0;
    //桁和を探索
    for(int d = 1; d <= 72; d++) {

        ll px = powll(a + d, n);
        if(px > m)continue;
        int sum = 0;
        while(px) {
            sum += px % 10;
            px /= 10;
        }
        if(sum == d)cnt++;
    }
    cout << cnt << endl;

}


Measured memory_bytes: 3236
#include <stdio.h>

int main() {
    long int l, r;
    scanf("%ld %ld", &l, &r);
    // printf("%d", l);

    if(r-l>2018) {
        printf("%d\n", 0);

        return 0;
    }

    long int i, j, min=2019;

    for(i=l; i<r+1; i++) {
        if(i%2019==0) {
            printf("%d\n", 0);

            return 0;
        } else if (i%673==0) {
            for(j=0; j<r+1; j++) {
                if(j%3==0) {
                    printf("%d\n", 0);

                    return 0;
                }
            }
        } else if (i<r) {
            for(j=i+1; j<r+1; j++) {
                if(min>i*j%2019) {
                    min = i*j%2019;
                }
            }
        }
    }

    printf("%ld\n", min);


    return 0;

}

Measured memory_bytes: 128
#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <numeric>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <cassert>
#include <random>
#include <time.h>
//#include <boost/multiprecision/cpp_int.hpp>



using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const double EPS = 1e-10;
long long const MOD = 1000000007;

long long mod_pow(long long x, long long n) {
    long long res = 1;
    for (int i = 0;i < 60; i++) {
        if (n >> i & 1) res = res * x % MOD;
        x = x * x % MOD;
    }
    return res;
}

template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

void fastInput() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

int main(void) {
    int K, X; cin >> K >> X;
    for (int i = max(X-K+1, -1000000); i < min(X+K, 1000001); i++) {
        cout << i << " ";
    }
    cout << endl;
}

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

int main () {
  int A, B, K;

  cin >> A >> B >> K;

  int c = 0;

  for(int i = min(A, B); i > 0; i--) {
    if(A % i == 0 && B % i == 0) {
      c++;
      if(c >= K) {
        cout << i << endl;
        return 0;
      }
    }
  }

  return 0;
}


Measured memory_bytes: 256
# N体のモンスター, K回まで必殺技が使える
N, K = map(int, input().split())

# モンスターの体力 高い順
H_list = list(map(int, input().split()))
H_list = sorted(H_list, reverse=True)

# K番目のモンスターまでは必殺技で殺す
H_list = H_list[K:]

# 残りのモンスターのHP数を合計する
HP_sum = sum(H_list)

print(HP_sum)

Measured memory_bytes: 26180
#include<stdio.h>

int main(){
	int n;
	int S=0, T=0;
	int i;
	for(i=0;i<4;i++){
		scanf("%d", &n);
		S+=n;
	}
	for(i=0;i<4;i++){
		scanf("%d", &n);
		T+=n;
	}
	if(S>T){
		printf("%d\n", S);
	}else{
		printf("%d\n", T);
	}
	return 0;
}

Measured memory_bytes: 592
#include <bits/stdc++.h>
//#include <mylib.h>
using namespace std;
//cin.sync_with_stdio(false);

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define FOR_EQ(i,a,b) for(int i = (a); i <= (b); ++i)
#define FOR_RE(i,a,b) for(int i = (a); i > (b); --i)
#define rep(i,n) FOR(i,0,n)
#define rep_eq(i,n) FOR_EQ(i,0,n)
#define rep_re(i,n) FOR_RE(i,n,0)
//1個上から時計周り
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
//上右下左
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
static const int NIL = -1;

typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> Vector;
typedef vector<Vector>	DVector;
int n;

int main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int a, b;
    cin >> a >> b;
    
    int cnt = 0;
    FOR_EQ(i, a, b){
        string str = to_string(i);
        if(str[0] == str[4]){
            if(str[1] == str[3]){
                cnt++;
            }
        }
    }
    
    cout << cnt << endl;
}

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

using namespace std;

long long inf=1000000007;

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

	int cnt=0;
	int l=0;
	int r=0;

	for(int i=0;i<n;i++){
		if(s.at(i)=='(') cnt++;
		else cnt--;
		if(cnt<0){
			l++;
			cnt=0;
		}
	}

	r=cnt;

	for(int i=0;i<l;i++){
		s="("+s;
	}

	for(int i=0;i<r;i++){
		s+=")";
	}

	cout<<s<<endl;

	return 0;
}


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

int main()
{
  ll n;
  cin >> n;
  ll ans = 0;
  for (ll i = 1; i <= n; i++)
  {
    if (i % 3 != 0 && i % 5 != 0)
    {
      ans += i;
    }
  }
  cout << ans << endl;
}


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

using namespace std;
using ll = long long;

int main() {
    int N, M;
    ll S;
    cin >> N >> M >> S;
 
    vector<vector<tuple<int, int, ll>>> E(N);
    vector<pair<ll, ll>> B(N);

    int amax = 0;
    for(int i = 0; i < M; i++) {
        int u, v, a;
        ll b;
        cin >> u >> v >> a >> b;
        E[u-1].push_back(make_tuple(v-1,a,b));
        E[v-1].push_back(make_tuple(u-1,a,b));
        amax = max(a, amax);
    }
    ll C = amax * (N - 1);
    vector<vector<ll>> dp(N, vector<ll>(C + 1, LLONG_MAX >> 4));
    for(auto & [c, d]: B) cin >> c >> d;

    for(int i = 0; i <= min(C, S); i++) dp[0][i] = 0;


    using qtype = tuple<ll, int, int>;
    priority_queue<qtype, vector<qtype>, greater<qtype>> q;
    q.push(make_tuple(0, min(C, S), 0));

    while(!q.empty()) {
        auto [t_sum, coin, node] = q.top();
        q.pop();
        for(auto [to, c, t]: E[node]) {
            if(coin < c) continue;
            ll nt = t_sum + t;
            if(nt < dp[to][coin - c]) {
                dp[to][coin - c] = nt;
                q.push(make_tuple(nt, coin - c, to));
            }
        }
        auto [b_num, b_time] = B[node];
        for(int i = 1;;i++) {
            int nc = min(C, b_num * i + coin);
            ll nt = t_sum + i * b_time;
            if(nt < dp[node][nc]) {
                dp[node][nc] = nt;
                q.push(make_tuple(nt, nc, node));
            }
            if(nc == C) break;
        }
    }
    for(int i = 1; i < N; i++) {
        cout << *min_element(dp[i].begin(), dp[i].end()) << endl;
    }
}

Measured memory_bytes: 37012
my $N = <>;

my @alf = ("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");

my $str;

$N =$N -1;
while(){
  my $mod = $N%26;
  $N = ($N-$mod)/26;
  $str .= $alf[$mod];
  if($N ==0){
      last;
  }
  $N = $N -1;
}
#$str .= $alf[$N-1];

$str = reverse $str;
print "$str";


Measured memory_bytes: 4708
#define _CRT_SECURE_NO_WARNINGS
#pragma GCC target("avx")
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#include <cstdio>
#include <cstring>
#include <string>
#include <string.h>
#include <cmath>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <queue>
#include <list>
#include <stack>
#include <bitset>
#include <fstream>
#include <sstream>
#include <assert.h>
#define eps 1e-7
#define SIZE 1000100
#define rep(i, a, b) for (long long i = a; i <= b; ++i)
#define pi acos(-1.0)
#define mp make_pair
#define ll long long
#define int long long
using namespace std;
void io() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); }
const int mod = 998244353;
int n, inv[SIZE] = { 0,1 }, cnt[SIZE], tp, maxx = 0, ans[SIZE], res = 0;
inline int qpow(int a, int b, int m) {	//快速幂，求a ^ b mod m
	int res = 1;
	while (b) {
		if (b & 1) res = res * a % m;
		a = a * a % m;
		b >>= 1;
	}
	return res;
}
signed main() {
	io(); cin >> n;
	rep(i, 1, n) {
		cin >> tp;
		cnt[tp]++;
		maxx = max(maxx, tp);
	}
	rep(i, 2, maxx) inv[i] = (mod - mod / i) * inv[mod % i] % mod;
	for (int i = maxx; i; --i) {	//求出gcd为i的所有pair的乘积之和
		int s1 = 0, s2 = 0;
		for (int j = i; j <= maxx; j += i) {
			s1 = (s1 + cnt[j] * j % mod) % mod;
			s2 = (s2 + cnt[j] * j % mod * j % mod) % mod;
		}
		ans[i] = (s1 * s1 % mod - s2 + mod) % mod;
		// s1 - s2 的作用是使得gcd为j的pair对数为 cnt * (cnt - 1)
		for (int j = i + i; j <= maxx; j += i) {
			ans[i] = (ans[i] - ans[j] + mod) % mod;
			//去重，删除gcd为ik (k > 1)的pair
		}
	}
	rep(i, 1, maxx) {	//计算 ans[i] / i % mod
		res = (res + ans[i] * inv[i] % mod) % mod;
	}
	cout << res * inv[2] % mod; //res / 2
}

Measured memory_bytes: 23680
#include<iostream>
#include<algorithm>
using namespace std;
bool p[5001][5001];
int x[3000], y[3000], n, maxn;
int main() {
	while (true) {
		cin >> n; maxn = 0; if (n == 0)break;
		for (int i = 0; i < n; i++) { cin >> x[i] >> y[i]; p[x[i]][y[i]] = true; }
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (i == j)continue;
				int X1 = x[j] - x[i], Y1 = y[j] - y[i];
				int X2 = -Y1, Y2 = X1;
				int X3 = X1 - Y1, Y3 = X1 + Y1;
				int X4 = X2 + x[i], Y4 = Y2 + y[i];
				int X5 = X3 + x[i], Y5 = Y3 + y[i];
				if (X4 < 0 || X4 > 5000 || Y4 < 0 || Y4 > 5000 || X5 < 0 || X5 > 5000 || Y5 < 0 || Y5 > 5000)continue;
				if (p[X4][Y4] == true && p[X5][Y5] == true) {
					maxn = max(maxn, X1*X1 + Y1*Y1);
				}
			}
		}
		cout << maxn << endl;
		for (int i = 0; i < n; i++) { p[x[i]][y[i]] = true; }
	}
	return 0;
}

Measured memory_bytes: 22652
n=int(input())
x=list(map(int,input().split()))

min_i=[x[0]]
for i in range(1,n):
  min_i.append(min(min_i[i-1],x[i]))
  
count=0
for i in range(n):
  if min_i[i]==x[i]:
    count=count+1
    
print(count)

Measured memory_bytes: 24744
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()

using namespace std;

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

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

	char X, Y; cin >> X >> Y;

	char res = '=';
	if (X < Y){
		res = '<';
	}else
	if (X > Y){
		res = '>';
	} // end if

	cout << res << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int mod = 1'000'000'007;
int mul(long long a, long long b){
	return a * b % mod;
}
int n, k;
map<tuple<int,int,int>, int> f;
int solve(int cur, int open, int odd){
	if(open < 0) return 0;
	if(cur == n + 1) return odd == k && open == 0;
	auto it = f.find(make_tuple(cur, open, odd));
	if(it != f.end()) return it->second;
	// [ ... open ... ] [ cur ]
	int ans = solve(cur + 1, open + 1, odd - cur - cur); // nothing
	ans += mul(open, solve(cur + 1, open, odd - cur + cur)); if(ans >= mod) ans -= mod; // cur in open
	ans += mul(open, solve(cur + 1, open, odd + cur - cur)); if(ans >= mod) ans -= mod; // open in cur
	ans += solve(cur + 1, open, odd); if(ans >= mod) ans -= mod; // cur in cur
	ans += mul(open, mul(open, solve(cur + 1, open - 1, odd + cur + cur))); if(ans >= mod) ans -= mod; // open in cur, cur in open
	return f[make_tuple(cur, open, odd)] = ans;
}
int main(){
	cin >> n >> k;
	cout << solve(1, 0, 0) << endl;
	return 0;
}


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

using namespace std;
ll N, a[100005], i, dp[100005];
int main()
{
   cin>>N;
   for(i=1;i<=N;i++)
    cin>>a[i];
   dp[0]=0;
   dp[1]=0;
   a[0]=0;
   for(i=2;i<=N;i++){
    if(i>2)
    dp[i]=min(dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i]-a[i-2]));
    else
        dp[i]=dp[i-1]+abs(a[i]-a[i-1]);
   }
    cout<<dp[N];
    return 0;
}


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

void solve(int a, int b, int c, int d, int e, int f) {
	double x = (f - (double)e*c/b) / (d - (double)e*a/b);
	double y = (c - a*x) / b;
	if (x == 0) x = 0.000;
	if (y == 0) y = 0.000;
	printf("%4.3f %4.3f\n", x, y);
}

int main() {
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		solve(a,b,c,d,e,f);
	}
	return 0;
}

Measured memory_bytes: 3052
def p_c():
    N = int(input())
    V = list(map(int, input().split()))
    ans = 0

    for _ in range(N - 1):
        V.sort()
        ans = (V.pop(0) + V.pop(0)) / 2
        V.append(ans)

    print(ans)


if __name__ == '__main__':
    p_c()


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#include <algorithm>
#include <map>
#include <cstdlib>
#include <cmath>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
const double pi=acos(-1);
int main(){
    ll a;
    string b;
    cin >> a >> b;
    string b100;
    bool first=false;
    bool point=false;
    int afterpoint=0;
    for(int i=0;i<b.size();i++){
        if(b[i]=='.'){
            point=true;
            continue;
        }
        if(first||b[i]!='0'){
            first=true;
            b100+=b[i];
        }
        if(point){
            afterpoint++;
            if(afterpoint==2) break;
        }
    }
    if(b100=="") b100="0";
    ll ans=a*stoi(b100)/100;
    cout << ans << endl;
}

Measured memory_bytes: 3568
#include<bits/stdc++.h>
using namespace std;
const long long MOD = 1e9+7;
#define rep(i,n) for(int i=0;i<n;++i)
typedef long long int ll;
typedef unsigned long long ull;
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
typedef pair<ll,ll> P;


int main()
{
    int n,y;
    cin>>n >>y;
    rep(i,n+1)rep(k,n+1)
    {
        int t = n-i-k;
        if((ll)10000*i+5000*k+1000*t!=y||t<0)continue;
        if(i+k+t==n){
            cout<<i<<" "<<k <<" "<<t<<endl;
            return 0;
        }
    }
    cout<<"-1 -1 -1"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int a,b,t1,t4,c,d;
	while(scanf("%d %d %d %d",&a,&b,&c,&d)!=EOF)
	{
		if(b>c&&a<d)
		{
		t1=(a>c?a:c);
			t4=(b<d?b:d);
		printf("%d\n",t4-t1);
		}
		else{
			printf("0\n");
		}
	}
 } 

Measured memory_bytes: 128
def prime_decomposition(n):
    
    i = 2
    table = []
    while i * i <= n:
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                n //= i
                cnt += 1
            table.append((i, cnt))
        i += 1
    if n > 1:
        table.append((n, 1))
    return table

from itertools import groupby
from collections import Counter
import sys
input = sys.stdin.readline

def main():
    N = int(input())

    ans = 0
    table = prime_decomposition(N)
    for _, cnt in table:
        i = 1
        while cnt >= i:
            cnt -= i
            i += 1
            ans += 1

    print(ans)

main()

Measured memory_bytes: 9460
import sys
import math
'''a,b= map(int,input().split())'''
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
a=int(input())
li0= [int(x) for x in input().split()]
count=0
for i in range(1,1+a):
  if i!=li0[i-1]:
    count+=1
if count<=2:
  print("YES")
else:
  print("NO")

Measured memory_bytes: 3060
function Main(input){
  var list = input.split("\n");
  var cnt = 0;
  for(var i=0;i<=Number(list[0]);i++){
    for(var j=0;j<=Number(list[1]);j++){
      for(var k=0;k<=Number(list[2]);k++){
        if(i*500+j*100+k*50==Number(list[3]))cnt++;
      }
    }
  }
  console.log(cnt);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7500
def main():
    s = input()
    k = int(input())
    ss = set(s)
    for i in range(0, len(s)):
        ss.add(s[i:i + 2])
        ss.add(s[i:i + 3])
        ss.add(s[i:i + 4])
        ss.add(s[i:i + 5])
    print(sorted(iter(ss))[k - 1])


if __name__ == '__main__':
    main()


Measured memory_bytes: 4556
n=int(input())
a = list(map(int,input().split()))
ans="Yes"
cnt=0
while(ans=="Yes"):
    for i in range(n):
        if(a[i]%2!=0):
            ans="No"
    if(ans=="Yes"):
        cnt+=1
        for i in range(n):
            a[i]=a[i]//2
print(cnt)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll>PLL;
#define rep(i,n) for (int i = 0; i < (n); ++i)
ll MOD = 1e4+7;
int main() {
    int n;
    cin >> n;
    vector<ll> a(n);
    vector<ll> b(n);
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> b[i];
    ll k = 0;
    rep(i, n) k += b[i] - a[i];
    ll anum = 0;
    rep(i, n)  if ( b[i] > a[i] ) anum += ( b[i] - a[i] + 1 ) / 2;
    if ( anum > k ) cout << "No" << endl;
    else            cout << "Yes" << endl;
    return 0;
}



Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <functional>
#include <math.h>
#include <stdlib.h>
#include <map>
#include <deque>
#include <list>
#include <sys/timeb.h>
#include <fstream>
#include <set>

using namespace std;

#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define INF 1050000000
#define INFL 1100000000000000000LL
#define EPS (1e-10)
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef long long ll;
typedef pair<int, int> Pi;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<Pi> > vvPi;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi> > pqlP;
struct Edge {
	int from, to, cost;
	bool operator<(Edge e) {
		return cost < e.cost;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
template <class T>
using vec = vector<T>;
template<class T>
using pql = priority_queue<T, vector<T>, greater<T>>;
string debug_show(Pi a) {
	return "(" + to_string(a.first) + "," + to_string(a.second) + ")";
}

template<class T>
struct augEdge {
	T from, to;
	int cost;
	bool operator<(augEdge e) { return cost < e.cost; }
	bool operator>(augEdge e) { return cost > e.cost; }
};
template<class T>
using augGraph = vector<augEdge<T>>;


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

	int sx, sy, tx, ty;
	cin >> sx >> sy >> tx >> ty;

	int ax = tx - sx;
	int ay = ty - sy;

	string ans = "";
	rep(i, ax) ans += 'R';
	rep(i, ay) ans += 'U';
	rep(i, ax) ans += 'L';
	rep(i, ay) ans += 'D';

	ans += 'D';
	rep(i, ax + 1) ans += 'R';
	rep(i, ay + 1) ans += 'U';
	ans += 'L';

	ans += 'U';
	rep(i, ax + 1) ans += 'L';
	rep(i, ay + 1) ans += 'D';
	ans += 'R';

	cout << ans << endl;

	return 0;
}



Measured memory_bytes: 256
using System;
class Prpgram
{
    static void Main(string[] args)
    {
        string input = Console.ReadLine();
        string[] inputlist = input.Split(' ');
        int N = int.Parse(inputlist[0]);
        int R = int.Parse(inputlist[1]);
        int ans;

        if (N < 10)
        {
            ans = R + 100 * (10 - N);
        }
        else ans = R;

        Console.Write(ans);
    }
}

Measured memory_bytes: 11092
#include <cstdio>
using namespace std;
const int N=2010;
const int INF=1e9;
int n;
int p[2][N];
int preSum[2][N][N*2];
inline void updateMin(int &x,int y){
	x=(y<x)?y:x;
}
void readData(){
	scanf("%d",&n);
	static char str[5];
	int x;
	for(int i=1;i<=n*2;i++){
		scanf("%s%d",str,&x);
		p[str[0]=='W'][x]=i;
	}
}
void initPrefix(){
	for(int k=0;k<2;k++){
		for(int j=n;j>=1;j--){
			for(int i=1;i<=n*2;i++){
				preSum[k][j][i]=preSum[k][j+1][i];
				if(i>=p[k][j])
					preSum[k][j][i]++;
			}
		}
	}
}
int f[N][N];
void dp(){
	for(int a=0;a<=n;a++)
		for(int b=0;b<=n;b++)
			f[a][b]=INF;
	f[0][0]=0;
	for(int i=0;i<2*n;i++){
		for(int a=0,b;a<=i;a++){
			b=i-a;
			if(a<=n&&b<=n){
				if(a<n) // fill a+1
					updateMin(f[a+1][b],f[a][b]+preSum[0][a+2][p[0][a+1]-1]+preSum[1][b+1][p[0][a+1]-1]);
				if(b<n) // fill b+1
					updateMin(f[a][b+1],f[a][b]+preSum[0][a+1][p[1][b+1]-1]+preSum[1][b+2][p[1][b+1]-1]);
			}
		}
	}
	printf("%d\n",f[n][n]);
}
int main(){
	readData();
	initPrefix();
	dp();
	return 0;
}


Measured memory_bytes: 78976
#include <stdio.h>
#include <math.h>

int main(int argc, const char * argv[]) {
    
    double x1,y1,x2,y2;
    double x;
    
    scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);
    
    x = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
    
    printf("%f\n",x);
    
    return 0;
}



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

int main(){
	string s;
	int cnt[26] = {};
	cin >> s;
	for(char c : s){
		cnt[c - 'a']++;
	}
	for(int i = 0;i < 26;i++){
		if(!cnt[i]){
			cout << (char)(i + 'a') << endl;
			return 0;
		}
	}
	cout << "None" << endl;
	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define int long long
#define pb push_back

using namespace std;

int32_t main(){
	string s;
	cin >> s;
	int ans = 0, a=1;
	char prev=s[0];
	bool par=(s[0] == '>');
	vector<int> v;
	for(int i = 1; i<s.length(); i++){
		if(s[i] == prev) a++;
		else{
			v.pb(a);
			a=1;
		}
		prev = s[i];
	}
	v.pb(a);
//	for(auto i : v) printf("%d ", i); printf("\n");
	for(int i=0; i<v.size(); i++){
		int x=v[i]-1;
		ans += x*(x+1)/2;
		if(par){
			ans += (i-1<0 ? v[i] : max(v[i-1],v[i]));
		}else{
		}
		par = 1-par;
	}
	if(par){
		ans += v.back();
	}
	cout << ans;
}


Measured memory_bytes: 3068
import itertools


n = int(input())
a = list(map(int, input().split()))

ans = 0
for ptn in itertools.product(range(-1, 2), repeat=n):
    for i, num in enumerate(ptn):
        if (a[i] + num) % 2 == 0:
            ans += 1
            break
print(ans)

Measured memory_bytes: 41836
#include <cstdio>
#include <utility>
#include <typeinfo>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <tuple>
#define REP(i,n) for(int i=0;i<n;i++)
typedef long long int ll;
using namespace std;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;

int main()
{

    double pi=3.141592653589;
    double x;
    cin>>x;
    
    printf("%f %f\n",x*x*pi,2*x*pi);
    
    return 0;
}

Measured memory_bytes: 1228
from collections import Counter, deque
n=int(input())
V=deque(list(map(int,input().split())))
if len(set(V))==1:print(n//2)
else:
    Odd=[]
    Even=[]
    for _ in range(n//2):
        Odd.append(V.popleft())
        Even.append(V.popleft())
    O=Counter(Odd)
    E=Counter(Even)
    if len(set(Odd))==1:print(n//2-E.most_common()[0][1])
    elif len(set(Even))==1:print(n//2-O.most_common()[0][1])
    elif O.most_common()[0][0]==E.most_common()[0][0]:print(min(n-E.most_common()[0][1]-O.most_common()[1][1],n-E.most_common()[1][1]-O.most_common()[0][1]))
    else:print(n-E.most_common()[0][1]-O.most_common()[0][1])

Measured memory_bytes: 19788
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll long long
#define maxn 200020 
using namespace std;
int n,a[maxn];
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;++i)scanf("%d",&a[i]);
	if(a[1]!=0){
		cout<<"-1"<<endl;
		return 0;
	}
	for(int i=2;i<=n;++i)
	if(a[i]-a[i-1]>1){
		cout<<"-1"<<endl;
		return 0;
	}
	ll ans=0;
	for(int i=2;i<=n;++i)
	if(a[i]){
		++ans;	
		if(a[i]<=a[i-1])ans+=a[i]-1;
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 1024
require "prime"
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
      return Array.new(size1){init}
  else
      return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

N=gets.to_i
ans=Prime.each(55555).to_a.select{|x| x%10==1}
puts ans[0..N-1].join(" ")

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

int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i,n) cin >> v[i];
  sort(v.begin(), v.end());
  int abc = v[(n-1)/2];
  int arc = v[n/2];
  cout << arc - abc << endl;
  return 0;
}


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

int main() {
  int N;
  cin >> N;
  
  vector<int> a(N);
  for( int i = 0; i < N; i++ ) cin >> a.at(i);
  
  int hikari = 1;
  for( int i = 0; i < N; i++ ){
    if( hikari == 2 ){
      cout << i << endl;
      return 0;
    }else{
      hikari = a.at(hikari-1);
    }
  }
  cout << -1 << endl;
      
  
}

Measured memory_bytes: 640
n, k = gets.split.map(&:to_i)
r, s, p = gets.split.map(&:to_i)
t = gets.chomp

ans = 0
n.times do |i|
  c = t[i]

  if i >= k && c == t[i - k]
    t[i] = "x"
    next
  end

  score = [p, s, r][%w(r p s).find_index(c)]
  ans += score
end

puts ans


Measured memory_bytes: 14612
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define inf (ll)1e18
using namespace std;
int V,E,R;
struct edge{
  int to,cost;
};
vector<edge> v[100001];
int main(){
  cin>>V>>E>>R;
  for(int i=0;i<E;i++){
    int s,t,d;cin>>s>>t>>d;
    v[s].push_back({t,d});
  }
  ll d[100001];
  for(int i=0;i<V;i++){
    d[i]=inf;
  }
  d[R]=0;
  priority_queue<pair<ll,int> > q;
  q.push(make_pair(0,R));
  while(!q.empty()){
    int now=q.top().se;
    ll nowd=-q.top().fi;
    q.pop();
    if(nowd>d[now])continue;
    vector<edge> temp=v[now];
    for(int i=0;i<temp.size();i++){
      if(d[temp[i].to]>d[now]+temp[i].cost){
        d[temp[i].to]=d[now]+temp[i].cost;
        int next=temp[i].to;
        q.push(make_pair(-d[next],next));
      }
    }
  }
  for(int i=0;i<V;i++){
    if(d[i]==inf){
      cout<<"INF"<<endl;
      continue;
    }
    cout<<d[i]<<endl;
  }
  return 0;
}

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

int main()
{
	int n,m;
	cin>>n>>m;
	if(m*2>=n)
	{
		cout<<'0'<<endl;
		return 0;
	}
	else
	{
		cout<<n-m*2<<endl;
		return 0;
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int64_t k, n; 
  cin >> k >> n;
  
  vector<int64_t> vec(n);
  for (int64_t i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  
  int64_t maxdis = 0;
  
  for (int64_t j = 0; j < n; j++) {
    if (j == n-1) {
      maxdis = max(maxdis, k - vec.at(n-1) + vec.at(0));
    } else {
      maxdis = max(maxdis, vec.at(j+1) - vec.at(j));
    }
    
  }
  
  cout << k - maxdis << endl;
  
  
}

Measured memory_bytes: 1920
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++) cin>>a[i];
  sort(a.rbegin(),a.rend());
  long long ans=0;
  int t=n-1;
  for(int i=0;i<n;i++){
    int lim=2;
    if(i==0) lim=1;
    for(int j=0;j<lim;j++){
    if(t>0){
     ans+=a[i];
      t--;
    }
    }
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 4056
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: usize,
        s: String
    }
    let s = s.chars().collect::<Vec<_>>();
    let r = s.iter().filter(|&c| *c == 'R').count();
    let g = s.iter().filter(|&c| *c == 'G').count();
    let b = s.iter().filter(|&c| *c == 'B').count();
    let mut ans = r * g * b;
    for d in 1.. {
        if d + d >= n {
            break;
        }
        for i in 0..n {
            let j = i + d;
            let k = j + d;
            if k >= n {
                break;
            }
            if s[i] != s[j] && s[j] != s[k] && s[i] != s[k] {
                ans -= 1;
            }
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 2164
#include <stdio.h>
	#include <string.h>
    int main()
    {
    	char s[10];
      	scanf("%s",s);
      	if(strcmp(s,"SUN")==0)
        {
    		printf("7\n");
        }
      	if(strcmp(s,"MON")==0)
        {
    		printf("6\n");
        }
      	if(strcmp(s,"TUE")==0)
        {
    		printf("5\n");
        }
      	if(strcmp(s,"WED")==0)
        {
    		printf("4\n");
        }
      	if(strcmp(s,"THU")==0)
        {
    		printf("3\n");
        }
      	if(strcmp(s,"FRI")==0)
        {
    		printf("2\n");
        }
      	if(strcmp(s,"SAT")==0)
        {
    		printf("1\n");
        }
      return 0;
    }

Measured memory_bytes: 128
#include<stdio.h>

int main()
{
  int arr[3];
  int count = 0;

  for(int i = 0; i<3; i++)
    {
      scanf("%d", &arr[i]);
    }
  
  for(int i = arr[0]; i<arr[1]+1; i++)
    {
      if(arr[2]%i == 0)
	{
	  count++;
	}
    }
  printf("%d\n", count);
  return 0;
}


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

int main() {
    ll N;
    ll A, B;
    cin >> N >> A >> B;
    if ((llabs(A-B)-1)%2) {
        cout << (1 + (llabs(A-B)-1)/2) << endl;
    }
    else {
        if (A > B) {
            swap(A, B);
        }
        // Aが左
        ll tmp = (A-1)+1+(1+llabs(1-(B-(A-1)-1))-1)/2;
        ll tmp2 = (N-B)+1+(1+llabs(N-(A+(N-B)+1))-1)/2;
        cout << min(tmp, tmp2) << endl;
    }
}


Measured memory_bytes: 256
use std::io::Read;
use std::collections::HashMap;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

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

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();
    let mut counts: HashMap<usize, usize> = HashMap::new();
    for _ in 0..(n - 1) {
        let a: usize = iterator.next().unwrap().parse().unwrap();
        *counts.entry(a).or_insert(0) += 1;
    }

    let mut result = String::new();
    for i in 1..=n {
        let count = counts.get(&i).unwrap_or(&0);
        result.push_str(&format!("{}\n", count));
    }

    return result.trim().to_string();
}


Measured memory_bytes: 9860
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    str s; cin >> s;
    if(s.back() == 's') s+="e";
    s+="s";
    cout << s << "\n";
}


Measured memory_bytes: 3636
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstdio>
using namespace std;
string a,b;
int main()
{
    cin>>a>>b;
    if(a[0]==b[2]&&a[1]==b[1]&&a[2]==b[0])
    cout<<"YES";
    else
    cout<<"NO";
    cout<<endl;
    return 0;
}

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

using namespace std;

double distance(double x1, double y1, double x2, double y2){
    return sqrt(pow(abs(x1-x2), 2)+pow(abs(y1-y2), 2));
}

int main(){
    int n; cin>> n;
    for(int i=0; i < n; i++){
        double x1,y1,x2,y2,x3,y3;
        cin >> x1 >>y1 >>x2 >>y2 >>x3 >>y3;
        double a = distance(x1, y1, x2, y2), b = distance(x2, y2, x3, y3), c = distance(x3, y3, x1, y1);
        double s = (a+b+c)/2;
        double r = (a*b*c)/(4.*sqrt(s*(s-a)*(s-b)*(s-c)));
        double a1 = 2*(x2-x1), b1 = 2*(y2-y1), c1 = x1*x1-x2*x2+y1*y1-y2*y2;
        double a2 = 2*(x3-x1), b2 = 2*(y3-y1), c2 = x1*x1-x3*x3+y1*y1-y3*y3;
        double x = (b1*c2-b2*c1)/(a1*b2-a2*b1);
        double y = (c1*a2-c2*a1)/(a1*b2-a2*b1);
        printf("%.3f %.3f %.3f\n", x, y, r);
    }
}

Measured memory_bytes: 1244
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String s = scan.next();

		int[] sw = new int[n + 1];
		int[] se = new int[n + 1];

		for(int i = 1; i < n; i++) {
			char a = s.charAt(i - 1);
			sw[i] = sw[i - 1];
			if(a == 'W') sw[i]++;
		}

		for(int i = n - 1; 0 < i; i--) {
			char a = s.charAt(i);
			se[i] = se[i + 1];
			if(a == 'E') se[i]++;
		}

		int ans = n;
		for(int i = 0; i < n; i++) {
			ans = Math.min(ans, sw[i] + se[i + 1]);
		}
		System.out.println(ans);
	}
}


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

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

  vector<int> c(26);
  rep(i,26){
    cin >> c[i];
  }

  vector<vector<int>> s (D,vector<int>(26));
  rep(d, D){
    rep(i,26){
      cin >> s[d][i];
    }
  }

  vector<int> t(D);
  rep(i,D){
    cin >> t[i];
    t[i] -=1;
  }

  vector<int> last(26);
  vector<int> v(D);
  int sat =0;

  rep(d, D){
    last[t[d]] = d+1;

    int desc=0;
    rep(i, 26){
      desc += c[i]*(d+1-last[i]);
    }
    //cout <<s[d][t[d]]<<endl;
    //cout << desc << endl;

    if(d==0){
      v[d] = s[d][t[d]] - desc;
    }else{
      v[d] = v[d-1] + s[d][t[d]] - desc;
    }

    cout << v[d] <<endl;

  }
  return 0;
}

Measured memory_bytes: 3648
def max(a, b)
  a > b ? a : b
end

def min(a, b)
  a > b ? b : a
end

num = gets.to_i
minv = gets.to_i
maxv = gets.to_i - minv
minv = min(minv, maxv + minv)

(num-2).times do
  n = gets.to_i
  maxv = max((n-minv), maxv)
  minv = min(minv, n)
end

puts maxv



Measured memory_bytes: 8904
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<string>
#include<cmath>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#include<complex>
#include<iomanip>
#include<unordered_map>
#define deg(x) cerr<<#x<<"="<<x<<endl;
#define fd(x) for(int i=0;i<x;i++)
#define fdd(a,x) for(int i=a;i<x;i++)
#define fx(x,n) for(int i=n-1;i>=x;i--)
#define mst(x) memset(x,0,sizeof(x));
#define fi first
#define se second
#define TB ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define ok "ok"
#define HH puts("");
#define ls rt<<1
#define rs rt<<1|1
#define pb(a,b) a.push_back(b);
#define FIN  freopen("1.in","r",stdin);
#define FOUT freopen("1.out","w",stdout);
using namespace std;
typedef long long ll;typedef long long LL;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<string,int> pss;
typedef unsigned long long ull;
const ll mod=998244353;
const ll inf=1e9+7;
const double eps=1e-8;
ll qpow(ll a,ll b,ll m){ ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return (r+m)%m;}
//const double pi=acos(-1);
 
ll dp[1020300][4];

int main()
{
    TB
	int n;
	cin>>n;
	dp[1][0]=8;
	dp[1][1]=dp[1][2]=1;
	dp[1][3]=0;
	fdd(2,n+1){
		dp[i][0]=dp[i-1][0]*8%inf;
		dp[i][1]=(dp[i-1][0]+dp[i-1][1]*9)%inf;
		dp[i][2]=(dp[i-1][0]+dp[i-1][2]*9)%inf;
		dp[i][3]=(dp[i-1][1]+dp[i-1][2]+dp[i-1][3]*10)%inf;
	}
	cout<<dp[n][3]<<'\n';
	return 0;
}

Measured memory_bytes: 34816
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main()
{
	int A, B;
	scanf("%d", &A);
	scanf("%d", &B);

	int integerArray[3] = { 1, 2, 3 };

	for (int i = 0; i < 3; i++)
	{
		if (A == integerArray[i] || B == integerArray[i])
		{
			continue;
		}
		else
		{
			printf("%d \n", integerArray[i]);
			return 0;
		}
	}
	return 0;
}


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

int32_t main()
{

	int n;
	cin >> n;
	int a[n];
	int i;
	fo(i, n)
	cin >> a[i];

	int sum = 0;

	for (int i = 0; i < n - 1; i++)
	{
		if (a[i] > a[i + 1])
		{
			sum += a[i] - a[i + 1];

			a[i + 1] += a[i] - a[i + 1];
		}
	}

	cout << sum << endl;
}



Measured memory_bytes: 5184
import sys
import numpy as np

n = int(input())
p = np.array(list(map(int, input().split())))

cnt = 0

for i in range(1,n-1):
    if p[i] != np.max(p[i-1:i+2]) and\
       p[i] != np.min(p[i-1:i+2]):

        cnt += 1

print(cnt)


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

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

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

int main()
{
    string s;
    cin >> s;
    if (s.at(2) == s.at(3) && s.at(4) == s.at(5)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
x=10**9+7
A=set(a);B=set(b)
if len(A)!=len(a) or len(B)!=len(b):
  print(0)
else:
  L=[]
  for i in range(n):
    l=[]
    for j in range(m):
      l.append(0)
    L.append(l)
  ct=1;ctn=0;ctm=0
  for k in range(m*n,0,-1):
    if k in A and k in B:
      L[n-ctn-1][m-ctm-1]=k
      ctn+=1;ctm+=1
    elif k in A:
        ct*=ctm
        ctn+=1
    elif k in B:
        ct*=ctn
        ctm+=1
    else:
      ct*=(ctm*ctn-m*n+k)
    if ct==0:
      break
    ct=ct%x
  print(ct)

Measured memory_bytes: 12020
#include<iostream>
#include<vector>
using namespace std;
int main(){
	long long n,m,k,dai,syou;
	cin >> n >> m >> k;	
	for(long i=0;i<=n;i++){
		for(long j=0;j<=m;j++){
			if(i*(m-j)+j*(n-i)==k){
				cout << "Yes\n";
				return 0;
			}
		}
	}
	cout << "No\n";	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
bool solve() {
    int N;
    cin >> N;
    if(!N) return false;
 
    vector<int> A(N);
    int sum = 0;
    for(int &e : A) {
        cin >> e;
        sum += e;
    }
 
    int ans = 0;
    for(int i = 0; i < N; i++) if(N * A[i] <= sum) ans++;
    cout << ans << endl;
    return true;
}
 
int main() {
    while(solve());
    return 0;
}


Measured memory_bytes: 3116
#include<iostream>
    using namespace std;
     
    int main()
    {
      long long n, d;
      cin>>d>>n;
      if(n>=100) n=101;
      for(int i=0; i<d; i++)
      {
        n*=100;
      }
      cout<<n<<endl;
      return 0;
    }

Measured memory_bytes: 256
from bisect import bisect_left, bisect_right

n = int(input())
aa = sorted(map(int, input().split()))
bb = map(int, input().split())
cc = sorted(map(int, input().split()))

sum = 0
for b in bb:
  sum += bisect_right(aa, b-0.1) * (n - bisect_left(cc, b+0.1))
print(sum)


Measured memory_bytes: 25652
import itertools
from functools import reduce

N = int(input())
S = [input() for _ in range(N)]

counter = [len(list(filter(lambda s: s[0] == l, S))) for l in 'MARCH']

ans = 0
for pat in itertools.combinations(range(5), 3):
    ans += reduce(lambda a, b: a * b, [counter[p] for p in pat], 1)

print(ans)

Measured memory_bytes: 17356
#include <bits/stdc++.h>
#define uint unsigned long long
#define ll long long
#define db long double
#define ls rt << 1
#define rs rt << 1 | 1
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define X first
#define Y second
#define pcc pair<char, char>
#define vi totor<int>
#define vl totor<ll>
#define rep(i, x, y) for(register int i = x; i <= y; i ++)
#define rrep(i, x, y) for(register int i = x; i >= y; i --)
#define eps 1e-15
#define lb(x) x & -x
#define sz(x) (x).size()
using namespace std;
inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
	return x * f;
}
inline ll read1()
{
	ll x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
	return x * f;
}
int a[4], ans;
int main()
{
	rep(i, 1, 3) cin >> a[i];
	sort(a + 1, a + 4);
	if(a[2] < a[3]) ans = a[3] - a[2], a[1] += ans, a[2] += ans;
	while(a[1] < a[2]) ans ++, a[1] += 2;
	if(a[1] != a[2]) ans ++;
	cout << ans;
	return 0;
}


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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
// #define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    int n; cin >> n;
    vec a(n);
    rep(i, n) cin >> a[i];
    auto b = a;
    sort(all(b));
    int cnt = 0;
    rep(i, n){
        if(a[i] != b[i]) cnt++;
    }
    if(cnt <= 2) cout << "YES" << endl;
    else cout << "NO" << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 7716
#include <iostream>
using namespace std;
typedef long long ll;
ll K, S;

ll solve() {
  ll x, y, z, res = 0;
  for(x = 0; x <= K; x++) {
    for(y = 0; y <= K; y++) {
      if(S - x - y <= K && S - x - y >= 0) res++;
    }
  }
  return res;
}

int main() {
  cin >> K >> S;
  cout << solve() << endl;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define RFOR(i,a,b) for(int i=(b-1); i>=(a); i--)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define pb push_back
using ll = long long;
using D = double;
using LD = long double;
using P = pair<int, int>;
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(){
    int n,x,y; cin >> n >> x >> y; x--; y--;
    vector<int> ans(n);
    vector<vector<int>> g(n);
    rep(i,n-1) {
        g[i].pb(i+1);
        g[i+1].pb(i);
    }
    g[x].pb(y); g[y].pb(x);
    rep(i,n-1){
        vector<int> dist(n, -1);
        queue<int> q;
        q.push(i);
        dist[i] = 0;
        while(!q.empty()){
            int v = q.front(); q.pop();
            for(int u : g[v]){
                if(u == v) continue;
                if(dist[u] == -1) {
                    dist[u] = dist[v] + 1;
                    q.push(u);
                }
            }
        }
        FOR(j, i+1, n) ans[dist[j]]++;
    }
    FOR(i,1,n){
        cout << ans[i] << endl;
    }
}


Measured memory_bytes: 384
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()

nn = n%10

if nn == 3:
  print('bon')
elif nn == 0 or nn== 1 or nn==6 or nn==8:
  print('pon')
else:
  print('hon')


Measured memory_bytes: 9124