akhauriyash/Code-Regression huggingface dataset:
#include<algorithm>
#include<set>
#include<iostream>
#include<cassert>
#include<complex>
#include<vector>
#include<cmath>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
const double eps = 1e-10;
typedef complex<double> P;
typedef vector<P> Polygon;
#define N 4002


double cross(P a,P b){
  return a.real()*b.imag()-a.imag()*b.real();
}

bool isp(P a,P b,P c){
  return abs(a-c)+abs(b-c)<abs(a-b)+eps;
}

bool is_intersected_ls(P a1,P a2,P b1,P b2){
  if ( isp(a1,a2,b1)||isp(a1,a2,b2)||isp(b1,b2,a1)||isp(b1,b2,a2))return true;
  if ( cross(a2-a1,b1-a1)*cross(a2-a1,b2-a1)<0 &&
       cross(b2-b1,a1-b1)*cross(b2-b1,a2-b1)<0)return true;
  return false;
}

P intersection_ls(P a1,P a2,P b1,P b2){
  P b=b2-b1;
  double d1=abs(cross(b,a1-b1));
  double d2=abs(cross(b,a2-b1));
  double t =d1/(d1+d2);
  return a1+(a2-a1)*t;
}


int make_data(Polygon &a,int y){
  int n = a.size();
  vector<pair<int,int> > block;
  static P tmp[4];
  static P a1,a2;
  static P b1,b2;
  rep(i,n){
    a1=a[i],a2=a[(i+1)%n];
    tmp[4];
    tmp[0].real()=-2001;
    tmp[0].imag()=y+1;
    tmp[1].real()=2001;
    tmp[1].imag()=y+1;
    tmp[2].real()=-2001;
    tmp[2].imag()=y;
    tmp[3].real()=2001;
    tmp[3].imag()=y;
    if (is_intersected_ls(a1,a2,tmp[0],tmp[1]) &&is_intersected_ls(a1,a2,tmp[2],tmp[3])){
      b1=intersection_ls(a1,a2,tmp[0],tmp[1]);
      b2=intersection_ls(a1,a2,tmp[2],tmp[3]);
      pair<int,int> ins=make_pair((int)floor(min(b1.real(),b2.real())),(int)ceil(max(b1.real(),b2.real())));
      block.push_back(ins);
    }

  }

  int ret=0;
  sort(block.begin(),block.end());

  if ( block.size()!=0){
    int prev=-10000;
    for(int i=0;i<block.size();i+=2){
      ret+=block[i+1].second-max(prev,block[i].first);
      prev=block[i+1].second;
    }
    //cout <<"end"<<endl;
  }
  return ret;
}


int solve(Polygon & a){
  int ret=0;
  int mini=10000,maxi=-10000;
  rep(i,a.size())mini=min(mini,(int)a[i].imag()),maxi=max(maxi,(int)a[i].imag());
  REP(i,mini,maxi+1)ret+=make_data(a,i);


  return ret;
}


main(){
  int n;
  while(cin>>n && n){
    Polygon a;
    P tmp;
    rep(i,n){
      cin>>tmp.real()>>tmp.imag();
      a.push_back(tmp);
    }
    cout << solve(a)<<endl;
  }
}

Measured memory_bytes: 992
#include <bits/stdc++.h>
#define Maxn 307
using namespace std;
int N,m,modp;
int c[Maxn][Maxn],f[Maxn][Maxn],s[Maxn][Maxn];
int main()
{
	scanf("%d%d%d",&N,&m,&modp);
	c[0][0]=1;
	for (int i=1;i<=300;i++)
	{
		c[i][0]=1;
		for (int j=1;j<=i;j++)
			c[i][j]=(c[i-1][j]+c[i-1][j-1])%modp;
	}
	for (int i=0;i<=m;i++)
		f[0][i]=1,s[0][i]=i+1;
	for (int n=1;n<=N;n++)
		for (int k=1;k<=m;k++)
		{
			f[n][k]=0;
			for (int j=0;j<n;j++)
			{
				int del=(1LL*c[n-1][j]*f[n-j-1][k])%modp;
				del=(1LL*del*s[j][k-1])%modp;
				f[n][k]=(f[n][k]+del)%modp;
			}
			s[n][k]=(s[n][k-1]+f[n][k])%modp;
		}
	printf("%d\n",f[N][m]);
	return 0;
}


Measured memory_bytes: 1280
#include<iostream>
#include<set>
#include<string>
using namespace std;
int main(){
  int n;
  cin>>n;
  set<string> a;
  string b;
  for(int i=0;i<n;i++){
     cin>>b;
     a.insert(b);
  }
  cout<<a.size()<<endl;
  return 0;
}

Measured memory_bytes: 19172
# coding: utf-8
# Your code here!
x,n = map(int, input().split())
if n > 0:
    p = list(map(int , input().split()))
else:
    p  = []
a = list(set(list(range(-100,102))) - set(p))
values = []
for i in a:
    values = values +  [[abs(x-i), i]]
values.sort(key=lambda x: x[0])
mins = values[0][0]
b = []
for i in values:
    if i[0] > mins:
        break
    b += [i[1]]
b.sort()
print(b[0])


