akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
int n,k;
int main()
{
    scanf("%d%d",&n,&k);
    double ans=0.0;
    for(int i=1;i<=n;i++){
        int tmp=i;
        int cnt=0;
        while(tmp<k){
            tmp*=2;
            cnt++;
        }
        ans+=pow(2,-cnt);
    }
    printf("%.12f\n",ans/n);
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();
		String[] hikakuStr = line.split("[\\s]+");

		int a = Integer.parseInt(hikakuStr[0]);
		int b = Integer.parseInt(hikakuStr[1]);
		int c = Integer.parseInt(hikakuStr[2]);
		int[] hikakuInt = new int[3];

		hikakuInt[0] = a;
		hikakuInt[1] = b;
		hikakuInt[2] = c;
		int buf = 0;

		for (int w = 0; w < hikakuInt.length - 1; w++) {
			for (int i = 1; i < hikakuInt.length; i++) {
				if (hikakuInt[i - 1] > hikakuInt[i]) {
					buf = hikakuInt[i - 1];
					hikakuInt[i - 1] = hikakuInt[i];
					hikakuInt[i] = buf;
				}
			}
		}
		System.out
				.println(hikakuInt[0] + " " + hikakuInt[1] + " " + hikakuInt[2]);
	}
}

Measured memory_bytes: 24376
while(True):
    (H,W)=[int(s) for s in input().split()]
    if (H,W) == (0,0):
        break
    for j in range(H):
        for k in range(W):
            if (j+k)%2 == 0:
                print("#",end="")
            else:
                print(".",end="")
        print("")
    print("")

Measured memory_bytes: 9104
n = int(input())
h = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]


class SegmentTree:
    def __init__(self, a, func=max, one=-10 ** 18):
        self.logn = (len(a) - 1).bit_length()
        self.n = 1 << self.logn
        self.func = func
        self.one = one

        self.b = [self.one] * (2 * self.n - 1)
        for i, j in enumerate(a):
            self.b[i + self.n - 1] = j
        for i in reversed(range(self.n - 1)):
            self.b[i] = self.func(self.b[i * 2 + 1], self.b[i * 2 + 2])

    def get_item(self, i):
        return self.b[i + self.n - 1]

    def update(self, i, x):
        self.b[i + self.n - 1] = x
        while i != 0:
            i = (i - 1) // 2
            self.b[i] = self.func(self.b[i * 2 + 1], self.b[i * 2 + 2])

    def update_func(self, index, x):
        i = index + self.n - 1
        self.b[i] = self.func(self.b[i], x)
        while i != 0:
            i = (i - 1) // 2
            self.b[i] = self.func(self.b[i * 2 + 1], self.b[i * 2 + 2])

    def get_segment(self, l, r, i=0):
        j = i - (1 << ((i + 1).bit_length() - 1))+1
        length = 1 << (self.logn - (i + 1).bit_length() + 1)
        ll = j * length
        rr = (j + 1) * length
        if l <= ll and rr <= r:
            return self.b[i]
        elif rr <= l or r <= ll:
            return self.one
        else:
            return self.func(self.get_segment(l, r, i * 2 + 1),
                             self.get_segment(l, r, i * 2 + 2))


seg = SegmentTree([0]*(n+1))

for i in range(n):
    j = seg.get_segment(0, h[i] + 1)
    seg.update_func(h[i], j + a[i])
print(seg.get_segment(0, n+1))


Measured memory_bytes: 121596
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> P;
typedef vector<vector<int>> Matrix;
static const int INF = 2000000000;


