akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
using vi = vector<int>;
using vll = vector<ll>;
ll fast_exp(ll base,ll e){
    ll r=1;
    while(e>0){
        if(e%2)r=(r*base);
        base=base*base;
        e/=2;
    }
    return r;
}
ll gcd(ll a,ll b){
    if(b==0)return a;
    return gcd(b,a%b);
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int h,w;cin>>h>>w;
    const ll m = 1e9+7;
    ll ans=0;
    vector<vector<char> > matrix(h,vector<char>(w,'.'));
    for(int i=0;i<h;i++)for(int j=0;j<w;j++)cin>>matrix[i][j];
    vector<vector<int> > dp(h,vector<int> (w,0));
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(matrix[i][j]=='#')dp[i][j]=0;
            else{
                if(i==0&&j==0){
                    dp[i][j]=1;
                }
                else if(i==0&&j>0){
                    dp[i][j]=dp[i][j-1];
                    dp[i][j]%=m;
                }
                else if(j==0&&i>0){
                    dp[i][j]=dp[i-1][j];
                    dp[i][j]%=m;
                }
                else{
                    dp[i][j]=dp[i-1][j]+dp[i][j-1];
                    dp[i][j]%=m;
                }
            }
        }
    }
    dp[h-1][w-1]%=m;
    cout<<dp[h-1][w-1];
    
}

Measured memory_bytes: 5248
x=int(input())
if x<600:
  print(8)
elif x<800:
  print(7)
elif x<1000:
  print(6)
elif x<1200:
  print(5)
elif x<1400:
  print(4)
elif x<1600:
  print(3)
elif x<1800:
  print(2)
else:
  print(1)

Measured memory_bytes: 9176
#include <bits/stdc++.h>
using namespace std;
#define     pii pair<LL, LL>
#define     pb  push_back
#define     SZ  1000005
#define     ff  first
#define     ss  second
#define     base 129
#define     mod 1000000007
#define     LL  long long int
//5 1 3 5 4
//A#BDC

int main()
{
    int n, a, b, c, d; cin>>n>>a>>b>>c>>d;
    string s; cin>>s;
    int h = 0, dot = 0, mx = 0, mx2 = 0, h2 = 0, mxd = 0;
    s = "$" + s;

    for(int i = a; i <= c; i++){
        if(s[i] == '#') {
            mx = max(mx, ++h);
        }
        else h = 0;

    }
    mx = max(mx, h);
    for(int i = b-1; i <= d+1; i++){
        if(s[i] == '#') {
            mx2 = max(mx2, ++h2);
        }
        else h2 = 0;
        if(s[i] == '.'){
            mxd = max(mxd, ++dot);
        }
        else dot = 0;

    }
    mx2 = max(mx2, h2);
    mxd = max(mxd, dot);
//    for(int i = b; i <= d; i++){
//        if(s[i] == '#') {
//            mx2 = max(mx2, ++h2);
//        }
//        else h2 = 0;
//
//    }
    if(mx > 1 || mx2 > 1){
        cout<<"No\n";
        return 0;
    }
    if((c > d && mxd < 3) && (s[d-1] == '#' || s[d+1] == '#')){
        cout<<"No\n";
        return 0;
    }
    cout<<"Yes\n";

    return 0;
}



Measured memory_bytes: 772
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
 
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

    int A, B, C, D, E;
    cin >> A >> B >> C >> D >> E;

    vector<int> menu = {A, B, C, D, E};

    //a.sc:一番効率の悪いメニュー時間
    l_l a = {10,0};
    rep (i,5) if (menu[i] % 10 != 0 and menu[i] % 10 < a.fs) a.fs = menu[i] % 10, a.sc = menu[i];

    int sum = 0;
    int num = -1;
    rep(i,5) rep(j,5) if (menu[i] == a.sc) num = i; //効率悪いメニューの番号

    rep(i,5) { 
        if (i != num) {
            rep(j,9) while(menu[i] % 10 != 0) menu[i]++;
        }
        sum += menu[i];
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
package main

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

type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) PrintLn(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *Io) PrintIntLn(a []int) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.PrintLn(b...)
}

func (io *Io) PrintStringLn(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.PrintLn(b...)
}

func count(nList []int, s, e int) int {
	if e >= len(nList) {
		e = len(nList) - 1
	}
	res := 0
	for i := s; i <= e; i++ {
		res += nList[i]
	}
	return res
}

func main() {
	io := NewIo()
	defer io.Flush()

	N := io.NextInt()
	K := io.NextInt()
	S := io.Next()

	nList := make([]int, 0, N/4)
	si := 0

	for i := range S {
		if S[i] != S[si] {
			nList = append(nList, i-si)
			si = i
		}
	}
	nList = append(nList, N-si)

	max := 0
	si = 0
	if S[0] == '0' {
		max = count(nList, 0, 1+2*(K-1))
		si = 1
	}

	for i := si; i < len(nList); i += 2 {
		tmp := count(nList, i, i+2*K)
		if tmp > max {
			max = tmp
		}
	}

	io.PrintLn(max)
}


Measured memory_bytes: 6400
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define MOD 1000000007
#define PI 3.141592653589793

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

    map<char, int> m;
    for(auto c: w)
        m[c]++;

    bool f = true;
    for(auto x: m)
        if(x.second % 2)
            f = false;
    cout << (f ? "Yes" : "No") << endl;
}


Measured memory_bytes: 256
// In the name of God

#include <bits/stdc++.h>

using namespace std;

#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL);
#define debug(x) cout << #x ": " << x << endl;