Measured memory_bytes: 9232
/*
 * 16-7-23_ABC042_B.cpp

 *
 *  Created on: 2016/07/23
 *      Author: ryoma
 */

#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int N,L;
string S[100];

int main() {
	cin >> N >> L;
	for(int i=0;i<N;i++){
		cin >> S[i];
	}
	sort(S,S+N);
	for(int i=0;i<N;i++){
		cout << S[i] ;
	}
	cout << endl;

	return 0;
}





Measured memory_bytes: 256
#include <bits/stdc++.h>
#define SZ(x) ((int) (x).size())
using namespace std;

int main() {
    #ifdef LOCAL_RUN
    freopen("task.in", "r", stdin);
    freopen("task.out", "w", stdout);
    //freopen("task.err", "w", stderr);
    #endif // ONLINE_JUDGE
    ios::sync_with_stdio(false);
    cin.tie(0);

    int values[] = {1, 2, 4, 8};
    int costs[4];
    for (int i = 0; i < 4; ++i) {
        cin >> costs[i];
    }
    for (int i = 1; i < 4; ++i) {
        costs[i] = min(costs[i], 2 * costs[i - 1]);
    }
    int64_t n;
    cin >> n;
    n *= 4;
    int64_t ans = 0;
    for (int i = 3; i >= 0; --i) {
        ans += (n / values[i]) * costs[i];
        n %= values[i];
    }
    cout << ans << '\n';
}


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int M = scn.nextInt();
		int ans = 0;
		if (M == 1) {
			ans = 0;
		} else {
			int[] X = new int[M];
			int[] DX = new int[M - 1];

			for (int i = 0; i < M; i++) {
				X[i] = scn.nextInt();
			}
			Arrays.sort(X);
			ans += X[M - 1] - X[0];

			for (int i = 0; i < M - 1; i++) {
				DX[i] = X[i + 1] - X[i];
			}
			Arrays.sort(DX);
			for (int i = 0; i < N - 1; i++) {
				if(M-2-i < 0)break;
				ans -= DX[M - 2 - i];
			}
		}
		System.out.println(ans);
	}

}


Measured memory_bytes: 52268
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rrep(i,n) for(ll i = 1; i <= (n); ++i)
#define drep(i,n) for(ll i = (n)-1; i >= 0; --i)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (ll)(x).size()
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
ll gcd(ll a,ll b){if(a%b==0){return b;}else{return(gcd(b,a%b));}}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
const int INF=1e9;
const ll MX = 1e18;
const ll MOD=INF+7;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};
const double PI=acos(-1);
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
#define YN {puts("YES");}else{puts("NO");}
const ll MAX = 1000001;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {fac[0] = fac[1] = 1;finv[0] = finv[1] = 1;inv[1] = 1;for (ll i = 2; i < MAX; i++){fac[i] = fac[i - 1] * i % MOD;inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;finv[i] = finv[i - 1] * inv[i] % MOD;}}
long long COM(ll n, ll k){if (n < k) return 0;if (n < 0 || k < 0) return 0;return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;}

int main() {
  int n, m;
  cin >> n >> m;
  vi broken(n+1);
  rep(i,m) {
    int a;
    cin >> a;
    broken[a] = 1;
  }
  vi dp(n+2);
  dp[n] = 1;
  for (int i = n-1; i >= 0; i--) {
    if (broken[i]) {
      dp[i] = 0;
      continue;
    }
    dp[i] = (dp[i+1] + dp[i+2]) % MOD;
  }
  cout << dp[0] << endl;
}    


Measured memory_bytes: 3988
from itertools import permutations

N,M = map(int,input().split())

Matrix = [[False for i in range(N)] for j in range(N)]

for i in range(M) :
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    Matrix[a][b] = True
    Matrix[b][a] = True

for i in range(N) :
    Matrix[i][i] = True

arange = list(range(2,N+1))

ans = 0
for pm in permutations(arange) :
    pm = [1] + list(pm)
    for row,col in zip(pm,pm[1:]) :
        row -= 1
        col -= 1
        if not Matrix[row][col] :
            break
    else :
        ans += 1
print(ans)


Measured memory_bytes: 3064
package main

import "fmt"

func main() {
	var n, m int
	fmt.Scan(&n, &m)

	as := make([]int, m)
	bs := make([]int, m)
	for i := 0; i < m; i++ {
		fmt.Scan(&as[i], &bs[i])
	}

	uf := newUnionFind(n + 1)

	cs := make([]int, 0)
	sum := n * (n - 1) / 2
	cs = append(cs, sum)
	for i := m - 1; i >= 1; i-- {
		a, b := as[i], bs[i]
		if !uf.same(a, b) {
			ac := uf.size(a)
			bc := uf.size(b)
			sum -= ac * bc
		}
		cs = append(cs, sum)
		uf.unite(a, b)
	}

	for i := m - 1; i >= 0; i-- {
		fmt.Println(cs[i])
	}
}

// UnionFind .
type UnionFind struct {
	par   []int
	rank  []int
	sizes []int
}

