akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<memory.h>
using namespace std;
/*
bool insertSort(char R[36][3], int N)
{
	bool isStable = true;
	for (int i = 1; i < N; i++)
	{
		char v[3];
		memcpy(v, &R[i][0], sizeof(v));
		
		int j = i - 1;
		while ((j >= 0) && (R[j][1] > v[1]))
		{
			memcpy(R[j + 1], R[j], sizeof(R[0]));
			j--;
		}
		memcpy(R[j + 1], v, sizeof(v));
		if (R[j + 2][1] == v[1])
		{
			isStable = false;
		}
	}
	return isStable;
}
*/
bool bubbleSort(char R[36][3], int N)
{
	bool isStable = true;

	for (int i = 0; i < (N - 1); i++)
	{
		for (int j = N - 1; j > i; j--)
		{
			if (R[j - 1][1] > R[j][1])
			{
				char temp[3];
				memcpy(temp, R[j], sizeof(temp));
				memcpy(R[j], R[j - 1], sizeof(R[0]));
				memcpy(R[j - 1], temp, sizeof(R[0]));
			}
		}
	}
	return isStable;
}

bool selectionSort(char R[36][3], int N)
{
	bool isStable = true;

	for (int i = 0; i < N - 1; i++)
	{
		int minPos = i;
		for (int j = i + 1; j < N; j++)
		{
			if (R[minPos][1] > R[j][1])
			{
				minPos = j;
			}
		}
		if (i != minPos) {
			swap(R[i], R[minPos]);
		}
	}
	return isStable;
}

void traceData(char R[36][3], int N, bool isStable)
{
	for (int i = 0; i < N - 1; i++)
	{
		cout << R[i] << " ";
	}
	cout << R[N - 1] << endl;
	if (isStable)
	{
		cout << "Stable" << endl;
	}
	else
	{
		cout << "Not stable" << endl;
	}
}

int main()
{
	char CARD1[36][3];
	char CARD2[36][3];
	int N;
	bool isStable;

	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> CARD1[i];
	}
	memcpy(CARD2, CARD1, sizeof(CARD2));

	isStable = bubbleSort(CARD2, N);
	traceData(CARD2, N, isStable);

	isStable = selectionSort(CARD1, N);
	for (int i = 0; i < N; i++)
	{
		if (strcmp(CARD1[i], CARD2[i]) != 0) isStable = false;
	}
	traceData(CARD1, N, isStable);

	return 0;
}

Measured memory_bytes: 3064
/* ----------------------- reclone_rk --------------------------------------------*/ 
#include<bits/stdc++.h>
using namespace std;
#define int long long int
const int mod=1e9+7;

#define FastRead ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define prq priority_queue<int>
#define prqp priority_queue<pair<int,int>>
#define vtr vector<int>
#define INF INT_MAX
#define NINF INT_MIN
#define endl "\n"
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define pvtr vector<pair<int,int>>
#define FOR(i,a,n) for (int i=(a);i<=(n);++i)

int gcd(int a, int b){ if(a == 0) return b; return gcd(b%a, a);}
int MOD(int n){ return ((n%mod)+mod)%mod;}
int power(int a,int b){ if(b==0)return 1LL;int s=power(a,b/2LL);s*=s;s%=mod;if(b&1LL)return (s*a)%mod;return s;}
int inv(int a){return power(a,mod-2);}
int nCr(int n,int r){if(r>n)return 0LL;if(n-r<r)r=n-r;int ans=1;for(int i=0;i<r;i++){ans*=(n-i);ans=MOD(ans);ans*=inv(i+1);ans=MOD(ans);}return ans;}

const double pi = 3.14159265358979323846;
signed main()
{   
   int n, k, x, y;
   cin>>n>>k>>x>>y;
   if(n<=k)
   {
      cout<<(n*x)<<endl;
   }
   else
      cout<<(k*x + (n-k)*y)<<endl;
	return 0;
}

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

bool isPrime(int num){
  if(num < 2) return false;
  else if(num == 2) return true;
  else if(num % 2 == 0) return false;

  for(int i = 3; i*i < num; i+=2){
    if (num % i == 0) return false;
  }

  return true;
}

int main(){
  int n;
  cin >> n;
  vector<int> a(1000010);
  for(int i = 0; i < n; i++){
    int x;
    cin >> x;
    a.at(x)++;
  }
  
  set<int> ans;
  for(int i = 0; i < 1000010; i++){
    if(a.at(i) == 0) continue;
    bool ok = true;
    if(a.at(i) > 1) ok = false;
    else{
      if(i != 1 && a.at(1) > 0) ok = false;
      for(int j = 2; j * j <= i; j++){
        if(i % j) continue;
        if(a.at(j) > 0 || a.at(i/j) > 0){
          ok = false;
          break;
        }
      }
    }
    if(ok) ans.insert(i);
  }
  
  cout << ans.size() << endl;
}


Measured memory_bytes: 16392
with Ada.Text_IO, Ada.Integer_Text_IO, Ada.Float_Text_IO;
 use Ada.Text_IO, Ada.Integer_Text_IO, Ada.Float_Text_IO;

procedure main is
   H: Integer;
   A: Integer;
begin
   get(H);
   get(A);
   put((H + A - 1) / A, 0);
end main;

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define inf 1000000000000000
#define bpc(x) __builtin_popcountll(x)
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define rep(n) for(ll i = 0; i < n; i++)
#define repi(i,n) for(ll i = 0; i < n; i++)

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 

using namespace std;

ll powa(ll a, ll b, ll c)
{
    a%=c;
    if(a<0)
	a+=c;
    ll res = 1;
    while(b>0)
    {
        if(b&1)
            res*=a, res%=c;
        a*=a, a%=c;
        b>>=1;
    }
    return res;
}
 
#define N 200005
 
ll fact[N];
ll ifact[N];
 ll n;
ll ncr(ll n, ll r)
{
    if(r>n)
        return 0;
    ll ans = fact[n];
    ans*=ifact[r];
    ans%=mod;
    ans*=ifact[n-r];
    ans%=mod;
    return ans;
}

