akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define MAXN 100005
#define MP make_pair
#define tomin(a,b) (a>(b)?a=(b):a) 
#define inf 2000000000
#define Dis first
#define No second
using namespace std;
int N,M;
struct Edge{
    int p,c,NXT;
};
Edge EDGE[MAXN<<2];
int tot,HEAD[MAXN];
void add_Edge(int a,int b,int c){
    EDGE[++tot]=(Edge){b,c,HEAD[a]};
    HEAD[a]=tot;
}
set<int> sub[MAXN];
typedef pair<int,int> pii;
priority_queue<pii> heap;
int dis[MAXN];
void Dij(){
    for(int i=2;i<=N;i++)
        dis[i]=inf;
    heap.push(MP(0,1));
    while(!heap.empty()){
        pii now=heap.top();
        heap.pop();
        if(-now.Dis>dis[now.No])continue;
        for(int v=HEAD[now.No];v;v=EDGE[v].NXT){
            Edge &nxt=EDGE[v];
            int cost=dis[now.No];
            if(sub[now.No].find(nxt.c)==sub[now.No].end())
                cost++;
            if(dis[nxt.p]>cost){
                dis[nxt.p]=cost;
                heap.push(MP(-cost,nxt.p));
                sub[nxt.p].clear();
            }
            if(dis[nxt.p]==cost)
                sub[nxt.p].insert(nxt.c);
        }
    }
}
int main(){
    scanf("%d%d",&N,&M);
    for(int i=1,p,q,c;i<=M;i++){
        scanf("%d%d%d",&p,&q,&c);
        add_Edge(p,q,c);add_Edge(q,p,c);
    }
    Dij();
    printf("%d\n",dis[N]==inf?-1:dis[N]);
    return 0;
}

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

int H,W,h,w,x,y,z;
int main()
{
	
	cin >> H >> W;
	cin >> h >> w;
	
	x = H*W;
	y = h*W;
	z = (w*H)-(w*h);
	
	cout << (x-y-z) << endl;
	
	return 0;
}

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

int main(){
  int N;
  double p[3000];
  cin>>N;
  for (int i(1);i<=N;i++) cin>>p[i];
  double dp[3000][3000] = {0.0}; 
  dp[0][0] = 1;
  for (int i(0);i<N;i++){
    for (int j(0);j<N;j++){
      dp[i+1][j]+=(dp[i][j]*(1-p[i+1]));
      dp[i+1][j+1]+=(dp[i][j]*p[i+1]);
    }
  }
  double ans(0.0);
  for (int i(N/2+1);i<=N;i++){
    ans+=dp[N][i];
  }
  cout <<setprecision(10) << ans << endl;
  return 0;
}



Measured memory_bytes: 70656
#include<stdio.h>

