akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 1000000000
#define INF 9223372036854775807
#define MOD 998244353
#define mod 1000000007
#define INT_MAX_ 2147483647
#define EPS (1e-10)
#define REP(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define REPE(i, a, n) for (ll i = a; i <= (ll)(n); i++)
#define rep(i,n)for (ll i = 0; i < (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
#define me memset
#define bit(n,k) ((n>>k)&1)
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int,int>Pin;
typedef pair<ll,ll>Pll;
template<class T> using V=vector<T>;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T> >;
long long GCD(long long a, long long b) {return b?GCD(b,a%b):a;}
long long LCM(long long a, long long b) {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
ll cmp1(pair<ll,Pll> a,pair<ll,Pll> b){
        if(a.fi!=b.fi)
        return a.fi<b.fi;
        else
        return a.se.fi>b.se.fi;
}
//----------------------------------------------------------------------

//----------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------  
    //ll begin_t=clock();
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    //-------------------------------
   /* int h1,h2,m1,m2,k;cin>>h1>>m1>>h2>>m2>>k;
    int ans=(h2-h1)*60;
    if(m2>=m1){
        ans+=m2-m1;
    }
    else{
        ans-=60;
        ans+=m2+60-m1;
    }
    cout<<mmax(0,ans-k)<<endl;

*/    string t;cin>>t;
    int n=t.length();
    for(int i=0;i<n;i++){
        if(t[i]=='?')t[i]='D';
    }
    int ans=0;
    for(int i=0;i<n;i++){
        if(t[i]=='D')ans++;
        if(i<n-1){
            if(t[i]=='P'&&t[i+1]=='D')ans++;
        }
    }
    cout<<t<<endl;
    //-------------------------------  
    //fclose(stdin);
    //fclose(stdout);
    //ll end_t=clock();cout<<"time="<<end_t-begin_t<<"ms"<<endl;
    //-------------------------------
    return 0;
}
//----------------------------------------------------------------------










































Measured memory_bytes: 3776
package main

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

var (
	readString func() string
	stdout     *bufio.Writer
)

func init() {
	readString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = readInt()
	}
	return b
}

func readLengthAndSlice() []int {
	n := readInt()
	return readIntSlice(n)
}

func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(stdout, f, args...)
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdout, args...)
}

func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

// readString() string
// readInt() int
// readIntSlice(n int) []int
// readLengthAndSlice() []int
func main() {
	defer stdout.Flush()
	N := readInt()
	c := make([]int, N)
	s := make([]int, N)
	f := make([]int, N)

	for i := 0; i < N-1; i++ {
		c[i] = readInt()
		s[i] = readInt()
		f[i] = readInt()
	}
	for i := 0; i < N; i++ {
		j := i
		cur := 0
		for j != N-1 {
			if s[j] > cur {
				//eprintln(j, cur, s[j])
				cur = s[j]
			} else {
				m := cur % f[j]
				//eprintln(j, cur, s[j], m)
				if m != 0 {
					cur += f[j] - m
				}
			}
			cur += c[j]
			j++
		}
		println(cur)
	}
}


Measured memory_bytes: 640
#include<cstdio>
#include<cstring>
const int MOD=1e9+7;
const int M=100005;
struct Matrix {
	int w[3][3];
	Matrix() {memset(w,0,sizeof(w));}
	inline int* operator [](const int id){return w[id];}
	friend Matrix operator * (Matrix a,Matrix b) {
		Matrix ret;
		for(int i=0;i<3;i++)
			for(int k=0;k<3;k++)
				for(int j=0;j<3;j++)
					ret[i][j]=(ret[i][j]+1ll*a[i][k]*b[k][j])%MOD;
		return ret;
	}
}now,g,f[30];
int n,m,x[M];
inline Matrix Query(int x) {
	x--; Matrix ret=f[0];
	for(int i=0;(1<<i)<=x;i++)
		if(x&(1<<i)) ret=ret*f[i];
	return ret;
}

int main() {
	now[0][0] = now[0][2] = 1, now[0][1] = 2;
	g[0][0] = g[0][2] = g[1][1] = g[1][2] = g[2][0] = 1;
	g[0][1] = g[2][1] = g[2][2] = 2;
	f[0] = g;
	memset(g.w,0,sizeof(g.w));
	g[0][0] = g[0][2] = g[1][1] = g[1][2] = g[2][2] = 1;
	g[0][1] = 2;
	scanf("%d %d",&n,&m);
	for(int i=1;i<30;i++) f[i]=f[i-1]*f[i-1];
	for(int i=1;i<=m;i++) {
		scanf("%d",&x[i]);
		if(x[i]-x[i-1]>1)
			now=now*Query(x[i]-x[i-1]-1);
		now=now*g;
	}
	if(n-x[m]>1)
		now=now*Query(n-x[m]-1);
	printf("%d\n",now[0][2]);
	return 0;
}

Measured memory_bytes: 2044
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main() {
	int N;
	cin>>N;
	vector<int> a(N);

	for(auto & e:a)cin>>e;

	int ans=0;
	for(int i=1; i<N; ++i) {
		if(a[i]==a[i-1]) {
			++ans;
			++i;
		}
	}

	cout<<ans<<endl;


	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
int n, x, a;
cin>>n;
int banyak = n;
cin>>x;
int donat[n];
for (int i=0;i<n;i++)
{
cin>>donat[i];
x-=donat[i];
}
int banding1;
int banding = x/donat[0];
for (int i=1;i<n;i++)
{
banding1 = x/donat[i];
if (banding1 > banding) {
banding = banding1;
}
}
cout<<banding+banyak<<endl;
}


Measured memory_bytes: 256
using System;
using System.IO;
using System.Text;

