akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
const int mod=1000000007;
const int mod1=998244353;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a,b;cin >> a >> b;
	if(a>12) cout << b << endl;
	else if(a>5) cout << b/2 << endl;
	else cout << 0 << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <vector> 
#include <algorithm>
#include <string>
#include <map>
using namespace std;

vector<string> bubbleSort(vector<string> v, int N){
    int flag = 1;
    int count = 0;

    while(flag) {

        flag = 0;
        for (int j = N - 1; j > 0; j--) {
            // cout << v.at(j).substr(1) << endl;
            int a;
            int b;
            istringstream(v.at(j).substr(1)) >> a;
            istringstream(v.at(j - 1).substr(1)) >> b;
            if(a < b) {
                swap(v.at(j), v.at(j - 1));

                flag = 1;

                count ++;
            }
        }
    }

    for (int k = 0; k < N; k++) {
        if(k == N - 1) {
            cout << v.at(k);
        } else {
            cout << v.at(k) << " ";
        }
    }

    cout << endl;

    return v;
}

vector<string> selectionSort(vector<string> v, int N) {
    int minj = 0;

    for (int i = 0; i < N; i++) {
        minj = i;

        for (int j = i; j < N; j++) {
            int a;
            int b;
            istringstream(v.at(j).substr(1)) >> a;
            istringstream(v.at(minj).substr(1)) >> b;
            if(a < b) {
                minj = j;
            }
        }

        if(i != minj) {
            swap(v.at(i), v.at(minj));
        }
        
    }

    for (int k = 0; k < N; k++) {
        if(k == N - 1) {
            cout << v.at(k);
        } else {
            cout << v.at(k) << " ";
        }
    }

    cout << endl;

    return v;
}

map<int, string> getDict(vector<string> v, int N) {
    map<int, string> tmpDict;

    for (int i = 0; i < N; i++) {
        char mark = v.at(i)[0];
        int index;
        istringstream(v.at(i).substr(1)) >> index;
        tmpDict[index] += mark;
    }

    return tmpDict;
}

void compare(map<int, string> a, map<int, string> b){
    for (int i = 0; i < a.size(); i++) {

        if(a[i] != b[i]) {
            cout << "Not stable" << endl;
            return;
        }
    }

    cout << "Stable" << endl;
    return;
}

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

    vector<string> vec(N);
    map<int, string> preSortCardDict;

    for (int i = 0; i < N; i++) {
        cin >> vec.at(i);

        char mark = vec.at(i)[0];
        int index;
        istringstream(vec.at(i).substr(1)) >> index;
        preSortCardDict[index] += mark;
    }

    // cout << preSortCardDict[4] << endl;

    vector<string> bubbleSortedVector = bubbleSort(vec, N);
    map<int, string> bubbleDict = getDict(bubbleSortedVector, N);

    compare(preSortCardDict, bubbleDict);

    vector<string> selectionSortedVector = selectionSort(vec, N);
    map<int, string> selectionDict = getDict(selectionSortedVector, N);
    compare(preSortCardDict, selectionDict);

    return 0;
}



Measured memory_bytes: 3192
#include<string>
#include<iostream>
#include <algorithm>
#include<vector>
#include<functional>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <numeric>
#include <math.h>
#define ll long long
#define PI 3.14159265358979323846
#define rep(i,n) for(ll i=0;i<(ll)n;i++)
using namespace std;

double deg2rad(double degree)
{
    return degree * PI / 180.0;
}


int main() {
    ll H1, M1, H2, M2, K;
    ll ans;
    cin >> H1 >> M1 >> H2 >> M2 >> K;
    ans = H2 * 60 + M2 - H1 * 60 - M1 - K;
    cout << ans << endl;

    return 0;

}


Measured memory_bytes: 3592
#include <iostream>
using namespace std;
int main(void){
    int n, t, b, ans = 0;
    cin >> n >> t;
    cin >> b;
    for(int i=1;i<n;i++){
        int a;
        cin >> a;
        if(b+t <= a){
            ans += t;
        }else{
            ans += a-b;
        }
        b = a;
    }
    cout << ans+t << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
int N; cin >> N;
string S; cin >> S;
int x =0, max=0;
for (int i = 0; i < N; i++)
{
    if(S[i]=='I') x++;
    if(S[i]=='D') x--;
    if(x>max) max =x; 
}
cout << max << endl;
return 0;
}


Measured memory_bytes: 384
#include <cstdio>
#include <algorithm>

int ans[200000];

int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 2; i <= n; ++i)
	{
		int a;
		scanf("%d", &a);
		ans[a - 1]++;
	}
	for (int i = 0; i < n; ++i)
	{
		printf("%d\n", ans[i]);
	}
	return 0;
}


Measured memory_bytes: 2456
#include<bits/stdc++.h>
using namespace std;
int k,la = 0;
string s,a[55555];
int main(){
	cin >> s >> k;
	int n = s.length();
	for(int l=1; l<=k; l++) {
	    for(int i=0; i+l<=n; i++) {
            a[la] = s.substr(i,l);
            la++;
        }
    }

	sort(a,a+la);
	unique(a,a+la);
	cout << a[k-1] << endl;
    
	return 0;
}