int main(){
  int a, b;
  cin >> a >> b;
  int ans = max(a+b, max(a*b, a-b));
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
const int MAX_V = 1000000; 
int prime[1000000+1];
int main() {
	int i, k, v;
	for(i = 2; i <= MAX_V; i++) {
		prime[i] = 1;
	}
	for(i = 2; i*i <= MAX_V; i++) {
		if(prime[i]) {
			for(k = 2 * i; k <= MAX_V; k += i) {
				prime[k] = 0;
			}
		}
	}
	while(scanf("%d", &v) != EOF) {
		for(i = v;i > 2;i--){
			if(prime[i]==1 && prime[i-2]==1){
				printf("%d %d\n",i-2,i);
				break;
			}
		}
	}
return 0;
}

Measured memory_bytes: 4504
#include <iostream>
#include <algorithm>

constexpr int MAX_N = 100000, INF = 2147483647;

int n, q;

int seg[MAX_N * 4];

void init(int x) {

	n = 1;

	while (x > n)
		n *= 2;

	for (int i = 0; i < n * 2 - 1; ++i)
		seg[i] = INF;
}

void update(int k, int a) {

	k += n - 1;

	seg[k] = a;

	while (k > 0) {

		k = (k - 1) / 2;

		seg[k] = std::min(seg[k * 2 + 1], seg[k * 2 + 2]);
	}
}

int query(int a, int b, int k, int l, int r) {

	if (r <= a || b <= l)
		return INF;

	if (a <= l&&r <= b)
		return seg[k];

	int vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
	int vr = query(a, b, k * 2 + 2, (l + r) / 2, r);

	return std::min(vl, vr);
}

int main() {

	std::cin >> n >> q;

	init(n);

	int t, x, y;

	for (int i = 0; i < q; ++i) {

		std::cin >> t >> x >> y;

		if (t == 0)
			update(x, y);
		else
			std::cout << query(x, y + 1, 0, 0, n) << std::endl;
	}

	return 0;
}

Measured memory_bytes: 4120
#include <bits/stdc++.h>
 
using namespace std;
 
#define ll long long
ll dp[5009];
  ll a[5000];
int main()
{
   string s;cin>>s;
   for(int i=0;i<s.size();i++){
       set<char>ss;
       ss.insert(s[i]);
       if(i+1<s.size()){
       ss.insert(s[i+1]);
          if(ss.size()==1){
           cout<<i+1<<" "<<i+2;
           return 0;
       } 
       }
       if(i+2<s.size()){
       ss.insert(s[i+2]);
           if(ss.size()==2){
           cout<<i+1<<" "<<i+3;return 0;
           
       }
       }
   }cout <<"-1 -1";

}

Measured memory_bytes: 3720
#include<iostream>
using namespace std;
int main() {
    int n, k;
    cin >> n >> k;
    //公式解説youtube 25:20
    double tmp = (double)(n - k) / (k - 1);
    if (tmp != (int)tmp) { // 切り上げ
        tmp = (int)tmp + 1;
    }
    int g = tmp + 1;
    cout << g << endl;
    return 0;
}




Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;

int main() {
    int n;
    cin >> n;
    int k;
    cin >> k;
    vector<ll> a(n);
    rep(i, n) {
        cin >> a[i];
    }

    vector<vector<ll> > sum(n, vector<ll>(n, -1));
    vector<ll> ssum(n);
    rep(i, n) {
        rep(j, n-i) {
            if(!i) {
                sum[0][j] = a[j];
                ssum[j] = a[j];
            } else {
                sum[i][j+i] = sum[i-1][j+i-1]+a[j+i];
                ssum.push_back(sum[i][j+i]);
            }
        }
    }

    ll x = 0;
    int jj = 40;
    rep(i, 41) {
        ll x_ = x+(1LL<<jj-i);
        int cou = 0;
        rep(j, n*(n+1)/2) {
            if((x_ & ssum[j]) == x_) {
                cou++;
            }
        }
        if(cou >= k) {
            x = x_;
        }
    }
    
    cout << x << endl;
}

Measured memory_bytes: 13748
#include <stdio.h>

#define INIT_LOOP 0														/* ??????????????????					*/
#define SECOND_ELEMENT 1												/* 2?????????????´?					*/
#define EXIT_SUCCESS 0													/* ????????????????????????				*/

int main( void )
{
	unsigned long usW_Delement_cnt;										/* ????´??????°						*/
	unsigned long usW_Dloop_cnt;										/* ?????????????????????				*/
	signed long slW_Delement;											/* ????´?							*/
	signed long slW_Delement_first;										/* 1?????????????´??¨???¶?????°			*/
	signed long slW_Delement_min;										/* ????°?????¨???¶?????°				*/
	signed long slW_Delement_max;										/* ?????§????¨???¶?????°				*/
	signed long slW_Dcalc;												/* ?¨??????¨?????°					*/

	scanf("%d", &usW_Delement_cnt );									/* ????´??????°?????\???				*/
	/* ????´??????°??????????????? */
	for( usW_Dloop_cnt = INIT_LOOP; usW_Dloop_cnt < usW_Delement_cnt; usW_Dloop_cnt++){
		scanf("%ld", &slW_Delement );									/* ????´??????\???					*/
		/* ????´????1?????????????´??????£?????´??? */
		if( usW_Dloop_cnt == INIT_LOOP ){
			slW_Delement_first = slW_Delement;							/* 1?????????????´??¨???¶?????°?????????	*/
		}
		else{
			/* else???????????????????????§?????\ */
		}

		slW_Dcalc = slW_Delement - slW_Delement_min;					/*?????????????¨????					*/
		/* ????´????2?????????????´??????£?????´??? */
		if( usW_Dloop_cnt == SECOND_ELEMENT ){
			slW_Delement_max = slW_Delement - slW_Delement_first;		/* ?????§????¨???¶?????°????????????????¨????	*/
		}
		/* ????´?-????°????????????§???????????§????????´??? */
		else if( slW_Delement_max < slW_Dcalc ){
			slW_Delement_max = slW_Delement - slW_Delement_min;			/* ?????§??????????´?-????°????????????????	*/
		}
		else{
			/* else?????????????????????????????\*/
		}

		/* ????´????1?????????????´??????£?????´??? */
		if( usW_Dloop_cnt == INIT_LOOP ){
			slW_Delement_min = slW_Delement;							/* ????°?????¨???¶?????°????????????????¨????	*/
		}
		/* ????´????????°???????????°?????????´??? */
		else if( slW_Delement_min > slW_Delement ){
			slW_Delement_min = slW_Delement;							/* ????°???????????´?????????????			*/
		}
		else{
			/* else?????????????????????????????\ */
		}

	}
	printf("%ld\n", slW_Delement_max);									/* ?????§????????????					*/
	return EXIT_SUCCESS;
}

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

int main() {
    string S, T;
    cin >> S >> T;
    for (int i = 0; i < S.length(); i++){
        if (S[i] != T[i]) {
            cout << "No" << endl;
            return 0;
        }
    }
    if (T.length() == S.length() + 1) {
        cout << "Yes" << endl;
    }
    return 0;
}


Measured memory_bytes: 3628
def dfs(v, n, visited, t):
    if sum(visited) == n:
        return 1
    ret = 0
    for i in range(n):
        if [v,i] not in t:
            continue
        if visited[i]:
            continue
        visited[i] = 1
        ret += dfs(i, n, visited, t)
        visited[i] = 0
    return ret


n,m = map(int,input().split())
t = []
for _ in range(m):
    a,b = map(int,input().split())
    t.append([a-1, b-1])
    t.append([b-1, a-1])
visited = [0 for i in range(n)]
visited[0] = 1
print(dfs(0, n, visited, t))


Measured memory_bytes: 3064
#include <atcoder/lazysegtree>
#include <atcoder/modint>
#include <atcoder/math>
#include <cstdio>

using namespace std;
using namespace atcoder;

using mint = modint998244353;

struct S {
    mint a;
    int size;
};

struct F {
    mint a, b;
};

mint p[200005];


S op(S l, S r) { 
    if(r.size == 0){
        return S{l.a, l.size};
    }
    else if(l.size == 0){
        return S{r.a, r.size};
    }
    return S{l.a * p[r.size] + r.a, l.size + r.size}; 
}

S e() { return S{0, 0}; }

mint v = 9;
mint w = v.inv();
S mapping(F l, S r) { 
    if(r.size == 0){
        return S{r.a, r.size};
    }
    mint v = 9;
    return S{r.a * l.a + l.b * (p[r.size] - 1) * w, r.size}; 
}

F composition(F l, F r) { return F{r.a * l.a, r.b * l.a + l.b}; }

F id() { return F{1, 0}; }

int main() {
    int n, q;
    scanf("%d %d", &n, &q);
    p[0] = 1;
    for (int i = 1; i < 200005; i++) {
        p[i] = p[i-1] * 10;
    }   

    vector<S> a(n);
    for (int i = 0; i < n; i++) {
        a[i] = S{1, 1};
    }

    lazy_segtree<S, op, e, F, mapping, composition, id> seg(a);
    
    // printf("%d\n", seg.all_prod().a.val());

    for (int i = 0; i < q; i++) {
        int l, r, d;
        cin >> l >> r >> d;
        seg.apply(l-1, r, F{0, d});
        printf("%d\n", seg.all_prod().a.val());
        // for (int i = 0; i < n; i++) {
        //     printf("%d ", seg.get(i).a.val());
        // }
        // cout << endl;
    }
}


Measured memory_bytes: 11732
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars};
#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
	input! {
		x: char,
		y: char,
	}

	if x < y {
		println!("<");
	}
	else if x > y {
		println!(">");
	}
	else {
		println!("=");
	}
}