int main() {
	IOS
	int a, b, c;
	cin >> a >> b >> c;
	int t = b;
	long long ans = 0;
	ans += min(b, c) * 2LL;
	b -= min(b, c);
	c -= min(t, c);
	ans += min(a+1, c);
	ans += b;
	cout << ans;
 	return 0;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))

if A[0]==1:
    print(1 if N==0 else -1)
    exit()

if A[0]>1:
    print(-1)
    exit()
    

INF = 10**15

cond = [1]
m = INF
for a in A[1:]:
    c = min(INF, cond[-1]*2-a)
    if c<0:
        print(-1)
        exit()
    cond.append(c)

ans = 0
node = 0
for n in range(N, -1, -1):
    n1 = A[n]
    n2 = min(cond[n], node)
    node = n1 + n2
    ans += node

print(ans)


Measured memory_bytes: 20164
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	int i,j,k,n;
	string a,b;
	cin>>a>>b;
	if(a.size()>b.size())
	{
		for(i=0;i<b.size();i++)
		{
			cout<<a[i]<<b[i];	
		}	
		cout<<a[a.size()-1]<<endl;
	}	
	else
	{
		for(i=0;i<b.size();i++)
		{
			cout<<a[i]<<b[i];
		}
		cout<<endl;
	}
	return 0;
} 

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

using namespace std;

vector<vector<int>> E;

int N, K;
int d[2000];

void dfs(int pos, int parent) {
	for (int i = 0; i < E[pos].size(); i++) {
		int nxt = E[pos][i];
		if (nxt == parent)continue;

		d[nxt] = d[pos] + 1;
		dfs(nxt, pos);
	}
}

int main() {
	cin >> N >> K;
	E.resize(N);
	for (int i = 0; i < N - 1; i++) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		E[a].push_back(b);
		E[b].push_back(a);
	}

	int ans = 1145141919;

	for (int i = 0; i < N; i++) {
		if (K % 2 == 0) {
			int cnt = 0;
			d[i] = 0;
			dfs(i, -1);
			for (int j = 0; j < N; j++)if (d[j] > K / 2)cnt++;
			ans = min(ans, cnt);
		}
		else {
			for (int j = 0; j < E[i].size(); j++) {
				int cnt = 0;
				d[i] = 0;
				d[E[i][j]] = 0;
				dfs(i, E[i][j]);
				dfs(E[i][j], i);
				for (int k = 0; k < N; k++) {
					if (d[k] > (K - 1) / 2)cnt++;
				}
				ans = min(ans, cnt);
			}
		}
	}
	cout << ans << endl;
	return 0;
}

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

int main(){
	int m, f, r;

	while(1){

		cin >> m >> f >> r;
		if((m == -1 &&f == -1) && r == -1) break;

		if(m == -1 || f==-1) cout << 'F';
		else if(m + f >=80) cout << 'A';
		else if(65 <= m+f && m+f < 80) cout << 'B';
		else if(50 <= m+f && m+f < 65) cout << 'C';
		else if(30 <= m+f && m+f < 50){
			if(r >= 50) cout << 'C';
			else if(r < 50) cout << 'D';
		}else if(m+f < 30) cout << 'F';

		cout << endl;
		

	}

	return 0;
}


Measured memory_bytes: 3084
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.begin(), c.end()
#define Cin(T, x) T x; cin >> x;
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i];
#define Cout(val) cout << (val) << "\n";
#define Sort(a) sort(Range(a));
#define DeSort(a) sort(RevRange(a));

using namespace std;
using ll = long long;

