akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=5100;
const int maxm=210;
int l[maxm][maxn];
int r[maxm][maxn];
int b[maxm][maxn];
int n,m;
int z[maxn];
int w[maxn];
int top=0;
ll a[maxn];
ll sum[maxn][maxn];
inline void init()
{
  scanf("%d%d",&n,&m);
  for(int i=2;i<=n;i++)
    scanf("%d",&a[i]),a[i]+=a[i-1];
  for(int i=1;i<=n;i++)
    for(int j=1;j<=m;j++)
      scanf("%d",&b[j][i]);
}
inline void pre_()
{
  for(int i=1;i<=m;i++)
  {
    top=0;
    for(int j=1;j<=n;j++)
    {
	  while(top&&w[top]<b[i][j])
	    top--;
	  l[i][j]=top ? z[top]+1 : 1;
	  z[++top]=j;
	  w[top]=b[i][j];
	}
	top=0;
	for(int j=n;j>=1;j--)
	{
	   while(top&&w[top]<b[i][j])
	     top--;
	  r[i][j]=top ? z[top]-1 : n;
	  z[++top]=j;
	  w[top]=b[i][j];
	}
	for(int j=1;j<=n;j++)
	{
	  sum[l[i][j]][j]+=b[i][j];
	  sum[l[i][j]][r[i][j]+1]-=b[i][j];
	  sum[j+1][j]-=b[i][j];
	  sum[j+1][r[i][j]+1]+=b[i][j];
	}
  }
}
inline void work_()
{
  ll ans=0;
  for(int i=1;i<=n;i++)
  {
    for(int j=1;j<=n;j++)
      sum[i][j]+=sum[i][j-1];
    for(int j=1;j<=n;j++)
      sum[i][j]+=sum[i-1][j];
    for(int j=i;j<=n;j++)
      ans=max(ans,sum[i][j]-a[j]+a[i]);
  }
  printf("%lld\n",ans);
}
int main()
{
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	init();
	pre_();
	work_();
	return 0;
}


Measured memory_bytes: 213760
#include <iostream>
#include <bitset>
#include <queue>
#include <utility>
using namespace std;

bitset<362880> ht;
typedef pair<int[9],int> state;
queue<state> q;
const int goal=46233;

int hash(const int *board)
{
    const static int fact[]={40320,5040,720,120,24,6,2,1};
    int h=0;
    int work;
    for(int i=0; i<8; i++) {
        work=board[i];
        for(int j=0; j<i; j++) {
            if(board[j]<board[i]) --work;
        }
        h+=work*fact[i];
    }
    return h;
}

int search()
{
    while(!q.empty()) {
        state now=q.front();
        if(hash(now.first)==goal) return now.second;
        q.pop();
        int f;
        for(f=0; now.first[f]; f++);
        if(f%3!=0) {
            state next=now;
            next.second++;
            swap(next.first[f], next.first[f-1]);
            int h=hash(next.first);
            if(!ht.test(h)) {
                ht.set(h);
                q.push(next);
            }
        }
        if((f+1)%3!=0) {
            state next=now;
            next.second++;
            swap(next.first[f], next.first[f+1]);
            int h=hash(next.first);
            if(!ht.test(h)) {
                ht.set(h);
                q.push(next);
            }
        } 
        if(f>=3) {
            state next=now;
            next.second++;
            swap(next.first[f], next.first[f-3]);
            int h=hash(next.first);
            if(!ht.test(h)) {
                ht.set(h);
                q.push(next);
            }
        } 
        if(f<6) {
            state next=now;
            next.second++;
            swap(next.first[f], next.first[f+3]);
            int h=hash(next.first);
            if(!ht.test(h)) {
                ht.set(h);
                q.push(next);
            }
        } 
    }
    return -1;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    state board;
    board.second=0;
    for(int i=0; i<9; i++) cin>>board.first[i];
    ht.set(hash(board.first));
    q.push(board);
    cout<<search()<<'\n';
    return 0;
}

Measured memory_bytes: 2248
#include <iostream>
#include <cstdlib>
using namespace std;
int main(void){
    // Your code here!
    int N;
    int A[110000];
    int price = 0;
    std::cin >> N;
    A[0] = 0;
    A[N + 1] = 0;
    for (int i = 1; i <= N; i++) {
        std::cin >> A[i];
    }
    
    for (int i = 0; i <= N; i++) {
        price = price + abs(A[i+1]-A[i]);
    }
    for (int i = 0; i < N; i++) {
         std::cout << price - (abs(A[i] - A[i+1])) - (abs(A[i + 1] - A[i + 2])) + abs(A[i] - A[i+2])<< std::endl;
    }
}


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

