akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
#define fast                                                                   \
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
#define ll long long
#define f(i, n) for (int i = 0; i < n; i++)
#define fo(i,a,n) for (i = a; i <= n; i++)
#define F first
#define S second
#define pii pair<int,int>
#define sz size()
#define all(v) v.begin(),v.end()
#define pb push_back
#define pf push_front    
#define PB pop_back
#define pll pair<long long, long long>
#define vi vector<int>
#define vl vector<int>
#define mp make_pair
#define mod 1000000007
typedef unsigned long long ull;
const int N = 200005;
const int MOD = 998244353 ;

int prime[1000000];

void sieve() { 
    prime[0] = prime[1] = 1; 
    for (int i = 2; i < 1000000; i++) { 
        if (prime[i] == 0) { 
            for (int j = i * 2; j < 1000000; j += i) { 
                if (prime[j] == 0) { 
                    prime[j] = i; 
                } 
            } 
            prime[i] = i; 
        } 
    } 
} 
void solve(){
    int x;
    cin>>x;
    sieve();
    for(int i = x; i < 1000000; i++){
        if(prime[i] == i){
            cout<<i;
            return ;
        }
    }
}


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


Measured memory_bytes: 8064
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append((i, n // i))
            if i != n // i:
                divisors.append((n // i, i))

    divisors.sort()
    return divisors


div = make_divisors(int(input()))
ans = 10**12
for a, b in div:
    ans = min(ans, a + b - 2)
print(ans)


Measured memory_bytes: 3704
#include<iostream>
#include <stack>
#include <vector>
#include <cstring>
using namespace std;
int main(){
    char str[20005];
    scanf("%s",str);
    stack<int> s1; // sto#include<iostream>re the index of String
    stack<pair<int, int>> s2; // left endpoint and area of all covering area
    //rintf("%d\n",strlen(str));
    int size = strlen(str);
    int total = 0; // total area;
    for(int i = 0; i<size; i++){// i is index of ele
        //for each ele
        //\ -> push
        if(str[i]=='\\'){
            s1.push(i);
        } else if(str[i]=='/' && s1.size()>0) {// / && (there is \)-> pop
            int j = s1.top();  // \ index
            s1.pop();
            int area = i - j; //cal current area(for each \/)
            total += area; // cal total
            //deal wwith another stack
            while(s2.size()>0 && s2.top().first>j){ // 2>1
                area += s2.top().second; s2.pop();
            }
            s2.push(make_pair(j,area)); // j means 
        }
        
    }
    printf("%d\n",total);
    
    int count = s2.size();
    if(count == 0) printf("%d",count);
    else printf("%d ",count);
    int arr[count+1];
    int i = 0;
    while(!s2.empty()){
        int sec = s2.top().second;
        arr[i++] = sec;
        s2.pop();
        //printf("%d ", sec);
    }//printf("\n");
    //printf("%s", str);
    for( i = count-1; i>=0; i--){\
      if(i!=0) printf("%d ", arr[i]);
      else printf("%d", arr[i]);
    
    }printf("\n");
  //printf("%.6f %.6f\n", M_PI*a*a,M_PI*2.0*a);
  return 0;
}



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

using namespace std;
typedef long long LL;

#define MAXN 2001
#define MOD 1000000007

int N,K,Q;
int A[MAXN];

int main(int argc, char** argv) {
#ifdef OJ	
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif
    std::ios::sync_with_stdio(false);

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


    int ans = 1e9+1;
    for (int i = 0; i < N; i++) {
        int lo = A[i];
        
        vector<int> smallest;
        int l = 0, r;
        while(l < N) {
            while(l < N && A[l] < lo) l++;
            if (l == N) break;

            r = l;
            vector<int> V;
            while(r < N && A[r] >= lo) { 
                V.push_back(A[r]);
                r++;
            }

            sort(V.begin(), V.end());
            for (int k = 0; k < (int)V.size()-K+1; k++) 
                smallest.push_back(V[k]);

            l = r;
        }

        sort(smallest.begin(), smallest.end());

        if (smallest.size() >= Q)
            ans = min(ans, smallest[Q-1] - smallest[0]);
    }

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

Measured memory_bytes: 256
n=input()
if n[-1]=='2'or n[-1]=='4'or n[-1]=='5'or n[-1]=='7'or n[-1]=='9':
    print('hon')
elif n[-1]=='0'or n[-1]=='1' or n[-1]=='6' or n[-1]=='8':
    print('pon')
else:
    print('bon')

Measured memory_bytes: 8988
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n);
	for(auto &x: a){
		cin >> x;
	}
	vector<int> p(n);
	iota(p.begin(), p.end(), 1);
	if(a == p){
		cout << "YES";
		return 0;
	}
	for(int i = 0; i < n; i ++){
		for(int j = i + 1; j < n; j ++){
			swap(a[i], a[j]);
			if(a == p){
				cout << "YES";
				return 0;
			}
			swap(a[i], a[j]);
		}
	}
	cout << "NO";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define mods 1000000009


int main()
{
   // factorila();
    //freopen("amin.txt","w",stdout)
    int n,cn=1,a,b,m,i,j,l,k,k1;
    char st1[190][140],st2[190][140];

     scanf("%d",&n);
     scanf("%d",&m);
     for(i=0;i<n;i++)
     cin>>st1[i];
     for(i=0;i<m;i++)
     cin>>st2[i];
     for(i=0;i<=n-m;i++)
     {
         for(j=0;j<=n-m;j++)
         {
             bool bb=false;
             for(k=0;k<m;k++)
             {
                 for(k1=0;k1<m;k1++)
                 {
                     if( st2[k][k1] != st1[k+i][k1+j] )
                     {
                         bb=true;
                         break;
                     }
                 }
                 if(bb)true;
             }
             if(!bb){
                    cout<<"Yes\n";
                    return 0;
             }
         }
     }
     cout<<"No\n";

}


Measured memory_bytes: 256
import numpy as np
S=input()

for i in range(len(S)):
    tmp=S[:-i-2]
    if len(tmp)%2!=0:
        continue
    else:
        tmp=list(tmp)
        tmp=list(np.array_split(tmp,2))
        if (tmp[0]==tmp[1]).all():
            break

print(len(tmp[0])*2)

Measured memory_bytes: 12396
#include <iostream>
#include <cmath>
#include <utility>

using namespace std;

typedef pair<int,int> pii;
typedef long long ll;
#define mp make_pair
#define x first
#define y second

int mod=1e9+7;

int main () {
	ll n,k;
	cin>>n>>k;
	ll sol=0ll;
	for(ll i=k;i<=n+1ll;i++){
		ll a=i*(i+1ll)/2ll;
		ll b=(n+1ll)*(n+2ll)/2ll-(n+1ll-i)*(n+2ll-i)/2ll;
		sol+=(b-a+1ll);
	}
	cout<<sol%mod;



return 0;
}



Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define ll long long int
#define yorn(f) cout<<((f)?"Yes":"No")<<endl
#define YORN(f) cout<<((f)?"YES":"NO")<<endl
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define println(x) cout << x << endl
using namespace std;
int main()
{
    double a, b;
    cin >> a >> b;
    cout << (int)ceil((a + b) / 2) << endl;
    return 0;
}

Measured memory_bytes: 3684
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;

namespace AOJ
{
	class Program
	{
		static void Main(string[] args)
		{
			var s = "";
			while ((s = Console.ReadLine()) != null)
			{
				var ab = s.Split(' ').Select(i => int.Parse(i)).ToArray();
				Console.WriteLine(ab[0] + ab[1]);
			}
		}
	}
}

Measured memory_bytes: 5940
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
    int n,k;
    cin>>n>>k;

    ll arr[n];
    for(int i=0;i<n;i++)
        cin>>arr[i];
    

    ll dp[n];
    dp[0]=0;
    for(int i=1;i<n;i++)
    {
        dp[i] = INT_MAX;
        for(int j=1;j<=k && i-j>=0;j++){

            dp[i] = min(dp[i],dp[i-j]+abs(arr[i]-arr[i-j]));
        }
    }

    cout<<dp[n-1];



    return 0;
}

Measured memory_bytes: 5184
from collections import deque
BIG_NUM = 2000000000

class Process:
    def __init__(self, arg_name, arg_value):
        self.name = arg_name
        self.value = arg_value
        self.finish_time = BIG_NUM

Q = deque()
n, limit = map(int, input().split())

for loop in range(n):
    input_str = list(map(str, input().split()))
    tmp_Process = Process(input_str[0], int(input_str[1]))
    Q.append(tmp_Process)

numFinish = 0
nowTime = 0

while True:
    tmp_Process = Q.popleft()

    if tmp_Process.value <= limit:
        nowTime += tmp_Process.value
        print(tmp_Process.name + ' ' + str(nowTime))
        numFinish += 1
    else:
        tmp_Process.value -= limit
        nowTime += limit
        Q.append(tmp_Process)

    if numFinish == n:
        break


Measured memory_bytes: 17556
import sys
input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

def main():
	n=II()
	A=LI()

	ans=0

	for i in range(n):
		if i%2==0 and A[i]%2==1:
			ans+=1
	print(ans)









if __name__ == "__main__":
	main()


Measured memory_bytes: 61996
#include<bits/stdc++.h>
//#include<iostream>
using namespace std;
//type
typedef long long ll;
#define pii pair<int, int>
#define vi vector<int>
//x * y * 1.0 can cause overflow
//constant
#define inf (int)(1e9+7)
#define mod (ll)(1e9+7)
#define eps 1e-10
//omission
#define eb emplace_back
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define all(v) v.begin(), v.end()
#define ios cin.tie(0); ios::sync_with_stdio(false)
#define FIX(a) cout << fixed << setprecision(a)
#define mp make_pair
//manip
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; }
#define UNIQUE(v) v.erase(unique(v.begin(), v.end(), v.end());
#define fill(x, y) memset(x, y, sizeof(x))
#define ceil(a, b) a / b + !!(a % b)
template<class T> T power_mod(T a, T b) {return b ? power(a * a % inf, b / 2) * (b % 2 ? a : 1) % inf : 1;}
template<class T> T power(T a, T b) {return b ? power(a * a, b / 2) * (b % 2 ? a : 1) : 1;}
#define LB(v, x) (int)(lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (int)(upper_bound(v.begin(), v.end(), x) - v.begin())
template<typename T> T gcd(T a, T b) {if (b == 0) return a; return gcd(b, a % b);}
template<typename T> T lcm(T a, T b) {return a / gcd(max(a, b), min(a, b)) * b;} //先に割る!!
#define outa(a, n) rep(i_, n) cout << a[i_] << " "; cout << endl
#define out(a) cout << a << endl
#define outv(v) rep(i, SZ(v)) cout << v[i] << " "; cout << endl
//loop
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep3(i, st, n) for (int i = st; i < n; ++i)
//algorithm
//double pointer, l start, how many adds, can be 0 -> init r = l, sum = 0
//bfs, not x, y, i, j
//not !(i % 2), i % 2 == 0
//minimal required terms
//cast caution
//look constraints always



int main() {
    
    
    
    
    int n;
    while (cin >> n && n) {
        int a = 0, b = 0;
        int state = 0; //両足床 0, 両足上 1
        int cnt = 0;
        rep(i, n) {
            string str; cin >> str;
            
            if (str == "lu") a = 1;
            else if (str == "ru") b ^= 1;
            else if (str == "ld") a = 0;
            else b = 0;
            
            if (state == 0 && a == 1 && b == 1) {
                cnt++;
                state = 1;
            } else if (state == 1 && a == 0 && b == 0) {
                cnt++;
                state = 0;
            }
            
        }
        out(cnt);
    }
}




Measured memory_bytes: 3072
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func nextFloat64() float64 {
	sc.Scan()
	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func nextString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)
	//sc.Buffer(nil, 100000000)
	n, m := nextInt(), nextInt()

	as := make([]int, m)
	sum := 0
	for i := 0; i < m; i++ {
		as[i] = nextInt()
		sum += as[i]
	}

	if sum > n {
		fmt.Println(-1)
	} else {
		fmt.Println(n - sum)
	}
}


Measured memory_bytes: 1892
import java.util.*;
import java.lang.*;

public class Main{
	static long mod = 1000000007;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long[][] dp = new long[s.length() + 1][13];
		dp[0][0] = 1;
		for (int i = 1; i <= s.length(); i++) {
			for (int j = 0; j < 10; j++) {
				if (s.charAt(i - 1) == '?' || s.charAt(i - 1) - '0' == j) {
					for (int k = 0; k < 13; k++) {
						dp[i][(k * 10 + j) % 13] += dp[i - 1][k];
						dp[i][(k * 10 + j) % 13] %= mod;
					}
				}
			}
		}
		System.out.println(dp[s.length()][5]);
	}
}