int main(void){
    Cin(int, a);
    Cin(int, b);
    Cin(int, c);
    Cin(int, d);
    //Cout();
    //Cout(() ? "Yes" : "No");
    Cout((a == b) ? "Draw" : (a == 1 || (b != 1 && a > b)) ? "Alice" : "Bob");
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(){
    string N;
    int K;
    while(cin >> N >> K){
        vector<vector<long long>> dp(2, vector<long long>(K+2, 0));
        dp[1][0] = 1;
        for(auto& c : N){
            int v = c - '0';
            vector<vector<long long>> next(2, vector<long long>(K+2, 0));            
            for(int i=0;i<=K;i++){
                next[0][i] += dp[0][i];
                next[0][i+1] += 9 * dp[0][i];
                if(v == 0){
                    next[1][i] += dp[1][i];
                } else {
                    next[1][i+1] += dp[1][i];
                    next[0][i+1] += (v-1) * dp[1][i];
                    next[0][i] += dp[1][i];
                }
            }
            dp = next;
        }
        cout << dp[0][K] + dp[1][K] << endl;
    }
}

Measured memory_bytes: 256
N, T = map(int, input().split())
ls = []
for i in range(N):
  a, b = map(int, input().split())
  ls += [(a,b)]
ls.sort(key=lambda x:x[0])

dp = [[0]*(T) for i in range(N+1)]

for i in range(N):
  a,b = ls[i]
  for j in range(T-1, a-1, -1):
    dp[i+1][j] = max(dp[i][j], dp[i][j-a]+b)

last = [0]*N
last[-1] = ls[-1][1]
for i in range(N-2, -1, -1):
  last[i] = max(last[i+1], ls[i][1])

ans = 0

for i in range(1,N+1):
  ans = max(ans, max(dp[i-1])+last[i-1])

print(ans)


Measured memory_bytes: 116568
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const long long INF = 1LL << 60;
long long dp[100001];
int main()
{
    long long n;
    cin >> n;
    for(int i=0;i<=n;i++){
        dp[i] = i;
    }
    for(int i=0;i<=n;i++){
        for(int j=6;(i+j)<=n;j*=6){
                dp[i+j] = min(dp[i] + 1,dp[i+j]);
        }
        for(int j=9;(i+j)<=n;j*=9){
                dp[i+j] = min(dp[i] + 1,dp[i+j]);
        }
    }
    cout << dp[n];
}


Measured memory_bytes: 1024
#include <stdio.h>
#include <iostream>

using namespace std;

int main() {
  int n;
  scanf("%d", &n);
  int* arrayA = new int[n];
  for (int i = 0; i < n; i++) {
    scanf(" %d", &arrayA[i]);
  }
  float reciprocalSum = 0;
  for (int i = 0; i < n; i++) {
    reciprocalSum += (float)1 / (float)arrayA[i];
  }
  float answer = 1 / reciprocalSum;
  cout << answer << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <utility>
using namespace std;
#define LARGE 1000000007

int main() {
    int N, M; cin >> N >> M;
	vector<int> a(M);

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

	vector<int> dp(N+1, 0);

	dp[0] = 1;
	int index;
	index = 0;

	for(int i = 1; i <= N; i++){
		if(index < M){
			if(a[index] == i){
				index++;
				continue;
			}
		}
		dp[i] += dp[i-1];
		if(i > 1){
			dp[i] += dp[i-2];
		}
		dp[i] %= LARGE;
	}

	cout << dp[N] << endl;
}

Measured memory_bytes: 1024
#include <iostream>
using namespace std;
int main(void){
    int a,b,c;
    cin>>a>>b>>c;
    if(a+b+c==17&&a%2==1&&b%2==1&&c%2==1)
    {
        cout<<"YES"<<endl;
    }
    else
    {
        cout<<"NO"<<endl;
    }
    return 0;
}

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

using namespace std;


int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int n, k; cin >> n >> k;
	set<int> arr;
	int tmp;
	for (int i = 0; i < k; ++i) {
		cin >> tmp;
		arr.insert(tmp);
	}

	int ans = n;
	while (true) {
		int tmp = ans;
		bool done = true;
		while (tmp > 0) {
			if (arr.find(tmp % 10) != arr.end()) {
				++ans;
				done = false;
				break;
			}
			else tmp /= 10;
		}
		if (done) {
			cout << ans << "\n";
			return 0;
		}
	}

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,1};
const int dy[6] = {0, 1, 0, -1,1,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// ---------------------------------------------------------------------------

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll N,L;
    cin >> N >> L;
    vector<int> A(N);
    for(int i=0; i<N; i++){
        cin >> A[i];
    }
    vector<int> cnt(N,0);
    priority_queue<pair<ll,int>> que;
    if(A[0] > A[1]){
        cnt[0] = 0;
        que.emplace(A[0],0);
    }else{
        cnt[0] = 1;
    }
    if(A[N-1] > A[N-2]){
        cnt[N-1] = 0;
        que.emplace(A[N-1],N-1);
    }else{
        cnt[N-1] = 1;
    }
    for(int i=1; i<N-1; i++){
        if(A[i-1] > A[i]) cnt[i]++;
        if(A[i] < A[i+1]) cnt[i]++;
        if(!cnt[i]) que.emplace(A[i],i);
    }
    ll ans = 0;
    while(que.size()){
        auto v = que.top();
        que.pop();
        v.first += ans;
        ans += L-v.first;
        if(v.second != 0){
            cnt[v.second-1]--;
            if(cnt[v.second-1] == 0){
                que.emplace(A[v.second-1]-ans,v.second-1);
            }
        }
        if(v.second != N-1){
            cnt[v.second+1]--;
            if(cnt[v.second+1] == 0){
                que.emplace(A[v.second+1]-ans,v.second+1);
            }
        }
    }
    cout<< ans << enld;
    return 0;
}


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

int main(){
    int n;
    cin>>n;
    vector<char> c(n);
    bool flag = false;
    int a=0; int b=0;
    for(int i=0;i<n;i++){
        cin>>c[i];
        if(c[i]=='R') a++;
        if(c[i] =='R' && c[i-1] == 'W'){
            flag = true;
        }
    } 
    if(!flag){
        cout<<0<<endl;
        return 0;
    }
    int ans=a;
    for(int i=0;i<n;i++){
        if(c[i]=='W'){
            b++; 
        }
        else{
            a--;
        }
        ans=min(max(a,b),ans);
    }
    cout<<ans<<endl;
    return 0;
}


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

int main() {
  double a, b, x;
  cin >> a >> b >> x;
  double s = x / a;
  double ans = 0, h = 0;
  if (s >= a * b / 2) {
    h = (a * b - s) * 2 / a;
    ans = atan2(h, a);
  } else {
    h = s * 2 / b;
    ans = atan2(b, h);
  }

  cout << fixed << setprecision(10) << ans * 360 / (2 * M_PI) << endl;
}


Measured memory_bytes: 512
#include<stdio.h>
int main()
{
	int n, m;
	while(scanf("%d%d", &n, &m)!=EOF)
	{
		int ans=0;
		if(n==0 && m==0)
		{
			break;
		}
		for(int i=1; i<n-1; i++)
		{
			for(int j=i+1; j<n; j++)
			{
				for(int k=j+1; k<n+1; k++)
				{
					if(m==i+j+k)
					{
						ans++;
					}
				}
			}
		}
		printf("%d\n", ans);
	}
	return 0;
} 


Measured memory_bytes: 2688
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * 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;
        Scanner in = new Scanner(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, Scanner in, PrintWriter out) {
            long n = in.nextLong();

            long ans = 0;

            for (long i = 1; i * i <= n; i++) {
                ans = i * i;
            }

            out.print(ans);

        }

    }
}



Measured memory_bytes: 23252
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#define EPS 1e-9
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define LL long long
const int MOD = 1E9+7;
const int N = 1000+5;
const int dx[] = {-1,1,0,0,-1,-1,1,1};
const int dy[] = {0,0,-1,1,-1,1,-1,1};
using namespace std;