int main(void){
    int K=0;
    int X=0;
    int min=0;
    int max=0;
    scanf("%d %d",&K,&X);
    min=X-K+1;
    max=X+K-1;
    for(int i=min;i<=max;i++){
        printf("%d ",i);
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 128
local day = io.read("*n")
local c = {}
for i = 1, 26 do
  c[i] = io.read("*n")
end
local s = {}
for id = 1, day do
  s[id] = {}
  for i = 1, 26 do
    s[id][i] = io.read("*n")
  end
end

local function solve(t, debug)
  local cur = 0
  local lastday = {}
  for i = 1, 26 do lastday[i] = 0 end
  for id = 1, day do
    local pid = t[id]
    cur = cur + s[id][pid]
    lastday[pid] = id
    for i = 1, 26 do
      cur = cur - c[i] * (id - lastday[i])
    end
    if debug then print(cur) end
  end
  return cur
end
local t = {}
for id = 1, day do
  t[id] = 1 + (id % 26)
end
local score = solve(t)
math.randomseed(1)
local random = math.random
while os.clock() < 1.5 do
  local changeday = random(1, 365)
  local changeto = random(1, 26)
  local changefrom = t[changeday]
  t[changeday] = changeto
  local tmp = solve(t)
  if score < tmp then
    score = tmp
  else
    t[changeday] = changefrom
  end
end
print(table.concat(t, "\n"))


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

#define all(x) begin(x), end(x)

using i64 = int_fast64_t;
using u64 = uint_fast64_t;
using f64 = double;
using p64 = pair<i64, i64>;

constexpr i64 INF = INT_FAST64_MAX / 2;

void solve() {
    i64 n;
    cin >> n;
    vector<i64> a(n);
    for (auto& e : a) cin >> e;
    a.emplace_back(0);
    i64 money = 1000, stock = 0;

    for (i64 i = 0; i < n; i++) {
        money += stock * a[i];
        stock = 0;
        if (a[i] < a[i + 1]) {
            stock = money / a[i];
            money %= a[i];
        }
    }

    cout << money << endl;
}

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
}


Measured memory_bytes: 3640
from math import sqrt, ceil


def mul(iterable, mod: int = None)->int:
    ret = 1
    for v in iterable:
        ret *= v
        if mod:
            ret %= mod
    return ret


def factors_of_factorial(N: int)->int:
    prime_factors = {}

    for n in range(2, N+1):
        d = 2
        while n > 1:
            if n % d == 0:
                prime_factors.setdefault(d, 0)
            while n % d == 0:
                prime_factors[d] += 1
                n //= d
            d += 1
    return mul((p+1 for p in prime_factors.values()), mod=10**9+7)


if __name__ == "__main__":
    N = int(input())
    ans = factors_of_factorial(N)
    print(ans)


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

int main(){
    int n;
    cin >> n;
    int a[n];
    rep(i, n) cin >> a[i];
    if(n==1){
        cout << a[0] << endl;
    }else{
        if(n%2==0){
            for (int i = n-1; i >=1 ; i-=2)
            {
                cout << a[i] << " ";
            }
            for (int i = 0; i <=n-4 ; i+=2)
            {
                cout << a[i] << " ";
            }
            cout << a[n-2] << endl;
        }else{
            for (int i = n-1; i >=0 ; i-=2)
            {
                cout << a[i] << " ";
            }
            for (int i = 1; i <=n-4 ; i+=2)
            {
                cout << a[i] << " ";
            }
            cout << a[n-2] << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
#define lli long long int
#define pb push_back
#define mod 1000000007
#pragma GCC optimize ("-O2")
#define mod2 998244353
#define MAXN 1000000000
#define v32 vector<int>
#define v64 vector<lli>
#define v1024 vector <vector <int>>
#define v4096 vector <vector <lli>>
#define vt vector
#define f(x, y, z) for (lli x = y; x < z; x++)
#define fd(x, y, z) for (lli x = y; x > z; x--)
#define lb lower_bound
#define ld long double
#define m64 map<lli,lli>
#define m32 map<int,int>
#define m64it map<lli,lli>::iterator
#define m32it map<int,int>::iterator
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ist insert
#define endl "\n"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define p_q priority_queue 
#define min_p_q priority_queue <int,vt <int>,greater <int>>
using namespace std;
using namespace __gnu_pbds; 

//USE AT YOUR OWN RISK
lli tmod(lli x,lli m=mod){return (x%m+m)%m;}

template <typename T> 
void DEBUG_ARR(vt<T> a,char c)
{
	f(i,0,a.size())cout<<tmod(a[i])<<c;
	cout<<"\n";
}

//make sure x is below mod
lli power(lli x, lli y,lli m=mod) 
{
    lli res = 1;  
   
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x)%m; 
        y = y>>1; 
        x = (x*x)%m;  
    }
    if(res<0)
       res+=m; 
    return res; 
}


// lli fact[2000009];
// lli ncr(lli n,lli r){
//     lli ans=fact[n];
//     if(r>n)return 0;
//     ans=(ans*power(fact[n-r],mod-2))%mod;
//     ans=(ans*power(fact[r],mod-2))%mod;
//     return ans;
// }


int main() 
{ 
    // fact[0]=1;
    // f(i,1,2000001)fact[i]=(i*fact[i-1])%mod;
    
    fastio;
    int t;
    // cin>>t;
    t=1;
    int temp=t;
	while(t--){
        // cout<<"Case #"<<temp-t<<": ";
        lli n;
        cin>>n;
        lli ans=0;
        f(i,1,n+1){
            ans+=(i)*(i%3!=0 && i%5!=0);
        }
        cout<<ans<<"\n";
    }   
    return 0; 	
}


Measured memory_bytes: 3640
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
#include<complex>

using namespace std;

#define ll long long
#define ld long double
#define EPS 1e-9
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef pair<int,pii> pip;
typedef vector<pii> vp;
typedef vector<vi> vvi;

int gcd(int a, int b){if(b==0) return a;return gcd(b,a%b);}
int lcm(int a, int b){return a/gcd(a,b)*b;}


signed main(void) {
    int n;
    cin >> n;
    int t = 1;
    while(t*2 <= n)t *= 2;
    cout << t << endl;
}



Measured memory_bytes: 3100
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	var n int
	n = nextInt()
	ma := make(map[int]int, n)
	for i := 0; i < n-1; i++ {
		tmp := nextInt()
		ma[tmp]++
	}

	for j := 1; j < n+1; j++ {
		fmt.Println(ma[j])
	}

}


Measured memory_bytes: 10332
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
//#include <stdio.h>
//#include <stack>
//#include <queue>
#include <cstdio>
#include <cmath>
#include <iterator>
#include <map>
//#include <fstream>
//#include <list>
//#include <iomanip>
#include <cctype>
 
using namespace std;
 
#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define ssort(z) sort(z.begin(),z.end())
#define eerase(z) z.erase(unique(z.begin(),z.end()),z.end())
 
 
void printVec(std::vector<int> & vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	std::cout << std::endl;
}
void printVec1(std::vector<string>& vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	std::cout << std::endl;
}
 
template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
	vector.erase(vector.begin() + index);
}
 
int vector_finder(std::vector<string> vec, string number) {
	auto itr = std::find(vec.begin(), vec.end(), number);
	size_t index = std::distance(vec.begin(), itr);
	if (index != vec.size()) { // 発見できたとき
		return 1;
	}
	else { // 発見できなかったとき
		return 0;
	}
}
 
#include <sstream> 
std::vector<std::string> StringSplit(const std::string& str, char sep)
{
	std::vector<std::string> v;
	std::stringstream ss(str);
	std::string buffer;
	while (std::getline(ss, buffer, sep)) {
		v.push_back(buffer);
	}
	return v;
}
 
Int gcd(Int a, Int b) {
	return b != 0 ? gcd(b, a % b) : a;
}
Int lcm(Int a, Int b) {
	return a * b / gcd(a, b);
}
 
bool comp(const string a, const string b) {
	return a.length() < b.length();
}
 
bool integer(double num) {
	return floor(num) == num;
}
 
string gen(int num) {
	string str = "";
	for (int i = 0; i < num; i++) str += ".";
	return str;
}
Int fact(int num) {
	if (num == 0) return 1;
	else return num * fact(num - 1);
}
 
