akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
//#include<tr1/unordered_map>
#pragma GCC optimize ("Ofast")
#define ll long long
#define pll pair<long long,long long>
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define forn(i, n) for(int i=0; i<int(n); i++)
#define Forn(i, n) for(int i=1; i<=int(n); i++)

using namespace std;

/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/hash_policy.hpp>
#include<ext/pb_ds/trie_policy.hpp>
#include<ext/pb_ds/priority_queue.hpp>
using namespace __gnu_pbds;
typedef tree<pll, null_type, less<pll>, rb_tree_tag, tree_order_statistics_node_update> ordered_multiset;*/

ll a,b,c,d;

int main()
{
    cin.tie(0); ios_base::sync_with_stdio(false);
    //freopen("connect_the_dots.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    ll s;
    cin >> s;
    a = 1000000000;
    d = (s+(a-1))/a;
    c = 1;
    b = a*d-s;
    cout << "0 0 " << a << " " << b << " " << c << " " << d << endl;
}



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

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, f, n) for (int i = (f); i < (n); i++)
ll const INF = 1LL << 60;

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

    int all_cnt = 0;
    for (int i = 1; i <= N; i += 2) {
        // cout << "i: " << i << ", ";
        int cnt = 0;
        for (int j = 1; j <= i; j++) {
            if (i % j == 0) {
                // cout << j << ", ";
                cnt++;
            }
        }
        // cout << cnt << endl;

        if (cnt == 8) {
            all_cnt++;
        }
    }

    cout << all_cnt << endl;
}


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

#define INF (1ll<<60)


long long M = 1000000007;