int main() {
  ll n; cin >> n;
  vector<ll> t(n+1); t[0] == 0;
  vector<P> p(n+1);
  p[0].first=0; p[0].second=0; 
  rep(i, n+1) cin >> t[i+1] >> p[i+1].first >> p[i+1].second;
  
  rep(i, n){
    ll dist = abs(p[i+1].first - p[i].first) + abs(p[i+1].second - p[i].second);
    if( dist > t[i+1]-t[i] || (dist-(t[i+1]-t[i]))%2 != 0 ){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}

Measured memory_bytes: 5576
#include<bits/stdc++.h>
using namespace std;
int main(){
  int k,s;
  cin>>k>>s;
  int ans=0;
  for(int x=0;x<=k;x++){
    for(int y=0;y<=k;y++){
      if(s-x-y>=0&&s-x-y<=k){ans++;}
    }
  }
  cout<<ans;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    static int A;
    static int B;

    private static void init() {
        Scanner scanner = new Scanner(System.in);
        A = scanner.nextInt();
        B = scanner.nextInt();
        scanner.close();
    }


    public static void main(String[] args) {
        init();
        System.out.println(Math.max(0, A - B * 2));
    }
}

Measured memory_bytes: 22100
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int mm=1000000007;
int i,j,k,n,m,f[2][4101][2],now,pre,ans,t1,t2;
void upd(int x,int y,int v){
	f[now][x][y]=(f[now][x][y]+v)%mm;
}
int main(){
	scanf("%d%d",&n,&m);memset(f,0,sizeof(f));now=0;pre=1;
	for (i=1;i<=n;i++) f[now][i][0]=1;
f[now][0][1]=1;
	for (i=0;i<m;i++){
		now^=1;pre^=1;memset(f[now],0,sizeof(f[now]));
		for (j=0;j<=n;j++)
		 for (k=0;k<=1;k++){
		 	if (j){
		 		upd(j-1,(j==1)?1:k,f[pre][j][k]);
				upd(j,(j==1)?1:k,f[pre][j][k]);
			}
			if (j<n){
				upd(j+1,k,f[pre][j][k]);
				upd(j,k,f[pre][j][k]);
			}
		 }
	}
	for (i=ans=0;i<=n;i++) ans=(ans+f[now][i][1])%mm;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string.h>
#include <cstdlib>
#include <cmath>

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

using namespace std;

int main(void){
    long int N, K;
    cin >> N >> K;

    long int remain1 = N % K;
    long int remain2 = abs(remain1 - K);

    if(remain1 < remain2){
        cout << remain1;
    }else{
        cout << remain2;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long 
using ldb = long double;
using pa = pair < int, int >;
#define F  first
#define S  second
#define f(i,x,n) for(int i=x;i<n;i++) 
#define unique_sort(x) sort(all(x)), x.resize(distance(x.begin(), unique(all(x))))
#define all(c) c.begin(),c.end()
const int MOD = 1e9 + 7, N = 5e5 + 10;
const int LINF = LLONG_MAX;
vector<int>store;
void dfs(int k,int x){
    store.push_back(x);
    if(k >= 9){
        return ;
    }
    int a = x%10;
    if(a){
        dfs(k+1,x*10+a-1);
    }
    dfs(k+1,x*10+a);
    if(a<9){
        dfs(k+1,x*10+a+1);
    }
}
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    f(i,1,10){
        dfs(0,i);
    }
    unique_sort(store);
    int k;
    cin >> k;
    cout << store[k-1];    
    return 0;
}
 

Measured memory_bytes: 2420
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author KharYusuf
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CSqrtInequality solver = new CSqrtInequality();
        solver.solve(1, in, out);
        out.close();
    }

    static class CSqrtInequality {
        public void solve(int testNumber, FastReader s, PrintWriter w) {
            BigInteger a = new BigInteger(Integer.toString(s.nextInt())), b = new BigInteger(Integer.toString(s.nextInt())), c = new BigInteger(Integer.toString(s.nextInt()));
            BigInteger n1 = a.add(b), n2 = a.multiply(b);
            n1 = c.subtract(n1);
            n2 = n2.multiply(new BigInteger("4"));
            if (n1.compareTo(new BigInteger("0")) <= 0) {
                w.println("No");
                return;
            }
            n1 = n1.multiply(n1);
            //w.println(n1.toString()+" "+n2.toString());
            w.println(n1.compareTo(n2) > 0 ? "Yes" : "No");
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {

            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {

                curChar = 0;

                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public int nextInt() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public boolean isSpaceChar(int c) {

            if (filter != null)
                return filter.isSpaceChar(c);

            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



Measured memory_bytes: 23380
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5+100;
#define fr(i,a,b) for(int i = a;i <= b; ++i)
#define nfr(i,a,b) for(int i = a;i >= b; --i)

vector<int> edge[N];

int f[N][3];
void dfs1(int x,int fa,int mxv,int scv,int tdv){
   f[x][0] = f[x][1] = f[x][2] = 1;
   fr(i,0,(int)edge[x].size()-1){
      int y = edge[x][i];
      if(y == fa)continue ;
      int nmv,ncv,ndv;
      if(y > mxv){
         nmv = y; ncv = mxv; ndv = scv;
      } else if(y > scv){
         nmv = mxv; ncv = y; ndv = scv;
      } else if(y > tdv){
         nmv = mxv; ncv = scv; ndv = y;
      } else {
         nmv = mxv; ncv = scv; ndv = tdv;
      }
      dfs1(y,x,nmv,ncv,ndv);
      if(y > mxv){
         ;
      } else if(y > scv){
         f[x][0] += f[y][0];
      } else if(y > tdv){
         f[x][0] += f[y][0]; f[x][1] += f[y][1];
      } else {
         f[x][0] += f[y][0]; f[x][1] += f[y][1]; f[x][2] += f[y][2];
      }
   }
}

int ans[N];
void dfs2(int x,int fa,int mxv,int mxvp){
   if(fa != mxv){
      if(x < mxv)ans[x] = ans[fa];
      else ans[x] = ans[fa]+f[x][1];
   } else {
      if(x < mxvp)ans[x] = ans[fa]+f[x][x > mxv ? 1 : 0]-f[x][x > mxvp ? 2 : 1];
      else ans[x] = ans[fa]+f[x][x > mxv ? 1 : 0];
   }
   if(x == 1)ans[x] = 0;
   
   fr(i,0,(int)edge[x].size()-1){
      int y = edge[x][i];
      if(y == fa)continue ;
      dfs2(y,x,max(mxv,x),max(mxvp,fa));
   }
}

int main(){
   int n;
   scanf("%d",&n);
   fr(i,1,n-1){
      int x,y;
      scanf("%d%d",&x,&y);
      edge[x].push_back(y);
      edge[y].push_back(x);
   }
   dfs1(1,0,1,0,0);
   dfs2(1,0,0,0);
   fr(i,2,n){
      printf("%d ",ans[i]);
   }
   puts("");
   return 0;
}


Measured memory_bytes: 31360
#include <stdio.h>

int main(void)
{

    int h1, h2, k1, k2, a, b, c, d, h, k;

    scanf("%d %d", &h1, &h2);

    scanf("%d %d", &k1, &k2);

    scanf("%d %d %d %d", &a, &b, &c, &d);

    h = a * h1;
    k = a * k1;
    h += b * h2;
    k += b * k2;
    h += c * (h1 / 10);
    k += c * (k1 / 10);
    h += d * (h2 / 20);
    k += d * (k2 / 20);

    if(h < k)
        printf("kenjiro\n");
    else if(h > k)
        printf("hiroshi\n");
    else if(h == k)
        printf("even\n");

    return 0;
}

Measured memory_bytes: 584
<?php
fscanf(STDIN, "%d %d %d", $h, $w, $d);
for ($i = 0; $i < $h; $i++) {
	$j = 0;
	foreach (explode(' ', trim(fgets(STDIN))) as $a) {
		$x[$a] = [$j, $i];
		$j++;
	}
}
for ($a = 1; $a <= $h * $w; $a++) {
	$r = $a % $d;
	if (isset($s[$r])) {
		$b = $a - $d;
		$t[$a] = $s[$r] += abs($x[$a][0] - $x[$b][0]) + abs($x[$a][1] - $x[$b][1]);
	} else {
		$t[$a] = $s[$r] = 0;
	}
}
fscanf(STDIN, "%d", $q);
while ($q--) {
	fscanf(STDIN, "%d %d", $l, $r);
	echo $t[$r] - $t[$l], "\n";
}

Measured memory_bytes: 52468
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define i_7 (ll)(1E9+7)
#define i_5 (ll)(1E9+5)
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    else return c+i_7;
}
typedef pair<int,int> i_i;
typedef pair<ll,ll> l_l;
ll inf=(ll)1E12;//10^12
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
const double EPS=1E-8;
////////////////////////////////////////



int main() {
    ios::sync_with_stdio(false);cin.tie(0);
    
    ll n;cin>>n;
    ll a[n],b[n];rep(i,0,n-1)cin>>a[i];
    rep(i,0,n-1)cin>>b[i];
    ll ans=0;
    rep(k,1,29){
        ll p=(ll)1<<k;
        ll c[n],d[n];
        rep(i,0,n-1){
            d[i]=b[i]%p;
            c[i]=a[i]%p;
        }
        sort(d,d+n);
        ll sum=0;
        rep(i,0,n-1){
            sum+=lower_bound(d,d+n,p-c[i])-lower_bound(d,d+n,p/2-c[i]);
            sum+=lower_bound(d,d+n,2*p-c[i])-lower_bound(d,d+n,p/2*3-c[i]);
        }
        if(sum%2)ans+=1<<(k-1);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 6528
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

const int64_t MOD = 1e9 + 7;

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

    vector<vector<int64_t>> dp(n + 1, vector<int64_t>(k + 1));
    vector<vector<int64_t>> dps(n + 1, vector<int64_t>(k + 2));
    irep(i, n)
    {
        dps[i][0] = 0;
        irep(j, k)
        {
            if (i == 0) {
                dp[i][j] = j == 0 ? 1 : 0;
            } else {
                dp[i][j] = (dps[i - 1][j + 1] - dps[i - 1][max(0L, j - a[i - 1])] + MOD) % MOD;
            }
            dps[i][j + 1] = (dps[i][j] + dp[i][j]) % MOD;
        }
    }
    cout << dp[n][k] << endl;
    return 0;
}

Measured memory_bytes: 159088
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(10);
}
signed main(){
  init_io();
  char c;
  cin >> c;
  cout << ++c<<endl;
}


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using edge = pair<ll, P>;
#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--)
using Graph = vector<vector<ll>>;
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

#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    string S, T;
    cin >> S >> T;
    ll cnt = 0;
    ll pre = -1;

    unordered_map<char, vector<ll>> pos;
    rep(i, S.size()) {
        pos[S[i]].emplace_back(i);
    }
    rep(i, T.size()) {
        if (!pos[T[i]].empty()) {
            auto idx = upper_bound(pos[T[i]].begin(), pos[T[i]].end(), pre);
            if (idx == pos[T[i]].end()) {
                pre = -1;
                cnt++;
                pre = pos[T[i]][0];
            } else {
                pre = *idx;
            }
        } else {
            cout << -1 << endl;
            return;
        }
    }
    cout << cnt * S.size() + pre + 1 << endl;
}

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


Measured memory_bytes: 1736
def abc171_e():
    n = int(input())
    A = list(map(int, input().split()))
    cum = 0
    for a in A:
        cum ^= a
    B = [0] * n
    for i, a in enumerate(A):
        B[i] = cum ^ a
    print(*B, sep=' ')

if __name__ == '__main__':
    abc171_e()

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

using namespace std;

typedef long long LL;
LL N;
char s[104];
LL k;

int main(){
    scanf("%s", s); N = strlen(s);
    scanf("%d", &k);
    LL cnt = 0, cnt2 = 0;
    for(LL i = 0; i < N; ++i){
        LL j = i, val = 0;
        while(j < N && s[i] == s[j]){
            ++j; ++val;
        }
        if(j == N || !i){
            cnt2 += val / 2;
        }
        else cnt += val / 2;
        i = j - 1;
    }
    LL gap = 0, i, j;
    for(i = N - 1; i >= 0 && s[i] == s[N - 1]; --i){
        ++gap;
    }
    for(j = 0; j <= i && s[0] == s[N - 1] && s[0] == s[j]; ++j){
        ++gap;
    }
    if(j > i){
        printf("%lld\n", N * k / 2);
        return 0;
    }
    if(s[0] == s[N - 1]) printf("%lld\n", (gap / 2) * (k - 1) + cnt * k + cnt2);
    else printf("%lld\n", (cnt + cnt2) * k);
    return 0;
}


Measured memory_bytes: 256
n,a,b=map(int,input().split());k=1000000007
c=(1<<n)%k-1

X=1
for i in range(a):X=X*(n-i)%k
Y=j=1
while j<=a:Y=Y*j%k;j+=1
#Z=Y**(k-2)を計算，ビットワイズによる繰り返し２乗法の実装。
d=k-2;Z=1
while d>0:
  Z=Z*Y%k if d&1==1 else Z
  Y=Y*Y%k;d>>=1 #一周する度にY, Y^2, Y^4, Y^8となる; dのビット桁をずらす
c-=X*Z%k

X=1
for i in range(b):X=X*(n-i)%k
Y=j=1
while j<=b:Y=Y*j%k;j+=1
d=k-2;Z=1
while d>0:
  Z=Z*Y%k if d&1==1 else Z
  Y=Y*Y%k;d>>=1
c-=X*Z%k

print(c%k)

Measured memory_bytes: 263412
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    gates=[]
    n,m = map(int,input().split())
    gates=[list(map(int,input().split())) for _ in range(m)]
    min_data=0
    max_data=10**5+1

    for gate in gates:
        if min_data < gate[0]:
            min_data=min(gate)
        if max_data > gate[1]:
            max_data=max(gate)
    print(len(list(range(min_data,max_data+1))))

if __name__=="__main__":
    main()

Measured memory_bytes: 28536
MOD = 10**9+7
l = input()
n = len(l)

dp = [ [0]*2 for _ in range(n+1) ]
dp[0][0] = 1 # same
dp[0][1] = 0 # smaller

for i in range(n):
    if l[i] == '1':
        dp[i+1][0] = dp[i][0] * 2
        dp[i+1][1] = dp[i][0] + dp[i][1] * 3
    else:
        dp[i+1][0] = dp[i][0]
        dp[i+1][1] = dp[i][1] * 3

    dp[i+1][0]%=MOD
    dp[i+1][1]%=MOD

ans = dp[n][0] + dp[n][1]
print(ans%MOD)

Measured memory_bytes: 75496
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
// const ll INF = 1e18;
//const ll MOD = 1e9+7;
//const double pi = 3.14159265358979;
using vl = vector<ll>;
# define rep(i, n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(ll i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(ll i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(ll i=((int)(n)); i>0; --i)
# define all(x) (x).begin(), (x).end()

ll N,M;

int Main() {
    cin >> N >> M;
    vl H(N);

    rep(i, N) {
        cin >> H[i];
        H[i]--;
    }
    vl A(M);
    vl B(M);
    
    vector<set<ll>> v(N);

    rep(i, M) {
        cin >> A[i] >> B[i];
        A[i]--; B[i]--;
        
        v[A[i]].insert(B[i]);
        v[B[i]].insert(A[i]);
    }

    ll cnt = 0;
    
    rep(i, N) {
        bool flag = true;
        
        for (auto &num : v[i]) {
            if (H[i] <= H[num]) {
                flag = false;
            }
        }
        
        if (flag) {
            cnt++;
        }
    }
    
    cout << cnt << endl;

    return 0;
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 19564
#define _USE_MATH_DEFINES
#include  <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include <stdlib.h>
#include<stdio.h>
#include <queue>
#include<map>
#include <sstream>
#include<set>
#include<stack>

//#include<bits/stdc++.h>


using namespace std;



int main() {

	string p;
	cin >> p;
	int a = 0, b = 0;
	for (int i = 0; i < p.size(); i++) {
		if (p[i] == '1')a++;
		else b++;
	}
	int t = min(a, b);
	cout << min(a, b) * 2 << endl;

	return 0;

}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define _GLIBCXX_DEBUG
#define fi first
#define se second

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vd = vector<double>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using vvd = vector<vd>;
using vvvi = vector<vvi>;
using vvvll = vector<vvll>;
using vvvd = vector<vvd>;

const double pi=acos(-1);
const ll MOD=1e9+7;
const ll INF=(1LL<<60);

int main() {
    int x;
    cin>>x;
    int ans=1;
    for (int i=2;i<x/2;i++){
        int num=i;
        while (num<=x){
            num*=i;
            if (num<=x){
                ans=max(ans,num);
            }
        }
    }
    cout<<ans<<endl;

    return 0;
}

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

int main() {
  int a;
  string s;
  cin >> s;
  if ( s[0] == '1' )
    a++;
  if ( s[1] == '1' )
    a++;
  if ( s[2] == '1' )
    a++;
  cout << a << endl;
}

Measured memory_bytes: 256
n,m = map(int, input().split())
a = list(map(int, input().split()))


t = 0
check=False
for x in range(len(a)):
  t += a[x]

for i in reversed(range(len(a))):
  for j in range(i):
    if(a[j] < a[j+1]):
      a[j], a[j+1] = a[j+1],a[j]

for y in range(m):
  if(a[y] >= t/(4*m)):
    check = True
  else:
    check=False
    break

if(check):
  print('Yes')
else:
  print('No')


Measured memory_bytes: 3064
while True:
    n,k = [int(x) for x in input().split()]
    if n==0 and k==0:
        break

    a = [int(input()) for i in range(n)]

    s = sum(a[0:k])
    max = s

    for i in range(k,n):
        s = s + a[i] - a[i - k]
        if s > max: 
            max = s

    print(max)



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

int main(void){
	int n, y;
	cin >> n >> y;
	for(int i = 0; i <= n; ++i){
		for(int j = 0; i+j <= n; ++j){
			if(i*10000+j*5000+(n-i-j)*1000==y){
				cout << i << " ";
				cout << j << " ";
				cout << n-i-j << endl;
				return 0;
			}
		}
	}
	cout << "-1 -1 -1" << endl;
	return 0;
}

Measured memory_bytes: 256
program knight
    implicit none
    integer(8)::x, y
    integer(8):: i, d
    read*, x, y

    if (mod(x+y,3) /= 0) then
        print*, 0
        stop
    end if

    d = (x+y)/3
    x = x - d
    y = y - d

    if (x < 0 .or. y < 0) then
        print*, 0
        stop
    end if

    if (x==0 .or. y==0) then
        print*, 1
        stop
    end if

    print*, nikou(x+y, x)

    contains
    function nikou(a,b) result(ret)
        integer(8):: a,b
        integer(8):: ret
        integer(8), parameter:: md = 1000000007
        integer(8), allocatable:: fi(:), i_fi(:)
        
        allocate(fi(a), i_fi(a))
        fi(1) = 1

        do i=2,a
            fi(i) = mod(fi(i-1)*i, md)
        end do

        do i=1,max(b,a-b)
            i_fi(i) = inv((fi(i)),md)
        end do

        ret = mod(mod(fi(a)*i_fi(b),md)*i_fi(a-b),md)
    end function


    function inv(x, md) result(ret)
        integer(8):: x, md, ret, power

        power = md-2
        ret = 1

        do while(power > 0)
            if (mod(power,2) == 1) ret=mod(ret*x,md)
            x=mod(x*x,md)
            power = power/2
        end do
    end function
end program knight

Measured memory_bytes: 9600
# https://atcoder.jp/contests/abc068/tasks/arc079_a
# C - Cat Snuke and a Voyage

n, m = list(map(int, input().split()))
ab_list = []

for _ in range(m):
    a, b = list(map(int, input().split()))
    ab_list.append((a, b))

ab_dict = {k: [] for k in range(1, m+1)}

# 1と接続している島
via_nodes_1 = set([b for a, b in ab_list if a == 1])
via_nodes_2 = set([a for a, b in ab_list if b == n])

# 積集合があるか
via_nodes = via_nodes_1 & via_nodes_2

if len(via_nodes):
    ans = 'POSSIBLE'
else:
    ans = 'IMPOSSIBLE'

print(ans)


Measured memory_bytes: 69772
#include<bits/stdc++.h>
using namespace std;
#define ran 222222
int n;
deque<int> q;
int a[ran],la;
int main(){
	scanf("%d",&n);
	bool flag = true;
	for(int i=1; i<=n; i++){
		int x;
		scanf("%d",&x);
		if(flag)
			q.push_back(x);
		else
			q.push_front(x);
		flag = !flag;
	}
	while(!q.empty()){
		a[la++] = q.front();
		q.pop_front();
	}
	if(!flag){
		reverse(a,a+la);
	}
	for(int i=0; i<la; i++)
		printf("%d%c",a[i],i<la-1?' ':'\n');
	return 0;
}


Measured memory_bytes: 3840
#include<iostream>
#include <complex>
#include <vector>
#include<string>
#include<cmath>
#include<algorithm>

using namespace std;
int main() {
#define int long long
	int N;
	int sq;
	cin >> N;
	sq = sqrt(N);
	vector<int> num;
	num.reserve(1000);

	for (int i = 1; i < 33; i++) {
		for (int j = 2; j < 11; j++) {
			num.push_back(pow(i,j));
		}
	}
	sort(num.begin(), num.end());
	num.erase(std::unique(num.begin(), num.end()), num.end());

	for (int i = num.size() - 1; i != -1; i--) {
		if (num[i] < 0) {
			cout << 1 << endl;
			break;
		}
		if (N >= num[i]) { cout << num[i] << endl; 
		break;
		}
	}


	

	return 0;
}

Measured memory_bytes: 256
A,B,C,X,Y = map(int,input().split())

#AとBをそのまま買う
ans1 = A * X + B * Y

#ABを可能な限り買って、残りのAかBを買う
if X > Y :
  ans2 = C * Y * 2 + A * (X - Y) 
else:
  ans2 = C * X * 2 + B * (Y - X) 
#とにかくABだけ買う
ans3 = C * max(X, Y) * 2

print(min(ans1,ans2,ans3))

Measured memory_bytes: 9180
#include <iostream>
using namespace std;
int n, m, j = 1, a[31], b[31], c[100];

int main(){
	char s;
	while(cin >> n >> s >> m, n+m){a[n] = m;b[m]++;}
	for(int i = 30;i >= 0;i--)if(b[i])c[i] = j++;
	while(cin >> n)cout << c[a[n]] << endl;
	return 0;
}

Measured memory_bytes: 3068
import java.util.*;



class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int y = sc.nextInt();
        for(int i = 0 ; i <= n ; i ++){
        	for(int j = 0 ; j <= n-i ; j ++){
            	int k = n-i-j;
                	if(y == 10000*i + 5000*j + 1000*k){
                    	System.out.println(i + " " + j + " " + k);
                      	return;
                    }
                
            }
        }
      	System.out.println("-1 -1 -1");
      
    }
}


Measured memory_bytes: 39428
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int i=0;i<n;++i)
int main(){
    int n; cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    int res = 0;
    rep(i,n) res ^= a[i];
    rep(i,n){
        int x = res ^ a[i];
        cout << x << ' ';
    }
    cout << endl;
}

Measured memory_bytes: 3952
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <string>
#include <math.h>
using namespace std;
typedef long long ll;


int main(void){

    ll N, L;
    
    cin >> N >> L;
    
    
    ll Taste[N];
    for(ll i=0; i<N; i++){
        Taste[i] = L + i +1  - 1;
    }
    
    ll min = abs(Taste[0]);
    ll eat = 0;
    
    for(ll i=0; i<N; i++){
        if(abs(Taste[i]) < min){
            eat = i;
            min = abs(Taste[i]);
        }
    }
    
    ll sum = 0;
    
    for(ll i=0; i<N; i++){
        if(i != eat){
            sum += Taste[i];
        }
    }

    cout << sum << endl;

    

}


Measured memory_bytes: 256
N=gets.to_i
require 'prime'
table=Array.new(N+1,0)
for i in 2..N do
  i.prime_division.each{|x|
    table[x[0]]+=x[1]
  }
end
c=0
c+=table.count{|x|x>=74}
num24=table.count{|x|x>=24}
num14=table.count{|x|x>=14}
num4=table.count{|x|x>=4}
num2=table.count{|x|x>=2}
if num4>1&&num2>2 then
  c+=(num4*(num4-1)/2)*(num2-2)
end
c+=num24*(num2-1)
c+=num14*(num4-1)
p c

Measured memory_bytes: 2044
package main

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

func main() {
	var total int
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		line := scanner.Text()
		strs := strings.Split(line, " ")

		for _, s := range strs {
			x, _ := strconv.Atoi(s)
			total += x
		}
	}

	fmt.Printf("%v\n", total)
}



Measured memory_bytes: 1088
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int N, M, C;
    cin >> N >> M >> C;

    vector<int> B(M);

    for (int i = 0; i < M; i ++){
        cin >> B[i];
    }

    int count = 0;
    for (int i = 0; i < N; i++){
        vector<int> A(M);
        long long sum = 0;

        for (int j = 0; j < M; j++){
            cin >> A[j];
            sum += A[j] * B[j];
        }

        if (sum + C > 0){
            count++;
        }
    }

    cout << count << endl;
}

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

typedef long long int ll;
#define INF 1999999999
#define MODA 1000000007

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    int count1 = count(s.begin(), s.end(), '1');
    cout << count1 << endl;



    return 0;
}


Measured memory_bytes: 256
{-# LANGUAGE TupleSections      #-}

import Data.List
import Data.Array.Unboxed
import Data.Array.MArray
import Data.Array.ST
import Control.Monad
import Control.Monad.ST
import Debug.Trace

n_num :: Int -> Int -> [Int]
n_num n 0 = []
n_num n i = (mod i n) : (n_num n $ div i n)

mp0 :: Int -> [Int] -> Int
mp0 _ [] = 8000
mp0 n xs = (abs $ (sum xs)-n)+((length xs)-1)*10

mp :: Int -> Int -> Int -> [(Int,Int)] -> Int
mp a b c xs = sum [mpA,mpB,mpC]
   where mpA = mp0 a $ map snd (filter (\x -> fst x == 0) xs)
         mpB = mp0 b $ map snd (filter (\x -> fst x == 1) xs)
         mpC = mp0 c $ map snd (filter (\x -> fst x == 2) xs)

main :: IO ()
main = do
    [n,a,b,c] <- map read.words <$> getLine :: IO [Int]
    ls <- replicateM n $ read <$> getLine
    let n' i = (n_num 4 i) ++ (take (n-(length $ n_num 4 i)) (repeat 0))
    print $ minimum $ map (\i -> mp a b c $ zip (n' i) ls) [0..4^n-1]


Measured memory_bytes: 1020
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <utility>
#define ll long long int
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()

using namespace std;

int main(){
	int a;
	string s;
	cin >> a;
	cin >> s;
	if(a>=3200) cout << s << endl;
	else cout << "red" << endl;
}


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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int n = s.size();
    int ans = n;
    rep(k,n-1){
        if(s[k] != s[k+1]){
            int cmp = max(k+1, n - (k+1));
            chmin(ans, cmp);
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
using namespace std;
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919364364
#define int long long
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}


int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}

int n, k;
int ans[1000][1000];
int cnt;

signed main() {
	cin >> n;
	for (int i = 1;; i++) {
		if (n < i*(i + 1) / 2) {
			cout << "No" << endl;
			return 0;
		}
		if (n == i * (i + 1) / 2) {
			k = i;
			break;
		}
	}
	cout << "Yes" << endl;
	cout << k + 1 << endl;
	for (int i = 0; i < k + 1; i++) {
		for (int j = 0; j < i; j++) {
			ans[i][j] = ans[j][i - 1];
		}
		for (int j = i; j < k; j++) {
			cnt++;
			ans[i][j] = cnt;
		}
	}
	for (int i = 0; i < k + 1; i++) {
		cout << k;
		for (int j = 0; j < k; j++) {
			cout << " " << ans[i][j];
		}
		cout << endl;
	}
}

Measured memory_bytes: 5376
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>

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

typedef long long ll;

using namespace std;

int main()
{
    int N;
    cin >> N;
    int d[N];
    int sum = 0;
    rep(i, N) cin >> d[i];

    for(int i = 0; i < N; i++)
    {
        for(int j = i+1; j < N; j++)
        {
            sum += d[i] * d[j];
        }
    }

    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    long long a,b[100];
    cin>>a;
    b[0]=2;
    for(int s=1;s<=a;s++)
    {
    	b[s]=b[s-1]*2+2;
	}
	cout<<b[a]<<endl;
    return 0;
}

Measured memory_bytes: 256
object Main extends App {
  val in = new java.util.Scanner(System.in)
  val A, B, K = in.nextLong

  val newA = math.max(A - K, 0)
  val newB = math.min(B, math.max(B - (K - A), 0))
  println(s"$newA $newB")
}

Measured memory_bytes: 27452
#include<stdio.h>
int main()
{
	int a,b,c,d;
	while(~scanf("%d%d%d%d",&a,&b,&c,&d))
	{
		int min,max;
		min=a>c?a:c;
		max=b>d?d:b;
		int sum;
		if(max-min>0)
		printf("%d\n",max-min);
		else
		printf("%d\n",0);
	}
}

Measured memory_bytes: 128
#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
#include <numeric> // next_parmutation
#define ll long long
#define rep(i, n) for(int i = 0; i < (n); i++)

using namespace std;

int main() {
    int n, m;
    int ans = 1001001001;
    ll x;
    int a[12][12];
    cin >> n >> m >> x;
    vector<ll> c(n);
    rep(i, n){
        cin >> c.at(i);
        rep(j, m) cin >> a[i][j];
    }
//bit全探索
rep(s, (1 << n)){
    int cost = 0;
    vector<int> d(m);
    rep(i, n){
        if(s >> i & 1){
            cost += c[i];
            rep(j, m) d[j] += a[i][j];
        }
    }
    bool ok = true;
    rep(j, m) if(d[j] < x) ok = false;
    if(ok) ans = min(ans, cost);
}
if(ans == 1001001001)cout << -1 << endl;
else cout << ans << endl;
return 0;

}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  vector<char> t(s.size());
  for(int i=0; i<s.size(); i++){
    t.at(i) = 'g';
  }
  
  int cnt_g = 0;
  int cnt_p = 0;
  
  for(int i=0; i<s.size(); i++){
    if(s.at(i) == 'p' && cnt_g > cnt_p){
      t.at(i) = 'p';
      cnt_p++;
    }
    else{
      cnt_g++;
    }
  }
  
  for(int i=s.size()-1; i>=0; i--){
    if(!(cnt_g > cnt_p+1)){
      break;
    }
    if(cnt_g > cnt_p+1 && s.at(i) == 'g'){
      t.at(i) = 'p';
      cnt_g--;
      cnt_p++;
    }
  }
  
  int ans = 0;
  for(int i=0; i<s.size(); i++){
    if(s.at(i) == 'g' && t.at(i) == 'p'){
      ans++;
    }
    if(s.at(i) == 'p' && t.at(i) == 'g'){
      ans--;
    }
  }    
  cout << ans << endl;   
}

Measured memory_bytes: 512
#pragma GCC optimize(3)
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <numeric>
#include <utility>
#include <random>
#include <chrono>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

//const int mod = 1e9+7;
int h,w,k, sx, sy, dx, dy;

int dirx[4] = {-1, 0, 1, 0};
int diry[4] = {0, 1, 0, -1};

inline void quickread() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

int he(int x, int y) {
    return abs(x - dx) / k + abs(y - dy) / k;
}



int bfs(vector<vector<char>> & maze, vector<vector<int>> & dist) {
    queue<pii> q;
    q.push({sx, sy});
    while(!q.empty()) {
        auto [x, y] = q.front();
        //cout << "dis: " << x <<" " << y << endl;
        q.pop();
        if(x == dx && y == dy) return dist[x][y];
        else {
            for(int i = 0; i < 4; i ++) {
                int ddx = dirx[i];
                int ddy = diry[i];
                for(int j = 1; j <= k; j ++) {
                    int offx = ddx * j;
                    int offy = ddy * j;
                    if(x + offx < 0 || x + offx >= h || y + offy < 0 || y + offy >= w || maze[x+offx][y+offy] == '@') {
                        break;
                    }
                    if(dist[x+offx][y+offy] > dist[x][y] + 1) {
                        dist[x+offx][y+offy] = dist[x][y] + 1;
                        q.push({x+offx, y + offy});
                    } else if(dist[x+offx][y+offy] <= dist[x][y]){
                        break;
                    }
                }
            }
        }
    }
    return -1;
}


int main()
{
    quickread();
    cin >> h >> w >> k;
    cin >> sx >> sy >> dx >> dy;
    sx --;
    sy --;
    dx --;
    dy --;
    vector<vector<char>> maze(h, vector<char>(w));
    vector<vector<int>> dist(h, vector<int>(w, 0x3f3f3f3f));
    dist[sx][sy] = 0;
    string line;
    for(int i = 0; i < h; i ++) {
        cin >> line;
        for(int j = 0; j < w; j ++) {
            maze[i][j] = line[j];
        }
    }
    cout << bfs(maze, dist) << endl;
    return 0;
}


Measured memory_bytes: 11892
#include <iostream>
#include <vector>

using namespace std;

void solve()
{
	int N, M, P;
	while(cin >> N >> M >> P, N || M || P)
	{
		vector<int> vec(N);
		int sum = 0;
		for(int i = 0; i < N; ++i)
		{
			cin >> vec[i];
			sum += vec[i] * 100;
		}
		sum = sum * (100 - P) / 100;
		if(vec[M - 1] != 0)
		{
			cout << sum / vec[M - 1] << endl;
		}
		else
		{
			cout << 0 << endl;
		}
	}
}

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

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

namespace AtCoder.Abc
{
    class A_171_αlphabet
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            // 文字列の入力
            string α = Console.ReadLine();
            string a;
            if (Regex.IsMatch(α,@"[a-z]"))
            {
                a = "a";
            }
            else
            {
                a = "A";
            }

            string result = a;

            Console.WriteLine(result);

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 26732
using System;
class B{
  static void Main()
  {
    var s = Console.ReadLine();
    Console.WriteLine(string.Format("{0}{0}{0}", s[0] > s[1] || (s[0] == s[1] && s[0] >= s[2]) ? s[0]-'0': s[0]-'0'+1 ));
  }
}

Measured memory_bytes: 13140
"""
NTC here
"""
import sys
inp= sys.stdin.readline
input = lambda : inp().strip()
flush= sys.stdout.flush
# import threading
# setrecursionlimit(10**6)
# threading.stack_size(2**26)

def iin(): return int(input())
def lin(): return list(map(int, input().split()))

# range = xrange
# input = raw_input

def main():
    n, k = lin()
    print('YES' if k*2-1<=n else 'NO')





        
main()
#threading.Thread(target=main).start()

Measured memory_bytes: 3060
// Anve$hi $hukla
#include <bits/stdc++.h>
using namespace std;
struct ${$(){ios_base::sync_with_stdio(false);cin.tie(NULL);}}$;

typedef long long LL;
const long long Mod = 1e9 + 7;

int main() {
    long long n, m;
    cin >> n >> m;
    if(n > m) {
        swap(n, m);
    }
    if(m - n > 1) {
        cout << 0 << endl;
        return 0;
    } else {
        long long ans = 1;
        if(m == n)
            ans = 2;
        for(long long i = 1; i <= n; i++) {
            ans = (ans * i) % Mod;
        }
        for(long long i = 1; i <= m; i++) {
            ans = (ans * i) % Mod;
        } 
        cout << ans << endl;
    }

    return 0;
}


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

using namespace std;
using ll = long long;

int main() {
#ifdef LOCAL
    freopen("in1.txt", "r", stdin);
    freopen("out1.txt", "w", stdout);
#endif


    int n;
    cin >> n;
    int a[105], b[105];
    for(int i = 0; i < n; ++i) {
        cin >> a[i] >> b[i];
    }
    int con = 0;
    bool ok = false;
    for(int i = 0; i < n; ++i){
        if(a[i] == b[i]) con++;
        else con = 0;
        if(con == 3){
            ok = true;
            break;
        }
    }
    if(ok) puts("Yes");
    else puts("No");
    return 0;
}

Measured memory_bytes: 3632
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
t=sum(a)
for i in range(n):
  if a[i]<b[i]:
    a[i+1]=max(a[i+1]-b[i]+a[i],0)
    a[i]=0
  else:
    a[i]-=b[i]
print(t-sum(a))

Measured memory_bytes: 19116
#include <set>
#include <iostream>
#include <vector>
using namespace std;

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


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

  int prev = -1;
  while(s.size()){
    int now;
    if(s.substr(0, 3) == "egg"){
      now = 0;
    }else{
      now = 1;
    }

    if(now == prev || prev == -1){
      v.push_back(vector<int>());
    }
    v[v.size() - 1].push_back(now);
    prev = now;

    if(now == 0) s = s.substr(3);
    else s = s.substr(7);
  }

  int alen = 0;
  REP(i,v.size()) alen = max<int>(alen, v[i].size());


  REP(i,v.size()){
    if(alen == v[i].size()){
      cout << (v[i][alen - 1] == 0 ? "egg" : "chicken") << endl;
      break;
    }
  }

  return 0;
}

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

int main() {
  int A,B,C;
  cin >> A >> B >> C;
  B = abs(A-B);
  C = abs(A-C);
  
  if (B+C == 0 && A%2 == 0) {
    cout << -1 << endl;
    return 0;
  }
  if (B+C == 0) {
    cout << 0 << endl;
    return 0;
  }
  
  int ans = 0;
  for (;;) {
    if (B%2 + C%2 > 0) {
      break;
    }
    ans++;
    B /= 2;
    C /= 2;
  }
  cout << ans << endl;
}

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

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

using namespace std;

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

	int ans = 0;

	for (int i = s.size() - 1; i >= 0; i--)
		if (s[i] == 'Z') {
			ans = i;
			break;
		}

	for(int i=0;i<s.size();i++)
		if (s[i] == 'A') {
			ans = ans - i;
			break;
		}

	cout << ans+1 << endl;

	return 0;
}

Measured memory_bytes: 640
// #Sazaの1日1AC
#include<bits/stdc++.h>
using namespace std;
const long long mod=1000000000+7;
const long long INF=9e18;
const double PI=3.14159265358979323846;

//マクロ
//型エイリアス
using ll = long long;
using P=pair<long long,long long>;
using vl=vector<long long>;
using vvl=vector<vector<long long>>;
using vP=vector<pair<long long, long long>>;
//ショートカット
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,k,n) for(int i=k;i<n;i++) //半開区間
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define mkp make_pair
//入力
#define vin(v,N) for(long long i=0;i<N;i++) cin>>v.at(i)
#define lin(n) long long n;cin>>n
#define chin(x) char x;cin>>x;
#define sin(s) string s;cin>>s;
#define vlin(v,N) vector<long long>v(N);for(long long i=0;i<N;i++)cin>>v.at(i)

#define max(a,b) max((ll)a,(ll)b)
#define min(a,b) min((ll)a,(ll)b)

//関数
//最大公約数
long long gcd(long long m, long long n){
  long long a=max(m,n);
  long long b=min(m,n);
  long long r=a%b;
  while(r!=0){
    a=b; b=r; r=a%b;
  }
  return b;
}
// 最小公倍数
long long lcd(long long m, long long n){
  return m*n/gcd(m,n);
}
//xのn乗
long long power(long long x, long long N){
  long long ret=1;
  for(long long i=0;i<N;i++)   
    ret*=x;
  return ret;
}
//繰り返し二乗法
long long repeat_squaring(long long x, long long n){
  if(n==0) return 1;
  else if(n%2==0){
    long long t=repeat_squaring(x,n/2);
    return t*t%mod;
  }
  else
    return x*repeat_squaring(x,n-1);
}
//素因数分解(mapで返す)
map<long long,long long> factor(long long p){
  ll p1=p;
  map<long long,long long>ret;
  for(long long i=2;i*i<=p1;i++){
     while(p%i==0){
      ret[i]++;
      p/=i;
    }
  }
  if(p!=1)
  ret[p]++;
  return ret;
}
//素数判定
bool is_prime(long long N){
  for(long long i=2;i*i<=N;i++){
    if(N%i==0)
      return false;
  }
  return true;
}
//最大値更新
void chmax(long long &a,long long b){
  a=max(a,b);
}
//最小値更新
void chmin(long long &a,long long b){
  a=min(a,b);
}

//構造体
//Union-Find木
struct UnionFind{
  //メンバ変数 
  vector<long long>par; //par[i]:=頂点iの親
  vector<long long>s; //s[i]:=頂点iが属する集合の個数(iが根のとき)
  
  //コンストラクタ
  UnionFind(long long N):par(N),s(N){
    for(long long i=0;i<N;i++){
      par[i]=i; //最初はすべてが根として初期化
      s[i]=1;
    }
  }
  //メンバ関数
  //root(i):=頂点iの根
  long long root(long long i){
    if(par[i]==i) return i;
    par[i]=root(par[i]); //経路圧縮
    return root(par[i]); //再帰
  }
  //size[i]:=iが属する集合の個数
  long long size(long long i){
    return s[root(i)];
  }
  //same(x,y) xとyが同じ根を持つか(同じ集合に含まれるか)
  bool same(long long x, long long y){
    return root(x)==root(y);
  }
  //unite(x,y) xの根をyの根に繋げる(集合を合併)
  void unite(long long x, long long y){
    if(!same(x,y)){
      long long rx=root(x);
      long long ry=root(y);
      par[rx]=par[ry];
      s[ry]=s[rx]+s[ry];
    }
  }
};
/////////////////⊂('ω'⊂ )))Σ≡GO!/////////////////

//メイン関数
int main(){
  //doubleの桁数
  cout<<fixed<<setprecision(10);
  
  lin(N); lin(M);
  UnionFind num(N);
  rep(i,M){
    lin(x);lin(y);lin(z);
    if(!num.same(x,y)) N--;
    num.unite(x,y);
  }
  
  cout << N << endl;
}

Measured memory_bytes: 1792
#include<stdio.h>

int main(){
	int mon,day,t,i;
	while(1){
		scanf("%d%d",&mon,&day);
		if(!mon&&!day)break;
		t=0;
		for(i=1;i<mon;i++){
			if(i==2)t+=29;
			else if(i==4||i==6||i==9||i==11)t+=30;
			else t+=31;
		}
		t+=day;
		switch(t%7){
		case 0:
			printf("Wednesday\n");
			break;

		case 1:
			printf("Thursday\n");
			break;

		case 2:
			printf("Friday\n");
			break;
		
		case 3:
			printf("Saturday\n");
			break;

		case 4:
			printf("Sunday\n");
			break;

		case 5:
			printf("Monday\n");
			break;

		case 6:
			printf("Tuesday\n");
			break;
		}
	}
	return 0;
}

Measured memory_bytes: 580