class Program{
    static void Main(string[] args){
        var N = int.Parse(Console.ReadLine());
        var b = Convert.ToString(N, 2);
        var answer = Convert.ToInt32("1".PadRight(b.Length, '0'), 2);
        var writer = new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = false};
        Console.SetOut(writer);
        Console.WriteLine(answer);
        Console.Out.Flush();}}

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

int main(int argc, char const *argv[]) {
    long long int L, R;
    long long int lm, rm, ans;
    ans = 2019;
    cin >> L >> R;
    lm = L % 2019;
    rm = R % 2019;
    if(R-L>2018){
        ans = 0;
    }
    else if (lm > rm) {
        ans = 0;
    }
    if (ans != 0) {
        for (int i = lm; i <= rm - 1; ++i) {
            for (int j = i + 1; j <= rm; ++j) {
                ans = ans < ((i * j) % 2019) ? ans :((i * j) % 2019);
            }
        }
    }

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


Measured memory_bytes: 256
#include <stdio.h>
#include<math.h>
#include <algorithm>
using namespace std;

int main(){

	double x,h;

	while(true){
		scanf("%lf",&x);
		scanf("%lf",&h);
		if(x == 0 && h == 0)break;

		printf("%.6lf\n",x*x+2*x*sqrt(h*h+(x/2)*(x/2)));
	}

    return 0;
}

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

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define ll1 1ll
#define ONE 1ll
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF =
    sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>
istream &operator>>(istream &is, pair<T, S> &p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> &p) {
  os << p.first << " " << p.second;
  return os;
}

template <typename T> void printvv(const vector<vector<T>> &v) {
  cerr << endl;
  rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
    if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
      cerr << "INF";
    } else
      cerr << v[i][j];
    cerr << (j == v[i].size() - 1 ? '\n' : ' ');
  }
  cerr << endl;
}
/*
   typedef __int128_t Int;
   std::ostream &operator<<(std::ostream &dest, __int128_t value) {
   std::ostream::sentry s(dest);
   if (s) {
   __uint128_t tmp = value < 0 ? -value : value;
   char buffer[128];
   char *d = std::end(buffer);
   do {
   --d;
 *d = "0123456789"[tmp % 10];
 tmp /= 10;
 } while (tmp != 0);
 if (value < 0) {
 --d;
 *d = '-';
 }
 int len = std::end(buffer) - d;
 if (dest.rdbuf()->sputn(d, len) != len) {
 dest.setstate(std::ios_base::badbit);
 }
 }
 return dest;
 }

 __int128 parse(string &s) {
 __int128 ret = 0;
 for (int i = 0; i < s.length(); i++)
 if ('0' <= s[i] && s[i] <= '9')
 ret = 10 * ret + s[i] - '0';
 return ret;
 }
 */

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

signed main(signed argc, char *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);

  int N, P;
  cin >> N >> P;
  vector<int> A(N);
  int n = 0;
  rep(i, 0, N) {
    cin >> A[i];
    if (A[i] % 2 == 0)
      n++;
  }
  int m = N - n;

  vector<vector<int>> nCr(55, vector<int>(55, 0));
  nCr[0][0] = 1;
  rep(i, 1, nCr.size()) {
    rep(j, 0, i + 1) {
      if (j == 0 or j == i)
        nCr[i][j] = 1;
      else
        nCr[i][j] = nCr[i - 1][j - 1] + nCr[i - 1][j];
    }
  }

  int ans = 1ll << n;
  int tmp=0;
  for (int i = P; i <= m; i += 2)
    tmp+= nCr[m][i];
  cout<<ans*tmp<<endl;

  return 0;
}


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

using namespace std;

const long long MOD = 1e9+7;
int main() {
    ios_base::sync_with_stdio(false);
    cout.precision(12);
    cout << fixed;
    cin.tie(0);

    int n, k;
    cin >> n >> k;
    vector<long long> v(n);
    for (int i = 0; i < n; i++) {
        cin >> v[i];
    }
    for (int i = k; i < n; i++) {
        long long a = v[i];
        long long b = v[i-k];
        if (a > b) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    }

    return 0;
}


Measured memory_bytes: 4780
N = int(input())
A = list(map(int,input().split()))
from collections import defaultdict
I = defaultdict(int)
J = defaultdict(int)
ans = 0

for i in range(N):
  I[A[i]+i] += 1
  J[i-A[i]] += 1
for i,j in I.items():
  ans += J[i]*j
    
print(ans)

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


int main() {
    int a,b,c;
    cin >> a >> b >> c;
    cout << max({a*10+b+c,b*10+a+c,c*10+a+b}) << endl;
    return 0;
}

/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long int
using namespace std;
template<typename T,typename U> using P=pair<T,U>;
template<typename T> using V=vector<T>;
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}

template<typename T>auto&operator<<(ostream&s,const vector<T>&v){s<<"[";bool a=1;for(auto e:v){s<<(a?"":" ")<<e;a=0;}s<<"]";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const pair<T,U>&p){s<<"("<<p.first<<","<<p.second<<")";return s;}
template<typename T>auto&operator<<(ostream&s,const set<T>&st){s<<"{";bool a=1;for(auto e:st){s<<(a?"":" ")<<e;a=0;}s<<"}";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const map<T,U>&m){s<<"{";bool a=1;for(auto e:m){s<<(a?"":" ")<<e.first<<":"<<e.second;a=0;}s<<"}";return s;}
#define DUMP(x)  cerr<<#x<<" = "<<(x)<<endl;

struct edge { int to, cost; };

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