Measured memory_bytes: 37688
#pragma region 宣言部分
#include <iostream>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iomanip>
typedef long long ll;
#define REP(i,n) for(int i = 0;i < (n);i++)
#define rep(i,m,n) for(int i = (m);i < (n);i++)
#define P pair<int,int>
#define pb push_back
#define mk make_pair
using namespace std;
#define Vec(a) vector <int> a
const int INF = 1 << 20;
const int MOD = 1e9+7;

#pragma endregion



int main(){
    double a,b,h,m;
    cin >> a >> b >> h >> m;
    double r = abs((60*h+m)*0.5 - 6*m) * M_PI / 180;
    double c = a*a + b*b - 2*a*b*cos(r);
    cout << fixed << setprecision(10) << sqrt(c) << endl;
    return 0;
}


Measured memory_bytes: 4176
a, b = map(int, input().split())
s = list(input())

for i in range(a+b+1):
    if i < a:
        if s[i] == '-':
            print('No')
            exit()
        else:
            continue
    elif i == a:
        if s[i] != '-':
            print('No')
            exit()
        else:
            continue
    else:
        if s[i] == '-':
            print('No')
            exit()
        else:
            continue

print('Yes')



Measured memory_bytes: 3060
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<62;
const int INF = 1<<30;
const double PI=acos(-1);
int ans = 0;