Measured memory_bytes: 1920
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
//using namespace boost::multiprecision;
typedef long long int ll;
typedef long double ld;
#define MOD 1000000007
#define ALL(obj) (obj).begin(),(obj).end()
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;}
const long long INF = 1LL << 60;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
bool pairCompareSecond(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.second < secondElof.second;
}
//四方向への移動ベクトル
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

struct edge{//グラフに使うヤツ
    ll from,to,cost;
};

typedef vector<vector<edge> > G;
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}

int main(){
    ll n;
    ll y=1000;
    cin >> n;
    ll a[n];
    vector<ll> x[n];
    for (ll i=0;i<n;i++){
        cin >> a[i];
    }
    ll f=a[0],c=0;
    for (ll i=0;i<n;i++){
        if (a[i]>=f){
            x[c].push_back(a[i]);
        }else{
            c++;
            x[c].push_back(a[i]);
        }
        f=a[i];
    }
    for (ll i=0;i<n;i++){
        if (x[i].size()){
            sort(ALL(x[i]));
            ll p=y/(x[i][0]);
            y-=p*(x[i][0]);
            y+=p*(x[i][x[i].size()-1]);
        }else{
            break;
        }
    }
    cout << y << endl;
    return 0;
}


Measured memory_bytes: 3632
N=int(input())
A=list(map(int,input().split()))
ans=1
mod=10**18
for i in A:
    if i==0:
        ans=0
        break
    elif i==1:
        continue
    elif ans!=-1:
        ans=ans*i
        if ans>mod:
            ans=-1
print(ans)

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

using namespace std;

#define pb push_back
#define sz(x) ((int)x.size())
#define sqr(x) ((x)*(x))
#define mem(a) memset(a,0,sizeof(a))
#define all(x) x.begin(),x.end()
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, int> pli;

const int mn = 3e5 + 5;
const int maxlog = 19;

int n;
int a[55];
int cnt[15];

int main() {
    //cin.sync_with_stdio(0);
#ifdef trote
    freopen("../1.txt", "r", stdin);
    freopen("../out.txt", "w", stdout);
#endif
    scanf("%d",&n);
    cnt[0]++;
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
        cnt[a[i]]++;
    }
    for(int i=0;i<=12;i++){
        if (cnt[i]>=3) {
            puts("0");
            return 0;
        }
    }
    sort(a+1,a+n+1);
    int ans=0;
    for(int i=0;i<(1<<12);i++){
        vector<int> v;
        for(int j=0;j<=12;j++){
            if (cnt[j]==2){
                v.pb(j);
                v.pb(24-j);
            }
            else if (cnt[j]==1){
                if ((1<<j)&i) v.pb(24-j);
                else v.pb(j);
            }
        }
        sort(all(v));
        v.pb(24);
        int uans=25;
        for(int i=1;i<sz(v);i++){
            uans=min(uans,v[i]-v[i-1]);
        }
        ans=max(ans,uans);
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define range(a) a.begin(), a.end()

using point = complex<double>;

point det(point a, point b, point c, point d) {
  return a * d - b * c;
}

point gaisin1(point a, point b, point c) {
  a -= c;
  b -= c;
  return det(a * conj(a), a, b * conj(b), b) / det(conj(a), a, conj(b), b) + c;
}

double det(double a, double b, double c, double d) {
  return a * d - b * c;
}

point gaisin2(point A, point B, point C) {
  A -= C;
  B -= C;
  double a = real(A), b = imag(A);
  double c = real(B), d = imag(B);
  double x = det((a*a + b*b) / 2, b, (c*c + d*d) / 2, d) / det(a, b, c, d);
  double y = det(a, (a*a + b*b) / 2, c, (c*c + d*d) / 2) / det(a, b, c, d);
  return point(x, y) + C;
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  int N; cin >> N;
  vector<point> P(N);
  rep(i, N) {
    int x, y; cin >> x >> y;
    P[i] = point(x, y);
  }
  auto f = [&](point p) {
    double res = 0;
    rep(i, N) {
      res = max(res, abs(P[i] - p));
    }
    return res;
  };
  double ans = 1e100;
  rep(i, N) rep(j, i) {
    ans = min(ans, f((P[i] + P[j]) / 2.0));
    rep(k, j) {
      ans = min(ans, f(gaisin2(P[i], P[j], P[k])));
    }
  }
  cout << ans << endl;
}

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

using namespace std;
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() //sortなどの引数を省略したい
#define SIZE(x) ll(x.size()) //sizeをsize_tからllに直しておく
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB emplace_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define Umap unordered_map
#define Uset unordered_set

int main(){
    ll n, d;
    cin >> n >> d;
    vector<ll> x(n), y(n);
    REP(i, n) cin >> x[i] >> y[i];
    ll ans = 0;
    d = d*d;
    REP(i, n) if(d >= x[i]*x[i] + y[i]*y[i]) ans++;
    cout << ans;
    return 0;
}

Measured memory_bytes: 6424
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static long Mod = (long)1e9 + 7;
        static void Main(string[] args)
        {
            SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            Out.Flush();
            Read();
        }
        static void Solve()
        {
            var w = ReadLine();
            var num = new long[26];
            foreach (var s in w)
                ++num[s - 'a'];
            if (num.Any(s => s % 2 != 0))
                WriteLine("No");
            else
                WriteLine("Yes");
        }
    }
}

