akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define int long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define forn(i,n) for(int i=0;i<(int)(n);i++)
#define for1(i,n) for(int i=1;i<=(int)(n);i++)
const int MOD = 1e9 + 7 ;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
const int N=20000001;
int n,x,y;

int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      int n;
      cin>>n;
      int a[n];
      int s=0;
      for(int i=0;i<n;i++)
      {
            cin>>a[i];
            s+=a[i];
      }
      int ans=1e17;
      int s1=0;
      for(int i=0;i<n;i++)
      {
            ans=min(ans,abs(s1-(s-s1)));
            s1+=a[i];
      }
      ans=min(ans,abs(s1-(s-s1)));
      cout<<ans;

}
// nothing is impossible

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<map>
#include<set>
using std::cin;using std::cerr;
using std::max;using std::min;
#define N 105
#define ll long long
#define db double
#define dbg1(x) cerr<<#x<<"="<<x<<" "
#define dbg2(x) cerr<<#x<<"="<<x<<"\n"
int n,A[N],cnt,ans;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&A[i]);
	for(int i=1;i<=n;i++)
	{
		if(A[i]^A[i-1])
		{
			if(cnt>1) ans+=cnt>>1;
			cnt=1;
		}
		else cnt++;
	}
	if(cnt>1) ans+=cnt>>1;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
const double pi=acos(-1);
int main(){
  rep(k,MOD){
    int h,w;
    cin >> h >> w;
    if(h==0 && w==0) return 0;
    rep(i,h){
      rep(j,w){
        if((i+j)%2==0) cout << '#';
        else cout << '.';
      }
      cout << endl;
    }
    cout << endl;
  }
}



Measured memory_bytes: 3116
n, c, k = gets.split.map(&:to_i)
ts = n.times.map { gets.to_i }.sort!.reverse!

ans = 1
base = ts.first
passengers = 0

1.upto(n - 1) do |i|
  if ts[i] + k < base || (ts[i] + k <= base + k && passengers == c)
    ans += 1
    base = ts[i]
    passengers = 0
  end

  passengers += 1
end

puts ans


Measured memory_bytes: 4016
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

int main(){
  int N;
  cin >> N;
  int b[N-1];
  for(int i = 0; i < N - 1; i++) cin >> b[i];

  int ans = 0;
  ans += b[0];
  ans += b[N - 2];

  for(int i = 1; i < N - 1; i++){
    ans += min(b[i-1], b[i]);
  }

  cout << ans << endl;
  return 0;
}


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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()
#define endl "\n"

using ll = long long;
using P = pair<int,int>;
using mp =  map<string,int>;

const int MOD = 1e9 + 7;

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

    string s;
    cin >> s;

    s[3] = '8';
    cout << s << endl;

    return 0;
}

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

/*****************MACRO*****/

#define ll long long
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

/*******CONSTANT***********/
#define INF (1<<30) //infinity value
#define EPS 1e-9
#define MOD 10000007
#define SIZ 1005
#define PI (acos(-1))

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);
    cout.tie(0);
    ll n;
    cin>>n;
    ll cnt=0;
    ll sum=0;
    for(ll i=2; i*i<= n; i++){
        if(n%i==0){

            ll j= n/i;
            ///so i, j are the two divisors
            if(n/(i-1)==n%(i-1)) sum+= i-1;
            if(j!=i && (n/(j-1)==n%(j-1))) sum+= j-1;
            //cout<<"i="<<i<<"\tj="<<j<<"\tcnt="<<cnt<<"\n";


        }
    }
    ///cout<<cnt+1<<"\n";///as N-1 always satisifies the condition
    if(n==2) cout<<0<<"\n";
    else cout<<sum+n-1<<"\n";






    return 0;
}


/**********************************************************************************
############
Find the bug:
for(ll i=2; i*i<= n; i++){
        if(n%i==0){

            ll j= n/i;
            ///so i, j are the two divisors
            if(n/(i-1)==n%(i-1)) cnt++, sum+= i-1;
            if(n/(j-1)==n%(j-1)) cnt++, sum+= j-1;
            //cout<<"i="<<i<<"\tj="<<j<<"\tcnt="<<cnt<<"\n";


        }
    }
    ///cout<<cnt+1<<"\n";///as N-1 always satisifies the condition
    cout<<sum+n-1<<"\n";

suppose sqrt(n)= 21 eta satisies the condition
tahole eta kintu 2 bar count or jog hosse




*************************************************************************************/


Measured memory_bytes: 256
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Queue;
import java.util.Scanner;
 


public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);   cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static int K,N;
	static int mod =1000000007;
	public static void main(String[] args) {
		
		String S=sc.next();
		int v[]=new int[200];
		for(int i=0;i<S.length();i++) {
			v[S.charAt(i)]=1;
		}
		char ans=0;
		for(int i=97;i<123;i++) {
			if(v[i]==0) {
				ans=(char) i;
				p(ans+"");
				break;
			}
		}
		if(ans==0)p("None");
		
	}

	
	//static ArrayList<Integer> cc = new ArrayList<>(10001);
	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
}
	