int main() {
	double a, b, t; cin >> a >> b >> t;
	int sum = 0;
	for (int i = 1; a * i <= t + 0.5; i++) {
		sum += b;
	}
	cout << sum;
 
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
import statistics
N= int(input())
min_all=[]
max_all = []
for _ in range(N):
    a,b=map(int,input().split())
    min_all.append(a)
    max_all.append(b)
min_median = statistics.median(min_all)
max_median = statistics.median(max_all)
if N%2:
    ans = max_median - min_median+1
else:
    ans = int((max_median - min_median +0.5)*2)
print(ans)


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

using namespace std;
#define inputInt(a) int a; cin >> a; 
#define inputInt2(a,b) int a; int b; cin >> a >> b; 
#define inputInt3(a,b,c) int a; int b; int c; cin >> a >> b >> c;
#define inputLong(a) long a;cin >> a; 
#define inputIntArray(a,N) int a[N];for(int i=0;i<N;i++){cin >> a[i];}
#define inputLongArray(a,N) long a[N];for(int i=0;i<N;i++){cin >> a[i];}
#define inputIntArray2(a,b,N) int a[N]; int b[N]; for(int i=0;i<N;i++){cin >> a[i] >> b[i];}
#define output(answer) cout << answer << endl;
#define fN(i,N)    for(int i=0; i<N; i++)
#define fSE(i,s,e) for(int i=s; i<=e; i++)
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
const ll MOD2 = 998244353;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main()
{
  //input
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  string S; cin >> S;
  
  //main
  ll ans = 0;
  
  vector<pair<ll,int>> v;
  int count = 1;
  for(int i=0; i<S.length(); i++){
    if(i == S.length()-1){ 
      if(S[i] == '<'){
        v.pb(mp(count,1));
      }else{
        v.pb(mp(count,0));
      }
    }else if(i < S.length()-1 && S[i] == S[i+1]){
      count++; 
    }else{
      if(S[i] == '<'){
        v.pb(mp(count,1));
      }else{
        v.pb(mp(count,0));
      }
      count = 1;
    }
  }
  
  //for(auto p : v){ cout << p.fi << " " << p.se << endl;}
  
  for(int i=0; i<v.size(); i++){
    /*if(v[i].fi > v[i+1].fi && v[i].se == 1){ 
      ans += v[i].fi*(v[i].fi+1)/2;
      v[i+1].fi --;
    }else if(v[i].fi <= v[i+1].fi && v[i].se == 1){
      v[i].fi --;
      ans += v[i].fi*(v[i].fi+1)/2;
    }else{
      ans += v[i].fi*(v[i].fi+1)/2;
    }*/
    ans += (v[i].fi-1)*(v[i].fi)/2;
    if(i < v.size()-1 && v[i].se == 1){
      ans += max(v[i].fi,v[i+1].fi);
      //cout << i << " " << max(v[i].fi,v[i+1].fi) << " " << endl;
    }else if(i == v.size()-1 && v[i].se == 1){ 
      ans += v[i].fi;
    }else if(i == 0 && v[i].se == 0){
      ans += v[i].fi; 
    }
  }
  
  // output
  
  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 6932
#include<iostream>
#include<cstring>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;
#define MAX 100005
#define INF 2E9
struct Card{
	char suit;
	int value;
};
struct Card L[MAX/2+2],R[MAX/2+2];
void merge(struct Card A[],int n,int left,int mid,int right)
{
	int i,j,k;
	int n1=mid-left;
	int n2=right-mid;
	for(int i=0;i<n1;i++)
	L[i]=A[left+i];
	for(int i=0;i<n2;i++)
	R[i]=A[mid+i];
	L[n1].value=R[n2].value=INF;
	i=j=0;
	for(k=left;k<right;k++)
	{
		if(L[i].value<=R[j].value)
		{
			A[k]=L[i++];
		}
		else
		A[k]=R[j++];
	}
}
void mergeSort(struct Card A[],int n,int left,int right)
{
	int mid;
	if(left+1<right)
	{
		mid=(left+right)/2;
		mergeSort(A,n,left,mid);
		mergeSort(A,n,mid,right);
		merge(A,n,left,mid,right);
	}
}
int partition(struct Card A[],int n,int p,int r)
{
	int i,j;
	struct Card t,x;
	x=A[r];
	i=p-1;
	for(j=p;j<r;j++)
	{
		if(A[j].value<=x.value)
		{
			i++;
			t=A[i];A[i]=A[j];A[j]=t;
		}
	}
	t=A[i+1];A[i+1]=A[r];A[r]=t;
	return i+1; 
}
void quickSort(struct Card A[],int n,int p,int r)
{
	int q;
	if(p<r)
	{
		q=partition(A,n,p,r);
		quickSort(A,n,p,q-1);
		quickSort(A,n,q+1,r);
	}
}

int main()
{
  int n,v;
  struct Card A[MAX],B[MAX];
  char S[10];
  int stable=1;
  cin>>n;
  for(int i=0;i<n;i++)
  {
  	scanf("%s %d",S,&v);
  	A[i].suit=B[i].suit=S[0];
  	A[i].value=B[i].value=v;
  }
  mergeSort(A,n,0,n);
  quickSort(B,n,0,n-1);
  for(int i=0;i<n;i++)
  if(A[i].suit!=B[i].suit)
  stable = 0;
  if(stable==1)
  cout<<"Stable"<<"\n";
  else
  cout<<"Not stable"<<"\n";
  for(int i=0;i<n;i++)
  {
  	cout<<B[i].suit<<" "<<B[i].value<<"\n";
  }
return 0;
 } 


Measured memory_bytes: 5492
#include<bits/stdc++.h>
using namespace std;
bool comp(pair<long long int,long long int>a,pair<long long int,long long int>b)
{
    if(a.first==b.first)
    {
        if(a.second<=b.second)
        return true;
        else
        return false;
    }
    if(a.first>b.first)
    return true;
    else return false;
}
long long int gcd(long long int bdda,long long int chota)
{
    if(chota==0)
        return bdda;
    return gcd(chota,bdda%chota);
}
void solve()
{
    string s;
    cin>>s;
    int n=s.length(),ans=INT_MAX;
    for(int i=0;i<n-2;i++)
    {
        string curr="";curr+=s[i];curr+=s[i+1];curr+=s[i+2];
        int num=stoi(curr);
        ans=min(ans,abs(753-num));
        //cout<<abs(753-num)<<" "<<num<<" "<<curr<<" "<<ans<<endl;
    }
    cout<<ans;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;    
    t=1;

    //cin>>t;
    while(t--)
    {
        solve();
    }
}


Measured memory_bytes: 3640
n = int(input())
h = list(map(int, input().split()))
h.append(0)
c = 0
while sum(h):
    for i in range(len(h)):
        if (0 < h[i] and h[i + 1] == 0):
            c += 1
    for i in range(len(h)):
        if h[i] != 0:
            h[i] -= 1

print(c)

Measured memory_bytes: 3060
/*Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow.

My little horse must think it queer
To stop without a farmhouse near
Between the woods and frozen lake
The darkest evening of the year.

He gives his harness bells a shake
To ask if there is some mistake.
The only other sound’s the sweep
Of easy wind and downy flake.

The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep.*/

#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
const int maxn= 100010;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli a=0ll,b=0ll;char ch;
    cin>>a>>ch>>b;
    if(ch=='+')
        cout<<(a+b);
    else
        cout<<(a-b);
    cout<<endl;
}

Measured memory_bytes: 256
import sys
# from collections import Counter, deque
# from collections import defaultdict
# from itertools import combinations, permutations, accumulate, groupby, product
# from bisect import bisect_left,bisect_right
# from heapq import heapify, heappop, heappush
# from math import floor, ceil,pi,factorial
# from operator import itemgetter
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
inf = 10**17
mod = 10**9 + 7

a,b,c = map(int, input().split())

if a-b <= c:
    print(c-a+b)
else:
    print(0)


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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int INF = 1e9;

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

    if (N == 0)
    {
        cout << X << endl;
        return 0;
    }

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

    if (N == 1)
    {
        int res = abs(X - (p[0] - 1)) <= abs(X - (p[0] + 1)) ? p[0] - 1 : p[0] + 1;
        cout << res << endl;
        return 0;
    }

    sort(p.begin(), p.end());
    int sub = INF;
    rep(i, N - 1)
    {
        if (abs(X - p[i]) < abs(X - p[i + 1]))
        {
            int acnt = p[i] + 1;
            int max_n = INF;
            int j = i + 1;
            while (true)
            {
                if (acnt != p[j])
                {
                    max_n = acnt;
                    break;
                }
                else if (j == N - 1)
                {
                    max_n = p[N - 1] + 1;
                    break;
                }
                else
                {
                    acnt++;
                    j++;
                }
            }

            int scnt = p[i] - 1;
            int min_n = INF;
            int k = i - 1;
            while (true)
            {
                if (scnt != p[k])
                {
                    min_n = scnt;
                    break;
                }
                else if (k == 0)
                {
                    min_n = p[0] - 1;
                    break;
                }
                else
                {
                    scnt--;
                    k--;
                }
            }

            int res = (abs(X - min_n) <= abs(X - max_n)) ? min_n : max_n;
            cout << res << endl;
            return 0;
        }
    }

    if (p[N - 2] != p[N - 1] - 1)
    {
        cout << p[N - 1] - 1 << endl;
    }
    else
    {
        cout << p[N - 1] + 1 << endl;
    }
}


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