func newUnionFind(n int) UnionFind {
	u := UnionFind{}
	u.par = make([]int, n)
	u.rank = make([]int, n)
	u.sizes = make([]int, n)

	for i := 0; i < n; i++ {
		u.par[i] = i
		u.rank[i] = 0
		u.sizes[i] = 1
	}

	return u
}

func (u UnionFind) unite(x, y int) {
	x = u.root(x)
	y = u.root(y)
	if x == y {
		return
	}

	if u.rank[x] < u.rank[y] {
		u.par[x] = y
		u.sizes[y] += u.sizes[x]
	} else {
		u.par[y] = x
		u.sizes[x] += u.sizes[y]
		if u.rank[x] == u.rank[y] {
			u.rank[x]++
		}
	}
}

func (u UnionFind) root(x int) int {
	if u.par[x] == x {
		return x
	}
	u.par[x] = u.root(u.par[x])
	return u.par[x]
}

func (u UnionFind) same(x, y int) bool {
	return u.root(x) == u.root(y)
}

func (u UnionFind) size(x int) int {
	return u.sizes[u.root(x)]
}


Measured memory_bytes: 11396
#include <bits/stdc++.h>
#define rep(i, z, n) for(int i = z; i < n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
//const int INF = 1<<29;
//const int MODINF = 1000000007;
using namespace std;

int main(){
    string S;
    cin >> S;
    if (S.at(1) == 'R') cout << "ABC" << endl;
    else cout << "ARC" << endl;
}


Measured memory_bytes: 3548
import * as fs from "fs";

// inputで受け取り配列化する
const input = fs.readFileSync("/dev/stdin", "utf8").split("\n");
input.shift();

let ac = 0;
let wa = 0;
let tle = 0;
let re = 0;

for (const result of input) {
  switch (result) {
    case "AC":
      ac++;
      break;
    case "WA":
      wa++;
      break;
    case "TLE":
      tle++;
      break;
    case "RE":
      re++;
      break;
    default:
      break;
  }
}

console.log(`AC x ${ac}
WA x ${wa}
TLE x ${tle}
RE x ${re}`);


Measured memory_bytes: 40696
#include <stdio.h>
#define MAX 100000
int parent(int i) {return i/2;}
int left(int i) {return 2*i;}
int right(int i) {return 2*i+1;}

int main()
{
  int H,i,A[MAX+1];
  scanf("%d",&H);
  for(i=1;i<=H;i++) scanf("%d",&A[i]);
  for(i=1;i<=H;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(parent(i)>=1) printf("parent key = %d, ",A[parent(i)]);
    if(left(i)<=H) printf("left key = %d, ",A[left(i)]);
    if(right(i)<=H) printf("right key = %d, ",A[right(i)]);
    printf("\n");
  }


  return 0;
}

Measured memory_bytes: 608
import java.util.Scanner;
class Main{
	
		int n;
		int x;
		int y;
		int b;
		int p;
		int kin=0;
		int wari;
		 public void solve(){
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
	
      for(int i=0; i<n; i++){ 
		x = sc.nextInt();
	    y = sc.nextInt();
		b = sc.nextInt();
		p = sc.nextInt();
		kin=(b*x)+(p*y);
		
    	if(b>5 && p>=2){
		 kin =(x*b +y*p)*4/5;
		 
    	}else if(b<5){
			     b=5;
    	}
		      if(p<2){
			  	 p=2;
		      }
			  int wari = (x*b + y*p)*4/5;
			  
			  if(kin>wari){
			  	kin=wari;
			  }
		
		System.out.println(kin);
      }
		 }
		 
		 public static void main(String[] args){
        Main obj = new Main();
        obj.solve();
    }
}

Measured memory_bytes: 23280
n = int(input())
c = list(map(int,input().split()))
a = [0]
a += c
a.append(0)
b = [0 for i in range(n+1)]
b[0] = abs(a[1])
count = abs(a[1])
for i in range(1,n):
    b[i] = abs(a[i+1]-a[i])
    count += b[i]
count += abs(a[n])
b[n] = abs(a[n])
for i in range(n):
    print(count - b[i] - b[i+1] + abs(a[i+2] - a[i]))



# 0 3 5 -1 0
# 0 5 -1 0
# 0 3 -1 0
# 0 3 5 0

Measured memory_bytes: 14048
import static java.lang.System.*;
import java.util.*;

public class Main {
	public static final int MOD = 1000000007;
	
    public static void main(String[] args) {
        Scanner sc = new Scanner(in);

        int n = sc.nextInt();
		int[] stone = new int[n];
		for(int i=0; i<n; i++) stone[i] = sc.nextInt()-1;
		
		int[] next = new int[n];
		Arrays.fill(next, -1);
		int[] last = new int[200000];
		Arrays.fill(last, -1);
		for(int i=n-1; i>=0; i--) {
			if(last[stone[i]] > i+1) 
				next[i] = last[stone[i]];
			last[stone[i]] = i;
		}
		
		long[] dp = new long[n];
		Arrays.fill(dp, 0L);
		dp[0] = 1L;
		
		for(int i=0; i<n-1; i++) {
			dp[i+1] += dp[i];
			dp[i+1] %= MOD;
			
			if(next[i] != -1) {
				dp[next[i]] += dp[i];
				dp[next[i]] %= MOD;
			}
			
			// for(int j=0; j<n; j++) out.print(dp[j] + " ");
			// out.println();
		}

        out.println(dp[n-1]);
    }
}