void func(int h,int w,vector<vector<int>>&path,vector<vector<bool>>&has){
   
    
    //clog<<h<<" "<<w<<endl;
    if(path[h][w]==1 and has[h][w]==false and h<52 and w<52){
        path[h][w] = 0;
        has[h][w] = true;
        func(h+1,w,path,has);
        func(h + 1, w + 1, path, has);
        func(h, w + 1, path, has);
        if(h>0){
            func(h - 1, w, path, has);
            func(h - 1, w + 1, path, has);
        }
        if(w>0){
            func(h, w - 1, path, has);
            func(h + 1, w - 1, path, has);
        }
        if(h>0 and w>0){
            func(h - 1, w - 1, path, has);
        }
    }
}
int main()
{
    int h, w;

    while (1)
    {
        vector<vector<int>> path(60, vector<int>(60, 0));
        vector<vector<bool>> has(60, vector<bool>(60, false));

        ans = 0;

        rep(i, 59){
            rep(j, 59){
                path[i][j] = 0;
                has[i][j] = false;
            }
        }
        cin >> h >> w;
        if (h == 0 and w == 0)
        {
            break;
        }

        rep(i, w)
        {
            rep(j, h)
            {
                cin >> path[i][j];
            }
        }
        rep(i, w)
        {
            rep(j, h)
            {
                if (has[i][j] == false)
                {
                 //   clog<<i<<" "<<j<< " -> "<<path[i][j]<<endl;
                    if (path[i][j] == 1)
                    {
                        ans++;
                       
                    }
                    func(i, j, path, has);
                }
            }
        }
     //   clog<<'f'<<endl;
        cout << ans << endl;
    }
}


Measured memory_bytes: 3332
s = ""; l = 0;
def expr(idx):
    ret, idx = term(idx)
    while idx<l:
        if s[idx]=='+':
            r, idx = term(idx+1)
            ret += r
        elif s[idx]=='-':
            r, idx = term(idx+1)
            ret -= r
        else:
            break
    return ret, idx
    