int main(int argc, char const *argv[]) {
    string S;cin>>S;
    bool s=false,n=false,w=false,e=false;
    for(char k:S){
        if(k=='S')s=true;
        if(k=='N')n=true;
        if(k=='W')w=true;
        if(k=='E')e=true;
    }
    if((s^n)||(w^e))cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<cstdio>
#include<queue>
#define PI 3.1415927
using namespace std;
int main() {
	int h[11];
	for (int i = 0; i < 10; i++) {
		cin >> h[i];
	}
	sort(h, h + 10);
	for (int i = 9; i > 6; i--) {
		cout << h[i] << endl;
	}
}


Measured memory_bytes: 3160
#include<iostream>
using namespace std;
int n, p, q; long double a, b, c[100000];
int main() {
	cin >> n;
	for (int i = 0; i <= n; i++) {
		cin >> p >> q; long double d = 0.0l;
		for (int j = 0; j < q; j++) {
			cin >> a >> b; c[i] += a*b; d += b;
		}
		c[i] /= d;
	}
	bool OK = false;
	for (int i = 0; i < n; i++) {
		if (c[i] - 1e-7 > c[n])OK = true;
	}
	if (OK == true)cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}

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

#define int long long

#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint,int> P1;
typedef pair<int,pint> P2;
typedef pair<pint,pint>PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD=1000000007;
const ll INF=1e18;
int dx[]={0,0,1,-1};
int dy[]={-1,1,0,0};

int N;

signed main(){
    cin.tie(0);
	ios::sync_with_stdio(false);
    cin>>N;
    int w=0;
    rep(i,1,3501)rep(j,1,3501){
        if(4*i*j-N*i-N*j==0)continue;
        if((N*i*j)%(4*i*j-N*i-N*j)!=0)continue;
        w=(N*i*j)/(4*i*j-N*i-N*j);
        if(w>0){
            cout<<i<<" "<<j<<" "<<w<<endl;
            return 0;
        }
    }
    
    
    
    
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <functional>
#include <algorithm>
#include <vector>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>

#define INF (1ll<<60)
#define MOD 1000000007
#define BOUND 27182818284

typedef long long ll;
typedef long long int lli;

#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)

template<class T>bool umax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool umin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

using namespace std;

// gcd
int gcd(int a, int b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
// gcd array
int findGCD(int arr[], int n){
    int result = arr[0];
    for (int i=1; i < n; i++)
        result = gcd(arr[i], result);

    return result;
}

// sort big to small
// sort(A,A+N, greater<int>());

// v.front() = -BOUND;
// v.back() = BOUND;

// Iterator
// v.begin
// v.end

int main() {
    long long N;
    vector<long long>A;

    cin >> N;

    rep(i,N) {
        long long x;
        cin >> x;
        A.push_back(x);
    }

    sort(A.begin(), A.end(), greater<long long>());

    long long tate=0;
    long long yoko=0;
    for(int i=0; i<N-1; i++){
        if(A[i]==A[i+1] && tate==0){
            tate=A[i];
            i++;
        }else if(A[i]==A[i+1] && yoko==0){
            yoko=A[i];
            i++;
        }
    }

    cout << tate*yoko << endl;
    return 0;
}



Measured memory_bytes: 1400
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000000


int main(){
	
	int X,Y;
	cin>>X>>Y;
	int ans = 0;
	if(X<=3){
		ans += 100000 * (4-X);
	}
	if(Y<=3){
		ans += 100000 * (4-Y);
	}
	if(X==1&&Y==1){
		ans += 400000;
	}
	
	cout<<ans<<endl;
	
	return 0;
	
}

Measured memory_bytes: 764
using System;

public class Input
{
    public long a;

    public long b;

    public long h;

    public Input()
    {
        string[] input = null;

        // スペース区切りの整数の入力(横、個別)
        input = Console.ReadLine().Split(' ');

        a = long.Parse(input[0]);

        // スペース区切りの整数の入力(横、個別)
        input = Console.ReadLine().Split(' ');

        b = long.Parse(input[0]);

        // スペース区切りの整数の入力(横、個別)
        input = Console.ReadLine().Split(' ');

        h = long.Parse(input[0]);
    }
}

public class Program
{
    public static void Main(string[] args)
    {
        string output = Proc();

        // 出力
        Console.WriteLine(output);
    }

    static string Proc()
    {
        Input input = new Input();
        string output = string.Empty;

        long result = -1;

        result = (input.a + input.b) * input.h / 2;

        output = result.ToString();
        return output;
    }
}


Measured memory_bytes: 11092
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math;

long[10^^5] XS;
long[10^^5] VS;

void main()
{
    auto nc = readln.split.to!(long[]);
    auto N = nc[0];
    auto C = nc[1];

    foreach (i; 0..N) {
        auto xv = readln.split.to!(long[]);
        XS[i] = xv[0];
        VS[i] = xv[1];
    }

    long[10^^5] tb, tba;
    long max_v = tb[N-1] = tba[N-1] = VS[N-1] - (C - XS[N-1]);
    foreach_reverse (i; 0..N-1) {
        tb[i] = tba[i] = tb[i+1] + VS[i] - XS[i+1] + XS[i];
        if (tb[i] < max_v) {
            tba[i] = max_v;
        } else {
            max_v = tb[i];
        }
    }
    long[10^^5] tbb;
    max_v = tbb[0] = VS[0] - XS[0];
    foreach (i; 1..N) {
        auto v = tbb[i-1] - XS[i-1] + tba[i];
        if (v > max_v) max_v = v;

        tbb[i] = tbb[i-1] + VS[i] - XS[i] + XS[i-1];
        if (tbb[i] > max_v) max_v = tbb[i];
    }
    auto r1 = max_v;

    max_v = tb[0] = tba[0] = VS[0] - XS[0];
    foreach (i; 1..N) {
        tb[i] = tba[i] = tb[i-1] + VS[i] - XS[i] + XS[i-1];
        if (tb[i] < max_v) {
            tba[i] = max_v;
        } else {
            max_v = tb[i];
        }
    }
    max_v = tbb[N-1] = VS[N-1] - (C - XS[N-1]);
    foreach_reverse (i; 0..N-1) {
        auto v = tbb[i+1] - (C - XS[i+1]) + tba[i];
        if (v > max_v) max_v = v;

        tbb[i] = tbb[i+1] + VS[i] - XS[i+1] + XS[i];
        if (tbb[i] > max_v) max_v = tbb[i];
    }
    auto r2 = max_v;

    writeln(max(r1, r2, 0));
}

Measured memory_bytes: 4348
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		for(int i = 0; i < n; i++){
			String people = br.readLine();

			String input = br.readLine();

			System.out.println(solve(people, input));
		}
	}

	static String solve(String people, String str){
		char[] pArray = people.toCharArray();
		int n = pArray.length;

		String result = str;
		for(int i = n - 1; i >= 0; i--){
//			System.out.println("next "+pArray[i]);
			switch (pArray[i]) {
			case 'J' :
				result = decodeJ(result);
				break;
			case 'C' :
				result = decodeC(result);
				break;
			case 'E' :
				result = decodeE(result);
				break;
			case 'A' :
				result = decodeA(result);
				break;
			case 'P' :
				result = decodeP(result);
				break;
			case 'M' :
				result = decodeM(result);
				break;
			}
		}

		return result;
	}

	static String decodeJ(String str){
//		System.out.println("Decode J");
		StringBuffer sb = new StringBuffer();
		sb.append(str.charAt(str.length() - 1));
		sb.append(str.substring(0, str.length() - 1));

//		System.out.println("J "+sb);
		return sb.toString();
	}

	static String decodeC(String str){
		StringBuffer sb = new StringBuffer();
		sb.append(str.substring(1));
		sb.append(str.charAt(0));

//		System.out.println("C "+sb);
		return sb.toString();
	}

	static String decodeE(String str){
		StringBuffer sb = new StringBuffer();
		int len = str.length();

		sb.append(str.substring((len - 1)/2 + 1));
		if(len % 2 == 1){
			sb.append(str.charAt(len/2));
		}
		sb.append(str.substring(0, len/2));

//		System.out.println("E "+sb);
		return sb.toString();
	}

	static String decodeA(String str){
		StringBuffer sb = new StringBuffer(str);

//		System.out.println("A "+sb);
		return sb.reverse().toString();
	}

	static String decodeP(String str){
		char[] cArray = str.toCharArray();
		for(int i = 0; i < str.length(); i++){
			if(cArray[i] == '0'){
				cArray[i] = '9';
			}
			else if(Character.isDigit(cArray[i])){
				cArray[i]--;
			}
		}
//		System.out.println("P "+ new String(cArray));
		return new String(cArray);
	}

	static String decodeM(String str){
		char[] cArray = str.toCharArray();
		for(int i = 0; i < str.length(); i++){
			if(cArray[i] == '9'){
				cArray[i] = '0';
			}
			else if(Character.isDigit(cArray[i])){
				cArray[i]++;
			}
		}
//		System.out.println("M "+ new String(cArray));

		return new String(cArray);
	}
}

Measured memory_bytes: 24232
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>

using namespace std;

typedef pair<long long int, long long int> P;

long long int INF = 1e18;
long long int MOD = 1e9 + 7;
#define MAX_V 1000

struct edge{
	long long int to, cap, cost, rev; // 
};

vector<edge> G[MAX_V] = {};
long long int dist[MAX_V]; // 
int prevv[MAX_V], preve[MAX_V]; // 

// 
void add_edge(long long int from, long long int to, long long int cap, long long int cost){
	G[from].push_back((edge){to, cap, cost, (long long int)G[to].size()});
	G[to].push_back((edge){from, 0, -cost, (long long int)G[from].size() - 1}); // 
}

// 
long long int min_cost_flow(int s, int t, int f, int V){
	
	long long int res = 0;
	
	while(f > 0){
		fill(dist, dist + V, INF);
		dist[s] = 0;
		bool update = true;
		while(update){
			update = false;
			for(int v = 0; v < V; v++){
				if(dist[v] == INF){
					continue;
				}
				for(int i = 0; i < G[v].size(); i++){
					edge &e = G[v][i];
					if(e.cap > 0 && dist[e.to] > dist[v] + e.cost){
						dist[e.to] = dist[v] + e.cost;
						prevv[e.to] = v;
						preve[e.to] = i;
						update = true;
					}
				}
			}
		}
		if(dist[t] == INF){
			return res;
		}
		
		long long int d = f;
		for(int v = t; v != s; v = prevv[v]){
			d = min(d, G[prevv[v]][preve[v]].cap);
		}
        if(dist[t] >= 0){
            return res;
        }
		f -= d;
		res += d * dist[t];
		for(int v = t; v != s; v = prevv[v]){
			edge &e = G[prevv[v]][preve[v]];
			e.cap -= d;
			G[v][e.rev].cap += d;
		}
	}
	return res;
}

int main(){
    int N, M, K;
    cin >> N >> M >> K;
    int a[110];
    long long int ans = 0;
    for(int i = 1; i <= N; i++){
        cin >> a[i];
        ans += a[i];
        add_edge(0, i, 1, 0);
    }
    for(int i = 1; i <= M; i++){
        for(int j = 1; j <= N; j++){
            int b;
            cin >> b;
    		add_edge(j, N + i, 1, a[j] - b);
        }
    }
    for(int i = 1; i <= M; i++){
        int T;
        cin >> T;
        add_edge(N + i, N + M + 1, T, 0);
    }
	cout << ans - min_cost_flow(0, N + M + 1, N - K, N + M + 2) << endl;
	
    return 0;
}


Measured memory_bytes: 3880
#include <bits/stdc++.h>
#define MAX 5005
using namespace std;

int n, k;

int lg(int x)
{
    int cnt = 0;
    while(x < k){
        cnt++;
        x = x * 2;
    }

    return cnt;
}

int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    // #ifndef ONLINE_JUDGE
    //     freopen("input.txt", "r", stdin);
    //     freopen("output.txt", "w", stdout);
    // #endif
    cin>>n>>k;

    double sum = 0;
    for(int i = 1; i <= n; i++){
        sum += (1 / (double) n) * (1 / (double) (1 << lg(i)));
    }

    cout<<setiosflags(ios::fixed)<<setprecision(12);
    cout<<sum<<endl;

    return 0;
}