signed main()
{
   int H, W, h, w; cin >> H >> W >> h >> w;

   if (H % h == 0 && W % w == 0) {
      cout << "No" << endl;
      return 0;
   }

   V<V<int>> A(H, V<int>(W));
   if (H % h != 0) {
      for (int j = 0; j < W; j++) {
         V<int> s(H+1, 1e5);
         s[0] = 0;
         for (int i = 0; i+h <= H; i++) {
            s[i+h] = s[i] - 1;
         }
         for (int i = 0; i < H; i++) {
            A[i][j] = s[i+1] - s[i];
         }
      }
   }
   else if (W % w != 0) {
      for (int i = 0; i < H; i++) {
         V<int> s(W+1, 1e5);
         s[0] = 0;
         for (int j = 0; j+w <= W; j++) {
            s[j+w] = s[j] - 1;
         }
         for (int j = 0; j < W; j++) {
            A[i][j] = s[j+1] - s[j];
         }
      }
   }

   cout << "Yes" << endl;
   for (int i = 0; i < H; i++) {
      for (int j = 0; j < W; j++) {
         cout << A[i][j] << (j == W-1 ? "\n" : " ");
      }
   }

   return 0;
}


Measured memory_bytes: 4096
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <utility>
#include <algorithm>
#include <functional>
#include <deque>
#define MAX_N 100001

using namespace std;

struct edge { int to, distance; };
struct vertex { vector<edge> es; int x; };
vertex G[MAX_N];
bool checked[MAX_N];

bool check(int i) {
    for (int j = 0; j < G[i].es.size(); ++j) {
        edge e = G[i].es[j];
        if (!checked[e.to]) {
            G[e.to].x = G[i].x + e.distance;
            checked[e.to] = true;
            if(!check(e.to))
                return false;
        } else {
            if (G[e.to].x != G[i].x + e.distance)
                return false;
        }
    }
    return true;
}

int main() {
    
    int N, M;
    cin >> N >> M;
    for (int i = 0; i < M; ++i) {
        int l, r, d;
        cin >> l >> r >> d;
        G[l-1].es.push_back(edge{r-1, d});
        G[r-1].es.push_back(edge{l-1, -d});
    }
    
    fill(checked, checked + MAX_N, false);
    bool flag = true;
    for (int i = 0; i < N; ++i) {
        if (!checked[i]) {
            G[i].x = 0;
            checked[i] = true;
            if(!check(i))
                flag = false;
        }
    }
    
    if (flag)
        cout << "Yes\n";
    else
        cout << "No\n";
    
    return 0;
}


Measured memory_bytes: 11520
#include <bits/stdc++.h>
 
using namespace std;
 
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz(x) ((int)(x).size())
#define whole(x) (x).begin(), (x).end()
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair < int, int > pii;
typedef pair < ll, ll > pll;
 
const int N = int(2e5) + 2;
const int LG = 20;
const ll mod = (int)1e9 + 7;
const int INF = (int)1e9 + 7;
const ll linf = 1e18; 
const ld pi = acos(-1);
const int base = 10;
const ld EPS = 1e-9;

int n;
ld a[55];
int main (){
    cin >> n;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    sort (a + 1, a + n + 1);
    for (int i = 2; i <= n; ++i) a[i] = (a[i - 1] + a[i]) / 2.0;
    cout << fixed << setprecision(11) << a[n]; 
}

Measured memory_bytes: 256
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

"""
・pseudo-tree graph
・in_deg = 1が保証されているので、向きの揃ったcycleがある
・1箇所の2択を決めれば全部決まる
"""

N = int(readline())
parent = [0] + list(map(int,read().split()))

child = [[] for _ in range(N+1)]
for i,x in enumerate(parent):
    child[x].append(i)

out_deg = [len(x) for x in child]

out_deg

G = [-1] * (N+1)

# とりあえず唯一のサイクル以外を処理：out_deg=0の頂点を捨てていく

stack = [i for i,x in enumerate(out_deg) if not x]
while stack:
    x = stack.pop()
    se = set(G[c] for c in child[x])
    g = 0
    while g in se:
        g += 1
    G[x] = g
    p = parent[x]
    out_deg[p] -= 1
    if not out_deg[p]:
        stack.append(p)

"""
・grundy数の候補は2種。
・片方決め打って計算。2周grundy数を計算してstableになっていればよい。
"""

for i,x in enumerate(out_deg[1:],1):
    if x==1:
        root = i
        break

cycle_len = sum(out_deg[1:])

is_stable = False
x = root
for _ in range(cycle_len*2+10):
    se = set(G[c] for c in child[x])
    g = 0
    while g in se:
        g += 1
    if g == G[x]:
        is_stable = True
        break
    G[x] = g
    x = parent[x]

answer = 'POSSIBLE' if is_stable else 'IMPOSSIBLE'
print(answer)

Measured memory_bytes: 44968
import sys
sys.setrecursionlimit(1000000000)
input = sys.stdin.readline
n=int(input())

a=[0]*(n)
for j in range(1,n+1):
    for k in range(1,n+1):
        for l in range(1,n+1):
            if j**2+k**2+l**2+j*k+k*l+l*j>n:
                break
            else:
                a[j**2+k**2+l**2+j*k+k*l+l*j-1]+=1

for i in a:
    print(i)

Measured memory_bytes: 74928
n = int(input())
x_list = list(map(int, input().split()))
y_list = list(map(int, input().split()))
list_sa = [abs(x_list[i] - y_list[i]) for i in range(n)]
list_sa2 = [pow(i, 2) for i in list_sa]
list_sa3 = [pow(i, 3) for i in list_sa]
print(sum(list_sa))
print(pow(sum(list_sa2), 1/2))
print(pow(sum(list_sa3), 1/3))
print(max(list_sa))


Measured memory_bytes: 5644
#include <iostream>

int main() {
    int A1,A2,A3;

    std::cin >> A1 >> A2 >> A3;

    if((A1+A2+A3)>=22){
        std::cout << "bust" << std::endl;
    }
    else{
        std::cout << "win" << std::endl;
    }


    return 0;
}

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

using namespace std;

typedef long long ll;