Measured memory_bytes: 23508
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<class T, class U> inline bool chmax(T& a,U b) { if (a < b) { a = b; return 1; } return 0; }
template<class T, class U> inline bool chmin(T& a,U b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
    int n;
    cin >> n;
    vector<string> s(n);
    map<string, int> mp;
    for (int i = 0; i < n; i++) {
        cin >> s[i];
        mp[s[i]]++;
    }
    
    int mx = 0;
    for (auto e : mp) chmax(mx, e.second);
    vector<string> ans;
    for (auto e : mp) {
        if (e.second == mx) ans.push_back(e.first);
    }
    
    sort(ans.begin(), ans.end());
    for (auto e : ans) cout << e << endl;
    return 0;
}

Measured memory_bytes: 28532
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <functional>
#include <algorithm>
#include <string>

using namespace std;

int main (void)
{
	int h[100],m,n;

	string a,left,right;

	for (int A = 0; A < 50; A++)
	{
		cin >> a;


		if (a == "-")
				{
					break;
				}

		cin >> m;

		for (int B = 0; B < m; B++)
		{
			cin >> h[B];

			n = 0;
							n = a.size();

			left = a.substr(0,h[B]);
			right = a.substr(h[B],n);

			a = right + left;

		}
		cout << a << endl;
	}

}

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

int main(void)
{
  int x, y;
  cin >> x >> y;

  int count = 0;
  if(abs(x) < abs(y)){
      count = abs(y) - abs(x);
      if(x<0&&y>=0 || x>=0 &&y<0)
        count++;
      else if(x<0 && y<0)
        count+=2;
  }
  else{
      count = abs(x)- abs(y);
      if(x>0 && y>0)
        count+=2;
      else if(x<=0 && y>0|| x>0 && y <= 0)
        count++;
  }

 
  cout << count << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };
template <class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
struct io { io() { ios::sync_with_stdio(false); cin.tie(0); } };
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-9;

signed main(void)
{    
    ll x, t;
    cin >> x >> t;
    
    mes(max(0ll, x-t));
    
    
    
    
    
    
}

Measured memory_bytes: 3552
#include <bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define deci fixed<<showpoint<<setprecision //<<deci()<<
#define ll long long
#define mod 1000000007
double pi=acos(-1);
using namespace std;
string s1,s2;
int cnt;
int main()
{ IOS
    cin>>s1>>s2;
 	for(int i=0;i<3;i++){
      if(s1[i]==s2[i]){
        cnt++;}}
	cout<<cnt;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void) {
	int N, x,i,w=2001,e=0,a;
	scanf("%d", &N);
	for (i= 1; i <= N;i++) {
		scanf("%d", &x);
		if (w > x)w = x;
		if (e < x)e = x;
	}
	a = e - w;
	printf("%d\n", (a+1)/2);
	return 0;
}


Measured memory_bytes: 2132
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MOD 1000000007
#define MOD2 998244353
#define pb emplace_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define sz(x) (ll)x.size()
#define F first
#define S second
#define FOR(i,a,b) for(ll i=a;i<=b;++i)
#define ROF(i,a,b) for(ll i=a;i>=b;--i)
#define trace(x) cerr<<#x<<": "<<x<<'\n';
typedef long long ll;
using namespace std;
using namespace __gnu_pbds;
#define T int
#define ordered_set tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>
auto clk=clock();
 
ll mexp(ll a, ll b, ll m){
    ll ans=1;
    a%=m;
    while(b){
        if(b&1) ans=ans*a%m;
        b>>=1;
        a=a*a%m;
    }
    return ans;
}

const int N = 100005;

ll h[N];
ll n, a, b;

bool ck(ll x){
    ll mx = 0;
    ll cnt = 0;
    FOR(i,1,n){
        ll temp = max(0LL, h[i] - b * x);
        cnt += (temp + a - b -1) / (a - b);
    }
    return cnt <= x;
}

int main(){
    IOS
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());

    cin >> n >> a >> b;
    FOR(i,1,n){
        cin >> h[i];
    }
    ll l = 0, r = 1000000000;
    ll ans;
    while(l <= r){
        ll mid = (l + r) / 2;
        if(ck(mid)){
            ans = mid;
            r = mid - 1;
        }
        else{
            l = mid + 1;
        }
    }
    cout << ans;


    cerr<<endl<<endl<<"Time: "<<fixed<<setprecision(12)<<(long double)(clock()-clk)/CLOCKS_PER_SEC<<" ms"<<endl<<endl;
 
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
 
using namespace std;
 