Measured memory_bytes: 256
//https://atcoder.jp/contests/abc157/tasks/abc157_c
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
template<class T>bool chmax(T &a, const T &b) {if (a<b) { a=b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) {if (b<a) { a=b; return 1; } return 0;}

int main(){
    ll N,M; cin>>N>>M;
    vector<pair<ll,ll>> lst(M);
    REP(i,M){
        cin>>lst[i].first>>lst[i].second;        
        lst[i].first -= 1;
    }

    auto check_val = [&](ll v)->bool{
        vector<ll> tbl;
        do {
            tbl.push_back(v%10);
            v /= 10;
        }while(v>0);
        reverse(tbl.begin(),tbl.end());
        bool ret=true;
        for(auto& p:lst){
            if(tbl.at(p.first) != p.second){
                ret = false;
                break;   
            }
        }
        return ret;
    };


    ll ans=-1;
    if (N==1){
        FOR(i,0,10){
            if (check_val(i)) {
                ans=i;
                break;
            }
        }
    }else if(N==2){
        FOR(i,10,100){
            if (check_val(i)) {
                ans=i;
                break;
            }
        }
    }else if(N==3){
        FOR(i,100,1000){
            if (check_val(i)) {
                ans=i;
                break;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}


int main_() {
    ll N,M; cin>>N>>M;
    vector<ll> tbl(N,-1);
    bool ans=true;
    REP(i,M){
        ll s,c; cin>>s>>c;
        if (tbl.at(s-1)==c || tbl.at(s-1)==-1){
            tbl.at(s-1)=c;
        }else{
            ans=false;
            break;
        }
    }
    if(N==1){
        if(tbl.at(0)<0) {
            cout<<0<<endl;
            return 0;
        }
        cout<<tbl.at(0)<<endl;
        return 0;
    }
    if(tbl.at(0)==0)ans=false;
    if(ans){
        FOR(i,0,tbl.size()){
            if(tbl.at(i)<0) {
                tbl.at(i)=i==0?1:0;
            }
        }
    }

    if(ans){
        for(auto&&t:tbl){
            cout<<t;
        }
        cout<<endl;
    }else{
        cout<<-1<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  string str;
  cin >> str;
  if (str == "a" ){
    cout << "vowel" << endl;}
  else if  (str == "i" ){
    cout << "vowel" << endl;}
  else if  (str == "u" ){
    cout << "vowel" << endl;}
  else if  (str == "e" ){
    cout << "vowel" << endl;}
  else if  (str == "o" ){
    cout << "vowel" << endl;}
  else { cout << "consonant" << endl;}
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<cctype>
#include<iomanip>
#include<functional>
#include<numeric>
#include<map>
#include<set>
#include<complex>
#define EPS 1e-10
using namespace std;
typedef long long llong;
vector<vector<char> >v;
int cnt;
int w, h;

void dfs(int x, int y) {
	if (x == h || x == -1)return;
	if (y == -1 || y == w)return;
	if (v[x][y] == '#')return;

	if (v[x][y] == '.'||v[x][y]=='@') {
		cnt++;
		v[x][y] = '#';
		dfs(x + 1, y);
		dfs(x - 1, y);
		dfs(x, y + 1);
		dfs(x, y - 1);

	}

	return;

}

int main() {
	while (cin >> w >> h&&w&&h) {
		v = vector<vector<char> >(h, vector<char>(w));
		int x, y;
		cnt = 0;
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				cin >> v[i][j];
				if (v[i][j] == '@') {
					x = i;
					y = j;
				}
			}
		}
		dfs(x, y);

		cout << cnt << endl;


	}
	return 0;
}

Measured memory_bytes: 3092
def angle(h, m)
  v = (30 * h + m/2.0 - 6 * m).abs
  v > 180 ? (v - 360).abs : v
end

def to_msg(angle)
  if angle < 30
    "alert"
  elsif angle >= 90
    "safe"
  else
    "warning"
  end
end

gets.to_i.times do
  h, m = gets.split(":").map(&:to_i)
  puts to_msg(angle(h, m))
end

Measured memory_bytes: 8812
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
    int n,l[200],s=0;
    cin>>n;
    n=n*2;
    for(int i=0;i<n;i++){
        cin>>l[i];
    }
    sort(l,l+n);
    for(int i=0;i<n;i+=2){
        s+=l[i];
    }
    cout<<s<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
ll mod=1e9+7;
bool prime(ll n)
{
    if(n==1)
        return false;
    if(n==2)
        return true;
    for(ll i=2; i*i<=n; i++)
    {
        if(n%i==0)
            return false;
    }
    return true;
}
ll gcd(ll x,ll y)
{
    if(y==0)
        return x;
    return gcd(y,x%y);
}
ll fp(ll b,ll p)
{
    if(p==0)
        return 1;
    ll  z=fp(b,p/2);
    if(p%2==0)
        return (z*z)%mod;
    else
        return (((z*z)%mod)*(b%mod))%mod;
}
long long  Factorial(long long n)
{
    if(n > 1)
        return n * Factorial(n - 1);
    else
        return 1;
}
const int m=1e6+1;
ll fact[m],inv[m];
void fn()
{
    fact[0]=1,inv[0]=1;
    for(int i=1; i<=1e6; i++)
    {
        fact[i]=(i*fact[i-1])%mod;
        inv[i]=fp(fact[i],mod-2);
    }
}

long long  nCr(ll N, ll R)
{
    return (((fact[N]*inv[N-R])%mod)*inv[R])%mod;
}
vector<int>v;
void primeFactors(int n)
{
    while (n%2 == 0)
    {
        v.push_back(2);
        n = n/2;

    }

    for (int i = 3; i <= sqrt(n); i = i+2)
    {
        while (n%i == 0)
        {
            v.push_back(i);
            n = n/i;
        }
    }
    if (n > 2)
        v.push_back(n);
}
long long  NCR(long long N, long long R)
{
return (Factorial(N)) / ((Factorial(N-R)) * Factorial(R));
}
int main()
{
 int n,x;
 cin>>n>>x;
 int ans[n],h[n];
 for(int i=0;i<n;i++){
    cin>>h[i];
 }
 ans[0]=0;
 ans[1]=ans[0]+abs(h[0]-h[1]);
 for(int i=2;i<n;i++){
        ans[i]=1e9;
    for(int j=i-1;j>=max(0,i-x);j--){
        ans[i]=min(ans[j]+abs(h[j]-h[i]),ans[i]);
    }
 }
cout<<ans[n-1]<<endl;
    return 0;
}


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

int J, Y;

void rec(int j, int y, string s){
    if(j == J && y == Y){
        cout << s << endl;
        return;
    }

    if(j == 5 && y == 5){return;}
    if(j <= 3 && y == 5){return;}
    if(j == 5 && y <= 3){return;}

    if(j+1 <= J){rec(j+1, y, s+'A');}
    if(y+1 <= Y){rec(j, y+1, s+'B');}
}

int main(){
    cin >> J >> Y;

    rec(0, 0, "");
}

Measured memory_bytes: 3216
#include <bits/stdc++.h>
using namespace std;
int arr[100010];
void swap(int a,int b){
	int t = arr[a];
	arr[a] = arr[b];
	arr[b] = t;
}
int partition(int arr[],int a,int b){
	int x = arr[b];
	int i = a-1;
	for(int j=a;j<b;j++){
		if(arr[j]<=x){
			i = i + 1;
			swap(i,j);
		}
	}
	swap(i+1,b);
	return i+1;
}
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++) scanf("%d",&arr[i]);
	int target = partition(arr,0,n-1);
	for(int i=0;i<n;i++){
		if(i) printf(" ");
		if(i==target) printf("[");
		printf("%d",arr[i]);
		if(i==target) printf("]");
	}
	cout<<endl;
	return 0;
}


Measured memory_bytes: 3692
#include <numeric>
#include<iostream>
#include<set>
#include<queue>
#include<vector>
#include<map>
#include<stack>
#include <cstdio>
#include<algorithm>
#include <sstream>
#include<string>
#include<string.h>
#include <cmath>
#include <iomanip>
#include <string>
#include<list>
using namespace std;
#define int long long
#define inf 1000000007
#define rep(i,j,n) for(int i=j;i<n;i++)
typedef pair<int,int>  P;
double pi = 3.141592653589793;
//使うやつはここから下に置こうな
signed main() {
    string s;int n;cin>>s>>n;
    set<string>key;
    rep(i,0,s.size()){
        rep(j,1,6){
            key.insert(s.substr(i,j));
        }
    }
    auto ans=key.begin();
    rep(i,0,n-1){
       ans++;
    }
    cout<<*ans<<endl;
    return 0;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define FSP(x) fixed << setprecision(x)
using namespace std;
using ll = long long;
constexpr ll INF = LLONG_MAX;
const long double PI = acosl(-1);
void Yes() {cout << "Yes\n";}
void No() {cout << "No\n";}
void YES() {cout << "YES\n";}
void NO() {cout << "NO\n";}

#include <vector>
#include <functional>

/*	verified : 2020/07/17
		AOJ, Range Minimum Query (RMQ)
		http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_A
*/

template<typename T>
struct segment_tree {
	long long N;				// the size of V
	long long M;				// the number of leaves
	std::vector<T> V;			// Segment Tree, 1-indexed
	std::function<T(T, T)> OP;	// binary operation
	T ID;						// identity element op OP

	segment_tree(std::vector<T>& a, std::function<T(T, T)> f, T t) : OP(f), ID(t) {
		M = 1;
		while (M < a.size()) M *= 2;
		N = 2 * M;
		V.resize(N, ID);
		for (long long i = 0; i < a.size(); i++) V[M + i] = a[i];
		for (long long i = a.size(); i < M; i++) V[M + i] = ID;
		for (long long i = M - 1; i > 0; i--) {
			V[i] = OP(V[2 * i], V[2 * i + 1]);
		}
	}

	segment_tree() {}
	void init(std::vector<T>& a, std::function<T(T, T)> f, T t) {
		OP = f; ID = t;
		M = 1;
		while (M < a.size()) M *= 2;
		N = 2 * M;
		V.resize(N, ID);
		for (long long i = 0; i < a.size(); i++) V[M + i] = a[i];
		for (long long i = a.size(); i < M; i++) V[M + i] = ID;
		for (long long i = M - 1; i > 0; i--) {
			V[i] = OP(V[2 * i], V[2 * i + 1]);
		}
	}

	void point_update(long long i, T x) {
		i += M;
		V[i] = x;
		while (i / 2 < i) {
			i /= 2;
			V[i] = OP(V[2 * i], V[2 * i + 1]);
		}
	}

	T range_subfunc(
		long long cur_node, long long cur_left, long long cur_right,
		long long l, long long r
	) {
		if (cur_right <= l || r <= cur_left) return ID;
		if (l <= cur_left && cur_right <= r) return V[cur_node];
		long long mid = (cur_left + cur_right) / 2;
		return OP(
			range_subfunc(cur_node * 2, cur_left, mid, l, r),
			range_subfunc(cur_node * 2 + 1, mid, cur_right, l, r)
		);
	}

	T range_fold(long long l, long long r) {
		return range_subfunc(1, 0, M, l, r);
	}
};

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	//constexpr ll P = 1e9 + 7;
	//constexpr ll P = 998244353;

	ll n, q;
	cin >> n >> q;
	vector<ll> c(n);
	for (ll i = 0; i < n; i++) {
		cin >> c[i];
		c[i]--;
	}

	vector<ll> l(q), r(q);
	vector<vector<ll>> queries(n);
	for (ll i = 0; i < q; i++) {
		cin >> l[i] >> r[i];
		l[i]--; r[i]--;
		queries[r[i]].push_back(l[i]);
	}

	map<vector<ll>, ll> ans;

	vector<ll> v(n + 1, 0), last(n, -1);
	auto f = [] (ll a, ll b) {return a + b;};
	segment_tree<ll> sg(v, f, 0);
	for (ll i = 0; i < n; i++) {
		if (last[c[i]] != -1) sg.point_update(last[c[i]], 0);
		sg.point_update(i, 1);
		last[c[i]] = i;
		for (auto j : queries[i]) {
			ans[{j, i}] = sg.range_fold(j, i);
		}
	}

	for (ll i = 0; i < q; i++) cout << ans[{l[i], r[i]}] + 1 << '\n';
}

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

int main() {
  int N;
  long L0,L1,L2;
  cin >> N;
  
  L0 = 2;
  L1 = 1;
  if (N==1) {
    cout << L1 << endl;
  }
  else {
    for (int i=2;i<=N;i++) {
      L2 = L0 + L1;
      L0 = L1;
      L1 = L2;
    }
    cout << L2 << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;;
#define ll long long
#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define INF 1<<30
#define LINF 1LL<<62
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define pb push_back
const int MOD = 1000000007;
 
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,k; cin >> n >> k;
  long double ans = 0;
  FOR(i,1,n+1){
      ll tmp = 0;
      while(k > (i<<tmp)){
          tmp++;
      }
      ans += (long double)(1.0) / (long double)(1<<tmp);
  }
  ans /= n;
  printf("%.10Lf\n", ans);

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
typedef long long ll;
const int MAXN = 55;

ll c[MAXN][MAXN];
ll cnt[2];
ll n, p;

int main()
{                  
	c[0][0] = 1;


	for (int i = 0; i < MAXN - 1; i++)
		for (int j = 0; j < MAXN - 1; j++)
		{
			c[i + 1][j + 1] += c[i][j];
			c[i + 1][j] += c[i][j];
		}                          


	ios_base::sync_with_stdio(0);
	cin >> n >> p;

	for (int i = 0; i < n; i++)
	{
		int x; 
		cin >> x;
		cnt[x % 2]++;
	}

	ll res = 0;

	for (int c0 = 0; c0 <= cnt[0]; c0++)
		for (int c1 = 0; c1 <= cnt[1]; c1++)
			if (c1 % 2 == p)
			{
				res += c[cnt[1]][c1] * c[cnt[0]][c0];
			}

	cout << res << '\n';
	return 0;
}


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

using ll = long long; 
const int mod = 1e9+7;
int n;
int mul(int a, int b) {
    return (ll) a * b % mod;
}
int add(int a, int b) {
    int c = a + b;
    if (c >= mod) {
        c -= mod;
    }
    return c;
}


struct M {
    vector<vector<int>> t;
    M() {
        t.resize(n, vector<int>(n));
    }
    M operator* (const M& b) const {
        M c = M();
        for(int i = 0; i < n; ++i) {
            for(int j = 0; j < n; ++j) {
                for(int k = 0; k < n; ++k) {
                    c.t[i][k] = add(c.t[i][k], mul(t[i][j], b.t[j][k]));
                }
            }
        }
        return c;
    }
};



// dp[n]
int main() {
// 	int n;
	ll k;
	scanf("%d%lld", &n, &k);
	vector<vector<int>> adj_mat(n, vector<int>(n));
	for (int i = 0; i < n; i++) {
	    for (int j = 0; j < n; j++) {
	        scanf("%d", &adj_mat[i][j]);
	    }
	}
	M answer = M();
	for (int i = 0; i < n; i++) {
	    answer.t[i][i] = 1;
	}
	M m = M();
	m.t = adj_mat;
	
	while (k > 0) {
	    if (k % 2) {
	        answer = answer * m;
	    }
	    
	    m = m * m;
	    
	    k = k / 2;
	}
	
	int total = 0;
	
	for (int i = 0; i < n; i++) {
	    for (int j = 0; j < n; j++) {
	        total = add(total, answer.t[i][j]);
	    }
	}
	
	printf("%d", total);
	
	return 0;
	/*
// 	vector<int> dp(n);
    vector<int> dp(n);
    vector<int> prev(n);
	for (int ki = 0; ki <= k; ki++) {
	    for (int i = 0; i < n; i++) {
	        if (ki == 0) {
	            dp[i] = 1;
	        }
	        else {
	            dp[i] = 0;
	            for (int nei : adj_list[i]) {
	                dp[i] += prev[nei];
	            }
	        }
	    }
	    for (int i = 0; i < n; i++) {
	        prev[i] = dp[i];
	    }
	}
	   // dp[i] = f(adj_list, i, k);
	   // if (k == 0) {
    //         return 1;
    //     }
    //     int ans = 0;
    //     for (int nei: adj_list[i]) {
    //         ans += f(adj_list, nei, k-1);
    //     }
    //     return ans;
	
	int ans = 0;
	for (int i = 0; i < n; i++) {
	    ans = add(ans, dp[i]);
	}
	
	printf("%d", ans);
	return 0;
	*/
}

Measured memory_bytes: 256
# coding:utf-8

import sys
# from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


n = II()
s = SI()

s = s[-1] + s + s[0]
P = ('00', '01', '10', '11')  # 0: S, 1: W
for p in P:
    for i in range(1, n):
        # print(i, p[-1], s[i])
        if s[i + 1] == 'o':
            p += p[-2] if p[-1] == '0' else str(int(p[-2]) ^ 1)
        else:
            p += p[-2] if p[-1] == '1' else str(int(p[-2]) ^ 1)
    else:
        if s[1] == 'o':
            tmp = p[1] if p[0] == '0' else str(int(p[1]) ^ 1)
        else:
            tmp = p[1] if p[0] == '1' else str(int(p[1]) ^ 1)
        p = tmp + p

    if p[1] == p[-1] and p[-2] == p[0]:
        ans = ''
        for a in p[1:-1]: ans += 'S' if a == '0' else 'W'
        print(ans)
        exit()

print(-1)


Measured memory_bytes: 3700
import datetime

S = input()

dt_base = datetime.datetime.strptime("2019/04/30", "%Y/%m/%d")
dt = datetime.datetime.strptime(S, "%Y/%m/%d")

td = dt - dt_base

if td.total_seconds() <= 0:
    print("Heisei")
else:
    print("TBD")



Measured memory_bytes: 4464
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define rep(i,k,n) for(int (i)=(k);(i)<(n);(i)++)
#define max(a,b) (a)>(b)?(a):(b)
#define min(a,b) (a)<(b)?(a):(b)
#define abs(a,b) (a)< 0 ?(a):-(a)
#define llong long long

int main(){
	int K; scanf("%d",&K);
	int A,B; scanf("%d %d",&A,&B);
	rep(i,A,B+1){
		if( i%K==0 ){
			printf("OK");
			return 0;
		}
	}
	printf("NG");
	return 0;
}


Measured memory_bytes: 1732
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds;   
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define ll long long int
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define all(x) x.begin(),x.end()
#define sz(x) (ll)x.size() 

ll power(ll x,ll y,ll p) 
{ 
    ll res = 1;      
    x = x % p;  
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1; 
        x = (x*x) % p;   
    } 
    return res; 
} 
ll a[200005],c[1000005],mrk[1000005];
int main()
{
    ios_base::sync_with_stdio(false);
	ll n,i,j,k,x,y,t,m;

	cin >> n;
	for(i=1;i<=n;i++)
	{
		cin >> a[i];
		c[a[i]]++;
	}
	x=0;
	for(i=1;i<=1e6;i++)
	{
		// if(i==8)

		if(c[i])
		{
			if(c[i]==1 && !mrk[i])
				x++;
			for(j=2*i;j<=1e6;j+=i)
				mrk[j]=1;
		}
	}
	cout<<x<<endl;
}

Measured memory_bytes: 20772
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n, d = i_map()
    num_list = i_row_list(n)

    count = 0

    for i in range(n):
        x, y = num_list[i][0], num_list[i][1]

        if sqrt(x * x + y * y) <= d:
            count += 1

    print(count)

if __name__ == '__main__':
    main()


Measured memory_bytes: 106684
import java.util.Scanner;
public class Main {
    private static Scanner sc=new Scanner(System.in);
    public static void main(String[] args){
        String odd=sc.next();
        String even=sc.next();
        for(int i=0;i<(odd.length()+even.length())/2;i++){
            System.out.print(odd.charAt(i));
            System.out.print(even.charAt(i));
        }
        if(odd.length()==even.length()) System.out.println();
        else System.out.println(odd.charAt(odd.length()-1));
    }
}

Measured memory_bytes: 23124
// lcmとかはg++ -std=c++17 default.cppみたいなかんじで

#include <bits/stdc++.h>
#define mod 1000000007
#define INF 1001001001
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define double long double
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n+1)
using namespace std;


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

    ll a,b,c,d,m,n,maxi=0,f=0,mini=INF;
    string str;
    cin>>n;
    vector<ll> v(n);
    rep(i,n) cin>>v[i];
    rep(i,n){
        while(v[i]%2==0){
            f++;
            v[i]/=2;
        }
    }
    cout<<f<<endl;
    return 0;
}


Measured memory_bytes: 384
try:
    from math import gcd
except:
    from fractions import gcd
from itertools import accumulate

N = int(input())
A = [int(s) for s in input().split()]
s = [0] + list(accumulate(A, gcd))
t = list(reversed(list(accumulate(reversed(A), gcd)))) + [0]

ans = max([gcd(s[i-1], t[i]) for i in range(1, N+1)])
print(ans)


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

#define fori(i, ini, lim) for(int i = int(ini); i < int(lim); i++)
#define ford(i, ini, lim) for(int i = int(ini); i >= int(lim); i--)

#define debug(x) cout << "> " << #x << " = " << x << endl;
#define debug_at(arr, at) cout << "> " << #arr << "[" << at << "] = " << arr[at] << endl;
#define debug_pair(p) cout << "> " << #p << " = (" << p.first << ", " << p.second << ")" << endl;

using namespace std;

typedef long long ll;

const int N = 2e5 + 23;

vector<int> adj[N];
int n, m;

int color[N];
bool dfs(int u, int c) {
    color[u] = c;
    bool res = true;
    for(int v : adj[u]) {
        if(color[v] == -1) {
            res = res and dfs(v, 1 - c);
        }
        if(color[v] == c) {
            return false;
        }
    }
    return res;
}

bool bipartite() {
    memset(color, -1, sizeof color);
    return dfs(1, 0);
}

inline ll solve() {
    ll res = 0;
    if(bipartite()) {
        int w = 0;
        fori(i, 1, n + 1) {
            if(color[i] == 0) {
                ++w;
                res -= adj[i].size();
            }
        }
        ll b = n - w;
        res += (b * w);
    }
    else {
        res = (((ll) n * (n - 1)) / 2) - m;
    }
    return res;
}

int main() {

    scanf("%d %d", &n, &m);
    fori(i, 0, m) {
        int u, v;
        scanf("%d %d", &u, &v);
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    ll ans = solve();
    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 9344
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstring>
#include <chrono>
#include <complex>
#define endl "\n"
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001;
#define all(c) c.begin(),c.end()
#define mp(x,y) make_pair(x,y)
#define mem(a,val) memset(a,val,sizeof(a))
#define eb emplace_back
  #define pb push_back
#define f first
#define s second
  #define MAXN 100005
using namespace std;
int a[MAXN],b[MAXN],c[MAXN],dp[MAXN][4];
int n;
ll solve(int i,int last){
	if(i==n) {
		return 0;
	}
	if(dp[i][last]!=-1) {
		return dp[i][last];
	}
	if(!last) {
		return dp[i][last]=max(b[i]+solve(i+1,2),max(c[i]+solve(i+1,3),a[i]+solve(i+1,1)));
	}
	if(last==1) {
		return dp[i][last]=max(b[i]+solve(i+1,2),c[i]+solve(i+1,3));
	}
	if(last==2) {
		return dp[i][last]=max(a[i]+solve(i+1,1),c[i]+solve(i+1,3));
	}
	if(last==3) {
		return dp[i][last]=max(a[i]+solve(i+1,1),b[i]+solve(i+1,2));
	}
}
int main()
{
	std::ios::sync_with_stdio(false);

	cin>>n;
	for(int i=0; i<n; i++) {
		cin>>a[i]>>b[i]>>c[i];
	}
	mem(dp,-1);
	cout<<solve(0,0)<<endl;
	return 0;
}


Measured memory_bytes: 7680
use proconio::input;

fn main() {
    input! {
        n: u32,
    }

    let ans = match n % 10 {
        2 | 4 | 5 | 7 | 9 => "hon",
        0 | 1 | 6 | 8 => "pon",
        3 => "bon",
        _ => unreachable!(),
    };
    println!("{}", ans);
}


Measured memory_bytes: 2124
n=int(input())
ls=[]
for i in range(n-1):
  c,s,f=map(int,input().split())
  ls.append(s)
  ls=list(map(lambda x:(x+c+(0 if x%f==0 else (f-x%f)) if s<=x else s+c),ls))
ls=ls+[0]
print(*ls,sep="\n")

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int n,a[200001],maxxx,maxx,b[200001];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n;
	for (int i=1;i<=n;++i) cin>>a[i],b[i]=a[i];
	sort(b+1,b+n+1);
	maxxx=b[n];
	maxx=b[n-1];
	for (int i=1;i<=n;++i)
		if (a[i]==maxxx) cout<<maxx<<endl;
		else cout<<maxxx<<endl;
	return 0;
}

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

int main(int argc, const char * argv[]) {
    int a1=0,a2=0,a3=0,a4=0,dice[101][7],i=0,a=0,z=0,j=0,k=0,b=0;
    scanf("%d",&a);
    for(i=1;i<=a;i++){
        for(j=1;j<=6;j++){
            scanf("%d",&dice[i][j]);
        }
    }
    for(i=1;i<=a;i++){
        for(j=i+1;j<=a;j++){
            for(k=0;k<10000;k++){
                z = rand()%4;
                if(z==0){
                    a1=dice[i][1];
                    a2=dice[i][3];
                    a3=dice[i][4];
                    a4=dice[i][6];
                    dice[i][1]=a3;
                    dice[i][3]=a1;
                    dice[i][4]=a4;
                    dice[i][6]=a2;
                }else if(z==1){
                    a1=dice[i][1];
                    a2=dice[i][2];
                    a3=dice[i][5];
                    a4=dice[i][6];
                    dice[i][1]=a2;
                    dice[i][2]=a4;
                    dice[i][5]=a1;
                    dice[i][6]=a3;
                }else if(z==2){
                    a1=dice[i][1];
                    a2=dice[i][2];
                    a3=dice[i][5];
                    a4=dice[i][6];
                    dice[i][1]=a3;
                    dice[i][2]=a1;
                    dice[i][5]=a4;
                    dice[i][6]=a2;
                }else if(z==3){
                    a1=dice[i][1];
                    a2=dice[i][3];
                    a3=dice[i][4];
                    a4=dice[i][6];
                    dice[i][1]=a2;
                    dice[i][3]=a4;
                    dice[i][4]=a1;
                    dice[i][6]=a3;
                }
                for(b = 1;b <= 6;b++)
                    if(dice[i][b] != dice[j][b])
                        break;
                if(b == 7){
                    printf("No\n");
                    return 0;
                }
//                for(aaa = 1;aaa<=6;aaa++){
//                    if(dice[i][aaa] != dice[j][aaa]){
//                        break;
//                    }else{
//                    }
//                    if(aaa==7){
//                        printf("No\n");
//                        return 0;
//
//                    }
//                }
            }
        }

    }
    printf("Yes\n");
    return 0;
}

Measured memory_bytes: 584
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int) n; i++)
using ll = long long;
template <class T>
using vt = std::vector<T>;
using vvi = std::vector<vt<int>>;

