akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int main(void) {
    int a, b, h, w;
    int num = 0;

    cin >> h >> w;
    int building[h + 2][w + 2];
    int step[h + 2][w + 2];
    for(int i = 0; i < w + 2; i++) {
        for(int j = 0; j < h + 2; j++) {
            if(i == 0 || i == w + 1 || j == 0 || j == h + 1) //外枠
                building[j][i] = 0;
            else {
                cin >> building[j][i];
            }
            step[j][i] = 1;
        }
    }
    queue<pair<int, int>> q;
    q.push(make_pair(0, 0));
    while(q.empty() == false) {
        pair<int, int> tmp = q.front();
        q.pop();
        a = tmp.first;
        b = tmp.second;
        step[a][b]=0;

        if(a != h + 1) {           //右を見る
            if(building[a + 1][b]) //隣が建物なら１カウント
                num++;
            else if(step[a + 1][b]) { //隣が開いていて
                q.push(make_pair(a + 1, b)); //行ったことがないならプッシュ
                step[a + 1][b] = 0;
            }
        }
        if(a != 0) { //左を見る
            if(building[a - 1][b])
                num++;
            else if(step[a - 1][b]) {
                q.push(make_pair(a - 1, b));
                step[a - 1][b] = 0;
            }
        }
        if(b != w + 1) { //下を見る
            if(building[a][b + 1])
                num++;
            else if(step[a][b + 1]) {
                q.push(make_pair(a, b + 1));
                step[a][b + 1] = 0;
            }
            if(b % 2 == 1 && a != h + 1) { //ｙ座標が奇数の時
                if(building[a + 1][b + 1])
                    num++;
                else if(step[a + 1][b + 1]) {
                    q.push(make_pair(a + 1, b + 1));
                    step[a + 1][b + 1] = 0;
                }
            } else if(b % 2 == 0 && a != 0) { //ｙ座標が偶数の時
                if(building[a - 1][b + 1])
                    num++;
                else if(step[a - 1][b + 1]) {
                    q.push(make_pair(a - 1, b + 1));
                    step[a - 1][b + 1] = 0;
                }
            }
        }
        if(b != 0) { //上を見る
            if(building[a][b - 1])
                num++;
            else if(step[a][b - 1]) {
                q.push(make_pair(a, b - 1));
                step[a][b - 1] = 0;
            }
            if(b % 2 == 1 && a != h + 1) { //ｙ座標が奇数の時
                if(building[a + 1][b - 1])
                    num++;
                else if(step[a + 1][b - 1]) {
                    q.push(make_pair(a + 1, b - 1));
                    step[a + 1][b - 1] = 0;
                }
            } else if(b % 2 == 0 && a != 0) { //ｙ座標が偶数の時
                if(building[a - 1][b - 1])
                    num++;
                else if(step[a - 1][b - 1]) {
                    q.push(make_pair(a - 1, b - 1));
                    step[a - 1][b - 1] = 0;
                }
            }
        }
    }
    cout << num << endl;
    return 0;
}



Measured memory_bytes: 3180
s = input()
n = len(s)


