akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define rep(i, n) repl(i, 0, n)
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define CST(x) cout << fixed << setprecision(x)
using ll = long long;
const ll MOD = 1000000007;
const int inf = 1e9 + 10;
const ll INF = 4e18 + 10;

int calc(vector<int> N, int i, int j, int k) {
    return N.at(0) + pow(-1, i) * N.at(1) + pow(-1, j) * N.at(2)+pow(-1, k) * N.at(3);
}

void prt(vector<int> N, vector<int> P) {
    cout << N.at(0);
    rep(i, 3) {
        if (P.at(i) % 2 == 0) cout << "+"; else cout << "-";
        cout << N.at(i + 1);
    }
    cout << "=7" << endl;
}

int main() {
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(false);
    
    string S;
    cin >> S;
    vector<int> N(4);
    rep(i, 4) N.at(i) = S.at(i) - 48;
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 2; j++) {
            for (int k =0; k < 2; k++) {
                vector<int> parity = {i, j, k};
                if (calc(N, i, j, k) == 7) {
                    prt(N, parity);
                    return 0;
                }
            }
        }
    }
    return 0;
}


Measured memory_bytes: 3744
N, *VS = $stdin.read.split.map(&:to_i)
occ = [{}, {}]
for i in 0...(N/2)
  occ[0][VS[i*2  ]] = (occ[0][VS[i*2  ]] || 0) + 1
  occ[1][VS[i*2+1]] = (occ[1][VS[i*2+1]] || 0) + 1
end
ranking = [
  occ[0].sort_by(&:last),
  occ[1].sort_by(&:last),
]
def ans(na, nb); p (N/2 - na) + (N/2 - nb); end
a1, na1 = *ranking[0][-1]
b1, nb1 = *ranking[1][-1]
a2, na2 = *ranking[0][-2]
b2, nb2 = *ranking[1][-2]
if a1 != b1
  ans(na1, nb1)
else
  if na1 < nb1
    ans(na2, nb1)
  elsif na1 > nb1
    ans(na1, nb2)
  else # 1位が同数
    if na2.nil?  # 全部同じ数
      p N/2
    else
      ans(na1, [na2, nb2].max)
    end
  end
end


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

using namespace std;

int main() {
    int n, a, b;
    cin >> n >> a >> b;
    int h[n];
    for (auto &hi:h) cin >> hi;
    long l = 0, r = (long)1e9;
    while (r - l > 1) {
        long c = (l + r + 1) / 2, sum=0;
        for (auto hi:h)
            if (hi > b * c)
                sum += (hi - b * c - 1) / (a - b) + 1;
        if (c < sum) l = c;
        else r = c;
    }
    cout <<  r << '\n';
    return 0;
}

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

int main() {
  int N;
  cin >> N;
  map<int, string> mp = {
      {0, "pon"}, {1, "pon"}, {2, "hon"}, {3, "bon"}, {4, "hon"},
      {5, "hon"}, {6, "pon"}, {7, "hon"}, {8, "pon"}, {9, "hon"},
  };
  cout << mp[N % 10] << endl;
}

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

enum FACE {TOP, BOTTOM, FRONT, BACK, LEFT, RIGHT };

class Dice
{
public:
	int id[6];
	Dice() {
		id[TOP] = 0; id[FRONT] = 1; id[LEFT] = 2;
		id[RIGHT] = 3; id[BACK] = 4; id[BOTTOM] = 5;
	}

	void roll_x() { roll(TOP, BACK, BOTTOM, FRONT); }
	void roll_y() { roll(TOP, LEFT, BOTTOM, RIGHT); }
	void roll_z() { roll(FRONT, RIGHT, BACK, LEFT); }

	void roll(FACE a, FACE b, FACE c, FACE d) {
		int tmp = id[a];
		id[a] = id[b];
		id[b] = id[c];
		id[c] = id[d];
		id[d] = tmp;
	}
};

Dice field[3][3][3]; //x,y,z

int t_tbl[3][3];
int f_tbl[3][3];
set<int> ans;

void dfs(int x, int y, int z, int r)
{
	if(z == 3) {
		ans.insert(r);
		return;
	}

	Dice& d = field[x][y][z];
	for(int k=0; k<6; (k&1?d.roll_y():d.roll_x()), k++)
	for(int i=0; i<4; d.roll_z(), i++) {
		if(y == 0 && f_tbl[x][z]) {
			if(d.id[FRONT] + 1 != f_tbl[x][z]) continue;
		}
		if(z == 0 && t_tbl[x][y]) {
			if(d.id[TOP] + 1 != t_tbl[x][y]) continue;
		}

		if(x != 0) {
			if(field[x-1][y][z].id[RIGHT] + field[x][y][z].id[LEFT] + 2 != 7) continue;
		}

		if(y != 0) {
			if(field[x][y-1][z].id[BACK] + field[x][y][z].id[FRONT] + 2 != 7) continue;
		}

		if(z != 0) {
			if(field[x][y][z-1].id[BOTTOM] + field[x][y][z].id[TOP] + 2 != 7) continue;
		}

		int nx = x + 1, ny = y, nz = z;
		if(nx == 3) { nx = 0; ny += 1; };
		if(ny == 3) { ny = 0; nz += 1; };

		int nr = r;
		if(x == 0) nr += field[x][y][z].id[LEFT] + 1;
		dfs(nx, ny, nz, nr);
	}
}

int main()
{
	int N;
	cin >> N;
	while(N--) {
		ans.clear();

		for(int i=0; i<3; i++)
		for(int j=0; j<3; j++)
			cin >> t_tbl[j][i];

		for(int i=0; i<3; i++)
		for(int j=0; j<3; j++)
			cin >> f_tbl[j][i];

		dfs(0, 0, 0, 0);

		for(set<int>::iterator it = ans.begin(); it != ans.end(); ++it) {
			if( it != ans.begin() ) cout << " ";
			cout << *it;
		}

		if(ans.size() == 0) cout << 0;

		cout << endl;
	}

}