int main() {
    int A,B,C,D,E,F;
    scanf("%d%d%d%d%d%d",&A,&B,&C,&D,&E,&F);

    int sugarWater=-1,sugar=1;
    for(int i=0;i*100*A<=F;i++){//水A
        int waterA=i*100*A;
        for(int j=0;j*100*B<=F-waterA;j++){//水B
            int waterB=j*100*B;
            for(int k=0;k*C<=F-waterA-waterB;k++){//糖C
                int sugarC=k*C;
                for(int t=0;t*D<=F-waterA-waterB-sugarC;t++){//糖D
                    int sugarD=t*D;
                    int sugarSum=sugarC+sugarD;//糖质量
                    int tot=waterA+waterB+sugarSum;//当前质量
                    int real=A*E*i+B*E*j;//当前可放的糖
                    if(real<sugarSum||tot>F)
                        continue;
                    if(tot!=0&&sugarSum*1.0/tot>sugar*1.0/sugarWater){
                        sugar=sugarSum;
                        sugarWater=tot;
                    }
                }
            }
        }
    }
    printf("%d %d\n",sugarWater,sugar);

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> P;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)
/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
vector<char>NUM(10);
	NUM = { '0','1','2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' };
*/



int main() {
	int A, B;
	cin >> A >> B;
	if ((A * B) % 2 == 0) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
	}
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int i;
  int n, m;
  for(i = 0;i < 3000;i++){
    scanf("%d %d", &n, &m);
    if(n == 0 && m == 0) break;
    if(n > m)
    printf("%d %d\n", m, n);
    else printf("%d %d\n", n, m);
  }
  return 0;
}


Measured memory_bytes: 2040
def main():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    a = [0] * n
    a[0] = 0
    for i in range(1, n):
        a[i] = min([a[j] + abs(h[i] - h[j]) for j in range(max(0, i - k), i)])
    print(a[-1])
 
if __name__ == '__main__':
    main()

Measured memory_bytes: 13980
import java.util.*;

class Main {

	static Scanner sc = new Scanner(System.in);

	
	
	public static void main(String[] args) {
		String S=sc.next(),T=sc.next();
		int count=0;
		for(int i=0;i<S.length();i++) {
			if(S.charAt(i)!=T.charAt(i)) {
				count++;
			}
		}
		System.out.println(count);
	}
}

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

int main() {
  string A, B;
  cin >> A >> B;

  if (A.size() > B.size())
    cout << "GREATER" << endl;
  else if (A.size() < B.size())
    cout << "LESS" << endl;
  else {
    if (A > B)
      cout << "GREATER" << endl;
    else if (A < B)
      cout << "LESS" << endl;
    else if (A == B)
      cout << "EQUAL" << endl;
  }
  return 0;
}

Measured memory_bytes: 3600
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <map>
#include <tuple>
#include <numeric>
#include <cmath>
#include <limits>

#define double long double

long long combination(int n, int r) {
  long long result = 1;
  for (int i = 1; i <= r; i++) {
    result *= n--;
    result /= i;
  }
  return result;
}

int main() {
  int n, a, b;
  std::cin >> n >> a >> b;
  std::vector<long long> vs(n);
  std::map<long long, int> counter;
  for (auto& i : vs) {
    std::cin >> i;
    counter[i]++;
  }
  std::sort(std::begin(vs), std::end(vs));
  double max_average = 0;
  int max_take = a;
  std::map<int, double> averages;
  for (int i = a; i <= b; i++) {
    auto sum =
      std::accumulate(std::rbegin(vs), std::rbegin(vs) + i, 0ll);
    double average = static_cast<double>(sum) / static_cast<double>(i);
    if (average > max_average) {
      max_take = i;
      max_average = average;
    }
    averages[i] = average;
  }
  long long patterns = 0;
  for (auto&& pair : averages) {
    int len;
    double average;
    std::tie(len, average) = pair;
    if (std::abs(average - max_average) > std::numeric_limits<double>::epsilon()) continue;
    std::map<long long, int> included_counter;
    std::for_each(std::rbegin(vs), std::rbegin(vs) + len, 
        [&] (auto v) { included_counter[v]++; });
    long long acc = 1;
    for (auto&& pair : included_counter) {
      long long num;
      int count;
      std::tie(num, count) = pair;
      acc *= combination(counter[num], count);
    }
    patterns += acc;
  }
  std::cout << std::setprecision(9) << std::fixed << max_average << '\n' << patterns << std::endl;
}



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

using namespace std;


#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VC vector<char>
#define VS vector<string>
#define FOREACH(x,a) for(auto& (x) : (a) )


int main() {
	int a, b;
	cin >> a >> b;
	cout << a + b / 2 << endl;
	return 0;
}

Measured memory_bytes: 256
n=int(input())
a=[0]*n
x=[[0]*n for i in range(n)]
y=[[0]*n for i in range(n)]

for i in range(n):
  a[i]=int(input())
  for j in range(a[i]):
    x[i][j],y[i][j]=map(int,input().split())
    x[i][j]-=1
    
def check(honest):
  for i in range(n):
    if not honest[i]:
      continue
    for j in range(a[i]):
      if y[i][j]==1 and not honest[x[i][j]]:
        return False
      if y[i][j]==0 and honest[x[i][j]]:
        return False
  return True

def dfs(honest):
  if len(honest)==n:
    if check(honest):
      return sum(honest)
    else:
      return 0
  return max(dfs(honest + [True]),
             dfs(honest + [False]))
 
print(dfs([]))