def f(s):
    n = len(s)
    if n % 2 == 0:
        return list(s[:n // 2]) == list(reversed(s[n // 2:]))
    else:
        return list(s[:n // 2]) == list(reversed(s[n // 2 + 1:]))


if f(s) and f(s[:(n - 1)//2]) and f(s[(n + 3) // 2 - 1:]):
    print('Yes')
else:
    print('No')


Measured memory_bytes: 3060
import math
n,x=map(int,input().split())
m=[int(input()) for i in range(n)]
zenbu=0
for i in range(n):
  zenbu+=m[i]
if x<zenbu:
  print(0)
  exit()
nokori=x-zenbu
tukuru=math.floor(nokori/min(m))
print(tukuru+n)



Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
vector<int> gen1(int n)
{  
    vector<int>bs1, bs2, bs3;
    bs1 = {0, 1, 3, 2};
    bs2 = {2, 0, 1, 3};
    bs3 = {3, 1, 0, 2};
    vector<int>res = {0, 1}, temp;
    for (int x = 1; x < n; x += 2)
    {  
        temp.clear();
        for (int high : bs1) temp.push_back(high << x | res[0]);
        for (int high : bs2) temp.push_back(high << x | res[1]);
        for (int i = 2; i < (int)res.size(); i += 2)
        {
            for (int high : bs3) temp.push_back(high << x | res[i]);
            for (int high : bs2) temp.push_back(high << x | res[i + 1]);
        }
        res = temp;
    }
    for (int i = 0; i < (int)res.size() - 1; i++) assert(__builtin_popcount(res[i] ^ res[i + 1]) == 1);
    assert(*res.begin() == 0 && *res.rbegin() == (1 << n) - 1);
    return res;
}
vector<int> gen2(int n)
{
    vector<int>res = {0, 1}, temp;
    if (n == 0) return {0};
    for (int x = 1; x < n; x++)
    {
        temp.clear();
        for (int low : res) temp.push_back(low);
        reverse(res.begin(), res.end());
        for (int low : res) temp.push_back((1 << x) | low);
        res = temp;
    }
    for (int i = 0; i < (int)res.size() - 1; i++) assert(__builtin_popcount(res[i] ^ res[i + 1]) == 1);
    assert(*res.begin() == 0);
    return res;
}
vector<int> gen3(int cnt0, int cnt1)
{
    vector<int>part1 = gen1(cnt1);
    vector<int>part0 = gen2(cnt0);
    vector<int>res;
    for (int low : part1)
    {
        for (int high : part0) res.push_back(high << cnt1 | low);
        reverse(part0.begin(), part0.end()); 
    }
    for (int i = 0; i < (int)res.size() - 1; i++) assert(__builtin_popcount(res[i] ^ res[i + 1]) == 1);
    assert(*res.begin() == 0 && *res.rbegin() == (1 << cnt1) - 1);
    return res;
}
int id[2][20], cnt0, cnt1;
int main()
{
    int n, A, B; scanf("%d%d%d", &n, &A, &B);
    B ^= A; 
    if (!(__builtin_popcount(B) & 1)) {puts("NO"); return 0;}
    for (int i = 0; i < n; i++)
    {
        if (B >> i & 1) id[1][cnt1++] = i;
        else id[0][cnt0++] = i;
    }
    vector<int>temp = gen3(cnt0, cnt1);
    puts("YES");
    for (int x : temp)
    {
        int res = 0;
        for (int i = 0; i < cnt0; i++) if (x >> (cnt1 + i) & 1) 
            res += (1 << id[0][i]);
        for (int i = 0; i < cnt1; i++) if (x >> i & 1)
            res += (1 << id[1][i]);
        printf("%d ", res ^ A);
    }
    puts("");
    return 0;
}

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

int read()
{
	int s=0;
	char c=getchar(),lc='+';
	while (c<'0'||'9'<c) lc=c,c=getchar();
	while ('0'<=c&&c<='9') s=s*10+c-'0',c=getchar();
	return lc=='-'?-s:s;
}
void write(int x)
{
	if (x<0)
	{
		putchar('-');
		x=-x;
	}
	if (x<10) putchar(x+'0');
	else
	{
		write(x/10);
		putchar(x%10+'0');
	}
}
void print(int x,char c='\n')
{
	write(x);
	putchar(c);
}

signed main()
{
	int a=read(),v=read(),b=read(),w=read(),t=read();
	if (w>=v) puts("NO");
	else if ((v-w)*t>=llabs(a-b)) puts("YES");
	else puts("NO");

	return 0;
}

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

int main(){
  int N;
  string S;
  cin >> N >> S;
  
  for (int i = 0; i < S.length(); i++){
    char a = S.at(i);
    char b = a + N;
    if (b >= 91) {
      b -= 26;
    }
    cout << b;
  }
  
  return 0;
}


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

namespace AtCoder {
    public class Program {
        static void Main() {
            int N = int.Parse(Console.ReadLine());
            int L = N.ToString().Length;
            char[] numbers = new char[] { '3', '5', '7' };
            List<string> Answers = new List<string>();
            Queue<string> Keys = new Queue<string>();
            Keys.Enqueue("");
            for (int i = 0; i < L; i++) {
                Queue<string> next = new Queue<string>();
                foreach (var k in Keys) {
                    foreach (var c in numbers) {
                        string k_app = k + c.ToString();
                        if (k_app.Contains('3') && k_app.Contains('5') && k_app.Contains('7')) Answers.Add(k_app);
                        next.Enqueue(k_app);
                    }
                }
                Keys = next;
            }

            Console.WriteLine(Answers.Where(x => int.Parse(x)<=N).Count());
        }
    }
}


Measured memory_bytes: 21852
#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <functional>
#include <limits>

using namespace std;

using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define Rep(i, n) for (long long i = 0; i< (long long)(n); i++)
#define RRep(i,n) for (long long i = ((long long)(n)-1); i>=0; i--)
#define all(v) (v).begin(),(v).end()

struct Edge{
    int to;
    int weight;
    Edge(int t, int w) : to(t), weight(w){ }
};

struct edge{
    int from;
    int to;
    int weight;
    edge(int f,int t,int w) : from(f), to(t), weight(w){ }
};

using Graph = vector<vector<Edge>>;
using graph = vector<vector<int>>;
using edges = vector<edge>;

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

template <class T>
T gcd(T a, T b){
    if( b==0 ) return a;
    return gcd(b, a%b);
}

template <class T>
T lcm(T a, T b){
    return (a*b)/gcd(a,b);
}

int INF = 1e9+7;

vector<int> dx = {-1,0,1,0};
vector<int> dy = {0,-1,0,1};

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int h,w;
    cin >> h >> w;
    vector<string> a(h);
    rep(i,h) cin >> a[i];
    vector<int> c(26,0);
    rep(i,h){
        rep(j,w){
            c[a[i][j]-'a']++;
        }
    }
    if(h%2==0 && w%2==0){
        rep(i,26){
            if(c[i]%4!=0){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    else if(h%2==0){
        int flag = 0;
        rep(i,26){
            if(c[i]%4==2) flag++;
            if(flag>h/2 || c[i]%2!=0){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    else if(w%2==0){
        int flag = 0;
        rep(i,26){
            if(c[i]%4==2) flag++;
            if(flag>w/2 || c[i]%2!=0){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    else{
        int flagA = 0;
        int flagB = 0;
        rep(i,26){
            if(c[i]%4==2) flagB++;
            if(c[i]%2==1) flagA++;
            if(flagB>h/2+w/2 || flagA>1){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <vector>
#include <list>
using namespace std;
#include <stdio.h>
#include <map> 
#include <algorithm>
#include <functional>
#include <algorithm>
#include <functional>
#include <array>
#include <iostream>
#include <limits>
#include <numeric>
#include <type_traits>


int  H, W;
std::vector<int> len;

int maze[20][20] = {};
struct pos {
	int x = 0;
	int y = 0;
};

std::vector<pos> tail[400];

int mazelen[20][20] = {};

bool update(pos pp) {

	pos p = pp;
	pos offset[] = {
		0, 1,
		0, -1,
		1, 0,
		-1, 0,
	};

	for (int i = 0; i < 4; ++i) {
		offset[i].x += p.x;
		offset[i].y += p.y;

		offset[i].x = std::min(W-1, offset[i].x);
		offset[i].x = std::max(0, offset[i].x);

		offset[i].y = std::min(H-1, offset[i].y);
		offset[i].y = std::max(0, offset[i].y);
	}

	int n = mazelen[pp.x][pp.y];
	bool find = false;

	for (int i = 0; i < 4; ++i) {
		auto c = offset[i];
		if ((mazelen[c.x][c.y] == 0) && (maze[c.x][c.y] == 0)) {
			mazelen[c.x][c.y] = n + 1;

			tail[n + 1].push_back(c);
			find = true;
		}
	}
	return find;
}

int maze_len() {
	
	bool find = false;

	int currentLen = 0;
	for (int i = 0; i < tail[currentLen].size(); ++i) {
		const auto p = tail[currentLen][i];
	}



	return 0;
}

int main()
{
	std::string S;
	cin >> H >> W;

//	int maze[20][20] = {};

	for (int h = 0; h < H; ++h) {
		for (int w = 0; w < W; ++w) {
			char a;
			cin >> a;
			if (a == '.') {
				maze[w][h] = 0;
			} else {
				maze[w][h] = 1;
			}
		}
	}

	int mm = 0;


	for (int y = 0; y < H; ++y) {
		for (int x = 0; x < W; ++x) {
			if (maze[x][y]) {
				continue;
			}

			pos c;
			c.x = x; c.y = y;

			for (int i = 0; i < 400; ++i) {
				tail[i].clear();
			}
			memset(mazelen, 0, sizeof(mazelen));

			tail[1].push_back(c);
			mazelen[x][y] = 1;

			for (int i = 1; i < 400; ++i) {
				bool b = false;
				for (int j = 0; j < tail[i].size(); ++j) {
					b |= update(tail[i][j]);
				}
				if (b == false) {
					mm = std::max(i - 1, mm);
					break;
				}
			}
		}
	}


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


	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define endl '\n'
const int inf = 1000000007;
const ll INF = 1e18;
// int mod = 998244353;
int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template<typename T, typename U> T pow_(T a, U b) { return b ? pow_(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<typename T> inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T, class T2> inline void add(T &a, T2 b) { (a += b % mod) %= mod; if (a < 0) a += mod; }
template<class T> void operator += (vector<T>& v, vector<T> v2) { rep(i, sz(v2)) v.eb(v2[i]); }

void solve();

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(12); // debuged
  int T;
  T = 1;
  while (T--) solve();
}

const int MAX = 2000005; // global じゃないとエラー
struct COM {
  ll fac[MAX], finv[MAX], inv[MAX];
  COM(int n) {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
      fac[i] = fac[i - 1] * i % mod;
      inv[i] = mod - inv[mod % i] * (mod / i) % mod;
      finv[i] = finv[i - 1] * inv[i] % mod;
    }
  };
  ll operator() (int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
  }
  ll p(int n, int k) { return fac[n] * finv[n - k] % mod; }
} c(500005); // 実引数なしでできない

void solve() {
  int n, m;
  cin >> n >> m;
  // o -> Ai != Bi
  // A は自由
  // B に関して, n 箇所が o の場合の数を求めたい
  // 逆に, x を使って数える
  // 0 箇所が x, すべて ? (o か x)
  // 1 箇所が x, n-1 箇所 ? を除く
  // 2 箇所が...
  ll ans = 0;
  rep(i, n + 1) {
    ll tmp = 1;
    tmp *= c(n, i); // x のところの選び方
    // A は自由
    (tmp *= c.p(m, n)) %= mod;
    // B に関して
    // ? のとこ n-i 箇所の埋め方
    // m-i 個から自由に選ぶ
    (tmp *= c.p(m - i, n - i)) %= mod;
    if (i & 1) (tmp = -tmp) %= mod;
    add(ans, tmp);
  }
  cout << ans << endl;
}


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

int main(){
  int n,x,t;
  cin >> n >> x >> t;
  
  cout << (n+x-1)/x*t << endl;
  return 0;
}


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

int n, k;
int a[200010];
vector<int> v;
int s;

int main() {
    cin >> n >> k;
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        a[x] ++;
    }
    for (int i = 0; i < 200001; i++) {
        if (a[i] != 0)
            v.push_back(a[i]);
    }
    sort(v.begin(), v.end());
    for (int i = 0; i < (int) v.size() - k; i++)
        s += v[i];
    cout << s << endl;
    return 0;
}


Measured memory_bytes: 2168
#define z(c)for(i=1;i<c)
#define s p[i][j]
#define t p[i+1][j]
n,m,a,b,i;char p[1009][1009];x(i,j){s=94;t=118;b--;}main(j){scanf("%d%d%d%d",&n,&m,&a,&b);z(n+1;)memset(p[i++]+1,46,m);z(n&&b&&m&1;i+=2)x(i,m);b&n&m>2&n>1&&x(n-1,m-2);z(n;i++)for(j=1;j<=m&&b;j++)s+t<99&&x(i,j);z(n+1;i++)for(j=1;j<m&&a;)if(p[i][j++]+s<99)p[i][j-1]=60,s=62,a--;puts(a|b?"NO":"YES");z(n+1&!a&!b;)puts(p[i++]+1);}

Measured memory_bytes: 2616
import math

def prime(n):
    prime=True
    s=int(math.sqrt(n))
    for i in range(2,s+1):
        if n%i==0:
            prime=False
            break
    
    return prime

def main():
    #input
    ans=0
    X=int(input())
    for j in range(X):
        if prime(X+j):
            ans=X+j
            break
    print(ans)
    
if __name__=="__main__":
    main()

Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
int main()
{
  int n,m;
  cin >> n >> m;
  vector<int> a(m),b(m);
  rep(i,m){
    cin >> a[i] >> b[i];
    a[i]--;
    b[i]--;
  }

  map<int,int> mp;
  rep(i,n) mp[i] = 0;
  rep(i,m){
    mp[a[i]]++;
    mp[b[i]]++;
  }

  bool f = true;
  for(auto& itr:mp){
    int val = itr.second;
    if(val&1){
      f = false;
      break;
    }
  }

  cout << (f?"YES":"NO") << "\n";
  return 0;
}


Measured memory_bytes: 5760
N = int(input())
H = list(map(int, input().split()))

maxi = 0
count = 0
for i in range(N-1):
    if H[i] >= H[i+1]:
        count = count+1
        if count > maxi:
            maxi = count
    else:
        count = 0
print(maxi)


Measured memory_bytes: 14252
#include <iostream>
#define N 60
#define MOD 1000000007

int n; char s1[N], s2[N];

int main()
{
	scanf("%d", &n);
	scanf("%s%s", s1 + 1, s2 + 1);
	long long ans = 1;
	for(int i = 1; i <= n; ++i)
	{
		if(i == 1 && s1[i] == s2[i])
			ans = (ans * 3) % MOD;
		else if(s1[i] == s2[i])
		{
			if(s1[i - 1] == s2[i - 1])
				ans = (ans * 2) % MOD;
		}
		else
		{
			if(i == 1)
				ans = (ans * 6) % MOD;
			else if(s1[i - 1] == s2[i - 1])
				ans = (ans * 2) % MOD;
			else if(s1[i] != s1[i - 1])
				ans = (ans * 3) % MOD;
		}
	}
	printf("%lld\n", ans);
	return 0;
}


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

#define pi 2 * acos(0.00)
#define ll long long
#define ull unsigned long long
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define nl '\n'
#define nll '\0'
#define mx 1000000
#define bdyptb return 0;
#define testcase ll t,tt; cin>>tt; for(t=1;t<=tt;t++)
   
#define mod 142857

using namespace std;


struct level
{
    int a;
    int b;
};

bool acp(level lhs,level rhs)
{return lhs.a<rhs.a;}


bool prime[mx+1];
void sieve(int n)
{
    
    memset(prime,true,sizeof(prime));
    prime[0]=false;
    prime[1]=false;
    for(int p=2;p*p<=n;p++)
    {
        if(prime[p]==true)
        {
            for(int i=p*p;i<=n;i+=p)
                prime[i]=false;
        }
    }
    
}
int main()
{
    fastio;
    
    int n;
    cin>>n;

    int  a[n],m=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        m=max(m,a[i]);
    }
    int ans=0;
    sort(a,a+n);
    bool sts[m+1];
    memset(sts,true,sizeof(sts));

    for(int i=0;i<n;i++)
    {
        for(int j=a[i]*2;j<=m; j+=a[i])
        // cout<<j<<nl;
        sts[j]=false;
        if(a[i]==a[i+1] and i<n-1)
        {
            sts[a[i]]=false;
            i++;
        }
    }
    for(int i=0;i<n;i++)
    {
        if(sts[a[i]])ans++;
    }
    cout<<ans<<nl;
}

Measured memory_bytes: 5376
#include<stdio.h>
int bubbleSort(int A[],int N){
  int i,j,temp,count=0,minj;
  for(i=0;i<N;i++){
    minj=i;
  for(j =i;j<N;j++){
    if(A[j]<A[minj]){
      minj=j;
    }
  }if(i!=minj){
      temp=A[i];
      A[i]=A[minj];
      A[minj]=temp;
      count++;
    }
    // if(A[i]>A[minj]){
    // if(i!=minj){
    // temp=A[i];
    //  A[i]=A[minj];
    //  A[minj]=temp;
      // if(i!=minj){
    //  count++;
      }
    return count;
    }
int main(){
  int N,i,flag;
  scanf("%d",&N);
  int A[N];
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
  }
 flag=bubbleSort(A,N);
 for(i=0;i<N;i++){
   if(i>0) printf(" ");
   printf("%d",A[i]);
 }
   printf("\n");
   // printf(" ");
 printf("%d\n",flag);
 return 0;
}

Measured memory_bytes: 604
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() { 
  ios::sync_with_stdio(false); cin.tie(0);
  int n;
  cin >> n;
  vector<vector<int>> v;
  vector<int> p(n);
  iota(p.begin(), p.end(), 1);
  do {
    v.push_back(p);
  } while (next_permutation(p.begin(), p.end()));
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  int pa, pb;
  for (int i = 0; i < (int) v.size(); i++) {
    if (a == v[i]) pa = i;
    if (b == v[i]) pb = i;
  }
  cerr << pa << " " << pb << endl;
  cout << abs(pa - pb) << '\n';
  return 0;
}

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

/* メモリ食い過ぎ注意 */
#define int long long

typedef long long ll;

/* define const */
const ll INF = (1ll << 60);
const ll MOD = (ll)1e9 + 7;
/* end defineing */

signed main()
{
    int n;
    deque<ll> a;
    cin >> n;

    for (int i = 0; i < n; i++)
    {
        int tmp;
        cin >> tmp;
        a.push_back(tmp);
    }
    sort(a.begin(), a.end());

    while (a.size() > 1)
    {
        // for (int i = 0; i < a.size(); i++)
        // cout << a[i] << " ";
        // cout << endl;
        // cout << "=" << a.size() << endl;

        int fst = -1;
        for (int i = 0; i < a.size(); i++)
        {
            if (a[i] > 0 && fst < 0)
            {
                fst = i;
                continue;
            }
            else if (fst >= 0)
                a[i] = a[i] % a[fst];
        }
        sort(a.begin(), a.end());
        while (a[0] == 0)
        {
            // cout << a[0] << endl;
            a.pop_front();
        }
    }
    cout << a[0] << endl;
}


Measured memory_bytes: 1024
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
N,Q = map(int,input().split())
tree = [[] for _ in range(N)]

for i in range(N-1):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    tree[y].append(x)
    tree[x].append(y)
ans = [0]*N
for i in range(Q):
    x,y = map(int,input().split())
    ans[x-1] += y


def dfs(cur,par):
    for chl in tree[cur]:
        if chl == par: #これで木の流れの逆行を防ぐ
            continue
        ans[chl] += ans[cur]
        dfs(chl,cur)

dfs(0,-1)
print(*ans)

Measured memory_bytes: 230940
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
typedef long long ll;

int main(){
    ll n; cin>>n;
    ll ans = 0;
    for(int A=1;A<=n-1;A++){
        ans += (n-1)/A;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<stack>
#include<iostream>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define MOD 1000000007
#define vec(a) vector<int>a
using namespace std;


int main()
{
#ifndef ONLINE_JUDGE
	freopen("output.txt", "w", stdout);
	freopen("input.txt", "r", stdin);
#endif
	ll n,i,j,k,l,m;
	cin>>n>>k;
	ll arr[n];
	for(i=0;i<n;i++)
		cin>>arr[i];
	l=0;
	m=1;
	for(i=0;i<n;i++)
	{
		l+=arr[i];
		if(l<=k)
			m++;
		else
			break;
	}
	cout<<m<<"\n";
	return 0;
}
	


Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <vector>
#include <stack>
#include <set>

using namespace std;

typedef long long ll;
#define mems(p) memset(p,0,sizeof(p))
#define mp make_pair

void fast()
{ios_base::sync_with_stdio(false);cin.tie(0);}

int main() {
	fast();
	ll n,m,templ,tempr,minl,minr;
	cin>>n>>m>>minl>>minr;
	for (int i = 1; i < m; ++i)
	{
		cin>>templ>>tempr;
		if (templ>minl) minl=templ;
		if (tempr<minr) minr=tempr; 
	}
	cout<<max(minr-minl+1,0ll)<<endl;
}

Measured memory_bytes: 256
fn main() {
    let input: Vec<i32> = read_vec();
    let k = input[1];
    let p: Vec<i32> = read_vec();

    println!("{}", solve(&p, k));
}

fn read<T: std::str::FromStr>() -> T {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).ok();
    buf.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|s| s.parse().ok().unwrap())
        .collect()
}

fn solve(p: &[i32], k: i32) -> i32 {
    let mut prices = Vec::from(p);
    prices.sort();
    prices.iter().take(k as usize).sum()
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_solve_1() {
        assert_eq!(210, solve(&[50, 100, 80, 120, 80], 3));
    }

    #[test]
    fn test_solve_2() {
        assert_eq!(1000, solve(&[1000], 1));
    }
}


Measured memory_bytes: 2140
#include "bits/stdc++.h"
using namespace std;

#define timesaver ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
 
typedef long long ll ;
typedef long double ldb ;
 
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define nl "\n"
 
#define all( x ) x.begin(),x.end()
#define sz( x ) ( int )( x ).size( )
#define mem( a, val ) memset(a, val, sizeof( a ) )
#define deci( x ) cout<<fixed<<setprecision( x );

int main( ) {
	timesaver ;
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	bool t = true;
	while(a > 0 && c > 0) {
		if(t) {
			c -= b;
		}
		else{
			a -= d;
		}
		t = !t;
	}
	if(a > 0)
		cout << "Yes";
	else
		cout << "No";
	return 0;
}

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

#define ll long long
#define ld long long
#define pi 3.14159265359

int max3(int x, int y, int z) {
    if (z > max(x, y)) {
        return z;
    }
    else {
        return max(x, y);
    }
}

int gcd(int a, int b, int c) {
    int Gcd = 1;
    for (int i = max3(a, b ,c); i > 0; i--) {
        if (a % i == 0 && b % i == 0 && c % i == 0) {
            Gcd = i;
            break;
        }
    }
    return Gcd;
}

int main() {
    int K; cin >> K;
    int ans1 = 0,ans2 = 0, ans3 = 0; //同じ数字がx個の時の和
    ans3 = (K * (K + 1)) / 2;
    for (int i = 1; i < K + 1; i++) {
        for (int j = 1; j < K + 1; j++) {
            if(j != i) {
                ans2 += gcd(i, i, j);   
            }
        }
    }
    ans2 *= 3;
    for (int i = 1; i < K - 1; i++) {
        for (int j = i + 1; j < K; j++) {
            for (int k = j + 1; k < K + 1; k++) {
                ans1 += gcd(i, j, k);
            }
        }
    }
    ans1 *= 6;
    int ans = ans1 + ans2 + ans3;
    cout << ans << endl;
}

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

int main() {
	int n, t;
	cin >> n >> t;
	vector<int> a(n), p(n);
	rep(i, n) cin >> a[i];
	int mx = 0;
	for(int i = n-1; i >= 0; i--) {
		mx = max(mx, a[i]);
		p[i] = mx - a[i];
	}
	sort(all(p));
	reverse(all(p));
	int ans = 0;
	rep(i, n) {
		if(p[i] == p[0]) ans++;
		else break;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <map>
#include <bitset>
#include <cstdio>
#include <set>
#include <stack>
#include <queue>
#include <cassert>
#include <numeric>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<vector<int>>
#define mii map<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())
#define ALL(a)  (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
//#define int ll
typedef long long ll;

const int md = 1000000007;
const int INF = 1<<30;
using namespace std;

int main(){
    int n; cin >> n;
    int a[2*n];
    rep(i,n*2) cin >> a[i];

    sort(a,a+(2*n));

    int ans = 0;
    for(int i = 0; i < n*2 ; i += 2){
        ans += a[i];
    }
    cout << ans << endl;
    
}

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

int x, y, a, b, c;
cin >> x >> y >> a >> b >> c;
vector<long long int> p(a+100);
vector<long long int> q(b+100);
vector<long long int> r(c+100);
rep(i,a) cin >> p.at(i);
rep(i,b) cin >> q.at(i);
rep(i,c) cin >> r.at(i);
sort(p.begin(), p.end(), greater<long long int>());
sort(q.begin(), q.end(), greater<long long int>());
sort(r.begin(), r.end(), greater<long long int>());
vector<long long int> rio(x+y+c+100);
rep(i,x) rio.at(i)=p.at(i);
rep(i,y) rio.at(x+i)=q.at(i);
rep(i,c) rio.at(x+y+i)=r.at(i);
sort(rio.begin(), rio.end(), greater<long long int>());

long long int sum=0;
rep(i,x+y) sum+=rio.at(i);
cout << sum << endl;
}

Measured memory_bytes: 4736
if __name__ == '__main__':
    n = int(input())
    values = list(map(int, input().split()))
    costs = list(map(int, input().split()))
    ans = 0
    for i in range(n):
        if values[i] - costs[i] > 0:
            ans += (values[i] - costs[i])

    print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

using namespace std;
#define ll long long
#define rep(i,n) for (int i = 0; i < n; i++)
#define MOD (1000000007)
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

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

const ll INF = 1LL << 60;

int main(){
  int n,m; cin >> n >> m;

  vector<bool> red(n,false); red[0] = true;
  vi cnt(n,1);// cnt[i]:i 番目の箱にある ball の数

  rep(i, m){
    int x,y; cin >> x >> y; x--; y--;
    if(red[x]) red[y] = true;
    cnt[x]--; cnt[y]++;
    if(cnt[x] == 0) red[x] = false;
  }

  int ans = 0;
  rep(i, n) if(red[i]) ans++;
  std::cout << ans << '\n';
}


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

ll gcd(ll x,ll y) {return y ? gcd(y,x%y) : x;} 
ll lcm(ll x,ll y) {return x/gcd(x,y)*y;}

int main(){
    string s;
    cin >> s;
    sort(s.begin(),s.end());
    if(s[0]==s[1]&&s[2]==s[3]&&s[1]!=s[2]) puts("Yes");
    else puts("No");
    
    return 0;
}








Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace AtCoder
{
    class Node<T>
    {
        private int m_height;
        private Node<T> m_parent;
        public T Item { get; private set; }
        public Node(T item)
        {
            m_height = 0;
            m_parent = this;
            Item = item;
        }
        public Node<T> Find()
        {
            if (m_parent == this) { return this; }

            Node<T> parent = m_parent.Find();
            m_parent = parent;
            return parent;
        }
        public static void Unite(Node<T> a, Node<T> b)
        {
            Node<T> p = a.Find();
            Node<T> q = b.Find();
            if (p.m_height < q.m_height)
            {
                p.m_parent = q;
                q.m_height = Math.Max(p.m_height + 1, q.m_height);
            }
            else
            {
                q.m_parent = p;
                p.m_height = Math.Max(q.m_height + 1, p.m_height);
            }
        }
    }
    class Program
    {
        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        static bool Solve(int N, int M, IEnumerable<List<int>> speakers)
        {
            var nodes = new Node<int>[N];
            for (int i = 0; i < N; ++i) { nodes[i] = new Node<int>(i); }
            foreach (var speaker in speakers)
            {
                if (speaker.Count >= 2)
                {
                    int a = speaker[0];
                    for (int i = 1; i < speaker.Count; ++i)
                    {
                        int b = speaker[i];
                        Node<int>.Unite(nodes[a], nodes[b]);
                    }
                }
            }
            var set = new HashSet<int>(nodes.Select(node => node.Find().Item));
            return set.Count == 1;
        }
        static void Main(string[] args)
        {
            int[] V1 = ReadInts();
            int N = V1[0];
            int M = V1[1];
            var speakers = new List<int>[M];
            for (int i = 0; i < M; ++i) { speakers[i] = new List<int>(); }
            for (int i = 0; i < N; ++i)
            {
                int[] V2 = ReadInts();
                int K = V2[0];
                for (int j = 0; j < K; ++j)
                {
                    int L = V2[j + 1] - 1;
                    speakers[L].Add(i);
                }
            }
            Console.WriteLine(Solve(N, M, speakers) ? "YES" : "NO");
        }
    }
}


Measured memory_bytes: 28696
#include<iostream>
#include<string>
using namespace std;
int main() {
	int stop;

	string A[110];
	int H, W;
	
	cin >> H >> W;

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

	for (int i = 0; i <= W + 1; ++i) {
		cout << "#";
	}
	cout << endl;

	for (int i = 0; i < H; ++i) {
		cout << "#";
		cout << A[i];
		cout << "#" << endl;
	}
	
	for (int i = 0; i <= W + 1; ++i) {
		cout << "#";
	}
	cout << endl;

	return 0;
}

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

using namespace std;

#define int long long
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl '\n'
#define Endl '\n'
#define cont continue
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/__gcd(a,b)
#define pb push_back
#define mp make_pair
#define mem(x) memset(x, 0, sizeof(x))

const ll inf=1e18;
const int mod=1e9+7;
inline int bigmod(int B,int P){int R=1;while(P>0){if(P&1){R=(R*B)%mod;}P>>=1;B=(B*B)%mod;}return R;}
const int mxn = 2e5+10;

int Mod(int a) {
	return (a+mod)%mod;
}
int Mul(int a, int b) {
	return Mod(Mod(a) * Mod(b));
}
int Add(int a, int b) {
	return Mod(Mod(a) + Mod(b));
}
//ll fact[mxn];
//ll in_fact[mxn];
//fact[0] = 1;
//for(ll i = 1; i < mxn; i++) {
	//fact[i] = (i*fact[i-1])%mod;
//}
//in_fact[mxn-1] = bigmod(fact[mxn-1],mod-2);
//for(ll i = mxn-2; i >= 0; i--) {
	//in_fact[i] = (in_fact[i+1] * (i+1))%mod;
//}
//ll c(ll n,ll r) {
	//ll ans = (fact[n] * (in_fact[r] * in_fact[n-r]%mod))%mod;
	//return ans;
//}


signed main(){
    fast;
	//freopen ("input.txt", "r", stdin);
	//freopen ("output.txt", "w", stdout);
    int tt = 1;
    //cin>>tt;
    for(int tc = 1; tc <= tt; tc++) {
        int n,x,m;
        cin>>n>>x>>m;
        int ans = x;
        vector<int>chk;
        chk.pb(x);
        map<int,int>vis;
        map<int,int>si;
        vis[x] = 1;
        si[x] = 0;
        for(int i = 1; i < n; i++) {
			x *= x;
			x %= m;
			if(!vis[x]) {
				vis[x] = 1;
				si[x] = i;
				chk.pb(x);
				ans += x;
			}
			else {
				break;
			}
		}
		int rs = 0;
		for(int i = si[x]; i < (int)chk.size(); i++) rs += chk[i];
		int bakin = n-chk.size();
		int sz = chk.size() - si[x];
		int jabe = bakin/sz;
		ans += (jabe*rs);
		int aro = bakin % sz;
		for(int i = 0; i < aro; i++) ans += chk[si[x]+i];
		cout<<ans<<endl;
			
        
        
    }



return 0;
}


Measured memory_bytes: 9824
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)

int main() {
  int N;
  int a[110];
  cin >> N;
  REP(i,N) cin >> a[i];
  
  sort(a, a+N, greater<int>());
  int A,B = 0;
  REP(i,N) {
    if (i%2 == 0) A += a[i];
    else B += a[i];
  }
  
  cout << A-B << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int n,m;
    cin>>n>>m;
    int a,ans=1;
    a=m/n;
    if (m%n==0) {
      cout<<m/n<<endl;
      return 0;
    }
    for (size_t i = 1; i < a+1; i++) {
      if (m%i==0) {
        if (ans<i) {
          ans=i;
        }
      }
    }
    cout<<ans<<endl;
}


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

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;

const ll mod=1e9+7;
const ll inf=1e16; 

#define rep(i,m,n) for(ll i=m;i<n;i++)
#define repr(i,m,n) for(ll i=m;i>=n;i--)

int main(){
   cin.tie(nullptr);
  ios::sync_with_stdio(false);
  
 string s;
  cin >> s;
  
  if(s=="BBB"||s=="AAA") cout << "No" << endl;
  else cout << "Yes" << endl;
  
  
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    String s = sc.next();
    
    
    if(a < 3200) System.out.println("red");
    else System.out.println(s);
  }
}


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

#define int long long
#define inf (int)1000000007

#define rep(i, n) for(int i = 0; i < (n); i++)
#define trep(i, n) for(int i = 0; i <= (n); i++)
#define rrep(i, n) for(int i = (n); i >= 0; i--)
#define mfor(i, s, t) for(int i = (s); i < (t); i++)
#define tfor(i, s, t) for(int i = (s); i <= (t); i++)
#define rfor(i, s, t) for(int i = (t) - 1; i >= (s); i--)

vector<int> v[114514];

int a[114514];
int ma[114514];

bool used[114514];
int d[114514];
bool f[114514];
int z[114514];

signed main() {
  int n;
  cin >> n;
  rep(i, n) {
    cin >> d[i];
    a[i] = 0;
    ma[i] = 0;
    z[i] = 0;
    used[i] = false;
  }
  rep(i, n - 1) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    z[x]++;
    z[y]++;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  stack<int> st;
  rep(i, n) {
    if(z[i] == 1) {
      st.push(i);
      f[i] = true;
    }
    else {
      f[i] = false;
    }
  }
  bool ok = true;
  rep(_, n) {
    int b = st.top();
    st.pop();
    used[b] = true;
    if(z[b] == 1) {
      int t;
      if(f[b]) {
        t = d[b];
      }
      else {
        if(a[b] < d[b] || d[b] * 2 < a[b]) {
          ok = false;
          break;
        }
        int k = a[b] - d[b];
        t = d[b] - k;
        if(k < (ma[b] - t)) {
          ok = false;
          break;
        }
      }
      for(auto i : v[b]) {
        if(!used[i]) {
          a[i] += t;
          ma[i] = max(ma[i], t);
          z[i]--;
          if(z[i] == 1) {
            st.push(i);
          }
        }
      }
    }
    else {
      if(f[b]) {
        if(a[b] != d[b]) {
          ok = false;
          break;
        }
      }
      else {
        if(a[b] != d[b] * 2) {
          ok = false;
          break;
        }
        if(a[b] < ma[b] * 2) {
          ok = false;
          break;
        }
      }
    }
  }
  if(ok) {
    cout << "YES" << endl;
  }
  else {
    cout << "NO" << endl;
  }
}


Measured memory_bytes: 10368
//{{{
#include <bits/stdc++.h>
using namespace std;
#define repX(a,b,child,x,...) x
#define repN(a) repX a
#define rep(...) repN((__VA_ARGS__,rep3,rep2,loop))(__VA_ARGS__)
#define rrep(...) repN((__VA_ARGS__,rrep3,rrep2))(__VA_ARGS__)
#define loop(n) rep2(i_,n)
#define rep2(i,n) rep3(i,0,n)
#define rep3(i,begin,end) for(int i=(int)(begin),i##_end=(int)(end);i<i##_end;++i)
#define rrep2(i,n) rrep3(i,n,0)
#define rrep3(i,begin,end) for(int i=(int)(begin-1),i##_end=(int)(end);i>=i##_end;--i)
#define foreach(x,a) for(auto&x:a)
using ll=long long;
const ll mod=(ll)1e9+7;
//}}}

int main(){
  int N, K;
  cin >> N >> K;
  int ans = N >= 2 * K - 1;
  puts(ans ? "YES" : "NO");
  return 0;
}


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

int main() {
	int q;
	cin >> q;
	set<int> S;
	for (int i = 0; i < q; ++i) {
		int query, x;
		cin >> query >> x;
		if (query == 0) {
			S.insert(x);
			cout << S.size();
		}
		else cout << S.count(x);
		cout << endl;
	}
}


Measured memory_bytes: 12468
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,vis[20],d=0,x,cnt=0,ans;
int main(){
	memset(vis,0,sizeof(vis));
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>x;
		if(x>=1&&x<=399){
			if(!vis[1])cnt++,vis[1]=1;continue;
		}
		else if(x>=400&&x<=799){
			if(!vis[2])cnt++,vis[2]=1;continue;
		}
		else if(x>=800&&x<=1199){
			if(!vis[3])cnt++,vis[3]=1;continue;
		}
		else if(x>=1200&&x<=1599){
			if(!vis[4])cnt++,vis[4]=1;continue;
		}
		else if(x>=1600&&x<=1999){
			if(!vis[5])cnt++,vis[5]=1;continue;
		}
		else if(x>=2000&&x<=2399){
			if(!vis[6])cnt++,vis[6]=1;continue;
		}
		else if(x>=2400&&x<=2799){
			if(!vis[7])cnt++,vis[7]=1;continue;
		}
		else if(x>=2800&&x<=3199){
			if(!vis[8])cnt++,vis[8]=1;continue;
		}else ++d;
	}
	if(cnt)cout<<cnt<<' ';
	else cout<<1<<' ';
	cout<<cnt+d;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm> 
#include <cstdlib>
#include <bitset>
#include <math.h>
#include <numeric>
#include <set>
#include <vector>
#define ll long long
#define pf printf
#define sf scanf
using namespace std;
int main(){
 //freopen("input.txt","r",stdin);
 //freopen("output.txt","w",stdout);
  int a,b;
  cin>>a>>b;
  cout<<6-(a+b);
  





  
  


  
 
 
 
    
 
return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
typedef long long ll;
int gcd(int a,int b){return a%b==0?b:gcd(b,a%b);}
char s[100010],t[100010];
int main(){
	int n,m,i;
	ll L;
	scanf("%d%d%s%s",&n,&m,s,t);
	L=(ll)n*m/gcd(n,m);
	for(i=0;i<m;i++){
		if(L/m*i%(L/n)==0&&s[L/m*i/(L/n)]!=t[i]){
			puts("-1");
			return 0;
		}
	}
	printf("%lld",L);
}

Measured memory_bytes: 384
n,m=map(int,input().split())
x=list(map(int,input().split()))

if n>=m:
    print(0)
else:
    x.sort()

    l=[0]*(m-1)
    for i in range(m-1):
        l[i]=x[i+1]-x[i]
    l.sort(reverse=True)
    lsum=0
    for i in range(n-1):
        lsum+=l[i]
    print(x[m-1]-x[0]-lsum)

Measured memory_bytes: 13968
#include <iostream>

using namespace std;



int main(void){
    int N;
    int jubeki[9]={1,10,100,1000,10000,100000,1000000,10000000,100000000};
    scanf("%d",&N);
    int ans=0;
    for(int i=1;i<=9;i++){
        int jogen=1;
        for(int j=0;j<i;j++)jogen*=3;
        for(int j=0;j<jogen;j++){
            int jo=j;
            int po=0;
            int flag[3]={};
            for(int k=0;k<i;k++){
                if(jo % 3 == 0){flag[0]=1;po += 3*jubeki[k];}
                if(jo % 3 == 1){flag[1]=1;po += 5*jubeki[k];}
                if(jo % 3 == 2){flag[2]=1;po += 7*jubeki[k];}
                jo/=3;
            }
            if(flag[0]==1&&flag[1]==1&&flag[2]==1&&po<=N)ans++;
            
        }
    }
    printf("%d",ans);
    return 0;
}

Measured memory_bytes: 256
/*2019/10/19 */
/*template*/
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#define MOD 1000000007
#define MIN 999999999
#define MAX -999999999
typedef long long int ll;
typedef unsigned long long int ull;
void llswap(ll *x,ll *y){ll tmp;tmp=*x;*x=*y;*y=tmp;}
void swap(int *x,int *y){int tmp;tmp=*x;*x=*y;*y=tmp;}
int rmax(int x,int y){return x>y?x:y;}
int rmin(int x,int y){return x>y?y:x;}
ll llrmax(ll x,ll y){return x>y?x:y;}
ll llrmin(ll x,ll y){return x>y?y:x;}
int asc(const void *a,const void *b){if(*(int*)a < *(int*)b)return -1;else if(*(int*)a == *(int*)b)return 0;else return 1;}
int desc(const void *a,const void *b){if(*(int*)a < *(int*)b)return 1;else if(*(int*)a == *(int*)b)return 0;else return -1;}
int llasc(const void *a,const void *b){if(*(ll*)a < *(ll*)b)return -1;else if(*(ll*)a == *(ll*)b)return 0;else return 1;}
int lldesc(const void *a,const void *b){if(*(ll*)a < *(ll*)b)return 1;else if(*(ll*)a == *(ll*)b)return 0;else return -1;}
int gcd(int x,int y){if(y==0)return x;return gcd(y,x%y);}
 
//int asc_t(const void *a,const void *b){if(((pair_t*)a)->d < ((pair_t*)b)->d)return -1;else if(((pair_t*)a)->d == ((pair_t*)b)->d)return 0;else return 1;}
//int asc_t(const void *a,const void *b){if(((pair_t*)a)->d < ((pair_t*)b)->d)return 1;else if(((pair_t*)a)->d == ((pair_t*)b)->d)return 0;else return -1;}
int main(){
    int n;
    char str[200000];

    scanf("%d",&n);
    scanf("%s",str);
    int ans=0;
    int cnt=1;
    for(int i=0;i<n-1;i++){
        if(str[i]!=str[i+1]){
            ans++;
        }
    }
    printf("%d\n",ans+1);
    return 0;
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

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

typedef long long ll;

const string YES = "Yes";
const string NO = "No";

void solve(long long N, long long M)
{
    if (M < N)
    {
        cout << NO << endl;
    }
    else
    {
        cout << YES << endl;
    }
}

int main()
{
    long long N;
    scanf("%lld", &N);
    long long M;
    scanf("%lld", &M);
    solve(N, M);
    return 0;
}


Measured memory_bytes: 256
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    A = zip(map(int,input().split()), range(1,n+1))
    print(*[a[1] for a in sorted(A)])
if __name__ == '__main__':
  main()


Measured memory_bytes: 23480
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <string>
#include <utility>
#include <iomanip>
#include <queue>
#include <algorithm>
#include<set>
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<pair<pair<int,int>,int>> vws(2*(n-1));
    vector<int> sn(n,0);
    vector<int> vwind(n+1,0);
    // vector<vector<int>> mat(n,vector<int>(n));
    vector<pair<int,int>> mat(2*(n-1));
    vector<long long int> ds(n,-1);
    // vector<int> 
    int u,v;
    long long int w;
    for(int i=0;i<n-1;i++){
        cin >> u >> v >>w;
        u--;v--;
        // mat.at(i)=make_pair(u,v);
        // mat.at(i)=make_pair(v,u);
        sn.at(u)++;
        sn.at(v)++;
        vws.at(2*i) = make_pair(make_pair(u,v),w);
        vws.at(2*i+1) = make_pair(make_pair(v,u),w);
    }
    sort(vws.begin(),vws.end());
    vwind.at(0)=0;
    for(int i=1;i<n;i++){
        vwind.at(i)=vwind.at(i-1)+sn.at(i-1);
    }
    // for(int i=0;i<n;i++){
    //     for(int j=0;j<sn.at(i);j++){
    //         cout << mat.at(i).at(j) << ",";
            
    //     }
    //     cout << endl;
    // }
    queue<int> que;
    int search;
    int dst;
    long long int dnow;
    que.push(0);
    ds.at(0)=0;
    while(!que.empty()){
        search=que.front();
        que.pop();
        dnow=ds.at(search);
        // cout << search << endl;
        for(int i=vwind.at(search);i<vwind.at(search)+sn.at(search);i++){
            dst = vws.at(i).first.second;
            
            if(ds.at(dst)==-1){
                ds.at(dst)=dnow+vws.at(i).second;
                que.push(dst);
                // cout << dst << "," << ds.at(dst) <<endl;
            }
            
        }
    }
    for(int i=0;i<n;i++){
        if(ds.at(i)&1)cout << 1 << endl;
        else cout << 0 << endl;
    }

}


Measured memory_bytes: 8240
#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
int main(){
  char c;
  while((c=getchar())!='\n'){
    if('a'<=c&&c<='z')
      c-='a'-'A';
    printf("%c",c);
  }
  cout<<endl;
  return 0;
}

Measured memory_bytes: 3012