Measured memory_bytes: 912
import java.io.*;
import java.util.*;
import static java.lang.System.out;

public class Main {
    static MyReader in = new MyReader();

    public static void main(String[] args) {
        int[] A = in.ii(9);
        int N = in.i();
        boolean[] b = new boolean[9];
        for (int i = 0; i < N; i++) {
            int B = in.i();
            for (int j = 0; j < 9; j++) {
                if (A[j] == B) {
                    b[j] = true;
                }
            }
        }
        boolean f = false;
        for (int i = 0; i < 3; i++) {
            f |= b[3 * i + 0] && b[3 * i + 1] && b[3 * i + 2];
        }
        for (int i = 0; i < 3; i++) {
            f |= b[0 + i] && b[3 + i] && b[6 + i];
        }
        f |= b[0] && b[4] && b[8] || b[2] && b[4] && b[6];
        out.println(f ? "Yes" : "No");
    }
}

class MyReader extends BufferedReader {
    char[] cbuf = new char[1024];
    int head = 0;
    int tail = 0;

    MyReader() {
        super(new InputStreamReader(System.in));
    }

    char next() {
        if (head == tail) {
            try {
                tail = super.read(cbuf, 0, cbuf.length);
            } catch (IOException e) {
                e.printStackTrace();
            }
            head = 0;
        }
        return cbuf[head++];
    }

    void back() {
        head--;
    }

    boolean minus() {
        boolean minus;
        while (true) {
            char c = next();
            if (!isDelimiter(c)) {
                if (!(minus = c == '-')) back();
                return minus;
            }
        }
    }

    void skip() {
        while (isDelimiter(next()));
        back();
    }

    char[] s(int N) {
        char[] cbuf = new char[N];
        read(cbuf, 0, N);
        return cbuf;
    }

    public int read(char[] cbuf, int off, int len) {
        skip();
        int i;
        for (i = 0; i < cbuf.length; i++) {
            char c = next();
            if (isDelimiter(c)) {
                break;
            }
            cbuf[i] = c;
        }
        return i;
    }

    boolean isDelimiter(char c) {
        return c == ' ' || c == '\n' || c == '\r';
    }

    int i() {
        boolean minus = minus();
        int n = 0;
        while (true) {
            int k = next() - '0';
            if (k < 0 || 9 < k) break;
            n = 10 * n + k;
        }
        return minus ? -n : n;
    }

    int[] ii(final int N) {
        int[] a = new int[N];
        for (int j = 0; j < a.length; j++) a[j] = i();
        return a;
    }

    long l() {
        boolean minus = minus();
        long n = 0;
        while (true) {
            int k = next() - '0';
            if (k < 0 || 9 < k) break;
            n = 10 * n + k;
        }
        return minus ? -n : n;
    }
}


Measured memory_bytes: 32480
#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>
#define IP pair<int,P>
#define PI pair<P,int>
#define PP pair<P,P>
#define Yes(f){cout<<(f?"Yes":"No")<<endl;}
#define YES(f){cout<<(f?"YES":"NO")<<endl;}
int Madd(int x,int y) {return (x+y)%M;}
int Msub(int x,int y) {return (x-y+M)%M;}
int Mmul(int x,int y) {return (x*y)%M;}



template< typename Monoid >
struct SegTree {
  using F = function< Monoid(Monoid, Monoid) >;

  int sz;
  vector< Monoid > seg;

  const F f;
  const Monoid M1;

  SegTree(int n, const F f, const Monoid &M1) : f(f), M1(M1) {
    sz = 1;
    while(sz < n) sz <<= 1;
    seg.assign(2 * sz, M1);
  }

  void set(int k, const Monoid &x) {
    seg[k + sz] = x;
  }

  void build() {
    for(int k = sz - 1; k > 0; k--) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }

  void update(int k, const Monoid &x) {
    k += sz;
    seg[k] = x;
    while(k >>= 1) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }

  Monoid get(int a, int b) {
    Monoid L = M1, R = M1;
    for(a += sz, b += sz; a < b; a >>= 1, b >>= 1) {
      if(a & 1) L = f(L, seg[a++]);
      if(b & 1) R = f(seg[--b], R);
    }
    return f(L, R);
  }

  Monoid operator[](const int &k) const {
    return seg[k + sz];
  }
};

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);

  int n;
  cin>>n;
  SegTree<int> seg(n,[](int a,int b){return max(a,b);},0);

  rep(i,n){
    int s;
    cin>>s;
    seg.set(i,s);
  }
  seg.build();
  int ans=-INF;
  rep(i,n-1){
    //cout<<seg.get(i+1,n)<<' '<<seg[i]<<endl;
    ans=max(ans,seg.get(i+1,n)-seg[i]);
  }

  cout<<ans<<endl;


}


Measured memory_bytes: 7020
mod = 10 ** 9 + 7

K = map(int, input())
D = int(input())

s = 0
dp = [0] * D
for k in K:
    ndp = [0] * D
    for d in range(10):
        for i, dpi in enumerate(dp, d):
            ndp[i % D] += dpi

    for d in range(s, s + k):
        ndp[d % D] += 1

    s = (s + k) % D
    dp = [x % mod for x in ndp]

print((dp[0] - (s != 0)) % mod)

Measured memory_bytes: 44380
import sys

def solve():
    input = sys.stdin.readline
    N = int(input())
    DP = [[False for j in range(100 * N + 1)] for _ in range(N)]
    DP[0][0] = True
    S = [int(input()) for _ in range(N)]
    DP[0][S[0]] = True
    for i in range(1, N):
        for j in range(100 * N + 1):
            if DP[i-1][j] == True: 
                DP[i][j] = True
                if j + S[i] < 100 * N + 1: DP[i][j + S[i]] = True
    for i in reversed(range(100 * N + 1)):
        if DP[N-1][i] and i % 10 > 0:
            print(i)
            break
    else: print(0)

    return 0

