akhauriyash/Code-Regression huggingface dataset:
#include <iostream>

using namespace std;

int main()
{
  int n,m1,m2,m3,m4 = 0; 
  cin >> n;

  m1 = n / 1000;
  m2 = (n - 1000*m1) / 100;
  m3 = (n - 1000*m1 - 100*m2) / 10;
  m4 = n - 1000*m1 - 100*m2 -10*m3;
    
  if (((m1 == m2) && (m1 == m3)) || ((m2 == m3) && (m2 == m4))){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  } 
}

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

int main() {
    ll H, W; cin >> H >> W;
    if (H == 1 || W == 1) {
        cout << 1 << endl;
    } else if (H % 2 == 0) {
        cout << H / 2 * W << endl;
    } else if (W % 2 == 0) {
        cout << W / 2 * H << endl;
    } else {
        cout << (H + 1) / 2 * (W + 1) / 2 + (H - 1) / 2 * (W - 1) / 2 << endl;
    }
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;
 
class Main {
	public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    String[] nums = str.split("");
    int min = 1000;
    int best = 753;
    for (int i = 0; i + 2 < str.length(); i++) {
      String num = nums[i] + nums[i+1] + nums[i+2];
      int diff = Math.abs(best - Integer.parseInt(num));
      if (diff < min) min = diff; 
      if (min == 0) break;
    }
    System.out.print(min);
	}
}

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

// io
#define get(i) scanf("%d", &i)
#define flush fflush(stdin)

// manipulations
#define f(i, n) for (int i = 0; i < n; i++)
#define fr(i, n) for (int i = n - 1; i >= 0; i--)
#define ff(i, a, b) for (int i = a; i <= b; i++)
#define lowbit(x) (x & -x)
#define sz(x) int((x).size())

// built-in
#define bitcount __builtin_popcount
#define gcd __gcd

// short
#define pb push_back
#define fill(arr, a) memset(arr, a, sizeof(arr))

// useful bits
#define IN(i, l, r) (l <= i && i <= r)
#define relax(a, b) (a) = max((a), (b))
#define relaxi(a, b) (a) = min((a), (b))

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll,ll>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

ll modpow(ll a, ll b, ll mod = (ll) (1e9 + 7)) 
{if (!b) return 1; a %= mod; return modpow(a * a % mod, b / 2, mod) * (b & 1 ? a : 1) % mod;}

// for rand
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// use uniform_int_distribution<int>(0, i)(rng)

const int DEBUG = 1;
const int mxn = 5e5, mxm = 1<<20, mod = 1e9+7;
int n, z;
int a[mxn], lazy[mxm];
ll dp[mxm][2];

void add(ll &a, ll b) {
	a+=b; if (a>=mod) a-=mod;
}

void update(int i) {
  	add(dp[i][0], (z-lazy[i])*dp[i][1]%mod);
	lazy[i] = z;
}

void solve() {
	scanf("%d",&n);
  	for (int i = 0; i < mxm; i++)
    	for (int j = 0; j < 2; j++)
    		dp[i][j]=!j,lazy[i]=lazy[i]=0;
  	ll ans = 0; z = 0;
 	for (int i = 0; i < n; i++) {
    	scanf("%d",&a[i]);
    	if (i) a[i] ^= a[i-1];
      	if (i == n-1) {
        	if (a[i] == 0) {
              	for (int x = 1; x < mxm; x++) {
                	update(x); add(ans,dp[x][1]); 
                }
              	add(ans,modpow(2,z));
            } else {
            	update(a[i]);
              	ans = dp[a[i]][0];
            }
        }
		if (a[i]==0) z++;
      	update(a[i]);
      	add(dp[a[i]][1],dp[a[i]][0]);
    }
  	cout << ans << endl;	
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);


#ifdef LOCAL
	if (DEBUG) freopen("input.txt", "r", stdin);
	if (DEBUG) freopen("output.txt", "w", stdout);
	clock_t start = clock();
#endif

	solve();

#ifdef LOCAL
	cout << setprecision(12) << ld(clock()-start) / CLOCKS_PER_SEC << endl;
#endif

	return 0;
}


Measured memory_bytes: 22656
N, M = map(int, input().split())
As = [int(input()) for _ in range(M)]+[0]
mod = 10**9 +7
dp = [0]*(N+1)
dp[0] = 1
j = 0
if As[j] != 1:
    dp[1] = 1
else:
    j += 1
for i in range(2, N+1):
    if i == As[j]:
        j += 1
        continue
    dp[i] = (dp[i-1]+dp[i-2])%mod
print(dp[N]%mod)



Measured memory_bytes: 51800
from itertools import accumulate

def solve():
	n, X, *x = map(int, open(0).read().split())
	acc = [0] + list(accumulate(x))
	ans = 1 << 60
	for div in range(1, n + 1):
		cost = 0
		phase = 1
		i = n
		while i > 0 and cost < ans:
			cost += (acc[i] - acc[max(i - div, 0)]) * max(5, 2 * phase + 1)
			i -= div
			phase += 1
		cost += (div + n) * X
		if cost < ans:
			ans = cost
	print(ans)

if __name__ == "__main__":
	solve()

Measured memory_bytes: 99148
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
using namespace std;
typedef long long ll;
ll MOD = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)
int main() {
    int n, h, w;
    cin >> n >> h >> w;
    cout << ( n - h + 1 ) * ( n - w + 1 ) << endl;
    return 0;
}


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