int main() {
    int i;
    int n, t_score=0, h_score=0;
    string tarou, hanako;
    
    cin >> n;    
    for(i=0; i<n; i++){
        cin >> tarou;
        cin >> hanako;
        
        if(tarou > hanako) t_score+=3;
        else if(tarou < hanako) h_score+=3;
        if(tarou == hanako) {t_score+=1; h_score+=1;}        
    }
    cout << t_score << " " << h_score << endl;
        
        return 0;
}
 

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

int n,d,cnt;
int f[105][105];

bool work(int a,int b)
{
	int ans = 0,t;
	for(int i = 1;i <= d;i++)
		ans += pow(abs(f[a][i] - f[b][i]),2);
	t = sqrt(ans);
	if(t * t == ans)
		return true;
	return false;
}

int pow(int a,int b)
{
	int t;
	if(b == 0)
		return 1;
	if(b == 1)
		return a;
	t = pow(a,b / 2);
	if(b % 2 == 0)
		return t * t;
	else
		return t * t * a ;
}
int main()
{
	cin >> n >> d;
	for(int i = 1;i <= n;i++)
		for(int j = 1;j <= d;j++)
			cin >> f[i][j]; 
	for(int i = 2;i <= n;i++)
		for(int j = 1;j < i;j++)
			{
				if(work(i,j))
					cnt++;	
			} 
	cout << cnt;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define sf scanf
#define pf printf

using namespace std;

int main()
{
	ll a,b,c;
  	sf("%lld %lld.%lld",&a,&b,&c);
  	b*=100;
  	b+=c;
  	pf("%lld\n",(a*b)/100);
    return 0;
}

Measured memory_bytes: 3796
function solve()
    n = parse(Int, readline())
    a = [parse(Int, x) for x in split(readline())]

    dp = zeros(Int, n)
    dp[2] = max(a[1], a[2])
    oddsum = a[1]
    for i in 3:n
        if i % 2 == 0
            dp[i] = max(oddsum, dp[i-2] + a[i])
        else
            dp[i] = max(dp[i-1], dp[i-2] + a[i])
            oddsum += a[i]
        end
    end
    dp[n]
end

println(solve())

Measured memory_bytes: 192520
#include <iostream>
#include <algorithm>
#include <climits>
#include <numeric>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>

#define barsik ios::sync_with_stdio(false)
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)

typedef long long ll;
typedef std::vector<int> vi;
typedef std::pair <int, int> pii;
typedef std::unordered_set <int> u_si;

using namespace std;

int f(char x, int a, int b){
    if(x == '1') return a + b;
    return a - b;
}

string to_bin(int n){
    string ans = "";
    while(n > 0){
        ans = to_string(n % 2) + ans;
        n /= 2;
    }
    if(ans.size() == 1){
        ans = "00" + ans;
    }
    else if(ans.size() == 2){
        ans = "0" + ans;
    }
    else if(ans.size() == 0){
        ans = "000";
    }
    return ans;
}

void solve(){
    string s;
    cin >> s;
    int a, b, c, d;
    a = s[0] - 48;
    b = s[1] - 48;
    c = s[2] - 48;
    d = s[3] - 48;
    for(int i = 0; i <= 7; i++){
        string sign = to_bin(i);
        int tmp = f(sign[0], a, b);
        tmp = f(sign[1], tmp, c);
        tmp = f(sign[2], tmp, d);
        if(tmp == 7){
            cout << a << ((sign[0] == '0') ? "-" : "+")  << b << ((sign[1] == '0') ? "-" : "+") << c << ((sign[2] == '0') ? "-" : "+") << d << "=7";
            return;
        }
    }
}
// a b c d
// f(a, b)
// f(

int main(){
    barsik;
    int q = 1;
    //cin >> q;
    while(q--) solve();
}



Measured memory_bytes: 256
import java.util.*;
public class Main {

  public static void main(String[] args) { 
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int[] arr = new int[n];

      int cnt = 0;
      for(int i = 0; i < n; i++) {
        arr[i] = sc.nextInt();
        if(arr[i] % 2 == 0) cnt++;
        else break;
      }
      int times = 0;
      while(cnt == n) {
        cnt = 0;
        for(int i = 0; i < n; i++) {
          if(arr[i] % 2 == 0) { 
            arr[i] /= 2;
            cnt++;
          } else break;
        }
        if(cnt == n)
          times++;
      }
      System.out.println(times);
  }
}