int main(){
  int N;cin >> N;
  vector<string> S(N);
  for(int i=0;i<N;i++)cin >> S[i];
  sort(S.begin(),S.end());
  int ans=1;
  for(int i=1;i<N;i++){
    if(S[i-1]!=S[i]){
      ans ++;
    }
  }
  cout << ans << endl;
}

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

#define GO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int

const int maxr = 2e5 + 5;

int arr[maxr];
int32_t main()
{
	GO;
	int n, k;
	cin >> n >> k;
	for (int i = 0; i < n; i++)
		cin >> arr[i];

	int i = 0, j = k;
	for (int l = k; l < n; l++) {
		if (arr[i] < arr[j])
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
		i++; j++;
	}
	return 0;
}

//!

Measured memory_bytes: 5176
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const long long infll = (long long) 1.01e18;
const ld eps = 1e-9;
const ld pi = acos((ld) -1);

mt19937 mrand(random_device{} ()); 

int rnd(int x) {
  return mrand() % x;
}

const int mod = 998244353;

int mul(int a, int b) {
  return (long long) a * b % mod;
}

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

const int maxn = (int) 3e5 + 5;
int f[maxn], inv[maxn], finv[maxn];

void precalc() {
  f[0] = 1;
  for (int i = 1; i < maxn; i++) {
    f[i] = mul(f[i - 1], i);
  }
  inv[1] = 1;
  for (int i = 2; i < maxn; i++) {
    inv[i] = (mod - (long long) (mod / i) * inv[mod % i] % mod) % mod;
  }
  finv[0] = 1;
  for (int i = 1; i < maxn; i++) {
    finv[i] = mul(finv[i - 1], inv[i]);
  }
}

int c(int n, int k) {
  return mul(f[n], mul(finv[k], finv[n - k]));
}

int n, a, b;
long long k;

int read() {
  if (scanf("%d%d%d%lld", &n, &a, &b, &k) < 4) {
    return false;
  }
  return true;
}

void solve() {
  int res = 0;
  for (int x = 0; x <= n; x++) {
    long long rem = k - (long long) x * a;
    if (rem < 0 || rem % b) {
      continue;
    }
    int y = rem / b;
    if (y <= n) {
      add(res, mul(c(n, x), c(n, y)));
    }
  }
  printf("%d\n", res);
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen(TASK ".in", "r", stdin));
  assert(freopen(TASK ".out", "w", stdout));