def term(idx):
    ret, idx = fact(idx)
    while idx<l:
        if s[idx]=='*':
            r, idx = fact(idx+1)
            ret *= r
        elif s[idx]=='/':
            r, idx = fact(idx+1)
            ret = abs(ret) / abs(r) * (-1 if ret*r<0 else 1)
        else:
            break
    return ret, idx

def fact(idx):
    ret = 0
    if s[idx]=='(':
        ret, idx = expr(idx+1)
        idx += 1
    else:
        ret, idx = num(idx)
    return ret, idx

def num(idx):
    ret = 0
    while idx<l and s[idx].isdigit():
        ret = 10*ret + int(s[idx])
        idx+=1
    return ret, idx

for i in xrange(input()):
    s = raw_input(); l = len(s);
    print expr(0)[0]

Measured memory_bytes: 4292
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;
 
int main() {
    ll n, k;
    cin >> n >> k;

    if(k == 0) {
        out(n*n);
        re0;
    }

    ll ans = 0;
    exrep(b, k+1, n) {
        ll c = (n+1)/b;
        ll d = (n+1)%b;
        ans += (b - k)*c + max(0LL, d - k);
    }
    
    out(ans);
    re0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  int n, m, a;
  while(1){
    cin >> n >> m;
    if(n == 0 && m == 0) break;
    int t[n+m];
    int ans = 0, sum = 0;
    for(int i = 0 ; i < n ; i++){
      cin >> a;
      t[i] = a;
    }
    for(int i = 0 ; i < m ; i++){
      cin >> a;
      t[i+n] = a;
    }
    sort(t, t+n+m-1);
    
    for(int i = n + m - 1 ; i >= 0 ; i--){
      //cout << t[i]<< endl;
      if(i != 0) sum = t[i] - t[i-1];
      else sum = t[i];
      ans = max(ans, sum);
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    int n, a[100005] = {};
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    if (n % 2) {
        for (int i = 0; i < n; i++) {
            if (i % 2) {
                if (a[i] != i + 1) {
                    cout << 0;
                    return 0;
                }
            } else {
                if (a[i] != i) {
                    cout << 0;
                    return 0;
                }
            }
        }
    } else {
        for (int i = 0; i < n; i++) {
            if (i % 2) {
                if (a[i] != i) {
                    cout << 0;
                    return 0;
                }
            } else {
                if (a[i] != i + 1) {
                    cout << 0;
                    return 0;
                }
            }
        }
    }
    ll z = 1;
    for (int i = 1; i < n; i++, i++) z = z * 2 % mod;
    cout << z;
}


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



int main(){
  
  string S,T;
  cin>>S>>T;
  
  int N=S.size();
  bool can=true;
  for(int i=0;i<N;i++){
    if(S.at(i)!=T.at(i)){
      can=false;
      break;
    }
  }
  
  if(can) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  
    
}

Measured memory_bytes: 3608
#include <stdio.h>
int n, m, s, x;
int a[1000];
int main() {
	scanf("%d%d", &n, &m);
	for (int i = 0; i < n; i++) {
		scanf("%d", a + i);
		s += a[i];
	}
	for (int i = 0; i < n; i++) {
		if (s <= 4 * m * a[i])x++;
	}
	if (x >= m)printf("Yes\n");
	else printf("No\n");
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c;
  cin>>a>>b>>c;
  if(b<a)swap(a,b);
  if(a<c&&c<b){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
  return(0);
}


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

int main(){
	int n;
	int ans = 0;
	cin >> n;
	vector<int> stick(n);
	rep(i,n) cin >> stick[i];
	sort(stick.begin(), stick.end());
	rep(b,n){
		rep(a,b){
			int sum = stick[a]+stick[b];
			int r = lower_bound(stick.begin(), stick.end(), sum) - stick.begin();
			int l = b+1;
			ans += r-l;
		}
	}
		cout << ans << endl;
			
			
	
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main()
{
    int n,cnt=0;
    double d,dis,x,y;
    scanf("%d %lf", &n, &d);
    while(n--)
    {
        scanf("%lf %lf", &x, &y);
        dis=(sqrt((x*x)+(y*y)));
        if(dis<=d)
            cnt++;
    }
    printf("%d", cnt);
}


Measured memory_bytes: 2208
#include <vector>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
#define rep(i,a) for(int i=lst[a];i;i=nxt[i])
using namespace std;

int read() {
	char ch;
	for(ch=getchar();ch<'0'||ch>'9';ch=getchar());
	int x=ch-'0';
	for(ch=getchar();ch>='0'&&ch<='9';ch=getchar()) x=x*10+ch-'0';
	return x;
}

const int N=2e5+5,M=N<<3,inf=0x7fffffff;

int t[M],f[M],nxt[M],lst[N],l;

void add(int x,int y,int z) {
	t[++l]=y;f[l]=z;nxt[l]=lst[x];lst[x]=l;
	t[++l]=x;f[l]=0;nxt[l]=lst[y];lst[y]=l;
}

int n,S,T,q[N],dis[N],p[N],fa[N];
vector<int> to[N];

bool bfs() {
	fo(i,S,T) dis[i]=0;dis[S]=1;
	int i=0,j=1;q[1]=S;
	while (i<j) {
		rep(k,q[++i])
			if (f[k]&&!dis[t[k]]) {
				dis[t[k]]=dis[q[i]]+1;
				q[++j]=t[k];
			}
	}
	return dis[T];
}

int dinic(int x,int y) {
	if (x==T) return y;
	int now=0;
	rep(i,x)
		if (f[i]&&dis[t[i]]==dis[x]+1) {
			int k=dinic(t[i],min(y,f[i]));
			f[i]-=k;f[i^1]+=k;
			y-=k;now+=k;
			if (!y) break;
		}
	if (!now) dis[x]=-1;
	return now;
}

bool vis[N];

void dfs(int x) {
	vis[x]=1;
	for(int y:to[x])
		if (!vis[p[y]]) {
			fa[y]=x;
			dfs(p[y]);
		}
}

int main() {
	n=read();S=0;T=n<<1;l=1;
	fo(i,1,n-1) {
		add(S,i,1);
		for(int c=read();c;c--) {
			int x=read();
			if (x>1) add(i,x+n-1,1);
			to[x].push_back(i);
		}
	}
	fo(i,1,n) add(i+n-1,T,1);
	int ret=0;
	while (bfs()) ret+=dinic(S,inf);
	if (ret<n-1) {puts("-1");return 0;}
	fo(i,1,n-1) rep(j,i) if (!f[j]&&t[j]) p[i]=t[j]-n+1;
	dfs(1);
	fo(i,1,n-1) if (!fa[i]) {puts("-1");return 0;}
	fo(i,1,n-1) printf("%d %d\n",p[i],fa[i]);
	return 0;
}

Measured memory_bytes: 26496
def main():
    h, w, a, b = list(map(int, input().split()))
    result_list = []
    for _ in range(b):
        result_list.append([0] * a + [1] * (w-a))
        if not min_count(result_list[-1]) == a:
            print('No')
            exit()
    for _ in range(h-b):
        result_list.append([1] * a + [0] * (w-a))
        if not min_count(result_list[-1]) == a:
            print('No')
            exit()
    for i in range(w):
        temp_list = []
        for j in range(h):
            temp_list.append(result_list[j][i])
        if not min_count(temp_list) == b:
            print('No')
            exit()
    result_str = ''
    for content in result_list:
        result_str += str(''.join(list(map(str, content)))) + '\n'
    print(result_str)


def min_count(input_list):
    zero = 0
    one = 0
    for v in input_list:
        if v == 0:
            zero += 1
        else:
            one += 1
    return min(zero, one)


if __name__ == '__main__':
    main()

Measured memory_bytes: 13940
// abc143_d
#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<int, int> 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 ((1 << 29)-1)
#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 i=0;i<(n-1);i++) cout << (vec)[i] << " "; cout << (vec)[(n)-1] << endl;}
template<class T> void print(const T& x){cout << x << endl;}
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<int> L(N);
    REP(i, N) cin >> L[i];

    sort(ALL(L));

    ll ans = 0;
    REP(i, N-1) REPN(j, i+1, N){
        auto it = lower_bound(ALL(L), L[i] + L[j]);
//        print(i, j, L[i], L[j], it - L.begin(), (it - L.begin()) - j - 1);
        ans += (it - L.begin()) - j - 1;
    }

//    vector<int> x{1, 2, 3, 4, 4, 4, 5};
//    auto it = lower_bound(ALL(x), 3);
//    print(it - x.begin());

    print(ans);

    return 0;
}


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

int main() {
	int a[3];
	for(int i = 0; i < 3; i++)
	cin>>a[i];
	
	sort(a,a+3);
	if(a[0] == a[2] || (a[0] != a[1]&&a[1] != a[2]))
	cout<<"No"<<endl;
	
	else 
	cout<<"Yes"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <stdio.h>
using namespace std;



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

	vector<string> vStr;

	string tmpS;

	long i = 0;
	long nA = 0;
	long nBC = 0;
	long nExchange = 0;
	while (i <= S.length()) {
		if (S[i] == 'A') {
			tmpS += 'A';
			nA++;
			i++;
		}
		else if (i != S.length() - 1) {
			if (S[i] == 'B' && S[i + 1] == 'C') {
				tmpS += "BC";
				nExchange += nA;
				i += 2;
			}
			else {
				if (!tmpS.empty()) {
					vStr.push_back(tmpS);
					tmpS.clear();
					nA = 0;
				}
				i++;
			}
		}
		else {
			if (!tmpS.empty()) {
				vStr.push_back(tmpS);
				tmpS.clear();
				nA = 0;
			}
			i++;
		}
	}

	if (!tmpS.empty()) {
		vStr.push_back(tmpS);
	}

	if (0) {
		int numB = 0;
		for (int iStr = 0; iStr != vStr.size(); iStr++) {
			string str = vStr[iStr];
			for (int j = 0; j != str.length() - 1; j++) {
				// j番目のAより右にあるBの数を数える
				if (str[j] == 'A') {
					for (int k = j + 1; k != str.length(); k++) {
						if (str[k] == 'B') {
							numB++;
						}
					}
				}
			}
		}
	}

	cout << nExchange << endl;

	return 0;
}



Measured memory_bytes: 3196
//https://atcoder.jp/contests/abc139/tasks/abc139_a
#include<bits/stdc++.h>
using namespace std;
int main()
{
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        int count{0};
        string s, s1;
        cin >> s >> s1 ;
        for(int i = 0; i < 3; i++)
        {
                if(s[i] == s1[i]) count++;
        }
        cout << count << endl;
}

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

int main() {
  int N;
  string S;
  cin >> N >> S;
  int res = 0;
  for (int i = 0; i <= N; ++i) {
    int con = 0;
    for (int j = 0; j < 26; ++j) {
      char c = 'a' + j;
      bool zen = false, kou = false;
      for (int k = 0; k < i; ++k) if (S[k] == c) zen = true;
      for (int k = i; k < N; ++k) if (S[k] == c) kou = true;
      if (zen && kou) ++con;
    }
    res = max(res, con);
  }
  cout << res << endl;
}
  

Measured memory_bytes: 3588
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let line = read_as_vec::<usize>();
    let (n, k, s) = (line[0], line[1], line[2]);

    let mut ans: Vec<usize> = vec![];

    for i in 0..k{
        ans.push(s);
    }

    let dummy: usize;
    if n-k >= s{
        dummy = s+1;
    }else{
        dummy = 1;
    }

    for _ in 0..n-k{
        ans.push(dummy);
    }

    for i in 0..n{
        print!("{} ", ans[i]);
    }

    println!("");
}


Measured memory_bytes: 5372
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
#include<queue>
#include<functional>
#include<map>
#include<set>
#include<cstring>
#include<string>
#include<stack>
#include<math.h>
#include<stdlib.h>
using namespace std;
//#define int long long
typedef pair<int, int> pii;
typedef pair<int, char> pic;
typedef priority_queue<pii, vector<pii>, greater<pii> > RPQ;
#define mk make_pair
#define INF (1 << 30)
#define INFL (1ll << 60ll)
#define mod 1000000007

int N, K;
string s;
int ans1, ans2;

signed main(){
    cin >> s;
    int N = (int)s.size();
    for(int i = 0; i < N; i++){
        if(i % 2){
            if(s[i] == '0')ans1++;
            else ans2++;
        }
        else {
            if(s[i] == '0')ans2++;
            else ans1++;
        }
    }
    cout << min(ans1, ans2) << endl;


    return 0;
}

/*

*/

Measured memory_bytes: 512
import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    if( S.equals("AAA") || S.equals("BBB")){
      System.out.println("No");
    }else{
      System.out.println("Yes");
    }
  }
}