Measured memory_bytes: 21716
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
typedef long long ll;
const int N =2e5+6;
const int mod = 1e9+7;
ll n,k;
ll a[N];
bool ch(ll x){
    ll s = 0;
    ll t = 0;
    for(int i=0;i<n;i++){
        if(a[i]>0){
            int st = -1;
            int en = n;
            while(en-st>1){
                int mid = (st+en)/2;
                if(a[i]*a[mid]<=x){
                    st = mid;
                }
                else{
                    en=  mid;
                }
            }
            s+=en;
        }
        else if(a[i]<0){
            int st = -1;
            int en = n;
            while(en-st>1){
                int mid = (st+en)/2;
                if(a[i]*a[mid]<=x){
                    en = mid;
                }
                else{
                    st =  mid;
                }
            }
            s+=n-en;
        }
        else if(x>=0){
            s+=n;
        }
        if(a[i]*a[i]<=x)t++;
    }
    ll ret = (s-t)/2;
    return ret<k;
}
void solve(){
    cin>>n>>k;
    for(int i=0;i<n;i++)cin>>a[i];
    sort(a,a+n);
    ll st = -1e18;
    ll en = 1e18;
    while(st<=en){
        ll mid = (st+en)/2;
        if(ch(mid)){
            st = mid+1;
        }
        else{
            en = mid-1;
        }
    }
    cout<<st<<endl;
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int t = 1;
    while(t--)solve();
    return 0;
}


Measured memory_bytes: 5132
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type contest struct {
	in  io.Reader
	out io.Writer
}

func (con *contest) Scan(a ...interface{}) (int, error) {
	return fmt.Fscan(con.in, a...)
}
func (con *contest) Scanln(a ...interface{}) (int, error) {
	return fmt.Fscanln(con.in, a...)
}
func (con *contest) Scanf(f string, a ...interface{}) (int, error) {
	return fmt.Fscanf(con.in, f, a...)
}
func (con *contest) Print(a ...interface{}) (int, error) {
	return fmt.Fprint(con.out, a...)
}
func (con *contest) Println(a ...interface{}) (int, error) {
	return fmt.Fprintln(con.out, a...)
}
func (con *contest) Printf(f string, a ...interface{}) (int, error) {
	return fmt.Fprintf(con.out, f, a...)
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	con := &contest{in: in, out: out}
	con.main()
}

func (con *contest) main() error {
	var a, b, c int
	con.Scan(&a, &b, &c)
	if a <= c && c <= b {
		con.Println("Yes")
	} else {
		con.Println("No")
	}
	return nil
}


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

#define LL long long
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9+7;

int main() {
    string s;
    cin >> s;
    map<char, bool> m;
    for(auto c : s) {
        if(m[c]) {
            cout << "no" << endl;
            return 0;
        }else{
            m[c] = true;
        }
    }
    cout << "yes" << endl;
    return 0;
}



Measured memory_bytes: 256
import java.util.*;
import java.io.*;

public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int x = sc.nextInt();
        int a = sc.nextInt();
        if(x < a) System.out.println(0);
        else System.out.println(10);

    }

    private static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            }else{
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while(true){
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                }else if(b == -1 || !isPrintableChar(b)){
                    return minus ? -n : n;
                }else{
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }
        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
            return (int) nl;
        }
        public double nextDouble() { return Double.parseDouble(next());}
    }
}


Measured memory_bytes: 23252
#include<iostream>
#include<stdio.h>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<string>
#include<stack>
#include<set>
#include<map>
#include<time.h>
#include<cstdlib>
typedef long long ll;
//#pragma comment(linker, "/STACK:1024000000,1024000000")
#define mm(a) memset(a,0,sizeof(a))
#define lr rt<<1
#define rr rt<<1|1
#define sync std::ios::sync_with_stdio(false);std::cin.tie(0);
#define inf 0x3f3f3f3f
#define eqs 1e-8
#define lb(x) (x&(-x))
#define ch(a) (int(a-'a')+1)
#define rep(i,a,b) for(int i=a;i<=b;i++)
using namespace std;
typedef pair<int,int> pii;
const double pi=acos(-1);
const int maxn=100005;
const ll Mod=1000000007;


ll a[maxn];
bool cmp(ll a,ll b)
{
    return a>b;
}

int main()
{
    sync;
    ll n,m,v,p;
    cin>>n>>m>>v>>p;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a+1,a+n+1,cmp);
    ll d=a[p];
    int sum=0;
    ll s=0;
    ll c=0;
    for(int i=p;i<=n;i++)
    {
        if(a[i]>d)
        {
            sum++;
            continue;
        }
        if(d-m>a[i])
            break;
        if(s<=1ll*(n-v)*m+1ll*a[i]*c)
        {
            sum++;
            s+=a[i];
            c++;
        }
        else
            break;
    }
    cout<<sum+p-1<<endl;
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;
const ll LINF = 1LL << 60;
const int MOD = 1'000'000'007;

template <typename T>
void print(const T &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << ' ';
        cout << v[i];
    }
    cout << endl;
}

template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