int main(){
  int H, W; cin >> H >> W;
  vector<vector<char>> S(H, vector<char>(W));
  for (int i=0; i<H; i++){
    for (int j=0; j<W; j++){
      cin >> S[i][j];
    }
  }
  int score = 0;
  for (int i=0; i<H; i++){
    for (int j=0; j<W; j++){
      if (S[i][j]=='#') continue;
      vector<vector<int>> dist(H, vector<int>(W,-1));
      dist[i][j] = 0;
      queue<pair<int,int>> que;
      que.push(make_pair(i,j));
      while(!que.empty()){
        pair<int, int> p = que.front();
        que.pop();
        int x=p.first, y=p.second;
        score = max(score, dist[x][y]);
        if (x+1<H&&S[x+1][y]=='.'&&dist[x+1][y]==-1){
          dist[x+1][y] = dist[x][y] + 1;
          que.push(make_pair(x+1,y));
        }
        if (0<=x-1&&S[x-1][y]=='.'&&dist[x-1][y]==-1){
          dist[x-1][y] = dist[x][y] + 1;
          que.push(make_pair(x-1,y));
        }
        if (y+1<W&&S[x][y+1]=='.'&&dist[x][y+1]==-1){
          dist[x][y+1] = dist[x][y] + 1;
          que.push(make_pair(x,y+1));
        }
        if (0<=y-1&&S[x][y-1]=='.'&&dist[x][y-1]==-1){
          dist[x][y-1] = dist[x][y] + 1;
          que.push(make_pair(x,y-1));
        }
      }
    }
  }
  cout << score << endl;
}


Measured memory_bytes: 256
import java.util.*;
class Main
{
    public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] h = new int[n];
        for(int i = 0; i < n; i++){
            h[i] = sc.nextInt();
        }
        int[] a = new int[n];
        a[0] = 0; a[1] = Math.abs(h[1] - h[0]);
        for(int i = 2; i < n; i++){
            a[i] = Integer.MAX_VALUE;
            for(int j = 1; j <= Math.min(i , k); j++){
                a[i] = Math.min(a[i], a[i-j] + Math.abs(h[i] - h[i - j]));
            }
        }
        System.out.println(a[n-1]);
    }
}

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

const int MAXN = 3e5 + 5;

int n, a[MAXN], ans[MAXN];
vector<int> f;

int main(){
	scanf("%d", &n);
	for(int i = 1; i <= n; ++i){
		scanf("%d", &a[i]);
	}
	for(int i = n; i >= 1; --i){
		int par = 0;
		for(int j = n/i*i; j > i; j -= i){
			par += ans[j];
			par = par%2;
		}
		ans[i] = (par^a[i]);
	}
	for(int i = 1; i <= n; ++i){
		if(ans[i] == 1)
			f.push_back(i);
	}
	printf("%d\n", (int)f.size());
	for(int i = 0; i < f.size(); ++i){
		if(i)
			printf(" ");
		printf("%d", f[i]);
	}
	printf("\n");
}

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

using namespace std;

int main(){
    int N;
    cin >> N;
    vector<long long> A(N);
    for (int i=0; i < N; i++){
        cin >> A[i];
    }

    bool flag = true;
    int cnt = 0;
    while (true) {
        for (auto a:A){
            if (a%(int(pow(2, cnt+1))) != 0) flag=false;
        }
        if (flag) {
            cnt++;
        }
        else{
            break;
        }
    }

    cout << cnt << endl;
    
}

Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s=sc.next();
        int n=s.length();
        boolean ans=true;
        for(int i=0;i<n;i++){
            if(s.charAt(i)!=s.charAt(n-i-1)){
                ans=false;
            }
        }
        for(int i=0;i<(n-1)/2;i++){
            if(s.charAt(i)!=s.charAt((n-1)/2-i-1)){
                ans=false;
            }
        }
        for(int i=0;i<(n-1)/2;i++){
            if(s.charAt(n-i-1)!=s.charAt((n+1)/2+i)){
                ans=false;
            }
        }
        System.out.println(ans?"Yes":"No");

    }

}

Measured memory_bytes: 22996
/*
Abdullah All Rawaha Anik
American International University - Bangladesh
18-*****-1
*/
#include<bits/stdc++.h>
using namespace std;
#define pii pair<ll,ll>
#define mp make_pair
#define  pb push_back
#define pf push_front
#define ll long long
const ll MAXN = 1e7+7;
ll arr[MAXN];
pii A[MAXN];
ll arr2[MAXN];
double probarray[MAXN];
double cumulitiveprobarray[MAXN];
ll power(ll x, ll y)
{
    ll res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x);
        y = y>>1;
        x = (x*x);
    }
    return res;
}
ll bigmod(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

void cumulitive()
{
    for(ll i=1;i<=300001;i++)
        arr[i]=arr[i-1]+i;
}
void probability(ll n)
{
    for(ll i=0;i<n;i++)
        probarray[i]=((double)arr[arr2[i]]/(double)arr2[i]);
//    for(ll i=0;i<n;i++)
//        cout<<probarray[i]<<endl;
//    cout<<endl;
    for(ll i=1;i<=n;i++)
        cumulitiveprobarray[i]=cumulitiveprobarray[i-1]+probarray[i-1];
//    for(ll i=1;i<=n;i++)
//        cout<<cumulitiveprobarray[i]<<endl;
}
int main()
{
    cumulitive();
    ll n,k;
    double maxx=(double)INT_MIN;
    cin>>n>>k;

    for(ll i=0;i<n;i++)
        cin>>arr2[i];

    probability(n);
    if(k>=n)
    {
      printf("%.12f\n",cumulitiveprobarray[n]);
    }
    else
    {
        for(ll i=0;i+k<=n;i++)
        {
            maxx=max(maxx,(cumulitiveprobarray[i+k]-cumulitiveprobarray[i]));
        }
        printf("%.12f\n",maxx);
    }

    return 0;
}



Measured memory_bytes: 12032
#include<bits/stdc++.h>
#include<cctype>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
#define all(v) (v).begin(),(v).end()
typedef long long int ll;
#define pi 3.1415926535897932384
#define E9 1000000000
#define eps 1e-4

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

  int cnt = 0;
  rep(i,N){
    if (S.substr(i,3) == "ABC") cnt++;
  }
  cout << cnt << endl;


  return 0;
}

Measured memory_bytes: 256
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

a = list(input())

c = '0'
count1 = 0
count2 = 0
for i in a:
    if i != c:
        count1 += 1
    if c == '0':
        c = '1'
    else:
        c = '0'