ll siz[N];
ll ans[N];
void dfs(ll curr, ll par, vector<ll> v[])
{
    siz[curr] = 1;
    ans[curr] = 1;
    autoit(v[curr],it)
    {
        if(*it == par)
            continue;
        dfs(*it,curr,v);
        siz[curr]+=siz[*it];
    }
    ll tot = siz[curr] - 1;
    autoit(v[curr],it)
    {
        if(*it == par)
            continue;
        //dfs(*it,curr,v);
        //siz[curr]+=siz[*it];
        ans[curr]*=(ncr(tot,siz[*it])*ans[*it])%mod;
        ans[curr]%=mod;
        tot-=siz[*it];
    }
}

void dfs1(ll curr, ll par, vector<ll> v[])
{
    if(par!=-1)
    {
        ll temp = ans[curr];
        ll temp1 = (((ans[par]*(fact[siz[par]-siz[curr]-1]))%mod) * fact[siz[curr]])%mod;
        temp1*=(powa(ans[curr],mod-2,mod));
        temp1%=mod;
        ans[curr]*=temp1;
        ans[curr]%=mod;
        ans[curr]*=ifact[siz[curr]-1];
        ans[curr]%=mod;
        ans[curr]*=ifact[n-siz[curr]];
        ans[curr]%=mod;
        siz[curr] = n;
    }
    
    autoit(v[curr],it)
    {
        if(*it == par)
            continue;
        dfs1(*it,curr,v);    
    }
}

int main()
{
   FAST/**/
   
   fact[0] = 1;
   for(ll i=1;i<N;i++)
        fact[i] = fact[i-1]*i, fact[i]%=mod;
   for(ll i=0;i<N;i++)
        ifact[i] = powa(fact[i],mod-2,mod);
   
   
   cin>>n;
   
   vector<ll> v[n];
   rep(n-1)
   {
       ll a,b;
       cin>>a>>b;
       a--,b--;
       v[a].pb(b);
       v[b].pb(a);
   }
   dfs(0,-1,v);
   dfs1(0,-1,v);
   rep(n)
        cout<<ans[i]<<"\n";
        
               
   return 0;        
}  
   

Measured memory_bytes: 20976
M = 1046527

def charToKey(a):
    if a == "A":
        return 1
    elif a == "C":
        return 2
    elif a == "G":
        return 3
    elif a == "T":
        return 4
    else:
        return 0

def strToKey(s):
    sum = 0
    coef = 1
    for c in s:
        key = charToKey(c)
        sum += coef * key
        coef *= 5
    return sum

def hash1(key):
    return key % M

def hash2(key):
    return 1 + (key % (M - 1))

def insert(A, value):
    key = strToKey(value)
    for i in range(M):
        hash = (hash1(key) + i * hash2(key)) % M
        if A[hash] == value:
            return
        elif A[hash] is None:
            A[hash] = value
            return
    return

def find(A, value):
    key = strToKey(value)
    for i in range(M):
        hash = (hash1(key) + i * hash2(key)) % M
        if A[hash] == value:
            return True
        elif A[hash] is None:
            return False
    return False

if __name__ == "__main__":
    A = [None for i in range(M)]

    N = int(input())
    for i in range(N):
        command, value = input().split()
        if command == "insert":
            insert(A, value)
        else:
            if (find(A, value)):
                print("yes")
            else:
                print("no")



Measured memory_bytes: 31056
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
const int LIMIT = 1e9 + 7;
#define rep(i, n) for(int i=0; i<(int)n; i++)
#define all(v) (v).begin(), (v).end()

namespace /* debug */{
  #define DEBUG(...) do{cout<<#__VA_ARGS__<<" = ";debug(__VA_ARGS__);}while(0) //変数
  #define ldebug(...) do{cout<<"["<<setw(3)<<__LINE__<<"] ";debug(__VA_ARGS__);}while(0) //行数
  #define lDEBUG(...) do{cout<<"["<<setw(3)<<__LINE__<<"] "<<#__VA_ARGS__<<" = ";debug(__VA_ARGS__);}while(0) //変数, 行数
  template<class T>void show(T&x){cout<<x<<" ";} //出力
  template<class T>void showendl(T&x){cout<<x<<endl;} //出力改行
  template<class P,class Q>void show(pair<P,Q>&x){cout<<"("<<x.first<<", "<<x.second<<") ";} //pair出力
  template<class P,class Q>void showendl(pair<P,Q>&x){cout<<"("<<x.first<<", "<<x.second<<")"<<endl;} //pair出力改行
  template<class H>void debug(H&&h){showendl(h);} //引数1つ
  template<class H,class...Ts>void debug(H&&h,Ts&&...ts){show(h);debug(forward<Ts>(ts)...);} //可変引数
  template<class T>void debug(vector<T>&vt){int i=0;for(auto x:vt)++i!=vt.size()?show(x):showendl(x);} //vector出力
  template<class T>void debug(initializer_list<T>init){int i=0;for(auto x:init)++i!=init.size()?show(x):showendl(x);} //初期化子リスト出力
}

int main(){
	int N;cin>>N;
  vi L(N);
  rep(i,N)cin>>L[i];

  int ans = 0;
  for(int i=0; i<N; i++){
    for(int j=i+1; j<N; j++){
      for(int k=j+1; k<N; k++){
        int a = L[i], b = L[j], c = L[k];
        if(
          a==b || b==c || c==a
        )continue;
        if(
          a+b>c &&
          b+c>a &&
          c+a>b
        )ans++;
      }
    }
  }

  cout<<ans<<endl;
}

Measured memory_bytes: 3604
#include<iostream>
#include<cstring>
#include<queue>
#include<algorithm>
using namespace std;

int x[5001][3];
int z[25000][2];

queue<int>Q1;
queue<int>R1;
queue<int>S1;
queue<int>Q2;
queue<int>R2;
queue<int>S2;