Measured memory_bytes: 26068
def calc(N, button) : 
  count = 0
  position = 1
  next = button[1]
  flag = [False] * (10 ** 5 + 1)
  
  for i in range(1, N + 1) : 
    count += 1
    next = button[position]
    if next == 2 : 
      return count
    position = next
    if flag[position] == True : 
      return -1
    flag[position] = True
    
  return -1


N = int(input())

button = [0] * (10 ** 5 + 1)

for i in range(1, N + 1) : 
  button[i] = int(input())
  
print(calc(N, button))

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

using namespace std;

int main(void){
  int n;
  cin >> n;
  vector<pair<int, int>> e(100002), o(100002);
  for(int i = 0; i <= 100001; i++) e[i].second = o[i].second = i;
  for(int i = 0; i < n; i++){
    int v;
    cin >> v;
    if(i % 2 == 0) e[v].first++;
    else o[v].first++;
  }
  sort(e.rbegin(), e.rend());
  sort(o.rbegin(), o.rend());
  int ans = n;
  for(int i = 0; i < 2; i++){
    for(int j = 0; j < 2; j++){
      if(e[i].second == o[j].second) continue;
      ans = min(ans, n - e[i].first - o[j].first);
    }
  }
  cout << ans << endl;
  return 0;
}


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

int main()
{
	int a;
	while(cin>>a)
	{
		int b,s,S;
		b=sqrt(a);
		s=b*b;
		for(int i=b-1;i>1;i--)
		{
			for(int o=2;o<10;o++)
			{
				S=pow(i,o);
				if(S<=a&&S>s)
					s=S;
			}
		}
		cout<<s<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#define all(x) x.begin(), x.end()
#define ff first
#define ss second
#define MOD 998244353
using namespace std;

int main() {
	int n, k;
	cin >> n >> k;
	vector<pair<int, int>> v, tmp;
	for (int i = 0; i < k; i++) {
		int x, y;
		cin >> x >> y;
		tmp.push_back({x, y});
	}
	sort(all(tmp));
	int px = 0, py = 0;
	for (auto g : tmp) {
		if (g.ff <= py) {
			py = g.ss;
		}
		else {
			if (px != 0 && py != 0)
				v.push_back({px, py});
			px = g.ff;
			py = g.ss;
		}
	}
	v.push_back({px, py});
	vector<int> A(n + 1);
	A[1] = 1;
	A[2] = -1;
	for (int i = 1; i <= n; i++) {
		A[i] += A[i - 1];
		if (A[i] >= MOD) A[i] -= MOD;
		for (auto g : v) {
			if (i + g.ff <= n) {
				A[i + g.ff] += A[i];
				if (A[i + g.ff] >= MOD) A[i + g.ff] -= MOD;
			}
			if (i + g.ss + 1 <= n) {
				A[i + g.ss + 1] -= A[i];
				if (A[i + g.ss + 1] < 0) A[i + g.ss + 1] += MOD;
			}
		}	
	}
	cout << A[n];
}

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

using namespace std;

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

#define sz(a) int((a).size())
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define ini(a, i) memset(a, i, sizeof(a))
#define inin(a, n, i) memset(a, i, sizeof(a[0])*(n))
#define contains(c, i) ((c).find(i) != (c).end())
#define present(i, c) (find(all(c), i) != (c).end())

#define trav(x, c) for(auto &x : c)
#define rep(i, n) for(int i = 0; i < n; i++)
#define repa(i, b, e) for(int i = (b)-((b)>(e)); i != (e)-((b)>(e)); i += 1-2*((b)>(e)))
	
template<class T> bool chkmax(T &x, T y) { return x < y ? x = y, true : false; }
template<class T> bool chkmin(T &x, T y) { return x > y ? x = y, true : false; }
template<class A, class B> A cvt(B x) { stringstream s; s << x; A r; s >> r; return r; }

void read() {}
void print() {}
template<class T, class... Args> void read(T& a, Args&... args) { cin >> a; read(args...); }
template<class T, class... Args> void print(T a, Args... args) { cout << a << ' '; print(args...); }
template<class... Args> void println(Args... args) { print(args...); cout << endl; }

#define debug(args...) { string s_(#args); replace(all(s_), ',', ' '); stringstream ss_(s_); istream_iterator<string> it_(ss_); cerr_(it_, args); }
void cerr_(istream_iterator<string> it) { (void) it; }
template<class T, class... Args> void cerr_(istream_iterator<string> it, T a, Args... args) { cerr << *it << " = " << a << endl; cerr_(++it, args...); }

template<class T, class S>  ostream& operator<<(ostream& os, const pair<T, S>& p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<class T> ostream& operator<<(ostream &os, const set<T> &s) { os << '{'; string sep; for (const auto &x : s) os << sep << x, sep = ", "; return os << '}'; }
template<class T, class S> ostream& operator<<(ostream &os, const map<T, S> &m) { os << '{'; string sep; for (const auto &x : m) os << sep << x, sep = ", "; return os << '}'; }
template<class T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }

//=========================

void run_test() {
	int x; read(x);
	println((x >= 30 ? "Yes" : "No"));
}

//=========================

int main() {
	ios::sync_with_stdio(false); cin.tie(nullptr);
	//int t_ = 1, t__; cin >> t__; while(t_ <= t__) { cout << "Case #" << t_++ << ": "; run_test(); }
	// int t_; cin >> t_; while(t_--) run_test();
	run_test();
	return 0;	
}


Measured memory_bytes: 3636
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;
 
const ll nmax = 1e9 + 7;
const ll Mod = 998244353;
const double PI = 2 * asin(1);

int N;
int C[200001], index[200001];
ll DP[200001];

int Solve(){
  for (int i = 1; i < N; i++){
    DP[i] = DP[i - 1];
    if (index[C[i]] != -1 && index[C[i]] != i - 1){
      DP[i] += DP[index[C[i]]];
    }
    DP[i] %= nmax;
    index[C[i]] = i;
  }
  return 0;
}

int main(){
  cin >> N;
  for (int i = 0; i < N; i++) cin >> C[i];
  fill(index, index + 200001, -1);
  DP[0] = 1; index[C[0]] = 0;
  Solve();
  cout << DP[N - 1] << endl;
  
  return 0;
}

Measured memory_bytes: 3328
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define len(v) ll(v.size())
#define fi first
#define se second

template <class T>
void cout_vec(const vector<T> &vec){
  for(auto itr:vec) cout<<itr<<' ';
  cout<<endl;
}

typedef pair<ll,ll> P;
const ll mod=1e9+7;
const ll inf=1e15;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,k;
  cin>>n>>k;
  vector<ll> a(n);
  rep(i,n) cin>>a[i];
  ll ans=0;
  vector<ll> cnt1(n,0),cnt2(n,0);
  rep(i,n){
    rep(j,n){
      if(a[i]>a[j]){
        //cout<<a[i]<<' '<<a[j]<<endl
        if(i<j) cnt2[i]++;
        else cnt1[i]++;
      }
    }
  }
  //cout_vec(cnt1);
  //cout_vec(cnt2);
  rep(i,n){
    ll now1=(k*(k-1)/2)%mod;
    ll now2=(k*(k+1)/2)%mod;
    (ans+=(now1*cnt1[i])%mod)%=mod;
    (ans+=(now2*cnt2[i])%mod)%=mod;
  }
  cout<<ans<<endl;
}

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

struct Lamp {
  int L;
  int R;
  int U;
  int D;
};

inline int score(const Lamp& l) { return l.L + l.R + l.U + l.D - 3; }

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<string> ss(H);
  vector<vector<Lamp>> lamps;
  for(int h = 0; h < H; ++h) {
    cin >> ss[h];
    lamps.push_back(vector<Lamp>(W));
  }

  for(int h = 0; h < H; ++h) {
    int count = 0;
    for(int w = 0; w < W; ++w) {
      if(ss[h][w] == '.') {
        count++;
      } else {
        count = 0;
      }
      lamps[h][w].L = count;
    }
    count = 0;
    for(int w = W - 1; w >= 0; --w) {
      if(ss[h][w] == '.') {
        count++;
      } else {
        count = 0;
      }
      lamps[h][w].R = count;
    }
  }
  for(int w = 0; w < W; ++w) {
    int count = 0;
    for(int h = 0; h < H; ++h) {
      if(ss[h][w] == '.') {
        count++;
      } else {
        count = 0;
      }
      lamps[h][w].U = count;
    }
    count = 0;
    for(int h = H - 1; h >= 0; --h) {
      if(ss[h][w] == '.') {
        count++;
      } else {
        count = 0;
      }
      lamps[h][w].D = count;
    }
  }
  int ans = 0;
  for(int h = 0; h < H; ++h) {
    for(int w = 0; w < W; ++w) {
      chmax(ans, score(lamps[h][w]));
    }
  }
  cout << ans << endl;
  return 0;
}

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

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

  int cnt = 0;
  long long ans = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S.at(i) == 'B')
      cnt++;
    else
      ans += cnt;
  }

  cout << ans << endl;
}