#endif
  while (read()) {
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}


Measured memory_bytes: 3712
#include <iostream>
#include <string>
#include <algorithm>
#include <stdlib.h>
#include <iomanip>
using namespace std;

long gcd(long a, long b) {
  if(b == 0) return a;
  return gcd(b, a%b);
}

long lcm(long a, long b) {
    return (a*b)/gcd(a, b);
}

int main() {
  long a, b, c, d;
  cin >> a >> b >> c >> d;
  long sum = b - a + 1;
  long e = lcm(c,d);
  //cout << e << endl;
  
  long ac = a/c;
  if (a%c != 0) ac += 1;
  long bc = b/c;
  long ad = a/d;
  if (a%d != 0) ad += 1;
  long bd = b/d;
  long ae = a/e;
  if (a%e != 0) ae += 1;
  long be = b/e;
  
  //cout << sum << ac << bc << ad << bd << ae << be << endl;
  sum = sum - (bc - ac + 1) - (bd - ad + 1) + (be - ae + 1);
  cout << sum << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<queue>
using namespace std;
#define int long  long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
typedef pair<int, int>P;
const int INF = 1e8;

signed main() {
	string A, B;
	cin >> A >> B;
	if (A[0] == B[2] && A[1] == B[1] && A[2] == B[0])cout << "YES";
	else cout << "NO";
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
#include<set>
#include<cstring>
using namespace std;

int main() {
  string s; cin >> s;
  if(s == "keyence") {
    cout << "YES" << endl;
    return 0;
  }
  int n = s.size();
  for(int i=0; i<n; i++) {
    for(int j=1; j<n-1; j++){
      if(i+j >= n) continue;
      string ss = s.substr(0, i);
      string tt = s.substr(i+j, n-i-j);
      if(ss + tt == "keyence") {
        cout << "YES" << endl;
        return 0;
      }
      // cerr << ss << " " << tt << endl;
    }
  }
  cout << "NO" << endl;

  return 0;
}


//EOF


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

bool prime (int i) {
  // 合成数かどうか
  bool can = true;
  for (int j=2; j<=sqrt(i); j++) {
    if (i%j==0) {
      can = false;
      break;
    }
  }
  return can;
}

int main() {
  int X;
  cin >> X;
  // X+1からあり得る最大の素数100003まで調べる
  for (int i=X; i<100004; i++) {
    if (prime(i)) {
      cout << i << endl;
      break;
    }
  }
}

Measured memory_bytes: 256
hoge = [int(input()) for _ in range(6)]

i=0
j=0
flag=0

for i in range(len(hoge)-2):
    for j in range(len(hoge)-1):
        if hoge[j]-hoge[i] > hoge[-1]:
            flag = 1



if flag==0:
    print('Yay!')
else:
    print(':(')


Measured memory_bytes: 2940
n,m,v,p = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
k = (v-n)*m
s = k
x = a[p-1]
for i in range(p,n):
  s += a[i-1]
  if a[i] + m < x or (i-p+1)*a[i] < s:
    print(i)
    exit()
print(n)
    
    
    

Measured memory_bytes: 62576
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<set>
#include<map>
#include<bitset>

using namespace std;
typedef long long ll;
#define i_7 1000000007
#define i_5 1000000005

ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    else return c+i_7;
}
typedef pair<int,int> i_i;
typedef pair<ll,ll> l_l;
#define inf 100000000/*10^8*/
#define rep(i,l,r) for(int i=l;i<=r;i++)

////////////////////////////////////////


int main(){
    int n;cin>>n;
    if(n==10||n==100||n==1000||n==10000||n==100000)cout<<10<<endl;
    else{
        int ans=0;
        while(n>0){
            ans+=n%10;
            n=n/10;
        }
        cout<<ans<<endl;
    }
    
    return 0;
}




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

using namespace std;

int A[200005];
int pos[200005];
int main() {
    int n; 
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) {
        scanf("%d", A + i);
        pos[A[i]] = i;
    }
    set<int> s;
    s.insert(0);
    s.insert(n + 1);
    long long res = 0;
    for (int i = 1; i <= n; ++i) {
        int p = pos[i];
        s.insert(p);
        auto p_index = s.find(p);
        auto r = ++p_index;
        auto l = --(--p_index);

        res +=  1LL * i * (p - *l) * (*r - p);
    }
    printf("%lld\n", res);
    return 0;
}


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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            var X = N[0];
            var A = N[1];

            if (A > X)
            {
                Console.WriteLine(0);
            }
            else
            {
                Console.WriteLine(10);
            }

        }
    }
}


Measured memory_bytes: 11220
#include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
using namespace std;
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) a = b;
  return a > b;
}
template<class T> inline bool chmax(T&a, T b) {
  if (a < b) a = b;
  return a < b;
}

signed main() {
  string g; cin >> g;
  while (g != "#") {
    int y, m, d;
    cin >> y >> m >> d;
    if (y >= 31 && m >= 5 || y > 31) {
      cout << "? " << y-30 << " " << m << " " << d << endl;
    } else {
      cout << g << " " << y << " " << m << " " << d << endl;
    }
    cin >> g;
  }
}



Measured memory_bytes: 3204
#include <cstdio>
#include <algorithm>
#include <vector>
#include <utility>
#include <map>
#include <set>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <stack>
#include <queue>
#include <cstring>
#include <iterator>

#define FOR(n) for(int i=0;i<(n);++i)
#define FOR_R(it,cont) for(auto it=rbegin(cont);it!=rend(cont);++it)
#define FOR_F(it,cont) for(auto it=begin(cont);it!=end(cont);++it)
#define ALL(cont) begin(cont), end(cont)
#define LB(b,e,v) lower_bound(b,e,v)
#define UB(b,e,v) upper_bound(b,e,v)
#define AS_MOD(a,b) ((((a) % (b) ) + (b)) % (b))
#define MODDING(a,b) (a) = AS_MOD(a,b)