Measured memory_bytes: 82508
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vd=vector<double>;
using vvd=vector<vd>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using vs=vector<string>;
#define rep(i,n) range(i,0,n)
#define range(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define LINF    	((ll)1ll<<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI			3.141592653589793

template<class S,class T>ostream& operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s; a=0;} return os;}

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	
	int n,m;
	cin>>n>>m;
	vi divisor;
	for(int i=1;i*i<=m;i++){
	    if(m%i==0){
	        divisor.push_back(i);
	        divisor.push_back(m/i);
	    }
	}
	sort(all(divisor));
	for(auto&d:divisor){
	    if(d>=n){
	        cout<<m/d<<endl;
	        return 0;
	    }
	}
	cout<<1<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int A,B,x,y;
    scanf("%d%d",&A,&B);
    x=B*2;
    y=(A-x);
    if(A<=x)
    {
        printf("0\n");

    }
    else
    {
        printf("%d\n",y);

    }
       return 0;
}



Measured memory_bytes: 1704
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A):
    sa = sum(A)
    M = N*(N+1)//2
    if sa % M != 0:
        return 'NO'

    k = sa // M

    kk = k
    for i in range(N):
        b = A[(i+1) % N] - A[i]
        b -= k
        if b > 0:
            error_print('a')
            return 'NO'
        if b % N != 0:
            error_print('b')
            return 'NO'
        kk += b // N

    if kk != 0:
        error_print('c')
        return 'NO'

    return 'YES'


def main():
    N = read_int()
    A = read_int_n()
    # N = 10
    # A = [random.randint(1, 10**9) for _ in range(N)]
    # print(A)
    print(slv(N, A))


if __name__ == '__main__':
    main()


Measured memory_bytes: 83820
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector <long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define boost ios::sync_with_stdio(false); cin.tie(0)
using namespace std;
const int inf = 1e9 + 5;
const ll inf64 = 1e18 + 5;

map <ll, ll> mp;
ll solve(ll n)
{
	if(n == 1) return 1;
	
	if(!mp[n]) mp[n] = 1 + 2ll * solve(n / 2);
	return mp[n];
}
int main()
{
	boost;
	ll n;
	cin >> n;
	cout << solve(n);
}


Measured memory_bytes: 256
import java.io.*;

public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static void main(String[] args) throws Exception {

		long A = nextLong();
		long B = nextLong();
		int K=nextInt();

		for(long i=A;i<=B;i++){
			if(i-A<K || B-K<i){
				System.out.println(i);
			}
		}
	}




	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}


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

using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;

#define ALL(x) x.begin(), x.end()

template<typename T>
constexpr T inf = static_cast<T>(pow(10, static_cast<int>(log10(numeric_limits<T>::max())))) + 7;
constexpr llong mod = 1e9+7;

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

  cout << (S[2] == S[3] && S[4] == S[5] ? "Yes": "No") << endl;

  return 0;
}

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

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int N;
int A[222222];

signed main(){
    cin>>N;
    rep(i,N)cin>>A[i+1],A[i+1]+=A[i];

    map<int,int>cnt;cnt[0]=0;
    int ma=0;
    for(int i=1;i<=N;i++){
        if(cnt.find(A[i])!=cnt.end()){
            chmax(ma,i-cnt[A[i]]);
        }
        else{
            cnt[A[i]]=i;
        }
    }

    cout<<ma<<endl;
    return 0;
}