Measured memory_bytes: 640
#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() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  int ans=0, active=0;
  rep(i,n) {
    if(active<a[i]) ans += a[i]-active;
    active=a[i];
  } 
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#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() {
  string N;
  cin >> N;
  int cnt = 0;
  rep(i, (int)N.size()) {
    cnt += N[i] - '0';
  }
  if (cnt % 9 == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

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

template<long long mod>
class ModInt {
public:
	long long v;
	ModInt(long long v = 0) : v((v % mod + mod) % mod) {}
	ModInt operator+(ModInt t) {return ModInt((v + t.v) % mod);}
	ModInt operator-(ModInt t) {return ModInt((v - t.v + mod) % mod);}
	ModInt operator*(ModInt t) {return ModInt((v * t.v) % mod);}
	ModInt operator+=(ModInt t) {return *this = *this + t;} 
	ModInt operator-=(ModInt t) {return *this = *this - t;}
	ModInt operator*=(ModInt t) {return *this = *this * t;}
	ModInt operator-() {return ModInt(-v);}
	ModInt mpow(long long t) {
		if (t == 0) return ModInt(1);
		ModInt a = mpow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}
	ModInt inv() {mpow(mod - 2);}
	ModInt operator/(ModInt t) {return ModInt(v) * inv();}
	ModInt operator/=(ModInt t) {return *this = *this / t;}
	ModInt operator==(ModInt t) {return *this.v == t.v;}
	ModInt operator!=(ModInt t) {return *this.v != t.v;}
	friend ostream& operator<<(ostream& os, const ModInt& mi) {
		os << mi.v;
		return os;
	}
};

int main() {
	
	string n;
	cin >> n;
	int d;
	cin >> d;
	
	int szN = n.size();

	using mint = ModInt<1000000007>;

	

	vector<vector<vector<mint>>> dp(10005, vector<vector<mint>>(2, vector<mint>(105, 0)));

	
	

	//for (int i = 0; i < d; i++) dp[0][0][i] = 1;
	dp[0][0][0] = 1;
	for (int i = 0; i < szN; i++) {
		int vl = (n[i] - '0');
		for (int smaller = 0; smaller < 2; smaller++) {
			for (int j = 0; j < d; j++) {
				for (int k = 0; k < (smaller ? 10 : vl + 1); k++) {
					dp[i + 1][smaller || k < vl][(j + k) % d] += dp[i][smaller][j];
				}
			}
		}
	}

	cout << dp[szN][1][0] + dp[szN][0][0] - 1 << endl;
	
	return 0;
}


Measured memory_bytes: 20792
#include <bits/stdc++.h>
using namespace std;;
#define ll long long
#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define INF 1<<30
#define LINF 1LL<<62
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define pb push_back
const int MOD = 1000000007;
 
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int num[4];
  REP(i,4){
      num[i] = 0;
  }
  REP(i,6){
      int tmp ; cin >> tmp;
      num[tmp-1]++;
  }
  bool ans = true;
  REP(i,4){
      if(num[i] == 3)ans = false;
  }
  if(ans){
      cout << "YES" << endl;
  }else{
      cout << "NO" << endl;
  }


}