if __name__ == "__main__":
    solve()

Measured memory_bytes: 11252
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,h[100005],dp[10005];
  cin>>n;
  for(int i=1;i<=n;i++){
    cin>>h[i];
  }
  dp[1]=0;
  for(int i=2;i<=n;i++){
    if(i!=2)
      dp[i]=min(abs(h[i]-h[i-2])+dp[i-2],abs(h[i]-h[i-1])+dp[i-1]);
    else
      dp[i]=abs(h[i]-h[i-1])+dp[i-1];
  }
  cout<<dp[n]<<endl;
  return (0);
}


Measured memory_bytes: 640
s=input()
if s[0]==s[1]:
    print(1,2)
    exit()
for i in  range(2,len(s)):
    if s[i-1]==s[i]:
        print(i, i+1) 
        exit()
    if s[i-2]==s[i]:
        print(i-1, i+1)

        exit()
print(-1, -1)

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//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; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
*/

int main(){
    int N, M; cin >> N >> M;
    vector<pair<int, int>> ba(M);
    for(int i=0; i<M; i++) cin >> ba[i].second >> ba[i].first;
    sort(ba.begin(), ba.end());

    int ans = 0;
    int id = 0;
    
    while(id<M){
        int bridge = ba[id].first-1;
        while(id<M && bridge >= ba[id].second) id++;
        ans++;
    }

    cout << ans << endl;
    
}

Measured memory_bytes: 1152
x=input()
y=len(x)
x1=x[y-1]
if x1=='0':
    print('pon')
if x1=='1':
    print('pon')
if x1=='2':
    print('hon')
if x1=='3':
    print('bon')
if x1=='4':
    print('hon')
if x1=='5':
    print('hon')
if x1=='6':
    print('pon')
if x1=='7':
    print('hon')
if x1=='8':
    print('pon')
if x1=='9':
    print('hon')


Measured memory_bytes: 9036
import java.util.*;
import java.io.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = Integer.parseInt(sc.next());
        int a_score = 0;
        int b_score = 0;
        for (int i = 0; i < n; i++) {
            String a = sc.next();
            String b = sc.next();
            if (a.compareTo(b) < 0) {
                b_score += 3;
            } else if (a.compareTo(b) > 0) {
                a_score += 3;
            } else {
                a_score++;
                b_score++;
            }
        }
        out.printf("%d %d\n", a_score, b_score);
        out.flush();
    }
}


Measured memory_bytes: 31420
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>

using namespace std;

using ll = long long;
using ull = unsigned long long;

const ll inf = (ll)1e9;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s, f) cout << fixed << setprecision(f) << s << endl;


int main()
{
	vector<int> a(3);

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

	sort(all(a));

	println(a[0] + a[1]);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IN(a) scanf("%d",&a);
#define REPT(i,n) for (int i=1;i<=(n);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RER(i,n,m) for (int i=m;i>(m-n);i--)
#define BR break;

using namespace std;

int main(){
	int a[10];

	REP(i,10)
	{
		IN(a[i]);
	}
	sort(a,a+10);

	RER(i,3,9){
		printf("%d\n",a[i]);
	}

	return 0;
 }

Measured memory_bytes: 1204
n = int(input())
a_max = 0
data = [int(input()) for i in range(n)]
a_max = max(data)
flag = True if 2 <= data.count(a_max) else False
for i in range(n):
  if data[i] == a_max and not flag:
    tmp = data.pop(i)
    print(max(data))
    data.insert(tmp,0)
    
  else:
  	print(a_max)

Measured memory_bytes: 12532
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
using namespace std;
#define int long long
#define inf 3000000000000
int p[10005], c[505], e[505];
int rwa[10005];
int dp[505][10005];//dp[i][j],i???????????±?????§??????j???????\?????????\???

signed main() {
	int m, n;
	cin >> m >> n;
	for (int i = 0; i < m; i++)cin >> p[i];
	for (int i = 0; i < n; i++)cin >> c[i] >> e[i];
	sort(p, p + m);
	reverse(p, p + m);
	for (int i = 0; i < m; i++)rwa[i + 1] = p[i];
	for (int i = 0; i < m; i++)rwa[i + 1] += rwa[i];

	for (int i = 0; i < 505; i++)
		for (int j = 0; j < 10005; j++)dp[i][j] = -1000000;
	dp[0][0] = 0;
	for (int i = 0; i < n; i++) {//??±
		for (int j = 0; j <= m; j++) {//?????§?????\??£????\????
			dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);//??±???????????????
			if(dp[i][j]!=-1000000)
			dp[i + 1][min(m, j + c[i])] = max(dp[i + 1][min(j + c[i], m)],
				dp[i][j] + rwa[min(m, j + c[i])] - rwa[j] - e[i]);
		}
	}
	int ans = 0;
	for (int i = 0; i <= m; i++)ans = max(ans, dp[n][i]);
	cout << ans << endl;
	}

Measured memory_bytes: 42788
#include<iostream>
#include<cassert>
#include<ctime>
#include<climits>
#include<queue>
#include<fstream>
#include<deque>
#include<iomanip>
#include<list>
#include<stack>
#include<sstream>
#include<string>
#include<cctype>
#include<cstdio>
#include<vector>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<map>
#include<set>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define EPS 1e-10
#define F first
#define S second
#define all(n) n.begin(),n.end()
#define pb push_back
#define insert(a,b,c,d) PP(P(a,b),P(c,d))
#define INF (1<<27)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<P,P> PP;
const int dx[4] = {0,1,0,-1};
const int dy[4] = {1,0,-1,0};
const int LIM = 1900000;
bool prime[LIM+2];
vector<int> primes;
void eratos(){
 
  int p=0;
  for(int i=0;i<=LIM;i++)prime[i] = true;
  prime[0] = prime[1] = false;
  for(int i=2;i<=LIM;i++){
    if(prime[i]){
      for(int j=2*i;j<=LIM;j+=i)prime[j] = false;
    }
  }
  
  REP(i,2,LIM){
    if(prime[i]){
      primes.pb(i);
    }
  }
  // cout << primes.size() << endl;///////////////////////////////
}
 