Measured memory_bytes: 2084
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define REP(X, Y, Z) for (ll(X) = (Y); (X) < (Z); (X)++)
#define REV(X, Y, Z) for (ll(X) = (Y); (X) > (Z); (X)--)

using namespace std;
using ll = long long;
using dll = deque<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using usll = unordered_set<ll>;
using umll = unordered_map<ll, ll>;
using sll = stack<int>;
using vll = vector<ll>;
using vvll = vector<vll>;

constexpr ll kMax = 1e12 + 1;
constexpr ll kMod = 1e9 + 7;

ll gcd(ll a, ll b) {
  if (a < b) {
    return gcd(b, a);
  }
  ll c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}

ll lcm(ll a, ll b) {
  return a / gcd(a, b) * b;
}

void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}

int main() {
  init();

  ll K, S;
  cin >> K >> S;

  ll ans = 0;
  REP(i, 0, K + 1) {
    REP(j, 0, K + 1) {
      if (S - (i + j) >= 0 && S - (i + j) <= K) {
        ans++;
      }
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> VI;
typedef vector<VI> VVI;
typedef pair<ll, ll> P;
#define FOR(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define PRINT(V) for (auto v : (V)) cout << v << " "
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const ll INF = numeric_limits<ll>::max();
int main()
{
    int n; cin >> n;
    map<string, int> s;
    string a;
    rep(i, n) {
        cin >> a;
        ++s[a];
    }
    vector<string> str = {"AC", "WA", "TLE", "RE"};
    rep(i, 4){
        cout << str[i] << " x " << s[str[i]] << endl;
    }
    return 0;
}

Measured memory_bytes: 3660
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
using namespace std;
constexpr int kMod = 1000000007;
typedef long long LL;

template<typename T>
istream& operator >> (istream& is, vector<T>& vs){
  for(T& v: vs) is >> v;
  return is;
}

int main() {
  int N; cin >> N;
  vector<int> A(N); cin >> A;

  int cnt = 0;
  for (int v : A) {
    while (v % 2 == 0) {
      ++cnt; v /= 2;
    }
  }
  cout << cnt << endl;
}


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

#define REP(i, n) for (int i = 0; i < n; i++)
int main(void)
{
    double d;
    cin >> d;
    d = 2 * 3.1415926535 * d;
 
    cout << d <<  endl;
}

Measured memory_bytes: 3752
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  int A,Z;
  for (int i = 0; i < s.size(); i++){
    if (s[i]=='A'){
      A = i;
      break;
    }
  }
  for (int i = s.size() - 1; i >= 0; i--){
    if (s[i]=='Z'){
      Z = i;
      break;
    }
  }
  cout << Z-A+1;
}

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

#define         pb         push_back
#define         sf(x)      scanf("%d",&x)
#define         sfl(x)     scanf("%lld",&x)
#define         pf(x)      printf("%d\n",x)
#define         pfl(x)     printf("%lld\n",x)
#define         endl       '\n'
#define         pii        pair<int,int>
#define         mapii      map<int,int>
#define         mapll      map<ll,ll>
#define         mapci      map<char,int>
#define         mapcl      map<char,ll>
#define         mapsi      map<string,int>
#define         mapsl      map<string,ll>
#define         pll        pair<ll,ll>
#define         vi         vector<int>
#define         vl         vector<ll>
#define         vd         vector<double,double>
#define         all(c)     c.begin(),c.end()
#define         F          first
#define         S          second
#define         mp         make_pair
#define        ftc(x)      cerr << #x << ": " << x << " " << endl;
#define         PI         acos(-1)
#define         lcm(a,b)   ((a*b)/__gcd(a,b))
#define        optimize    ios_base::sync_with_stdio(false);cin.tie(NULL);
#define        sqr(a)       ((a)*(a))

int main()
{
    ll tst;
//
//    cin >> tst;
//
//    while(tst--)
//    {
//
//    }

ll a,b,i,j,k,l,m,n,p,q,KK;
//ll a,b,i,j,k,l,m,n;

cin >> n >> m >> KK;

a = (1<<n);
b = (1<<m);

char ch[n+10][m+10];
char tp[n+10][m+10];

for(i=0;i<n;i++)for(j=0;j<m;j++)cin>>ch[i][j];
ll cnt=0,ans = 0;
for(p=0;p<a;p++)
{
    for(q=0;q<b;q++)
    {
        cnt = 0;
        for(i=0;i<n;i++)for(j=0;j<m;j++)tp[i][j] = ch[i][j];

        for(k=0;k<n;k++)
        {
            if((1<<k)&p)for(i=0;i<m;i++)tp[k][i]='*';
        }
        for(k=0;k<m;k++)
        {
            if((1<<k)&q)for(i=0;i<n;i++)tp[i][k]='*';
        }

        for(i=0;i<n;i++)for(j=0;j<m;j++)if(tp[i][j]=='#')cnt++;
        if(cnt == KK)ans++;

    }
}

cout << ans << endl;



//cout << m << endl;
}


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

using ll = long long;

constexpr ll MOD = 1e9+7;
constexpr ll INF = 1ll<<60;

#define FOR(i,a,b) for (ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

int main(int argc, char **argv)
{
	ll N, M; cin >> N >> M;
	vector<ll> seen(N, 0);

	REP(i, M)
	{
		ll a, b; cin >> a >> b;
		--a, --b;

		++seen[a];
		++seen[b];
	}

	bool ok{true};

	for (auto &e : seen)
	{
		if (e&1)
			ok = false;
	}
	std::cout << (ok ? "YES" : "NO") << std::endl;	
}

Measured memory_bytes: 1024
import java.util.*;

public class Main{
	public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt();
    int A = sc.nextInt();
    int B = sc.nextInt();
    
    int sum = 0;
      
    for(int i=0; i<=N; i++){
    int n = i;
    int digsum = 0;
    while(n>0){
    //各桁の和を求めていこう
    digsum = digsum + n%10;
    n /= 10;
    }
    if(digsum >= A && digsum <= B)
      sum = sum+i;
    }
    
    System.out.println(sum);
    }
}
  

Measured memory_bytes: 23764
import java.io.BufferedInputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        new Main().solveA();
        // new Main().solveB();
    }

    private void solveB() {

        try (Scanner sc = new Scanner(System.in);) {

        }
    }

    private void solveA() {
        try (Scanner sc = new Scanner(new BufferedInputStream(System.in, 8096));) {
            List<Integer> list = new ArrayList<>();
            int N = sc.nextInt();
            for (int i = 0; i < N; i++) {
                list.add(sc.nextInt());
            }

            List<Integer> sortedList = new ArrayList<>(list);

            Collections.sort(sortedList);

            int median = sortedList.get(N / 2);
            int medianMinus = sortedList.get(N / 2 - 1);

            for (int i : list) {
                if (i >= median) {
                    System.out.println(medianMinus);
                } else {
                    System.out.println(median);
                }
            }
        }
    }

}