using namespace std;
typedef pair<int,int> P;
typedef pair<P, P> PP;
typedef long long ll;
int X;
int K;
int Q;
priority_queue<P,vector<P>, greater<P> > queries;
int main() {
  scanf("%d%d", &X, &K);
  FOR(K) {
    int r;
    scanf("%d", &r);
    queries.push(P(r, -1));
  }
  scanf("%d", &Q);
  FOR(Q) {
    int a,t;
    scanf("%d%d", &t, &a);
    queries.push(P(t, a));
  }

  int x=0,y=0,z=X,lastTime=0;
  bool isAtop=true;
  while(!queries.empty()) {
    P p=queries.top();queries.pop();
    int timeElapsed = p.first-lastTime;
    if (isAtop) {
      x-=timeElapsed;
      if (x+z-y<=0) {
        x=0;y=0;z=0;
      } else if (x<0) {
        y=y-x;
        x=0;
      }
    } else {
      x+=timeElapsed;
      if (x>=X) {
        x=X;y=X;z=X;
      } else if(x+z-y>X) {
        z = z-(x+z-y-X);
      }
    }
    if (p.second==-1) {
      isAtop=!isAtop;
    } else {
      int answer=0;
      if (p.second<=y) {
        answer=x;
      } else if(p.second<=z) {
        answer=x+p.second-y;
      } else {
        answer=x+z-y;
      }
      printf("%d\n", answer);
    }
    lastTime=p.first;
  }
  return 0;
}


Measured memory_bytes: 2928
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
    
    int l, r;
    cin >> l >> r;
    int ans = 2020;
    for(int i=l; i<=r-1; i++){
        if(l==0) l++;
        if(l==2019||r==2019){
            ans=0;
            break;
        }
        for(int j=l+1; j<=r; j++){
            ans = min( ans, ((i%2019)*(j%2019)%2019) );
            if(ans==0){
                goto outside;
            } 
        }
    }
    outside:
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3620
/*
ID: skipian1
PROB: 
LANG: C++11
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF = 2000000000
#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define X first
#define Y second

pair<ll, ll> prop(pair<ll, ll> a)  {
  if (a.X < 0) return mp(-a.X, -a.Y);
  if (a.X == 0 && a.Y < 0) return mp(0, a.Y);
  else return a;
}

pair<ll, ll> sub(pair<ll, ll> a, pair<ll, ll> b) {
  return mp(a.X-b.X, a.Y-b.Y);
}

int main() {
  int n;
  cin >> n;
  ll x, y;
  map<pair<ll, ll>, int> nber;
  pair<ll, ll> arr[n];
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    arr[i] = mp(x, y);
  }
  for (int i = 0; i < n; i++) {
    for (int j = i+1; j < n; j++) {
      nber[sub(arr[i], arr[j])]++;
      nber[sub(arr[j], arr[i])]++;
    }
  }
  int ans = n;
  for (auto c: nber) {
    ans = min(ans, n-c.Y);
  }
  cout << ans << "\n";
}


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

// Shortcut

#pragma optimize ("O3")
#define int long long
#define endl '\n'
#define eb emplace_back
#define pb push_back
#define pob pop_back
#define mp make_pair
#define upb upper_bound
#define lwb lower_bound
#define fi first
#define se second
#define For(i, l, r) for (int i = l; i < r; i++)
#define ForE(i, l, r) for (int i = l; i <= r; i++)
#define Ford(i, r, l) for (int i = r; i > l; i--)
#define FordE(i, r, l) for (int i = r; i >= l; i--)
#define Fora(i, a) for (auto i : a)

// I/O & Debug

#define PrintV(a) for (int iiii = 0; iiii < a.size(); iiii++) cout << a[iiii] << ' ';
#define PrintVl(a) for (int iiii = 0; iiii < a.size(); iiii++) cout << a[iiii] << endl;
#define PrintA(a, n) for (int iiii = 0; iiii < n; iiii++) cout << a[iiii] << ' ';
#define PrintAl(a, n) for (int iiii = 0; iiii < n; iiii++) cout << a[iiii] << endl;
#define Ptest(x) return cout << x, 0;
#define gl(s) getline(cin, s);
#define setpre(x) fixed << setprecision(x)
/*
#define debug(args...){ string _sDEB = #args; replace(_sDEB.begin(), _sDEB.end(), ',', ' '); stringstream _ssDEB(_sDEB); istream_iterator<string> _itDEB(_ssDEB); DEB(_itDEB, args); }
void DEB(istream_iterator<string> it) {}
template<typename T, typename... Args>
void DEB(istream_iterator<string> it, T a, Args... args){
    cout << *it << " = " << a << endl;
    DEB(++it, args...);
}
*/

// Functions

//#define isvowel(a) (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
#define bend(a) a.begin(), a.end()
#define rbend(a) a.rbegin(), a.rend()
#define mset(a) memset(a, 0, sizeof(a));
#define mmset(a) memset(a, 0x3f, sizeof(a));
//mt19937 rando(chrono::steady_clock::now().time_since_epoch().count());

// Data Structure

#define pque priority_queue
#define mts multiset
typedef long long ll;
typedef long double ld;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <ld> vld;
typedef vector <string> vs;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <vi > vvi;
typedef vector <vll > vvll;
typedef vector <pii > vpii;
typedef vector <pll > vpll;

const int N = 1e5 + 5, mod = 1e9 + 7, inf = 1e9 + 7;