Measured memory_bytes: 21972
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


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

  vector<int> A(N);
  REP(i, N) cin >> A[i];

  vector<int> o(N);
  iota(ALL(o), 0);

  sort(ALL(o), [&](int const & l, int const & r){
      return A[l] < A[r];
      });

  REP(i, N){
    if(A[i] < A[o[N/2]]) cout << A[o[N/2]] << "\n";
    else cout << A[o[N/2-1]] << "\n";
  }

  return 0;
}

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

#define f first
#define s second
#define pb push_back
#define all(c) c.begin(),c.end()

#define gi(x) scanf("%d", &x)
#define pi(x) printf("%d", x)
#define gl(x) scanf("%lld", &x)
#define pl(x) printf("%lld", x)
#define sp printf(" ")
#define nl printf("\n")

typedef long long int lld;
typedef long double ldb;

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
	template <typename Arg1>
	void __f(const char* name, Arg1&& arg1){
		cerr << name << " : " << arg1 << std::endl;
	}
	template <typename Arg1, typename... Args>
	void __f(const char* names, Arg1&& arg1, Args&&... args){
		const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
	}
#else
#define trace(...)
#endif

char str[100];

main(){
	int n;
	cin >> n;
	int slo = 0, shi = 0, lo = 0, hi = n-1, md, smd;
	// string str;
	cout << lo << endl;
	// scanf("%d", &lo);
	scanf("%s", str);
	if(str[0] == 'V') return 0;
	if(str[0] == 'M') slo = 0;
	else slo = 1;
	cout << hi << endl;
	// scanf("%d", &hi);
	scanf("%s", str);
	if(str[0] == 'V') return 0;
	if(str[0] == 'M') shi = 0;
	else shi = 1;
	while(1){
		md = (lo + hi)/2;
		cout << md << endl;
		// cin >> str;
		scanf("%s", str);
		if(str[0] == 'V') return 0;
		if(str[0] == 'M') smd = 0;
		else smd = 1;
		// trace(slo, smd, shi, lo, md, hi);
		if((md - lo)%2 == 0){
			if(smd == slo){
				lo = md;
				slo = smd;
			}
			else{
				hi = md;
				shi = smd;
			}
		}
		else{
			if(smd == slo){
				hi = md;
				shi = smd;
			}
			else{
				lo = md;
				slo = smd;
			}
		}
	}
}


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