int main() {
	int n, m, a, b, c, k, p, sum, sum2, sum3, t;
	while (true) {
		cin >> n;
		if (n == 0) {
			break;
		}
		cin >> m >> a >> b >> c;
		z[0][0] = 1;
		z[0][1] = n;

		k = 1;
		for (int i = 1; i <= m; i++) {
			cin >> x[i][1] >> x[i][2];
			sum2 = 1;
			sum3 = 1;
			for (int j = 0; j < k; j++) {
				sum2 += z[j][1] - z[j][0] + 1;
				sum2 -= 1;
				if (sum2 <= x[i][1]) {
					Q1.push(z[j][0]);
					Q2.push(z[j][1]);
				}
				else if (sum3 > x[i][2]) {
					S1.push(z[j][0]);
					S2.push(z[j][1]);
				}
				else if (sum2 <= x[i][2] && sum3 > x[i][1]) {
					R1.push(z[j][0]);
					R2.push(z[j][1]);
				}
				else if (sum2 <= x[i][2] && sum3 <= x[i][1]) {
					Q1.push(z[j][0]);
					Q2.push(z[j][0] + x[i][1] - sum3);
					R1.push(z[j][0] + x[i][1] - sum3 + 1);
					R2.push(z[j][1]);
				}
				else if (sum2 > x[i][2] && sum3 > x[i][1]) {
					R1.push(z[j][0]);
					R2.push(z[j][0] + x[i][2] - sum3);
					S1.push(z[j][0] + x[i][2] - sum3 + 1);
					S2.push(z[j][1]);
				}
				else {
					Q1.push(z[j][0]);
					Q2.push(z[j][0] + x[i][1] - sum3);
					R1.push(z[j][0] + x[i][1] - sum3 + 1);
					R2.push(z[j][0] + x[i][2] - sum3);
					S1.push(z[j][0] + x[i][2] - sum3 + 1);
					S2.push(z[j][1]);
				}
				sum2 += 1;
				sum3 = sum2;
			}
			k = 0;
			k += Q1.size();
			k += R1.size();
			k += S1.size();
			p = 0;

			while (!S1.empty()) {
				z[p][0] = S1.front();
				z[p][1] = S2.front();
				S1.pop();
				S2.pop();
				p++;
			}
			while (!R1.empty()) {
				z[p][0] = R1.front();
				z[p][1] = R2.front();
				R1.pop();
				R2.pop();
				p++;
			}
			while (!Q1.empty()) {
				z[p][0] = Q1.front();
				z[p][1] = Q2.front();
				Q1.pop();
				Q2.pop();
				p++;
			}
		}
		sum = 0;
		sum2 = 1;
		sum3 = 1;
		for (int i = 0; i < k; i++) {
			sum2 += z[i][1] - z[i][0] + 1;
			if (sum2 - 1 >= a && sum3 <= b) {
				if (z[i][1] <= c) {
					sum += min(b, sum2 - 1) - max(a, sum3) + 1;
				}
				else if (z[i][0] <= c) {
					t = min(b, sum2 - 1);
					t = min(t, sum3 + c - z[i][0]);
					if (t - max(a, sum3) >= 0) {
						sum += t - max(a, sum3) + 1;
					}
				}
			}
			sum3 = sum2;
		}
		cout << sum << endl;
	}
	return 0;
}

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

#define ll long long;
mt19937 mrand(random_device{}());
int rnd(int x) { return mrand() % x; }

struct fast_ios {
  fast_ios() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
  };
} fast_ios_;

int main() {
  int N;
  cin >> N;
  cout << (1000 - N % 1000) % 1000 << "\n";
}



Measured memory_bytes: 3636
import java.util.*;

public class Main {
    public static void main(String[] args) {

        solve_152_D();

        return;
    }

    private static void solve_152_D() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int matrix[][] = new int[10][10];
        int count = 0;

        for(int i=0; i<10; i++)
            for(int j=0; j<10; j++)
                matrix[i][j] = 0;


        for(int i=1; i<=N; i++){
            int left = mostleft(i);
            int right = i%10;
            matrix[left][right]++;
        }

        for(int i=1; i<=N; i++){
            int left = mostleft(i);
            int right = i%10;
            count += matrix[right][left];
        }

        System.out.println(count);
    }

    private static int mostleft(int x){
        int a = x;
        while( x>0 ){
            a = x;
            x = x/10;
        }
        return a;
    }
}

Measured memory_bytes: 25172
#include <bits/stdc++.h>
#include<list>
#include<algorithm>
#define ll long long int
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define rep(a,b,c) for(a=b;a<c;a++)
#define repj(a,b,c) for(a=b;a<c;a++)
#define repr for(i=n-1;i>=0;i--)
#define pii pair<ll,ll>
#define pll pair<ll, ll>
#define inf 100000001
const double pie  =3.141592653589793238463;
#define mod 1000000007
#define lb lower_bound
#define up upper_bound
#define rep1 for(i=1;i<=n;i++)
#define vr vector
#define ef else if
#define all(x) (x).begin(), (x).end()
#define SORT(A) sort(A.begin(), A.end());
#define REVERSE(A) reverse(A.begin(), A.end());
#define lenth length()
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll myXOR(unsigned long long int x, unsigned long long int y)
{
    return (x|y)&(~x|~y);   
}
ll powerLL(ll x, ll n) 
{ 
    ll result = 1; 
    while (n) { 
        if (n & 1) 
            result = result * x % mod; 
        n = n / 2; 
        x = x * x % mod; 
    }
    return result; 
}
int main()
{
    fastio
    ll t,n,m,i,j,k,l,x,y,z,a,b,c,d,e,p,nl,np,q,r,s;
    string str,str1;
    cin>>n;
    float ans=2*pie*n;
    printf("%0.12f",ans);
    cout<<endl;


}

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

using namespace std;

typedef long long LL;

const int N = 1010;


int main()
{
    string a, b;
    cin >> a >> b;
    for(int i = 0; i < a.size(); i++)
    {
        cout << a[i];
        if(i < b.size()) cout << b[i];
    }

    puts("");

    return 0;
}


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

typedef long long ll;
typedef long double ld;
#define pi 3.14159265359
#define inf (1 << 21)
#define mod 1000000007