Measured memory_bytes: 256
program test

integer(8) :: n,a(3000),b(3000),i,j,k,dp(0:3000,0:3000)=0,left,right,total,max_dp

read(*,*) n
read(*,*) (a(i),i=1,n)
do i=1,n
  b(i) = i
enddo

call heapsort_down(n,a(1:n),b(1:n))

! aが活発度、bが幼児の初期位置(x)
do total=1,n
  do left=0,total-1
    right=total-1-left    
    !左詰め
    dp(left+1,right) = max(dp(left+1,right),dp(left,right)+a(total)*abs(b(total)-(left+1)))
    !右詰め
    dp(left,right+1) = max(dp(left,right+1),dp(left,right)+a(total)*abs(b(total)-(n-right)))
  enddo
enddo

max_dp = 0
do left=0,n
  max_dp = max(max_dp,dp(left,n-left))
enddo

write(*,*) max_dp

contains
subroutine heapsort_down(n,y1,y2)

  implicit none
  integer(8),intent(in) :: n
  integer(8),intent(inout) :: y1(1:n)
  integer(8),intent(inout) :: y2(1:n)
  integer(8) :: i,k,j,l
  integer(8) :: t1,t2
  
  l = n/2+1
  k = n

  do while (k /= 1)
     if(l > 1) then
        l = l-1
        t1 = y1(l)
        t2 = y2(l)
        
     else
        t1 = y1(k)
        t2 = y2(k)
        y1(k) = y1(1)
        y2(k) = y2(1)
        k = k-1
        if(k == 1) then
           y1(1) = t1
           y2(1) = t2
           exit
        endif
     endif

     i = l
     j = l+l

     do while(j <= k)
        if(j < k) then
           if(y1(j) > y1(j+1)) j = j+1
        endif
        
        if (t1 > y1(j)) then
           y1(i) = y1(j)
           y2(i) = y2(j)
           i = j
           j = j+j
        else
           j = k+1
        endif
     
     enddo
     
     y1(i) = t1
     y2(i) = t2
  
  enddo
  return

end subroutine heapsort_down



end program

Measured memory_bytes: 26568
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9 + 7);

int main(void) {
	string s;
	int k;
	cin >> s >> k;
	
	int n = (int)s.size();
	set<string> st;
	
	for(int i = 0; i < n; ++i) {
		for(int j = 1; j <= k; ++j) {
			string sub = s.substr(i, j);
			st.insert(sub);
		}
	}
	
	int cnt = 0;
	for(auto& ss : st) {
		cnt++;
		
		if( cnt == k ) {
			cout << ss << endl;
			return 0;
		}
	}
	
	return 0;
}


Measured memory_bytes: 4732
#include <iostream>

int main( void )
{
    int s;
    std::cin >> s;
    const int sec = s % 60;
    s /= 60;
    const int min = s % 60;
    const int hour = s / 60;
    std::cout << hour << ":" << min << ":" << sec << std::endl;
    return 0;
}