typedef long long lint;
typedef unsigned long long ulint;
const int MOD=1000000007;

template<unsigned long long SIZE> class unionFind{
    protected:
        long long uni[SIZE];
        long long diff_weight[SIZE];
    public:
        unionFind(){
            for(int i=0;i<SIZE;i++){
                uni[i]=-1;
                diff_weight[i]=0;
            }
        }
        unsigned long long root(unsigned long long a){
            if(a>=SIZE) throw std::range_error("The given index is larger than the size of the tree.");
            if(uni[a]<0) return a;
            else{
                unsigned long long r=root(uni[a]);
                diff_weight[a]+=diff_weight[uni[a]];
                return uni[a]=r;
            }
        }
        long long weight(unsigned long long a){
            root(a);
            return diff_weight[a];
        }
        long long diff(unsigned long long a, unsigned long long b){
            if(isSame(a,b)) return weight(b)-weight(a);
            else return INT64_MAX;
        }
        unsigned long long count(unsigned long long a){
            return -uni[root(a)];
        }
        bool merge(unsigned long long a, unsigned long long b, long long w=1){
            w+=weight(a);  w-=weight(b);
            a=root(a);  b=root(b);
            if(a==b) return false;
            if(uni[a]>uni[b]){
                swap(a, b);
                w=(-w);
            }
            uni[a]+=uni[b];
            uni[b]=a;
            diff_weight[b]=w;
            return true;
        }
        bool isSame(unsigned long long a,unsigned long long b){
            return root(a)==root(b);
        }
};