Measured memory_bytes: 17096
#include <iostream>
#include <vector>
#include <map>
using namespace std;
typedef long long ll;
ll len, exi[8000][26], X;
string A, ans;
vector<ll> shiten;
map<char, ll> mp;
int main(void){
    // Your code here!
    cin >> A;
    len = A.length();
    shiten.push_back(len);
    for (ll i = len - 1; i >= 0; i--){
        mp[A[i]]++;
        if (mp.size() == 26){
            shiten.insert(shiten.begin(), i);
            mp.clear();
        }
    }
    for (ll i = 0; i < shiten.size(); i++){
        for (ll j = 0; j < 26; j++){
            bool jud = false;
            for (ll l = X; l < shiten[i]; l++){
                if (A[l] - 'a' != j) continue;
                jud = true;
                break;
            }
            if (jud) continue;
            ans += (char)(97 + j);
            if (shiten[i] == len) break;
            for (ll l = shiten[i];; l++){
                if (A[l] - 'a' != j) continue;
                X = l + 1;
                break;
            }
            break;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 644
#include <stdio.h>

int main(void){
	int a[5];
	int i;
	int x,y;
	for(i=0;i<5;i++){
		scanf("%d",&a[i]);
	}
	x=a[1]/a[3];
	if (a[1]%a[3]!=0){
		x++;
	}
	y=a[2]/a[4];
	if (a[2]%a[4]!=0){
		y++;
	}
	if (x>y){
		printf("%d\n",a[0]-x);
	}else{
		printf("%d\n",a[0]-y);
	}
	
	return 0;
}

Measured memory_bytes: 596
//C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

//Hang in there!

using namespace std;


int main() {
	char c;
	int ans = 0;
	for (int i = 0; i < 4; i++) {
		cin >> c;
		if (c == '+') {
			ans++;
		}
		else {
			ans--;
		}
	}
	cout << ans << endl;
}



Measured memory_bytes: 256
const fs = require("fs");

function clamp(n) {
  if (n < 0) {
    return 0;
  }
  return n;
}
const input = fs.readFileSync("/dev/stdin", { encoding: "utf8" }).split(" ");
const A = parseInt(input[0]);
const B = parseInt(input[1]);
const K = parseInt(input[2]);

const a = clamp(A - K);
const delta = clamp(K - A);
const b = clamp(B - delta);
console.log(a + " " + b);


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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> cnt(9);
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    cnt[min(a, 3200) / 400]++;
  }
  int mi = 0, ma = 0;
  for (int i = 0; i < 8; i++) {
    mi += !!cnt[i];
  }
  ma = mi + cnt[8];
  mi = max(1, mi);
  cout << mi << " " << ma << '\n';
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define M 13

int main(void)
{
  int i;
  char s[M];

  scanf("%s", s);

  for (i = 0; i < M - 1; i++) {
    if (i == 4) {
      printf(" ");
    }
    printf("%c", s[i]);
  }
  printf("\n");

  return 0;
}


Measured memory_bytes: 128
#include<stdio.h>
int main()
{
	int n,m,x,y;
	int a[5]={0},b[5]={0};
	scanf("%d%d",&n,&m);
	int flag=1;
	while(m--)
	{
		scanf("%d%d",&x,&y);
		if(b[x]==0||a[x]==y) {a[x]=y;b[x]=1;}
		else flag=0;
	}

	if(flag){
		if(n==1)	printf("%d\n",a[1]);
		else{
			if(a[1]==0&&b[1]==0)	a[1]=1;
			if(a[1]==0&&b[1]==1)
			{
				printf("-1\n");
				return 0;
			}
			for(int i=1;i<=n;i++)
			printf("%d",a[i]);
			printf("\n");
			}
		}
	else printf("-1\n");
	
	return 0;
 } 

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

#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << " = " << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define SP << " " <<

typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;

const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const int INF = (1LL << 60); // 1152921504606846976
const double EPS = (1 >> 30);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> inline T ceil(T a, T b) {return T((a + b - 1) / b);}
template<class T> inline T round(T a, T b) {return T(a / b);}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }
template <class T> inline void out(T &a) { bool flag=true; for(auto&x:a){if(flag) {flag=false;} else{ cout << ' '; } cout<<x; } cout << endl; }



//----------------------------------------------------------------
int nmax=200000; // 2*(10^5)
vvec g(nmax);

void solve()
{
    
    string s;
    cin>>s;
    int n=s.size();
    vector<int> dp(2019);
    ll ans=0;
    rep(i,n){
        int x=s[i]-'0';
        vec kari(2019,0);
        kari[x]++;
        rep(j,2019){
            if(dp[j]>0){
                if((j*10+x)%2019==0) ans+=dp[j];
                kari[(j*10+x)%2019]+=dp[j];
            }
        }
        dp=kari;
    }
    cout<<ans<<endl;
}
//-----------------------------------------------------------------

signed main(){ ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15);
    int repeat = 1;
    // cin >> repeat;
    while(repeat--) solve();
}


Measured memory_bytes: 8316
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define sz(v) (ll((v).size()))
#define forn(i,n) for(ll i=0;i<(n);i++)
#define forr(i,n) for(ll i=(n)-1;i>=0;i--)
#define forv(i,v) forn(i,sz(v))
#define fors(i,s) for(auto i=(s).begin();i!=(s).end();++i)
#define all(v) (v).begin(),(v).end()
#define clr(x) memset(x,0,sizeof(x))

const ll N = 3030;
const ll K =1e5+5;
const ll mod= 1e9+7;
ll fact[2*K],all[N],good[N];
ll n;
vector<pair<ll,ll>> v;

void add_self(ll &a, ll b){a+=b;if(a>=mod)a-=mod;}
void sub_self(ll &a, ll b){a-=b;if(a<0)a+=mod;}
void mul_self(ll &a, ll b){a*=b;a%=mod;}

void prec()
{
	fact[0]=1;for(int i=1;i<2*K;i++){fact[i]=i;mul_self(fact[i],fact[i-1]);}
}

ll power(ll a, ll x)
{
	ll ret=1;
	while(x)
	{
		if(x%2)mul_self(ret,a);
		x/=2;
		mul_self(a,a);
	}
	return ret;
}

ll mod_inv(ll x){return power(x,mod-2);}

ll Cal (ll r, ll c)
{
	ll x=1;
	mul_self(x,fact[r+c]);
	mul_self(x,mod_inv(fact[r]));
	mul_self(x,mod_inv(fact[c]));
	return x;
}