int n, ans = 0;
pii a[N];

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cin >> n;
    ForE(i, 1, n){
        cin >> a[i].fi >> a[i].se;
    }
    sort(a + 1, a + 1 + n);
    map <pii, int> mpp;
    ForE(i, 1, n){
        ForE(j, i + 1, n){
            int x = a[j].fi - a[i].fi, y = a[j].se - a[i].se;
            mpp[{x, y}]++;
            ans = max(ans, mpp[{x, y}]);
        }
    }
    cout << n - ans;
}

/*
==================================+
INPUT:                            |
------------------------------    |

------------------------------    |
==================================+
OUTPUT:                           |
------------------------------    |

------------------------------    |
==================================+
*/

Measured memory_bytes: 384
#include<stdio.h>
 
int main(void){
  int i,j,m,f,r;
  char s;
 
  for(;;){
    scanf("%d%d%d",&m,&f,&r);
    if(m+f+r == -3) break;
 
    if(m == -1 || f == -1)
      s = 'F';
    else if(m+f >= 80)
      s = 'A';
    else if(m+f >= 65)
      s = 'B';
    else if(m+f >= 50)
      s = 'C';
    else if(m+f >= 30)
      if(r >= 50)
        s = 'C';
      else
        s = 'D';
    else
      s = 'F';
 
    printf("%c\n", s);
  }
   
  return 0;
}


Measured memory_bytes: 2056
# 入力 : 自然数     ex) 12
# 出力 : 約数リスト ex) [(2,2),(3,1)]
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]


def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base ** exponent
    return a

n = int(input())
if n == 1:
    print(1)
    exit()
fct = factorize(n)
maxDigit = n
for div in divisorize(fct):
    outNum = num(div)
    nonOutNum = int(n/outNum)
    digitOut = 0
    digitNonOut = 0
    while outNum > 0:
        digitOut += 1
        outNum = int(outNum / 10)
    while nonOutNum > 0:
        digitNonOut += 1
        nonOutNum = int(nonOutNum / 10)
    if max(digitOut, digitNonOut) < maxDigit:
        maxDigit = max(digitOut, digitNonOut)
print(maxDigit)


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

ll ruijyo(int k) {
  ll tmp = 1;
  if (k == 0) {
    return 1;
  }
  else {
    rep(i, k) {
      tmp *= 10;
    }
    return tmp;
  }
}

int main() {
  int d, g;
  cin >> d >> g;
  vector<int> p(d);
  vector<int> c(d);
  rep(i, d) {
    cin >> p.at(i) >> c.at(i);
  }
  vector<int> sum(d);
  rep(i, d) {
    sum.at(i) = p.at(i) * 100 * i + c.at(i);
  }
  int min_sum_time = 2000;
  for (int tmp = 0; tmp < (1 << 10); tmp++) {
    bitset<10> s(tmp);
    int sum_score = 0;
    int sum_time = 0;
    int max = 0;
    rep(i, d) {
      if (s.test(i)) {
        sum_score += p.at(i) * 100 * (i + 1) + c.at(i);
        sum_time += p.at(i);
      }
    }
    if (sum_score >= g) {
      if (min_sum_time > sum_time) {
        min_sum_time = sum_time;
      }
    }
    else {
      for (int i = d - 1; i >= 0; i--) {
        if (!s.test(i)) {
          max = i;
          break;
        }
      }
      rep(i, p.at(max) - 1) {
        sum_score += 100 * (max + 1);
        sum_time++;
        if (sum_score >= g) {
          if (min_sum_time > sum_time) {
            min_sum_time = sum_time;
            break;
          }
        }
      }
    }
  }
  cout << min_sum_time << endl;
}
      

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <queue>
#include <string>

using namespace std;

static int N, L;
int solve();

int solve() {
  int taste = L * N + (N + 1) * N / 2 - N;
  if (L + N <= 0) {
    taste -= (L + N - 1);
  } else if (L <= 0) {
    taste -= 0;
  } else {
    taste -= L;
  }
  return taste;
}

int main() {
  cin >> N >> L;
  cout << solve() << endl;
  return 0;
}


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

int main() {
    int i, n, total=0, a[100000]={0};
    cin >> n;
    for(i=1; cin >> a[i]; i++);
    a[n+1] = 0;
    for(i=0; i<=n; i++) total += abs(a[i] - a[i+1]);
    for(i=1; i<=n; i++) {
        cout << total - (abs(a[i-1]-a[i]) + abs(a[i]-a[i+1])) + abs(a[i-1]-a[i+1]) << endl;
    }
}

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

#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
int main(void){
    
    int a, b, c;
    cin >> a >> b >> c;
    
    int m = MAX(a, MAX(b, c)) - MIN(a, MIN(b, c));
    cout << MAX(m, -m) << "\n";
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		double a, b, c;
		double s, l, h;

		Scanner stdIn = new Scanner(System.in);

		a = stdIn.nextDouble();
		b = stdIn.nextDouble();
		c = stdIn.nextDouble();

		s = (((a * b)) * Math.sin(Math.toRadians(c))) / 2.0;
		l = a + b + Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2) - (2.0 * (a * b * Math.cos(Math.toRadians(c)))));
		h = b * Math.sin(Math.toRadians(c));

		System.out.println(s);
		System.out.println(l);
		System.out.println(h);

		stdIn.close();
	}
}

Measured memory_bytes: 27972
def main():
    s = list(input())
    k = int(input())

    for i in range(len(s)-1):
        if s[i] == 'a':
            continue
        else:
            mod = 26-(ord(s[i])-97)%26
            if k >= mod:
                k -= mod
                s[i] = 'a'
            if k == 0:
                break
    
    if k > 0:
        mod = ((ord(s[-1])-97)+k)%26
        s[-1] = chr(mod+97)
    print(''.join(s))

if __name__ == '__main__':
    main()



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