c = '1'
for i in a:
    if i != c:
        count2 += 1
    if c == '0':
        c = '1'
    else:
        c = '0'
print(min(count1, count2))

Measured memory_bytes: 6736
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int inf = INT_MAX;
const ll INF = LLONG_MAX;
const ll MOD = 1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b, const ll mod=MOD) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b, const ll mod=MOD) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b, const ll mod=MOD) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b, const ll mod=MOD) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int a, b, c, d; cin >> a >> b >> c >> d;
    int res = min(a, b) + min(c, d);
    cout << res << endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<string>
#include<sstream>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<vector>
//#define int  long long 
using namespace std;
int k;
string s;
set<string> st;
string gt[25000];
/*bool cmp(string a, string b)
{
	int len1 = a.size(), len2 = b.size();
	for (int i = 0; i < min(len1, len2); i++)
	{
		if (a[i] < b[i])
			return true;
		else if (a[i] > b[i])
			return false;
	}
	if (len1 > len2) return true;
	return false;
}*/
signed main()
{
//	string a = "a", b = "aa";
//	cout << (a > b) << endl;
	while (cin >> s)
	{
		scanf("%d", &k);
		st.clear();
		int len = s.size();
		for (int i = 0; i < len; i++)
		{
			for (int j = 1; j <= 5; j++)
			{
				if (i + j <= len)
					st.insert(s.substr(i, j));
			}
		}
		set<string>::iterator it = st.begin();
		for (int i = 0; it != st.end(); it++, i++)
		{
			if (i == k - 1)
			{
				cout << *it << endl;
				break;
			}
			//gt[i] = *it;
		}
		//cout << gt[k - 1] << endl;
		//sort(gt, gt + st.size(), cmp);
		//for (int i = 0; i < st.size(); i++)	cout << gt[i] << endl;
	}
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
// define
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (((a)%mod) * ((b)%mod)) % mod
#define rollcall cout << "I'm Sucu." << endl;
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define dmt(x, y, z) make_tuple(x, y, z)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define fi first
#define se second
// debug
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p){
  os << "(" << p.first << "," << p.second << ")";return os;
}
template <typename T, typename U, typename V>
ostream &operator<<(ostream &os, const tuple<T, U, V> &t){
  os << "(" << get<0>(t) << "," << get<1>(t) << "," << get<2>(t) << ")";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  for (auto it = v.begin();it != v.end();++it){
    if(it != v.begin())os << " ";os << *it;
  }return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &mp){
  for(auto x: mp)os << "(" << x.first << "," << x.second << ")" << endl;
  return os;
}
template<typename T, int SIZE>
int array_length(const T (&)[SIZE]){return SIZE;}
template<typename T, int N>
void PRINTF(const T (&a)[N], int s = N, int t = -1, bool f = true){
	if(t == -1){rep(i,s){if(i)cout << " ";cout << a[i];}}
	else repi(i,s,t){if(i!=s)cout << " ";cout << a[i];}
	if(f)cout << "\n";
}
template<typename T, int N1, int N2>
void PRINTF(const T (&a)[N1][N2], int h = N1, int w = N2){
	rep(i,h){rep(j,w){cout << a[i][j] << " \n"[j==w-1];}}
}
string substr(const string &str, int S1, int S2 = -1){
  if(S2 == -1)return str.substr(S1);
  return str.substr(S1, S2-S1);
}
// typedef
typedef complex<double> Point;
typedef pair<int, int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef tuple<int, int, int> TT;
typedef pair<int, TT> PT;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;
// int sum = accumulate(a, a+n, 0LL);
// int mx = max_element(a, a+n);
// int mn = min_element(a, a+n);
// int cnt = count(a, a+n, k);


//公約数
int gcd(int a, int b){
  if(a == 0 || b == 0)return max(a, b);
  if(a == b)return a;
  if(a > b)a = a%b;
	else b = b%a;
  return gcd(a, b);
}
//公倍数
int lcm(int a, int b){
  if(a == 0)return 0;
  return a/gcd(a, b)*b;
}

