akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <cstdarg>
#include <sys/time.h>
#include <fstream>
//#include "cout.h"

using namespace std;

#define SZ(x) ((int)x.size())
#define MSET(x,a) memset(x, a, (int)sizeof(x))
#define PB push_back
#define VI vector < int >
#define PII pair < int, int >
#define LL long long
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define FIT(it,v) for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OUT(A) cout << #A << " = "<< (A) << endl
#define OUT2(A, B) cout << "(" << #A << ", " << #B << ") = (" << (A) << ", "<< (B) << ")" << endl
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }

#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(ALL(c), (e)) != (c).end())



void init() {

}

void input() {

}

void solve() {
  int n, a, b;
  cin >> n >> a >> b;
  int cnt1 = 0;
  int cnt2 = 0;
  int cnt3 = 0;
  REP(i, n) {
    int p;
    cin >> p;
    if (p <= a) cnt1++;
    else if (p <= b) cnt2++;
    else cnt3++;
  }
  int res = 100;
  chmin(res, cnt1);
  chmin(res, cnt2);
  chmin(res, cnt3);
  cout << res << endl;
}

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


Measured memory_bytes: 256
def main():
    import sys
    sys.setrecursionlimit(10 ** 7)
    
    input = sys.stdin.readline

    N, M, K = map(int, input().split())

    fs = tuple(set() for _ in range(N))
    for _ in range(M):
        a, b = (int(x) - 1 for x in input().split())
        fs[a].add(b)
        fs[b].add(a)

    bs = tuple(set() for _ in range(N))
    for _ in range(K):
        a, b = (int(x) - 1 for x in input().split())
        bs[a].add(b)
        bs[b].add(a)

    roots = [-1] * N
    sizes = [-1] * N

    def dfs(v):
        """
        return: 連結成分のサイズを返す
        roots: 連結成分の各成分に根のindexを割り当てる
        """
        sz = 1
        for u in fs[v]:
            if ~roots[u]: continue
            roots[u] = roots[v]
            sz += dfs(u)
        return sz

    for v in range(N):
        if ~roots[v]: continue
        roots[v] = v
        sizes[v] = dfs(v)

    ans = []
    for v in range(N):
        r = roots[v]
        res = sizes[r] - 1 - len(fs[v]) - sum(1 for u in bs[v] if roots[u] == r)
        ans.append(res)

    print(*ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 93760
def list_up_next_games(players):
    games = set()
    for p in players:
        if A[p]:
            opponent = A[p][-1] - 1
            if A[opponent][-1] - 1 == p:
                if p < opponent:
                    games.add((p, opponent))
                else:
                    games.add((opponent, p))
    return(games)

N = int(input())
A = [list(map(int, input().split())) for i in range(N)]
for i in range(N):
    A[i].reverse()

games = list_up_next_games(list(range(N)))

done_games = []
days = 0
while games:
    days += 1
    players = []
    for game in games:
        done_games.append(game)
        A[game[0]].pop()
        A[game[1]].pop()
        players.append(game[0])
        players.append(game[1])
    games = list_up_next_games(players)

if len(done_games) == N*(N-1)//2:
    print(days)
else:
    print(-1)


Measured memory_bytes: 106588
N, H = map(int, input().split())
bs = []
maxA = 0
ans = 0
for _ in range(N):
    a, b = map(int, input().split())
    maxA = max(maxA, a)
    bs.append(b)
bs.sort(reverse=True)

for b in bs:
    if H <= 0: break
    if b > maxA:
        H -= b
        ans += 1

if H > 0:
    ans += (-(-H//maxA))
print(ans)


Measured memory_bytes: 7384
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <math.h>
#include <string>
#include <numeric>
#include <queue>
#include <cstdio>
#include <cstring>
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define rep1(i,n) for(ll i=1;i<n;++i)
#define mrep(i,n) for(ll i=n;i>=0;--i)
#define all(a) (a).begin(),(a).end()
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vb vector<bool>
#define vvb vector<vector<bool> >
#define pl pair<ll,ll>
#define inf 1001001001001001000
#define mod 1000000007
//#define mod 998244353
#define pi 3.1415926535
using namespace std;
struct __INIT {
	__INIT() {
		cin.tie(0);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(15);
	}
}__init;


int main(void) {
    ll n;
    cin>>n;
    //for(ll n=0;n<101;n++){
    ll dp[101][4];
    dp[0][0] = dp[0][1] = dp[0][2] = dp[0][3] = 0;
    dp[1][0] = dp[1][1] = dp[1][2] = dp[1][3] = 1;
    dp[2][0] = dp[2][1] = dp[2][2] = dp[2][3] = 4;
    for(ll i = 3;i<=n;i++){
        dp[i][0] = (dp[i-1][0]+dp[i-1][1]-dp[i-2][2]+dp[i-1][2]-dp[i-2][1]+dp[i-1][3]-3*dp[i-3][2])%mod;
        dp[i][1] = (dp[i-1][0]-dp[i-2][2]+dp[i-3][1]+dp[i-1][1]+dp[i-1][2]+dp[i-1][3])%mod;
        dp[i][2] = (dp[i-1][0]+dp[i-1][1]+dp[i-1][2]+dp[i-1][3])%mod;
        dp[i][3] = (dp[i-1][0]+dp[i-1][1]+dp[i-1][2]+dp[i-1][3])%mod;
    }
    if((dp[n][0]+dp[n][1]+dp[n][2]+dp[n][3])%mod < 0){
        cout<<(dp[n][0]+dp[n][1]+dp[n][2]+dp[n][3])%mod+mod<<endl;
    }
    else cout<<(dp[n][0]+dp[n][1]+dp[n][2]+dp[n][3])%mod<<endl;
    //}
    return 0;
}


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

struct node{
	vector<int> to;
	vector<int> cost;

	bool done = false;
}node[100000];

int dist[100000];
int tmp;

void push_node(int l, int r, int d){
	node[l-1].to.push_back(r-1);
	node[l-1].cost.push_back(d);
}

void dij(int i, int d){
	if (node[i].done){
		if (dist[i] != d){
			cout << "No" << endl;
			exit(0);
		}
		else{
			return;
		}
	}
	else{
		node[i].done = true;
		dist[i] = d;
		for (int j = 0; j < node[i].to.size(); j++){
			dij(node[i].to[j], d + node[i].cost[j]);
		}
	}
}

int main(void){
	int n, m;
	int l, r, d;
	
	cin >> n >> m;
	for (int i = 0; i < m; i++){
		cin >> l >> r >> d;
		push_node(l, r, d);
		push_node(r, l, -d);
	}
	for (int i = 0; i < n; i++){
		if (!node[i].done) dij(i, 0);
	}

	cout << "Yes" << endl;

	return 0;
}

Measured memory_bytes: 17152
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in Actual solution is at the top
 */
public class Main {

  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    TaskB solver = new TaskB();
    solver.solve(1, in, out);
    out.close();
  }

  static class TaskB {

    public void solve(int testNumber, InputReader in, PrintWriter out) {
      long[] arr = in.nextLongArray(3);
      long k = in.nextLong();
      Arrays.sort(arr);
      for (int i = 0; i < k; i++) {
        arr[2] *= 2L;
      }
      out.println(ArrayUtils.sum(arr));
    }

  }

  static class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1 << 13];
    private int curChar;
    private int numChars;

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

    public int read() {
      if (this.numChars == -1) {
        throw new UnknownError();
      } else {
        if (this.curChar >= this.numChars) {
          this.curChar = 0;

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

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

        return this.buf[this.curChar++];
      }
    }

    public long nextLong() {
      int c;
      for (c = this.read(); isSpaceChar(c); c = this.read()) {
      }

      byte sgn = 1;
      if (c == 45) {
        sgn = -1;
        c = this.read();
      }

      long res = 0;

      while (c >= 48 && c <= 57) {
        res *= 10L;
        res += c - 48;
        c = this.read();
        if (isSpaceChar(c)) {
          return res * sgn;
        }
      }
      throw new InputMismatchException();
    }

    public static boolean isSpaceChar(int c) {
      return c == 32 || c == 10 || c == 13 || c == 9 || c == -1;
    }

    public long[] nextLongArray(int n) {
      long[] arr = new long[n];
      for (int i = 0; i < n; i++) {
        arr[i] = nextLong();
      }
      return arr;
    }

  }

  static class ArrayUtils {

    public static long sum(long[] arr) {
      long ret = 0;
      for (int i = 0; i < arr.length; i++) {
        ret += arr[i];
      }
      return ret;
    }

  }
}



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

int main(void){
    int n,k,q;
    cin >> n >> k >> q;
    vector<int> a(n);
    for(int i = 0;i < q;i++){
        int x;
        cin >> x;
        x--;
        a[x]++;
    }
    for(int i = 0;i < n;i++){
        if(k - q + a[i] > 0){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int mx=0,tmp=1e9,sum=0;
	for (int i=0;i<n;i++){
		int a;
		cin>>a;
		if (tmp>=a) sum++,tmp=a;
		else{
			if (sum>=mx) mx=sum;
			tmp=a;
			sum=1;
		}
	}
	cout<<max(sum,mx)-1<<endl;
	return 0;
}

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

using namespace std;

int P,Q,R;
int a[5];

int main()
{
	cin>>P>>Q>>R;
	a[1]=P;
	a[2]=Q;
	a[3]=R;
	sort(a+1,a+4);
	cout<<a[1]+a[2]<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template < typename T > string tost( const T& n ) { ostringstream stm; stm << n; return stm.str();}
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 const INF = 1001001001;


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

string s;
cin >> s;
set<char> st;
rep(i,s.size()) st.insert(s[i]);
if(st.size() == 4) cout << "Yes" << endl;
else if (st.size() == 1 || st.size() == 3) cout << "No" << endl;
else {
    string t = "";
    for(auto c : st) t.push_back(c);
    if(t == "EW" || t == "NS") cout << "Yes" << endl;
    else cout << "No" << endl;
}

return 0;
}

Measured memory_bytes: 256
r,g,b,n = map(int,input().split())
cnt = 0
for i in range(n//r+1):
    for j in range(n//g+1):

        if (n-r*i-g*j) % b == 0 and n-r*i-g*j >= 0:
            cnt += 1
print(cnt)

Measured memory_bytes: 40940
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<numeric>
#include<iomanip>
#include<deque>
#include<tuple>
#include<queue>
#include<map>
#include <cstdint>
#include<unordered_map>
#include <boost/multiprecision/cpp_int.hpp>


#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define Endl endl
#define F first
#define S second

namespace mp = boost::multiprecision;

using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;

ll GCD(ll x, ll y) {
	return x ? GCD(y % x, x) : y;
}

ll LCM(ll m, ll n)
{
	if ((0 == m) || (0 == n))
		return 0;

	return ((m / GCD(m, n)) * n); // lcm = m * n / GCD(m,n)
}
int main() {
	int n;
	cin >> n;
	map<int, int>a;
	deque<int>ans;
	ll s = 0;
	rep(i, n) {
		int m;
		cin >> m;
		if (a[m] == 0) {
			a[m] = i + 1;
		}
		else {
			a[m] = 0;
			ans.push_back(m);
		}
	}
	if (ans.size() <= 1) {
		cout << 0 << endl;
	}
	else {
		sort(all(ans));
		reverse(all(ans));
		s =(ll) ans[0] * ans[1];
		cout << s << endl;
	}
}


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

int main(){
    long long a,b,k;
    int h,n;

    cin >>h>>n;

    vector<int> A(n);

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

    for(int i = 0;i < n;i++){
        h-=A[i];
    }
    if(h<=0){
        cout <<"Yes" <<endl;
    }else{
        cout <<"No" <<endl;
    }
}



Measured memory_bytes: 640
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int i = 1;

		while(true){
			int x = i;
			if(x % 3 == 0){
				System.out.printf(" %d",i);
			}else{
				while(x != 0){
					if(x % 10 == 3){
						System.out.printf(" %d",i);
						break;
					}else{
						x = x / 10;
					}
				}
			}

			i++;
			if(i > n){
				break;
			}
		}
		System.out.print("\n");
	}
}

Measured memory_bytes: 33896
#include <iostream>
using namespace std;
 
int main() {
int n,d;
cin >> n;
d = n%10;
if((d==2)||(d==4)||(d==5)||(d==7)||(d==9)){
cout << "hon" << endl;
}
else if((d==0)||(d==1)||(d==6)||(d==8)){
cout << "pon" << endl;
}
else cout << "bon" << endl;
return 0;
}

Measured memory_bytes: 3632
#include <stdio.h>

int n;
char ans[100] = {};
bool bi[100] = {};
int len = 0;


int main() {

	scanf("%d", &n);


	int sub = n;
	int hit = 0;
	int at = 2;
	int i = 0;
	
	if (sub == 0) ans[0] = '0';

	while (sub != 0) {
		hit = sub % 2;
		bi[i] = hit;
		i++;
		if(sub > 0 ) sub = sub / (-2);
		else sub = (sub - 1) / (-2);
		
	}

	for (int j = 1; j <= i; j++) {
		if (bi[j-1])
			ans[i-j] = '1';
		else
			ans[i-j] = '0';
	}


	printf("%s\n", ans);

	return 0;

}

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

using namespace std;
using ll = long long;

#define rep(i, a) for (int (i) = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int (i) = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int (i) = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int (i) = (int) (a)-1; (i) >= (int) (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
#define TRUE__ "Yes"
#define FALSE__ "No"
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x

#ifdef LOCAL
	#define lcout(a) cout << a;
	#define lcoutln(a) cout << a << endl;
	#define lcerr(a) cerr << a;
	#define lcerrln(a) cerr << a << endl;
#else
	#define lcout(a) 
	#define lcoutln(a) 
	#define lcerr(a) 
	#define lcerrln(a) 
#endif

vector<int> s(26);
int N;

void reset()
{
	rep(i, 26) s[i] = 0;
}

void wh(int& a, int& b)
{
	auto v = s;
	sort(all(v));
	a = v[25];
	b = v[24];
}

void culc(int& a, int& pos)
{
	string t;
	getchar();
	getline(cin, t);
	int b;
	rep(i, N) {
		s[t[i*2]-'A']++;
		wh(a, b);
		if (a > b + (N-i-1)) {
			rep(j, 26) if (s[j]==a) {
				pos = j;
				a = i+1;
				return;
			}
		}
	}
	pos = -1;
}

int main()
{
	cin >> N;
	while (N) {
		int a, pos;
		culc(a, pos);
		if (pos == -1) cout << "TIE" << endl;
		else cout << (char) (pos+'A') << " " << a << endl;
		cin >> N;
		reset();
	}
}



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

int main()
{
	int a[4][4]={};
	int x, y;
	rep(i, 3)
	{
		cin >> x >> y;
		x--; y--;
		a[x][y]=1; a[y][x]=1;
	}
	int d[4]={};
	int mm=0;
	rep(i, 4)
	{
		rep(j, 4)
		{
			d[i]+=a[i][j];
		}
		mm=max(d[i], mm);
	}
	if(mm>2) cout << "NO" << endl;
	else cout << "YES" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vii;
typedef vector<vector<int>> vvi;
#define clr(a, b) memset(a, b, sizeof(a))
#define pb push_back
#define frpn(x) freopen(#x ".in","r",stdin);freopen(#x ".out","w",stdout);
#define all(a) a.begin(), a.end()
#define mkp make_pair
#define forn(i, n) for(int i=0; i<(int)(n); ++i)
#define forab(i, a, b) for(int i=(int)(a); i<=(int)(b); ++i)
#define fornd(i, n) for(int i=(int)(n-1); i>=0; --i)

const int MOD = (int)1e9+7;

template <class T>
inline void rem(T &n){
   n = (-MOD <= n && n <= MOD) ? n : n%MOD ;
  if(n < 0) n += MOD; 
}
//modular inverse
//inv(a,m) - inverse of a mod m
template <class T>
inline T inv(T a, T m){
 return 1<a ? m - inv(m%a, a)*m/a : 1;
}
//const int NAX = (int)3e5+5;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifdef LOCAL
    clock_t tStart = clock();
#endif
   int n, k, q; cin >> n >> k >> q;
   vi a(n, 0);
   forn(i, q) {
      int x; cin >> x;
      --x;
      ++a[x];
   } 
   forn(i, n) 
     if(k - (q-a[i]) <= 0)
       cout << "No\n";
     else
       cout << "Yes\n";
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * (clock() - tStart)/ CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}


Measured memory_bytes: 1024
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using LLONG = long long;
const LLONG MOD = 1000000007;

int main()
{
    int h1, m1, h2, m2, k; cin >> h1 >> m1 >> h2 >> m2 >> k;
    int all = h2 * 60 + m2 - (h1 * 60 + m1);
    cout << all - k << endl;
}


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

int main(){
  int deck[200],a[200],b[200];
  int n,m,k;
  int i,j;

  cin >> n;
  cin >> m;

  for(i=0;i<2*n;i++)deck[i] = i+1;

  for(i=0;i<m;i++){
    cin >> k;
    if(!k){
      for(j=0;j<n;j++){
	a[j] = deck[j];
	b[j] = deck[j+n];
      }
      for(j=0;j<n;j++){
	deck[2*j] = a[j];
	deck[2*j+1] = b[j];
      }
    }else{
      for(j=0;j<k;j++)a[j] = deck[j];
      for(j=k;j<2*n;j++)b[j-k] = deck[j];
      for(j=0;j<2*n-k;j++)deck[j] = b[j];
      for(j=2*n-k;j<2*n;j++)deck[j] = a[j-2*n+k];
    }
  }
  for(i=0;i<2*n;i++)cout << deck[i] << endl;
}

Measured memory_bytes: 0
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys, math, bisect, random, itertools
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n = II()
    print(n*n*3)
    return

#B
def B():
    n, d = LI()
    print((n-1)//(2*d+1)+1)
    return

#C
def C():
    n = II()
    a = IR(n)
    b = a[::1]
    b.sort()
    for i in range(n):
        if a[i] == b[-1]:
            print(b[-2])
        else:
            print(b[-1])
    return

#D
def D():
    n = II()
    a = [0] + LI()
    for i in range(n // 2, 0, -1):
        x = sum(a[i::i])
        if x % 2 != a[i]:
            a[i] ^= 1
    ans = []
    x = 0
    for i in range(1, n + 1):
        if a[i]:
            ans.append(str(i))
            x += 1
    print(x)
    if x == 0:
        return
    print(" ".join(ans))
    return

#E
def E():
    n = II()
    a = IR(n)
    dp = deque([a[0]])
    ans = 1
    for i in a[1:]:
        x = bisect_right(dp, i)
        y = bisect_left(dp, i)
        if y == 0:
            ans += 1
            dp.appendleft(i)
        else:
            if x == y:
                dp[y - 1] = i
            else:
                if y >= ans:
                    ans += 1
                    dp.append(i)
                else:
                    dp[y - 1] = i
    print(ans)
    return

#F
def F():
    return

#Solve
if __name__ == '__main__':
    E()


Measured memory_bytes: 49756
#include <iostream>
#include <cstring>
using namespace std;
int main(){
int sum;
char s[100];
cin>>s;
for(int i=0;i<strlen(s);i++){
for(int j=i+1;j<strlen(s);j++){
if(s[i]==s[j])sum++;
}
}
if(sum==0)cout<<"yes";
else cout<<"no";
return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;
typedef pair<pll, pll> P;
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS = 1e-9;
const bool debug = 0;
//---------------------------------//

int main() {
	string str[100];
	bool isnr[100][100] = {};
	int H, W;
	cin >> H >> W;
	REP(i, H) cin >> str[i];
	
	REP(i, H) {
		bool ok = true;
		REP(j, W) if (str[i][j] == '#') ok = false;
		if (ok) REP(j, W) isnr[i][j] = true;
	}
	
	REP(j, W) {
		bool ok = true;
		REP(i, H) if (str[i][j] == '#') ok = false;
		if (ok) REP(i, H) isnr[i][j] = true;
	}
	
	REP(i, H) {
		bool isln = true;
		REP(j, W) if (!isnr[i][j]) isln = false;
		if (isln) continue;
		REP(j, W) if (!isnr[i][j]) putchar(str[i][j]);
		puts("");
	}
	
	return 0;
}

Measured memory_bytes: 256
n=int(input())
t=[[int(i)for i in input().split()]for i in range(n)]
import math
from fractions import Fraction
dp=[0]*n
dp[0]=1
for i in range(1,n):
    dp[i]=math.ceil(max(Fraction(t[i-1][0],t[i][0]),Fraction(t[i-1][1],t[i][1]))*dp[i-1])
print(dp[-1]*(t[n-1][0]+t[n-1][1]))

Measured memory_bytes: 5680
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8').trim()

const s = stdin.split('\n')[0]

const ans = () => {
  const sAry = s.split('')

  for (let i = 1; i < sAry.length; i++) {
    if (sAry[i] === sAry[i - 1]) {
      return 'Bad'
    }
  }
  return 'Good'
}

console.log(ans())


Measured memory_bytes: 7372
from itertools import combinations_with_replacement as c

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

Q=[list(map(int,input().split())) for _ in range(q)]
a=0

for i in c(range(1,m+1),n):
    s=0
    for j in Q:
        if i[j[1]-1]-i[j[0]-1]==j[2]:
            s+=j[3]
    a=max(a,s)
print(a)

Measured memory_bytes: 9092
#include <cstdio>
long long L, R;
int main()
{
	scanf("%lld%lld", &L, &R);
	if (L == R)
	{
		puts("1");
		return 0;
	}
	long long H = 1;
	while (H << 1 <= (L ^ R))
		H <<= 1;
	L &= H + H - 1;
	R &= H + H - 1;
	long long E = 1;
	while (E <= R - H)
		E <<= 1;
	printf("%lld\n", H - L + (E > L ? H : H - L + E));
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <sstream>
#include <map>
#include <vector>
#include <algorithm>

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

using namespace std;

vector<string> split(const string &str, char delim)
{
  vector<string> res;
  size_t current = 0, found;
  while((found = str.find_first_of(delim, current)) != string::npos)
  {
    res.push_back(string(str, current, found - current));
    current = found + 1;
  }
  res.push_back(string(str, current, str.size() - current));
  return res;
}

int main()
{
	string f[101];
	map<string,string> m;

	string s,n;
	vector<string> res;
	while(cin >> s)
	{
		cin >> n;
		m[s] += n + " ";

		vector<string>::iterator ite = find(res.begin(),res.end(),s);
		if(ite == res.end())
		{
			res.push_back(s);
		}
	}

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

	rep(i,res.size())
	{
		cout << res[i] << endl;
		m[res[i]] = m[res[i]].substr(0,m[res[i]].size()-1);
		vector<string> _s = split(m[res[i]],' ');
		vector<int> v;
		rep(j,_s.size())
		{
			v.push_back(atoi(_s[j].c_str()));
		}

		sort(v.begin(),v.end());		
		
		rep(j,v.size())
		{
			if(j == _s.size()-1)
			{
				cout << v[j] << endl;
			}
			else
			{
				cout << v[j] << " ";
			}
		}
	}

	return 0;
}

Measured memory_bytes: 1244
s = input()
K = int(input())
l = [chr(i) for i in range(97, 97+26)]
selected = []
for i in l:
  if i in s:
    index = []
    for ind, j in enumerate(s):
      if i == j:
        index.append(ind)
    for j in index:
      for k in range(K):
        if j+k == len(s):
          break
        selected.append(s[j:j+k+1])
    selected=list(set(selected))
    selected.sort()
    if len(selected)>=K:
      print(selected[K-1])
      break


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

int main(){
  int a, b, x;
  cin >> a >> b >> x;
  
  if (a+b < x)
    cout << "NO" << endl;
  else{
    if (a > x)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}

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

int main() {
	int A, B;
	cin >> A >> B;
	int a = A + B;
	int b = B - A;

	if (B % A == 0) {
		cout << a << endl;
	}
	else {
		cout << b << endl;
	}
 }

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <iostream>
#include <algorithm>
//#include <vector>

using namespace std;

#define MAX(x,y) (x>y?x:y)
#define MIN(x,y) (x<y?x:y)
#define ABS(x) (x>0?x:-(x))
#define INF 1000000000

#define MOD 1000000007

void swap(int* a, int* b)
{
	int tmp;
	tmp = *a;
	*a = *b;
	*b = tmp;
}

void swap2(double* a, double* b)
{
	double tmp;
	tmp = *a;
	*a = *b;
	*b = tmp;
}

int gcd(int a, int b)  //最大公約数
{
	if (a < b)
		swap(&a, &b);

	if (a % b == 0)
		return b;
	else
		return gcd(b, a % b);
}

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

long power(long x, int n) { //x^n 計算量O(logn)
	long ans = 1;
	while (n > 0) {
		if ((n & 1) == 1) {
			ans = ans * x;
		}
		x = x * x; //一周する度にx, x^2, x^4, x^8となる
		n >>= 1; //桁をずらす n = n >> 1
	}
	return ans;
}

int choose(int n, int k) {
	return k == 0 ? 1 : (long long)choose(n - 1, k - 1) * n % MOD * power(k, MOD - 2) % MOD;
}

void bubble_sort(int a[], int n)
{
	int i, j, tmp;

	for (i = 0; i < n; i++)
	{
		for (int k = 0; k < n; k++)
			printf("%d ", a[k]);

		for (j = n - 1; j > i; j--)
		{
			if (a[j - 1] > a[j])
			{
				tmp = a[j];
				a[j] = a[j - 1];
				a[j - 1] = tmp;
			}
		}
		printf("\n");
	}
}

void selection_sort(int a[], int n)
{
	int i, j, tmp, min, key;

	for (i = 0; i < n - 1; i++)
	{
		min = i;
		key = a[i];

		for (int k = 0; k < n; k++)
			printf("%d ", a[k]);

		for (j = i + 1; j < n; j++)
		{
			if (a[j] < a[min])
			{
				min = j;
				key = a[j];
			}
		}

		tmp = a[i];
		a[i] = a[min];
		a[min] = tmp;

		printf("\n");
	}

	for (int k = 0; k < n; k++)
		printf("%d ", a[k]);
}

void insertion_sort(int a[], int n)
{
	int i, j, tmp;

	for (i = 1; i < n; i++)
	{
		j = i;

		while (j >= 1 && a[j - 1] > a[j])
		{
			tmp = a[j];
			a[j] = a[j - 1];
			a[j - 1] = tmp;
			j--;
		}
	}
}

void shell_sort(int a[], int n)
{
	int h, i, j;

	for (h = 1; h < n / 9; h = h * 3 + 1)
		;

	for (; h > 0; h /= 3)
	{
		for (int k = 0; k < n; k++)
			printf("%d ", a[k]);

		for (i = h; i < n; i++)
		{
			j = i;
			while (j >= h && a[j - h] > a[j])
			{
				swap(&a[j - h], &a[j]);
				j -= h;
			}
		}
		printf("\n");
	}

	for (int k = 0; k < n; k++)
		printf("%d ", a[k]);
}

int partition(int a[], int l, int r)
{
	int i, j, pivot;

	i = l - 1;
	j = r;
	pivot = a[r];

	for (;;)
	{
		while (a[++i] < pivot)
			;
		while (i < j-- && pivot < a[j])
			;

		if (i >= j)
			break;

		swap(&a[i], &a[j]);
	}

	swap(&a[i], &a[r]);
	return i;
}

void quick_sort1(int a[], int l, int r)
{
	int v;

	if (l >= r)
		return;

	v = partition(a, l, r);

	quick_sort1(a, l, v - 1);
	quick_sort1(a, v + 1, r);
}

void quick_sort(int a[], int n)
{
	quick_sort1(a, 0, n - 1);
}

int main() {
	
	int M, N, L, K;
	int a[100000];

	scanf("%d", &N);

	printf("%d",(N+1)/2);


}

Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
const long long inf = 1LL << 61;
int main() {
	long long n;
	cin >> n;
	vector<int> v;
	while (n > 0) {
		v.push_back(n % 3);
		n /= 3;
	}
	long long ans = inf;
	for (int i = 1; i <= v.size(); ++i) {
		vector<long long> b(i);
		long long mul = 1;
		for (int j = 0; j < v.size(); ++j) {
			if (j < i) b[j] = v[j];
			else {
				mul *= 3;
				b[i - 1] += v[j] * mul;
			}
		}
		bool ok = true;
		for (int j = 0; j < i; ++j) {
			int limit = (j == 0 || j == i - 1 ? 1 : 2);
			if (b[j] >= limit) continue;
			bool found = false;
			for (int k = j + 1; k < i; ++k) {
				if (b[k] >= 1) {
					--b[k];
					for (int l = k - 1; l > j; --l) {
						b[l] += 2;
					}
					b[j] += 3;
					found = true;
					break;
				}
			}
			if (!found) {
				ok = false;
				break;
			}
		}
		if (ok) {
			long long sum = 0;
			for (int j = 0; j < i; ++j) {
				sum += b[j];
			}
			ans = min(ans, sum);
		}
	}
	if (v.empty()) cout << 0 << endl;
	else cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3160
#include <iostream>
//#include <vector>
#include <string>
#include <algorithm>
//#include <math.h>
//#include <queue>
//#include <stack>
//#include <iomanip>

// sometimes used
//#include <set>
//#include <map>
//#include <numeric>
//#include <list>
//#include <deque>
//#include <unordered_map>

typedef long long LL;
//typedef long double LD;
using namespace std;
 
//#define MOD 1000000007
//#define MAX 100100
//#define NIL -1
//#define INFTY 1000000000000000000

int main(){
    string s;
    string t;
    cin >> s >> t;
    LL ans=0;
    for(LL i=0; i<=s.size()-t.size(); i++){
        LL tmp=0;
        for(LL j=0; j<t.size(); j++){
            if(s[i+j]==t[j]){
                tmp++;
            }
        }
        //cout << tmp << endl;
        ans=max(ans, tmp);
    }
    ans=t.size()-ans;

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3596
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	h := nextInt()
	w := nextInt()
	l := make([]string, h)
	for i := 0; i < h; i++ {
		l[i] = nextStr()
	}

	for i := 0; i < h+2; i++ {
		for j := 0; j < w+2; j++ {
			if i == 0 || i == h+1 || j == 0 || j == w+1 {
				fmt.Printf("#")
			} else {
				fmt.Printf("%c", l[i-1][j-1])
			}
		}
		fmt.Printf("\n")
	}

}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // Default=64
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 1828
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
//---------------------------------------------------------------------------------------------------
const double EPS = 1e-8;
const double INF = 1e12;
#define PI 2*acos(0.0)
typedef complex<double> P;
namespace std { bool operator < (const P& a, const P& b) { return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b); } }
namespace std { bool operator == (const P& a, const P& b) { return abs(real(a) - real(b)) < EPS && abs(imag(a) - imag(b)) < EPS; } }
double cross(const P& a, const P& b) { return imag(conj(a)*b); }
double dot(const P& a, const P& b) { return real(conj(a)*b); }
struct L : public vector<P> { L() {} L(const P &a, const P &b) { push_back(a); push_back(b); } };
typedef vector<P> G;
struct C { P p; double r; C() {} C(const P &p, double r) : p(p), r(r) {} };
int ccw(P a, P b, P c) {
	b -= a; c -= a;
	if (cross(b, c) > 0)   return +1;       // counter clockwise
	if (cross(b, c) < 0)   return -1;       // clockwise
	if (dot(b, c) < 0)     return +2;       // c--a--b on line
	if (norm(b) < norm(c)) return -2;       // a--b--c on line
	return 0;
}
/*---------------------------------------------------------------------------------------------------
????????????????????????????????? ??§?????§  
??????????????? ??§?????§ ???????´<_??? ?????? Welcome to My Coding Space!
???????????? ??? ?´_???`??????/??? ???i     
?????????????????????????????? ???  |???|     
????????? /?????? /??£??£??£??£/??????|  
??? ???_(__??????/???    ???/ .| .|????????????  
??? ????????????/????????????/??????u??????  
---------------------------------------------------------------------------------------------------*/






//---------------------------------------------------------------------------------------------------
void _main() {
    double a, b, c, d, e, f, g, h;
    while (~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &a, &b, &c, &d, &e, &f, &g, &h)) {
        vector<P> v;
        v.push_back(P(a, b));
        v.push_back(P(c, d));
        v.push_back(P(e, f));
        v.push_back(P(g, h));

        set<int> s;
        rep(i, 0, 4) {
            int j = (i + 1) % 4;
            int k = (i + 2) % 4;

            s.insert(ccw(v[i], v[j], v[k]));
        }

        if (s.size() == 1) printf("YES\n");
        else printf("NO\n");
    }
}

Measured memory_bytes: 3116
#include <bits/stdc++.h>
const double PI = acos(-1);
#define rep(i, n) for (int i = 0; i < (int)(n); i++ )
using namespace std;
int main(){
    int long long n,a;
    cin >> n >> a;
    int x = -1; 
    int y = -1; 
    int z = -1;
    for(int i = 0; i <= n; i++){
        for(int j = 0; j <= n; j++){
            int num = a - 10000*i - 5000*j;
            if(0 <= num ){
                int k = num / 1000;
                if( i + j + k == n){
                    x = i;
                    y = j;
                    z = k;
                    break;
                }
            }
        }
    }
    cout << x << " " << y << " "<< z << endl;
}

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

int main() {
	int n;//3<=n<=100
	int s;//0<=s<=1000
	int max,min,total,result;
	int i,finish=0;
	
	scanf("%d",&n);
	
	while(finish==0){
	max=0;
	min=1000;
	total=0;
	for(i=0;i<n;i++){
		scanf("%d",&s);
		if(s<min){min=s;}
		if(s>max){max=s;}
		total+=s;
	}
	result=(total-min-max)/(n-2);
	printf("%d\n",result);
	
	scanf("%d",&n);
	if(n==0){finish=1;}
	}
	return 0;
}

Measured memory_bytes: 1188
#include <bits/stdc++.h>
#define N 1000005
#define ll long long int 	
#define MP make_pair
#define pb push_back
#define ppb pop_back
#define sp " "
#define endl "\n"
#define fi first
#define se second
#define ii pair<int,int>
#define lli pair<ll,ll>
#define fast cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false)
#define fast2 freopen ("badhair.gir","r",stdin);freopen ("badhair.cik","w",stdout);
#define mod 1000000009
#define fs(x,y) for(int i=1;i<=y;i++) cin>>x[i]
#define fo(i,x,y) for(int i=x;i<=y;i++)
#define INF 1000000000005
using namespace std;
 
ll n,m,ar[N],sum,arr[N],tut[N];
 
int main()
{
	fast;
	cin>>n;
	fs(ar,n);
	fo(i,1,n)
		tut[ar[i]]=i;
	fs(arr,n);
	fo(i,1,n)
		sum+=arr[i];
	fs(arr,n-1);
	// cout<<sum<<endl;
	// fo(i,1,n)
	// cout<<tut[i]<<sp;
	// cout<<endl;
	fo(i,1,n-1)
		if(tut[i]==tut[i+1]-1)
			sum+=arr[i];
	cout<<sum;
}
 
 
 
/*     cd onedrive\desktop\kod
cls
 
Sinav:21-22 aralik
Aciklama: Muhtemelen 25 aralik
*/

Measured memory_bytes: 4352
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
import sys
def I(): return int(input())  # '123' -> 123
def Is(): return map(int, input().split())  # '123 456' -> 123, 456
def LI(): return list(map(int, input().split()))  # '123 456' -> [123, 456]
def TI(): return tuple(map(int, input().split()))  # '123 456' -> (123, 456)
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  # 'aa bb' -> 'aa','bb' or ['aa','bb']
def LS(): return list(input())  # 'abc123' -> ['a','b','c','1','2','3']
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

s = S()
n = len(s)
a = s[:int(((n-1)/2))]
b = s[int(((n+3)/2)-1):]
if s[:] != s[::-1] or a[:] != a[::-1] or b[:] != b[::-1]:
    print("No")
    exit()
print("Yes")

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

int a(long double b){
    int cnt=0;
    while(b){
        cnt++;
        b/=10;
    }
    return cnt;
}
int main(){
    int n; cin >> n;
    vector<long double>A(n);
    long double sum=1;
    rep(i,n){
        cin >> A[i];
        if(A[i]==0){
            cout << 0 << endl;
            return 0;
        }
    }

    rep(i,n){
        if(sum*A[i]>1000000000000000000){
             cout << -1 << endl;
            return 0;
        }
        sum*=A[i]; 
    }
    cout <<fixed<<setprecision(0)<< sum << endl;
    return 0;
}

Measured memory_bytes: 4780
#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;

int main(){
	int sum = 0;
	int n;
	while(scanf("%d", &n)>0){
		sum = 0;
		for(int i=0; i<10; i++){
			for(int j=0; j<10; j++){
				for(int k=0; k<10; k++){
					for(int l=0; l<10; l++){
						if(i+j+k+l==n) sum++;
					}
				}
			}
		}
		printf("%d\n", sum);
	}

	return 0;
}

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

int main(int argc, char const *argv[])
{
    int a, b, ans;
    string op;
    while(1) {
        cin >> a >> op >> b;
        if (op == "+") ans = a + b;
        else if (op == "-") ans = a - b;
        else if (op == "*") ans = a * b;
        else if (op == "/") ans = a / b;
        else break;
        cout << ans << endl;

    }
    
    return 0;
}







Measured memory_bytes: 3156
N = int(input())
h = list(map(int, input().split()))

dp = [10**10] * (N+1)
dp[0] = 0
dp[1] = abs(h[1] - h[0])
for i in range(2, N):
    dp[i] = min(dp[i-1] + abs(h[i]-h[i-1]), dp[i-2] + abs(h[i]-h[i-2]))

print(dp[N-1])

Measured memory_bytes: 13924
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld double
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int n,m;
    cin>>n>>m;
    cout<<(n*(n-1))/2+(m*(m-1))/2;
}

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

#define INF 0x3f3f3f3f
#define Size 1050
#define pb push_back
#define mp make_pair
#define X first
#define Y second
using namespace std;

typedef long long int ll;
typedef vector <int> vi;
typedef pair <int,int> pii;

inline int read()
{
    int x=0, f=1; char ch=getchar();
    while(ch<'0' || ch>'9') {if(ch=='-') f=-1; ch=getchar();}
    while(ch>='0' && ch<='9') {x=x*10+ch-'0'; ch=getchar();}
    return x*f;
}

vi f;
int main()
{
    int q=read(),k,x;
    while (q--)
    {
        k=read();
        if (k==0) {x=read(); f.pb(x);}
        else if (k==1) {x=read(); printf("%d\n",f[x]);}
        else f.pop_back();
    }
    return 0;
}



Measured memory_bytes: 3980
//{{{
#include<algorithm>
#include<cmath>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<random>
#include<set>
#include<sstream>
#include<sys/time.h>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printw) FUNC(printwe) FUNC(printb) FUNC(printbe) FUNC(printd) FUNC(printde) FUNC(printdu);
#endif
template <class S, class T>
istream& operator >> (istream& in, pair<S, T>& p){ return in >> p.first >> p.second; }
template <class T>
istream& operator >> (istream& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }
//}}}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> as(n); cin >> as;
    map<int, int> mp;
    for(auto& a : as){
        mp[a]++;
    }
    if(mp.size() > 3){
        cout << "No" << '\n';
    }else if(mp.size() == 1){
        cout << (mp.begin()->first == 0 ? "Yes" : "No") << '\n';
    }else if(mp.size() == 2){
        cout << (mp.begin()->first == 0 && mp.begin()->second * 2 == mp.rbegin()->second ? "Yes" : "No") << '\n';
    }else if(mp.size() == 3){
        vector<int> nums;
        int sum = mp.begin()->second;
        for(auto& p : mp){
            if(sum != p.second){
                cout << "No" << '\n';
                return 0;
            }
            nums.push_back(p.first);
        }
        cout << (nums[0] ^ nums[1] ^ nums[2] ? "No" : "Yes") << '\n';
    }
}
/*
0101
1101
1000
0101
1101
1000

01
10
11
01
10
11

10
00
10
*/


Measured memory_bytes: 4224
#include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int,int> II;
typedef tuple<int,int,int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');
// debug cerr
template<class Iter> void __kumaerrc(Iter begin, Iter end) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; }
void __kumaerr(istream_iterator<string> it) { (void)it; cerr<<endl; }
template<typename T, typename... Args> void __kumaerr(istream_iterator<string> it, T a, Args... args) { cerr<<*it<<"="<<a<<", ",__kumaerr(++it, args...); }
template<typename S, typename T> std::ostream& operator<<(std::ostream& _os, const std::pair<S,T>& _p) { return _os<<"{"<<_p.first<<','<<_p.second<<"}"; }
#define __KUMATRACE__ true
#ifdef __KUMATRACE__
#define dump(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); __kumaerr(_it, args); }
#define dumpc(ar) { cerr<<#ar<<": "; FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
#define dumpC(beg,end) { cerr<<"~"<<#end<<": "; __kumaerrc(beg,end); }
#else
#define dump(args...)
#define dumpc(ar)
#define dumpC(beg,end)
#endif

// $ cp-batch AntiAdjacency | diff AntiAdjacency.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address AntiAdjacency.cpp && ./a.out

/*
 
 3/3/2019
 
 19:53-
 
 */

int N,K;

void solve() {
  cout<<(2*K-1<=N?"YES":"NO")<<endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<setprecision(12)<<fixed;
  
  cin>>N>>K;
  solve();
  
  return 0;
}


Measured memory_bytes: 256
use std::{cmp, io};

fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    let n: usize = input.trim().parse().unwrap();
    input.clear();
    io::stdin().read_line(&mut input).unwrap();
    let hs: Vec<isize> = input.trim().split_whitespace().map(|h| h.parse().unwrap()).collect();

    let mut costs = vec![0; n];
    costs[1] = (hs[1] - hs[0]).abs();
    for i in 2..n {
        costs[i] = cmp::min((hs[i] - hs[i - 2]).abs() + costs[i - 2], (hs[i] - hs[i - 1]).abs() + costs[i - 1]);
    }

    println!("{}", costs[n - 1]);
}

Measured memory_bytes: 6396
#include <iostream>
#include <string>

using namespace std;

int main() {
    int n;
    string s;
    cin >> n >> s;
    if(n < 3){
        cout << 0 << endl;
        return 0;
    }
    n -= 2;
    int count = 0;
    for(int i=0; i < n; i++){
            if(s[i] == 'A' && s[i+1] == 'B' && s[i+2] == 'C'){
                ++count;
            }
    }

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


Measured memory_bytes: 256
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

#[allow(dead_code)]
struct Scanner<'a> {
    cin: StdinLock<'a>,
}
#[allow(dead_code)]
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn input<T: FromStr>(&mut self) -> T {
        self.read().unwrap()
    }

    fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.input()).collect()
    }

    fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }
}
fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let n: usize = sc.input();

    let ans = (1..=n)
        .map(|x| n / x * (n / x + 1) * x / 2)
        .sum::<usize>();
    println!("{}", ans);
}


Measured memory_bytes: 2164
#include <stdio.h>

int main(void){
  int a,b;
  scanf("%d %d",&a,&b);

  if (a > b){
    printf("a > b\n");
  }
  else if(a < b){
    printf("a < b\n");
  }
  else{
    printf("a == b\n");
  }
    return 0;
  }


Measured memory_bytes: 1968