int main(){
  std::string s;
  std::cin >> s;
  std::set<char> check;
  rep(i,s.size()){
    char sc = s[i];
    if(check.count(sc)){
      std::cout << "no" << '\n';
      return 0;
    }
    check.insert(sc);
  }

  std::cout << "yes" << '\n';
  return 0;
}


Measured memory_bytes: 256
//Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
using namespace std;
#define ios ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define ll long long
#define endl '\n'
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
bool sortbysec(const pair<int,int>&a,const pair<int,int>&b)
{
    return (a.second<b.second);
}
int main()
{
    ios;
    int n;
    cin>>n;
    int a[n],c=0;
    for(int i=0;i<n;i++)
        cin>>a[i];
    for(int i=0;i<n;i++)
    {
        if(a[i]!=i+1)
        c++;

    }
    if(c<=2)
    {
        cout<<"YES"<<endl;

    }
    else
        cout<<"NO"<<endl;



}
//Alhamdulillah







Measured memory_bytes: 3648
#include <bits/stdc++.h>
/*
||||||||||||||||||||||||||||||||||||||||||||||||
   |      |||         |      ||||    ||||  |   |
  | |     |   |      | |     |   |  |      |   |
 |   |    |    |    |   |    |   |  |      |   |
|||||||   |    |   |||||||   |||     |||   |||||
|     |   |   |    |     |   | |        |  |   |
|     |   |||      |     |   |  ||  ||||   |   |
||||||||||||||||||||||||||||||||||||||||||||||||

*/
using namespace std;
#define ff first
#define ss second
#define mp make_pair
#define all(v) v.begin(),v.end()
//#define int long long
#define ll long long
#define M 1000007

