akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(ll i = n;i >= 0;--i)
#define FOR(i,m,n) for(ll i = m, i##_len=(n);i <i##_len; ++i)
#define all(x) (x).begin(),(x).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; }
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll modinv(ll a, ll m) {ll b = m, u = 1, v = 0;while (b) {ll t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;}
const int INF = 1e9;
const ll LLINF = 1e16;

int main(void)
{
    ll k, a, b;
    cin >> k;
    cin >> a >> b;
    REP(i,1001){
        if(a <= i*k && i*k <= b){
            cout << "OK" << endl;
            return 0;
        }
    }
    cout << "NG" << endl;
    return 0;
}

Measured memory_bytes: 3596
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cctype>
#include<map>
#include<cstring>
#include<bitset>
#include<cassert>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,b) for (int (i)=a;(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long int;

const int inf = 1001001000;
const long long int Inf = 1001001001001001000;



void print(vector<vector<int>> a){
	for (int i = 0; i < a.size(); i++)
	{
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<vector<long long int>> a){
	for (int i=0;i<a.size();i++){
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(vector<long long int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(set<int> a){
	for (auto x:a)
		cout << x << " ";
	cout << endl;
}

//ワーシャルフロイト法のテンプレ.graphに最短経路が格納される.
//負の重みがある場合inf + const = inf に気を付けること.
//graphは隣接行列.
void WF(vector<vector<int>> &graph){
	int n = graph.size();
	for (int k = 0; k < n; k++){
		for (int i = 0; i < n; i++){
			for (int j = 0; j < n; j++){
				graph[i][j] = min(graph[i][j], graph[i][k] + graph[k][j]);
			}
		}
	}
}

//素因数分解をする関数.
map<long long int, int> prime_factorization(long long int a)
{
	map<long long int, int>ans;
	for (long long i = 2; i*i <= a; ++i) {
		while (a%i == 0) {
			ans[i]++;
			a /= i;
		}
	}
	if (a != 1)ans[a]++;
	return ans;
}

int main()
{
	int x;
	cin >> x;
	if (x < 1200)
		puts("ABC");
	else
		puts("ARC");

	return 0;
}

Measured memory_bytes: 3580
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<ll>;
using vll = vector<vector<ll>>;
using pii = pair<int,int>;
#define FOR(i,a,b) for(ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1000000007;
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int main(){
  int n,k;
  while(cin >> n >> k,n){
    vector<int> vec(n);
    REP(i,n) cin >> vec[i];
    int ans = 0;
    REP(i,k) ans += vec[i];
    int tmp = ans;
    FOR(i,k,n){
      tmp += vec[i];
      tmp -= vec[i-k];
      ans = max(ans,tmp);
    }
    cout << ans << endl;
  }
}


Measured memory_bytes: 3056
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <ratio>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <climits>
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back
#define in insert
#define vll vector<ll>
#define endl "\n"
#define pll pair<ll,ll>
#define f first
#define s second
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define int ll
#define sz(x) (ll)x.size()
#define all(x) (x.begin(),x.end())
using namespace std;

 
const ll INF = 1e12;
const ll N =(1e5+5); // TODO : change value as per problem
const ll MOD = 1e9+7;


void solve(){
	bitset<6> b;
	cin >> b;
	cout << b.count() << endl;	
}
signed main(){
 
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
     // freopen(".in","r",stdin);freopen(".out","w",stdout);
    
     ll tt=1;   
     // cin >> tt;
    while(tt--){    
        solve();
    }    
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int i,j=1,k,n,res=0;
	cin>>n;
	vector <int> arr;
	for(i=0;i<n;i++)
	{
		cin>>j;
		arr.push_back(j);
	}
	vector <int>::iterator ptr,qtr;
	for(ptr=arr.begin(),j=1;ptr!=arr.end();ptr++)
	{
		if(*ptr==j)
		{
			res++;
			j++;
		}
	} if(res==0)
	cout<<-1;
	else
	cout<<(n-res);
	
	return 0;
}


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

using namespace std;

typedef long long ll;

#define sz(x) int((x).size())

const int N=1e6+5,M=1e3+7,mod=1e9+7;

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

int a[N],b[N],n,m,k,tc,ans,d,x,y;

char s[N];

int main() {
    scanf("%s",s);
    n=strlen(s);
    for(int i=0;i<n/2;i++){
        if (s[i]!=s[n-i-1])
            ans++;
    }
    printf("%d\n",ans);
}



Measured memory_bytes: 256
fun main (args:Array<String>){
    val (_ , numOfBuyFruits)  = readLine()!!.split(" ").map(String::toInt)
    val valueList = readLine()!!.split(" ").map(String::toInt).sorted()
    val valuePoint  = valueList[numOfBuyFruits-1]
    var sumValue = 0
    var count = 0
    for (value in valueList) {
        if(value <= valuePoint){
            sumValue += value
            count++
            if(count == numOfBuyFruits) break
            else continue
        }
    }
    print(sumValue)
}

Measured memory_bytes: 40376
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <set>
#include <sstream>
using namespace std;
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
const int INF = 1001001001;
const ll MOD = 1e9+7;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){std::fill((T*)array, (T*)(array+N),val);}

class CompareDist
{
public:
    bool operator()(PLL n1,PLL n2) {
				if(n1.first!=n2.first) return n1.first<n2.first;
				else return n1.second<n2.second;
    }
};


__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

signed main(){
	int a,b,c; cin>>a>>b>>c;
  if(a+b+c>=22) return cout<<"bust"<<endl,0;
  cout <<"win" << endl;

  return 0;
}


Measured memory_bytes: 256
import * as fs from 'fs';

// main
function main(input: string[]) {
    // param
    var n: number = 0;
    var m: number = 0;
    var ans: number = 0;
    // init
    [n, m] = input.shift().split(" ").map(x => Number(x));
    // solve
    ans = n * (n - 1) / 2 + m * (m - 1) / 2
    // answer
    console.log(ans);
}
// entrypoint
function entrypoint() {
    try {
        // linux
        var input = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        console.debug = function () { };
        main(input);
    }
    catch (ex) {
        // windows
        const lines: string[] = [];
        // @ts-ignore
        const reader = require('readline').createInterface({
            // @ts-ignore
            input: process.stdin,
            // @ts-ignore
            output: process.stdout
        });
        reader.on('line', function (line: string) {
            lines.push(line);
        });
        reader.on('close', function () {
            input = lines;
            main(input);
        });
    }
}
entrypoint();


Measured memory_bytes: 29660
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()
k = []
ans = 0
for i in range(K):
  if T[i] == 's':
    ans += R
  elif T[i] == 'p':
    ans += S
  elif T[i] == 'r':
    ans += P
  k.append(T[i])
for i in range(K, N):
  if T[i] == 's':
    if k[0] != 's':
      ans += R
      k.pop(0)
      k.append('s')
    else:
      k.pop(0)
      k.append('0')
  elif T[i] == 'p':
    if k[0] != 'p':
      ans += S
      k.pop(0)
      k.append('p')
    else:
      k.pop(0)
      k.append('0')
  elif T[i] == 'r':
    if k[0] != 'r':
      ans += P
      k.pop(0)
      k.append('r')
    else:
      k.pop(0)
      k.append('0')
print(ans)

Measured memory_bytes: 4084
#include <stdio.h>
#include <string.h>

int main()
{
	int i;
	int num;
	int data[30];
	for(i=0; i<30; i++){
		data[i]=1;
	}
	for(i=0; i<28; i++){
		scanf("%d", &num);
		data[num-1]=0;
	}
	for(i=0; i<30; i++){
		if(data[i]){
			printf("%d\n", i+1);
		}
	}
	return 0;
}

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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
//#define int long long int
const int MOD = 1000000007;
const ll LINF = (ll)1e18 - 1;
const int INF = 1e9 - 1;
const double EPS = 0.000000001;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

void print(const vector<int> &v) {
  for(auto x : v) {
    cout << x << " ";
  }
  cout << endl;
}

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, q;
  cin >> n >> q;
  VL s(n), t(n), x(n);
  VL d(q);
  rep(i, n) cin >> s[i] >> t[i] >> x[i];
  rep(i, q) cin >> d[i];
  VL ans(q, -1);

  vector<tuple<ll, ll, ll>> event;
  set<ll> st;
  rep(i, n) {
    event.push_back(make_tuple(s[i] - x[i], 1, x[i]));
    event.push_back(make_tuple(t[i] - x[i], -1, x[i]));
  }
  sort(all(event));
  int id = 0;
  for(auto e : event) {
    if(id > q - 1) break;
    while(get<0>(e) > d[id]) {
      if(!st.empty()) ans[id] = *st.begin();
      id++;
      if(id > q - 1) break;
    }

    if(get<1>(e) == 1) {
      st.insert(get<2>(e));
    }
    else {
      st.erase(get<2>(e));
    }
  }
  for(auto an : ans) {
    out(an);
  }
  return 0;
}


Measured memory_bytes: 29288
#include<stdio.h>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<bitset>
#include<vector>
#include<math.h>
#define ls(x) (x<<1)
#define rs(x) ((x<<1)|1)
#define ll long long
using namespace std;
int main()
{
    int x1,x2,x3,x4,y1,y2,y3,y4;
    scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
    x3=x2-(y2-y1);
    y3=y2+(x2-x1);
    x4=x3-(y3-y2);
    y4=y3+(x3-x2);
    printf("%d %d %d %d",x3,y3,x4,y4);
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    public static bool f = false, t = true;
    static void Main(string[] args)
    {
        int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
        Console.WriteLine((a[2]-a[1])%2==0?"Alice":"Borys");
        Console.ReadLine();
    }
    public static long gcd(long a, long b)
    {
        while (true)
        {
            if (a == 0) { return b; }
            if (b == 0) { return a; }
            if (a > b) { a -= b; }
            else { b -= a; }
        }
    }
    public static long lcm(long a, long b) { return a / gcd(a, b) * b; }
    public static bool IsPrime(int num)
    {
        if (num < 2) return false;
        else if (num == 2) return true;
        else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

        double sqrtNum = Math.Sqrt(num);
        for (int i = 3; i <= sqrtNum; i += 2)
        {
            if (num % i == 0)
            {
                // 素数ではない
                return false;
            }
        }

        // 素数である
        return true;
    }
}
public static class Read
{
    public static void outl(string n = "") { Console.WriteLine(n); return; }
    public static long Long() { return long.Parse(Console.ReadLine()); }
    public static long[] longs() { return Console.ReadLine().Split().Select(long.Parse).ToArray(); }
    public static int Int() { return int.Parse(Console.ReadLine()); }
    public static int[] ints() { return Console.ReadLine().Split().Select(int.Parse).ToArray(); }
    public static string Str() { return Console.ReadLine(); }
    public static string[] Strs() { return Console.ReadLine().Split(); }
}

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

namespace ConsoleApp14
{
    class Class6
    {
        static void Main()
        {
            var I = Console.ReadLine().Split();
            int N = int.Parse(I[0]);
            int C = int.Parse(I[1]);
            int K = int.Parse(I[2]);
            SortedDictionary<int, int> Table = new SortedDictionary<int, int>();
            for(int i = 0; i < N; i++)
            {
                var read = int.Parse(Console.ReadLine());
                if (Table.ContainsKey(read)) Table[read]++;
                else Table[read] = 1;
            }
            int num=Table.Keys.First(),count=0, ans=0;
            foreach(int i in Table.Keys)
            {
                if (count == 0) num = i;
                if (i - num <= K)
                {
                    count += Table[i];
                    if (count >= C) { ans += count / C;count %= C; }

                }
                else
                {
                    count = 0;
                    ans++;
                    num = i;
                    count += Table[i];
                    if (count >= C) { ans += count / C;count %= C; }
                }
            }
            if (count > 0) ans++;
            Console.WriteLine(ans);
        }
    }
}


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

int main(){
    while(1){
        int m,f,r;
        cin>>m>>f>>r;
        if((m==-1)&&(f==-1)&&(r==-1)) break;
        if((m==-1)or(f==-1)){
            cout<<'F'<<endl;
        }else if((m+f)>=80){
            cout<<'A'<<endl;
        }else if((65<=(m+f))&&((m+f)<80)){
            cout<<'B'<<endl;
        }else if((50<=(m+f))&&((m+f)<65)){
            cout<<'C'<<endl;
        }else if((30<=(m+f))&&((m+f)<50)&&50<=r){
            cout<<'C'<<endl;
        }else if((30<=(m+f))&&((m+f)<50)&&50>r){
            cout<<'D'<<endl;
        }else if((m+f)<30){
            cout<<'F'<<endl;
        }
    }
}


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

using namespace std;

void rwFile() {
    freopen("INP.inp", "r", stdin);
    freopen("OUT.out", "w", stdout);
}

void solveA() {
    int m, n; cin >> m >> n;
    if (m == n) cout << "Yes";
    else cout << "No";
}

void solveB() {
    int a, b; cin >> a >> b;
    if (a > b) swap(a, b);
    for (int i = 0; i < b; i++) cout << a;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr); cout.tie(nullptr);
    //rwFile();
    solveB();
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int b[3]={0};
	int x=0,i;
	
	for(i=0;i<3;i++){
		scanf("%d",&b[i]);
	}
	
	x = 2*2*b[0]+2*b[1]+b[2];
	
	switch(x){
		case 6:
		case 1:
			printf("Open\n");
			break;
		default :
			printf("Close\n");
			break;
	}
	
	return(0);
}

Measured memory_bytes: 584
#include "bits/stdc++.h"
#define ALL(x) x.begin(), x.end()
#define LEN(x) (int)x.size()
#define iostreamBooster() do{ cin.tie(nullptr); ios_base::sync_with_stdio(false); }while(0)
using namespace std;
typedef int64_t i64;
typedef pair<int,int> pii;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
constexpr int INF = 0x3f3f3f3f;

signed main()
{
  int N, K;
  string s;

  cin >> N >> K;
  cin >> s;

  vector<int> d;
  vector<bool> f;

  int cnt = 1;
  for (int i = 1; i < N; ++i) {
    if (s[i] != s[i-1]) {
      d.push_back(cnt);
      f.push_back(s[i-1] - '0');
      cnt = 1;
    } else {
      ++cnt;
    }
  }
  d.push_back(cnt);
  f.push_back(s.back() - '0');

  // for (int i = 0; i < LEN(d); ++i) {
  //   printf("[%d] %2d %d\n", i+1, d[i], (int)f[i]);
  // }

  const int L = LEN(d);
  int ans = 0;

  int left = 0;
  int right = 0;
  int sum = 0;
  cnt = 0;
  for (left = 0; left < L; ++left) {
    while (right < L && (f[right] || (!f[right] && cnt < K))) {
      if (!f[right]) ++cnt;
      sum += d[right];
      ++right;
    }

    chmax(ans, sum);
    if (right == left) {
      ++right;
    } else {
      sum -= d[left];
      if (!f[left]) --cnt;
    }
  }

  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 1020
#include<iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int Max = 1000000;
int main(){
 	int N, M;
 	cin >> N >> M;
 	int a, b;
 	P bridge[M], bridge2[M];
 	for(int i=0;i<M;i++){
 		cin >> a >> b;
 		bridge[i] = make_pair(a, b);
 		bridge2[i] = make_pair(b, a);
 	} 	
 	sort(bridge, bridge+M);
 	sort(bridge2, bridge2+M);

 	int i = 0;
 	bool Isto[N+1], Isfrom[N+1];
 	for(int i=0;i<=N;i++){
 		Isto[i] = false;
 		Isfrom[i] = false;
 	}

 	while(bridge[i].first == 1){
 		Isto[bridge[i].second] = true;
 		i++;
 	}
 	i = M-1;
 	while(bridge2[i].first == N){
 		Isfrom[bridge2[i].second] = true;
 		i--;
 	}

 	for(int i=2;i<N;i++){
 		if(Isto[i] && Isfrom[i]){
 			cout << "POSSIBLE" <<endl;
 			return 0;
 		}
 	}
 	cout << "IMPOSSIBLE" <<endl;
    
  	return 0;
}





Measured memory_bytes: 3712
fn main() {
    let (N, K, Q) = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        let v: Vec<i32> = line.split_whitespace().map(|a| a.parse().unwrap()).collect();
        (v[0], v[1], v[2])
    };
    let mut points: Vec<i32> = Vec::new();
    for i in 0..N {
        points.push(0);
    }
    for i in 0..Q {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        let w = line.trim().parse::<usize>().unwrap();
        points[w - 1] += 1
    }
    for i in 0..N {
        if points[i as usize] <= Q - K {
            println!("No")
        } else {
            println!("Yes")
        }
    }
}


Measured memory_bytes: 4732
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define start_routine cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false); int begtime = clock();
#define end_routine int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0
#define PB push_back
#define MP make_pair
#define MOD (int)1e8
#define maxn (int)2e5+1
#define inf (int) 1e17
#define int long long
#define ll long long
#define vi vector<int> 
#define pii pair<int, int>
#define mii map<int, int> 
#define print(stuff) cout << stuff << endl
#define len(stuff) stuff.size()

signed main() {	
	start_routine;
	int x;
	cin >> x;

	if (x==1) {
		print(1);
		return 0;
	}
	vector<bool> isp(x+1, false);
	for (int i = 2; i <= x; i++) {
		for (int j = i*i; j <= x; j *= i) isp[j] = true;
	}
	
	int mx = 0;
	for (int i = 1; i <= x; i++) if (isp[i]) mx = i;

		cout << mx;
	end_routine;
}


Measured memory_bytes: 256
if __name__ == "__main__":
	W, H, x, y, r = input().split()
	W, H, x, y, r = int(W), int(H), int(x), int(y), int(r)
	
	if (x - r) < 0 or W < (x + r) or (y - r) < 0 or H < (y + r):
		print("No")
	else:
		print("Yes")

Measured memory_bytes: 6724
#include <iostream>
#include <string>
#include <stack>
#include <math.h>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <vector>

using namespace std;






int main()
{
	int n, w;
	int a[30], b[30],c[30];
	cin >> w;
	cin >> n;
	for (int i = 0; i < n; i++) {
		scanf("%d,%d", &a[i], &b[i]);
		
	}
	for (int i = 1; i <= w; i++) {
		c[i] = i;
	}
	for (int i = 0; i < n; i++) {
		swap(c[a[i]], c[b[i]]);
	}
	for (int i = 1; i <= w; i++) {
		cout << c[i] << endl;
	}
	

}

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

// int/long:            -2,147,483,648 - 2,147,483,647 (-2^31 <= int < 2^31)
// long/long long:      -9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

#define INF (1<<30)
//1,073,741,824
//= 536,870,912 *2

#define MOD 1000000007

#define Rep0(i, n)      for (auto i=0; i<n; i++)
#define Rep1(i, n)      for (auto i=1; i<=n; i++)
#define Sort(P) sort(P.begin(), P.end())
#define Rev(P)  reverse(P.begin(), P.end())

int     main() {
        int N, K;
        cin >>N >>K;
        vector<ll> A(N, 0);
        Rep0(i, N)
                cin >>A.at(i);
        Rep0(i, K) {
                vector<ll> AA(N+1, 0);
                Rep0(j, N) {
                        AA.at(max((ll)0, j-A.at(j)))++;
                        AA.at(min((ll)N, j+A.at(j)+1))--;
                }
                ll S=0;
                int C=0;
                Rep0(j, N) {
                        S+=AA.at(j);
                        if (S==A.at(j))
                                C++;
                        else
                                A.at(j)=S;
                }
                if (C==N)
                        break;
        }
        Rep0(i, N)
                cout <<A.at(i) <<' ';
        cout <<endl;
        return 0;
}

Measured memory_bytes: 6396
#include"bits/stdc++.h"
#define int long long
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define itr(i,x) for(auto i=(x).begin();i!=(x).end();++i)
#define All(x) (x).begin(),(x).end()
#define rAll(x) (x).rbegin(),(x).rend()
using namespace std;
typedef pair<int,int> P;
const int mod=1000000007;
int gcd(int x,int y){return y?gcd(y,x%y):x;}
int lcm(int x,int y){return x*y/gcd(x,y);}
void YN(bool flg){cout<<(flg?"YES":"NO")<<endl;}
void Yn(bool flg){cout<<(flg?"Yes":"No")<<endl;}
void yn(bool flg){cout<<(flg?"yes":"no")<<endl;}
signed main(){
	vector<string> s(2);
	rep(i,2) cin>>s[i];
	YN(s[0][0]==s[1][2]&&s[0][1]==s[1][1]&&s[0][2]==s[1][0]);
}


Measured memory_bytes: 256
((input) => {
  const [S, T] = input.trim().split('\n');
  const sl = S.length;
  const tl = T.length;
  let min = tl;

  for (let i = 0; i <= sl - tl; i++) {
    const target = S.slice(i, tl + i);
    let diff = 0;
    for (let j = 0; j < tl; j++) {
      if (target[j] !== T[j]) diff += 1;
    }
    if (min > diff) {
      min = diff;
    }
   }

  console.log(min);
})(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 32436
#include <bits/stdc++.h>
#define LL long long
#define PI pair<int,int>
#define PL pair<LL,LL>
#define st first
#define nd second
#define all(x) x.begin(),x.end()

using namespace std;

const int MX = 1e5 + 5;

int n,m;
priority_queue<int> pq;

int main(){
    cin >> n >> m;
    for(int i=0 ; i<n ; ++i){
        int x;
        cin >> x;
        pq.push(x);
    }
    while(m--){
        int x = pq.top();
        pq.pop();
        x /= 2;
        pq.push(x);
    }
    LL ans = 0;
    while(!pq.empty()){
        ans += 1ll * pq.top();
        pq.pop();
    }
    cout << ans << endl;
}  

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

int main()
{
    int N;
    cin >> N;
    ll A[N+1], B[N];
    for(int i = 0; i < N+1; ++i) cin >> A[i];
    for(int i = 0; i < N; ++i) cin >> B[i];

    ll cnt = 0;
    for(int i = 0; i < N; ++i) {
        if(A[i] <= B[i]) {
            cnt += A[i];
            B[i] -= A[i];
            A[i] = 0;
        }
        else {
            cnt += B[i];
            A[i] -= B[i];
            B[i] = 0;
        }

        if(A[i+1] <= B[i]) {
            cnt += A[i+1];
            B[i] -= A[i+1];
            A[i+1] = 0;
        }
        else { // A[i+1] > B[i]
            cnt += B[i];
            A[i+1] -= B[i];
            B[i] = 0;
        }
        
    }

    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 1792
N = int(input())
X, U = ['' for _ in range(N)], ['' for _ in range(N)]
for n in range(N):
    X[n], U[n] = input().split()

otoshidama = 0
for n in range(N):
    if U[n] == 'JPY':
        otoshidama += float(X[n])
    else:
        otoshidama += float(X[n])*380000.0

print(otoshidama)

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

using namespace std;

int main()
{
    int d; cin >> d;
    if (d == 25) {
        cout << "Christmas" << endl;
    } else if (d == 24) {
        cout << "Christmas Eve" << endl;
    } else if (d == 23) {
        cout << "Christmas Eve Eve" << endl;
    } else {
        cout << "Christmas Eve Eve Eve" << endl;
    }
}


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

int main() {
  int N, L; cin >> N >> L;
  int sum = 0, min_apple = L;
  for (int i = 0; i < N; i++) {
    sum += L + i;
    if (abs(L + i) < abs(min_apple))
      min_apple = L + i;
  }
  cout << sum - min_apple << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define tzcnt __builtin_ctzl
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bit(n) (1LL<<(n))

using namespace std;
typedef long long ll;
typedef __int128_t lll;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
template<typename T>string join(V<T>&v){stringstream s;FOR(i,0,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
void dout(double d){printf("%.12f\n",d);}
void YN(bool z){cout<<(z?"YES\n":"NO\n");}
void Yn(bool z){cout<<(z?"Yes\n":"No\n");}
void yn(bool z){cout<<(z?"yes\n":"no\n");}
mt19937 rnd; void set_rnd(){random_device r;rnd=mt19937(r());}
V<ll> fact, rfact; void set_fact(int n, ll m){fact.pb(1);rfact.pb(1);FOR(i,1,n+1)fact.pb(fact[i-1]*i%m),rfact.pb(modPow(fact[i],m,m-2));}
const int iinf = 1e9+6;
const ll linf = 1e18;
const int mod = 1e9+7;
const double pi = acos(-1);
const double eps = 1e-10;
const int N = 1e5;
string s;
int n;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> s;
  n = sz(s);
  if(s[n-1]=='1'||s[0]=='0'){
    cout << -1 << endl;
    return 0;
  }
  stringstream ans;
  int p = 1;
  FOR(i, 0, n-1){
    if(s[i] != s[n-i-2]){
      cout << -1 << endl;
      return 0;
    }
    ans << p << ' ' << i+2 << "\n";
    if(s[i] == '1') p = i+2;
  }
  cout << ans.str();
  return 0;
}

Measured memory_bytes: 3924
#include <stdio.h>
#include <stdlib.h>

long int a[100000][2];

void quick_sort(long int a[100000][2], int i, int j);
int partition(long int a[100000][2], int i, int j);

int main(void)
{
	
	int n, m;
	int i;
	long int sum = 0;
	long int money = 0;
	int count_i;
	
	scanf("%d%d", &n, &m);
	
	for(i = 0; i < n; i++) {
		scanf("%ld%ld", &a[i][0], &a[i][1]);
	}
	
	quick_sort(a, 0, n - 1);
	
	for(i = 0; i < n; i++) {
		sum += a[i][1];
		if(sum >= m) {
			count_i = i;
			break;
		}
	}
	
	sum = 0;
	
	for(i = 0; i < count_i; i++) {
		sum += a[i][1];
		money += a[i][0] * a[i][1];
	}
	
	money += a[count_i][0] * (m - sum);
	
	printf("%ld", money);
	
	return 0;
}

void quick_sort(long int a[100000][2], int i, int j)
{
	int k;
	
	if(i == j) {
		return;
	}
	
	if( (k = partition(a, i, j)) == -1) {
		return;
	}
	
	quick_sort(a, i, k - 1);
	quick_sort(a, k, j);
	
	return;
}

int partition(long int a[100000][2], int i, int j)
{
	int l = i, r = j;
	long int k;
	long int work;
	
	k = a[l][0];
	
	while(l <= r) {
		
		while(a[l][0] < k && l <= j) {
			l++;
		}
		
		while(a[r][0] > k && r >= i) {
			r--;
		}
		
		if(l > r) {
			break;
		}
		work = a[l][0];
		a[l][0] = a[r][0];
		a[r][0] = work;
		
		work = a[l][1];
		a[l][1] = a[r][1];
		a[r][1] = work;
		
		l++;
		r--;
		
	}
	
	return l;
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <vector>
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
#include <cmath>
#include <iomanip>
#include <ctype.h>

using namespace std;
using ll = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;

#define TR ","
#define fi first
#define se second
#define rep(i,N) for(ll i=0;i<(ll)N;++i)
#define repe(i,a,b) for(ll i=a;i<(ll)b;++i)
#define all(v) v.begin(), v.end()
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define INF 100000000

ll gcd(ll a, ll b) {
    if (a < b) swap(a, b);
    if (b == 0) return a;
    return gcd(b, a % b);
}

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

ll waz = 76543217;

ll inv(ll x) {
    if (x == 1) { return 1; }
    if (x == 0) { return 0; }
    else {
        ll a = (waz - inv(waz % x) * (waz / x)) % waz;
        if (a >= 0) { return a; }
        else { return waz + a; }
    }
}

void printVector(const vector<int>& vec) {
    for (int value : vec) {
        cout << value << " ";
    }
    cout << endl;
}

vector<ll> p;

ll phi(ll x) {
    ll a = x;
    ll b = x;
    for (ll k = 0; k != p.size(); ++k) {
        if (a % p[k] == 0) {
            while (a % p[k] == 0) {
                a /= p[k];
            }
            b = b / p[k] * (p[k] - 1);
        }
        if (a == 1) { break; }
    }
    return b;
}

bool my_compare(pair<string, int> a, pair<string, int> b) {
    if (a.first != b.first) {
        return a.first < b.first;
    }

    if (a.second != b.second) {
        return a.second > b.second;
    }
    else {
        return true;
    }
}

int main()
{
    IO;

    ll n; cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];

    sort(all(a));
    a.erase(unique(all(a)), a.end());

    rep(i, a.size() - 1) {
        cout << a[i] << " ";
    }
    cout << a[a.size() - 1] << endl;
}


Measured memory_bytes: 3612
#include <iostream>
#include <queue>

using namespace std;

typedef long long ll;

struct Square {
    int i,j;
    Square(){}
    Square(int i, int j) : i(i), j(j){}
};

int main()
{
    int H, W;
    char s[51][51];
    int memo[51][51] = {};

    cin >> H >> W;

    int blackNum = 0;
    for (int i = 1; i <= H; ++i)
    {
        for (int j = 1; j <= W; ++j)
        {
            cin >> s[i][j];
            if (s[i][j] == '#') ++blackNum;
        }
    }

    queue<struct Square> q;
    q.push(Square(1,1));
    memo[1][1] = 1;

    int dir[4][2]={{0,-1},{-1,0},{0,1},{1,0}};
    while (!q.empty())
    {
        struct Square cur = q.front();
        q.pop();

        int x = cur.i;
        int y = cur.j;

        for (int i = 0; i < 4; ++i)
        {
            int xx = x + dir[i][0];
            int yy = y + dir[i][1];
            if (xx < 1 || yy < 1 || xx > H || yy > W) continue;
            if (memo[xx][yy] == 0 && s[xx][yy] == '.')
            {
                memo[xx][yy] = memo[x][y] + 1;
                q.push(Square(xx,yy));
            }

        }
    }

    if (memo[H][W] == 0)
    {
        cout << -1 << endl;
        return 0;
    }

    cout << H*W - memo[H][W] - blackNum << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define dbg(x) cout<<#x<<"="<<x
#define nl cout<<"\n"
#define frn(i,n) for(int i = 0;i < n;i++)
#define fr(i,a,b) for(int i = a;i < b;i++)
#define pb push_back
#define trav(x,c) for(auto &x:c)
using namespace std;

int toint(string s) {
  int ans = 0;
  for(char x: s) ans = ans*10 + (x - '0');
  return ans;
}

int sum(int x) {
  int s = 0;
  while(x) {
    s += x%10;
    x /= 10;
  }
  return s;
} 

int main() {
  int n,k;
  cin>>n>>k;
  int ans = INT_MAX;
  frn(i,n+1) {
    ans = min(ans, (1<<i) + (n-i)*k);
  }
  cout<<ans;
}

Measured memory_bytes: 256
card = [list(map(int, input().split())) for i in range(3)]
N = int(input())
An = [int(input()) for i in range(N)]

bingo = [[0]*3 for _ in range(3)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if card[j][k] == An[i]:
                bingo[j][k] += 1

for i in range(3):
    if bingo[0][i] * bingo[1][i] * bingo[2][i] > 0:
        print('Yes')
        exit()
for i in range(3):
    if bingo[i][0] * bingo[i][1] * bingo[i][2] > 0:
        print('Yes')
        exit()
if bingo[0][0] * bingo[1][1] * bingo[2][2] > 0:
    print('Yes')
    exit()
if bingo[0][2] * bingo[1][1] * bingo[2][0] > 0:
    print('Yes')
    exit()
print('No')

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mp make_pair
#define pb push_back
#define mod 1000000007
#define dbg(n) cout<<#n<<' '<<n<<endl;
int power(ll x,ll y){ll res=1;while(y>0){if(y&1)res=(res*x)%mod;y=y>>1;x=(x*x)%mod;}return res;}
int main(){ 
	int t;
	cin>>t;
	map<int,int> mp;
	int a[200001];
	for(int i=0;i<t;i++){
		cin>>a[i];
		mp[a[i]]=i;
	}
	sort(a,a+t);
	int count=0;
	for(int i=0;i<t;i++){
		if(abs(mp[a[i]]-i)%2!=0){count++;}
	}	
	cout<<count/2<<endl;
}



Measured memory_bytes: 7424
package main

import (
	"fmt"
	"math"
)

func main() {
	// Code for B - Bishop
	var H, W int
	fmt.Scanf("%d %d", &H, &W)

	if H == 1 || W == 1 {
		fmt.Println("1")
	} else {
		A := (float64(H) / 2.0) * float64(W)
		fmt.Println(int(math.Ceil(A)))
	}
}


Measured memory_bytes: 1836
#include <stdio.h>
#include <stdlib.h>

#define WHITE 0
#define GRAY -1
#define BLACK 1
#define INF -1
#define MAX 100

int *u, *k, **v, *color, *d;
int *queue, head, tail;
int n, time;

void init() {
	int i, j;

	u = (int *)malloc(sizeof(int) * (n + 1));
	k = (int *)malloc(sizeof(int) * (n + 1));
	color = (int *)malloc(sizeof(int) * (n + 1));
	d = (int *)malloc(sizeof(int) * (n + 1));
	v = (int **)malloc(sizeof(int *) * (n + 1));
	queue = (int *)malloc(sizeof(int) * (n + 1));
}

void input() {
	int i, j;

	scanf("%d", &n);
	init();

	for (i = 1; i <= n; i++) {
		scanf("%d%d", &u[i], &k[i]);
		v[i] = (int *)malloc(sizeof(int) * (k[i] + 1));
		for (j = 1; j <= k[i]; j++) {
			scanf("%d", &v[i][j]);
		}
	}
}

void enqueue(int q) {
	if (tail > MAX) tail = 0;
	queue[tail++] = q;
}

int dequeue() {
	int x = queue[head];

	if (head == tail || head > tail) return x;
	else {
		if (head > MAX) {
			head = 0;
		}
	}
	return queue[head++];
}

void BFS(int s) {
	int i, u;

	for (i = 1; i <= n; i++) {
		color[i] = WHITE;
		d[i] = INF;
	}
	color[s] = GRAY;
	d[s] = 0;
	enqueue(s);

	while (head != tail) {
		u = dequeue();
		for (i = 1; i <= k[u]; i++) {
			if (color[v[u][i]] == WHITE) {
				color[v[u][i]] = GRAY;
				d[v[u][i]] = d[u] + 1;
				enqueue(v[u][i]);
			}
		}
		color[u] = BLACK;
	}
}

void output() {
	int i;

	for (i = 1; i <= n; i++) {
		printf("%d %d\n", u[i], d[i]);
		free(v[i]);
	}
	free(u);
	free(k);
	free(color);
	free(d);
	free(v);
	free(queue);
}

main () {
	input();
	BFS(u[1]);
	output();
	return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
#include <algorithm>
#include <string>
#include <iostream>
#include <cmath>
using namespace std;

int h[1000000];
int dp[1000000];

int cost(int x,int y){

      if(x==y)
        return 0;
      if(dp[x]!=-1)
        return dp[x];
      int c=abs(h[x]-h[x+1])+cost(x+1,y);
      if(x+2<=y)
        c= min(c,(cost(x+2,y)+abs(h[x+2]-h[x])));

        return  dp[x]=c;

    }


  int main(){

      int n;
      cin>>n;


      for(int i=1;i<=n;i++)
        cin>>h[i];


    memset(dp,-1,sizeof(dp));
    cout<<cost(1,n)<<endl;










  }














Measured memory_bytes: 14080
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
using namespace std;

int main() {
	int g, b;
	cin >> g >> g >> b;
	cout << ((g * 10 + b) % 4 == 0 ? "YES" : "NO");
}


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

using namespace std;

#define fastio cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(0)
typedef long long ll;
#define int ll
#define swap(x, y)((x)^=(y)^=(x)^=(y))
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> matrix;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define all(c) c.begin(),c.end()
#define mp make_pair
#define pb push_back
#define f first
#define tcase int _; cin>> _; for( ; _; --_)
#define s second
#define endl '\n'
const int MAX = 1e5+1;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1);
const double DEG = 180/PI;
const int MOD = 1e9+7;
int mod(int x, int m){ if(x >= 0) return x % m; if(-x < m) return m-(-x); return mod(x%m, m);}
int gcd (int a, int b) {while(b){a = mod(a, b); swap(a, b);} return a;}
int lcm (int a, int b) {return a / gcd(a, b) * b;}
int fexp(int base, int exp, int m){
	int total = 1;
	while(exp > 0){
		if(exp % 2 == 1){
			total = mod(((mod(total, m)) * (mod(base, m))), m);
			exp--;
		}
		base= mod((mod(base, m) * mod(base, m)), m);
		exp /= 2;
	}
	return mod(total, m);
}

int n;

void solve(){
	int mw;
	cin>> n>> mw;
	vi v(n), w(n);

	for(int i =0; i<n; ++i)
		cin>> w[i] >> v[i];

	int dp[2][MAX];
	// memset(dp, 0, sizeof(dp));
	for(int i = 1; i<MAX; ++i) dp[0][i] = INF;

	for(int i = 1; i<=n; ++i){
		bool s = i&1;
		for(int j = 0; j<MAX; ++j) dp[s][j] = INF;
		for(int j = 0; j<MAX; ++j){
			dp[s][j] = min(dp[s][j], dp[!s][j]);
			if(j - v[i-1] >= 0) dp[s][j] = min(dp[s][j], dp[!s][j - v[i-1]] + w[i-1]);
		}
	}
	int ans = 0;
	for(int i = 0; i<MAX; ++i) if(dp[n&1][i] <= mw) ans = i;
	cout << ans << endl;
}

int32_t main(){
	fastio;
	solve();
	return 0;
}


Measured memory_bytes: 5256
#include<stdio.h>
int main(void)
{
    double ans_h=0,ans_l=10000000,a,ans=0;

    while(scanf("%lf",&a)!=EOF){
        if(ans_h < a)ans_h = a;
        if(ans_l > a)ans_l = a;
    }
    ans = ans_h-ans_l;

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

Measured memory_bytes: 648
def problem():
    N = int(input())
    H = list(map(int, input().split()))
    print(algorithm(N,H))


def algorithm(N: int, H):
  currentMax = H[0]
  counter = 1
  for i in range(1, N):
    if currentMax <= H[i]:
      counter += 1
      currentMax = H[i]
    
  return counter

problem()

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

int main(){
  int N, K; cin >> N >> K;
  vector<int> H(N);
  rep(i, N) {
    cin >> H[i];
  }

  sort(H.rbegin(), H.rend());
  long long ans = 0;

  if(K >= N) cout << 0 << endl;
  else {
    for (int i = K; i < N; i++) {
      ans += H[i];
    }
    cout << ans << endl;
  }
}


Measured memory_bytes: 1024
#include <algorithm>     //sort,二分探索,など
#include <bitset>        //固定長bit集合
#include <cmath>         //pow,logなど
#include <complex>       //複素数
#include <deque>         //両端アクセスのキュー
#include <functional>    //sortのgreater
#include <iomanip>       //setprecision(浮動小数点の出力の誤差)
#include <iostream>      //入出力
#include <iterator>      //集合演算(積集合,和集合,差集合など)
#include <map>           //map(辞書)
#include <numeric>       //iota(整数列の生成),gcdとlcm(c++17)
#include <queue>         //キュー
#include <set>           //集合
#include <stack>         //スタック
#include <string>        //文字列
#include <unordered_map> //イテレータあるけど順序保持しないmap
#include <unordered_set> //イテレータあるけど順序保持しないset
#include <utility>       //pair
#include <vector>        //可変長配列

using namespace std;
typedef long long ll;

//マクロ
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#define ALL(x) (x).begin(), (x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size())      //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 1000000007    //10^9+7
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define MAXR 100000 //10^5:最大のrange(素数列挙などで使用)

// debug
#define DEBUG(x) cout << #x << ": " << x << endl
#define DEBUG2(x, y) cout << #x << ": " << x << " " << #y << ": " << y << endl
#define DEBUG_VEC(v)   \
  cout << #v << ":";   \
  REP(i, v.size())     \
  cout << " " << v[i]; \
  cout << endl
#define DEBUG_ARR(v, n) \
  cout << #v << ":";    \
  REP(i, n)             \
  cout << " " << v[i];  \
  cout << endl

ll X;
ll inf = 10e9 + 1;

ll solve(ll a)
{
  ll x = pow(a, 5) - X;
  if (x > 0)
  {
    ll l = 0;
    ll r = inf;
    while (r - l > 1)
    {
      ll m = (r + l) / 2;
      if (pow(m, 5) == x)
      {
        return m;
      }
      if (pow(m, 5) < x)
      {
        l = m;
      }
      else
      {
        r = m;
      }
    }
  }
  else
  {
    ll l = -inf;
    ll r = 0;
    while (r - l > 1)
    {
      ll m = (r + l) / 2;
      if (pow(m, 5) == x)
      {
        return m;
      }
      if (pow(m, 5) < x)
      {
        l = m;
      }
      else
      {
        r = m;
      }
    }
  }
  return inf;
}

signed main()
{
  cin >> X;

  ll A = 0;
  REP(a, 10e5)
  {
    ll b = solve(a);
    if (b != inf)
    {
      cout << a << " " << b << endl;
      break;
    }
  }
}


Measured memory_bytes: 4100
#include <bits/stdc++.h>
using namespace std;
int main() {
	int n,i,k,j;
	cin>>n>>k;
	int a[n+1];
	int dp[n+1];
	for(i=0;i<n;i++)
	{
	    cin>>a[i];
	    dp[i]=INT_MAX;
	}
	
	dp[0]=0;
	for(i=1;i<n;i++)
	{
	    for(j=i-1 ; j>=i-k && j>=0 ; j--)
	    {
	        dp[i]=min(abs(a[i]-a[j])+dp[j],dp[i]);
	    }
	}
	cout<<dp[n-1]<<"\n";
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <map>
#include <set>

using namespace std;

typedef long int lint;
typedef long long int llint;

#define INF 2147483647
#define LINF 92233720370000000000

int n;
int v[110000][3], dp[110000][3];

int main() {
    cin >> n;

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

    for (int i = 1; i <= n; i++) {
        for (int j = 0; j < 3; j++) {
            for (int k = 0; k < 3; k++) {
                if (j == k) continue;
                dp[i][j] = max(dp[i][j], dp[i - 1][k] + v[i][j]); 
            }
        }
    }

    int ans = 0;
    for (int i = 0; i < 3; i++) {
        ans = max(dp[n][i], ans);
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 2560
#include <stdio.h>
int main(){
    int N, Q;
    scanf("%d%d", &N, &Q);
    char S[N];
    int l[100000], r[100000], i;
    int A[100001]={0};
    scanf("%s", S);
    for(i=0;i<Q;i++){
        scanf("%d%d", &l[i], &r[i]);
    }
    for(i=0;i<N;i++){
        if( S[i-1]=='A' && S[i]=='C' ){
            A[i]++;
        }
        A[i] = A[i] + A[i-1];
    }
    for(i=0;i<Q;i++){
        printf("%d\n",A[ r[i]-1 ] - A[ l[i]-1 ]);
    }
    return 0;
}

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

int count = 0;

void printlist(int lst[], size_t len){
	for(size_t i = 0; i < len - 1; i ++){
		cout << lst[i] << " ";
	}
	cout << lst[len - 1] << endl;
}

void marge(int list[], size_t left, size_t mid, size_t right, size_t len){
	int i = 0;
	int j = 0;
	int k = 0;
	int n_1 = mid - left;
	int n_2 = right - mid;
	int B[right - left];

	while(i < n_1 && j < n_2){
		if(list[i + left] <= list[j + mid]){
			B[k] = list[i + left];
			i ++;
		}else{
			B[k] = list[j + mid];
			j ++;
		}
		k ++;
	}
	if(i == n_1){
		while(j < n_2){
			B[k] = list[j + mid];
			j ++;
			k ++;
		}
	}else{
		while(i < n_1){
			B[k] = list[i + left];
			i ++;
			k ++;
		}
	}
	count += k;

	for(size_t i = 0; i < right - left; i ++){
		list[left + i] = B[i];
	}
}

void margSort(int list[], size_t left, size_t right, size_t len){
	if(left +  1 < right){
		int mid((left + right) / 2);

		margSort(list, left, mid, len);
		margSort(list, mid, right, len);
		marge(list, left, mid, right, len);
	}
}

int main(int argc, char const *argv[])
{
	int N;
	cin >> N;
	int st[N];
	for (auto& i : st){
		cin >> i;
	}
	margSort(st, 0, sizeof(st) / sizeof(int), sizeof(st) / sizeof(int));
	printlist(st, sizeof(st) / sizeof(int));
	cout << count << endl;
	return 0;
}


Measured memory_bytes: 6932
#include <iostream>
#include <vector>
#include <cmath>
#include <cstring>

using namespace std;

int MAX;
vector<int> V;
vector<int> D;
int N;
int M;
bool dp[10][1000100] = {0};

void solve(int n) {
	memset(dp, 0, sizeof(dp));

	int ans = 1;

	for (int i=0; i<N && V[i]<=n; i++)
		dp[0][V[i]] = 1;

	for (int i=1; i<6 && !dp[i-1][n]; i++) {
		ans++;
		for (int j=0; j<=n; j++) {
			if (!dp[i-1][j]) continue;
			for (int k=0; k<N && j+V[k]<=n; k++)
				dp[i][j+V[k]] = 1;
		}
	}

	cout << ans << " ";

	memset(dp, 0, sizeof(dp));

	ans = 1;

	for (int i=0; i<M && D[i]<=n; i++)
		dp[0][D[i]] = 1;

	for (int i=1; i<=MAX && !dp[1-i%2][n]; i++) {
		ans++;
		for (int j=0; j<=n; j++)
			dp[i%2][j] = 0;
		for (int j=0; j<=n; j++) {
			if (!dp[1-i%2][j]) continue;
			for (int k=0; k<M && j+D[k]<=n; k++)
				dp[i%2][j+D[k]] = 1;
		}
	}

	cout << ans << endl;
}

int main() {
	MAX = (int)pow(10.0, 6);
	for (int i=1; i*(i+1)*(i+2)/6<=MAX; i++) {
		V.push_back(i*(i+1)*(i+2)/6);
		if ( V[i-1]%2==1 ) D.push_back(i*(i+1)*(i+2)/6);
	}
	N = (int)V.size();
	M = (int)D.size();

	int n;
	cin >> n;
	while (n!=0) { 
		solve(n);
		cin >> n;
	}
	return 0;
}

Measured memory_bytes: 10988
//26
#include<iostream>
#include<map>

#define S(X) ((X)*(X))

using namespace std;

double d[20][20];
double ans;
map<int,double> mm;

double dfs(int l,int r,int u){
  if(r==0){
    double cd=0;
    for(int i=0;i<20;i++){
      for(int j=i+1;j<20;j++){
	if((u&1<<i)&&(u&1<<j)){
	  cd+=d[i][j];
	}
      }
    }
    return cd;
  }else{
    double m=0;
    for(int i=r-1;i<l;i++){
      double c=dfs(i,r-1,u|1<<i);
      if(c>m){
	m=c;
      }
    }
    return m;
  }
}

int main(){
  int n,m;
  cin>>n>>m;
  double l[20],a[20],b[20];
  for(int i=0;i<n;i++){
    cin>>l[i]>>a[i]>>b[i];
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      d[i][j]=S(l[i]-l[j])+S(a[i]-a[j])+S(b[i]-b[j]);
    }
  }
  cout<<fixed<<dfs(n,m,0)<<endl;
  return 0;
}
  

Measured memory_bytes: 1296