using namespace std;
#define repr(i,a,b) for (int i=a; i<b; i++)
#define rep(i,n) for (int i=0; i<  n; i++)
 
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

const long long INF = 1LL << 60;

bool dp[100100];

int main () {
    string s1,s2,s3;
    cin >> s1 >> s2 >> s3;

    cout <<(char) toupper(s1[0]) <<(char)toupper(s2[0])<<(char) toupper(s3[0])<< endl;


    
}



Measured memory_bytes: 256
open System

let N = stdin.ReadLine()|>int
let p = stdin.ReadLine().Split()|>Array.map int
[<EntryPoint>]
let main argv =
    let mutable ans = 0
    for i in [0..N-1] do
        ans <- ans + if p.[i]<>i+1 then 1 else 0
    match (ans-2)>0 with
    |true -> printfn "%s" "NO"
    |false -> printfn "%s" "YES"
    0
   

Measured memory_bytes: 14044
#include <iostream>
using namespace std;
int dp[55][3005];
int n,m,s,i,j,k;
int main(void){
    while(1){
    cin>>n>>m>>s;
    if(!n)break;
    n*=n;
    for(i=0;i<=n;i++)for(j=0;j<=s;j++)dp[i][j]=0;
    dp[0][0]=1;
    for(i=1;i<=m;i++)for(j=n;j>0;j--)for(k=i;k<=s;k++)dp[j][k]=(dp[j-1][k-i]+dp[j][k])%100000;
    cout<<dp[n][s]<<endl;
    }
}

Measured memory_bytes: 3672
int main(void)
{
  int A, B, C;
  
  scanf("%d %d %d", &A, &B, &C);
  if ((A == B || B == C || C == A) && !(A == B && B == C))
  {
    printf("Yes\n");
  }
  else
  {
    printf("No\n");
  }
  
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#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 pb(x) push_back(x)
#define fi first
#define se second
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef vector<int> vi;
const int inf = 1e9+7;
const int INF = 1e18+7;
int mod = 1e9+7;

string str;
int solve(int k, int n, string str, int sum){
	if(k == n){
		sum += atoll(str.c_str());
		return sum;
	}
	int ret = 0;
	ret += solve(k+1, n, str, sum);
	string s = str.substr(0, k);
	rep(i,k)str[i] = '0';
	ret += solve(k+1,n, str, sum+atoll(s.c_str()));
	return ret;
}

signed main(){
	cin >> str;
	int n = str.size();
	int ans = solve(1, n, str, 0);
	printf("%lld\n", ans);
	return 0;
}




Measured memory_bytes: 256
//Congrats on 10,000,000 submissions!

#include<stdio.h>
#include<string.h>
int main(){
	char s[20],t[20],u[20];
	int a,b;
	scanf("%s%s%d%d%s",s,t,&a,&b,u);
	if(strcmp(s,u))printf("%d %d\n",a,b-1);
	else printf("%d %d\n",a-1,b);
}

Measured memory_bytes: 128
#include<iostream>
using namespace std;
typedef long long ll;
int main()
{
  int n,i,res=0;
  ll x,y,d;
  cin >> n >> d;
  for(i=0;i<n;i++){
    cin >> x >> y;
    if(x*x+y*y<=d*d)
      res++;
  }
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 3632
/**
 *      ABC 67 C
 *      author  : kyomukyomupurin
 *      created : 2018-09-12 01:44:50
**/

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int N; cin >> N;
    ll a[N] = {};
    for (int i = 0; i < N; ++i) {
        cin >> a[i];
    }

    ll s[N] = {}; s[0] = a[0];
    for (int i = 1; i < N; ++i) {
        s[i] = a[i] + s[i - 1];
    }
    ll X = 2000000000;

    for (int i = 0; i < N - 1; ++i) {
        ll min = abs(s[i] - (s[N - 1] - s[i]));
        if (min < X){
            X = min;
        }
    }
    cout << X << '\n';

    return 0;
}

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

namespace ConsoleApplication7
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            if (N % 10 == 3) {
                Console.WriteLine("bon");
            }
            else if (N % 10 == 0 || N % 10 == 1 || N % 10 == 6 || N % 10 == 8)
            {
                Console.WriteLine("pon");
            }
            else
            {
                Console.WriteLine("hon");
            }

        }
    }
}


Measured memory_bytes: 27540
#include <bits/stdc++.h>
#define INF 1e18
#define int long long
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define Repr(i, n, a) for (int i = (n); i >= (a); i--)
#define rep(i, n) Rep(i, 0, n)
#define repr(i, n) Repr(i, n, 0)
#define all(a) a.begin(), a.end()
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int mod = 1000000007;

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    int ans = 0;
    for (int i = 1; i < n - 1; i++)
    {
        if (a[i - 1] <= a[i] && a[i] <= a[i + 1])
            ans++;
        if (a[i - 1] >= a[i] && a[i] >= a[i + 1])
            ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		String[] x = saori.nextHayami().split("");
		
		if(x.length < 3){
			System.out.println(0);
		} else {
			int ten = Integer.parseInt(x[x.length-2] + x[x.length-1]);
			String str = "";
			for(int i = 0;i < x.length - 2;i++){
				str += x[i];
			}
			int buy = Integer.parseInt(str);
			boolean ans = false;
			for(int i = 0;i < buy;i++){
				if(ten >= 5){
					ten -= 5;
				}else if(ten >= 4){
					ten -= 4;
				}else if(ten >= 3){
					ten -= 3;
				}else if(ten >= 2){
					ten -= 2;
				}else if(ten >= 1){
					ten -= 1;
				}else if(ten == 0){
					ans = true;
				}
			}
			if(ans || ten == 0){
				System.out.println(1);
			} else {
				System.out.println(0);
			}
		}	
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 22740