Measured memory_bytes: 97916
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define square(x) pow(x 2.0)
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
#define max_queue(x) priority_queue<x>
#define min_queue(x) priority_queue<x, vector<x>, greater<x>>
#define big_sort(v) sort(all(v), [](int a, int b) { return a > b; })//大きい順にソート
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
#define co(x) cout << x << endl;
#define cins(n,v) rep(i,n){cin >> v.at(i);}
#define couts(v) rep(i,v.size()){cout << v.at(i) << endl;}
// aよりもbが大きいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmax(T &a, const T& b) {
  if (a < b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}
// aよりもbが小さいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmin(T &a, const T& b) {
  if (a > b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}
/*
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
*/

int main() {
  ll n,m,a,b,ans=0;
  cin >> n >> m;
  vi h(n);
  vi v(n);
  cins(n, h);
  rep(i,m){
    cin >> a >> b;
    if(h[a-1]>h[b-1]){
      v[b-1]++;
    }else if(h[a-1]<h[b-1]){v[a-1]++;
    }else{v[a-1]++;v[b-1]++;}
  }
  rep(i,n){
    if(v[i]==0){ans++;}
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 4052
#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
#define repprev(i,a,b) for(ll i=b-1;i>=a;i--)
#define reprev(i,n) repprev(i,0,n)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
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; }
template<class T> int former(const vector<T> &v, T x){
   return upper_bound(v.begin(),v.end(),x) - v.begin() - 1;
}
template<class T> int latter(const vector<T> &v, T x){
    return lower_bound(v.begin(),v.end(),x) - v.begin();
}
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define BIT_FLAG_0 (1<<0) // 0000 0000 0000 0001
#define BIT_FLAG_1 (1<<1) // 0000 0000 0000 0010
#define BIT_FLAG_2 (1<<2) // 0000 0000 0000 0100
#define BIT_FLAG_3 (1<<3) // 0000 0000 0000 1000
#define BIT_FLAG_4 (1<<4) // 0000 0000 0001 0000
#define BIT_FLAG_5 (1<<5) // 0000 0000 0010 0000
#define BIT_FLAG_6 (1<<6) // 0000 0000 0100 0000
#define BIT_FLAG_7 (1<<7) // 0000 0000 1000 0000
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll LLINF = 1LL<<60;
const int INTINF = 1<<29;

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

struct UnionFind {
    vector<ll> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(ll n) : par(n, -1) { }
    void init(ll n) { par.assign(n, -1); }

    ll root(ll x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }

    bool issame(ll x, ll y) {
        return root(x) == root(y);
    }

    bool merge(ll x, ll y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }

    ll size(ll x) {
        return -par[root(x)];
    }
};

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

int main(void){
   int R[200000], n;
    cin >> n;
    for(int i = 0; i < n; ++i) cin >> R[i];

    int maxv = -2000000000; // 十分小さい値を初期値に設定
    int minv = R[0];

     for(int i = 1; i < n; ++i){ // ここで毎回R[i]を読み込めば配列は不要
        maxv = max(maxv, R[i] - minv); // 最大値を更新
        minv = min(minv, R[i]);
     }
    cout << maxv << endl;
    return 0;
}


Measured memory_bytes: 3864
#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;

int main(){
    string w;
    cin>>w;
    vector<ll> a(26,0);
    for(ll i=0;i<w.size();i++) a[w[i]-'a']++;
    for(ll i=0;i<26;i++){
        if(a[i]%2!=0){
            cout<<"No"<<endl;
            break;
        }
        if(i==25) cout<<"Yes"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:26-

            int n = sc.nextInt();
            int[] as = new int[n + 1];
            int[] vs = new int[n + 1];
            for (int i = 1; i < as.length; i++) as[i] = sc.nextInt();

            for (int i = n; i > 0; i--) {
                int sum = 0;
                for (int j = 1; j * i < as.length; j+=2) {
                    sum += vs[j * i];
                }
                if (2 * i < vs.length) sum += as[2 * i];
                vs[i] = (sum % 2) ^ as[i];
            }

            List<Integer> balls = new ArrayList<>();
            for (int i = 1; i < vs.length; i++) {
                if (vs[i] > 0) balls.add(i);
            }

            out.println(balls.size());
            for (Integer ball : balls) {
                out.println(ball);
            }

        }
    }

}