int main(){
    int N,M;
    cin >> N >> M;
    unionFind<100001> uf;
    for(int i=0;i<M;i++){
        int L,R,D;
        cin >> L >> R >> D;
        if(uf.isSame(L,R)){
            if(uf.diff(L,R)!=D){
                cout << "No" << endl;
                return 0;
            }
        }else uf.merge(L,R,D);
    }
    cout << "Yes" << endl;

    return 0; 
}

Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#include<ctime>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<iomanip>
#include<numeric>
#include<queue>
#include<deque>
#include<cfloat>
#include<functional>
#include<tuple>
#include<math.h>
#include<bitset>
#include<stack>
#include<set>
#include<random>
#include<stdlib.h>
#define rip(i,n) for(int i=0;i<n;i++)
#define Rip(i,n) for(int i=1;i<=n;i++)
#define RIP(i,a,b) for(int i=a;i<b;i++)
#define all(V) V.begin(),V.end()
#define MOD 1000000007
#define mod 998244353
#define inf MOD 
#define sec setprecision
#define Pair pair<ll,ll>
#define _CRT_SECURE_NO_WARNINGS
#pragma target("avx")
#pragma optimize("O3")
#pragma optimize("unroll-loops")
constexpr double eps = 1e-9;
constexpr double pi = 3.141592653589793238462643383279;
using namespace std;
using ll = long long;
using ld = long double;
ll gcd(ll a, ll b)
{
	if (a % b == 0)	return(b);
	else return(gcd(b, a % b));
}
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
ll pow(ll x, ll n) {
	x %= mod;
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return (pow((x * x) % mod, n / 2) % mod);
	else
		return (x * pow(x, n - 1)) % mod;
}
void solve() {

}
int main() {
	vector<int>a(5);
	rip(i, 5)cin >> a[i];
	sort(all(a));
	reverse(all(a));
	int sum = 0;
	rip(i, 5) {
		sum += (a[i] - 1) / 10 + 1;
	}
	int mini = 9;
	int count = 0;
	rip(i, 5) {
		if (a[i] % 10 == 0)count++;
	}
	if (count == 5)cout << sum*10 << endl;
	else {
		rip(i, 5) {
			if (a[i] % 10 != 0) {
				mini = min(mini, a[i] % 10);
			}
		}
		cout << sum*10 - (10 - mini) << endl;
	}
}

Measured memory_bytes: 3592
import java.util.*;
import static java.lang.Integer.*;
import static java.lang.Long.parseLong;
//import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static int MOD = 1000000007;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		int k = parseInt(sc.next());
		int[] h = new int[n];
		int cnt=0;
		for(i=0;i<n;i++) {
			h[i] = parseInt(sc.next());
			if(h[i]>=k)cnt++;
		}
		sc.close();
		out.println(cnt);
	}
}


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

#define uint unsigned int
#define ull unsigned long long
#define INF 1000000001
#define LINF 1000000000000000001
#define ll long long
#define ld long double
#define M 1000000007
#define E 0.0000001
#define N (1<<17)
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pdd pair<double, double>
#define pld pair<long double, long double>
#define cll complex<long long>
#define cld complex<long double>
#define X real()
#define Y imag()
#define C 'a'
#define F first
#define S second
#define PI 3.1415926535897932384626433

using namespace std;

/**
x : y, where
x = a / (a + b)
y = b / (a + b)

x = 2
y = 3
a = 2
b = 3

x = 3
y = 2
a = 6
b = 4

a/b = x/y
a*y = b*x
*/

int main () {
    ull n;
    cin>>n;
    ull af, bt;
    cin>>af>>bt;
    __int128_t a = (__int128_t)af;
    __int128_t b = (__int128_t)bt;
    for (int i = 1; i < n; i++) {
        ull xt, yt;
        cin>>xt>>yt;
        __int128_t x = (__int128_t)xt;
        __int128_t y = (__int128_t)yt;
        a += (x - (a % x)) % x;
        b += (y - (b % y)) % y;
        if (a * y > b * x) {
            b = a * y / x;
        } else if (b * x > a * y) {
            a = b * x / y;
        }
        //cout<<a<<" "<<b<<endl;
    }
    cout<<(ull)a + (ull)b<<endl;
}


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

int main() {
    int n;
    long long K;
    cin >> n >> K;
    vector<long long> a(n), b(n);
    for (int i = 0; i < n; i++) {
        cin >> a.at(i) >> b.at(i);
    }
    
    vector<long long> nk = {K};
    for (int i = 0; i < 30; i++) {
        if (!(K & (1ll << i))) continue;
        
        nk.push_back((K & ~(1ll << i)) | ((1ll << i) - 1));
    }

    long long maxi = 0;
    for (long long ki: nk) {
        long long sum = 0;
        for (int j = 0; j < n; j++) {
            bool ok = true;
            for (int k = 0; k < 30; k++) {
                if (!(ki & (1ll << k)) && (a.at(j) & (1ll << k))) ok = false;
            }   
            if (ok) sum += b.at(j);
        }
        maxi = max(maxi, sum);
    }
    cout << maxi << endl;
}