int main()
{
    ios_base::sync_with_stdio(false);

    prec();

	ll h,w;cin>>h>>w>>n;
	forn(i,n){ll r,c;cin>>r>>c;r--,c--;v.pb(mp(r,c));}v.pb(mp(0,0));v.pb(mp(h-1,w-1));n+=2;
	sort(all(v));

	good[0]=0;
	for(int i=1;i<n;i++)
	{
		ll r=v[i].F,c=v[i].S;
		good[i]=Cal(r,c);
		forn(j,i)
		{
			ll rx=v[j].F,cx=v[j].S;
			ll diffr = r-rx,diffc=c-cx;
			if(diffr< 0 || diffc<0)continue;

			ll sub =  good[j];
			mul_self(sub,Cal(diffr,diffc));
			sub_self(good[i],sub);
		}
	}
	cout<<good[n-1]<<endl;
}


Measured memory_bytes: 1920
n,l = map(int, input().split())
aji = [l+i for i in range(n)]


min_aji = 10**9+7
ind = 0
for i in range(n):
    if min_aji > abs(aji[i]):
        ind = i
        min_aji = abs(aji[i])

print(sum(aji)-aji[ind])

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i ++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PL;
typedef pair<int,int> P;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const vector<int> dy = {-1,0,1,0};
const vector<int> dx = {0,1,0,-1};

int main() {
    int k; cin >> k;
    ll ans = 0;
    for (int i = 1; i < k + 1; i++) {
        for (int j = 1;j < k + 1; j++) {
            for (int l = 1; l < k + 1; l++) {
                int g = __gcd(__gcd(i,j),l);
                ans += g;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3632
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:https://atcoder.jp/contests/abc158/tasks/abc158_a>
 問題文============================================================
 A - Station and Bus
 =================================================================
 解説=============================================================
 文字列Sの中に
 
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    string S;cin >> S;
    set<char> st; for(auto c:S) st.insert(c);
    if(st.size() == 2) return "Yes";
    else return "No";
    
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<string>() << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e18;
int mod = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int mod_pow(int x,int y) {
    int res = 1;
    while(y > 0) {
        if(y%2) {
            res = res*x%mod;
        }
        x = x*x%mod;
        y/=2;
    }
    return res;
}
int fac[200005], finv[200005], inv[200005];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < 200005; i++){
        fac[i] = fac[i - 1] * i % mod;
        inv[i] = mod - inv[mod%i] * (mod / i) % mod;
        finv[i] = finv[i - 1] * inv[i] % mod;
    }
}
int COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}
signed main() {
    COMinit();
    int n,k;
    cin >> n >> k;
    int ans = 0;
    for(int i = 0; i <= min(n,k); i++) {
        ans += COM(n,i)*COM(n-1,n-i-1);
        ans %= mod;
    }
    cout << ans << endl;
}


Measured memory_bytes: 8288
#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,w;
    cin>>n>>w;
    long long int weight[n],value[n];
    for(long long int i=0;i<n;i++)
    {
        long long int v1,v2;
        cin>>v1>>v2;
        weight[i]=v1;
        value[i]=v2;
    }
    long long int dp[2][w+1];
    for(int i=0;i<2;i++)
    {
        for(int j=0;j<=w;j++)
        {
            dp[i][j]=0;
        }
    }
    long long int i=0;
    for(long long int p=1;p<=n;p++)
    {
        i=i^1;
        for(long long int j=0;j<=w;j++)
        {
            
            if(weight[p-1]<=j)
            {
                dp[i][j]=max(value[p-1]+dp[abs(i-1)][j-weight[p-1]],dp[abs(i-1)][j]);
            }
            else
            {
                dp[i][j]=dp[abs(i-1)][j];
            }
        }
    }
    cout<<max(dp[0][w],dp[1][w]);
    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
    ll a, b, c;
    cin >> a >> b >> c;
    if((a % 2 == 0) || (b % 2 == 0) || (c % 2 == 0)){
        cout << 0 << endl;
        return 0;
    }
    ll mini;
    ll mid;
    mini = min(a, min(b, c));
    mid = a + b + c - min(a, min(b, c)) - max(a, max(b, c));
    cout << mini * mid << endl;


        return 0;
}

Measured memory_bytes: 256
N = int(input())
H = list(map(int,input().split()))

ans = 0
i = 0

for k in range(N):
    tmp = 0
    while i<N-1:
        if H[i]>=H[i+1]:
            tmp += 1
            i += 1
        else:
            break
    ans = max(tmp,ans)
    if i >= N-1:
        break
    i += 1
    
    
print(ans)


Measured memory_bytes: 15020
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>

using namespace std;

typedef long long ll;

#define  kak 1000000000000;



int main(){
    ll r;
    ll D;
    ll x2000;
    ll xnext;

    cin >> r;
    cin >> D;
    cin >> x2000;
    ll xprev = x2000;
    for (int i = 0; i < 10; ++i) {
        xnext = r * xprev - D;
        cout << xnext << endl;
        xprev = xnext;
    }
    return 0;
}




Measured memory_bytes: 256
import java.util.*;
import static java.lang.Integer.*;
import static java.lang.Long.*;
//import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		int c = parseInt(sc.next());
		sc.close();
		boolean f = false;
		int aa = 0;
		for(i=1;i<b;i++) {
			aa += a;
			if(aa%b==c) {
				f = true;
				break;
			}
		}
		out.println(f?"YES":"NO");
	}
	
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i < (n+1); ++i)
using namespace std;
using ll = long long;
const ll INF = +10010010000;
typedef pair<ll,ll> P;
const int mod = 1e9+7;