int main()
{
    string s, t;
    cin >> s >> t;
    int mini = INF;
    for (int i = 0; i <= s.size() - t.size(); i++)
    {
        int cnt = 0;
        for (int j = 0; j < t.size(); j++)
        {
            if (s[i + j] != t[j])
            {
                ++cnt;
            }
        }
        mini = min(mini, cnt);
    }
    cout << mini << endl;
    return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
char board[2][3];
int main()
{
    for(int i = 0;i < 2;i++)
    {
        for(int j = 0;j < 3;j++)
            cin >> board[i][j];
    }
    if(board[0][0] == board[1][2] && board[0][1] == board[1][1] && board[0][2] == board[1][0])
        cout << "YES";
    else
        cout << "NO";
    return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

n = int(input())
A = [list(map(int,input().split())) for i in range(n)]
mod = 10**9 + 7
l = 2*10**5 + 10

M = [1]  # i!のmod
m = 1
for i in range(1, l):
    m = (m * i) % mod
    M.append(m)

def pow(x, y, mod):  # x**y の mod を返す関数
    ans = 1
    while y > 0:
        if y % 2 == 1:
            ans = (ans * x) % mod
        x = (x**2) % mod
        y //= 2
    return ans

def inv(x, mod):  # x の mod での逆元を返す関数
    return pow(x, mod-2, mod)

# print(inv(8,13))

MI = [0] * (l-1) +[inv(M[l-1], mod)]  # i!の逆元
for i in range(l-2, -1, -1):
    MI[i] = MI[i+1] * (i+1) % mod

def C(x, y):  # コンビネーション
    if y < 0 or y > x:
        return 0
    elif x > l:  # O(min(y, x-y))
        y = min(y, x-y)
        ans = 1
        for i in range(x, x-y, -1):
            ans = (ans * i) % mod
        return (ans * MI[y]) % mod
    else:  # O(1)
        ans = M[x]
        ans = (ans * MI[y]) % mod
        return (ans * MI[x-y]) % mod


M2 = [1]
for i in range(l):
    M2.append((M2[-1] * 2) % mod)

import math

D = {}
m = 0
for i in range(n):
    x = A[i][0]
    y = A[i][1]
    if x != 0 or y != 0:
        m += 1
        
        s = 0
        while not (x >= 0 and y > 0):
            x, y = -y, x
            s += 1
        g = math.gcd(x, y)
        x //= g
        y //= g
        try:
            D[(x,y)][s] += 1
        except:
            D[(x,y)] = [0,0,0,0]
            D[(x,y)][s] += 1
    
# print(D,m)

def minus(ll,x):
    ans0 = 0
    # hu = -1
    for i in range(2, x+1):
        ans0 = (ans0 + M2[ll-x] * C(x, i)) % mod
        # hu *= -1
    return ans0

# ans = M2[m] - 1 + (n-m)
ans = 1
DV = list(D.values())
ld = len(DV)
# print(DV)
for i in range(len(DV)):
    s = sum(DV[i])
    s0 = DV[i][0] + DV[i][2]
    s1 = DV[i][1] + DV[i][3]
    ans = (ans * (M2[s0] + M2[s1] - 1)) % mod
    # print(s,s0,s1)
    # print(minus(s) ,minus(s0) , minus(s1))
    # ans = (ans - minus(ld,s) + minus(s0,s-s0) + minus(s1,s-s1)) % mod

print((ans-1 + (n-m)) % mod)


Measured memory_bytes: 154224
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long LL;
typedef pair<LL,LL> P;
const LL mod=1e9+7;
const LL LINF=1LL<<62;
const int INF=1000000000;


int main(){
    int n,a,b;cin >> n >> a >> b;
    vector<int> p(n);
    for (int i = 0; i < n; i++) {
        cin >> p[i];
    }
    vector<int> v(3,0);
    for (int i = 0; i < n; i++) {
        if(p[i]<=a) v[0]++;
        else if(p[i]<=b) v[1]++;
        else v[2]++;
    }
    cout << min({v[0],v[1],v[2]}) << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#define PI 3.14159265359
typedef long long ll;
const int MOD = 1e9+7;
const ll LLINF = 1e18;
using namespace std;


ll llmin(ll x, ll y){
	if (x < y) return x;
	return y;
}

ll llmax(ll x, ll y){
	if (x > y) return x;
	return y;
}


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


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


int main() { 
    int n,m;
    cin >> n >> m;
    n=min(m,n);
    vector<int> x(m);
    for (int i=0;i<m;i++) cin >> x[i];
    sort(x.begin(),x.end());
    int ans=x[m-1]-x[0];
    vector<int> dx(m-1);
    for (int i=0;i<m-1;i++) {
        dx[i]=x[i+1]-x[i];
    }
    sort(dx.begin(),dx.end(),greater<int>());
    for (int i=0;i<n-1;i++) ans-=dx[i];
    cout << ans << endl;
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		long n = sc1.nextLong();
		long[] time = new long[5];
		time[0] = sc1.nextLong();
		time[1] = sc1.nextLong();
		time[2] = sc1.nextLong();
		time[3] = sc1.nextLong();
		time[4] = sc1.nextLong();

		long ans = 0;
		int idx = 0;
		for (int i=0; i < 4 ; i++) {
			if (time[idx] > time[i+1]) {
				idx = i+1;
			}
		}

		if (n % time[idx] == 0) {
			ans = 4 + (n / time[idx]);;
		}
		else {
			ans = 5 + (n / time[idx]);
		}

		System.out.println(ans);

		sc1.close();

	}

}

Measured memory_bytes: 23124
H, W = map(int, input().split())
L = [input() for _ in range(H)]

count = 0
for i in range(H):
  for j in range(W):
    if L[i][j] == '#':
      count += 1
      
if count == W + H - 1:
  print('Possible')
else:
  print('Impossible')

Measured memory_bytes: 3060
# -*- coding: utf-8 -*-
n, T = map(int,input().split())
t = [int(i) for i in input().split()]

ans = 0
for i in range(n - 1):
    if t[i + 1] - t[i] <= T:
        ans += t[i + 1] - t[i]
    else:
        ans += T
print(ans + T)


Measured memory_bytes: 25196
import java.io.*;

public class Main{
	/*
	public static long findGcd(long f1, long f2){
		long gcd = 1;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		for(long i=1; i<=(long)(Math.sqrt(min)+1); i++){
			if(min % i == 0){
				long tmp = min / i;
				if((max % tmp) == 0){
					gcd = tmp;
					break;
				}
			}
		}
		return gcd;
	}
	
	public static long findlcm(long f1, long f2){
		long lcm = 0;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		long i=1;
		while(lcm == 0){
			if((max * i)%min == 0){
				lcm = max * i;
			}
			i++;
		}
		return lcm;
	}
	*/
	
	//最大公約数を求めるメソッド
    static long findGcd(long x, long y){
        if(x%y==0){
            return y;
        }else{
            long m = 1;
            while(m!=0){
                m = y%x;
                y = x;
                x = m;
            }
            return y;
        }
    }
    //最小公倍数を求めるメソッド
    static long findlcm(long x, long y){
        for(long i=1; i<=x; i++){
            if(y*i%x==0){
                return y*i;
            }
        }
        return 0;
    }
	
	public static void main(String[] argv) throws NumberFormatException, IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		while((line = br.readLine()) != null){
			String[] lineArray = line.split(" ");
			long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};
			long gcd = findGcd(factor[0], factor[1]);
			long lcm = findlcm(factor[0], factor[1]);
			System.out.println(gcd + " " + lcm);
		}
	}
}

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