Measured memory_bytes: 3064
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
using namespace std;
int main()
{
	int n;
	scanf("%d", &n);
	int flg = 0;
	for(int i = 1; i <= 9; i++){
		if(n % i == 0 && n / i <= 9 && n / i >= 0){
			flg = 1;
		}
	}
	if(flg == 1){
		printf("Yes");
	}else{
		printf("No");
	}
	return 0;
}

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string S, T;
    cin >> S >> T;
    int ans = T.size();
    for(int i = 0; i + T.size() <= S.size(); ++i){
        int cnt = 0;
        for(int j = 0; j < T.size(); ++j){
            if(T[j] != S[i+j]) cnt++;
        }
        ans = min(ans, cnt);
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll M = 998244353;

int main() {
    int N;
    cin >> N;
    vector<ll> a(N);
    ll ans = 1LL, sum = 0;
    for (int i = 0; i < N; i++) {
        cin >> a[i];
        sum += a[i];
        ans *= 3LL;
        ans %= M;
    }

    vector<vector<ll>> dp(500, vector<ll>(100000, 0));
    vector<vector<ll>> dp2(500, vector<ll>(100000, 0));
    dp[0][0] = dp2[0][0] = 1;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j <= sum; j++) {
            dp[i + 1][j + a[i]] += dp[i][j];
            dp[i + 1][j + a[i]] %= M;
            dp[i + 1][j] += 2 * dp[i][j];
            dp[i + 1][j] %= M;

            dp2[i + 1][j + a[i]] += dp2[i][j];
            dp2[i + 1][j + a[i]] %= M;
            dp2[i + 1][j] += dp2[i][j];
            dp2[i + 1][j] %= M;
        }
    }

    ll x = 0;
    for (int i = (sum + 1) / 2; i <= sum; i++) {
        x += dp[N][i];
        x %= M;
    }

    ans = ((ans - 3 * x) % M + M) % M;
    if (sum % 2 == 0) ans += 3 * dp2[N][sum / 2];

    cout << (ans % M + M) % M << endl;
}

Measured memory_bytes: 783728
#include <stdio.h>

  /* 配列の要素を交換する */
void Swap(int x[ ], int i, int j)
{
    int temp;

    temp = x[i];
    x[i] = x[j];
    x[j] = temp;
}

void QSort(int x[ ], int left, int right)
{
    int i, j;
    int pivot;

    i = left;                      /* ソートする配列の一番小さい要素の添字 */
    j = right;                     /* ソートする配列の一番大きい要素の添字 */

    pivot = x[(left + right) / 2]; /* 基準値を配列の中央付近にとる */

    while (1) {                    /* 無限ループ */

        while (x[i] < pivot)       /* pivot より大きい値が */
            i++;                   /* 出るまで i を増加させる */

        while (pivot < x[j])       /* pivot より小さい値が */
            j--;                   /*  出るまで j を減少させる */
        if (i >= j)                /* i >= j なら */
            break;                 /* 無限ループから抜ける */

        Swap(x, i, j);             /* x[i] と x[j]を交換 */
        i++;                       /* 次のデータ */
        j--;
    }

    if (left < i - 1)              /* 基準値の左に 2 以上要素があれば */
        QSort(x, left, i - 1);     /* 左の配列を Q ソートする */
    if (j + 1 <  right)            /* 基準値の右に 2 以上要素があれば */
        QSort(x, j + 1, right);    /* 右の配列を Q ソートする */
}

int main(void){
    int N, d[100000];
    scanf("%d",&N);
    for(int i = 0; i < N; i++)
    {
        scanf("%d",&d[i]); 
    }
    
    QSort(d,0,N-1);
    
    if(d[N/2] == d[N/2 - 1])
    {
        printf("0\n");
    }
    else
    {
        printf("%d\n",d[N/2] - d[N/2 - 1]);
    }
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long int  ll;
const ll mod = 1e9+7;
const ll mod1 = 998244353;
#define rep(i,a,b) for(ll i=a;i<b;i++)

void swap(ll &a , ll &b){
    ll t = a;
    a = b;
    b = t;
}

ll min(ll a, ll b){
    if(a<b)return a;
    return b;
}

ll max(ll a, ll b){
    if(a>b)return a;
    return b;
}

 ll pow(ll a, ll b) {
    a %= mod;
    ll ans = 1;
    while (b > 0) {
        if (b & 1)
            ans = ans * a % mod;
        a = a * a % mod;
        b /= 2;
    }
    return ans;
 }

bool sorter(ll a, ll b){
    if(a>b)return 1;
    return 0;
}




int main(){

   
   ios_base :: sync_with_stdio(0);
   cin.tie(0);
   ll n,m;
   cin>>n>>m;
   ll ans = m*(m-1)/2;
   ans += n*(n-1)/2;
    cout<<ans;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
    
    int S;
    cin >> S;
    int h = S / 3600;
    int m = (S % 3600) / 60;
    int s = (S % 3600) % 60;
    cout << h << ":" << m << ":" << s << endl;
    return 0;
    
}


Measured memory_bytes: 3096
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int INF = 1e9 + 5;

string read(int dp[3002][3002], string s, string t, int i, int j)
{
    if(i == 0 || j == 0) return "";
    if(s[i - 1] == t[j - 1]) return read(dp,s,t,i - 1,j - 1) + s[i - 1];
    if(dp[i][j - 1] > dp[i - 1][j])
        return read(dp,s,t,i,j - 1);
    return read(dp,s,t,i - 1,j);
}

int main()
{
    string s, t;
    cin >> s >> t;
    int slen = s.length(), tlen = t.length();
    int dp[3002][3002] = {};
    for(int i = 1; i <= slen; i++)
    {
        for(int j = 1; j <= tlen; j++)
        {
            if(s[i - 1] == t[j - 1]) dp[i][j] = dp[i - 1][j - 1] + 1;
            else    dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
        }
    }
    cout << read(dp, s, t, slen, tlen);
}


Measured memory_bytes: 65792
#include <cmath>
#include <cstdio>
#include <vector>
#include<cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    long long t,i,n,m,mii[10],mxi[10],j,flag=0;
    char a[10][10];
    cin>>n>>m;
    for(i=0;i<n;i++)
    {
        mii[i]=10000;
        mxi[i]=-1;
    }
    for(i=0;i<n;i++)
    {
         for(j=0;j<m;j++)
         {
             cin>>a[i][j];
             if(a[i][j]=='#')
             {
                 //cout<<mxi[i]<<" "<<j<<endl;
                 mii[i]=min(mii[i],j);
                 mxi[i]=max(mxi[i],j);
             }
         }    
        if(i!=0)
        {
            
            if(!(mii[i]==mxi[i-1]))
            {
                //cout<<i<<" "<<mxi[i-1]<<" "<<mii[i]<<endl;
                flag=1;
            }
        }
    }
    //for(i=0;i<n;i++)
    //    cout<<mii[i]<<" "<<mxi[i]<<endl;
    if(!flag)
        cout<<"Possible"<<endl;
    else
        cout<<"Impossible"<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

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

    int lo = 1, hi = n;

    for (int i = 0; i < m; ++i) {
      int l = sc.nextInt();
      int r = sc.nextInt();

      lo = (l > lo) ? l : lo;
      hi = (r < hi) ? r : hi;
    }

    System.out.println(Math.max(0, hi - lo + 1));
  }
}

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