struct mint{
    ll x;
    mint(ll x=0):x((x%mod+mod)%mod){}
    mint& operator+=(const mint a){
        (x+=a.x)%=mod;
        return *this;
    }
    mint& operator-=(const mint a){
        (x-=mod-a.x)%=mod;
        return *this;
    }
    mint& operator*=(const mint a){
        (x *= a.x)%= mod;
        return *this;
    }
    mint operator+(const mint a)const{
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a)const{
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a)const{
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
      if(!t)return 1;
      mint a = pow(t>>1);
      a*=a;
      if(t%1)a*=*this;
      return a;
    }

    // for prime mod
    mint inv() const {
      return pow(mod-2);
    }
    mint& operator/=(const mint a){
      return (*this) *= a.inv();
    }
    mint operator/(const mint a)const{
      mint res(*this);
      return res/=a;
    }
};

struct combination{
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1){
    fact[0] = 1;
    for(int i = 1; i<n;++i)fact[i] = fact[i-1] * i;
    ifact[n] = fact[n].inv();
    for(int i = n; i>=1;--i) ifact[i-1] = ifact[i] * i;
  }
  mint operator()(int n, int k){
    if(k<0 || k>n)return 0;
    return fact[n] * ifact[k] + ifact[n-k]; 
  }
};
int main(){
    int n;
    cin >> n;
    // while(n>0){
    //     if(n/10==0){
    //         break;
    //     }
    //     n<<1;
    // }
    n%=10;
    if(n==3){
        cout << "bon"<<endl;
    }else if(n==0||n==1||n==6||n==8)cout<<"pon"<<endl;
    else cout<<"hon"<<endl;
    return 0;
}

Measured memory_bytes: 3596
#include <stdio.h>

void call(int n){
    int i = 1;
    int x;

    do{
        x = i;
        if(x%3 == 0){
            printf(" %d", i);
        }else{
            do{
                if(x%10 == 3){
                    printf(" %d", i);
                    x = 0;
                }else x /= 10;
            }while(x);
        }
    }while(++i <= n);
    putchar('\n');
}

int main(){
    int n;

    scanf("%d", &n);
    call(n);
    return 0; 
}


Measured memory_bytes: 2104
#include "bits/stdc++.h"
#define REP(i, n) for(int i = 0; i < int(n); i++)
#define FOR(i,n,m) for(int i = int(n); i < int(m); i++)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 6;
const ll LLINF = 1e18 + 1;

int main() {
    int n, m; cin >> n >> m;
    string s; cin >> s;
    reverse(s.begin(), s.end());
    vector<int> ans;
    int now = 0;
    while (now < n) {
        if (n < now + m) {
            ans.push_back(n - now);
            break;
        }
        for (int i = m - 1; i >= 0; i--) {
            if (s[now + i + 1] == '0') {
                ans.push_back(i + 1);
                now += i + 1;
                break;
            }
            else if (i == 0) {
                puts("-1");
                return 0;
            }
        }
    }
    for (int i = ans.size() - 1; i >= 0;i--) {
        cout << ans[i] << " ";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 1144
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string>
#include <cmath>
#include <sstream>
#include <istream>
#include <iomanip>
#include <typeinfo>
#include <stack>

using namespace std;
typedef long long ll;
ll N;

int main(){

    ll N;
    cin >> N;

    vector<ll > H(N);

    for(ll i = 0; i < N; i++){
        cin >> H[i];
    }

    if(N == 1){
        cout << "Yes" << endl;
        return 0;
    }else if(N == 2){
        if(H[0] > H[1] ){
            if(H[0] - H[1] == 1){
                cout << "Yes" << endl;
                return 0;
            }else{
                cout << "No" << endl;
                return 0; 
            }

        }else{
            cout << "Yes" << endl;
            return 0;          
        }
    }

    if(H[0] > H[1] && H[0] - H[1] == 1){
        //まだ１大きいだけならなんとかなる
        if(H[0] != 1){
            H[0]--;
        }  
    }else if(H[0] == H[1]){
        //一緒でもなんとかなる
        if(H[0] != 1){
            H[0]--;
        }  
    }else if(H[0] < H[1]){
        if(H[0] != 1){
            H[0]--;
        }  
    }else{
        //無理
        cout << "No" << endl;
        return 0;
    }

    for(ll i = 1; i < N - 1; i++){
        if(H[i] > H[i-1]){
            if(H[i] > H[i + 1] && H[i] - H[i + 1] == 1){
                if(H[i] != 1){
                    H[i]--;
                }  
            }else if(H[i] == H[i + 1] || H[i] < H[i + 1]){
                if(H[i] != 1){
                    H[i]--;
                }  
            }else{
                //無理
                cout << "No" << endl;
                return 0;                
            }
        }else if(H[i] == H[i - 1]){
            //この場合は低くできない
            if(H[i] > H[i + 1]){
                //無理
                cout << "No" << endl;
                return 0;               
            }
        }
        //cout << i << endl;
    }

    cout << "Yes" << endl;



} 


Measured memory_bytes: 1024
package main

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

const (
	initialBufSize = 1e4
	maxBufSize     = 1e6 + 7
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

func main() {
	N := nextInt()
	var ans int
	// 1はすべての約数なのでどこかで足す
	// wg := new(sync.WaitGroup)
	// wg.Add(1)
	// go func() {
	for i := 2; i <= N; i++ {
		for j := 1; i*j <= N; j++ {
			ans += i * j
		}
	}
	// 	wg.Done()
	// }()
	// wg.Wait()
	ans += N * (N + 1) / 2
	fmt.Println(ans)
}

func nextLine() 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 abs(a int) int {
	if a > 0 {
		return a
	} else {
		return -a
	}
}

func pow(p, q int) int {
	res := p
	if q == 0 {
		return 1
	}
	for i := 0; i < q-1; i++ {
		res *= p
	}
	return res
}

func MinOf(vars ...int) int {
	min := vars[0]
	for _, i := range vars {
		if min > i {
			min = i
		}
	}
	return min
}

func MaxOf(vars ...int) int {
	max := vars[0]
	for _, i := range vars {
		if max < i {
			max = i
		}
	}
	return max
}

func gcdof2numbers(a int, b int) int {
	if b == 0 {
		return a
	}
	return gcdof2numbers(b, a%b)
}

func lcmof2numbers(a int, b int) int {
	return a / gcdof2numbers(a, b) * b
}

// マイナスの場合は考慮していない
func fuctorial(a int) int {
	if a == 1 || a == 0 {
		return 1
	} else {
		return fuctorial(a-1) * a
	}
}

func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}

// 素因数分解したmapを返す
func primeFuctorize(n int) map[int]int {
	pf := map[int]int{}
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			pf[i]++
			n /= i
		}
	}
	if n != 1 {
		pf[n]++
	}
	return pf
}