signed main(){
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int ans = 0;
  ans += b/c - (a-1)/c;
  ans += b/d - (a-1)/d;
  // cout << ans << endl;
  ans -= b/lcm(c, d) - (a-1)/lcm(c, d);
  // cout << ans << endl;
  cout << (b-a+1)-ans << endl;
  return 0;
}






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

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rept(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define reps(i,s,n) for(int (i)=(s);(i)<(int)(n);(i)++)
#define repst(i,s,n) for(int (i)=(s);(i)<=(int)(n);(i)++)
#define repr(i,n) for(int (i)=(n);(i)>=0;(i)--)
#define each(itr,v) for(auto (itr):(v))
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp(x,y) make_pair((x),(y))
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln "\n"
#define show(x) cout << #x << " = " << x ln
#define dbg(x) cout<<#x"="<<x ln

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<int> > mat;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int inf = (int)1e9;
const ll linf = (ll)1e18;
const int mod = (int)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;

// ━━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…
// .｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋
// ・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・

string s;
int l;

int main() {
	cin >> s;
	l = (int)s.length();
	cout << s[0] << l-2 << s[l-1] << ln;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mod 1000000007
#define mx 10005
//#define y 3
using namespace std;
typedef  long long int ll;
#define  f(i, n) for(int i = 0; i < n; ++i)
#define pb push_back

void input(){
  int n, p;
  cin>> n >>p;
  cout << (n * 3 + p)/2 <<endl;
}
int main(){
    input();
    return 0;
}



Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
class Program
{      
    
    public void Slove()
    {
        var inputs = Console.ReadLine().Split();
        int n = int.Parse(inputs[0]);
        int t = int.Parse(inputs[1]);
        int[] array = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int[] maxList = new int[n];
        maxList[n - 1] = array[n - 1];
        foreach(int i in Enumerable.Range(0, n).Reverse().Skip(1))
        {
            maxList[i] = Math.Max(maxList[i + 1], array[i]);
        }
        int result = 0;
        int max = 0;
        foreach(int i in Enumerable.Range(0, n - 1))
        {
            int temp = maxList[i] - array[i];
            if(temp > max)
            {
                max = temp;
                result = 1;
            }
            else if(temp == max)
                result++;
        }
        //System.Console.WriteLine(string.Join(",", maxList));
        System.Console.WriteLine(result);
    }
    
    static void Main(string[] args)
    {
        new Program().Slove();
    }
}


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

int main(){
  int N;
  map<int,int> mp;
  cin >> N;
  for(int i=0;i<N; i++){
    int k;
    cin >> k;
    mp[k]++;
  }
  int res = 0;
  for(auto t :mp){
    auto k = t.first;
    auto v = t.second;
    res++;
  }
  cout << res << endl;
}

Measured memory_bytes: 256
import sys

rl = sys.stdin.readline

n, k = map(int, rl().split())

li = list(map(int, rl().split()))

dp = [1<<60]*n

dp[0] = 0
dp[1] = abs(li[0] - li[1])

if k < n:    
    for i in range(2, k):
        for j in range(i):
            a = dp[j] + abs(li[j] - li[i])
            if dp[i] > a:
                dp[i] = a
    for i in range(k, n):
        for j in range(i-k, i):
            a = dp[j] + abs(li[j] - li[i])
            if dp[i] > a:
                dp[i] = a
else:
    for i in range(n):
        for j in range(i):
            a = dp[j] + abs(li[j] - li[i])
            if dp[i] > a:
                dp[i] = a
        
print(int(dp[-1]))




Measured memory_bytes: 52880
# coding: utf-8
# Your code here!


n = int(input())
a = [int(input()) for _ in range(5)]

ans = 0

if min(a)<n:
    nec_i = a.index(min(a))
    nec_n = n//a[nec_i]
    if n%a[nec_i] != 0:
        nec_n+=1
    ans = nec_n+4
else:
    ans = 5

print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int m;
int main()
{
    m=read();
    while(m--)
    {
        int a=read(),b=read(),lt=read(),rt=read();
        int len=(a+b)/(min(a,b)+1);
        int l=1,r=a,mid,res=0;
        while(l<=r)
        {
            mid=l+r>>1;
            int cnt=(mid+len-1)/len;
            int lefta=a-mid,leftb=b-cnt+1-len;
            if(1LL*lefta*len<leftb) r=mid-1;
            else res=mid,l=mid+1;
        }
        int cnt=(res+len-1)/len,prelen=cnt?cnt-1+res:0;
        int lefta=a-res,leftb=b-max(0,cnt-1),first=leftb-(lefta*len);
        for(int j=lt;j<=rt;++j)
        {
            if(j<=(cnt-1)*(len+1)) putchar(j%(len+1)?'A':'B');
            else if(j<=prelen) putchar('A');
            else if(j<=prelen+first) putchar('B');
            else putchar((j-prelen-first)%(len+1)==1?'A':'B');
        }
        puts("");
    }
    return 0;
}


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

int n, m;
int a[55];

int main()
{
    cin >> n >> m;
    for(int i = 1 ; i <= m ; i++)
    {
        int x, y;
        cin >> x >> y;
        a[x]++;
        a[y]++;
    }
    for(int i = 1 ; i <= n ; i++)
        cout << a[i] << "\n";
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <list>
#include <cmath>
#include <stack>
#include <iomanip>

using namespace std;
typedef long long ll;
using Pll = pair<ll,ll>;

const ll INF = 1LL<<60;
const ll MOD = 1000000007;

//cout << fixed << setprecision(10);

int main() {
    ll N;cin >> N;
    vector<ll> A(N),csum(N,0);
    for(int i=0;i<N;i++) cin >> A[i];
    sort(A.begin(),A.end());
    csum[0]=A[0];
    for(int i=0;i<N-1;i++){
        csum[i+1]=csum[i]+A[i+1];
    }

    ll ma = A[0];
    ll idx=0;
    for(int i=0;i<N-1;i++){
        if(A[i+1]>2*csum[i]) idx=i+1;
    }
    
    cout << N-idx << endl;

    return 0;
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
#define int long long 
using ldb = long double;
using pa = pair < int, int >;
#define F  first
#define S  second
#define f(i,x,n) for(int i=x;i<n;i++) 
#define all(c) c.begin(),c.end()
const int MOD = 1e9 + 7, N = 5e5 + 10;
const int LINF = LLONG_MAX;
string s1,s2,s;
int a,b,c,d,ans;
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> a >> b >> c;
    swap(a,b);
    swap(a,c);
    cout << a << " " << b << " " << c; 
    return 0;
}
 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var < (end); var++)
#define RFOR(var, begin, end) for (int var = (begin) - 1; var >= (end); var--)
#define REP(var, length) FOR(var, 0, length)
#define RREP(var, length) RFOR(var, length, 0)
#define SORT(vector) sort(vector.begin(), vector.end())

const ll MOD = 1e9 + 7;

int n;

int func(int s7, int s5, int s3, ll num) {
  int ret = 0;
  if (num > n) return 0;
  if (s7 && s5 && s3) ret++;
  int ret1 = func(s7 + 1, s5, s3, num + 7 * pow(10 ,s7 + s5 + s3));
  int ret2 = func(s7, s5 + 1, s3, num + 5 * pow(10 ,s7 + s5 + s3));
  int ret3 = func(s7, s5, s3 + 1, num + 3 * pow(10 ,s7 + s5 + s3));
  return ret + ret1 + ret2 + ret3;
}

void solve(istream& cin, ostream& cout) {
  cin >> n;
  cout << func(0, 0, 0, 0) << endl;
}

#ifndef TEST
int main() {
  solve(cin, cout);
}
#endif


Measured memory_bytes: 512
using System;

class Code_01
{

    public static void Main()
    {
        string Num = Console.ReadLine();
        int N = int.Parse(Num);
        string Datas = Console.ReadLine();
        int SUM = 0;
        int VariableSum = 0;
        for (int i = 0; i < N; i++)
        {
            int J = int.Parse(Datas.Split(' ')[i]);
            SUM += (int)Math.Pow(J, 2);
            VariableSum += J;
        }
        int X = 0;
        int ANS = 0;
        int ANS2 = 0;
        int End = 0;
        while (true)
        {
            ANS =N *(int)Math.Pow(X, 2) - 2 * X * VariableSum;
           // Console.WriteLine(ANS);
            ANS2 = N*(int)Math.Pow(X + 1, 2) - 2 * (X + 1) * VariableSum;
            if (ANS2 >= ANS)
            {
                End = X;
                break;
            }
            X++;

        }

    //    Console.WriteLine(SUM);
        SUM +=N* (int)Math.Pow(End, 2)  -2 * End * VariableSum;
        Console.WriteLine(SUM);
    }
}



Measured memory_bytes: 11092
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include<math.h>
#include<map>
#include<set>
using namespace std;
#define INF 1100000000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<ll,ll> P;

int par[110000]; //親
int ran[110000]; //木の深さ

// n要素を初期化
void init(int n){
  for(int i=1;i<=n;i++){
    par[i]=i;
    ran[i]=0;
  }
}

//木の根を求める
int find(int x){
  if(par[x]==x){
    return x;
  }else{
    return par[x]=find(par[x]);
  }
}

//xとyの属する集合を併合
void unite(int x,int y){
  x=find(x);
  y=find(y);
  if(x==y) return;

  if(ran[x]<ran[y]){
    par[x]=y;
  }else{
    par[y]=x;
    if(ran[x]==ran[y]) ran[x]++;
  }
}

//xとyが同じ集合に属するか否か
bool same(int x,int y){
  return find(x)==find(y);
}

//計算量はO(V*E)

struct edge{
  int from,to;
  ll cost;
};

edge es[110000]; //辺

ll d[110000],pre; //最短距離
bool flag=true;

int V,E; //Vは頂点数，Eは辺数

//s番目の頂点から各頂点への最短距離を求める
void shortest_path(int s){
  for(int i=1;i<=V;i++) d[i]=INF;
  int count=0;
  d[s]=0;
  while(true){
    if(count==V-1){
      pre=d[V];
    }else if(count==2*V-1){
      if(pre==d[V]){
        return;
      }else{
        cout<<"inf"<<endl;
        flag=false;
        return;
      }
    }
    count++;
    bool update=false;
    for(int i=0;i<E;i++){
      edge e=es[i];
      if(!same(e.from,1)) continue;
      if(d[e.from]!=INF && d[e.to]>d[e.from]+e.cost){
        d[e.to]=d[e.from]+e.cost;
        update=true;
      }
    }
    if(!update) break;
  }

}

int main(){
  int a,b,c;
  cin>>V>>E;
  init(V);

  for(int i=0;i<E;i++){
    cin>>es[i].from>>es[i].to>>es[i].cost;
    es[i].cost*=(-1);
    unite(es[i].from,es[i].to);
  }

  shortest_path(1);
  //cout<<"inf"<<endl;
  if(flag) cout<<d[V]*(-1)<<endl;

  
}


Measured memory_bytes: 256
#include <iostream>
#include <array>
#include <map>
#include <queue>

template <class T, class U>
T ipow(T b, U n) {
    T ret = 1;
    while (n > 0) {
        if (n & 1) ret *= b;
        n >>= 1;
        b *= b;
    }
    return ret;
}

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

const std::array<std::array<int, 3>, 3> goal({std::array<int, 3>({1, 2, 3}),
                                              std::array<int, 3>({4, 5, 6}),
                                              std::array<int, 3>({7, 8, 0})});

int encode(const std::array<std::array<int, 3>, 3>& brd) {
    int ret = 0;
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            ret += ipow(9, i * 3 + j) * brd[i][j];
        }
    }
    return ret;
}