int main()
{
	int n;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	int ans=0;
	for(int i=1;i<n-1;i++)
	{
		if((a[i-1]<a[i]&&a[i+1]>a[i])||\
		a[i-1]>a[i]&&a[i+1]<a[i])
		{
			ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python

def lot3h():
    mounts = []
    for i in range(10):
        mounts.append(int(raw_input()))
    mounts.sort()
    mounts.reverse()
    for i in range(3):
        print "%d\n" % mounts[i] ,
    return

if __name__ == "__main__":
    lot3h()

Measured memory_bytes: 4208
def d_three_colors(N, A, MOD=998244353):
    # 参考: http://smijake3.hatenablog.com/entry/2019/04/21/023359
    a_sum = sum(A)

    # dp0[i][s]: a_iまでの数を使い、G+Bの値がsとなるような選び方
    # としてDPを行うが、iを0から増やすのではなくa_sumから減らすやり方だと、
    # iについて配列を保持しておく必要がなくなり、1次元配列で済む
    dp0 = [0] * (a_sum + 1)
    dp0[0] = 1
    for a in A:
        for s in range(a_sum, a - 1, -1):
            # a_iを採用する場合、Gに足す場合とBに足す場合の2通りあるので、
            # dp[s-a]の2倍を足すことになる
            dp0[s] = (dp0[s] + 2 * dp0[s - a]) % MOD

    # dp[s]: GとBにa_iの値を平等に割り振って、G+Bの値がsとなるような選び方
    dp1 = [0] * (a_sum + 1)
    dp1[0] = 1
    for a in A:
        for s in range(a_sum, a - 1, -1):
            # a_iを採用する場合、GとBに平等に足すことになる(dp0のループと違い、
            # どちらに足すかを選ばない)ので、dp1[s-a]の1倍を足すことになる
            dp1[s] = (dp1[s] + dp1[s - a]) % MOD

    ans = pow(3, N, MOD)  # すべての塗り方
    for l in range(a_sum // 2 + 1):
        # G+B<=a_sum//2 のとき、三角形は存在しないので、その分を引く
        ans = (ans - 3 * dp0[l]) % MOD
    if a_sum % 2 == 0:
        # このとき、G==B==a_sum//2の場合の数を引きすぎているので、足す
        ans = (ans + 3 * dp1[a_sum // 2]) % MOD
    return ans

N = int(input())
A = [int(input()) for _ in range(N)]
print(d_three_colors(N, A))

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

typedef long long ll;

char s[100005];
char t[100005];
int nxt[100005][26];//not the next in kmp lol
int slen,tlen;
int pos;
int tms;
ll ans;

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin>>s+1;
    cin>>t+1;
    slen=strlen(s+1);
    tlen=strlen(t+1);
    for(int j=0;j<26;j++){
        nxt[slen+1][j]=slen+1;
    }
    for(int i=slen;i>=1;i--){
        for(int j=0;j<26;j++){
            nxt[i][j]=nxt[i+1][j];
        }
        nxt[i][s[i]-'a']=i;
    }
    pos=1;
    for(int i=1;i<=tlen;i++){
        if(nxt[pos][t[i]-'a']==slen+1){
            tms++;
            pos=nxt[1][t[i]-'a']+1;
            if(pos==slen+2){
                cout<<-1<<endl;
                return 0;
            }
        }else{
            pos=nxt[pos][t[i]-'a']+1;
        }
    }
    ans=(ll(tms))*slen+pos-1;
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 10624
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;

int main() 
{
	int a, b, k;

	cin >> a >> b >> k;

	if (b - a + 1 <= k * 2)
	{
		for (int i = a; i <= b; i++)
		{
			cout << i << endl;
		}
	}
	else
	{
		for (int i = a; i <= a + k - 1; i++)
		{
			cout << i << endl;
		}
		for (int i = b - k + 1; i <= b; i++)
		{
			cout << i << endl;
		}
	}
}

Measured memory_bytes: 256
import collections as cl
import numpy as np

# デバッグ用
DEBUG = False
#DEBUG = True

# 宣言
result = 0
A = []
ELEM_MAX = 10000

# 入力部
if DEBUG:
    N = '10'
    a = '1 2 3 4 5'

else:
    N = int(input())

    for i in range(N):
        a = int(input())
        A.append(a)

# 処理部
A_counter = cl.Counter(A)
for val in A_counter.values():
    result += val % 2

# 出力部
print(result)

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

int main(){
  string A, B;
  cin>>A>>B;
  if(A == B) cout << "EQUAL" << endl;
  else if(A.size() > B.size()) cout << "GREATER" << endl;
  else if(A.size() < B.size()) cout << "LESS" << endl;
  else if(A.size() == B.size()){
    if(A > B) cout << "GREATER" << endl;
    if(A < B) cout << "LESS" << endl;
  }
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
typedef long long ll;

int main(){
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    ll ans = a[0]-1, k = 1;
    for(int i = 1; i < n; i++){
        if(a[i] <= k)   continue;
        if(a[i] == k+1){
            k++;
            continue;
        }
        // a[i] ~ k+1+1まではk+1ずつ減らして良い
        // k+1にしてしまうとk削らないといけなくなるのでダメ
        // (k+1になってしまう1歩手前でa[i]が1になるまでごっそり削るべき)
        // a[i] ~ k+1+1の数はa[i]-(k+1+1)+1ヶあるのでこれをk+1でfloor取ればOK
        ans += (a[i]-(k+1+1)+1+k)/(k+1);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define REPR(i, n) for(int i = (n); i >= 0; i--)
#define FOR(i, m, n) for(int i = (m); i < (n); i++)
#define INF 1e9
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << ": " << x << endl;

using namespace std;
typedef long long ll;

signed main() {
  int N, L;
  vector<string> S;
  string tmp;

  cin >> N;
  cin >> L;

  REP(i, N) {
    cin >> tmp;
    S.push_back(tmp);
  }

  sort(ALL(S));

  REP(i, N) cout << S[i];
  cout << endl;

  return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
        String str = sc.next();
        if(str.matches("A[a-z]+C[a-z]+")) {
            System.out.println("AC");
        } else {
            System.out.println("WA");
        }
    }
}

Measured memory_bytes: 25300
#pragma GCC optimize("Ofast", "unroll-loops")

#include <bits/stdc++.h>

using namespace std;

int N, M, K;

void input(void) {
	cin >> N >> M >> K;
}

bool judge(int x, int y) {
	return (N * x + M * y - 2 * x * y == K);
}

int main(void) {
	input();
	bool res = false;
	for (int x = 0; x <= M; ++x)
		for (int y = 0; y <= N; ++y)
			res |= judge(x, y);
	cout << (res ? "Yes" : "No") << endl;
	return 0;
}

Measured memory_bytes: 3636
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;

const long long INF = 1LL << 50;

class FenwickTreeMax {
    public:
        FenwickTreeMax(int n) : N(n), data(n, -INF) {

        }

        void put(int x, long long v) {
            for (; x < N; x |= x + 1) {
                data[x] = max(data[x], v);
            }
        }

        long long get(int x) {
            long long res = -INF;
            for (; x >= 0; x = (x & (x + 1)) - 1) {
                res = max(res, data[x]);
            }
            return res;
        }

    private:
        int N;
        vector<long long> data;
};


class FenwickTreeMin {
    public:
        FenwickTreeMin(int n) : N(n), data(n, INF) {

        }

        void put(int x, long long v) {
            for (; x < N; x |= x + 1) {
                data[x] = min(data[x], v);
            }
        }

        long long get(int x) {
            long long res = INF;
            for (; x >= 0; x = (x & (x + 1)) - 1) {
                res = min(res, data[x]);
            }
            return res;
        }

    private:
        int N;
        vector<long long> data;
};


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

    int n;
    cin >> n;
    vector<pair<int,int>> P;
    for (int i = 0; i < n; ++i) {
        int x, y;
        cin >> x >> y;
        P.emplace_back(x, y);
    }

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

    vector<int> Y;
    for (int i = 0; i < n; ++i) {
        Y.push_back(P[i].second);
    }
    sort(Y.begin(), Y.end());
    Y.resize(unique(Y.begin(), Y.end()) - Y.begin());

    auto index = [&](int y) {
        auto it = lower_bound(Y.begin(), Y.end(), y);
        int res = it - Y.begin();
        return res;
    };

    FenwickTreeMax ftup(n);
    FenwickTreeMax ftdown(n);

    long long res = 0;
    for (int i = 0; i < n; ++i) {
        int x = P[i].first;
        int y = P[i].second;

        int idx = index(y);
        {
            auto ans = ftdown.get(idx);
            if (ans > -INF && ans < INF) {
                ans = x + y + ans;
                res = max(res, ans);
            }
            ftdown.put(idx, -y - x);
        }
        {
            auto ans = ftup.get(n - 1 - idx);
            if (ans > -INF && ans < INF) {
                ans = ans + x - y;
                res = max(res, ans);
            }
            ftup.put(n - 1 - idx, y - x); 
        }
    }

    cout << res << '\n';


    return 0;
}

Measured memory_bytes: 9796
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <locale>
#include <random>
#include <cassert>
#include <sstream>
using namespace std;
#define F first
#define S second
#define pb push_back
#define MP make_pair
#define ALL(x) begin(x), end(x)
#define SZ(x) (int)(x).size()
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ln(i, n) " \n"[i == n]
typedef long long LL;
typedef long double LDB;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
//////////////////////
const long double eps = 1e-13;
const long double PI = acos(-1);
const int INF = (int)1e9;
const LL  INFF = (LL)1e15;
const int mod = 998244353;
const int MXN = (int)1e6 + 7;
int main(){
	int n, k; scanf("%d %d", &n, &k);
	int v = (n + 1) / 2;
	if (k > v) puts("NO");
	else puts("YES");
	return 0;
}


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

namespace ConsoleApp15
{
    class Class78
    {
        static void Main()
        {
            char[] S = Console.ReadLine().ToCharArray();
            string T = Console.ReadLine();

            for(int i = S.Length-T.Length ;i>=0;i--)
            {
                bool frag = true;
                for(int j = 0; j < T.Length; j++)
                {
                    if (S[i + j] != T[j])
                        if (S[i + j] != '?')
                            frag = false;
                }
                if (frag)
                {
                    for(int j = 0; j < T.Length; j++)
                    {
                        S[i + j] = T[j];
                    }
                    for (int j = 0; j < S.Length; j++)
                        if (S[j] == '?') S[j] = 'a';
                    Console.WriteLine(S);
                    return;
                }
            }
            Console.WriteLine("UNRESTORABLE");
        }
    }
}


Measured memory_bytes: 11092
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
typedef long long ll;
ll a[210];
ll sum=0;
int judge(ll n){
    ll ans=0;
    for(int i=0;i<n;i++){
        if(a[i]==0) return sum;
        if(a[i]%2==0) {
        ans++;
        a[i]=a[i]/2;
        }
        else return sum;
    }
    if(ans==n) {
        sum++;
        judge(ans);
    }
    else return sum;
}
int main(){
    ios::sync_with_stdio(0);
    ll n;
    cin>>n;
    memset(a,0,sizeof(a));
    for(int i=0;i<n;i++){
        cin>>a[i];
        if(a[i]==0) return 0;
    }
    ll m=judge(n);
    cout<<m<<endl;
        return 0;
}

Measured memory_bytes: 256
def insertionSort(lis,leng):
    for i in range(leng):
        v = lis[i]
        j = i - 1
        while j >= 0 and lis[j] > v:
            lis[j+1] = lis[j]
            j = j-1
        lis[j+1]=v
        print(*lis)

        
if __name__ == "__main__":
    lengg=int(input())
    liss=list(map(int, input().split()))
    insertionSort(liss,lengg)

Measured memory_bytes: 8000
#include<stdio.h>

int main(){   
int n;
scanf("%d",&n);
int a;
long long int s = 0;
int min = 1000001;
int max = -1000001;


for(int i = 0;i < n;i++){
    scanf("%d",&a);
    if(min > a){ min = a; }
    if(max < a){ max = a;}
    s += a;
}
printf("%d %d %lld\n",min,max,s);
}


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

using ll = long long;
using vi = vector<int>;
using vi2 = vector<vector<int>>;
#define MP(a,b) make_pair((a),(b))
#define MT(...) make_tuple(__VA_ARGS__)

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl;

#define DCOUT(x,n) cout << fixed << setprecision(n) << (x) << endl;

#define sz(x) (int)(x).size()
#define HOGE cout << "hoge" << endl;
using P = pair<ll,ll>;

template<typename T>inline istream& operator>>(istream&i,vector<T>&v)
{REP(j,sz(v))i>>v[j];return i;}

const int INF = 1e9;
const ll m = 1e9+7;

int main(){
    ll n;
    cin >> n;
    vector<ll> a(n);
    REP(i,n) cin >> a[i];
    ll sum = 0;
    REP(i,n){
      	sum += a[i];
      	sum %= m;
    }
    ll ans;
    ans = sum*sum;
    ans %= m;
    REP(i,n){
        ans -= (a[i]*a[i])%m;
      	while(ans<0) ans += m;
        ans %= m;
    }
    if(ans%2==0) cout << ans/2 << endl;
    else cout << (ans+m)/2 << endl;
}


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

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef vector<vector<long long>> VVL;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef tuple<int,int,int> tpl;

#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define EXIST(m,v) (m).find((v)) != (m).end()
#define LB(a,x) lower_bound((a).begin(), (a).end(), x) - (a).begin()
#define UB(a,x) upper_bound((a).begin(), (a).end(), x) - (a).begin()

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);--i)
#define RREP(i,n) RFOR(i,n,0)

#define en "\n"

constexpr double EPS = 1e-9;
constexpr double PI  = 3.1415926535897932;
constexpr int INF = 2147483647;
constexpr long long LINF = 1LL<<60;
constexpr long long MOD = 1000000007; // 998244353;

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

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

void Main(){
    int a, b;
    cin >> a >> b;
    cout << a * b << en;
    return;
}

int main(void){
    cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);cout<<fixed<<setprecision(15);
    int t=1; //cin>>t;
    REP(_,t) Main();
    return 0;
}


Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long int lli;
#define optimize ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define forn(i,n) for(int i = 0; i<n; i++)
#define forab(i,a,b) for(int i = a; i<b; i++)
#define forll(i,a,b) for(lli i = a; i<b; i++)
#define mp make_pair
#define pb emplace_back
#define sortv(v) sort(v.begin(), v.end())
#define debug(x) cout<<#x<<" : "<<x<<endl
#define all(x) x.begin(),x.end()
const int mod1 = 1000000007;
const int mod2 = 998244353;

int main()
{
	optimize

	int n;
	cin>>n;

	string s;
	cin>>s;

	int i = 0;
	int j = (int)s.size()-1;

	int ans = 0;
	while(i<j)
	{
		if(s[i] == 'W' && s[j] == 'R')
		{
			ans++;
			i++;
			j--;
		}
		else if(s[j] == 'W')
			j--;
		else if(s[i] == 'R')
			i++;
	}

	cout<<ans<<endl;

	
	return 0;
}

Measured memory_bytes: 3760