akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <sstream> // std::ostringstream
#include <string>
#include <tuple>
#include <vector>

using namespace std;

int main(int argc, char* argv[]) {
 string S;
  cin >> S;

int count=0;
for(int i=0;i<S.length();i++){
if(S[i]=='o')count++;
}

if(count >= 8){
cout << "YES" << endl;
}else if(15-S.length() >= 8-count){
cout << "YES" << endl;
}else{
cout << "NO" << endl;
}

    
 
  return 0;
}


Measured memory_bytes: 256
def f(x, a_list):
    return sum(map(lambda y: y ^ x, a_list))

N, K = map(int, input().split())
a_list = list(map(int, input().split()))

bit_num = len(bin(K)) - 2
dp = ["0" for _ in range(bit_num)]

for i in range(bit_num):
    bits = dp[:i]

    one = bits + ["1"] + ["0"] * (bit_num - i - 1)
    zero = bits + ["0"] + ["0"] * (bit_num - i - 1)

    if f(int("".join(one), 2), a_list) > f(int("".join(zero), 2), a_list) and int("".join(one), 2) <= K:
        dp[i] = "1"
    else:
        dp[i] = "0"
print(f(int("".join(dp), 2), a_list))


Measured memory_bytes: 14984
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

int main(){
    ll N;
    cin >> N;
    vector<ll> H(N);
    rep(i, 0, N) cin >> H[i];
    ll cnt = 0, ans = 0, pre = -1;
    rep(i, 0, N){
        if(H[i] <= pre){
            cnt++;
            ans = max(ans, cnt);
        }else{
            cnt = 0;
        }
        pre = H[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define ALL(A) (A).begin(),(A).end()
#define ll long long
const ll mod = 1e9+7;
const ll INF = 2*1e18;
const int inf = 1e9+7;

char s[1005][1005];
int main(void){
	int N;
	cin >> N;
	for(int i=0;i<N;i++){
		for(int j=0;j<N;j++){
			if((i+j)%2==0){
				s[i][j] = '#';
			}else{
				s[i][j] = '.';
			}
		}
	}
	int ans = 0;
	for(int i=0;i<N;i++){
		if(s[i][0] =='.'){
			ans ++;
			s[i][0] = 'x';
		}
		if(s[0][i] =='.'){
			ans++;
			s[0][i] = 'x';
		}
		if(s[N-1][i] =='.'){
			ans++;
			s[N-1][i] = 'x';
		}
	}
	for(int i=1;i<N-1;i++)
		if(i%3==2){
			for(int j=0;j<N;j++){
				if(s[i][j] =='.'){
					ans++;
					s[i][j] = 'x';
				}
			}
		}
	
	cout << ans << endl;
	for(int i=0;i<N;i++)for(int j=0;j<N;j++){
		if(s[i][j] =='x')cout << i << " " << j << endl;
	}
}

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

#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define all(x) begin(x), end(x)
#define uniq(x) (x).erase(unique(all(x)), end(x))
#define bit(n) (1LL << (n))
#define cdiv(a, b) (((a) - 1) / (b) + 1)
#define dump(x) cerr << #x " = " << (x) << endl
using vint = vector<int>;
using vvint = vector<vint>;
using pint = pair<int, int>;
using vpint = vector<pint>;
template<typename T> using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>;
constexpr long double PI = 3.1415926535897932384626433832795028L;
constexpr int DY[8] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr int DX[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b) {
    while (b) { swap(a %= b, b); }
    return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
template<typename T> void fin(T mes) {
    cout << mes << endl;
    exit(0);
}
template<typename T, typename U> bool chmax(T &a, const U &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T, typename U> bool chmin(T &a, const U &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template<typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &rhs) {
    os << "(" << rhs.first << ", " << rhs.second << ")";
    return os;
}
template<typename T> ostream &operator<<(ostream &os, const vector<T> &rhs) {
    os << "{";
    for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
        os << *itr << (next(itr) != rhs.end() ? ", " : "");
    }
    os << "}";
    return os;
}
struct setup {
    static constexpr int PREC = 20;
    setup() {
        cout << fixed << setprecision(PREC);
        cerr << fixed << setprecision(PREC);
    };
} setup;

int N, M;
int H[110000];
bool bad[110000];
signed main() {
    cin >> N >> M;
    rep(i, N) { cin >> H[i]; }
    rep(i, M) {
        int A, B;
        cin >> A >> B;
        A--, B--;
        if (H[A] <= H[B]) { bad[A] = true; }
        if (H[A] >= H[B]) { bad[B] = true; }
    }
    int ans = 0;
    rep(i, N) { if (!bad[i]) { ans++; }}
    cout << ans << endl;
}


Measured memory_bytes: 4524
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
f = 0
for x in str(n):
    f += ord(x) - ord('0')
print("Yes" if n % f == 0 else "No")


Measured memory_bytes: 3316
# coding: utf-8
import re
import bisect
from datetime import datetime as dt
import bisect
import fractions

def gcd(a, b):
    return int(fractions.gcd(a, b))

def lcm(a, b):
    return a // gcd(a,b) * b

class slist(list):
    def __init__(self, *args, **kw):
        list.__init__(self, *args, **kw)
        self.sort()

    def append(self, value):
        bisect.insort(self,value)

    def index_left(self, value):
        return bisect.bisect_left(self, value)

def calc(n, a, b):
    return n//a + n//b - n//lcm(a,b)
    #aa = (int(n/a))
    #bb = (int(n/b))
    #ab = (int(n/lcm(a,b)))
    #return int(aa + bb - ab)

if __name__ == '__main__':
    a, b, c, d = map(int, input().split())
    ans = calc(b, c, d) - calc(a - 1, c, d)
    print(b - a + 1 - ans)


Measured memory_bytes: 5328
#include <stdio.h>

int main(){
  int a, b, c;
  scanf("%d",&a);
  scanf("%d",&b);
  if(a>b){
    c = a;
    a = b;
    b = c;
  }
  if((a==1)&&(b==2)) printf("3");
  else if((a==1)&&(b==3)) printf("2");
  else printf("1");
}

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

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pair<int,int>>
#define vpll vector<pair<ll,ll>>
#define fr(i,k,n) for (int i = k; i < n; ++i)
#define fri(i,k,n) for (int i = k; i >= n; --i)
#define INF (ll)1e16
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define all(arr) arr.begin(),arr.end()

void boost(){
  ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

ll dp[402][402],sum[402][402];

ll fun(int i,int j){
  if(dp[i][j])
    return dp[i][j];
  ll mn=INF;
  fr(k,i,j)
    mn=min(mn,fun(i,k)+fun(k+1,j));
  return dp[i][j]=sum[i][j]+mn;
}

void solve(){
  int n;
  cin>>n;
  fr(i,0,n){
    cin>>dp[i][i];
    sum[i][i]=dp[i][i];
  }
  fr(i,0,n-1){
    fr(j,i+1,n){
      sum[i][j]=sum[i][j-1]+dp[j][j];
    }
  }
  cout<<fun(0,n-1)-sum[0][n-1]<<endl;
  return;
}

int main()
{
  boost();
  
  int tc=1;
  //cin>>tc;
  while(tc--)
    solve();
  return 0;
}

Measured memory_bytes: 6152
#include <bits/stdc++.h>
 
using namespace std;
 
int main(int argc, char *argv[]) {
    int A, B;
    cin >> A >> B;
    int s = A - (2 * B);
    if (s <= 0) {
        cout << 0 << endl;
    } else {
        cout << s << endl;
    }
    return 0;
}

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

int main() {
  int n;
  ll ans = 0;
  cin >> n;
  vector<int> a(n+1),b(n);
  rep(i,n+1) {
    cin >> a[i];
  }
  rep(i,n) cin >> b[i];

  rep(i,n) {
    int c = min(a[i],b[i]);
    a[i] -= c; b[i] -= c;
    ans += c;
    c = min(a[i+1],b[i]);
    a[i+1] -= c; b[i] -= c;
    ans += c;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef string str;
static const long long INF = 1LL<<59;
static const long long MOD = (ll)1e9+7;

#define endl "\n"
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define REP(i, n) for(ll i=0;i<n;i++)
#define SZ(v) (ll)((v).size())
#define WHOLE(v) (v).begin(), (v).end()
#define ASC(v) sort((v).begin(), (v).end())
#define DESC(v) sort((v).rbegin(), (v).rend())
#define INV(v) reverse((v).begin(), (v).end())
#define FOLDL(src, dst, lambda) partial_sum((src).begin(), (src).end(), (dst).begin(), lambda)
#define FOLDR(src, dst, lambda) INV(src);partial_sum((src).begin(), (src).end(), (dst).begin(), lambda);INV(dst)
#define CUMSUML(src, dst) FOLDL(src, dst, [](auto a, auto b) {return a+b;})
#define CUMSUMR(src, dst) FOLDR(src, dst, [](auto a, auto b) {return a+b;})
#define ACCUM(v, d0, lambda) accumulate((v).begin(), (v).end(), d0, lambda)
#define SUM(v, d0) ACCUM(v, d0, [](auto a, auto b) {return a+b;})
#define ERASE(v, i) v.erase(v.begin() + i)
#define UNIQ(v) ASC(v);v.erase(unique(v.begin(), v.end()), v.end())

template <typename T>void debug(T t) {cerr << t << endl;}
template <typename T, typename ...Args>void debug(T t, Args ...args) {cerr << t << " ";debug(args...);}
template <typename T>void out(T t) {cout << t << endl;}
template <typename T, typename ...Args>void out(T t, Args ...args) {cout << t << " ";out(args...);}

void solve() {
    vll A(3);
    for(auto &a:A) cin >> a;
    ASC(A);
    if(A[0] == A[1]) {
        out(A[2]);
    }else {
        out(A[0]);
    }
}

int main() {
    fast_io;
    solve();
    return 0;
}

Measured memory_bytes: 256
#![allow(dead_code)]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}
fn read_vec2<T: std::str::FromStr>(n: usize) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
fn main() {
    println!("{}", (0..read::<i32>()).map(|_| "ACL").collect::<String>());
}

Measured memory_bytes: 2028
a, b, c, d = map(int, input().split())

def euclid(a, b):
  if b == 0:
    return a
  return euclid(b, a % b)

x = c * d // euclid(c, d)

bd = b // d
bc = b // c
bx = b // x
bsum = b - bd - bc + bx

ad = (a - 1) // d
ac = (a - 1) // c
ax = (a - 1) // x
asum = (a - 1) - ad - ac + ax

print(bsum - asum)


Measured memory_bytes: 3060
using System;
using System.Linq;

namespace abc_055_C
{
    class Program
    {
        public static long a = 0;
        static void Main(string[] args)
        {
            long[] gf = Console.ReadLine().Split().Select(long.Parse).ToArray();
            long s = gf[0], c = gf[1];
            if (s * 2 < c)
            {
                c -= s * 2;
                Console.WriteLine(s + c / 4);
            }
            else
            {
                Console.WriteLine(c / 2);
            }
            Console.ReadLine();
        }
    }
}


Measured memory_bytes: 13268
#演習2-5　Kannnondo
while True:
    n=int(input())
    if n==0:
        break
    else:
        A=[0]*40
        A[0],A[1],A[2]=1,1,2

        for i in range (3,31):
            A[i]=A[i-1]+A[i-2]+A[i-3]
        if A[n]%3650==0:
            print(A[n]//3650)
        else:
            print((A[n]//3650)+1)


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

ll W, H;

ll mn(ll w, ll h) {
    if (w*h % 2 == 0) return w*h/2;
    return (max(w,h)/2) * min(w,h);
}
ll mx(ll w, ll h) {
    if (w*h % 2 == 0) return w*h/2;
    return (max(w,h)/2 + 1) * min(w,h);
}

int main() {
    scanf("%lld %lld", &H, &W);
    ll ans = 1e9;
    for (ll i = 1; i < H; i++) {
        ll m1 = max(W*i,mx(H-i,W));
        ll m2 = min(W*i,mn(H-i,W));
        ans = min(ans, m1-m2);
    }
    for (ll i = 1; i < W; i++) {
        ll m1 = max(H*i,mx(W-i,H));
        ll m2 = min(H*i,mn(W-i,H));
        ans = min(ans, m1-m2);
    }
    printf("%lld\n", ans);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mp make_pair
#define pb push_back
#define fst first
#define snd second
typedef long long ll;
typedef pair<int,int> pii;

int n,cnt=1,ans[200007];
string st;
vector<int> pos[2][2],s11;

void print(){puts("Yes"); rep(i,n+n) printf("%d ",ans[i]); exit(0);}
void erase(vector<int> &v,int x){v.erase(find(v.begin(),v.end(),x));}

int main()
{
	cin>>n>>st;st="1"+st+"1";
	rep(i,n+n) pos[st[i]-'0'][st[i+1]-'0'].pb(i);
	
	if(pos[1][1].size()==n+n)
	{
		if(n&1) {puts("No"); return 0;}
		rep(i,pos[1][1].size()) {ans[pos[1][1][i]]=cnt+(i&1); if((i&3)==3)cnt+=2;}
		print();
	}
	
	if(pos[1][1].size()&1){puts("No"); return 0;}
	if(pos[1][1].size()%4==0)
	{
		rep(i,pos[1][0].size()) ans[pos[1][0][i]]=ans[pos[0][1][i]]=cnt++;
		rep(i,pos[0][0].size()) {ans[pos[0][0][i]]=cnt; if(i&1) cnt++;}
		rep(i,pos[1][1].size()) {ans[pos[1][1][i]]=cnt+(i&1); if((i&3)==3)cnt+=2;}
		print();
	}
	
	int a=0;while(a<=n+n&&st[a]=='1')a++;
	if(a>n+n){puts("No");return 0;}
	while(1)
	{
		while(a<n+n&&st[a+1]=='0')a++;
		if(a>=n+n){puts("No");return 0;}
		if(a+2<=n+n&&st[a+2]=='1') break;
		a+=2;
	}
	int b=a+1;while(b<=n+n&&st[b]=='1')b++;
	if(b>n+n){puts("No");return 0;}
	int p=0;while(p<pos[1][1].size()&&pos[1][1][p]>a&&pos[1][1][p]<b-1) p++;
	if(p>=pos[1][1].size()){puts("No");return 0;}
	while(p+1<pos[1][1].size()&&pos[1][1][p+1]<a) p++;
	int x=a,y=b-1,z=a+1,w=pos[1][1][p];
	erase(pos[0][1],x);erase(pos[1][0],y);ans[x]=ans[y]=cnt++;
	erase(pos[1][1],z);erase(pos[1][1],w);ans[z]=ans[w]=cnt++;
	
	
	rep(i,pos[1][0].size()) ans[pos[1][0][i]]=ans[pos[0][1][i]]=cnt++;
	rep(i,pos[0][0].size()) {ans[pos[0][0][i]]=cnt; if(i&1) cnt++;}
	rep(i,pos[1][1].size()) {ans[pos[1][1][i]]=cnt+(i&1); if((i&3)==3)cnt+=2;}
	print();
	return 0;
}

Measured memory_bytes: 3708
/*
これを入れて実行
g++ code.cpp
./a.out
 */

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long double ld;

int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};

const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;

bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}

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

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

ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}

ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}

//-----------------------ここから-----------

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

    vector<int> b(n);
    for(int i = 0; i < n; i++) cin >> b[i];

    for(int i = 0; i < n; i++){
        if(b[i] > i + 1){
            cout << -1 << endl;
            return 0;
        }
    }

    int ok = true;
    vector<int> l;
    while(true){
        for(int i = b.size() - 1; i >= 0; i--){
            if(b[i] == i + 1){
                b.erase(b.begin() + i);
                l.push_back(i + 1);
                break;
            }
            if(i == 0){
                ok = false;
            }
        }

        if(!ok || b.size() == 0) break;
    }

    

    if(!ok){
        cout << -1 << endl;
    } else {
        reverse(l.begin(), l.end());
        for(int i = 0; i < l.size(); i++){
            cout << l[i] << endl;
        }
    }
}


Measured memory_bytes: 256
K = int(input())

if(K%2 == 0):
    print("-1")
    exit()

A = 7
ans = 1
while(A < K): #O(6)
    A = A*10 + 7
    ans += 1

while(True):
    #print(A)
    A = A % K #1
    if(ans > K):
        print("-1")
        exit()
    if(A==0): #1
        print(ans)
        exit()
    A = A * 10 + 7 # 1
    ans += 1# 1


Measured memory_bytes: 9188
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define quick                    \
    ios::sync_with_stdio(false); \
    cin.tie(0);
#define time cerr << (0.1 * clock()) / CLOCKS_PER_SEC << endl;
#define mod 1000000007
typedef long long ll;
typedef pair<ll, ll> pl;
#define forn(n) for (ll i = 0; i < ll(n); i++)

void solve() {
    string s;
    cin >> s;
    for (int i = 0; i < s.length(); ++i) {
        if (s[i] == '?') {
            cout << 'D';
            continue;
        }
        cout << s[i];
    }
    cout << endl;
}

int main() {
    quick;
    solve();
}

Measured memory_bytes: 3780
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <stack>

#define MAX_N 1000000

using namespace std;

int main()
{
    int X, Y;

    scanf("%d%d", &X, &Y);
    if(Y % 2 == 0 && Y >= 2 * X && 4 * X >= Y)
        printf("Yes");
    else
        printf("No");

    return 0;

}


Measured memory_bytes: 1732
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>

using namespace std;

int main(){
    unsigned long long N, sum = 0;
    vector<unsigned long long> a, b, c, num;
    cin >> N;

    a.resize(N);
    b.resize(N);
    c.resize(N);
    num.resize(N + 1);
    num[0] = 0;
    copy_n(istream_iterator<unsigned long long>(cin), N, a.begin());
    copy_n(istream_iterator<unsigned long long>(cin), N, b.begin());
    copy_n(istream_iterator<unsigned long long>(cin), N, c.begin());
    auto d = [](unsigned long long x, unsigned long  long y){ return y < x; };
    sort(a.begin(), a.end(), d);
    sort(b.begin(), b.end(), d);
    sort(c.begin(), c.end(), d);
    
    vector<unsigned long long>::iterator   ai = a.begin(),
                            bi,
                            ni = num.begin() + 1,
                            ci = c.begin();
    for(bi = b.begin(); bi < b.end(); bi++){
        while(ci < c.end() && *bi < *ci) ci++;
        *ni = (unsigned long long)distance(c.begin(), ci) + *(ni - 1);
        ni++;
    }
    
    bi = b.begin();
    ni = num.begin();
    for(ai = a.begin(); ai < a.end(); ai++){
        while(bi < b.end() && *ai < *bi){
            bi++;
            ni++;
        }
        sum += *ni;
    }
    
    cout << sum << endl;
    return 0;
}


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

int n;

int main() {
    while(1) {
        cin >> n;
        if (n == 0) break;
        vector<int> hist(10, 0);
        for (int i = 0; i < n; ++i) {
            int c;
            cin >> c;
            hist[c]++;
        }
        for (auto cnti : hist) {
            for (int i = 0; i < cnti; ++i) {
                cout << "*";
            }
            if (cnti == 0) cout << "-";
            cout << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 2996
#include <stdio.h>

int main(void)
{
  int i, x;

  i=0;

  while(1)
    {
      scanf("%d", &x);

      if(x==0)
        break;

      else
        {
          i++;

          printf("Case %d: %d\n", i, x);
        }
    }
  return 0;
}

Measured memory_bytes: 600
#include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;

#define int long long int
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define rep(i,a,b) for (int i = a; i < b; ++i)
#define dbg(x) { cerr<<"> "<<#x<<": "<<x<< endl; }
#define dbg2(x,y) { cerr<<"> "<<#x<<": "<<x<<" , "<<#y<<": "<<y<<endl; }
#define dbg3(x,y,z) { cerr<<"> "<<#x<<": "<<x<<" , "<<#y<<": "<<y<<" , "<<#z<<": "<<z<<endl; }
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
const int inf = INT_MAX;
const double eps = 0.0000001;
const double PI = acos(-1.0);
const int MOD = 1e9+7;
const int N  = 1e5+5;

int a[N], dp[N];

signed main(){
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif  
    IOS;

    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
    	cin >> a[i];
    }
    dp[n] = 0;
    dp[n-1] = abs(a[n]-a[n-1]);
    dp[n-2] = abs(a[n]-a[n-2]);
    for (int i = n-3; i >= 1; i--) {
    	dp[i] = min(dp[i+2]+abs(a[i+2]-a[i]), dp[i+1]+abs(a[i+1]-a[i]));
    }
    cout << dp[1];
    return 0;
}

Measured memory_bytes: 1792
const input = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n');
console.log(input.map(function(x) {
  const arr = x.split(' ').map(Number);
  return arr[0] == 0 ? '' : function(h, w) {
    return Array(h + 1).join(Array(w + 1).join('#').concat('\n'));
  }(arr[0], arr[1]);
}).join('\n').trim().concat('\n'));

Measured memory_bytes: 16768
#include <bits/stdc++.h>
#define repl(i, l, r) for (int i = l; i < r; i++)
#define rep(i, n) repl(i, 0, n)
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int, int>;

int main()
{
    ll n;
    cin >> n;
    for(ll i = floor(sqrt(n)); i > 0; i--) {
        if(n % i == 0) {
            cout << i + n / i - 2 << endl;
            break;
        }
    }
    return 0;
}


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

using namespace std;

int main() {
	int n;
	cin >> n;
	vector<pair<int, int>> edge;
	vector<vector<int>> connected(n);
	for (int i = 0; i < n-1; ++i) {
		int a, b;
		cin >> a >> b;
		a--;
		b--;
		edge.push_back(make_pair(a, b));
		connected[a].push_back(b);
		connected[b].push_back(a);
	}
	vector<int> field(n, -1);
	field[0] = 0;
	field[n - 1] = 1;
	vector<int> current_fill1,current_fill2;
	vector<int> next_fill1,next_fill2;
	current_fill1.push_back(0);
	current_fill2.push_back(n-1);
	while (true) {
		next_fill1.clear();
		for (auto val : current_fill1) {
			for (auto con : connected[val]) {
				if (field[con] == -1) {
					field[con] = 0;
					next_fill1.push_back(con);
				}
				else if (field[con] == 0) {
					continue;
				}
				else {
					continue;
				}
			}
		}
		current_fill1 = next_fill1;

		next_fill2.clear();
		for (auto val : current_fill2) {
			for (auto con : connected[val]) {
				if (field[con] == -1) {
					field[con] = 1;
					next_fill2.push_back(con);
				}
				else if (field[con] == 1) {
					continue;
				}
				else {
					continue;
				}
			}
		}
		current_fill2 = next_fill2;

		if (current_fill1.size() == 0 && current_fill2.size() == 0) break;
	}
	int fennec_count = 0;
	for (int i = 0; i < n; ++i) {
		if (field[i] == 0) fennec_count++;
	}
	int snuke_count = n - fennec_count;
	if (fennec_count > snuke_count) {
		cout << "Fennec" << endl;
	}
	else {
		cout << "Snuke" << endl;
	}
}

Measured memory_bytes: 7156
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())
N, K = map(int, input().split())
D = input().split()

for n in range(N, 100000):
    s = str(n)
    ok = True
    for c in s:
        if c in D:
            ok = False
    if ok:
        print(n)
        break

    
    

Measured memory_bytes: 9364
use std::collections::BinaryHeap;

fn main() {
    let mut input = String::new();
    std::io::stdin().read_line(&mut input);
    let mut vec = Vec::with_capacity(2);
    vec = input
        .split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect::<Vec<i32>>();
    let mut data = BinaryHeap::with_capacity(vec[1] as usize);
    input.clear();
    std::io::stdin().read_line(&mut input);
    data = input
        .split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect::<BinaryHeap<i32>>();
    let mut sum = 0;
    let length = data.len() / 4;
    // let remainder = data.len() % 4;
    for i in 0..3 {
        for i in 0..length {
            sum += data.pop().unwrap();
        }
        if sum >= vec[0] {
            println!("Yes");
            return;
        }
    }
    while !data.is_empty() {
        sum += data.pop().unwrap();
    }
    if sum >= vec[0] {
        println!("Yes");
        return;
    }
    println!("No");
}

Measured memory_bytes: 6396
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const ll inf = 1e18;

int main() {
    int a, b;
    cin >> a >> b;
    cout << (a-1)*(b-1) << endl;
}

Measured memory_bytes: 256
ks = input()
k, s = [int(x) for x in ks.split(" ")]
comb = []
for x in range(min(k,s) + 1)[::-1]:
    for y in range(min(x + 1, s - x + 1))[::-1]:
        z = s - x - y
        if (x <= k and y <= k and z <= k and y <= x and z <= y):
            comb.append([x,y,z])
count = 0
for c in comb:
    l = len(set(c))
    if l == 1:
        count += 1
    elif l == 2:
        count += 3
    else:
        count += 6
print(count)

Measured memory_bytes: 127272
//おまじない
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#define INF 1e9+7
#define roop(i,m,n) for(int i=m;i<n;i++)
#define mroop(i,m,n) for(int i=m;i<n;i--)
#define NO cout<<"NO"<<endl;
#define YES cout << "YES"<<endl;
#define No cout << "No"<<endl;
#define Yes cout << "Yes"<<endl;
using namespace std;
typedef long long int ll;


//(int)'a'は97 (int)'A'は65
//おまじない



int main() {

	int f, e;
	string str;
	cin >> str;

	for (int i = 0;i<str.size(); i++) {
		if (str[i] == 'A') {
			f = i;
			break;
		}
	}

	for (int i = str.size()-1; i >= 0;i--) {
		if (str[i] == 'Z') {
			e = i;
			break;
		}
	}

	cout << e - f + 1 << endl;


	return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <string>
#include <algorithm>
#include <cmath>
#include <climits>
#define REP(i, n) for(int i=0; i<(n); i++)
#define FOR(i, a, n) for(int i=(a); i<(n); i++)
using namespace std;

int main(){
    string s;
    cin>>s;
    s[5]=' ';
    s[13]=' ';
    cout << s << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include <cstdio>
#include <float.h>
#include <ctype.h>
 using namespace std;
 int main(void) {
		int a, b, c, d, e, f, g, h, i, j, k, l, m, o, p, q, r, s, t, u, v, w, x, y, z;
		scanf("%d %d %d %d %d", &a, &b, &c, &d, &e);
		f = a * e;
		if (e<=c) {
			g = b;
		}
		else {
			h = e - c;
			g = h*d+b;
		}
		if (f < g) {
			printf("%d\n", f);
		}
		else if(g<f){
			printf("%d\n", g);
		}
		return 0;
 }



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

int main()
{
string S;
  cin>>S;
  
 if(S.length()%2==1)
 {cout<<"No"<<endl;
 }
  else
  {
  int f=0;
    for(int i=0;i<S.length()-1;i+=2)
    {if(S[i]!='h'||S[i+1]!='i')
    {f=1;
     break;
    }
    }
  if(f==0)
  {
    cout<<"Yes"<<endl;
  }
  else
  {cout<<"No"<<endl;
  }
  }
}


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

const int MOD = 1000000007;

int main() {
    int N, K;
    std::cin >> N >> K;

    std::vector<int> count, tmp;
    for (int i = 1; i * i <= N; i++) {
        count.push_back(i);
        if (i != N / i)
            tmp.push_back(N / i);
    }

    for (int i = tmp.size() - 1; i >= 0; i--)
        count.push_back(tmp[i]);
    int M = count.size();
    for (int i = M - 1; i > 0; i--)
        count[i] -= count[i - 1];

    std::vector<int> dp(count);
    for (int i = 0; i < K - 1; i++) {
        for (int i = 1; i < M; i++)
            dp[i] = (dp[i] + dp[i - 1]) % MOD;
        std::reverse(dp.begin(), dp.end());
        for (int i = 0; i < M; i++)
            dp[i] = 1LL * dp[i] * count[i] % MOD;
    }

    int ans = 0;
    for (int i = 0; i < M; i++)
        ans = (ans + dp[i]) % MOD;
    std::cout << ans << "\n";
}

Measured memory_bytes: 892
#include<cstdio>
#include<cctype>

int main() {
    char ch;
    int cnt[26] = {};

    while (scanf("%c", &ch) != EOF) {
        if (isupper(ch)) ch = tolower(ch);
        cnt[ch - 'a']++;            
    }
    for (int i = 0; i < 26; i++) printf("%c : %d\n", 'a' + i, cnt[i]);

    return 0;
}

Measured memory_bytes: 976
import copy
n=int(input())
ls=list(map(int,input().split(' ')))
new_ls=copy.copy(ls)
new_ls.insert(0,0)

flag=True
for i in range(1,n):
    new_ls[i]=new_ls[i]-1
    if new_ls[i]>=new_ls[i-1] and new_ls[i+1]>=new_ls[i]:
        pass
    else:
        new_ls[i]+=1
        if new_ls[i]<new_ls[i-1] or new_ls[i+1]<new_ls[i]:
            flag=False
            break

if flag:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 63836
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();


int main() {
    int n, m, x;
    cin >> n >> m >> x;
    vector<int> arr(m, 0);
    for(int& val: arr)
        cin >> val;
    sort(arr.begin(), arr.end());
    auto it_x = lower_bound(arr.begin(), arr.end(), x);
    auto it_0 = lower_bound(arr.begin(), arr.end(), 0);
    auto it_n = lower_bound(arr.begin(), arr.end(), n);
    cout << min(it_n-it_x, it_x-it_0) << endl;
    return 0;
}




Measured memory_bytes: 256
<?php
/*
    Problem URL : https://beta.atcoder.jp/contests/abc066/tasks/abc066_b

    Score  :
    Result :
    Time   : ms
    Memory : KB
 */

// define('DEBUG', true);
define('DEBUG', false);

ini_set('error_reporting', E_ALL & ~E_NOTICE);

fscanf(STDIN, "%s", $S);

$ans = 0;

for ($i = 2; $i < strlen($S); $i += 2) {
    $strA = substr($S, 0, $i / 2);
    $strB = substr($S, $i / 2, $i / 2);
    if ($strA == $strB) {
        $ans = $i;
    }
}

echo $ans . PHP_EOL;


Measured memory_bytes: 4604
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010

/* 再帰降下法 */
// char *p = str; res = expr(p);

int val = 0;

int term(char* &s);
int number(char* &s);
int factor(char* &s);
int expr(char* &s);

//数
int number(char* &s){
  int res = 0;
  
  if(*s == '0' || *s == '1') return (*s++)-'0';
  if('a' <= *s && *s <= 'd') return (val >> ((*s++) - 'a'))%2;

  return res;
}

//乗算除算(優先順位:高)
int term(char* &s){
  int res = factor(s);
  while(1){
    if(*s == '^') res ^= factor(++s);
    else if(*s == '*') res *= factor(++s);
    else break;
  }
  return res;
}

//括弧か数
int factor(char* &s){
  if(*s == '-') return !factor(++s);
  if(*s != '(') return number(s);
  int res = expr(++s); s++;
  return res;
}

//式(優先順位: 低)
int expr(char* &s){
  int res = term(s);
  return res;
}

int check(char *s){
  int res = 0;
  for(int i=0;i<16;i++){
    char *p = s;
    val = i;
    res = res*2 + expr(p);
  }
  return res;
}

vector<string> vec[16];
int par = 0;

void make_expr(){
  string s = ".";
  for(int i=0;i<6;i++){
    s[0] = "01abcd"[i];
    vec[1].push_back(s);
  }

  for(int i=2;i<=15;i++){

    for(int j=0;j<vec[i-1].size();j++){
      vec[i].push_back("-" + vec[i-1][j]);
    }

    for(int j=1;j<i-3;j++){
      int r = i-3-j;
      if(j > r) continue;

      for(int p=0;p<vec[j].size();p++){
        for(int q=0;q<vec[r].size();q++){
          vec[i].push_back("(" + vec[j][p] + "*" + vec[r][q] + ")");
          vec[i].push_back("(" + vec[j][p] + "^" + vec[r][q] + ")");
          assert(j+r+3 == i);
        }
      }
    }

    sort(vec[i].begin(), vec[i].end());
    vec[i].erase(unique(vec[i].begin(), vec[i].end()), vec[i].end());
    //debug(vec[i].size());
  }
}

bool solve(){
  char s[30];

  scanf("%s", s);
  if(s[0] == '.') return 0;

  int res = check(s);
  
  for(int i=1;i<=15;i++){
    for(int j=0;j<vec[i].size();j++){
      char s[17];
      strcpy(s, vec[i][j].c_str());
      if(res == check(s)){
        printf("%d\n", i);
        return 1;
      }
    }
  }
  
  printf("%d\n", 16);
  
  return 1;
}


int main(){
  make_expr();

  while(solve());
  
  return 0;
}



Measured memory_bytes: 49572
#include <iostream>
#include <cstdio>
#include <vector>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
using namespace std;

int main() {
    long long N;

    cin >> N;
    string str;

    while (N) {
        long long val = (N-1)%26;
        str += (val + 'a');

        ++val;
        N -= val;
        N /= 26;
    }

    reverse(str.begin(), str.end());
    cout << str << endl;

    return 0;
}

Measured memory_bytes: 3596
#include <iostream>
#include <string>
using namespace std;
int main() {
    string s;
    cin >> s;
    if (s == "Sunny") cout << "Cloudy" << endl;
    if (s == "Cloudy") cout << "Rainy" << endl;
    if (s == "Rainy") cout << "Sunny" << endl;
    return 0;
}


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

#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef complex<double> point;
#define xx real()
#define yy imag()

#define REP(i, a, b) for(int i = (a); i < (int)(b); i++)
#define REPN(i, a, b) for(int i = (a); i <= (int)(b); i++)
#define FA(it, x) for(__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define SZ(x) (int)(x).size()
#define BE(x) (x).begin(), (x).end()
#define SORT(x) sort(BE(x))
#define _1 first
#define _2 second

#define x1 gray_cat_x1
#define y1 gray_cat_y1

template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

#define file "I1"

const double EPS = 1e-9;
const double PI = acos(-1.);
const int INF = 1e9;
const ll MOD = 1e9 + 7;

const int MAXN = 2e5 + 5;

int cnt[MAXN], cnt_covered[MAXN];
int a[MAXN];

void solve(){
	int n, q;
	scanf("%d%d",&n, &q);
	REPN(i, 1, n) {
		scanf("%d", &a[i]);
		cnt[a[i]]++;
	}
	for(int i = n; i > 0; i--) {
		int lim = max(0, i - cnt[i]);
		cnt_covered[lim + 1]++;
		cnt_covered[i + 1]--;
	}
	int cnt_uncovered = 0;
	REPN(i, 1, n) {
		cnt_covered[i] += cnt_covered[i - 1];
		if (!cnt_covered[i]) {
			cnt_uncovered++;
		}
		//printf("%d %d\n", i, cnt_covered[i]);
	}
	while(q--) {
		int pos, val;
		scanf("%d%d", &pos, &val);
		int old_val = a[pos];
		if (cnt[old_val] <= old_val) {
			cnt_covered[old_val - cnt[old_val] + 1]--;
			if (cnt_covered[old_val - cnt[old_val] + 1] == 0) {
				cnt_uncovered++;
			}
		}
		cnt[old_val]--;
		a[pos] = val;
		cnt[val]++;
		if (cnt[val] <= val) {
			cnt_covered[val - cnt[val] + 1]++;
			if (cnt_covered[val - cnt[val] + 1] == 1) {
				cnt_uncovered--;
			}
		}
		printf("%d\n", cnt_uncovered);
	}
}   

int main(){

    //freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();    
    }
}


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

int main(){
  int k;
  string s;
  cin >> k>>s;
  if(s.size()<=k)cout <<s;
  else{
    for(int i=0;i<k;i++){
      cout<<s.at(i);
    }
    cout <<"...";
  }
}

Measured memory_bytes: 3632
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using static System.Math;

namespace CSharpSpiral {
	class Program {
		static void Main(string[] args) {
			var sw = new StreamWriter(Console.OpenStandardOutput()) {
				AutoFlush =
#if DEBUG
			true
#else
			false
#endif
			};
			Console.SetOut(sw);
			new Program().Solve(new ConsoleInput(
#if DEBUG
			new StreamReader("../../../inputData.txt")
#else
			Console.In
#endif
			, ','));
			Console.Out.Flush();
		}
		public void Solve(ConsoleInput cin) {
			var prevNum = 0;
			var dp = new int[1];
			dp[0] = cin.ReadInt;
			while(!cin.isEOF) {
				var line = cin.ReadLine.Split(',').Select(int.Parse).ToArray();
				var L = line.Length;
				if(prevNum > L) {
					var nextDp = new int[L];
					for(int i = 0; i < L; i++)
						nextDp[i] = Max(dp[i], dp[i + 1]) + line[i];
					dp = nextDp;
				} else {
					var nextDp = new int[L];
					nextDp[0] = dp[0] + line[0];
					nextDp[L - 1] = dp[L - 2] + line[L - 1];
					for(int i = 1; i < L - 1; i++)
						nextDp[i] = Max(dp[i - 1], dp[i]) + line[i];
					dp = nextDp;
				}
				prevNum = L;
			}
			Console.WriteLine(dp.First());
		}
	}
	static class ExtendClass {
		public static string Join<T>(this IEnumerable<T> X, string separator = " ") => string.Join(separator, X);
		
	}
	class ConsoleInput {
		private readonly TextReader _stream;
		private readonly char _separator = ' ';
		private readonly Queue<string> inputStream;
		public ConsoleInput(TextReader stream, char separator = ' ') {
			this._separator = separator;
			this._stream = stream;
			inputStream = new Queue<string>();
		}
		public string Read {
			get {
				if(inputStream.Count != 0) return inputStream.Dequeue();
				string[] tmp = _stream.ReadLine().Split(_separator);
				for(int i = 0; i < tmp.Length; ++i)
					inputStream.Enqueue(tmp[i]);
				return inputStream.Dequeue();
			}
		}
		public string ReadLine { get { return _stream.ReadLine(); } }
		public int ReadInt { get { return int.Parse(Read); } }
		public long ReadLong { get { return long.Parse(Read); } }
		public double ReadDouble { get { return double.Parse(Read); } }
		public string[] ReadStrArray(long N) {
			var ret = new string[N];
			for(long i = 0; i < N; ++i)
				ret[i] = Read;
			return ret;
		}
		public int[] ReadIntArray(long N) { var ret = new int[N]; for(long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
		public long[] ReadLongArray(long N) { var ret = new long[N]; for(long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
		public double[] ReadDoubleArray(long N) { var ret = new double[N]; for(long i = 0; i < N; ++i) ret[i] = ReadDouble; return ret; }
		public bool isEOF {
			get { return _stream.Peek() == -1; }
		}
	}

}



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

int int_pow(int n,int m){
	int ans=1;
	while(m--) ans*=n;
	return ans;
}

int main(){
	int R,C;
	while(cin>>R>>C,R||C){
		int ans=0,sumC,sum,osenbei[10][10000];
		for(int i=0;i<R;i++){
			for(int j=0;j<C;j++){
				cin>>osenbei[i][j];
			}
		}
		for(int bit=0,loop=int_pow(2,R);bit<loop;bit++){
			sum=0;
			for(int i=0;i<C;i++){
				sumC=0;
				for(int j=0;j<R;j++){
					if((bit>>j & 1) ^ (osenbei[j][i] & 1)){
						sumC++;
					}
				}
				if(sumC <= R/2){
					sumC = R-sumC;
				}
				sum+=sumC;
			}
			if(sum > ans){
				/*for(int i=0;i<R;i++){
					printf(" %d",bit>>i & 1);
				}puts("");*/
				ans=sum;
			}
		}
		printf("%d\n",ans);
	}
	return 0;
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
int main () {
  int N;
  cin >> N;
  vector<int> dataa(N), datab(N);
  int a;
  for(int i = 0; i < N; i++) {
    cin >> a;
    dataa.at(i) = a;
    datab.at(i) = a;
  }
  sort(dataa.begin(), dataa.end());
  int med1, med2;
  med1 = dataa.at(N/2 - 1);
  med2 = dataa.at(N/2);
  for(int i = 0; i < N; i++) {
    if (datab.at(i) <= med1) cout << med2 << endl;
    else if (datab.at(i) >= med2) cout << med1 << endl;
  }
  return 0;
}


Measured memory_bytes: 3712
#include <iostream>
#include <list>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <algorithm>

#define REP(i, n) for(int (i)=0;(i)<(n);++(i))
#define MOD 1000000007

typedef long long ll;

using namespace std;

bool checkSameCharacterInString(string s)
{
	bool res = false;
	map<char, int> countMap;

	for (char c = 'a'; c <= 'z'; ++c)
	{
		countMap[c] = 0;
	}

	for (int i = 0; i < s.size(); ++i)
	{
		countMap[s[i]]++;
		if (countMap[s[i]] >= 2)
		{
			res = true;
			break;
		}
	}

	return res;
}

int main()
{
    string s;
    cin >> s;
    if (!checkSameCharacterInString(s)) cout << "yes" << endl;
    else cout << "no" << endl;
}


Measured memory_bytes: 256
//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
//#include<unordered_map>//イテレータあるけど順序保持しないmap
//#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列
#include<valarray>//なんとなく追加
//メモ：表示桁数を大きくする　　cout << fixed << setprecision(20) << cm << endl;
using namespace std;
typedef long long ll;

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



signed main() {
int X,Y,RE;
string ans = "No";
cin >>X >>Y;

for(int i=0;i<=X;i++){
RE = 0;
RE = i*2;
RE += (X-i)*4;
if(RE==Y){
    ans = "Yes";
}
}

answer(ans);
return 0;
}


Measured memory_bytes: 3620
from collections import Counter as C
N, M = map(int, input().split())
A = [[int(a)-1 for a in input().split()] for _ in range(N)]
X = [1] * M
mi = 1 << 100
for i in range(M):
    c = C([min([(j, A[i][j]) for j in range(M) if X[A[i][j]]])[1] for i in range(N)])
    a = max([(c[a], a) for a in c])[1]
    mi = min(mi, c[a])
    X[a] -= 1
print(mi)

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

int main() {
    int n; cin>>n;
    vector<double> v(n);
    rep(i,n) cin>>v[i];
    for(int i=1;i<n;i++) {
    sort(v.begin(),v.end());
    v[i]=(v[i-1]+v[i])/2;
    }
    cout<<v[n-1]<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, a, n) for (int i = (a); i < (int)(n); ++i)
#define REPC(i, a, n) for (int i = (a); i <= (int)(n); ++i)
#define ALL(t) t.begin(), t.end()
#define RALL(t) t.rbegin(), t.rend()
#define MATINIT(type, row, col, init)                                          \
  vector<vector<type>>(row, vector<type>(col, init));
#define Yes(cond) cout << (cond ? "Yes" : "No") << endl;
#define YES(cond) cout << (cond ? "YES" : "NO") << endl;
using namespace std;
using LL = long long;
using ULL = unsigned long long;
template <class T> using VEC = std::vector<T>;
template <class T> using MAT = std::vector<std::vector<T>>;
void DUMP() { cerr << endl; }
template <class Head, class... Tail> void DUMP(Head &&head, Tail &&... tail) {
  cerr << head << ", ";
  DUMP(std::move(tail)...);
}
template <typename T> ostream &operator<<(ostream &os, vector<T> &vec) {
  os << "{";
  for (auto v : vec)
    os << v << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> p) {
  os << "[" << p.first << " " << p.second << "]";
  return os;
}

int main() {
  int n;
  cin>>n;
  if(n==1){
    cout<<"Hello World"<<endl;
  }else{
    int a,b;cin>>a>>b;cout<<a+b<<endl;
  }

  return 0;
}


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

int main() {
    long long W, H, x, y;
    cin >> W >> H >> x >> y;
    
    double S = W * H / 2.0;
    
    cout << S << ' '
         << ((x * 2 == W) && (y * 2 == H) ? 1 : 0) << endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <fstream>
#include<iomanip>
#define endl "\n"
#define ll long long
#define countBit1(x) __builtin_popcountll(x)
using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    int res= 0;
    for(int i = 1; i <= n; i++)
    {
        int x;
        cin >> x;
        i%2 != 0 & x%2 != 0 ? res++ : 0;
    }
    cout << res;
    return 0;
}

Measured memory_bytes: 3640
#include<stdio.h>
#define min(x, y) ((x) < (y) ? (x) : (y))

int main(){
  while(1){

    int n, balls[10007], i;
    scanf("%d", &n);
    if(n == 0)return 0;
    
    balls[0] = -1;
    balls[n + 1] = -2;
    for(i = 1;i <= n;i++){
      scanf("%d", balls + i);
    }
    int res = n;
    for(i = 1;i <= n;i++){
      int up, down, ans, old = balls[i];
      balls[i] = balls[i + 1];
      up = i + 1;
      down = i;
      ans = 0;
      while(balls[up] == balls[down]){
	int erased = 0, color = balls[up];
	while(balls[up] == color){
	  up++;
	  erased++;
	}
	while(balls[down] == color){
	  down--;
	  erased++;
	}
	if(erased >= 4){
	  ans += erased;
	}
	else break;
      }
      res = min(res, n - ans);
      
      balls[i] = balls[i - 1];
      up = i;
      down = i - 1;
      ans = 0;
      while(balls[up] == balls[down]){
	int erased = 0, color = balls[up];
	while(balls[up] == color){
	  up++;
	  erased++;
	}
	while(balls[down] == color){
	  down--;
	  erased++;
	}
	if(erased >= 4){
	  ans += erased;
	}
	else break;
      
      }
      res = min(res, n - ans);
      
      balls[i] = old;
    }
    printf("%d\n", res);
  }
}

Measured memory_bytes: 1064
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define np next_permutation
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define pi acos(-1.0)
const ll INF = 1LL<<61;
template<class T>bool chmax(T &a, const T &b) { 
  if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) {
  if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
ll jou(ll N, ll P){if(P==0) return 1;
    if(P%2==0){ll t = jou(N, P/2);return t*t % mod;
    }return (N * jou(N, P-1)) % mod;}  //jou(n,mod-2)で逆元
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'大文字'+=32;    で小文字に
//  cout << fixed << setprecision (20);   小数点以下2０桁まで
//実行時間制約2秒では２×10^8回くらいまで計算できる



int main(){
  ll n;
  cin>>n;
  
  vector<int> ans;
  while(n>0){
    if(n%26==0) {
      ans.pb(26);
      n=n/26-1;
    }
    else {
      ans.pb(n%26);
      n/=26;
    }
  }

  reverse(all(ans));

  rep(i,ans.size()){
    cout << (char)('a'-1+ans[i]);
  }

cout << endl;
}


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

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

  if (x == 0) {
    cout << "1" << endl;
  } else {
    cout << "0" << endl;
  }

  return 0;
}


Measured memory_bytes: 3616
s=str(input())
c=0
while(True):
  if len(s)%2==1:
    s=s[:-2]
    continue
  i=len(s)//2
  if s[:i]==s[i:] and c!=0:
    print(len(s))
    exit()
  else:
    s=s[:-2]
    c+=1

Measured memory_bytes: 2940
n, m = map(int, input().split())

py = [[] for _ in range(n)]

dy = {}

for i in range(m):
    p, y = map(int, input().split())
    py[p - 1].append(y)
    dy[y] = i

ans = [" " for _ in range(m)]

for i in range(n):
    if len(py[i]) == 0:
        continue
    temp = sorted(py[i])
    for j in range(len(temp)):
        s = str(i + 1)
        t = 6 - len(s)
        if t > 0:
            s = '0' * t + s
        s2 = str(j + 1)
        t = 6 - len(s2)
        if t > 0:
            s2 = '0' * t + s2
        s = s + s2
        ans[dy[temp[j]]] = s

for x in ans:
    print(x)





Measured memory_bytes: 35800