int main()
{
  string s;
  int n, ans = 0, idx;
  cin >> n >> s;
  idx = s.find("ABC");
  while(idx != string::npos)
  {
    ans++;
    s = s.substr(idx+1);
    idx = s.find("ABC");
  }
  cout << ans << endl;
  return 0;
}

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

int main() {
  string s;
  cin >> s;
  int c = 0;
  for (int i = 0; i < 3; i++) {
    if (s.at(i) == 'o') c++;
  }
  cout << 700 + 100 * c << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define clr(x) memset(x,0,sizeof x)
#define For(i,a,b) for (int i=(a);i<=(b);i++)
#define Fod(i,b,a) for (int i=(b);i>=(a);i--)
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define fi first
#define se second
#define outval(x) cerr<<#x" = "<<x<<endl
#define outtag(x) cerr<<"-----------------"#x"-----------------\n"
#define outarr(a,L,R) cerr<<#a"["<<L<<".."<<R<<"] = ";\
                    For(_x,L,R) cerr<<a[_x]<<" ";cerr<<endl;
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair <int,int> pii;
LL read(){
    LL x=0,f=0;
    char ch=getchar();
    while (!isdigit(ch))
        f=ch=='-',ch=getchar();
    while (isdigit(ch))
        x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
    return f?-x:x;
}
const int N=5005;
int n;
char s[N],t[N];
deque <int> a,b,A,B;
int main(){
	n=read();
	cin>>(s+1)>>(t+1);
	if (s[1]!=t[1])
		a.pb(0);
	For(i,1,n-1){
		if (s[i]!=s[i+1])
			a.pb(i);
		if (t[i]!=t[i+1])
			b.pb(i);
	}
	if (s[n]!=t[n])
		a.pb(n);
	int ans=1e9;
	For(i,-n,n)
		if (i%2==0){
			int t=i;
			A=a,B=b;
			while (t>0)
				A.push_front(0),A.push_front(0),t-=2;
			while (t<0)
				B.push_front(0),B.push_front(0),t+=2;
			while (A.size()<B.size())
				A.pb(n),A.pb(n);
			while (B.size()<A.size())
				B.pb(n),B.pb(n);
			int now=0;
			For(i,0,(int)A.size()-1)
				now+=abs(A[i]-B[i]);
			ans=min(ans,now);
		}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 512
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = {0,100001};
        boolean flag = true;
        while(m>0){
            int l = sc.nextInt();
            int r = sc.nextInt();
            if(r < a[0] || a[1] < l){
                System.out.println(0);
                flag = false;
                break;
            }
            if(a[0] < l){
                a[0] = l;
            }
            if(r < a[1]){
                a[1] = r;
            }
            m--;
        }

        if(flag){
            System.out.println(a[1]-a[0]+1);
        }
    }
}


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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main()
{
    string S;
    cin >> S;
    
    int N;
    N = S.length();

    vector<int> ans(N,0);

    char now;
    int index;
    int start;
    int count;
    now = 'R';
    REP(i, N){
        if(i ==0){
            count = 1;
            start = 0;
            now = 'R';
            continue;
        }
        // 最後の文字列
        if(i == N-1){
            if((now == 'R') && (S[i] == 'L')){
                index = i;
            }
            count++;
            if ((index - start) % 2 == 0){
                ans[index-1] = count / 2;
                ans[index] = (count+1) / 2;
            }
            else{
                ans[index-1] = (count+1) / 2;
                ans[index] = count / 2;
            }
            break;
        }
        // R→R
        if((now == 'R') && (S[i] == 'R')){
            count++;
            now = 'R';
            continue;
        }
        // R→L
        if((now == 'R') && (S[i] == 'L')){
            count++;
            now = 'L';
            index = i;
            continue;
        }
        // L→L
        if((now == 'L') && (S[i] == 'L')){
            count++;
            now = 'L';
            continue;
        }
        // L→R
        if((now == 'L') && (S[i] == 'R')){
            if ((index - start) % 2 == 0){
                ans[index-1] = count / 2;
                ans[index] = (count+1) / 2;
            }
            else{
                ans[index-1] = (count+1) / 2;
                ans[index] = count / 2;
            }
            count=1;
            now = 'R';
            start = i;
            continue;
        }
    }
    REP(i, N){
        if(i == N-1){
            cout << ans[i] << endl;
        }
        else{
            cout << ans[i] << " ";
        }
    }

    return 0;
}