int main() {
    std::array<std::array<int, 3>, 3> brd;
    for (auto& v : brd) {
        for (auto& e : v) std::cin >> e;
    }

    std::map<int, int> dp;
    std::queue<std::array<std::array<int, 3>, 3>> que;
    que.push(brd);
    dp[encode(brd)] = 0;

    while (!que.empty()) {
        auto b = que.front();
        que.pop();
        int ope = dp[encode(b)];

        int zx, zy;
        {
            bool flag = false;
            for (zx = 0; zx < 3; ++zx) {
                for (zy = 0; zy < 3; ++zy) {
                    if (b[zx][zy] == 0) {
                        flag = true;
                        break;
                    }
                }
                if (flag) break;
            }
        }

        for (int i = 0; i < 4; ++i) {
            int nx = zx + dx[i], ny = zy + dy[i];
            if (nx < 0 || 3 <= nx || ny < 0 || 3 <= ny) continue;
            std::swap(b[zx][zy], b[nx][ny]);
            int id = encode(b);
            if (!dp.count(id)) {
                dp[id] = ope + 1;
                que.push(b);
            }
            std::swap(b[zx][zy], b[nx][ny]);
        }
    }

    std::cout << dp[encode(goal)] << std::endl;
    return 0;
}



Measured memory_bytes: 12124
#include<iostream>
#include<queue>
#include<vector>
#define ii pair<int,int>
#define iii pair<int,ii> 
using namespace std;
int v,e,a,b;
vector<int> adjl[110000];
int vis[110000];
int memo[110000];
int start = 0;
int dp(int nodes){
//	cout<<nodes<<"\n";
	int sz = adjl[nodes].size();
	if(sz == 0) return 0;
	if(memo[nodes]!=-1) return memo[nodes];
	int ret = 0;
	for(int i = 0;i<sz;i++){
//		cout<<" visit "<<adjl[nodes][i]<<"\n";
		ret = max(ret, dp(adjl[nodes][i]) + 1);
	}
//	cout<<"\n";
	return memo[nodes] = ret;
}