Measured memory_bytes: 3080
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, n) for (int i = 1; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define put(x) cout << x << endl;
#define println(x) cout << x << endl;
template<typename T>bool mins(T& x,const T&y){if(x>y){x=y;return true;}else return false;}
template<typename T>bool maxs(T& x,const T&y){if(x<y){x=y;return true;}else return false;}
using namespace std;
signed main()
{
    int n;
    cin >> n;

    ll INF = 1e18;
    vector<ll> dp(n+1, INF);
    dp[0] = 0;
    for (ll j = 1; j * 1 <= n; j++) {
        mins(dp[j], j);
    }

    rep(i, n+1) {
        for (ll v = 6; i + v <= n; v *= 6) {
            mins(dp[i+v], dp[i] + 1);
        }
        for (ll v = 9; i + v <= n; v *= 9) {
            mins(dp[i+v], dp[i] + 1);
        }
    }

    ll res = dp[n];
    put(res);

    return 0;
}

Measured memory_bytes: 3860
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;
public class Main implements Runnable{

	int a,b;

	public void solve() {
		a = nextInt();
		b = nextInt();

		if(a < b){
			if(b-a > 360-b+a){
				double c = (a+360-b)*1.0/2;
				out.println((a-c+360)%360);
			}else{
				double c = (b-a)*1.0/2;
				out.println(a+c%360);
			}
		}else{
			if(a-b > 360-a+b){
				double c = (b+360-a)*1.0/2;
				out.println((a+c)%360);
			}else{
				double c = (a-b)*1.0/2;
				out.println((a-c+360)%360);
			}
		}
    }

    public static void main(String[] args) {
        new Thread(null,new Main(),"",64 * 1024 * 1024).start();
    }

    /* Input */
    private static final InputStream in = System.in;
    private static final PrintWriter out = new PrintWriter(System.out);
    private final byte[] buffer = new byte[2048];
    private int p = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (p < buflen)
            return true;
        p = 0;
        try {
            buflen = in.read(buffer);
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (buflen <= 0)
            return false;
        return true;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrint(buffer[p])) {
            p++;
        }
        return hasNextByte();
    }

    private boolean isPrint(int ch) {
        if (ch >= '!' && ch <= '~')
            return true;
        return false;
    }

    private int nextByte() {
        if (!hasNextByte())
            return -1;
        return buffer[p++];
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = -1;
        while (isPrint((b = nextByte()))) {
            sb.appendCodePoint(b);
        }
        return sb.toString();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }

    @Override
    public void run() {
        out.flush();
        new Main().solve();
        out.close();

    }
}

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

int main() {
  int64_t a,v,b,w,t;
  cin>>a>>v>>b>>w>>t;
  int64_t c=(v-w)*t;
  int64_t d=a-b;
  if(d<0){
    d*=(-1);
  }
  if(c>=d){
    cout<<"YES";
  }
  else{
    cout<<"NO";
  }
}

  

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))
#define sz(v) ((int) v.size())

using namespace std;

using i64 = long long;
using f80 = long double;
using vi32 = vector<int>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

void yes() { cout << "Yes" << endl; exit(0); }
void no() { cout << "No" << endl; exit(0); }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> void amax(T &x, T y) { x = max(x, y); }
template <typename T> void amin(T &x, T y) { x = min(x, y); }
template <typename T> T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

const int INF = 1001001001;
const int dx[] = {0, -1, 0, 1};
const int dy[] = {1, 0, -1, 0};

void solve() {
  int a, b;
  cin >> a >> b;
  reps(x, 10000) {
    int wa = x * 8 / 100;
    int wb = x * 10 / 100;
    if (wa == a && wb == b) {
      cout << x << endl;
      return;
    }
  }
  cout << -1 << endl;
}


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

int main(void){
   long long X,K,D;
   cin>>X>>K>>D;
   X=abs(X);
   if(K<=X/D){
      cout<<X-K*D<<endl;
   }else{
      long long temp=X/D;
      X=X-temp*D;
      K=K-temp;
      if(K%2==0) cout<<X<<endl;
      else cout<<abs(X-D)<<endl;
   }
   return 0;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;
using ll = long long;
using v1 = vector<int>;
using vl = vector<long long>;
using v2 = vector<vector<int>>;
using v3 = vector<vector<char>>;

bool judge = false;
int K;

void magic(int a, int b, int c, int kr){
	if(kr == K){
		if(c > b && b > a){
			judge = true;
			return;
		}else{
			return;
		}
	}
	kr++;
	rep(i, 3){
		if(i == 0){
			int na= a*2;
			magic(na, b, c, kr);
		}else if(i == 1){
			int nb = b*2;
			magic(a, nb, c, kr);
		}else if(i == 2){
			int nc = c*2;
			magic(a, b, nc, kr);
		}
	}
}

int main(){
	int a, b, c;
	cin >> a>> b >> c >> K;
	magic(a, b, c, 0);
	if(judge) cout << "Yes" << endl;
	else cout << "No" << endl;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF    	((ll)1ll<<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007ll)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI			3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s; a=0;} return os;}
void OUT(bool b){cout<<(b?"YES":"NO")<<endl;}
void Out(bool b){cout<<(b?"Yes":"No")<<endl;}
void out(bool b){cout<<(b?"yes":"no")<<endl;}
int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int clz(int x) { return 31 - __builtin_clz(x); }
int clz(ll x) { return 63 - __builtin_clzll(x); }
int ctz(int x) { return __builtin_ctz(x); }
int ctz(ll x) { return __builtin_ctzll(x); }

class compare {
public:
	bool operator()(tuple<ll, ll> a, tuple<ll, ll> b) {
		return (get<1>(a) > get<1>(b));
	}
};