int b_search(int key){
  if(key == 0)return 0;
  if(key == 1)return 0;
  int l=0,r=primes.size()-1;
 
  while(l <= r){
    int mid = (l+r)/2;
    if(key <= primes[mid] && primes[mid-1] < key)return mid;
    if(key < primes[mid])r = mid;
    else if(primes[mid] < key)l =mid+1;
    //cout << "r = "<< r << ", l = " << l << endl;
  }
  assert(false);
}
 
int main(){
  clock_t start,end;
  start = clock();
  eratos();
  end = clock();
 
  //cout << setiosflags(ios::fixed) << setprecision(10) << "eratos time = " <<(double)(end-start)/CLOCKS_PER_SEC << endl;
  int N,P;
  while(true){
    
    cin >> N >> P;
    if(N == -1 && P == -1)break;
    
    int index = b_search(N);
    if(prime[N])index++;
    //cout << "index = " << index << " " << primes[index] << endl;    
    vector<int> Set;
    for(int i=index;i<=index+P;i++){
      for(int j=i;j<=index+P;j++){
    Set.pb(primes[i]+primes[j]);
      }
    }
    sort(all(Set));
    cout << Set[P-1] << endl;
  }
return 0;
}

Measured memory_bytes: 3852
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#define rep(i,n) for(int i = 0; i < n;i++)
#define ll long long
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;cin>>s;
  if(s=="SUN")
    cout<<7;
  if(s=="MON")
    cout<<6;
  if(s=="TUE")
    cout<<5;
  if(s=="WED")
    cout<<4;
  if(s=="THU")
    cout<<3;
  if(s=="FRI")
    cout<<2;
  if(s=="SAT")
    cout<<1;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;
//typedef tuple<ll, ll, ll> T;

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 dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