int main(){
	cin>>v>>e;
	for(int i = 1;i<=v;i++) adjl[0].push_back(i);
	for(int i = 0;i<e;i++){
		cin>>a>>b;
		adjl[a].push_back(b);
	}
	int ans = 0;
	for(int i = 0;i<=v;i++) memo[i] = -1;
	ans = dp(0) -1 ;
	cout<<ans<<"\n";
//	for(int i = 0;i<=v;i++) cout<<memo[i]<<" ";cout<<"\n";
//	for(int i = 0;i<=v;i++) ans = max(ans,)
	return 0;
}

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

#define rep(i,a) for(int i=0; i<a; i++)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define loop3(i,j,k,a) for(int i=0; i<a; i++)for(int j=0; j<a; j++)if(i!=j)for(int k=0; k<a; k++)if(i!=k&&j!=k)
#define loop4(i,j,k,l,a) for(int i=0; i<a; i++)for(int j=0; j<a; j++)if(i!=j)for(int k=0; k<a; k++)if(i!=k&&j!=k)for(int l=0; l<a; l++)if(i!=l&&j!=l&&k!=l)
#define rep1(i,a) for(int i=1; i<=a; i++)

#define scnd1(a) scanf("%d", &a)
#define scnd2(a,b) scanf("%d%d", &a,&b)
#define scnd3(a,b,c) scanf("%d%d%d", &a,&b,&c)
#define scnd4(a,b,c,d) scanf("%d%d%d%d", &a,&b,&c,&d)

#define cin1(a) cin >> a;
#define cin2(a,b) cin >> a >> b;
#define cin3(a,b,c) cin >> a >> b >> c;
#define cin4(a,b,c,d) cin >> a >> b >> c >> d;
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define prtd1(a) printf("%d\n", a)
#define prtd2(a,b) printf("%d %d\n", a,b)
#define prtd3(a,b,c) printf("%d %d %d\n", a,b,c)
#define prtd4(a,b,c,d) printf("%d %d %d %d\n", a,b,c,d)

#define mem(a,n) memset( a, n, sizeof(a))
#define INF 1000000000
typedef long long ll;

bool prime[100009];
int prim_nums[100009];

void eratosthenes(bool prime[], int X) {
    
    for ( int i = 2; i*i <= X; i++ ) {
        int v = i*2;
        while( v <= X) {
            prime[v] = false;
            v += i;
        }
    }
}

int main() {
    int Q;
    cin >> Q;
    
    mem( prime, true);
    eratosthenes( prime, 100000);
    
    mem( prim_nums, 0);
    for( int i=3; i<=100000; i+=2 ) {
        if( prime[i] && prime[ (i+1)/2 ]) prim_nums[i]++;
        prim_nums[i] += prim_nums[i-2];
    }
    
    int l, r;
    rep(i,Q) {
        scnd2( l, r);
        if ( l>1 ) l-=2;
        prtd1( prim_nums[r]-prim_nums[l] );
    }
}


Measured memory_bytes: 1152
#include<iostream>
#include<cmath>
#include<algorithm>
#include <cassert>
#include<string>
#define rep(i,rept) for(long long i = 0; i <(long long)rept;i++)
using namespace std;
int main() {
	int a = 0, b = 0, c = 0, d[100000], e[100000], f = 0, g = 0, h = 0, count = 0;
	char rikka, toka[100000];
	string saya, homu, kyok, mami, mado[50];
	bool gg = false;
	int manji, nk[26] = { false };
	cin >> a;
	if (a % 111 == 0) {
		cout << a << endl;
	}
	else {
		cout << (a / 111 + 1) * 111 << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rrep(i,n) rrepi(i,n,0)
#define rrepi(i,a,b) for(int i=int(a);i>int(b);--i)
#define all(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define show(v) rep(i,v.size()){cout<<v[i]<<" ";}cout<<endl;
#define MOD 1000000007
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define SZ(x) ((int)(x).size())
#define sum(v,i) accumulate(all(v),i)
//#define int long long
using ll = long long;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };
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 gcd(int a, int b) { return b ? gcd(b, a % b) : a; }//最大公約数
int lcm(int a, int b) { return a * b / gcd(a, b); }	//最小公倍数
//template <typename... Args>void IN(Args& ... args) {cin >>args;IN(args...);return;} //まとめて入力　IN(a,b,c,d...)

void Main() {
	int n; cin >> n;
	cout << n * n;
}

signed main() {
	Main();

	return 0;
}


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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CTypicalStairs solver = new CTypicalStairs();
        solver.solve(1, in, out);
        out.close();
    }

    static class CTypicalStairs {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int mod = 1_000_000_007;
            int n = in.nextInt();
            int m = in.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < m; i++)
                arr[i] = in.nextInt();
            //dp[k] : nb of steps to get to get to the N-1th from the kth step
            //dp[k] = if arr[k]==0 => 0 else dp[k+1] + dp[k+2]
            //dp[n-1] = 1
            long[] dp = new long[n + 2];
            dp[n + 1] = 0;
            dp[n] = 1;
            int cur = m == 0 ? -1 : arr[m - 1];
            int indM = m - 1;
            for (int i = n - 1; i >= 0; i--) {
                if (i == cur) {
                    indM--;
                    if (indM >= 0)
                        cur = arr[indM];
                    dp[i] = 0;
                } else {
                    dp[i] = dp[i + 1] + dp[i + 2];
                    dp[i] %= mod;
                }
            }
            out.println(dp[0]);
        }

    }
}



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

int main() {
  long long h,w;
  cin>>h>>w;
  long long ans;
  if(h==1 || w==1) ans=1;
  else{
  if(h%2==0){
    h/=2;
    ans=h*w;
  }
  else{
    if(w%2==0){
      w/=2;
      ans=h*w;
    }
    else{
      w/=2;
      ans=w*h+h/2+1;
    }
  }
  }
  cout<<ans<<endl;
}




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

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define spa << " " <<
ll MOD = 1e9+7;
void chmin(ll &a, ll b) { if (a > b) a = b; }
void chmax(ll &a, ll b) { if (a < b) a = b; }