Measured memory_bytes: 90200
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef  unsigned long long int ull;
typedef pair<ll,ll> P;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
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 (a>b) { a=b; return 1; } return 0; }
int main(){
 ll n,m;
 cin>>n>>m;
 V<char> s(n);
 if(n!=1)s[0]='1';
 else s[0]='0';
 for(int i=1;i<n;i++){
     s[i]='0';
 }
 bool ok=true;
 V<bool> used(n,false);
 for(int i=0;i<m;i++){
     int a;
     char b;
     cin>>a>>b;
     a--;
     if((used[a]&&s[a]!=b)||(n!=1&&a==0&&b=='0'))ok=false;
     used[a]=true;
     s[a]=b;
 }
 if(ok){
     for(int i=0;i<n;i++)cout<<s[i];
     cout<<endl;
 }
 else cout<<-1<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#define d for(x=0;x<N;x++){for(y=0;y<N;y++){

m[10][10],c,x,y,N=10;
main(z){d m[x][y]=x?m[x-1][y+1]+1:y?m[x][y-1]+y:1;}}
  for(;scanf("%d",&N),N;){
    printf("Case %d:\n",++c);
    d printf("%3d",(z=x+y)<N?z%2?m[x][y]:m[y][x]:N*N+1-(z%2?m[N-1-x][N-1-y]:m[N-1-y][N-1-x]));}printf("\n");}}}