Measured memory_bytes: 1824
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    N = II()
    ac = 0
    wa = 0
    tle = 0
    re = 0
    for i in range(N):
        s = input()
        if s == 'AC':
            ac += 1
        elif s == 'TLE':
            tle += 1
        elif s == 'WA':
            wa += 1
        elif s == 'RE':
            re += 1

    print(f'AC x {ac}')
    print(f'WA x {wa}')
    print(f'TLE x {tle}')
    print(f'RE x {re}')

if __name__ == '__main__':
    solve()


Measured memory_bytes: 9280
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {($($a:expr),*) => {println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);}}
#[allow(unused_macros)]
macro_rules! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);
impl<T: PartialEq> Eq for Total<T> {}
impl<T: PartialOrd> Ord for Total<T> { fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering { self.0.partial_cmp(&other.0).unwrap() }}

#[allow(dead_code)]
const MAX:usize = 100006;
#[allow(dead_code)]
const INF_U32:u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32:i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64:u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64:i64 = 1 << 62;
#[allow(dead_code)]
const MOD:i64 = 1e9 as i64 + 7;

#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

use std::f64;

fn main() {
    input!{a:f64, b:f64, x:f64};
    let y = x/(a*a);
    if x >= a*a*b/2.0 {
        println!("{}", (2.0*(b-y)/a).atan()*180.0/f64::consts::PI);
    }
    else {
        println!("{}", (a*b*b/(2.0*x)).atan()*180.0/f64::consts::PI);
    }
}

Measured memory_bytes: 4732
import java.util.Scanner;

public class Main {

	static class Point{
		double x;
		double y;
		
		public Point(double x, double y) {
			this.x = x;
			this.y = y;
		}
		
		public String toString(){
			return x + " " + y;
		}
	}
	
	static int n;
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		Point start = new Point(0.0, 0.0);
		Point end = new Point(100.0, 0.0);
		System.out.println(start);
		make(start, end, 0);
		System.out.println(end);
		scan.close();
	}
	
	public static void make(Point start, Point end, int i) {
		if (n <= i) {
			return;
		}

		Point s = new Point((2.0 * start.x + 1.0 * end.x) / 3.0, (2.0 * start.y + 1.0 * end.y) / 3.0);
		Point t = new Point((1.0 * start.x + 2.0 * end.x) / 3.0, (1.0 * start.y + 2.0 * end.y) / 3.0);
		
		double ux = (t.x - s.x) * Math.cos(Math.toRadians(60)) - (t.y - s.y)*Math.sin(Math.toRadians(60)) + s.x;
		double uy = (t.x - s.x) * Math.sin(Math.toRadians(60)) + (t.y - s.y)*Math.cos(Math.toRadians(60)) + s.y;
		Point u = new Point(ux, uy);
		
		
		make(start, s, i + 1);
		System.out.println(s);
		make(s, u, i + 1);
		System.out.println(u);
		make(u, t, i + 1);
		System.out.println(t);
		make(t, end, i + 1);
	}

	
	
	
}

Measured memory_bytes: 32268
#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;
  
int main() {
    int a, b;
    cin >> a >> b;
    string S;
    for (int i = 0; i < a; i++) {
        cin >> S;
        cout << S << endl;
        cout << S << endl;
    }
}

Measured memory_bytes: 256