int main(){
  ll i, j;
  ll a, b, c;
  cin >> a >> b >> c;
  cout << max({a, b, c}) - min({a, b, c}) << endl;

  return 0;
}

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

using std::cin;
template <typename T>
using vec = std::vector<T>;
template <typename T>
using min_heap = std::priority_queue<T, vec<T>, std::greater<T>>;

typedef long long lld;
const int MAXC = 2500;
const int MAXN = 55;
const lld MAXT = 3e12;
int C[MAXN];
int D[MAXN];
int M, N, S;

struct Edge {
  int v;
  int a, b;
};
vec<Edge> G[MAXN];
bool seen[MAXN];
int visited;

lld T[MAXN][MAXC+5];
// T[i][j] = min time to arrive at city i with j silver coins.

struct State {
  lld time;
  int u, s;

  bool operator > (const State& o) const {
    return time > o.time;
  }
};

void dijkstra(int src) {
  min_heap<State> pq;

  pq.push({0, src, S});
  T[src][S] = 0;
  seen[src] = true;
  ++visited;

  while (!pq.empty()) {
    State cur = pq.top();
    pq.pop();

    if (T[cur.u][cur.s] < cur.time) {
      continue;
    }

    if (!seen[cur.u]) {
      seen[cur.u] = true;
      if (++visited == N) {
        break;
      }
    }

    for (auto& nxt: G[cur.u]) {
      lld time = cur.time;
      int silver = cur.s;
      if (silver < nxt.a) {
        int xchg = (nxt.a - silver + C[cur.u] - 1) / C[cur.u];
        silver = std::min(xchg * C[cur.u] + silver, MAXC);
        time += 1LL * xchg * D[cur.u];
      }

      auto transit = [&time, &silver, &nxt, &pq](){
        lld nt = time + nxt.b;
        int ns = silver - nxt.a; 
        if (nt < T[nxt.v][ns]) {
          pq.push({nt, nxt.v, ns});
          T[nxt.v][ns] = nt;
        }
      };
      transit();

      while (silver < MAXC) {
        silver = std::min(silver + C[cur.u], MAXC);
        time += D[cur.u];
        transit();
      }
    }    
  }
}

void output() {
  for (int t = 2; t <= N; ++t) {
    lld ans = *std::min_element(T[t], T[t]+MAXC+1);
    printf("%lld\n", ans);
  }
}

void fastio() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
}

void init() {
  for (int i = 1; i <= N; ++i) {
    G[i].clear();
    seen[i] = false;
  }
  for (int i = 1; i <= N; ++i) {
    for (int j = 0; j <= MAXC; ++j) {
      T[i][j] = MAXT;
    }
  }
  S = std::min(MAXC, S);
  visited = 0;
}

int main() {
  fastio();
  cin >> N >> M >> S;
  init();
  for (int i = 0; i < M; ++i) {
    int a, b, u, v;
    cin >> u >> v >> a >> b;
    G[u].push_back({v, a, b});
    G[v].push_back({u, a, b});
  }
  for (int i = 1; i <= N; ++i) {
    cin >> C[i] >> D[i];
  }
  dijkstra(1);
  output();
  return 0;
}

Measured memory_bytes: 36708
#include <stdio.h>

int main()
{
    int a,b,c,d;

    int e=0;

    int f=0;


    scanf("%d%d%d%d",&a,&b,&c,&d);

    while(1)
    {
        c-=b;
        if(c<=0){
            e++;
            break;}
        a-=d;
        if(a<=0){
            f++;
            break;}
    }

if(e!=0){
    printf("Yes");
}
else{printf("No");}
    return 0;
}

Measured memory_bytes: 1732
#include <bits/stdc++.h>
#define pb push_back
#define IOS                                                                    \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define ll long long int
#define ld long double
#define el '\n'
#define PI (ld)3.141592653589793238462643383279502884197169399375105820974944
#define inf (ll)1000000000
#define mod (ll)1000000007
#define mod1 (ll)998244353
#define fo(i, n) for (long long i = 0; i < int(n); i++)
#define pll pair<ll, ll>
#define mll map<ll,ll>
#define vli vector<pair<ll,int>>
#define vpl vector<pll>
#define vvl vector<vector<ll> >
#define vvpl vector< vector<pll> >
#define ff first
#define ss second
#define pqueue priority_queue< ll >
#define pdqueue priority_queue< ll,vl ,greater< ll > >
#define mem(a,b) memset(a,b,sizeof(a));
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define sz(a) (ll)a.size()
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fd(i,a,b) for(ll i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define vl vector<ll>
//#define x ff
//#define y ss
#define pt(a) for(auto it:a)cout<<it<<" ";cout<<endl;
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
using namespace std;

double gcd(double a, double b) { return a < 0.01 ? b : gcd(fmod(b, a), a); }

vector<ll> parent, rak;

void make_set(int f){
    fo(i,f+1)parent.pb(i);
    rak.assign(f+1,1);
}

ll find_set(ll v) {
    if (v == parent[v])
        return v;
    return parent[v] = find_set(parent[v]);
}

ll union_sets(ll a, ll b) {
    a = find_set(a);
    b = find_set(b);
    if (a != b) {
        if (rak[a] < rak[b])
            swap(a, b);
        parent[b] = a;
        rak[a]+=rak[b];
        return (rak[a]-rak[b])*(rak[b]);
    }
    return 0;
}

long long bpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1)
      res = res * a % m;
      a = a * a % m;
      b >>= 1;
  }
  return res;
}
ll extend_gcd(ll a,ll b,ll &x,ll &y){
    if(b==0){
        x=1;
        y=0;
        return a;
    }
    ll x1,y1;
    ll ans =extend_gcd(b,a%b,x1,y1);
    x=y1;
    y=x1-(a/b)*y1;

    return ans;
}
ll inverse(ll a,ll m){
    ll x,y;
    extend_gcd(m,a,x,y);
    y%=m;
    y+=m;
    y%=m;
    return y;
}