Measured memory_bytes: 616
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <deque>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main()
{
	int N, x;
	cin >> N >> x;
	if (x == 1 || x == 2 * N - 1)
	{
		cout << "No" << endl;
	}
	else
	{
		vector<int> ans(2 * N - 1);
		auto mid = (2 * N - 1) / 2;
		ans[mid] = x;
		ans[mid - 1] = x - 1;
		ans[mid + 1] = x + 1;
		auto num = 1;
		for (auto i = 0; i < 2 * N - 1; ++i)
		{
			if (i >= mid - 1 && i <= mid + 1)
			{
				continue;
			}
			while (num >= x - 1 && num <= x + 1)
			{
				++num;
			}

			ans[i] = num;
			++num;
		}

		cout << "Yes" << endl;
		for (auto i = 0; i < (int)ans.size(); ++i)
		{
			cout << ans[i] << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 2304
#include <iostream>
using namespace std;
void bubble(int a[]);
int main(){
    int a[5];
    for(int i=0;i<5;i++)
        cin >> a[i];
    bubble(a);
    for(int i=0;i<4;i++)
        cout << a[i] << " " ;
    cout << a[4] << endl;
}

void bubble(int a[]){
    for(int i=0;i<4;i++){
        for(int j=0;j<4-i;j++){
            if(a[j]<a[j+1]){
                int tmp;
                tmp=a[j];
                a[j]=a[j+1];
                a[j+1]=tmp;
            }
        }
    }
}

Measured memory_bytes: 1160
//#define _GRIBCXX_DEBUG
#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;


// ?????¬???????????¬??????
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<double> vd;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<long, long> pil;


// Effective std
template<typename C, typename T>
constexpr int count(C& c, T t) { return count(ALL(c), t); }

template<typename C, typename F>
constexpr int count_if(C& c, F f) { return count_if(ALL(c), f); }

template<typename C, typename T, typename U>
constexpr void replace(C& c, T t, U u) { replace(ALL(c), t, u); }

template<typename C, typename F, typename U>
constexpr void replace_if(C& c, F f, U u) { (ALL(c), f, u); }

template<typename C>
constexpr void sort(C& c) { sort(ALL(c)); }

template<typename C, typename Pred>
constexpr void sort(C& c, Pred p) { sort(ALL(c), p); }


// ??°?????????????????¬??????
typedef int Weight;

struct Edge {
  int src, dst;
  Weight weight;
  Edge(int src, int dst, Weight weight) :
    src(src), dst(dst), weight(weight) {}
};

bool operator < (const Edge &e, const Edge &f) {
  return e.weight != f.weight ? e.weight > f.weight :
    e.src != f.src ? e.src < f.src : e.dst < f.dst;
}

typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
typedef vector<Weight> Array;
typedef vector<Array> Matrix;


int main() {
  while(true) {
    int m, f, r;
    scanf("%d %d %d", &m, &f, &r);
    if(m==-1 && f==-1 && r==-1) break;

    string p;
    if(m==-1 || f==-1 || m+f<30) p = "F";
    else if(m+f>=80) p = "A";
    else if(m+f>=65 && m+f<80) p = "B";
    else if(m+f>=50 && m+f<65) p = "C";
    else if((m+f>=30 && m+f<50) && r>=50) p = "C";
    else p = "D";

    cout << p << endl;
  }
  return 0;
}

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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;
typedef vector < vector<ll> > Mat;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
  int X; cin >> X;
  int ans = 1;
  for (int i = 2; i * i <= X; i++){
    int now = i * i;
    while (now <= X){
      ans = max(now, ans);
      now *= i;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3560
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<fstream>

#define MOD (1000000007)

using namespace std;

typedef long long int Int;

constexpr Int TEN(int n) { return n == 0 ? 1 : 10 * TEN(n-1); }

int main(void) {
    Int a,b,c;
    cin>>a>>b>>c;

    if(c-a-b > 0 && 4*a*b < (c-a-b)*(c-a-b)) {
        cout<<"Yes"<<endl;
    } else {
        cout<<"No"<<endl;
    }

    return 0;
}




Measured memory_bytes: 888
let () = Scanf.scanf "%d\n" @@ fun x ->
  let dp = Array.make (x + 106) false in
  dp.(0) <- true;
  for i = 0 to x do
    if dp.(i) then begin
      dp.(i + 100) <- true;
      dp.(i + 101) <- true;
      dp.(i + 102) <- true;
      dp.(i + 103) <- true;
      dp.(i + 104) <- true;
      dp.(i + 105) <- true;
    end
  done;
  print_endline @@
  if dp.(x) then "1" else "0"


Measured memory_bytes: 2432
#include<bits/stdc++.h>
using namespace std;
#define MAXN	100005
#define MAXLOG	20
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
vector <int> a[MAXN];
int ans[MAXN][MAXLOG];
void work(int pos, int fa) {
	for (unsigned i = 0; i < a[pos].size(); i++)
		if (a[pos][i] != fa) {
			work(a[pos][i], pos);
			for (int j = 0; j < MAXLOG; j++)
				ans[pos][j] += ans[a[pos][i]][j];
		}
	int home = -1;
	for (int i = MAXLOG - 1; i >= 0; i--)
		if (ans[pos][i] >= 2) {
			home = i;
			break;
		}
	for (int i = 0; i <= home; i++)
		ans[pos][i] = 0;
	for (int i = home + 1; i < MAXLOG; i++) {
		ans[pos][i]++;
		if (ans[pos][i] == 1) break;
		else ans[pos][i] = 0;
	}
}
int main() {
	int n; read(n);
	for (int i = 1; i < n; i++) {
		int x, y;
		read(x), read(y);
		a[x].push_back(y);
		a[y].push_back(x);
	}
	work(1, 0);
	for (int i = MAXLOG - 1; i >= 0; i--)
		if (ans[1][i]) {
			printf("%d\n", i);
			return 0;
		}
	return 0;
}

Measured memory_bytes: 19200
import sys

sys.setrecursionlimit(int(1e6))

n, m = map(int, input().split())

edges = {}

for i in range(m):
    s, t = map(int, input().split())
    if s not in edges:
        edges[s] = set()
    if t not in edges:
        edges[t] = set()
    edges[s].add(t)
    edges[t].add(s)

order = [0] * n
lowlink = [0] * n
visited = set()
articulation = set()


def dfs(v, p, i):
    visited.add(v)

    i += 1
    lowlink[v] = order[v] = i

    is_articulation = False
    cnt = 0

    if v not in edges:
        return

    for t in edges[v]:
        if t not in visited:
            cnt += 1
            dfs(t, v, i)
            lowlink[v] = min(lowlink[v], lowlink[t])
            if p != -1 and order[v] <= lowlink[t]:
                is_articulation = True
        elif t != p:
            lowlink[v] = min(lowlink[v], order[t])

    if p == -1 and cnt > 1:
        is_articulation = True

    if is_articulation:
        articulation.add(v)


k = 0
for i in range(n):
    if i not in visited:
        dfs(i, -1, k)

for art in sorted(articulation):
    print(art)



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

using namespace std;

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

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  int n;
  string s;
  cin >> n >> s;
  REP(i, s.size()) {
    int w = (s[i] - 'A' + n) % 26;
    cout << (char)(w + 'A');
  }
  cout << "\n";
  return 0;
}

Measured memory_bytes: 256
/**
 * @author torith
 * @date 2018-10-26
 */

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    ll a[200000];
    ll sum = 0;
    for (int i = 0; i < N; ++i) {
        cin >> a[i];
        sum += a[i];
    }

    ll ans = 1000000000000000000LL;
    ll tmp = 0;
    for (int i = 0; i < N - 1; ++i) {
        tmp += a[i];
        ans = min(ans,abs(sum-2*tmp));
    }

    cout << ans << "\n";

    return 0;
}



Measured memory_bytes: 1792
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;

public static class P
{
    public static void Main()
    {
        Console.WriteLine(Console.ReadLine().Replace('?', 'D'));
    }
}


Measured memory_bytes: 27080
N, Q = map(int, input().split())
S = input()

ac = [0] * (N + 1)
for i in range(N - 1):
    ac[i + 1] = ac[i] + (1 if S[i] == 'A' and S[i + 1] == 'C' else 0)
for i in range(Q):
    l, r = map(int, input().split())
    print(ac[r-1] - ac[l-1])

Measured memory_bytes: 7748
from collections import deque

K = int(input())
queue = deque(range(1, 10))

for i in range(K):
    x = queue.popleft()
    shimo1keta = x % 10
    if shimo1keta != 0:
        queue.append(x * 10 + shimo1keta - 1)
    queue.append(x * 10 + shimo1keta)
    if shimo1keta != 9:
        queue.append(x * 10 + shimo1keta + 1)

print(x)


Measured memory_bytes: 11956
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,k,s;cin>>n>>k>>s;
	int a[n];
	for(int i=0;i<k;i++)
	a[i]=s;
	
	int m;
	if(s==1000000000)
	m=1;
	else
	m=s+1;
	for(int i=k;i<n;i++)
	{
		a[i]=m;
	}
	for(int i=0;i<n;i++)
	cout<<a[i]<<" ";
	
	return 0;
}

Measured memory_bytes: 1664
#include <stdio.h>
int main(){
  int m,nmin,nmax,tokuten[200];
  int i,j;
  int gap,gapmax,count;
  
  while(1){
  scanf("%d%d%d",&m,&nmin,&nmax);
  if(m==0 && nmin==0 && nmax==0)break;
  gapmax=0;
  for(i=0;i<m;i++){
    scanf("%d",&tokuten[i]);
  }
  
  for(j=nmin;j<=nmax;j++){
    gap=tokuten[j-1]-tokuten[j];
    if(gap>=gapmax){
      gapmax=gap;
      count=j;
    }
  }
    printf("%d\n",count);
  }
  
  return 0;
}

Measured memory_bytes: 600
/**
 *    author:  tootal    
 *    created: 2020/04/11 16:09:01
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    for (int i : {111, 222, 333, 444, 555, 666, 777, 888, 999}) {
        if (i >= n) {
            cout << i << endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 256
n,t = [int(x) for x in input().split()]
costs = []
timeIndices = []

for i in range(n):
	cost,time = [int(x) for x in input().split()]
	costs.append(cost)
	if time<=t: timeIndices.append(i)

mincostIndex=0
for i in timeIndices:
	if costs[i] < costs[mincostIndex]:
		mincostIndex=i

if (timeIndices): print(costs[mincostIndex])
else: print("TLE")


Measured memory_bytes: 3060
#include <cstdio>
#include <cmath>
#include <limits>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cstdint>
#include <stdio.h>
#include <stdlib.h>
#define rep(i, s, g) for (i = s; i < g; i++)
using namespace std;
using ll = long long;

const ll mod = 1000000000 + 7; //10^9

int main() {
    string n;
    cin >> n;
    int ans = 0;
    int d = n.size();
    vector <int> x(d);

    // cout <<"ans" <<ans<<  endl;
    for (auto &&i : n)
    {
        ans = ans + i -48 ;
    }
    
    
    // cout << ans << endl;
    if(ans % 9 == 0 ){
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    
    
    // ll n;
    // cin >> n;
    // ll d = 0;
    // ll a = n;
    // while(a>0) {
    //     a /= 10;
    //     d++;
    // }
    // vector<ll> x(d);
    // ll i = 0;
    // while(n>0) {
    //     x[i] = n% 10;
    //     n /= 10;
    //     i++;
    // }
    // ll ans= 0;
    // for (auto &&i : x)
    // {
    //     ans += i;
    // }
    // // cout << ans << endl;
    // if(ans % 9 == 0 ){
    //     cout << "Yes" << endl;
    // }
    // else
    // {
    //     cout << "No" << endl;
    // }
    
    
}

Measured memory_bytes: 3716
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const int64_t LINF=8931145141919364364,LMOD=998244353;
// const int dy[]={0,-1,0,1,1,-1,-1,1};
// const int dx[]={1,0,-1,0,1,1,-1,-1};

int main() {
	const double PI = acos(-1);
	double a, b, x; cin >> a >> b >> x;
	double h = x / a / a;
	double s = a * h;
	if(2 * s / b < a) {
		printf("%.10f\n", 90 - atan2(2 * s / b, b) / PI * 180);
	} else {
		printf("%.10f\n", 90 - atan2(a, 2 * (b - h)) / PI * 180);
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
	int a,b,c,d,e,x,y=0;
	cin>>a>>b>>c>>d>>e;
	if(e<=c)x=b;
	else{y=e-c;x=y*d+b;}
	if(e*a<x)cout<<e*a;
	else cout<<x;
	cout<<endl;
}

Measured memory_bytes: 3076
li = list(map(int,input().split()))
so = sorted(li)
a = so[0]
b = so[4]
c = so[8]
for n in so[:4]:
    res1=  a==n
for n in so[4:8]:
    res2=  b==n
for n in so[8:]:
    res3= c==n
res = 'yes' if res1 and res3 and res2 else 'no'
print(res)


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    int N, T;
    cin >> N >> T;
    vector<P> items(N);
    rep(i, N) cin >> items[i].first >> items[i].second;
    vector<vector<ll>> dp(N + 1, vector<ll>(T + 3005, 0));
    sort(items.begin(), items.end());
    rep(i, N) {
        P p = items[i];
        rep(t, T + 3001) {
            if (t - p.first >= 0 && T > t - p.first) {
                dp[i + 1][t] = max(dp[i + 1][t], dp[i][t - p.first] + p.second);
            }
            dp[i + 1][t] = max(dp[i + 1][t], dp[i][t]);
        }
    }
    ll ans = 0;
    rep(t, T + 3004) {
        ans = max(ans, dp[N][t]);
    }
    cout << ans << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


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

const int INF = 1e9+5;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    vector<int> dp(3);
    while(n--){
        vector<int> a(3);
        for(int i=0;i<3;++i) cin>>a[i];
        vector<int> dp1(3);
        for(int i=0;i<3;++i){
            for(int j=0;j<3;++j){
                if(i!=j)
                    dp1[j] = max(dp1[j],dp[i]+a[j]);
            }
        }
        dp = dp1;
    }
    cout<<max(dp[0],max(dp[1],dp[2]))<<'\n';
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long n,k,x,a[200005];
int main(){
	cin>>n;
	for(k=1;k<=n;k++){
		cin>>a[k];
		x=x^a[k];
	}
	for(k=1;k<=n;k++){
		
		a[k]=x^a[k];
		cout<<a[k]<<" ";
	}
	
}

Measured memory_bytes: 5152
#!/usr/bin/env python3

# from collections import defaultdict
# from heapq import heappush, heappop
import sys

sys.setrecursionlimit(10**6)
input = sys.stdin.buffer.readline
INF = 10 ** 9 + 1  # sys.maxsize # float("inf")
MOD = 10 ** 9 + 7


def debug(*x):
    print(*x, file=sys.stderr)


def solve(N, K, XS):
    table = [0] * (K + 1)
    for i in range(XS[0] + 1):
        table[i] = 1

    for i in range(1, N):
        v = 0
        newtable = [0] * (K + 1)
        accum = [0] * (K + 1)
        acc = 0
        for j in range(K + 1):
            acc += table[j]
            accum[j] = acc

        # debug(": table", table)
        # debug(": accum", accum)
        for j in range(K + 1):
            # v = 0
            # for k in range(XS[i] + 1):
            #     if j - k < 0:
            #         break
            #     v += table[j - k]
            #     v %= MOD
            v = accum[j]
            k = j - XS[i] - 1
            if k >= 0:
                v -= accum[k]

            newtable[j] = v % MOD
        table = newtable

    return table[K]


def main():
    # parse input
    N, K = map(int, input().split())
    XS = list(map(int, input().split()))

    print(solve(N, K, XS))


# tests
T1 = """
3 4
1 2 3
"""


def test_T1():
    """
    >>> as_input(T1)
    >>> main()
    5
    """


T2 = """
1 10
9
"""


def test_T2():
    """
    >>> as_input(T2)
    >>> main()
    0
    """


T3 = """
2 0
0 0
"""


def test_T3():
    """
    >>> as_input(T3)
    >>> main()
    1
    """


T4 = """
4 100000
100000 100000 100000 100000
"""


# def test_T4():
#     """
#     >>> as_input(T4)
#     >>> main()
#     """
# add tests above


def _test():
    import doctest
    doctest.testmod()


def as_input(s):
    "use in test, use given string as input file"
    import io
    global read, input
    f = io.StringIO(s.strip())

    def input():
        return bytes(f.readline(), "ascii")

    def read():
        return bytes(f.read(), "ascii")


USE_NUMBA = False
if (USE_NUMBA and sys.argv[-1] == 'ONLINE_JUDGE') or sys.argv[-1] == '-c':
    print("compiling")
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('solve', solve.__doc__.strip().split()[0])(solve)
    cc.compile()
    exit()
else:
    input = sys.stdin.buffer.readline
    read = sys.stdin.buffer.read

    if (USE_NUMBA and sys.argv[-1] != '-p') or sys.argv[-1] == "--numba":
        # -p: pure python mode
        # if not -p, import compiled module
        from my_module import solve  # pylint: disable=all
    elif sys.argv[-1] == "-t":
        print("testing")
        _test()
        sys.exit()
    elif sys.argv[-1] != '-p' and len(sys.argv) == 2:
        # input given as file
        input_as_file = open(sys.argv[1])
        input = input_as_file.buffer.readline
        read = input_as_file.buffer.read

    main()


Measured memory_bytes: 212604
#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#include<cmath>
#include<cstdint>


     
#define INF 1e9
#define LINF 1e19
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)
#define pb push_back
#define sz size()
     
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<ll, ll>;

     
const ll MOD = 1e9 + 7;
const ll ZER = 0;



int main(){
    string s;
    cin >> s;
    if(s[(int)s.sz - 1] == 's')cout << s << "es" << endl;
    else cout << s << "s" << endl;
}





Measured memory_bytes: 3624