vector<ll> divisor(ll n){
    vector<ll> res;
    for(ll i=1; i*i <= n; i++){
        if(n % i == 0){
            res.push_back(i);
            if(i != n / i) res.push_back(n / i);
        }
    }
    return res;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin>>N;
    auto res = divisor(N);
    ll ans=0;
    for(auto x:res){
        ll m = x-1;
        if(m==0) continue;
        if(N/m==N%m) ans+=m;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
 
int main()
{
    int a;
    cin >> a;
    if(a>=400&&a<=599) cout << 8 << endl;
    if(a>=600&&a<=799) cout << 7 << endl;
    if(a>=800&&a<=999) cout << 6 << endl;
    if(a>=1000&&a<=1199) cout << 5 << endl;
    if(a>=1200&&a<=1399) cout << 4 << endl;
    if(a>=1400&&a<=1599) cout << 3 << endl;
    if(a>=1600&&a<=1799) cout << 2 << endl;
    if(a>=1800&&a<=1999) cout << 1 << endl; 
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n) ;i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
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(int argc, char const *argv[]) {
  int n,k;
  string s;
  cin >> n >> k >> s;
  char c = s[k-1]+32;
  s[k-1]=c;
  cout << s << endl;

  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define ArraySizeOf(array)     (sizeof(array) / sizeof(array[0]))
#define res(i,n) for(int i=n;;i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define REV(i,n) for(int i=n-1;i>0;i--)
#define req(i,n,m) for(int i=n;i<m;i++)
#define REQ(i,n,m,l) for(int i=n;i<m;i+=l) 
#define _GLIBCXX_DEBUG
int INF = 1e9 + 7;
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1)
{
    unsigned day;
    if (dow < dow1) dow += 7;
    day = dow - dow1;
    day += 7 * n - 6;
    return day;
}
signed gcd(long long x, long long y) {
    if (y == 0)return x;
    return gcd(y, x % y);
}
signed lcm(long long x, long long y) {
    return x / gcd(x, y) * y;
}
unsigned DayToWeekNumber(unsigned day)
{
    return (day - 1) / 7 + 1;
}
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0)
{
    return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
signed main() {
    int N; cin >> N;
    vector<int>A(N);
    rep(i, N)cin >> A[i];
    int count = 1;
    REP(i, N+2) {
        count = A[count-1];
        if (count == 2) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
}

Measured memory_bytes: 3764
//author:emre yazicioglu

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
#define fori(a,b,c) for(ll a = b;a < ll(c);a++)
#define ford(a,b,c) for(ll a = b;a >= ll(c);a--)
#define pb push_back

const int N = 2e6 + 7;
ll n,m,k,ans,cur;
ll sum,a,b,c,d;
string str;
vector<ll> v;
double ar[N];

int main(){

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

	// freopen("../in.txt","r",stdin);
	// freopen("../out.txt","w",stdout);
	
	cin >> n;
	fori(i,1,n + 1)
		cin >> ar[i];
	
	sort(ar + 1,ar + n + 1);

	double l = double((ar[1] + ar[2])/2.0);

	fori(i,3,n + 1)
		l = double((l + ar[i])/2.0);
	
	cout << double(l);

}

Measured memory_bytes: 256
import java.util.Scanner;
  
class Main{
  public static void main(String[] arg){
    
    Scanner in = new Scanner(System.in);

    String s = in.nextLine();
    String p = in.nextLine();

    String tmp = s + s.substring(0, p.length());

    if(tmp.indexOf(p) != -1)
        System.out.println("Yes");
    else
        System.out.println("No");

  }
}

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

struct Res {
    int num;
    string S;
    int P;

    // 演算子オーバーロードで比較関数を定義
    bool operator<(const Res& another) const {
        if (S != another.S)
        return S < another.S; // 高い順に並べたいので演算子を逆に
        if (P != another.P)
        return P > another.P; // 同様に比較演算子を反転
    }
};

int main(){
    int N;
    cin >> N;

    string S[N];
    int P[N];
    vector<Res > p(N);

    for(int i = 0; i < N; i++) {
        cin >> S[i] >> P[i];
        Res tmp = {i, S[i], P[i]};
        p[i] = tmp;
    }

    // firstが小さい順、secondが小さい順にソート
    sort(p.begin(), p.end());

    for (int i = 0; i < N; i++) {
        cout << p[i].num + 1 << endl;
    }
    

    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<functional>
#include<algorithm>
using namespace std;
int main(void)
{
	int r,b,w,g,sum;
	scanf("%d %d %d %d",&r,&b,&w,&g);
	sum=r+b+w+g;
	printf("%d\n",sum);
	return 0;
}


Measured memory_bytes: 2612
A,B=map(int, input().split())
S=input()
if '-' not in S:
  print('No')
  exit()
S_array=S.split('-')
if len(S_array) !=2:
  print('No')
  exit()
if len(S_array[0])==A and len(S_array[1])==B:
  print('Yes')
else:
  print('No')
        

Measured memory_bytes: 9176
import numpy as np

N, D = list(map(int, input().split()))
X = []
for i in range(N):
    x_i = [int(i) for i in input().split()]
    X.append(x_i)
X = np.array(X)

ans = 0
for i in range(N):
    for j in range(i + 1, N):
        if np.sqrt(np.sum((X[i] - X[j]) ** 2)).is_integer():
            ans += 1
print(ans)


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

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

const int N = 1e6+10 , mod = 1e9+7;

string s[N];
int dirx[] = {-1 , 0 , 1 , 0};
int diry[] = {0 , 1 , 0 , -1};
vector <int> dis[N] , go[N][4] , forw[N][4];
int n , m , k;
queue <pii> q;

bool in(int x , int y){
   if(x < 0 || x >= n || y < 0 || y >= m || s[x][y] == '@')
      return false;
   return true;
}

void dfs(int x , int y , int dir , int k , int d){
   if(d < dis[x][y]){
      dis[x][y] = d;
      q.push({x , y});
   }
   k = min(k , forw[x][dir][y]);
   int step = 1;
   if(go[x][dir][y] != -1)
      step += go[x][dir][y];
   go[x][dir][y] = max(go[x][dir][y] , k);
   if(in(x + dirx[dir] * step , y + diry[dir] * step) && step <= k)
      dfs(x + dirx[dir] * step , y + diry[dir] * step , dir , k - step , d);
}

void bfs(int stx , int sty){
   dis[stx][sty] = 0;
   q.push({stx , sty});
   while(q.size()){
      pii xx = q.front();
      q.pop();
      int x = xx.first , y = xx.second;
      for(int i = 0 ; i < 4 ; i++)
         dfs(x , y , i , k , dis[x][y] + 1);
   }
}

int32_t main(){
   ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
   cin >> n >> m >> k;
   int x , y , z , w;
   cin >> x >> y >> z >> w;
   x--; y--; z--; w--;
   for(int i = 0 ; i < n ; i++){
      cin >> s[i];
      for(int j = 0 ; j < m ; j++){
         dis[i].push_back(mod);
         for(int k = 0 ; k < 4 ; k++)
            go[i][k].push_back(-1);
      }
   }
   int f[n][4][m];
   for(int i = 0 ; i < n ; i++)
      for(int j = 0 ; j < m ; j++){
         if(s[i][j] == '@')
            f[i][0][j] = -1;
         else if(i == 0)
            f[i][0][j] = 0;
         else
            f[i][0][j] = f[i - 1][0][j] + 1;
      }
   for(int i = 0 ; i < n ; i++)
      for(int j = m - 1 ; j >= 0 ; j--){
         if(s[i][j] == '@')
            f[i][1][j] = -1;
         else if(j == m - 1)
            f[i][1][j] = 0;
         else
            f[i][1][j] = f[i][1][j + 1] + 1;
      }
   for(int i = n - 1 ; i >= 0 ; i--)
      for(int j = 0 ; j < m ; j++){
         if(s[i][j] == '@')
            f[i][2][j] = -1;
         else if(i == n - 1)
            f[i][2][j] = 0;
         else
            f[i][2][j] = f[i + 1][2][j] + 1;
      }
   for(int i = 0 ; i < n ; i++)
      for(int j = 0 ; j < m ; j++){
         if(s[i][j] == '@')
            f[i][3][j] = -1;
         else if(j == 0)
            f[i][3][j] = 0;
         else
            f[i][3][j] = f[i][3][j - 1] + 1;
      }
   for(int i = 0 ; i < n ; i++)
      for(int j = 0 ; j < 4 ; j++)
         for(int k = 0 ; k < m ; k++)
            forw[i][j].push_back(f[i][j][k]);
   bfs(x , y);
   if(dis[z][w] == mod)
      dis[z][w] = -1;
   cout << dis[z][w];
   return 0;
}


Measured memory_bytes: 304640
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  int h, w;
  while (cin >> h >> w, h) {
    vs s(h);
    rep(i, h) cin >> s[i];
    int x = 0;
    rep(i, h) rep(j, w) {
      int t = 0;
      fn<void(int, int, char)> f = [&](int i, int j, char c) {
        if (i < 0 || j < 0 || i >= h || j >= w || c == '-' || s[i][j] != c) return;
        s[i][j]  = '-';
        int di[] = {1, 0, -1, 0}, dj[] = {0, 1, 0, -1};
        rep(k, 4) f(i + di[k], j + dj[k], c);
      };
      x += s[i][j] != '-';
      f(i, j, s[i][j]);
    }
    cout << x << endl;
  }
}

Measured memory_bytes: 4884
A, B = map(int, input().split())

pmin = -(-A//0.08)
pmax = (A+1)//0.08

qmin = -(-B//0.1)
qmax = (B+1)//0.1

if pmax < qmin or qmax < pmin:
    print(-1)
else:
    if pmin < qmin:
        print(int(qmin))
    else:
        print(int(pmin))

Measured memory_bytes: 3060
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
 
public class Main {
    public static void main(String[] args) {
 
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = null;
 
        // エラトステネスの篩
        int MAX = 50000;
        boolean[] prime = new boolean[MAX + 1];
        Arrays.fill(prime, true);
        
        prime[0] = false; 
        prime[1] = false;
        for (int i = 2; i * i <= MAX; i++) {
            if (prime[i] == false)
                continue;
            for (int j = i * 2; j <= MAX; j += i)
                prime[j] = false;
        }
 
        try {
            while ((line = br.readLine()) != null) {
                line = line.trim();
                if (line.equals("0"))
                    break;
                int count = 0;
                int N = Integer.parseInt(line);
 
                for (int start = 1; start <= N / 2; start++) {
                    if (prime[start] == true && prime[N - start] == true)
                        count++;
                }
 
                System.out.println(count);
            }
            br.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Measured memory_bytes: 25960
// https://atcoder.jp/contests/abcXXX/tasks/abcXXX_x

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pll = pair<ll, ll>;

static const ll INF = 1001001001;
static const ll LLINF = 1001001001001001001;
static const ll MOD = (ll)1e9 + 7;
static const double EPS = 1e-9;

#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define RANGE(i, m, n) for(ll i = (m); i <= (n); ++i)
#define RRANGE(i, m, n) for(ll i = (m); i >= (n); --i)
#define POSITIVE(x) (x)=((x) < 0) ? 0 : (x)

int run(istream& in, ostream& out) {
    ll r;
    in >> r;
    ll ans = 3*r*r;

    out << ans << endl;
    return 0;
}

int main() {
    return run(cin, cout);
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cassert>
#include <algorithm>    
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cstring>
#include <cmath>
#include <bitset>
#define pb push_back
#define mk make_pair
#define eb emplace_back
#define eps 1e-8
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()

// #define int long long
using namespace std;

typedef long double ld;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef unsigned long long ull; 
typedef vector<int> vii;
typedef vector<long double> vd;
const int inf = 1e9;
const int M = 1e9 + 7;
//__int128

int d[505][505];
int a[505][505];

signed main()
{
  ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int n, m, q;
	cin >> n >> m >> q;
	for(int i = 0; i < m; ++i) {
		int x, y;
		cin >> x >> y;
		a[x][y]++;
	}  
	for(int i = 1; i <= n; ++i) {
		for(int j = 1; j <= n; ++j) {
			d[i][j] = d[i - 1][j] + d[i][j - 1] - d[i - 1][j - 1] + a[i][j];
		}
	}
	while(q--) {
		int x, y;
		cin >> x >> y;
		--x;
		cout << d[y][y] + d[x][x] - d[x][y] - d[y][x] << endl;
	}
	return 0;
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
#define pi 3.14159
using namespace std;

int main()
 {
 	int a,b;
	cin>>a>>b;
	if(b>a)
		cout<<(2*b)-1<<endl;
	else if (a==b)
		cout<<2*a<<endl;
	else 
		cout<<(2*a)-1<<endl;
 	
	return 0;
}
 	
 					

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
#define fs first
#define sc second
// 多倍長
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using boost::rational;
using boost::multiprecision::cpp_int;

const double PI = acos(-1);
const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;


vector<string> split(const string &s, char delim) {
    vector<string> elems;
    string item;
    for (char ch: s) {
        if (ch == delim) {
            if (!item.empty())
                elems.push_back(item);
            item.clear();
        }
        else {
            item += ch;
        }
    }
    if (!item.empty())
        elems.push_back(item);
    return elems;
}




int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int a,b;
    cin >> a >> b;
    string s;
    cin >> s;
    if((int)s.size() != a + b + 1){
      cout << "No" << endl;
      return 0;
    }else if(s[a] != '-'){
       cout << "No" << endl;
       return 0;
    } else if(count(s.begin(), s.end(), '-') != 1) {
      cout << "No" << endl;
       return 0;
    } else {
      cout << "Yes" << endl;
      return 0;
    }



}


Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
#define RI register int
int read() {
	int q=0;char ch=' ';
	while(ch<'0'||ch>'9') ch=getchar();
	while(ch>='0'&&ch<='9') q=q*10+ch-'0',ch=getchar();
	return q;
}
const int mod=1000000007,N=200005,bas=2000;
int n,ans;
int f[4005][4005],fac[8005],ni[8005],a[N],b[N];
int qm(int x) {return x>=mod?x-mod:x;}
int ksm(int x,int y) {
	int re=1;
	for(;y;y>>=1,x=1LL*x*x%mod) if(y&1) re=1LL*re*x%mod;
	return re;
}
int C(int d,int u) {return 1LL*fac[d]*ni[u]%mod*ni[d-u]%mod;}
int main()
{
	n=read();
	for(RI i=1;i<=n;++i)
		a[i]=read(),b[i]=read(),++f[bas-a[i]][bas-b[i]];
	fac[0]=1;for(RI i=1;i<=8000;++i) fac[i]=1LL*fac[i-1]*i%mod;
	ni[8000]=ksm(fac[8000],mod-2);
	for(RI i=7999;i>=0;--i) ni[i]=1LL*ni[i+1]*(i+1)%mod;
	for(RI i=0;i<=bas+bas;++i)
		for(RI j=0;j<=bas+bas;++j) {
			if(i!=0) f[i][j]=qm(f[i][j]+f[i-1][j]);
			if(j!=0) f[i][j]=qm(f[i][j]+f[i][j-1]);
		}
	for(RI i=1;i<=n;++i) ans=qm(ans+f[a[i]+bas][b[i]+bas]);
	for(RI i=1;i<=n;++i) ans=qm(ans+mod-C(a[i]+b[i]+a[i]+b[i],a[i]+a[i]));
	printf("%lld\n",1LL*ans*ksm(2,mod-2)%mod);
    return 0;
}

Measured memory_bytes: 64512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll a, b, c, d, s;
  in(s);
  d = s % 10;
  s = s / 10;
  c = s % 10;
  s = s / 10;
  b = s % 10;
  a = s / 10;
  if(a + b + c + d == 7){
    out(a);
    out('+');
    out(b);
    out('+');
    out(c);
    out('+');
    out(d);
    out("=7");
    memi;
    return 0;
  }
  if(a + b + c - d == 7){
    out(a);
    out('+');
    out(b);
    out('+');
    out(c);
    out('-');
    out(d);
    out("=7");
    memi;
    return 0;
  }
  if(a + b - c + d == 7){
    out(a);
    out('+');
    out(b);
    out('-');
    out(c);
    out('+');
    out(d);
    out("=7");
    memi;
    return 0;
  }
  if(a + b - c - d == 7){
    out(a);
    out('+');
    out(b);
    out('-');
    out(c);
    out('-');
    out(d);
    out("=7");
    memi;
    return 0;
  }
  if(a - b + c + d == 7){
    out(a);
    out('-');
    out(b);
    out('+');
    out(c);
    out('+');
    out(d);
    out("=7");
    memi;
    return 0;
  }
  if(a - b + c - d == 7){
    out(a);
    out('-');
    out(b);
    out('+');
    out(c);
    out('-');
    out(d);
    out("=7");
    memi;
    return 0;
  }
  if(a - b - c + d == 7){
    out(a);
    out('-');
    out(b);
    out('-');
    out(c);
    out('+');
    out(d);
    out("=7");
    memi;
    return 0;
  }
  if(a - b - c - d == 7){
    out(a);
    out('-');
    out(b);
    out('-');
    out(c);
    out('-');
    out(d);
    out("=7");
    memi;
    return 0;
  }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(void){
  int a, b, i, flag = 1;
  char str[12] = {};

  scanf("%d%*[^0123456789]%d", &a, &b);
  scanf("%s", str);

  if(a >= 1 && a <= 5 && b >= 1 && b <= 5 && strlen(str) == a + b + 1 && str[a] == '-'){
     for(i = 0; i < a + b + 1; i++){
       if(i == a){
         continue;
       }
       if(str[i] < '0' || str[i] > '9'){
         flag = 0;
         break;
       }
     }
  }
  else{
    flag = 0;
  }
  if(flag){
    puts("Yes");
    return 0;
  }
  puts("No");

  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k;
    cin>>n>>k;
    set<int>p;
    for(int i=1;i<=n;i+=2)
    {
        p.insert(i);
    }
    int x=p.size();
   int w=n-x;
   int v=max(x,w);
   if(v>=k)
   {
       cout<<"YES"<<endl;
   }
   else
   {
       cout<<"NO"<<endl;
   }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector> 
# include <cstdint>
#define FOR(i,l,r) for(int i=(l);i<(r);++i)
#define RFOR(i,l,r) for(int i=(l);i>=(int)(r);i--)
#define rep(i,n)  FOR(i,0,n)
#define rrep(i,n)  RFOR(i,n-1,0)

#define int long long
using namespace std;
const int MX = 1e6;
const int inf = 1e9;
const int mod = 1e9+7;

vector<int> fac(300001); //n!(mod M)
vector<int> ifac(300001); //k!^{M-2} (mod M)

long long fpow(long long a,long long n){
  long long ret=1;
  if(n==1) return a;
  if(n%2==0) {
      ret = fpow(a*a%mod, n/2) %mod ;
  }else {
      ret = (a%mod)*fpow(a*a%mod, n/2) %mod;
  }
  return ret %mod;
}
int comb(int a, int b){ //aCbをmod計算
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    int tmp = ifac[a-b]* ifac[b] % mod;
    return tmp * fac[a] % mod;
}
const int D = 60;
int to[D][MX];

signed main(){
    int n;
    cin >> n;
    vector<int> arr;
    int ans = 0;
    rep(i,n) {
        int a;
        cin >> a;
        while(a%2==0) {
            ans++;
            a/=2;
        }
    }
    cout << std::setprecision(15)<<ans << endl;

}

Measured memory_bytes: 4992
#include <stdio.h>
int main() {
	int n;
	scanf("%d", &n);
	long long int arr[n];
	for (int i = 0; i < n; i++)
	{
		scanf("%lld", &arr[i]);
		if (arr[i] == 0)
		{
			printf("0\n");
			return 0;
		}
	}
	long long int sum = 1;
	for (int i = 0; i < n; i++)
	{
		if (sum > 1000000000000000000/arr[i])
		{
			printf("-1\n");
			return 0;
		}
		sum *= arr[i];
	}
	printf("%lld\n", sum);
	return 0;
}

Measured memory_bytes: 2488
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	try {
    		final int CHECKED = 0;

    		int[][] a  = new int[3][3];
    		for (int i=0; i<3; i++) {
    			for (int j=0; j<3; j++) {
    				a[i][j] = sc.nextInt();
    			}
    		}
    		final int n = sc.nextInt();
    		final int[] b = new int[n];
    		for (int i=0; i<n; i++) {
    			b[i] = sc.nextInt();
    		}

    		for (int bi=0; bi<n; bi++) {
    			for (int ai=0; ai<3; ai++) {
    				for (int aj=0; aj<3; aj++) {
    					if (a[ai][aj] == b[bi]) {
    						a[ai][aj] = CHECKED;
    					}
    				}
    			}
    		}

    		if (   (a[0][0] == CHECKED && a[0][1] == CHECKED && a[0][2] == CHECKED)
    			|| (a[1][0] == CHECKED && a[1][1] == CHECKED && a[1][2] == CHECKED)
    			|| (a[2][0] == CHECKED && a[2][1] == CHECKED && a[2][2] == CHECKED)
    			|| (a[0][0] == CHECKED && a[1][0] == CHECKED && a[2][0] == CHECKED)
    			|| (a[0][1] == CHECKED && a[1][1] == CHECKED && a[2][1] == CHECKED)
    			|| (a[0][2] == CHECKED && a[1][2] == CHECKED && a[2][2] == CHECKED)
    			|| (a[0][0] == CHECKED && a[1][1] == CHECKED && a[2][2] == CHECKED)
    			|| (a[0][2] == CHECKED && a[1][1] == CHECKED && a[2][0] == CHECKED)
    				) {
    			System.out.println("Yes");
    		} else {
    			System.out.println("No");
    		}

    	} finally {
    		sc.close();
    	}
    }
}


Measured memory_bytes: 21712
A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(A[k-1])

Measured memory_bytes: 3060
#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long ans = 0;

  for(int i = 1; i <= n; i++) {
    if(i % 3 != 0 && i % 5 != 0) {
      ans += i;
    }
  }

  printf("%lld\n", ans);
  return 0;
}

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

plus = False
minus = False
ans = 0
for i in range(N-1):
    if not(plus) and not(minus):
        if A[i] < A[i+1]:
            plus = True
        elif A[i] > A[i+1]:
            minus = True

    else:
        if plus:
            if A[i] <= A[i+1]:
                continue
            else:
                ans += 1
                plus = False
        else:
            if A[i] >= A[i+1]:
                continue
            else:
                ans += 1
                minus = False
print(ans+1)


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

using namespace std;

short N;

struct Array{
	short a[10], d;
	Array(){}
	bool operator==(const Array &obj)const{
		for(short i = 0; i < N; i++){
			if(a[i] != obj.a[i]) return false;
		}
		return true;
	}
	bool operator<(const Array &obj)const{
		for(short i = 0; i < N; i++){
			if(a[i] < obj.a[i]) return true;
			if(a[i] > obj.a[i]) return false;
		}
		return d < obj.d;
	}
};

Array A, I;
vector<Array> vec, vec2;

void dfs(Array arr, short dep, vector<Array> &vec)
{
	vec.push_back(arr);
	if(dep == 4) return;
	
	Array tmp;
	for(short i = 0; i < N; i++){
		for(short j = 0; j < N; j++){
			if(i >= j) continue;
			for(short k = 0; k < N; k++) tmp.a[k] = arr.a[k];
			for(short k = i; k <= j; k++) tmp.a[k] = arr.a[j-(k-i)];
			tmp.d = arr.d + 1;
			dfs(tmp, dep+1, vec);
		}
	}
}

int main(void)
{
	cin >> N;
	for(short i = 0; i < N; i++) cin >> A.a[i];
	for(short i = 0; i < N; i++) I.a[i] = i+1;
	A.d = I.d = 0;
	
	dfs(A, 0, vec);
	dfs(I, 0, vec2);
	
	sort(vec.begin(), vec.end());
	vec.erase(unique(vec.begin(), vec.end()), vec.end());
	
	sort(vec2.begin(), vec2.end());
	vec2.erase(unique(vec2.begin(), vec2.end()), vec2.end());
	
	short ans = N-1;
	Array tmp;
	for(short i = 0; i < vec.size(); i++){
		tmp = vec[i]; tmp.d = 0;
		auto p = lower_bound(vec2.begin(), vec2.end(), tmp);
		if(*p == vec[i]){
			ans = min(ans, (short)(p->d + vec[i].d));
		}
		if(vec[i] == I) ans = min(ans, vec[i].d);
	}
	
	cout << ans << endl;
	
	return 0;
}


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

int main()
{
    int D;
    cin >> D;
    string ans = "Christmas";

    for (int i = 25; i > D; i--){
      ans = ans + " Eve";
    }
    
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
import math
a, b, h, m = map(int, input().split())
hun = m
ji = h*60 + hun
#print(hun)
#print(ji)
sita_do = ji*0.5 - hun*6
ans = a**2 + b**2 - 2*a*b*math.cos(math.radians(sita_do))
print(math.sqrt(ans))

Measured memory_bytes: 62324
// けんちょんさんのサイトわかりやすい
//　http://drken1215.hatenablog.com/entry/2019/03/09/224100
//
//　xor	の性質抑えよう
//

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

long long f(long long n)
{
    long long x = n&3;

    if(x == 0) return n;
    else if(x==1) return 1;
    else if(x==2) return n+1;
    return 0;

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll a,b;
    cin>>a>>b;
    cout<<(f(b)^f(a-1))<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#define rep(i,n) for (int i= 0;i<(n);++i)
using namespace std;
typedef long long ll;
int main()
{
    int n;
    cin >> n;
    vector<int64_t>hari(n);
    for(int i=0;i<n;i++)
         cin >> hari.at(i);
    sort(hari.begin(),hari.end(),greater());
    int64_t ans=hari.at(0);
    for(int i=1;i<n;i++){
         if(ans%hari.at(i)!=0){
            int64_t a=ans;
            while(ans%hari.at(i)!=0)
                ans+=a;
        }
  }
  cout << ans << endl;


    return 0;
}

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


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

  ll n = s.size();

  int ans = 0;
  rep(i,n){
    ans += s[i] -'0';
    ans %= 9;
  }

  if(!ans) cout << "Yes" << endl;
  else cout << "No" << endl;
  
}


Measured memory_bytes: 3760
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

#define MAX 1000000

bool p[MAX];

int main(){
  memset(p, 1, sizeof(p));
  p[0] = p[1] = 0;
  for(int i = 0 ; i < MAX ; i++){
    if(p[i]){
      for(int j = 2 * i ; j < MAX ; j+= i){
	p[j] = 0;
      }
    }
  }
 int n;
 
 while(cin >> n, n){
   int cnt = 0;
   for(int i = 0 ; i < n ; i++){
     for(int j = i ; j < n ; j++){
       if(p[i] && p[j]){
	 if(i + j == n){
	   cnt++;
	 }
       }
     }
   }
   cout << cnt << endl;
 }
 return 0;
}

Measured memory_bytes: 1844