int main() {
    int N, Q; cin >> N >> Q;
    string S; cin >> S;
    vector<int> cnt(N); //i文字目までにACが何回登場したかを記録する配列
    for (int i = 1; i < N; i++) {
        cnt.at(i) = cnt.at(i - 1);
        if (S.at(i) == 'C' && S.at(i - 1) == 'A') {
            cnt.at(i)++;
        }
    }
    for (int i = 0; i < Q; i++) {
        int l, r; cin >> l >> r;
        cout << cnt.at(r - 1) - cnt.at(l - 1) << endl;
    }
    return 0;
}


Measured memory_bytes: 1408
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		if (a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0) {
			System.out.println("Possible");
		} else {
			System.out.println("Impossible");
		}
	}
}


Measured memory_bytes: 21716
#include <cstdio>
#include <algorithm>
using namespace std;
#define ll long long
int main(){
	ll k, n;
	scanf("%lld %lld", &k, &n);
	ll a[n], ma = -1;
	for (int i = 0; i < n; i++){
		scanf("%lld", &a[i]);
		if (i > 0) ma = max(ma, a[i] - a[i - 1]);
	}
	ma = max(ma, a[0] + k - a[n - 1]);
	printf("%lld\n", k - ma);
}

Measured memory_bytes: 1664
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <utility>
#include <tuple>
#include <cctype>
using namespace std;
#define INF 0x3f3f3f3f
//#define INF 1100000000000000000LL
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pint;
typedef tuple<int,int,int> tint;
typedef vector<int> vint;
typedef vector<ll> vll;
int dx[8]={0,0,-1,1,1,1,-1,-1};
int dy[8]={-1,1,0,0,1,-1,1,-1};
const int SIZE=5050;
//ここまでテンプレ
int main() {
	int N,K;
	cin>>N>>K;
	vint a;
	for(int i=0;i<N;i++){
		int c;
		cin>>c;
		a.pb(c);
	}
	sort(a.begin(),a.end());
	int noNeed=-1,Need=N;
	while(Need-noNeed>1){
		int Now=(Need+noNeed)/2;
		bool DP[SIZE][SIZE]={};
		DP[0][0]=1;
		for(int i=0;i<N;i++){
			for(int j=0;j<=K;j++){
				if(DP[i][j]){
					DP[i+1][j]=1;
					if(j+a[i]<=K && Now!=i)
						DP[i+1][j+a[i]]=1;
				}
			}
			/*
			cout<<Now<<" "<<i+1<<endl;
			for(int j=0;j<=K;j++)
				cout<<DP[i+1][j]<<" ";
			cout<<endl;
			*/
		}
		bool flag=0;
		for(int i=max(K-a[Now],0);i<K;i++){
			if(DP[N][i])
				flag=1;
		}
		if(flag)
			Need=Now;
		else
			noNeed=Now;
		//cout<<noNeed<<" "<<Need<<endl;
	}
	cout<<noNeed+1<<endl;
    return 0;
}

Measured memory_bytes: 25216
#include <iostream>
//#include <iomanip>
//#include <string>
//#include <vector>
#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
//#include <queue>
//#include <deque>
//#include <bitset>
//#include <math.h>
using namespace std ;
using ll = long long ;
//using ld = long double ;
//using vll = vector<ll> ;
//using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
//using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;
//#define all(v) v.begin(),v.end()
//ll mod = 1000000007 ;
//long double pie = acos(-1) ;
//ll INF = 1000000000000 ;

//void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
//void fix_cout(){cout << fixed << setprecision(20) ;}

int main(){
	ll a,b,c ;
	cin >> a >> b >> c ;
	cout << min(b/a,c)  << endl ;
}

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

const int N=55;

char s[N];
int n,k;

int main()
{
	scanf("%d%d",&n,&k);
	scanf("%s",s+1);
	for(int i=1;i<=n;i++)
		if(i==k)printf("%c",s[i]-'A'+'a');
		else printf("%c",s[i]);
	printf("\n");
	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
   int N;
   cin >> N;
    
   int h[20] = {0};
   for (int i = 0; i < N; ++i)
       cin >> h[i];
   int total = 1;
   for (int i = 1; i < N; ++i)
   {
       bool flag = true;
       for (int j = i; j > 0; --j)
           if (h[i] < h[j-1])
           {
               flag = false;
               break;
           }
       if (flag)
           total++;
   }

   cout << total << endl;
   return 0;
}


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