Measured memory_bytes: 1920
#include<bits/stdc++.h>
using namespace std;
bool comp(pair<long long int,long long int>a,pair<long long int,long long int>b)
{
    if(a.first==b.first)
    {
        if(a.second<=b.second)
        return true;
        else
        return false;
    }
    if(a.first>b.first)
    return true;
    else return false;
}
bool rev(long long int a,long long int b)
{
    if(a>b)return true;
    else return false;
}
bool compa(pair<string,pair<int,int>>a,pair<string,pair<int,int>>b)
{
    if(a.first==b.first)
    {
        if(a.second.first>b.second.first)
        return true;
        else
        return false;
    }
    if(a.first<b.first)
    return true;
    else 
    return false;
}
long long int gcd(long long int bdda,long long int chota)
{
    if(chota==0)
        return bdda;
    return gcd(chota,bdda%chota);
}
void solve()
{
    long long int n;
    cin>>n;
    long long int a[n];
    for(long long int i=0;i<n;i++)
    cin>>a[i];
    long long int h=a[n-1];
    for(long long int i=n-2;i>=0;i--)
    {
        if(a[i]>h+1)
        {
            cout<<"No";return;
        }
        h=min(h,a[i]);
    }
    cout<<"Yes";
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;    
    t=1;

    //cin>>t;
    while(t--)
    {
        solve();
    }
}


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

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.begin(), a.end(), greater<int>());
  vector<int> a_sorted(a.size());
  partial_sort_copy(begin(a), end(a), begin(a_sorted), end(a_sorted));
  for(int i = 0; i < n; i++){
    if(a[i] == a_sorted[n-1]){
      cout << a_sorted[n-2] << "\n";
    }
    else{
      cout << a_sorted[n-1] << "\n";
    }
  }
  return 0;
}

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

map<ll,ll> prime;
const ll mod=1e9+7;

int main(void)
{
	ll n;
	cin>>n;
	for (ll i = 2; i <=n; i++){
		ll d=2,k=i;
		while(d<=k){
			while(k%d==0){
				k/=d;
				prime[d]++;
			}
			d++;
		}
	}
	ll ret=1;
	for(auto x:prime){
		ret=(ret*(x.second+1))%mod;
	}
	cout<<ret<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a,b,c,d,ta,ao; 
int main()
{
	cin>>a>>b>>c>>d;
	ta=(a+d-1)/d;
	ao=(c+b-1)/b;
	if(ao>ta)
		cout<<"No";
	else
		cout<<"Yes";
return 0;
}


Measured memory_bytes: 3604
package main

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

func main() {
	r := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscan(r, &n)
	e := make([][]int, n-1)
	for i := 0; i < n-1; i++ {
		var u, v int
		fmt.Fscan(r, &u, &v)
		if u > v {
			u, v = v, u
		}
		e[i] = []int{u, v}
	}

	var ans int64
	for i := 1; i <= n; i++ {
		ans += int64(i) * int64(n-i+1)
	}
	for i := 0; i < n-1; i++ {
		ans -= int64(e[i][0]) * int64(n-e[i][1]+1)
	}
	fmt.Println(ans)
}


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

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
/* }}} */

fn main() {
    input! {
        h: u64
    }
    let mut h = h;
    let mut c = 0;
    while h != 1 {
        h /= 2;
        c += 1;
    }
    let mut res: u64 = 0;
    for i in 0..c+1 {
        res += 1 << i;
    }
    println!("{}", res);
}
/* vim:set foldmethod=marker: */


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
 
#define fur(i,n,m,k) for (int i = (n) ; i < (m) ; i += k)
#define fr(i,n,m,k) for (int i = (n - 1) ; i >= (m) ; i -= k)
#define pub push_back
#define pob pop_back
#define Sz size()
#define F first
#define S second
 
typedef pair<int,int> pii;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef long double ld;
const int maxn=1e6+20;
ll n,t,b,a,c,d;
bool bo;
int main(){
	cin>>t;
	while(t){
		a=t%10;
		t=t/10;
		if(a==7)return cout<<"Yes"<<endl,0;
	}
	cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 3640
def main():
    n,y = map(int,input().split())

    for i in range(n+1):
        for j in range(n+1):
            k = n-i-j
            if k < 0:
                continue
            if 10000*i + 5000*j + 1000*k == y:
                print(i,j,k)
                return

    print(-1,-1,-1)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
def ipt(N=0,switch=0):
    if N == 0:
        return list(map(int,input().split()))
    else:
        if switch==0:
            return [list(map(int,input().split())) for _ in range(N)]
        else:
            return [int(input()) for _ in range(N)]

N=int(input())
A=ipt()
min=4**9
for i in range(N):
    cnt=0
    while(A[i]%2==0):
        A[i] = A[i]//2
        cnt += 1
    if min > cnt:
        min=cnt
print(min)

Measured memory_bytes: 3064
#include<stdio.h>
using namespace std;

int binarySearch(int t, int S[], int n){
    int left, right, mid;
    left = 0;
    right = n;
    while(left < right){
        mid = (left + right) / 2;
        if(t > S[mid]){
            left = mid + 1;
        }else if(t < S[mid]){
            right = mid;
        }else{
            return t == S[mid];
        }
    }
    return 0;
}

int main(){
    int n, q, t, cnt = 0;
    scanf("%d",&n);
    int S[1000000];
    for(int i=0;i<n;i++) scanf("%d",&S[i]);
    scanf("%d",&q);

    for(int i=0;i<q;i++){
        scanf("%d",&t);
        if(binarySearch(t,S,n)) cnt++;
    }

    printf("%d\n",cnt);

    return 0;
}


Measured memory_bytes: 3060