/*const int N = 1000001;
int lp[N+1];
vector<int> pr;
void s(){
for (int i=2; i<=N; ++i) {
        if (lp[i] == 0) {
            lp[i] = i;
            pr.push_back (i);
        }
        for (int j=0; j<(int)pr.size() && pr[j]<=lp[i] && i*pr[j]<=N; ++j)
            lp[i * pr[j]] = pr[j];
    }
}*/


ld kv;
ll t,n,x,y,h,k,z,p,q,w;
string s;
//vvl v;
//vl vis,d;

int main() {
    IOS;
    cin>>x>>y;
    cout<<(y%x==0?x+y:y-x);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
int main()
{
  string s;
  cin >> s;

  int n = s.size();
  bool f = true;
  rep(i,n){
    if(i&1){
      if(s[i]=='R'){
	f = false;
	break;
      }
    }
    else{
      if(s[i]=='L'){
	f = false;
	break;
      }
    }
  }

  cout << (f?"Yes":"No") << "\n";
  
  
  return 0;
}


Measured memory_bytes: 256
// uno {{{
#include <bits/stdc++.h>
#include <unistd.h>
#define SZ(x) ((int)(x).size())
#define ALL(c) begin(c),end(c)
#define REP(i,n) for ( int i=0; i<(int)(n); i++ )
#define REP1(i,a,b) for ( int i=(int)(a); i<=(int)(b); i++ )
#define FOR(it,c) for ( auto it=(c).begin(); it!=(c).end(); it++ )
#define MP make_pair
#define PB push_back
using namespace std;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef long long LL;

void RI() {}

template<typename... T>
void RI( int& head, T&... tail ) {
    scanf("%d",&head);
    RI(tail...);
}

template<typename T>
void _dump( const char* s, T&& head ) { cerr<<s<<"="<<head<<endl; }

template<typename T, typename... Args>
void _dump( const char* s, T&& head, Args&&... tail ) {
    int c=0;
    while ( *s!=',' || c!=0 ) {
        if ( *s=='(' || *s=='[' || *s=='{' ) c++;
        if ( *s==')' || *s==']' || *s=='}' ) c--;
        cerr<<*s++;
    }
    cerr<<"="<<head<<", ";
    _dump(s+1,tail...);
}

#define dump(...) _dump(#__VA_ARGS__, __VA_ARGS__);

template<typename A, typename B>
ostream& operator <<( ostream &s, const pair<A,B> &p ) { return s<<"("<<p.first<<","<<p.second<<")"; }

template<typename Iter>
ostream& _out( ostream &s, Iter b, Iter e ) {
    s<<"[";
    for ( auto it=b; it!=e; it++ ) s<<(it==b?"":" ")<<*it;
    s<<"]";
    return s;
}

template<typename T>
ostream& operator <<( ostream &s, const vector<T> &c ) { return _out(s,ALL(c)); }
template<typename T>
ostream& operator <<( ostream &s, const set<T> &c ) { return _out(s,ALL(c)); }
template<typename A, typename B>
ostream& operator <<( ostream &s, const map<A,B> &c ) { return _out(s,ALL(c)); }

// }}}

int n;
string s = "";
void input() {
    RI(n);
}

void solve() {
    if(n == 0) {
        printf("0\n");
        return;
    }
    while (n)
    {
        s = to_string(abs(n%2)) + s;
        n = -(n >> 1);
    }
    cout << s << endl;
}

int main( int argc, char *argv[] ) {
    input();
    solve();
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define sz(x) ((long long)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define oo 1e15;
const ld eps = 1e-9;
const ld pi = acosl(-1);
const int mod = 998244353;
const int mod1 = 1e9 + 7;


mt19937_64 rnd(time(0));

void faster()
{
    cin.tie(nullptr);
    cout.tie(nullptr);
    ios::sync_with_stdio(false);
}

signed main() {
    faster();
    // freopen("in", "r", stdin);
    // freopen("out", "w", stdout);
    //______________________________________
    /*__*/double start = clock();/*__*/
    //_____________________________________
    int n;
    cin >> n;
    vector <int> a(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];
    vector <int> dp(n);
    dp[0] = 0;
    for (int i = 1; i < n; i++)
    {
        dp[i] = oo;
        if (i > 1)
            dp[i] = abs(a[i] - a[i - 2]) + dp[i - 2];
        dp[i] = min(dp[i], abs(a[i] - a[i - 1]) + dp[i - 1]);
    }
    cout << dp[n - 1];
    //______________________________________
    //  cerr << "Time " << (clock() - start)  * 1.0 / CLOCKS_PER_SEC << "s\n";
    return 0;
}

Measured memory_bytes: 1024
n=int(input())
#print(n)

def kaisu(j):
    kotae=0
    while j % 2==0:
        j = j / 2
        kotae+=1
    return kotae

kaisu0=0
ans=1
for i in range(1,n+1):
    if kaisu0 < kaisu(i):
        kaisu0 = kaisu(i)
        ans = i

print(ans)



Measured memory_bytes: 2940
n = int(raw_input())
a = [int(s) for s in raw_input().split(" ")]
four_multi = 0
no_four_multi_even = 0
odd = 0
for i in a:
    if i % 4 == 0:
        four_multi += 1
    elif i % 2 == 0:
        no_four_multi_even += 1
    else:
        odd += 1
if odd <= four_multi:
    print "Yes"
elif odd - 1 == four_multi and no_four_multi_even == 0:
    print  "Yes"
else:
    print "No"


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

int main(){
   int n;
   cin >> n;
   int sum = 0;
   for(int i = 0; i < n; i++){
       int ai;
       cin >> ai;
       while(ai % 2 == 0){
           ai = ai/2;
           sum += 1;
       }
   }
   cout << sum << endl;
}



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

int main(){
  char a,b;

  cin >> a >> b;

  if(a > b)
    cout << ">" << endl;
    else if(a < b)
      cout << "<" << endl;
      else
        cout << "=" << endl;
  
  return 0;
}
        


Measured memory_bytes: 256