int main(){
	string s;
	cin >> s;
	if(s.compare("Sunny")==0)
		cout << "Cloudy";
	if(s.compare("Cloudy")==0)
		cout << "Rainy";
	if(s.compare("Rainy")==0)
		cout << "Sunny";
			
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
 
 
 string S;
 int ans=0;
 
 
 int main () {
      cin >> S ;
      int ans = 0;
      for(int i=0;i<S.size();i++){
           if(S[i]== 'o')ans++;
      }
 
      string judge;
 
      if(ans >= 8 || (8-ans) <= (15-S.size()))judge="YES";
      else judge="NO";
      
      cout << judge <<endl;
 
 }

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

using namespace std;
using ll = int;
ll n,t[400010],mx = 10000000;
void built(){
	for(int i = n-1;i>0;i--){
		t[i] = min(t[i<<1],t[i<<1|1]);
	}
}

ll query(int l, int r){
	ll mn = mx;
	for(l += n, r += n; l<r; l >>= 1,r >>= 1){
		if(l&1) mn = min(mn,t[l++]);
		if(r&1) mn = min(mn,t[--r]);
	}
	return mn;
}

ll s[400010];
void built2(){
	for(int i = n-1;i>0;i--){
		s[i] = max(s[i<<1],s[i<<1|1]);
	}
}

ll query2(int l, int r){
	ll mn = 0;
	for(l += n, r += n; l<r; l >>= 1,r >>= 1){
		if(l&1) mn = max(mn,s[l++]);
		if(r&1) mn = max(mn,s[--r]);
	}
	return mn;
}
int a[200010],dp[200010] = {};
int main(){
	int i,k;
	cin >> n >> k;
	for(i=0;i<n;i++){
		cin >> a[i];
		t[i + n] = a[i];
		s[i + n] = a[i];
	}
	built(); built2();
	dp[0] = 1;
	for(i=1;i<n;i++){
		if(a[i]>a[i - 1]){
			dp[i] = dp[i - 1] + 1;
		}else{
			dp[i] = 1;
		}
	}
	/*for(i=0;i<n;i++){
		cout << dp[i] << " ";
	}
	cout << endl;*/
	int ans = 0,j = -1;
	for(i=k - 1;i<n;i++){
		if(dp[i]>=k) continue;
		if(j<i - k + 1){
			ans++;
			j = i;
		}else{
			int mn = query(i - k + 1,j + 1),mx = query2(i - k + 1,j + 1);
			int lmx = query2(j - k + 1,i - k + 1),rmn = query(j + 1,i + 1);
			//cout << i << " " << j << " " << mn << " " << mx << " " << lmx << " " << rmn << endl;
			if(dp[i - k]>=i - j && dp[i]>=i - j && lmx<mn && mx<rmn) continue;
			//cout << i << endl;
			ans++; j = i;
		}
	}
	for(i=0;i<n;i++){
		if(dp[i]>=k){
			ans++;
			break;
		}
	}
	//cout << endl;
	cout << ans << endl;
	/*cout << endl;
	int ans2 = 0,b[100];
	vector<int> v;
	for(i=k - 1;i<n;i++){
		for(j=i - k + 1;j<=i;j++){
			v.push_back(a[j]);
		}
		sort(v.begin(),v.end());
		for(j=0;j<=i - k;j++){
			cout << a[j] << " ";
		}
		for(j=0;j<k;j++){
			cout << v[j] << " ";
		}
		for(j=i + 1;j<n;j++){
			cout << a[j] << " ";
		}
		cout << endl;
		v.clear();
	}*/
}

Measured memory_bytes: 4992
k,s=map(int,input().split())

#xはmax(0,s-2*k)からmin(s,k)までの値をとる　min(s,k)+1-max(0,s-2*k)通り
#xを決めた時、yはmax(0,s-(x+k)からmin(s-x,k)までの値をとる　min(s-x,k)+1-max(0,s-(x+k))通り
#x,yを決めた時、zは一意　1通り


l=[]
for i in range(max(0,s-2*k),min(s,k)+1):
    l.append(min(s-i,k)+1-max(0,s-(i+k)))
    
print(sum(l))

Measured memory_bytes: 3060
#include <iostream>
#include<cmath>
#include<stack>
#include<algorithm>
using namespace std;

void arraycout(int *arrayy,int n){
    for(int u=0;u<n;u++){//出力
        if(u==n-1){
            cout<<arrayy[u]<<endl;
        }else{
            cout<<arrayy[u]<<' ';
        }
    }
    
}
void insertionSort(int* A,int n){
    for(int i=0;i<n;i++){
        
        int v=A[i];
        int j=i-1;
        while(j>=0&&A[j]>v){
            swap(A[j+1],A[j]);
            j--;
        }
        A[j+1]=v;
        arraycout(A,n);
    }
    
}
int main(){

    int n;
    cin>>n;
    int sou[n];
    for(int i=0;i<n;i++){
        cin>>sou[i];
    }
    insertionSort(sou,n);
    
    
    return 0;
}



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

long sum(int a,int b,int c) {
  return a*10+b*5+c;
}
int main() {
  int n;cin>>n;
  long y;cin>>y;
  y /= 1000;
  int k;
  rep(i,n+1)rep(j,n+1) {
    k = n-i-j;
    if (k<0) continue;
    if (y == sum(i,j,k)) {
      cout<<i<<" "<<j<<" "<<k<<endl;
      return 0;
    }
  }
  cout << "-1 -1 -1";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int n,m;
    
    
    cin>>n>>m;
    
    vector<int> fo(m);
    
    for(int i=0;i<n;i++){
        int ct;
        cin>>ct;
        for(int j=0;j<ct;j++){
            int num;
            cin>>num;
            fo[num-1]++;
        }
    }
    
    int cot=0;
    for(int i=0;i<m;i++){
        if(fo[i]==n) cot++; 
    }
    
    cout<<cot<<endl;
    return 0;
}


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

using namespace std;
using ll=long long;
using vi=vector<int>;
using vl=vector<ll>;
using vs=vector<string>;

#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define repr(i, a, n) for (int i = (n); i >= (a); --i)

template<typename T,typename U>
void Inparray(T &f,U n){
  for(int i=0;i<n;i++) cin>>f[i];
}

template<typename T,typename U>
void Printarray(T f,U n){
  for(int i=0;i<n;i++) i!=n ? cout<<f[i]<<" " : cout<<f[i];
}

void flagfunc(bool flag,string A,string B){
  flag ? cout<<A<<endl : cout<<B<<endl;
}

void flag2func(bool flag){
  flag ? cout<<"Yes"<<endl : cout<<"No"<<endl;
}

void flag3func(bool flag){
  flag ? cout<<"YES"<<endl : cout<<"NO"<<endl;
}

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  string a,b;cin>>a>>b;
  rep(i,0,a.size()+b.size()){
    //cout<<i<<" "<<i-(i+1)/2<<endl;
  	i%2==0 ? cout<<a[i-(i+1)/2] : cout<<b[i-(i+1)/2];
  }
  cout<<endl;
}

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