#define mii  map<ll int,ll int>
#define msi  map<string,ll int>
#define mis  map<ll int, string>
#define rep(a,b)    for(ll i=a;i<b;i++)
#define rep0(n)    for(ll i=0;i<n;i++)
#define repi(i,a,b) for(ll i=a;i<b;i++)
#define pb push_back
#define vi vector<ll>
#define mp make_pair
#define vs vector<string>
#define ppb pop_back
#define endl '\n'
#define asdf ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define r0 return 0;
#define FORD(i, a, b) for (int i = (int) (a); i >= (int) (b); --i)
#define FORE(it, c) for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define inputoutput freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define Set(a, s) 4(a, s, sizeof (a))
#define FOR repi
int n;
signed main()
{
 int t=1;
 //cin>>t;
   //cin.ignore();
 while(t--)
 {
     int n;
     cin>>n;
        vector<int> a(n);
        rep0(n)
        cin>>a[i];
        int p=0;
       vector<int>  ans(n+100,1e18);
        ans[0]=0;
        ans[1]=abs(a[1]-a[0]);
        rep(2,n)
        {
            int aaa=abs(a[i-1]-a[i]),bbb=abs(a[i-2]-a[i]);
            ans[i]=min(aaa+ans[i-1],bbb+ans[i-2]);
            //cout<<ans[i-1]<<" ";
        }
        cout<<ans[n-1];

 }
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define int long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
const int MOD=1e9+7;
const int INF=1e18;

signed main(){
    int N;cin>>N;
    map<int,int>memo;
    REP(i,N){
        int a;cin>>a;
        memo[a]++;
    }
    int ans=0;
    for(auto v:memo){
        ans+=(v.second>=v.first?v.second-v.first:v.second);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 6272
#include <bits/stdc++.h>
typedef long long lint;

#define PI acos(-1)
#define INF64 1LL << 60
#define INF32 1 << 29
#define all(a) (a).begin(), (a).end()

using namespace std;

void execute()
{
	int N;
	lint ans = 1;
	lint input;
	lint a, b, r;
	cin >> N;

	for (int i = 0; i < N; i++)
	{
		cin >> input;

		a = max(ans, input);
		b = min(ans, input);
		r = a % b;
		for (; r != 0;)
		{
			a = b;
			b = r;
			r = a % b;
		}
		ans *= input / b;
	}
	cout << ans << endl;
	return;
}

int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	execute();

	int stop;
	cin >> stop;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;

int main(){
	int n,x;
	while(~scanf("%d",&n)){
		int mi,ma;
		scanf("%d",&x);
		mi=ma=x;
		int mil=1,mal=1;
		for(int i=2;i<=n;i++){
			scanf("%d",&x);
			mi=min(mi,x);
			ma=max(ma,x);
			if(mi==x) mil=i;
			if(ma==x) mal=i;
		}
		if(mi+ma>0){
			printf("%d\n",2*n);
			printf("%d %d\n",mal,1);
			printf("%d %d\n",mal,1);
			for(int i=1;i<n;i++){
				printf("%d %d\n",i,i+1);
				printf("%d %d\n",i,i+1);
			}
		}
		else{
			
			printf("%d\n",2*n);
			printf("%d %d\n",mil,n);
			printf("%d %d\n",mil,n);
			for(int i=n-1;i>0;i--){
				printf("%d %d\n",i+1,i);
				printf("%d %d\n",i+1,i);
			}
		}
	}
}


Measured memory_bytes: 256
def main():
    N, M = map(int, input().split())
    search = M//N + 1
    for s in range(search, 0, -1):
        sum_array = s * N
        if sum_array > M:
            continue
        remain = M - sum_array
        if remain % s == 0:
            print(s)
            return

if __name__ == "__main__":
    main()


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

#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define mem(x,val) memset((x),(val),sizeof(x))
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define PI acos(-1.0) 
#define N 111111

const int INF = 1 << 30 ;
typedef long long ll ;
typedef pair < int , int > pii ;

int  a[27] ;

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

  for(int i = 0 ; i<s.length() ;i++){
    a[s[i] -'a']++ ;
  }

  for(int i = 0 ;i<26 ;i++){
    if(a[i] == 0){
      printf("%c", i+'a') ;
      return 0 ;
    }
  }
  printf("None") ;
  return 0 ;
}



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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

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

int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

int main(){
    ll k,a,b,m;
    cin>>k>>a>>b;
    m=k;
    if(a>=b){
        cout<<k+1<<endl;
        return 0;
    }
    else{
        if(k<a+1){
            cout<<k+1<<endl;
            return 0;
        }
        else{
            ll ans=b;
            k=k-a-1;
            int n=k/2;
            ans+=n*(b-a);
            if(k%2==1)ans++;
            cout<<max(ans,m+1)<<endl;
        }     
    }
}


Measured memory_bytes: 256