int N;
ll a[200000 + 10];

ll ans = 0;
ll num_to_pos[200000 + 10];

int main() {
	cin >> N;
	fill(num_to_pos, num_to_pos + N, -1);
	for (int i = 0; i < N; i++)cin >> a[i], num_to_pos[a[i]] = i;

	set <ll> donepos;
	for (ll i = 1; i <= N; i++) {
		if (donepos.size() == 0) {
			ans += (num_to_pos[i] + 1) * (N - num_to_pos[i]) * i;
			donepos.insert(num_to_pos[i]);
		}
		else {
			ll l = -1, r = N;
			donepos.insert(num_to_pos[i]);
			if (donepos.find(num_to_pos[i]) != donepos.begin()) {
				auto befnow = donepos.find(num_to_pos[i]);
				befnow--;
				l = *befnow;
			}
			auto befend = donepos.end();
			befend--;
			if (donepos.find(num_to_pos[i]) != befend) {
				auto nxtnow = donepos.find(num_to_pos[i]);
				nxtnow++;
				r = *nxtnow;
			}
			ans += (num_to_pos[i] - l) * (r - num_to_pos[i]) * i;
		}
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;

#define llint long long int
#define REP(i,s,l) for(llint i=s;i<l;i++)
#define DEBUG 0
#define INF (1LL<<50)
#define MOD 1000000007

int main() {

    int ryokan;
    int height[20];
    cin >> ryokan;
    int count=1;
    int heightMax=0;

    REP(i,0,ryokan){
        cin >> height[i];
    }

    REP(i,0,ryokan-1){
        if(heightMax < height[i]) heightMax = height[i] ;
        if(height[i+1] >= heightMax) count++; 
    }

    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(1000000)
n=int(input())


def dfs(s,x):
  if len(s)==n:
    print(s)
  else:
    for i in range(x):
      dfs(s+chr(ord("a")+i),x)
    dfs(s+chr(ord("a")+x),x+1)  
dfs("a",1) 
  

Measured memory_bytes: 9212
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main() {
	int n,m;
	cin>>n>>m;
	priority_queue<P, vector<P>,greater<P> > task_q;
	priority_queue<int> cda_q;
	for(int i = 0; i < n; i++) {
		int a,b;
		cin>>a>>b;
		P p(a,b);
		task_q.push(p);
	}
	int ans = 0;
	for(int day = m-1; day >= 0; day--) {
		if(!task_q.empty()) {
			while(!task_q.empty() && task_q.top().first + day <= m) {
				P task = task_q.top(); task_q.pop();
				cda_q.push(task.second);
			}
		}
		if(!cda_q.empty()) {
			ans += cda_q.top(); cda_q.pop();
		}
	}
	cout << ans << endl;
}


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

#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)((n)-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define fi first
#define se second
#define debug(...) {cerr<<"[L"<<__LINE__<<"] "; _debug(__VA_ARGS__);}

template<typename T>
string join(const vector<T>&v, string del=", "){ stringstream s;
    for(auto x : v) s << del << x; return s.str().substr(del.size());
}
template<typename T>
ostream& operator<<(ostream& o, const vector<T>&v){
    if(v.size()) o << "[" << join(v) << "]"; return o;
}
template<typename T>
ostream& operator<<(ostream& o, const vector<vector<T> >&vv){
    int l = vv.size();
    if(l){ o<<endl; rep(i,l) o << (i==0 ? "[ " : ",\n  " ) << vv[i] << (i==l-1 ? " ]" : ""); }
    return o;
}
template<typename T1, typename T2>
ostream& operator<<(ostream& o, const pair<T1, T2>& p){
    return o << "(" << p.first << ", " << p.second << ")";
}
inline void _debug(){cerr<<endl;}
template<class First, class... Rest>
void _debug(const First& first, const Rest&... rest){cerr<<first<<" ";_debug(rest...);}

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

const double PI = (1*acos(0.0));
const double EPS = 1e-9;
const int INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const ll mod = 1e9 + 7;

inline void finput(string filename) {
    freopen(filename.c_str(), "r", stdin);
}

struct Sieve{
    int n;
    vi f, primes;
    Sieve(int n): n(n), f(n+1){
        f[0] = f[1] = -1;
        for(ll i=2; i<=n; i++){
            if(f[i]) continue;
            primes.push_back(i);
            f[i] = i;
            for(ll j=i*i; j<=n; j += i){
                if(!f[j]) f[j] = i;
            }
        }
    }
    bool isPrime(int x){ return f[x] == x; }
    vi prime_factor(int x){
        vi res;
        while(x != 1){
            res.push_back(f[x]);
            x /= f[x];
        }
        return res;
    }
    vector<pii> factor(int x){
        vi pf = prime_factor(x);
        if(pf.size() == 0) return {};
        vector<pii> res(1, pii(pf[0], 0));
        for(int p : pf){
            if(res.back().first == p){
                res.back().second++;
            }else{
                res.emplace_back(p, 1);
            }
        }
        return res;
    }
};

int main(){
    ios_base::sync_with_stdio(0);
    // finput("./input");
    int NUM = 1000010;
    int n; cin >> n;
    auto sieve = Sieve(NUM);
    vi a(n);
    rep(i,n) cin >> a[i];

    vi table(NUM);
    rep(i,n){
        auto pv = sieve.prime_factor(a[i]);
        set<int> primes(all(pv));
        for(auto prime : primes){
            table[prime]++;
        }
    }
    string ans = "pairwise coprime";
    rep(i,NUM){
        if(table[i] == n){
            ans = "not coprime";
            break;
        }else if(table[i] > 1){
            ans = "setwise coprime";
        }
    }
    cout << ans << endl;
    return 0;
}

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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repr(i, n) for(int i = (n-1); i >= 0; --i)

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; }

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

const int MAX = 200005;
const int INF = 1001001001;
const int MOD = 1000000007;

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

    queue<ll> q;
    int cnt = 0;
    for (int i = 1; i < 10; ++i) {
        q.push(i);
    }

    while (cnt < K) {
        ll n = q.front(); q.pop();
        cnt++;
        if (cnt == K) {
            cout << n << endl;
            return 0;
        }
        if (0 < (n%10)) q.push(n*10 + (n%10) - 1);
        q.push(n*10 + (n%10));
        if ((n%10)+1 < 10) q.push(n*10 + (n%10) + 1);
    }
}

Measured memory_bytes: 1792
#include <iostream>
#include <deque>
#include <algorithm>
#include <iterator>
#include <numeric>

int minus1(int zero_front, int zero_back, std::deque<int> &A){
  for(int i = zero_front + 1 ; i < zero_back ; i++){
    A[i] -= 1;
  }
  return 1;
}

int main(){
  int N;
  std::cin>>N;
  std::deque<int> h;
  std::copy_n(std::istream_iterator<int>(std::cin) ,N ,std::back_inserter(h));

  h.push_back(0);
  h.push_front(0);
  
  int count = 0;
  int zero_front = 0;
  while(zero_front !=(int) h.size() - 1){
    zero_front = 0;
    int zero_back  = 0;
    bool check_front = false;
    for(int i = 0 ; i < (int)h.size() ; i++){
      if(h[i] != 0) {
	check_front = true;
	break;
      }else{
	zero_front = i;
      }
    }
    if(check_front == true){
      for(int i = zero_front + 1 ; i < (int)h.size(); i++ ){
	if(h[i] == 0){
	  zero_back = i;
	  break;
	}
      }
      count += minus1(zero_front, zero_back, h);
    }
  }
  std::cout << count << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
using namespace std;
using ll =long long;
int main() {
	ll X;

	cin >> X;
	
	cout << (X / 500) * 1000 + X % 500 - X % 5;





}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int tmp[] = {10,50,100,500},n;
  bool ok = false;
  while(cin >> n && n){
    if(ok) cout << endl;
    else ok = true;
    int a[4],b[4];
    for(int i=0;i<4;i++){
      cin >> a[i];
    }
    int money = (a[3] * 500 + a[2] * 100 + a[1] * 50 + a[0] * 10) - n;
    b[3] = money/500;
    b[2] = money%500/100;
    b[1] = money%100/50;
    b[0] = money%50/10;
    for(int i=0;i<4;i++){
      if(a[i] - b[i] > 0){
        cout << tmp[i] << " " << a[i] - b[i] << endl;
      }
    }
  }
}

Measured memory_bytes: 1160
#include <cstdio>
#include <cstdlib>
#include <ctime>
#define N 200000

int a[N];

void swap(int *x_ptr, int *y_ptr);
void heap_struct(int t, int last);

void heap_sort(int a[], int n)
{
	for (int i = (n - 2) / 2; i >= 0; i--)
	{
		heap_struct(i, n - 1);
	}
	for (int i = n - 1; i > 0; i--)
	{
		swap(&a[0], &a[i]);
		heap_struct(0, i - 1);
	}
}

int main(void)
{
	int n, min, i;
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d",&a[i]);
	}

	heap_sort(a, n);

	for (i = 0; i < n; i++)
	{
		if (a[i] == a[i + 1])
		{
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");

	return 0;
}

void swap(int *x_ptr, int *y_ptr)
{
	int temp = *x_ptr;
	*x_ptr = *y_ptr;
	*y_ptr = temp;
}
void heap_struct(int t, int last)
{
	int tmp;
	int j;
	tmp = a[t];
	while (1)
	{
		j = 2 * t + 1;
		if (j > last)
			break;
		if (j != last && a[j + 1] > a[j])
			j++;
		if (tmp >= a[j])
			break;
		a[t] = a[j];
		t = j;
	}
	a[t] = tmp;
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;
const int INF = INT_MAX;

int main() {
	int H, W, h, w;
	cin >> H >> W >> h >> w;

	int ans = (H - h) * (W - w);

	cout << ans << endl;
}

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

int main() {
    int n, x;
    cin >> n >> x;
    int sum = 0, i, l;
    for (i = 1; i <= n; i++) {
        cin >> l;
        sum += l;
        if (sum > x) break;
    }
    cout << i;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstring>
#include <cstdlib>
#include <iomanip>
#include <string>
#include <ctype.h>

const int INF =100000000;

using namespace std;

int main(){

  while(1){
    int t;
    cin >>t;

    if(t == 0){
      break;
    }else{
      int n;
      int sum=0;
      cin >> n;
      for(int i = 0;i < n;i++){
	int a1,a2;
	cin >> a1 >> a2;
	sum += (a2-a1);
      }
      if(sum >= t){
	cout << "OK" << endl;
      }else{
	cout << t - sum << endl;
      }
    }
  }
} 


Measured memory_bytes: 1164
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 30 20:27:30 2020

@author: black
"""

N, X, Y = map(int, input().split())

def sp_root(i, j, X, Y): #i<j, X+1<Y
    root = abs(X-i) + abs(Y-j) + 1
    return root

k_lis = [0]*(N-1)

ans = 0
for i in range(1,N):
    for j in range(i+1,N+1):
        k_lis[min(j - i, sp_root(i, j, X, Y))-1] += 1

for i in k_lis:
    print(i)

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

int main(){
    string S;
    bool dp[100010] = {0};
    cin >> S;
    int size = S.size();
    if(size >= 5 && S.substr(0, 5) == "dream"){
        dp[4] = true;
    }
    if(size >= 5 && S.substr(0, 5) == "erase"){
        dp[4] = true;
    }
    if(size >= 6 && S.substr(0, 6) == "eraser"){
        dp[5] = true;
    }
    if(size >= 7 && S.substr(0, 7) == "dreamer"){
        dp[6] = true;
    }
    for(int i=7; i<size; i++){
        if(S.substr(i-4, 5) == "dream" && dp[i-5]){
            dp[i] = true;
        }
        if(S.substr(i-6, 7) == "dreamer" && dp[i-7]){
            dp[i] = true;
        }
        if(S.substr(i-4, 5) == "erase" && dp[i-5]){
            dp[i] = true;
        }
        if(S.substr(i-5, 6) == "eraser" && dp[i-6]){
            dp[i] = true;
        }
    }
    cout << (dp[size-1] ? "YES" : "NO");
    return EXIT_SUCCESS;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
signed main()
{ 
  vector <double> a;
  double  n,b=0,c;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>c;
    a.push_back(c);
  }
  sort(a.begin(),a.end());
  b=a[0];
  for(int i=0;i<n-1;i++){
  b=(b+a[i+1])/2;
  }
  cout<<b<<"\n";
}




Measured memory_bytes: 256
#include<iostream>

int n, k;

int main()
{
	std::cin >> n >> k;
	for( int i = 0; i < k; i++ ){
		int a, b;
		std::cin >> a >> b;
		
		std::cout << std::min( a - 1, std::min( n - a, std::min( b - 1, n - b ) ) ) % 3 + 1 << std::endl;
	}
		
	
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define rep(I, N) for (int I = 1; I <= (N); ++I)
#define repp(I, N) for (int I = 0; I < (N); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORR(I, A, B) for (int I = (A); I >= (B); I--)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
const int N = 2e5 + 5;
const double eps = 1e-7;
const int mod = 1e9 + 7;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
LL gcd(LL a,LL b){return b>0?gcd(b,a%b):a;}
LL ksm(LL a,LL b){LL ans = 1;while(b){if(b&1) ans = ans * a % mod;a = a * a % mod;b >>= 1;}return ans % mod;}
int a[N];
int main() {
    int n;
    cin >> n;
    rep(i,n) cin >> a[i];
    sort(a + 1,a + n + 1);
    int x = a[n / 2];
    int y = a[n / 2 + 1];
    cout << y - x << endl;
    return 0;
}


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

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

    int count = 0;
    for (int i = 0; i < 3; i++) {
        if (S[i] == T[i]) {
            count++;
        }
    }

    cout << count << endl;

    return 0;
}

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

int main() {
    vector<ll> a(3);
    cin>>a[0]>>a[1]>>a[2];
    sort(a.begin(),a.end());
    cout<<a[0]+a[1]<<endl;
}


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


int main() {
	int n;
	cin >> n;
	int a[100];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (int i = n - 1; i >= 0; --i) {
		cout << a[i];
		if (i != 0) {
			cout << ' ';
		}else {
			cout << endl;
		}
		
	}
	return 0;
}

Measured memory_bytes: 1160
#include <iostream>

using namespace std;

int main()
{
	bool f = true;
	while (f) {
		int a, b;
		char c;
		cin >> a >> c >> b;
		switch (c) {
		case '+':
			cout << a + b << endl;
			break;
		case '-':
			cout << a - b << endl;
			break;
		case '*':
			cout << a * b << endl;
			break;
		case '/':
			cout << a / b << endl;
			break;
		case '?':
			f = false;
			break;
		}
	}

	return 0;
}


Measured memory_bytes: 3084
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define FOR(i,k,n) for(int(i)=(k);(i)<(n);++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v),end(v)
#ifdef ONLINE_JUDGE
  #define debug(x)
  #define debug2(x,y)
  #define debug3(x,y,z)
  #define assert(e) if(!(e)){stod("");}
#else
  #define debug(x) std::cerr<<#x<<": "<<x<<"\n"
  #define debug2(x,y) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<"\n"
  #define debug3(x,y,z) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<", "<<#z<<": "<<z<<"\n"
#endif

using ll=long long;
using vi=std::vector<int>;
using vvi=std::vector<vi>;
using vll=std::vector<ll>;
using vvll=std::vector<vll>;
template<typename T> using vvec=std::vector<std::vector<T>>;
template<typename T>
auto make_v(size_t sz){return std::vector<T>(sz);}
template<typename T,typename... Ts>
auto make_v(size_t sz,Ts...ts){return std::vector<decltype(make_v<T>(ts...))>(sz,make_v<T>(ts...));}
template<typename T>
void fill_v(T&var,const T&x){var=x;}
template<typename V,typename T>
void fill_v(V&v,const T&x){for(auto&& w:v){fill_v(w,x);}}

template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<std::vector<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<std::deque<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s, const std::set<T>&v){
  s<<"\n";for(auto&& elm:v){s<<elm<<"\t";}s<<"\n";return s;}

inline void scan(int&a){scanf("%d",&a);}
inline void scan(ll&a){scanf("%lld",&a);}
inline void scan(char&a){scanf(" %c",&a);}
inline void scan(double&a){scanf("%lf",&a);}
template<typename T>
inline void scan(std::vector<T>&v){for(auto&& sv:v){scan(sv);}}
template<typename First,typename...Args>
inline void scan(First&f,Args&...args){scan(f);scan(args...);}
inline void scan(std::string&s){char BUF[3000000];scanf(" %s",BUF);s=std::string(BUF);}
inline void print(int a){printf("%d\n",a);}
inline void print(ll a){printf("%lld\n",a);}
inline void print(double a){printf("%.12f\n",a);}
inline void print(std::string s){std::cout<<s<<"\n";}

using namespace std;

void solve() {
  string s, t;
  scan(s);
  scan(t);
  int n = s.size();
  int ans = 0;
  rep (i, n) {
    if (s[i] != t[i]) {
      ans += 1;
    }
  }
  print(ans);
}

int main() {
  solve();
  return 0;
}


Measured memory_bytes: 3456
#include <bits/stdc++.h>
#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 debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) rep(i, x.size()) cerr << x[i] << (i == x.size() - 1 ? "\n" : " ")
#define all(x) x.begin(),x.end()
#define int long long
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = ((1LL << 30) + (1LL << 29));
const int MOD = 1000000007;

//=============================
int N,M,K;
string S,T;
vector<int> A;
vector<int> B;
//=============================
void input()
{
    cin>>N;
}
//=============================
void func(){}
bool is_prime[66666];
vector<int> P;
void Eratosthenes(const int N)
{
    for (int i = 0; i <= N; i++)
    {
        is_prime[i] = true; // initialize.
    }
    for (int i = 2; i <= N; i++)
    {
        if (is_prime[i])
        {
            for (int j = 2 * i; j <= N; j += i)
            {
                is_prime[j] = false;
            }
            P.emplace_back(i);
        }
    }
}
//=============================
void solve()
{
    Eratosthenes(66666);
    int j=0;
    rep(i,N){
        for(;;++j){
            if (P[j]%5==3){
                cout<<P[j]<<" ";
                ++j;
                break;
            }
        }
    }
    cout<<endl;

}
//=============================
signed main()
{
    input();
    solve();
    return 0;
}

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

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

    for(int i = 0; i < n; i++){
        cin >> s[i];
    }
    sort(s.begin(), s.end());
    s.erase(unique(s.begin(), s.end()), s.end());

    cout << s. size() << endl;

}

Measured memory_bytes: 9600
from collections import defaultdict
import math
N, M = map(int, input().split(' '))
A = list(map(int, input().split(' ')))
kijun = sum(A)/M/4

a = list(filter(lambda x: x >= kijun, A))
if len(a) >= M:
    print('Yes')
else:
    print('No')


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

int main()
{
  int n,t;cin>>n>>t;
  vector<int> a(n);
  int i;
  for(i=0;i<n;i++)cin>>a.at(i);
  vector<int>bmax(n);
  bmax.at(n-1)=a.at(n-1);
  for(i=n-2;i>=0;i--)
  {
    bmax.at(i)=max(bmax.at(i+1),a.at(i));
  }
  vector<int> dis(n);
  for(i=0;i<n;i++)dis.at(i)=bmax.at(i)-a.at(i);
  sort(dis.begin(),dis.end());
  reverse(dis.begin(),dis.end());
  int ans=1;
  for(i=1;i<n;i++)
  {
    if(dis.at(i)==dis.at(0))ans++;
    else break;
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 1536
n,y=map(int,input().split())
for a in range(n+1):
    for b in range(n+1):
        c=n-a-b
        if c<0:
            continue 
        if a*10000+b*5000+c*1000==y:
            print(a,b,c)
            exit()
print('-1 -1 -1')

Measured memory_bytes: 41452
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use text_io::*;

const U_INF: usize = 1 << 60;
const I_INF: isize = 1 << 60;

fn main() {
    let a: usize = read!();
    let b: usize = read!();
    let c: usize = read!();

    let ans = if (a..=b).contains(&c) || (b..=a).contains(&c) {
        "Yes"
    } else {
        "No"
    };
    println!("{}", ans);
}


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

namespace AtCoders {
	class Program {
		static void Main(string[] args) {
			
			int[] numArray = { 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51 };
			var inputArray = retreiveIntArray();
			var inputCount = 1;

			// 不正な入力は処理しない
			if (inputArray.Length != inputCount) {
				Console.WriteLine("invalid input");
				return;
			}
			var K = inputArray[0];

			//答えの出力
			var ans = numArray[K-1];
			Console.WriteLine(ans);

		}

		/// <summary>
		/// スペースで区切られた文字列配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static string[] retreiveStringArray() {
			var inputArray =  Console.ReadLine().Split(' ');
			return inputArray;
		}

		/// <summary>
		/// スペースで区切られた整数配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static int[] retreiveIntArray() {
			var inputArray = Console.ReadLine().Split(' ');
			var intArray = inputArray.Select(s => int.Parse(s));
			return intArray.ToArray();
		}
	}
}


Measured memory_bytes: 13396
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define rep(i, n) for (int i = 0; i < n; i++)

int main() {
  int N;
  cin >> N;
  vector<int> X, Y, H;
  rep(i, N) {
    int x, y, h;

    cin >> x >> y >> h;
    X.push_back(x);
    Y.push_back(y);
    H.push_back(h);
  }

  bool end_flag = false;
  int result_x, result_y, result_h;
  rep(i, 101) {
    if (end_flag) break;
    rep(j, 101) {
      if (end_flag) break;
      end_flag = true;
      // resultを計算
      rep(k, N) {
        if (H[k] == 0) continue;
        result_x = i;
        result_y = j;
        result_h = H[k] + abs(X[k] - result_x) + abs(Y[k] - result_y);
        break;
      }

      //すべての調査結果に適合するか
      rep(k, N) {
        if (max(result_h - abs(X[k] - result_x) - abs(Y[k] - result_y), 0) ==
            H[k]) {
          continue;
        } else {
          end_flag = false;
          break;
        }
      }
    }
  }

  cout << result_x << " " << result_y << " " << result_h << endl;
  return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
B - AcCepted
https://beta.atcoder.jp/contests/abc104/tasks/abc104_b

"""
import sys
from sys import stdin
input = stdin.readline


def solve(S):
    result = 'AC'
    if S[0] != 'A':
        result = 'WA'
    if S[2:-1].count('C') != 1:
        result = 'WA'
    S = S[1:2] + S[2:-1].replace('C', 'c') + S[-1:]
    if not S.islower():
        result = 'WA'
    return result


def main(args):
    S = input().strip()
    ans = solve(S)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])


Measured memory_bytes: 3064
#include <algorithm>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define INF 10000000

int main() {
  int N, T, A;  //個数、気温、目標気温
  cin >> N >> T >> A;
  int now;
  int res = 0;
  vector<int> H(N);
  int min = INF;
  for (int i = 0; i < N; i++) {
    cin >> H[i];
    now = 1000 * A - (1000 * T - H[i] * 6);
    if (now < 0) now = -now;
    if (now < min) min = now, res = i + 1;
  }

  cout << res << endl;
}

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

using namespace std;

#define sz(v)           ((int)((v).size()))
#define clr(v, d)       memset(v, d, sizeof(v))
#define rep(i, v)       for(int i=0; i<sz(v); ++i)
#define lp(i, n)        for(int i=0; i<(int)(n); ++i)
#define lpi(i, j, n)    for(int i=(j); i<(int)(n); ++i)
#define lpd(i, j, n)    for(int i=(j); i>=(int)(n); --i)
#define INF             1000000000

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;

void init(){
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
}

const int N = 2e3+5;

int main()
{
	init();
	int n; ll res = 0;
	int arr[N];
	cin >> n;
	lp(i, n)
		cin >> arr[i];
	sort(arr, arr+n);
	lp(i, n){
		lpi(j, i+1, n){
			int num = 0;
			int max_idx = lower_bound(arr, arr+n, arr[i] + arr[j]) - arr;
			int min_idx = upper_bound(arr, arr+n, arr[j] - arr[i]) - arr;
			if(i >= min_idx && i < max_idx)
				--num;
			if(j >= min_idx && j < max_idx)
				--num;
			num += (max_idx - min_idx);
			res += max(num, 0);
		}
	}
	cout << res/3;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF=1e9,MOD=1e9+7,ohara=1e6+10;
const ll LINF=1e18;
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl
#define Cerr(x) cerr<<(x)<<endl
#define fi first
#define se second

ll n,cnt,ans,a[ohara],b,c,d,tmp,tmpp,m,h,w,x,y,sum,pos,k;
ld doua;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
//int dy[]={-1,0,1,-1,1,-1,0,1};
//int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

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

    cin>>n;
    rep(i,n)cin>>a[i];
    if((*max_element(a,a+n))-(*min_element(a,a+n))>=2)Cout("No");
    else{
        if((*max_element(a,a+n))-(*min_element(a,a+n))==0){
            if(a[0]==n-1)Cout("Yes");
            else{
                if(a[0]*2<=n)Cout("Yes");
                else Cout("No");
            }
        }
        else{
            ll maxcou=0,mincou=0;
            ll ma=(*max_element(a,a+n));
            rep(i,n){
                if(a[i]==ma)maxcou++;
                else mincou++;
            }
            // mincouは一人ぼっちの子猫ちゃん
            //一人全員と自分と同じ奴が見えてる
            if(mincou<=ma-1&&2*(ma-mincou)<=maxcou)Cout("Yes");
            else Cout("No");
        }
    }
    return 0;
}


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

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rep2(i, a, b) for (ll i = (a); i < (b); i++)
#define chmax(x, v)                                                            \
  do {                                                                         \
    x = max(x, v);                                                             \
  } while (0)
#define chmin(x, v)                                                            \
  do {                                                                         \
    x = min(x, v);                                                             \
  } while (0)
typedef uint64_t ull;
typedef int64_t ll;
typedef std::pair<ll, ll> PLL;

using namespace std;

ll N,K;
vector<ll> a;

// ペアの積がm以下である組み合わせ数
ll f(ll m) {
  // printf("m=%ld\n",m);
  ll t = 0;

  ll i=0;
  while (i < N && a[i] < 0) {
    // a[i]が負
    ll l = -1, r = N;
    while (l+1 < r) {
      ll x = (l+r)/2;
      if (a[x] * a[i] <= m) {
        r = x;
      } else {
        l = x;
      }
    }
    ll d = N - r;
    t += d;
    // printf("i=%ld d=%ld\n", i, d);
    i++;
  }

  while (i < N) {
    // a[i]が0以上
    ll l = -1, r = N;
    while (l+1 < r) {
      ll x = (l+r)/2;
      if (a[x] * a[i] <= m) {
        l = x;
      } else {
        r = x;
      }
    }
    ll d = r;
    t += d;
    // printf("i=%ld d=%ld\n", i, d);
    i++;
  }

  rep(i, N) {
    if (a[i] * a[i] <= m) {
      t--;
    }
  }
  t /= 2;
  return t;
}

signed main() {
  cin >> N >> K;
  a.resize(N);
  rep(i, N)
    cin >> a[i];
  sort(begin(a), end(a));

  ll l = -1e18-3, r = 1e18+3;
  while (l+1 < r) {
    ll m = (l+r)/2;
    if (f(m) < K) {
      l = m;
    } else {
      r = m;
    }
  }
  cout << r << endl;
  return 0;
}



Measured memory_bytes: 1920
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <vector>


#define REP(i,n) for(int i=0; i<n; i++)
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;
 
#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9

using namespace std;
typedef long long ll;

int n, K;
ll a[1003];
vector<ll> subsum;

int main(){
	
	
	cin >> n >> K;
	
	REP(i,n){
		cin >> a[i];
	}
	
	for (int i=0; i<n; i++){
		ll s = 0;
		for (int k=i; k<n; k++){
			s += a[k];
			subsum.push_back(s);
		}
	}
	
	ll ans = 0;
	for (int i=40; i>=0; i--){
		ll po = ans + ((ll)1<<i);
		
		int count=0;
		REP(j,subsum.size()){
			if ((subsum[j] & po) == po){
				count++;
			}
		}
		if (count>=K){
			ans = po;
		}
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 5872