Measured memory_bytes: 1024
def main():
    n, m = map(int, input().split())
    dp = [0] * (n + 1)
    dp[0] = 1
    for _ in range(m):
        a = int(input())
        dp[a] = -1
    mod = 10 ** 9 + 7

    for i in range(n + 1):
        if dp[i] != -1:
            if i + 1 <= n and dp[i + 1] != -1:
                dp[i + 1] = (dp[i + 1] + dp[i]) % mod
            if i + 2 <= n and dp[i + 2] != -1:
                dp[i + 2] = (dp[i + 2] + dp[i]) % mod

    print(dp[-1] % mod)


if __name__ == "__main__":
    main()


Measured memory_bytes: 70748
#include<iostream>
#include<cstdio>
#include <stdio.h>
#include<algorithm>
#include<cstring>
#include <string>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<map>
#include<vector>
#include<bits/stdc++.h>
#include <set>
#define ll   long long
#define IO ios::sync_with_stdio(false);cin.tie();cout.tie(0)
#define inf 0x3f3f3f
#define pi 3.1415926535898
using namespace std;
const int N=2e5+10;
const int mod=1e9+7;
int f[N],d[N];
int n,m,l,r,v;
int finds(int x)
{
    if(x==f[x])
    {
        return x;
    }
    int now=f[x];
    f[x]=finds(f[x]);
    d[x]=d[x]+d[now];
    return f[x];
}
int main()
{
    cin>>n>>m;
    int ok=1;
    for(int i=1; i<=n; i++)
    {
        f[i]=i;
    }
    for(int i=1; i<=m; i++)
    {
        cin>>l>>r>>v;
        int sl=finds(l);
        int sr=finds(r);
        if(sl==sr)
        {
            if(d[l]-d[r]!=v)
                ok = 0;
        }
        else
        {
            f[sl]=sr;
            d[sl]=v+d[r]-d[l];
        }

    }
    if(ok)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;

    return 0;
}


Measured memory_bytes: 4380
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define int ll
using pint = pair<int,int>;
using Graph = vector<vector<int>>;
void YN(bool flg) {cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg) {cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg) {cout<<(flg?"yes":"no")<<'\n';}
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
#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 out(n) cout << n << '\n'
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<VI> VVI;
const int MOD = 1000000007;
const long long INF = 1e10; //10^10
const double PI = acos(-1.0L);
/*mod逆元*/long long modinv(long long a, long long m) {long long b = m, u = 1, v = 0;while (b) {long long t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;}
template< typename T >T mod_pow(T x, T n, T p=MOD) {T ret = 1;while(n > 0) {if(n & 1) (ret *= x) %= p;(x *= x) %= p;n >>= 1;}return ret;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n >>= 1; }return r; }
int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*素因数分解*/map< int, int >prime_factor(int n){map< int, int > ret;for(int i = 2; i * i <= n; i++) {while(n % i == 0) {ret[i]++;n /= i;}}if(n != 1) ret[n] = 1;return ret;}
/*約数列挙*/vector<int> divisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}