int main(){
    int n;
    cin >> n;
    vi p(n);
    rep(i, n) cin >> p[i];

    int cnt = 1;
    int min_p = p[0];
    repa(i, 1, n){
        if(min_p > p[i]) cnt++;
        min_p = min(min_p, p[i]);
    }

    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 4016
#include <cstdio>
#include <deque>
#include <iostream>

using namespace std;

int main() {

	int num, c=0;
	double w, h;
	deque<int> x;

	while(scanf("%d, %lf, %lf", &num, &w, &h)!=EOF)  {
		if(w/(h*h)>=25) {
			x.push_back(num);
			c++;
		}
	}

	if(c) {
		while(c!=0) {
			cout << x[x.size()-c] << endl;
			c--;
		}
	}
	else
		cout << "ツ該ツ督鳴づ按つオ" << endl;

	return 0;

}

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

int N, K;

int main(){
    cin >> N >> K;

    long double ans = 0.0;
    for(int i=0;i<N;i++){
        int64_t j = i+1;
        long double res = 1.0;
        while( j < K ){
            j *= 2;
            res *= 1.0/2.0;
        }
        ans += res;
    }

    cout << setprecision(15) << ans / N << endl;
}

Measured memory_bytes: 256
fun main(args: Array<String>){
    val (n,x) = readLine()!!.split(" ").map(String::toInt)
    val list = readLine()!!.split(" ").map(String::toInt)

    var sum = 0
    var count = 0

    if(list[0] > x){
        println(1)
        return
    }

    for(i in 0..list.size-1){
        if(sum <= x){
            sum += list[i]
            count++
        }
        else{
            break
        }
    }

    if(sum <= x){
        count++
    }

    println(count)

}

Measured memory_bytes: 37688
#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>;
// #define chmax(x,y) x = max(x,y)
// #define chmin(x,y) x = min(x,y)


template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

vector<vector<int> > calcNext(const string &S) {
    int n = (int)S.size();
    vector<vector<int> > res(n+2, vector<int>(26, n+1));
    for (int i = n-1; i >= 0; --i) {
        for (int j = 0; j < 26; ++j) res[i][j] = res[i+1][j];
        res[i][S[i]-'a'] = i;
    }
    return res;
}

int main() {
    string S;
    cin >> S;
    int n = (int)S.size();
    auto next = calcNext(S);

    vector<int> dp(n+1, 1<<29);
    vector<char> recon(n+1, 'a'); 
    dp[n] = 1;
    for (int i = n - 1; i >= 0; --i) {
        for (int j = 0; j < 26; ++j) {
            if (next[i][j] == n+1) {
                if (dp[i] > 1) {
                    dp[i] = 1;
                    recon[i] = 'a'+j;
                }
            }
            else if (chmin(dp[i], dp[next[i][j] + 1] + 1)) {
                recon[i] = 'a'+j;
            }
        }
    }

    string res = "";
    int index = 0;
    while (index <= n) {
        res += recon[index];
        index = next[index][recon[index]-'a'] + 1;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 31088
class Dice():

    def __init__(self, d):
        self.d = d
        self.north = [2, 6, 3, 4, 1, 5]
        self.south = [5, 1, 3, 4, 6, 2]
        self.east = [4, 2, 1, 6, 5, 3]
        self.west = [3, 2, 6, 1, 5, 4]

    def roll(self, direction):
        if direction == 'S':
            self.d = [ self.d[self.south[i]-1] for i in range(6) ]
        elif direction == 'N':
            self.d = [ self.d[self.north[i]-1] for i in range(6) ]
        elif direction == 'E':
            self.d = [ self.d[self.east[i]-1] for i in range(6) ]
        elif direction == 'W':
            self.d = [ self.d[self.west[i]-1] for i in range(6) ]

    def getDice(self):
        return self.d


s = [ int(s) for s in input().split() ]
command = input().strip()

dice = Dice(s)
for c in command:
    dice.roll(c)

r = dice.getDice()
print(r[0])



Measured memory_bytes: 5612
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
using i64 = int64_t;

__attribute__((constructor)) static void init()
{
    ios::sync_with_stdio(false);
    std::cin.tie(0);
}

int main()
{
    int k, a, b;
    cin >> k >> a >> b;

    for (int i = a; i <= b; i++) {
        if (i % k == 0) {
            cout << "OK"
                 << "\n";
            return 0;
        }
    }

    cout << "NG"
         << "\n";
}


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

#define ff              first
#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 vvi             vector<vi>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define mod             1000000007
#define inf             1e18
#define deb(x)          cout << #x << "=" << x << '\n';
#define ps(x,y)         fixed<<setprecision(y)<<x
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

void solve() {

    int n;
    cin >> n;
    vvi a(n, vi(3));
    for(int i = 0; i<n; i++){
        cin >> a[i][0] >> a[i][1] >> a[i][2];
    }

    vvi dp(n, vi(3));

    dp[0][0] = a[0][0];
    dp[0][1] = a[0][1];
    dp[0][2] = a[0][2];

    for(int i = 1; i<n; i++) {
        for(int j = 0; j < 3; j++) {
            dp[i][j] = a[i][j] + max(dp[i - 1][(j + 1) % 3], dp[i - 1][(j + 2) % 3]);
        }
    }

    cout << max(max(dp[n-1][0], dp[n-1][1]), dp[n-1][2]) << '\n';

}

int32_t main() {
    FIO;
    int t = 1;
//    cin >> t;
    while(t--) {
        solve();
    }
    return 0;
}


Measured memory_bytes: 11264
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
int main(){
    int K,A,B;
    cin>>K>>A>>B;
    string ans="NG";
    for(int i=A;i<=B;i++){
        if(i%K==0)ans="OK";
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3616
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define ALL(obj) (obj).begin(),(obj).end()
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef priority_queue<int> p_que;
typedef priority_queue<int, vector<int>, greater<int>()> p_que_rev;
const int INF = INT_MAX;
const lint LINF = LLONG_MAX;
const int MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    string s;
    cin >> s;
    int len = s.length();
    const string ABC = "ABC";
    lint dp[len+1][4];
    for (int i=0; i<=len; ++i){
        for (int j=0; j<=3; ++j){
            dp[i][j] = 0;
        }
    }
    dp[0][0] = 1;
    int p, q;
    for (int i=0; i<=len; ++i){
        for (int j=0; j<=3; ++j){
            if(i == 0 && j == 0){
                continue;
            }
            else if(i == 0){
                dp[i][j] = 0;
            }
            else if(j == 0){
                if(s[i-1] == '?'){
                    q = 3;
                }
                else {
                    q = 1;
                }
                dp[i][j] = (q * dp[i-1][j]) % MOD;
            }
            else {
                if(s[i-1] == '?'){
                    q = 3;
                }
                else {
                    q = 1;
                }
                if(s[i-1] == ABC[j-1] || s[i-1] == '?'){
                    p = 1;
                }
                else {
                    p = 0;
                }
                dp[i][j] = (p * dp[i-1][j-1]) % MOD + (q * dp[i-1][j]) % MOD;
                dp[i][j] = dp[i][j] % MOD;
            }
        }
    }
    cout << dp[len][3] << endl;
    return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <cmath>
#include <vector>
#include <deque>
#include <algorithm>

using namespace std;

#define INF 1e9
#define MAXN 100005
#define MAXM 100005
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define pii pair<int, int>

ll N;
vi A;
int k;
deque<int> ans;

void solve(){
    ans.push_back(A[0]);

    if(N % 2 == 0){
        for(int i = 1; i < N; ++i){
             if(i % 2 == 1)
                ans.push_front(A[i]);
            else
                ans.push_back(A[i]);
        } 
    } else {
        for(int i = 1; i < N; ++i){
            if(i % 2 == 1)
                ans.push_back(A[i]);
            else
                ans.push_front(A[i]);      
            }
        } 

    k = ans.size();

    rep(i, k){
        cout << ans[i];
        if(i==k-1) cout << endl;
        else cout << " ";
    }
}

int main(){
    cin >> N;
    A.resize(N);

    rep(i, N) cin >> A[i];

    solve();
}


Measured memory_bytes: 3840
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan =  null;
		try{
			scan = new Scanner(System.in);
			int n;
			while((n = scan.nextInt())!=0){
			char[][] set = new char[n][2];
			for(int i = 0; i < set.length;i++){
				for(int j = 0 ;j < set[i].length;j++){
					set[i][j] = scan.next().charAt(0);
				}
			}
			int m = scan.nextInt();
			for(int i = 0 ; i < m;i++){
				char c = scan.next().charAt(0);
				boolean check = false;
				for(int j = 0; j < set.length;j++){
					if(set[j][0] == c){
						check = true;
						System.out.print(set[j][1]);
						break;
					}
				}
				if(!check)System.out.print(c);
			}
			System.out.println();
			}
		}finally{
			if(scan !=null)scan.close();
		}
	}
}

Measured memory_bytes: 69720
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

N = inp()
aa = inpl()
#aa = [a*2 for a in aa]
S = sum(aa)//2

tmp = 0
raa_ev = [0]
for i in range(1,N,2):
    tmp += aa[i]
    raa_ev.append(tmp)

tmp = 0
raa_od = [0]
for i in range(0,N,2):
    tmp += aa[i]
    raa_od.append(tmp)

ans = [0]*N
for i in range(1,N+1):
    tmp = S
    if i%2 == 1:
        tmp -= raa_od[(i-1)//2]
        tmp -= raa_ev[-1] - raa_ev[(i-1)//2]
    else:
        tmp -= raa_ev[i//2-1]
        tmp -= raa_od[-1] - raa_od[i//2]
    ans[i-1] = tmp*2

print(' '.join(map(str,ans)))


Measured memory_bytes: 25248
#include <bits/stdc++.h>
#define pq priority_queue
#define mp make_pair
#define cauto const auto &

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

#define clr(ar, val) memset(ar, val, sizeof(ar))

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 dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

using namespace std;

template <class T = int> T in() {
    T x;
    cin >> x;
    return (x);
}

template <class T> void print(T &x) {
    cout << x << '\n';
    return;
}
typedef long long int64;
typedef long long lint;
typedef long long lli;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pint;
typedef pair<long, long> plong;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<ll, ll> pll;

const int iinf = 1 << 29;
const long long linf = 1ll << 61;

int n;
pii red[103], blue[103];
bool usedred[103], usedblue[103];
int main() {
    cin >> n;
    REP(i, n) { cin >> red[i].first >> red[i].second; }
    REP(i, n) { cin >> blue[i].second >> blue[i].first; }
    sort(red, red + n, greater<pint>());
    sort(blue, blue + n);

    int ans = 0;
    REP(i, n) {
        REP(j, n) {
            if (red[i].first < blue[j].second &&
                red[i].second < blue[j].first && !usedred[i] && !usedblue[j]) {
                ans++;
                usedred[i] = 1;
                usedblue[j] = 1;
                break;
            }
        }
    }
    print(ans);
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int h,a;cin>>h>>a;
	int rem=h%a;
	int ans=h/a;
	if(rem==0){
		cout<<ans;
	}
	else{
		cout<<ans+1;
	}
	return 0;
	

	

}

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    if(n >= 18 || n % 4 == 0 || n % 7 == 0 || n == 11 || n == 15){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

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

int main(){
  int n,t,ma=-1,ans=0,left,right=0,dif;cin>>n>>t;
  vector<int> a(n,0);
  REP(i,n) cin>>a.at(i);

  REP(left,n){
    int mm=0;
    while(right<n&&a.at(left)<=a.at(right)){
      mm=max(mm,a.at(right)-a.at(left));
      ++right;
    }

    if(ma<mm){
      ans=1;
      ma=mm;
    }else if(ma==mm) ans++;

    left=right-1;
  } 
  cout<<ans<<endl;
}

Measured memory_bytes: 640
// abc178_e
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF (ll)(1e9)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
#define print_line(vec, n) {for(int idx=0;idx<(n-1);idx++) cout << (vec)[idx] << " "; cout << (vec)[(n)-1] << endl;}
template<class T> void print(const T& x){cout << x << "\n";}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif

    int N;
    cin >> N;
    vector<P> pos(N);
    REP(i, N) cin >> pos[i].first >> pos[i].second;

    vector<P> cand(4);

    cand[0] = *max_element(ALL(pos), [](P& a, P& b){return a.first + a.second < b.first + b.second;});
    cand[1] = *max_element(ALL(pos), [](P& a, P& b){return a.first + a.second > b.first + b.second;});
    cand[2] = *max_element(ALL(pos), [](P& a, P& b){return a.first - a.second < b.first - b.second;});
    cand[3] = *max_element(ALL(pos), [](P& a, P& b){return a.first - a.second > b.first - b.second;});

    ll ans = 0;
    REP(i, N){
        REP(j, 4){
            ll dist = abs(pos[i].first - cand[j].first) +  abs(pos[i].second - cand[j].second);
            ans = max(ans, dist);
        }
    }
    print(ans);


    return 0;
}


Measured memory_bytes: 6364
#include<bits/stdc++.h>
#define ll long long int
#define M 1000000007
using namespace std;
ll n,t,x;
ll ceil(ll x,ll y){
  return (x%y ? x/y+1 : x/y);
}
int main(){
      ios_base::sync_with_stdio(false); cin.tie(NULL);
      cin>>n>>x>>t;
      cout<<ceil(n,x)*t;     
}

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

#define pb push_back

using namespace std;

typedef long long ll;

ll nc2(ll n){
	if(n<=0)
		return 0;
	return (n*(n-1))/2;
}

int main(){
	ll n;
	vector<int> a, cnt;
	vector<bool> done;
	cin>>n;
	a.assign(n, 0);
	done.assign(n, false);
	cnt.assign(n, 0);
	for(int i=0;i<n;i++){
		cin>>a[i];
		cnt[a[i]]++;
	}
	ll sum = 0;
	for(int i=1;i<=n;i++){
		if(!done[a[i]]){
			done[a[i]] = true;
			sum += nc2(cnt[a[i]]);
		}
	}
	//cout<<sum<<"\n";
	for(int i=0;i<n;i++){
		ll tmp = sum;
		tmp -= nc2(cnt[a[i]]);
		tmp += nc2(cnt[a[i]]-1);
		cout<<tmp<<"\n";
	}
	return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)n; i++)

using namespace std;

int main() {
    int N; cin >> N;
    double sum = 0;
    rep(i, N) {
        string v; cin >> v;
        string t; cin >> t;
        double vd = stod(v);
        if (t.compare("BTC") == 0) {
            sum += 380000.0 * vd; 
        }   
        else {
            sum += vd; 
        }   
    }   
    cout << sum << endl;
}

Measured memory_bytes: 256
using System;

class Program{
	private static void Main()
    {
      string[] str = Console.ReadLine().Split(' ');
      
      long a = (long)int.Parse(str[0]);
      long b = (long)int.Parse(str[1]);
      
      long m = a * b;
      long x = m;
      
      while(x - a > 0)
      {
        x = x - a;
        if(x == (long)(x / b) * b)
          m = x;
      }
      
      Console.WriteLine(m);
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long lli;
typedef pair<lli,lli> ii;
typedef vector<lli> vi;
typedef vector<vector<lli> > vvi;
typedef vector<ii> vii;
 
#define EB emplace_back
#define PB push_back
#define MP make_pair
#define FF first
#define SS second

lli mod = 1e9 +7, inp[3010];
pair<lli, bool> dp[2][3010][3010];
int n;

lli solve(bool op, int l, int r)
{
    if(dp[op][l][r].SS==1)
        return dp[op][l][r].FF;
    dp[op][l][r].SS=1;
    if(l>r)
    	return 0;
    else if(op==0)
        dp[op][l][r].FF = max(inp[l]+solve(1, l+1, r), inp[r]+solve(1, l, r-1));
    else
        dp[op][l][r].FF = min(solve(0, l+1, r)-inp[l], solve(0, l, r-1)-inp[r]);
    return dp[op][l][r].FF;
}

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    cin >> n;
    for(int i=1; i<=n; i++)
        cin >> inp[i];
    cout<<solve(0, 1, n);
}

Measured memory_bytes: 167536
#include <bits/stdc++.h>
#define MOD 1000000007
#define MAX 10005
#define int long long
#define T int t;cin>>t;while(t--)
#define f(i,a,b) for(int i=a;i<b;i++)
#define debug(x) cout<<x = <<x<<n;
#define set_dp(dp) memset(dp,-1,sizeof(dp))
using namespace std;

signed main(){
	ios_base::sync_with_stdio(false);	
	cin.tie(0);
	cout.tie(0);
	string s,t;
	cin >> s >> t;
	int n = s.length();
	vector<vector<int> > map(26);
	f(i,0,n) map[s[i]-'a'].push_back(i);
	f(i,0,n) map[s[i]-'a'].push_back(i+n);
	int ans = 0;
	int i = 0;
	f(j,0,t.length()){
		int c = t[j]-'a';
		if(map[c].size()==0){
			cout<<"-1\n";
			return 0;
		}
		i = *lower_bound(map[c].begin(), map[c].end(),i) + 1;
		if(i>=n){
			i -= n;
			ans += n;
		}
	}
	ans += i;
	cout << ans << "\n";
	return 0;
}



Measured memory_bytes: 2756
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			String str = sc.nextLine();
			if("END OF INPUT".equals(str)) break;
			String[] stra = str.split(" ");
			for(int i = 0 ; i < stra.length ;i++){
				System.out.print(stra[i].length());
			}
			System.out.println();
		}
		sc.close();
	}

}

Measured memory_bytes: 17176
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC150A
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b;
            var word = Console.ReadLine().Split(' ');
            a = int.Parse(word[0]);
            b = int.Parse(word[1]);
            if ((a * 500) < b)

                Console.WriteLine("No");
            else
                Console.WriteLine("Yes");
            Console.ReadKey();
        }
    }
}


Measured memory_bytes: 13140
def main():
    n = int(input())
    inlis = list(map(int, input().split()))

    anslis = []
    for _ in range(n):
        anslis.append("")

    if n % 2 == 0:
        for i in range(n):
            if i < n // 2:
                a = -2 * i + n 
            else:
                a = (i - n //2) * 2 + 1
            anslis[i] = inlis[a-1]
    else:
        for i in range(n):
            if i < n // 2:
                a = -2 * i + n
            elif i == n // 2:
                a = 1
            else:
                a = (i - n//2) * 2
            anslis[i] = inlis[a-1]
    print(*anslis)






if __name__ == "__main__":
    main()

Measured memory_bytes: 111008