void solve(){

}
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int h,w,n;
	ll cnt=0;
	char c;
	cin>>h>>w;
	int tx,ty;
	vvl vv(h+2,vl(w+2,-1));
	rep(i,h){
		rep(j,w){
			cin>>c;
			if(c!='#')vv[i+1][j+1]=INF;
			else cnt++;
		}
	}
	queue<pll> q;
	vv[1][1]=0;
	q.push(pll(1,1));
	while(!q.empty()){
		tie(tx,ty)=q.front();q.pop();
		rep(i,4){
			if(vv[tx+dx[i]][ty+dy[i]]==INF){
				vv[tx+dx[i]][ty+dy[i]]=vv[tx][ty]+1;
				q.push(pll(tx+dx[i],ty+dy[i]));
			}
		}
	}
	if(vv[h][w]==INF)cout<<-1<<endl;
	else cout<<(h*w-vv[h][w]-cnt-1)<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,n) for (int64_t i=0; i<(n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()
#define chmax(x,y) x=max(x,y)




int main(){
    int n,z,w;
    cin>>n>>z>>w;
    vector<int> p(n);
    rep(i,n) cin>>p[i];
    if(n==1){
        cout<<abs(p[0]-w)<<endl;
        return 0;
    }
    int en=p[n-1], enn;
    rep(i,n-1){
        enn=p[n-2-i];
        if(enn!=en) break;
    }
    if(enn==en){
        cout<<abs(w-en)<<endl;
        return 0;
    }else{
        if(abs(enn-en)>abs(en-w)){
            cout<<abs(enn-en)<<endl;
            return 0;
        }else{
            cout<<abs(en-w)<<endl;
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define r(i, n) for (int i=0;i<n;i++)
using namespace std;
int main() {
  int n;
  cin >> n;
  int b[n]={};
  r(i, n-1) cin >> b[i];
  int a=b[0]+b[n-2];
  for(int i=1; i<n-1; i++) {
    a+=min(b[i-1],b[i]);
  }
  cout << a <<endl;
  return 0;
}

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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



int n;
int dp[101010];
void solve(){
	cin >> n;
	
	fill(dp,dp+101010, INF);
	priority_queue<P,vector<P>,greater<P>> q;
	q.push({1,1});
	while(!q.empty()){
		P p = q.top(); q.pop();
		int c = p.first, a = p.second;
		a %= n;
		if(a == 0){
			cout << c << endl;
			break;
		}
		if(dp[a] <= c) continue;
		dp[a] = c;
		q.push({c,a*10});
		q.push({c+1,a+1});
		//cout << c << " " << a << endl;
	}
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}


Measured memory_bytes: 2804
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>
#include <stack>
#include <tuple>
#include <array>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)


typedef long long int ll;
typedef double D;      // ??§?¨?????????????double???long double?????????
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;


const int INF = (1<<30) - 1;
const D EPS = 1e-9;

#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)


//g++ -std=c++0x -msse4.2 -O3
//#include <bits/stdc++.h>
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(16);
    cout.setf(ios::fixed);
    
    double d; cin >> d;
    cout << max(int(d)+1.0, d * sqrt(2)) << endl;
    
    return 0;
}

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

typedef long long ll;
const int maxn = 2e5 + 5;
ll val[maxn], k;
ll n, p1, p2;
inline ll calc(long long a){
	ll ret = 0;
	if(a >= 0){
		for(int i=1;i<=n;i++){
			if(val[i] < 0){
				ll tmp = std::lower_bound(val, val+n+2, a/val[i]) - val;
				if(tmp >= i) continue;
				ret += (i - tmp);
			}
			else if(val[i] == 0){
				ret += i-1;
			}
			else{
				ll tmp = std::upper_bound(val, val+n+2, a/val[i]) - val - 1;
				ret += std::min(tmp, (ll)i-1);
			}
		}
	}
	else{
		for(int i=1;i<=n;i++){
			if(val[i] <= 0) continue;
			ll tmp = std::upper_bound(val, val+n+2, (a - val[i] + 1) / val[i]) - val;
			ret += tmp - 1;
		}
	}
	return ret;
}
int main(){
	scanf("%lld%lld",&n,&k);
	ll l = -1e18, r = 1e18;
	for(int i=1;i<=n;i++) scanf("%lld",&val[i]);
	val[0] = -1e18;
	val[n+1] = 1e18;
	p1 = std::lower_bound(val+1, val+n+1, 0) - val;
	p2 = std::upper_bound(val+1, val+n+1, 0) - val;
	std::sort(val+1, val+n+1);
	while(l != r){
		ll mid = (l + r) >> 1;
		if(calc(mid) >= k) r = mid;
		else l = mid + 1;
	}
	printf("%lld\n", l);
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
//#include <tuple>
#include <string>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long
#define pb push_back
using namespace std;

int n, k;

int main(){
	cin >> n >> k;


	if ((double)n / 2+n%2 >= (double)k) {
		cout << "YES\n";
		return 0;
	}
	else cout << "NO\n";
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <random>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

i64 s;

int main() {
    cin >> s;
    i64 x1 = 0, y1 = 0,
        x2 = 1e9, y2 = 1,
        x3 = x2 - s % x2, y3 = s / x2 + 1;
    if (s < 1e18) {
        printf("%lld %lld %lld %lld %lld %lld\n", x1, y1, x2, y2, x3, y3);
    } else {
        printf("0 0 1000000000 0 0 1000000000\n");
    }
    return 0;
}

Measured memory_bytes: 764
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <stdio.h>
#include <string>

using namespace std;

const long long MOD = 1e9 + 7;

static int N;
vector<map<string, long long>> memo;

bool ok(string last4) {
  for (int i = 0; i < 4; i++) {
    string t = last4;
    if (i >= 1) {
      t[i - 1] = last4[i];
      t[i] = last4[i - 1];
    }
    if (t.find("AGC") != string::npos) {
      return false;
    }
  }
  return true;
}

long long dfs(int cur, string last3) {
  if (memo[cur].find(last3) != memo[cur].end()) {
    return memo[cur][last3];
  }
  if (cur == N) {
    return 1;
  }
  long long ret = 0;
  for (string c : {"A", "C", "G", "T"}) {
    if (ok(last3 + c)) {
      ret = (ret + dfs(cur + 1, last3.substr(1, 2) + c)) % MOD;
    }
  }
  memo[cur][last3] = ret;
  return ret;
}

void solve(int N) {
  long long ans = dfs(0, "TTT");
  printf("%lld\n", ans);
}

int main() {
  cin >> N;
  memo.resize(N + 1);
  solve(N);
  return 0;
}

Measured memory_bytes: 768
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(a) (a).size() 
#define rep(i,n) for(int i=0;i<n;i++)
#define ford(i,a,n) for(int i=a;i<n;i++)
#define fors(i,s) for(int i=0;i<s.size();i++)
#define foreach(c,itr) for(__typeof((c).begin(),(c).end())itr=c.begin();itr!=c.end();itr++) 
#define fill(a,b) memset(a,b,sizeof(a))
#define INF 1e9
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef vector<int> vi;
int main(){
	int n,k,q;
	cin>>n>>k>>q;
	int a[q];
	int cnt[n];
	fill(cnt,0);
	rep(i,q){
		cin>>a[i];
		cnt[a[i]-1]++;
	}
	rep(i,n){
		if(k-q+cnt[i]<=0){
			cout<<"No"<<endl;
		}
		else{
			cout<<"Yes"<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1408
#include "bits/stdc++.h"
using namespace std;
 
////////////// Prewritten code follows. Look down for solution. ////////////////
 
#define fs first
#define sc second
#define pb push_back
#define mp(a, b) make_pair(a, b)
#define len(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
 
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
typedef pair<ll, ll> pll;
 
template<typename T>
const T INF = (is_same<T, int>::value ? 1e9 : 1e18);
template<typename T>
inline T mod(T n, T mod){ T res = n%mod; if(res < 0) res += mod; return res; }
 
/// command for char arrays with spaces -> scanf(" %[^\n]", text);
 
////////////////////////// Solution starts below. //////////////////////////////
 
int main(){
	fastio;
	int n, m;
	cin >> n >> m;
	vvi adj(n+1, vi()), vis(n+1, vi(4, 0));;	
	while(m--){
		int a, b;
		cin >> a >> b;
		adj[a].pb(b);
	}
	int s, t;
	cin >> s >> t;
	function<int(int)> bfs = [&](int sc){
		queue<pii> q;
		q.push({sc, 0}); 
		while(!q.empty()){
			int v = q.front().fs;
			int d = q.front().sc;
			q.pop();
			if(vis[v][d%3]) continue;
			vis[v][d%3] = 1;
			if(v == t and d%3 == 0) return d/3;
			for(int u : adj[v]){
				q.push({u, d+1});
			}
		}
		return -1;
	};
	cout << bfs(s) << endl;
	return 0;
}

Measured memory_bytes: 11264
n,m,x,y=map(int,input().split())
xlist=[int(i) for i in input().split()]
ylist=[int(i) for i in input().split()]
xlist.append(x)
ylist.append(y)

if x<y and max(xlist)<min(ylist):
    print("No War")
else:
    print("War")

Measured memory_bytes: 3060
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")
 
#include <x86intrin.h>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <assert.h>
#include <string>
#include <bitset> 
#include <vector>
#include <cmath>                                    
#include <deque>                                    
#include <queue>
#include <iomanip>
#include <stack>
#include <map>
#include <random>
#include <ctime>
#include <unordered_map>
#include <set>
#include <unordered_set>
//#include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
 
//using namespace __gnu_pbds;
using namespace std;

 
//template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
     
#define F first
#define S second           
#define lb lower_bound               
#define ub upper_bound
#define pb push_back
#define pf push_front    
#define ppb pop_back
#define mp make_pair                                     
#define bpp __builtin_popcountll                                                                                        
#define sqr(x) ((x) * (x)) 
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define in insert
#define ppf pop_front
#define endl '\n'
//#define int long long
 
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
 
const int mod = (int)1e9 + 7;
const int N = (int)3e5 + 123;
const ll inf = (ll)1e18 + 1;
 
const double pi = acos (-1.0);
const double eps = 1e-9;                  
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};

int mx, cur;
string s;

inline void boost () {
   ios_base :: sync_with_stdio (0);
   cin.tie (0), cout.tie (0);
}
 
inline void Solve () {
   cin >> s;
   for (int i = 0; i < sz (s); i ++) {
      if (s[i] == 'S') {
         mx = max (mx, cur);
         cur = 0;
      }
      else cur ++;
   }
   mx = max (mx, cur);
   cout << mx;
}               
 
signed main () {                                       
  // #ifdef QWERTY
   //   freopen("input", "r", stdin);
   //#endif
  // freopen (".in", "r", stdin);    
  // freopen (".out", "w", stdout);              
   boost ();
   int tt = 1;
   
   //cin >> tt;   
   while (tt --) {
      Solve ();
   }                                               
   return 0;      
}                   

Measured memory_bytes: 3636