//----------------ライブラリとか----------------

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(15);

    int a,b; cin >> a >> b;
    int ans = 0;
    int now = 1;
    while(now<b){
        ans++;
        now += a;
        now--;
    }
    out(ans);

    return 0;
}

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

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

  int ans = 0;

  for(int i = 0;i < n-2;i++){
    if((p[i] <= p[i+1] && p[i+1] <= p[i+2]) || (p[i] >= p[i+1] && p[i+1] >= p[i+2]))ans++;
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
import sys
## io
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))
## dp
INIT_VAL = 0
DP2 = lambda d1, d2: [[INIT_VAL]*d2 for _ in range(d1)]
DP3 = lambda d1, d2, d3: [[[INIT_VAL]*d3 for _ in range(d2)] for _ in range(d1)]

def main():
    a, b = MII()
    dd = MII()
    total = sum(dd)
    if total > a: print(-1); exit(0)
    else: print(a-total)

if __name__ == '__main__':
    main()


Measured memory_bytes: 9984
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
    int a, b;
    double n;
    cin >> a >> b;
    n = a * (b < 10 ? 10 : (b < 100 ? 100 : 1000)) + b;
    int nsqrt = pow(n, 0.5);
    double nsqrtsq = pow(nsqrt, 2);
    cout << (n == nsqrtsq ? "Yes" : "No") << endl;
    return 0;
}

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

int main() {
  int n;
  cin >> n;
  int sum = 0;
  for(int i=0; i<n; i++){
    int l, r;
    cin >> l >> r;
    sum += r-l+1;
  }
   cout << sum; 
    
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define MAX 100
 
void trace(int A[],int N){
   int i,j;
   for(j=0;j<N;j++){
     if(j>0) cout << " ";
     cout << A[j];
     }
     cout << endl;
}
 
void insertionSort(int A[],int N){
   int i,j,v;
   for(i=1;i<N;i++){
     v = A[i];
     j = i - 1;
     while(j>=0&&A[j]>v){
       A[j+1] = A[j];
       j--;
     }
     A[j+1] = v;
   trace(A,N);
   }
}
 
int main(){
   int i,j,N,v,A[MAX];
 
   cin >> N;
   for(i=0;i<N;i++)cin >> A[i];
 
   trace(A,N);  
   insertionSort(A,N);
    
   return 0;
}

Measured memory_bytes: 1164
#include <algorithm>
#include <functional>
#include <cmath>
#include <cstdio>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <climits>

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
using namespace std;
typedef pair<int ,int > P;

int n;
int main() {
    cin>>n;
    int m = ceil(log2(n)/log2(3));
    cout<<m<<endl;
    return 0;
}

Measured memory_bytes: 1188
#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main()
{
    int x, a, b;
    cin >> x >> a >> b;

    if (abs(x - a) > abs(x - b))
        cout << "B" << endl;
    else
        cout << "A" << endl;

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>


int main(){
	int a, b, c, d, e, s[5], i, j, x=0, y=0, k=0, z=0, u=0, aux;
	scanf("%i", &a);
	scanf("%i", &b);
	scanf("%i", &c);
	scanf("%i", &d);
	scanf("%i", &e);
	if(a%10!=0)
		x=((a/10)+1)*10-a;
	if(b%10!=0)
		y=((b/10)+1)*10-b;
	if(c%10!=0)
		k=((c/10)+1)*10-c;
	if(d%10!=0)
		z=((d/10)+1)*10-d;
	if(e%10!=0)
		u=((e/10)+1)*10-e;
	s[0]=a+b+c+d+e+y+k+z+u;
	s[1]=a+b+c+d+e+x+k+z+u;
	s[2]=a+b+c+d+e+x+y+z+u;
	s[3]=a+b+c+d+e+x+y+k+u;
	s[4]=a+b+c+d+e+x+y+k+z;
	for(i=0; i<5; i++){
		for(j=i;j<5;j++){
			if(s[j]<=s[i]){
				aux=s[i];
				s[i]=s[j];
				s[j]=aux;
			}
		}
	}
	printf("%i\n", s[0]);
}

Measured memory_bytes: 128
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        s: chars,
        t: chars
    }

    let mut count = 0;
    for (c1, c2) in s.iter().zip(t.iter()) {
        if c1 != c2 {
            count += 1;
        }
    }

    println!("{}", count);
}


Measured memory_bytes: 4064