akhauriyash/Code-Regression huggingface dataset:
namespace Test
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class Test
    {
        public static void Main(string[] args)
        {
            var test = new Test();
            var n = test.ConvertIntArray(test.ReadInput());
            var h = n[0];
            var array = test.ConvertIntArray(test.ReadInput());
            Array.Sort(array);
            Array.Reverse(array);
            
            for(var i = 0; i<array.Length; i++)
            {
                h -= array[i];
                if(h <= 0)
                {
                    break;
                }
            }

            if(h <= 0)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }


        public string[] ReadInput()
        {
            return Console.ReadLine().Split(' ');
        }

        public int[] ConvertIntArray(string[] x)
        {
            var convertedArray = new int[x.Length];
            for (var i = 0; i < x.Length; i++)
            {
                convertedArray[i] = int.Parse(x[i]);
            }

            return convertedArray;
        }

        public double[] ConvertDoubleArray(string[] x)
        {
            var convertedArray = new double[x.Length];
            for (var i = 0; i < x.Length; i++)
            {
                convertedArray[i] = int.Parse(x[i]);
            }

            return convertedArray;
        }

        public long[] ConvertLongArray(string[] x)
        {
            var convertedArray = new long[x.Length];
            for (var i = 0; i < x.Length; i++)
            {
                convertedArray[i] = long.Parse(x[i]);
            }

            return convertedArray;
        }

        public int CountContainWords(string source, string word)
        {
            var count = 0;
            var loopCount = source.Length - (word.Length - 1);
            for (var i = 0; i < loopCount; i++)
            {
                if (source.Substring(i, word.Length) == word)
                {
                    count++;
                }
            }
            return count;
        }
    }
}

Measured memory_bytes: 16480
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,unsafe-math-optimizations")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
#include <assert.h>
#include <immintrin.h>
#include <emmintrin.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define PB push_back
#define MP make_pair
const int MOD=1000000007;
#define endl "\n"
#define fst first
#define snd second
const int UNDEF = -1;
const int INF=1<<30;
template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, true : false; }
template<typename T> inline bool chkmin(T &aa, T bb) { return aa > bb ? aa = bb, true : false; }
typedef pair<ll,ll> pll;typedef vector<ll> vll;typedef pair<int,int> pii;typedef vector<int> vi;typedef vector<vi> vvi;
#ifdef ONLINE_JUDGE
#define assert(...) /* nothing */
#endif
#define DEBUG_CAT
#ifdef DEBUG_CAT
#define dbg(...)   printf( __VA_ARGS__ )
#else 
#define dbg(...)   /****nothing****/
#endif
int rint();char rch();long long rlong();
const int mn=2e5+4;
int a[mn];
map<ll,int> h;
int main()
{
  ios_base::sync_with_stdio(false); cin.tie(0);
  ll ans=0;
  ll sum=0;
  int n=rint();
  h[0]=1;
  for (int i=0;i<n;i++) {
    int x=rint();
    sum+=x;
    ans+=h[sum];
    ++h[sum];
  }
  printf("%lld\n",ans);
}


inline int read_char() {
  static char buf[1 << 16], *ptr = buf, *end_ptr = buf;
  if (ptr == end_ptr) {
    int len = fread(buf, 1, sizeof(buf), stdin);
    if (len <= 0) return EOF;
    ptr = buf;
    end_ptr = buf + len;
  }
  return *ptr++;
}

inline int rint() {
  int ch; bool sg = 0;
  do {
    ch = read_char();
    if (ch == '-') sg = 1;
  } while (ch < '0' || ch > '9');
  int x = ch - '0';
  while (true) {
    ch = read_char();
    if (ch < '0' || ch > '9') break;
    x = x * 10 + ch - '0';
  }
  return (sg?-x:x);
}


Measured memory_bytes: 12800
#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using ulli = unsigned long long int;
#define debug(x) cerr << #x << " : " << x << endl
#define debugv(x) cerr << #x << " : {";for(auto value_of_x:x){ cerr << value_of_x << ", ";}cerr << endl


namespace atcoder {
	template<typename T>
	T ncr(T left, T right) {
		right = min(left - right, right);
		T ans = 1;
		for (T i = 1; i <= right; i++) {
			ans = ans * (left - right + i) / i;
		}
		return ans;
	}

	const int LIMIT = 1000000007;
	const int tenfive = 100000;
}

using namespace atcoder;

int main() {
	int n,m;
	cin >> n >> m;
	vector<int> v(m);
	for (int i = 0; i < m; i++) {
		cin >> v[i];
		v[i] += tenfive;
	}
	sort(v.rbegin(), v.rend());
	for (int i = 0; i < m-1; i++) {
		v[i] -= v[i + 1];
	}
	v[m - 1] = LIMIT;
	sort(v.rbegin(), v.rend());
	for (int i = 0; i < min(n,m); i++) {
		v[i] = 0;
	}
	lli ans = 0;
	for (int i = 0; i < m; i++) {
		ans += v[i];
	}

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


Measured memory_bytes: 640
def che(da):
  for i in range(2):
    for j in range(2):
      if da[i][j] - da[i][j+1] != da[2][j] - da[2][j+1]:
        return False
      if da[i][j] - da[i+1][j] != da[i][2] - da[i+1][2]:
        return False
  return True

da = [list(map(int,input().split())) for i in range(3)]
if che(da):
  print('Yes')
else:
  print('No')

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define max(a,b) (a>b?a:b)
#define min(a,b) (a>b?b:a)
#define lowbit(x) (x&-x)
#define F first
#define S second 
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f; 
const int maxn=2e5+10;
struct node{
	int t,f;
	char a;
}p[maxn];
int main()
{
	int q,x,y;
	char a[maxn];
	int t[maxn];
	string s;
	string ft="",bk="";
	cin>>s>>q;
	int dir=0;
	for(int i=1;i<=q;i++){
		cin>>p[i].t;
		if(p[i].t==2)
		cin>>p[i].f>>p[i].a;	
	}
	for(int i=q;i>=1;i--){
		if(p[i].t==1) dir=!dir;
		else{
			if(p[i].f==1){
				if(dir==0){
					ft=ft+p[i].a;
				}else bk=p[i].a+bk;
			}else if(p[i].f==2){
				if(dir==0) bk=p[i].a+bk;
				else ft=ft+p[i].a;
			}
		}
	}
	if(dir==0){
	cout<<ft;
	cout<<s;
	cout<<bk;	
	}
	
	else{
		reverse(s.begin(),s.end());
		cout<<ft;
		cout<<s;
		cout<<bk;
	}
}


Measured memory_bytes: 3812
#define _CRT_SECURE_NO_WARNINGS
    #define _USE_MATH_DEFINES
     
    #include "bits/stdc++.h"
    using namespace std;
    #define rep(i, n) for (int i = 0; i < (n); ++i)
    #define rep2(i, a, b) for (int i = (a); i < (b); ++i)
    #define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
    #define rrep2(i, a, b) for (int i = (a)-1; i >= b; --i)
    #define range(i, a, b, c) for (int i = a;             \
                                   c > 0 ? i < b : i > b; \
                                   i += c)
    #define chmax(a, b) (a = (a) < (b) ? (b) : (a))
    #define chmin(a, b) (a = (a) > (b) ? (b) : (a))
    using ll = long long;
    using ull = unsigned long long;
    using ld = long double;
    #define all(a) begin(a), end(a)
    #define ifnot(a) if (not(a))
    #define dump(x) cerr << #x << " = " << (x) << endl
    #define int long long
    #ifdef _MSC_VER
    const bool test = true;
    #else
    const bool test = false;
    #endif
     
    int dx[] = {1, 0, -1, 0};
    int dy[] = {0, 1, 0, -1};
    const int INF = (int)1 << 60;
    const ll INFL = (ll)1 << 60;
    ll mod_n = (int)1e9 + 7;
    const double eps = 1e-10;
    typedef long double Real;
    // return -1, 0, 1
    int sgn(const Real &r) { return (r > eps) - (r < -eps); }
    int sgn(const Real &a, const Real &b) { return sgn(a - b); }
     
    //.....................
    const int MAX = (int)2e5 + 5;
     
    vector<string> split(const string &str, char sep)
    {
        vector<string> v;
        stringstream ss(str);
        string buffer;
        while (getline(ss, buffer, sep))
        {
            v.push_back(buffer);
        }
        return v;
    }
     
    template <class InputIterator>
    int sum(InputIterator begin, InputIterator end)
    {
        return accumulate(begin, end, 0ll);
    }
     
    void solve();
     
    signed main()
    {
        cout << fixed << setprecision(20);
        solve();
        while (true)
        {
            char s[MAX];
            if (scanf("%s", s) == EOF)
                break;
            int n = strlen(s);
            for (int i = n - 1; i > -1; i--)
            {
                ungetc(s[i], stdin);
            }
            solve();
        }
        return 0;
    }
     
    int A, B, C;
     
    void solve()
    {
        cin >> A >> B >> C;
        if (A <= C && C <= B) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define f(a,j,k) for(int i = a ; i < j ; i += k)
#define f1(a,j,k) for(int i = a ; i > j ; i -= k)
using namespace std;
typedef long long ll;
typedef vector<long long> vl;
typedef vector<int> vi;
typedef pair<int,int> pri;
typedef pair<long long,long long> prl;
int main() {
	std::ios::sync_with_stdio(false);
  double a;
	cin >> a;
	printf("%.12lf\n",(a/3)*(a/3)*(a/3));

	return 0;
}


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

using namespace std;

int main() {
  int n, d1, d2;
  cin >> n;
  
  int t = 0;
  for(int i = 0; i < n; i++) {
    cin >> d1 >> d2;
    if(d1 == d2) {
      t++;
      if(t == 3) {
        cout << "Yes\n";
        return 0;
      }
    }
    else
      t = 0;
  }
  cout << "No\n";
}

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

int main(){
  int d;cin>>d;
  if(d==25)
    cout<<"Christmas"<<endl;
  else if(d==24)
    cout<<"Christmas Eve "<<endl;
  else if(d==23)
    cout<<"Christmas Eve Eve"<<endl;
  else if(d==22)
    cout<<"Christmas Eve Eve Eve"<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#include <map>
#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 INF 2e9
#define ALL(v) v.begin(), v.end()
typedef long long ll;


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;
}

vector<vector<ll>> p(5001);
bool C(pair<ll,ll> w) {
    if(0<=w.first && w.first<=5000 && w.second >= 0 && w.second <= 5000) {
        if(upper_bound(p[w.first].begin(),p[w.first].end(),w.second) != lower_bound(p[w.first].begin(),p[w.first].end(),w.second)){
           return true;
        }
        else {
            return false;
        }
    }
    else {
        return false;
    }
    
}

int main() {
    ll n,m,x;
    cin >> n >> m >> x;
    vector<ll> cost(n);
    vector<vector<ll>> a(n,vector<ll>(m));
    REP(i, n){
        cin >> cost[i];
        REP(j, m){
            cin >> a[i][j];
        }
    }

    ll c = 1000000000;
    bool flag = false;

    REP(i, pow(2,n)){
        vector<ll> X(m);
        ll b = i;
        ll tmpc = 0;
        REP(j, n){
            REP(k, m){
                X[k] += (b%2) * a[j][k];
            }
            tmpc += (b%2) * cost[j];
            b /= 2;
        }

        // cout << i << tmpc << endl;
        // REP(k,m){
        //     cout << X[k] << ' ';
        // }
        // cout << endl;
        sort(X.begin(),X.end());
        if(X[0] >= x){
            c = min(c, tmpc);
            flag = true;
        }

    }
    if (!flag){
        c = -1;
    }
    cout << c << endl;

}


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


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


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N, M = readnums()
    ab = [list(readnums()) for _ in range(M)]

    s1 = {x[1] for x in ab if x[0] == 1}
    s2 = {x[0] for x in ab if x[1] == N}

    if len(s1 & s2):
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')


if __name__ == "__main__":
    main()


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

struct UnionFind {
    vector<int> par;
    vector<int> sz;

    UnionFind(int n=0){
        if(n>0) initialize(n);
    }

    void initialize(int n){
        par.resize(n);
        sz.resize(n);
        for(int i=0; i<n; i++){
            par[i] = i;
            sz[i] = 1;
        }
    }

    int find(int x){
        if(par[x] == x){
            return x;
        }else{
            return par[x] = find(par[x]);
        }
    }

    bool unite(int x, int y){
        x = find(x);
        y = find(y);
        if(x == y) return false;
        if(sz[x] > sz[y]) swap(x, y);
        par[x] = y;
        sz[y] += sz[x];
        return true;
    }

    bool same(int x, int y){
        return find(x) == find(y);
    }

    int size(int x){
        return sz[find(x)];
    }
};

void fin(bool ok){
    cout << (ok ? "Yes" : "No") << endl;
    exit(0);
}

int main(){
    int64_t N, M, Q;
    cin >> N >> M >> Q;
    UnionFind uf(N);
    vector<pair<int, int>> multi;
    while(Q--){
        int a, b, c;
        cin >> a >> b >> c;
        if(c == 0){
            uf.unite(a, b);
        }else{
            multi.emplace_back(a, b);
        }
    }
    for(auto& p : multi) if(uf.same(p.first, p.second)) fin(false);
    if(M == N-1) fin(multi.size() == 0);

    int64_t c = 0;
    for(int i=0; i<N; i++) if(uf.find(i) == i) c++;
    int64_t mx = N-c+c*(c-1)/2;
    fin(M <= mx);
    return 0;
}


Measured memory_bytes: 2168
n = int(input())
v = list(map(int, input().split( )))
v1 = sorted(v)
for _ in range(n-1):
  new = (v1[0] + v1[1])/2
  v1 = v1[2:]
  v1.append(new)
  v1 = sorted(v1)
print(v1[0])

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

using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define RREP(i, n) RFOR(i, n, 0)
#define MFOR(i, m) for(auto i=(m).begin();i!=(m).end();i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())

typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1 << 30;

template<typename T>
void printv(vector<T> const& s) {
  REP(i, SZ(s)) {
    cout << s[i] << " ";
  }
  cout << endl;
}

int main () {
  cin.tie(0);
  cout << setprecision(10);

  int n; cin >> n;
  vi a(n), b(n), c(n);
  REP(i, n) {
    cin >> a[i] >> b[i] >> c[i];
  }

  vi dpa(n), dpb(n), dpc(n);
  dpa[0] = a[0];
  dpb[0] = b[0];
  dpc[0] = c[0];

  FOR(i, 1, n) {
    dpa[i] = max(dpb[i-1], dpc[i-1]) + a[i];
    dpb[i] = max(dpc[i-1], dpa[i-1]) + b[i];
    dpc[i] = max(dpa[i-1], dpb[i-1]) + c[i];
  }

  cout << max(dpa[n-1], max(dpb[n-1], dpc[n-1])) << endl;
}


Measured memory_bytes: 2560
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N, M = MAP()
nodes = [[0] for i in range(N)]
H = LIST()
for i in range(M):
    a, b = MAP()
    a -= 1; b -= 1
    nodes[a].append(H[b])
    nodes[b].append(H[a])

ans = 0
for i in range(N):
    if H[i] > max(nodes[i]):
        ans += 1
print(ans)


Measured memory_bytes: 29812
#include<iostream>
#include<string>
#include<cstdlib>
#include<vector>
#include<algorithm>
#include<functional>
#include<cmath>

#define REP(i,n) for(int i=0;i<n;i++)
#define ll long long int

using namespace std;

int to_int(string s) {
  return atoi(s.c_str());
}

int main() {
  int d,g;
  int p[10], c[10],s[10];
  cin >> d >> g;
  REP(i,d) {
    cin >> p[i] >> c[i];
    s[i] = p[i]*(i+1)*100 + c[i];
  }


  int result = 100000;

  REP(i,d+1) {
    REP(j,pow(2,i)) {
      int tmp = 0;
      int count = 0;
      int minj = 0;
      REP(k,i) {
        if((j >> k)%2 == 1) {
          count += s[k];
          tmp += p[k];
        }
      }
      if(count < g) {
        int sh = d-1;
        while(true) {
          if(((j >> sh) & 1) == 0) break;
          sh--;
        }
        REP(l,p[sh]) {
          if(l*100*(sh+1) + count >= g) {
            tmp += l;
            count += l*100*(sh+1);
            break;
          }
        }
        if(count < g) continue;
      }
      if(tmp < result) {
        result = tmp;
      }
    }
  }

  cout << result << endl;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int n,a;
int con[10001000];
int main() {
    cin >> n; for (int i = 0; i < n; ++i) cin >> a, con[a]++;
    for (int i = 10000001; i >= 0; --i) con[i] += con[i+1];
    long long res = 0;
    for (int i = 0; i <= 10000000; ++i) res += min(i*4, con[i]);
    cout << res+1 << endl;
    return 0;
}


Measured memory_bytes: 40220
import numpy as np
n, z, w = map(int, input().split())
tmp = list(map(int, input().split()))
a = np.array(tmp)

if len(a) == 1:
    score = abs(a[0] - w)
else:
    score = max(abs(a[-2] - a[-1]), abs(a[-1] - w))

print(score)


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

using namespace std;

int main() {
  int N, C, K;
  cin >> N >> C >> K;

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

  sort(T, T + N);

  int answer = 0;
  int limit = T[0] + K;
  int count = 0;

  for (int i = 0; i < N; i++) {
    int t = T[i];

    if (t > limit || count == C) {
      answer += 1;
      limit = t + K;
      count = 0;
    }

    count += 1;
  }

  if (count > 0) {
    answer += 1;
  }

  cout << answer << endl;
}


Measured memory_bytes: 640
// include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define pb            push_back
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())

const int INF = 1e9;


// code
// ------------------------------------------------
int main() {

  int n,m;

  cin >> n >> m;

  // vector<int> a(m);
  // vector<int> b(m);

  vector<int> t(n);
  rep(i,m)
  {
    int b;
    cin >> b;
    t[b-1]++;

    cin >> b;
    t[b-1]++;
  }

  rep(i,n)
  {
    cout << t[i] << endl;
  }


  return 0;
}

// funcの実体
// ------------------------------------------------
int CalcSumOfDigit(int n)
{
  int s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
#include<iomanip>
#include<list>
#include<deque>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define END {}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
typedef std::pair<int,int> P;
struct edge{int to,cost;};
const int INF=100000000000000000;
const int INF2=9223372036854775807;
const int MOD=1000000007;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define min(X,Y) (((int)(X)<(int)(Y))?(X):(Y))
#define max(X,Y) (((int)(X)>(int)(Y))?(X):(Y))
#define MAX(X,Y) (*max_element(X,Y))
#define MIN(X,Y) (*min_element(X,Y))
#define NP(X,Y) next_permutation(X,Y)
#define setp(X,Y) cout<<fixed<<setprecision(Y)<<X;
int ceil2(int a,int b){if(a%b==0){return a/b;}else{return a/b+1;}}
int pow2(int a,int b){int r=1;for(int i=1;i<=b;i++){r*=a;}return r;}
int Log2(int a){int t=0;while(1){if(a==0||a==1){break;}a/=2;t++;}return t;}

int N;
int X;
int G[51];//ハンバーガーの数
int E[51];//パティの数

int f(int n,int x){
	if(n==0){
		return 1;
	}
	if(x==1){
		return 0;
	}
	else if(1<x&&x<=1+G[n-1]){
		return f(n-1,x-1);
	}
	else if(1+G[n-1]+1==x){
		return E[n-1]+1;
	}
	else if(1+G[n-1]+1<x&&G[n]-1){
		return E[n-1]+1+f(n-1,x-1-G[n-1]-1);
	}
	else{
		return E[n-1]+1+E[n-1];
	}
}

signed main(){
	cin>>N>>X;
	G[0]=1;
	E[0]=1;
	for(int i=1;i<=50;i++){
		G[i]=1+G[i-1]+1+G[i-1]+1;
		E[i]=E[i-1]+E[i-1]+1;
	}
	DEB(G[1])END
	cout<<f(N,X)<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long ll;
// const int INF = (1 << 30) - 1;
// const ll LL_INF = (1LL << 62) - 1;
// const ll MOD = 1e9 + 7;

string s, t;

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

  unordered_map<char, vector<int>> mp;
  for (int i = 0; i < s.size(); i++) {
    mp[s[i]].push_back(i);
  }
  bool ok = true;
  for (int i = 0; i < t.size(); i++) {
    if (mp.find(t[i]) == mp.end()) {
      ok = false;
      break;
    }
  }
  if (!ok) {
    cout << -1 << endl;
    return 0;
  }

  long l = 1;
  long ans = 0;
  long cur = -1;
  for (int i = 0; i < t.size(); i++) {
    vector<int> &v = mp[t[i]];
    auto ub = upper_bound(v.begin(), v.end(), cur);
    long idx = 0;
    if (ub == v.end()) {
      ans = l * s.size();
      l++;
      cur = -1;
      idx = v[0];
      ans = ans + idx + 1;
    } else {
      idx = *ub;
      ans = ans - (cur + 1) + idx + 1;
    }
    cur = idx;
  }

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


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

int n;
string a, b;
int main()
{
	int i, j;
//	freopen ("input.txt", "r", stdin);
	cin >> n;
	cin >> a;
	cin >> b;
	for (i = 0; i < n; i++) {
		for (j = 0; j < n - i; j++) {
			if (a[i + j] != b[j]) break;
		}
		if (j == n - i) break;
	}
	i = n - i;
//	for (i = 0; i < n; i++) {
//		if (a[n - i - 1] != b[i]) break;
//	}
    cout <<n + n - i << endl;
    return 0;
}


Measured memory_bytes: 256
while True:
    n, r = map(int, input().split())
    if n == 0:
        break
    deck = list(range(n, 0, -1))
    for i in range(r):
        p, c = map(int, input().split())
        deck = deck[p - 1:p - 1 + c] + deck
        del deck[p - 1 + c:p - 1 + c + c]
    print(deck[0])



Measured memory_bytes: 5608
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
long i,n;
char d;
double x[21],y[21],a,b,c,s;
for(i=0;i<20;i++){
cin>>x[i]>>d>>y[i];
if(cin.eof())break;
}
n=i;
for(s=0,i=0;i<n-1;i++){
a=sqrt((x[i]-x[0])*(x[i]-x[0])+(y[i]-y[0])*(y[i]-y[0]));
b=sqrt((x[i+1]-x[0])*(x[i+1]-x[0])+(y[i+1]-y[0])*(y[i+1]-y[0]));
c=sqrt((x[i+1]-x[i])*(x[i+1]-x[i])+(y[i+1]-y[i])*(y[i+1]-y[i]));
s+=sqrt((a+b+c)*(-a+b+c)*(a-b+c)*(a+b-c))*0.25;
}
printf("%.6f\n",s);
return 0;
}

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

int main(void) {
    int A, B;
    scanf("%d%d", &A, &B);
    if ((A<B && A>1) || (B == 1 && A>B)) {
        printf("Bob\n");
    } else if ((A>B && B>1) || (A == 1 && A<B)) {
        printf("Alice\n");
    } else {
        printf("Draw\n");
    }

    return 0;
}

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

using namespace std;
typedef long long ll;

#define cout (cout << setprecision(12))

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if (a + b + c >= 22) cout << "bust" << endl;
    else cout << "win" << endl;
}

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

int main() {
	char ch[6] = { 'A','B','C','D','E','F' };
	int num[6] = { 10,11,12,13,14,15 };

	char X, Y;
	int Xx, Yy;

	cin >> X >> Y;

	for (int x = 0; x < 6; x++) {
		if (X == ch[x]) {
			Xx = x;
		}
		if (Y == ch[x]) {
			Yy = x;
		}
	}

	if (num[Xx] > num[Yy]) cout << ">";
	else if (num[Xx] < num[Yy]) cout << "<";
	else { cout << "="; }


	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#ifdef HIRO
#define d(f_, ...) printf((f_), ##__VA_ARGS__)
#else
#define d(f_, ...)
#endif

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<long long, long long> pllll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector< pair<int, int> > vii;
typedef vector< pair<long long, long long> > vllll;
typedef map<int, int> mii;
typedef map<long long, long long> mllll;
typedef queue<int> qi;
typedef queue< pair<int, int> > qp;
#define mp make_pair
#define pi 3.14159265358979323846
#define MAX max_element
#define MIN min_element
#define all(v) v.begin(), v.end()
#define gt(T) greater<T>()
#define sum(v) accumulate(v.begin(), v.end(), 0ll)
#define uni(v) do{ \
  sort(v.begin(), v.end()); \
  decltype(v)::iterator result = unique(v.begin(), v.end()); \
  v.erase(result, v.end()); \
}while(0)
#define fi(init, n) for(int i = init; i < n; ++i)
#define fj(init, n) for(int j = init; j < n; ++j)
#define fk(init, n) for(int k = init; k < n; ++k)
#define zero(x) memset(x, 0, sizeof(x))
#define negative(x) memset(x, ~0, sizeof(x))
#define bitsum(x) __builtin_popcount(x)
const ll MOD = 1e9 + 7;
const int INF = 1e9;
const int di[] = { 0, 1, 0, -1 };
const int dj[] = { 1, 0, -1, 0 };

template<typename T>
T gcd(T a, T b) {
	return b ? gcd(b, a % b) : a;
}
template<typename T>
T lcm(T a, T b) {
	return a / gcd(a, b) * b;
}
template<typename T>
int finder(vector<T> vec, T number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) return 1;
	else return 0;
}
ll frac(ll n){
	if (n == 0) return 1;
	return (n * frac(n - 1)) % MOD;
}
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(int argc, char** argv) {
#ifdef HIRO
  string quiz(argv[1]);
  string id(argv[2]);
  string filename("input/" + quiz + "/" + id + ".txt");
  ifstream fin(filename);
  if (fin.peek() == ifstream::traits_type::eof()) {
    cout << "No input.";
    return 0;
  }
  ifstream cin(filename);
  std::cin.rdbuf(cin.rdbuf());
#endif
  // f(n) = n(n-2)(n-4)・・・1 -> n is odd
  // or
  // f(n) = n(n-2)(n-4)・・・2 -> n is even
  //
  // if n is odd, there is no factor of 2, so the answer is 0
  // if n is even, the answer is the number of factor of 5 (because the number of factor of 2 is apparently more)
  //
  // 34: 30, 20, 10
  // 36: 30, 20, 10
  // 38: 30, 20, 10
  // 40: 40, 30, 20, 10
  // 42: 40, 30, 20, 10
  // 44: 40, 30, 20, 10
  // 46: 40, 30, 20, 10
  // 48: 40, 30, 20, 10
  // 50: 50, 40, 30, 20, 10
  //
  // => number of multiple of 5 is n / 10
  // => number of multiple of 5 ^ 2 is n / 50
  // => number of multiple of 5 ^ 3 is n / 250
  ll ans = 0;
  ll n, cnt;
  cin >> n;
  if(n % 2 == 0) {
    cnt = n / 10;
    while(cnt) {
      ans += cnt;
      cnt /= 5;
    }
  }
  cout << ans << endl;
  return 0;
}



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

int main(){
    int l, i=0;
    vector<int> a;
    vector<int> b = {5, 5, 7};
    
    while(i<3){
        cin >> l;
        a.push_back(l);
        i++;
    }
    
    sort(a.begin(), a.end());
    if(a==b)
        cout << "YES";
    else
        cout << "NO";
}



Measured memory_bytes: 256
from itertools import combinations
N, M, Q = map(int, input().split())
A = []
for i in range(Q):
    A.append(list(map(int, input().split())))

ans = 0
for c in combinations(range(N+M-1), N):
    x = sorted(list(c))
    ans_new = 0
    for i in range(Q):
        if x[A[i][1]-1] - A[i][1] - x[A[i][0]-1] + A[i][0] == A[i][2]:
            ans_new += A[i][3]
    if ans_new > ans:
        ans = ans_new
print(ans)

Measured memory_bytes: 9148
N,M = map(int,input().split())
Xs = list(map(int,input().split()))
Xs.sort()
X_dis = []
for i in range(M-1):
  X_dis.append(Xs[i+1]-Xs[i])
X_dis.sort(reverse = True)
dis = sum(X_dis[:N-1])
ans = Xs[-1]-Xs[0]-dis
print(ans)

  
  

  


  
  

Measured memory_bytes: 13968
//↓見なくていいよ！ここから--------------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//↑見なくていいよ！ここまで--------------------------------------------------
function Main(){
	var one = nextIntArray();
	var A = one[0];
	var B = one[1];
	var C = one[2];
	myout(Math.max(0, C - (A - B)));
}


Measured memory_bytes: 30040
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <math.h>
 
#define REP(i,n)for (int i=0;i<(n);i++)
#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define ll long long
using namespace std;
typedef pair<int,int> P;

const int INF = 1<<29;

int fld[30][30];
int dp[30][30][4];//(x,y)からゴールに行くための最小のコスト
int h,w;
int c[4];
int dx[]={0,1,0,-1},dy[]={-1,0,1,0};

int main(){
	while(1){
		cin>>w>>h;
		if(w==0&&h==0)break;
		REP(i,h)REP(j,w)cin>>fld[i][j];
		REP(i,4)cin>>c[i];
		REP(i,h)REP(j,w)REP(k,4)dp[i][j][k]=INF;
		dp[0][0][1]=0;
		bool f=true;
		while(f){
			f=false;
			REP(x,w)REP(y,h){
				REP(k,4){
					int cost=(k==fld[y][x]?0:c[k]);
					REP(i,4){
						int tx=x+dx[(k+i)%4],ty=y+dy[(k+i)%4];
						if(tx<0||tx>=w||ty<0||ty>=h)continue;
						if(dp[ty][tx][(k+i)%4]>dp[y][x][i]+cost){
							dp[ty][tx][(k+i)%4]=dp[y][x][i]+cost;
							f=true;
						}
					}
				}
			}
		}
		int ans=INF;
		REP(i,4)ans=min(ans,dp[h-1][w-1][i]);
		cout<<ans<<endl;
	}
}


Measured memory_bytes: 3080
import fractions
def lcm(a):
    LCM = a[0]
    for i in range(1, n):
        LCM = LCM * a[i] // fractions.gcd(LCM, a[i])
    return LCM

n = int(input())
a = list(map(int, input().split()))

m = lcm(a) - 1
ans = 0

for i in range(n):
    ans += m%a[i]

print(ans)

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

using namespace std;

int main() {
    string T,s,p;
    bool check=false;
    cin>>s>>p;
    T=s+s;
   for(int i=0;i<T.size()-p.size();i++){
       bool ok = true;
       for(int j=0;j<p.size();j++){
           if (p.at(j)!=T.at(i+j)) { ok = false; break; }
       }
       if(ok){check=true;break;}
   }
   if(check)cout<<"Yes"<<endl;
   else cout<<"No"<<endl;
}


Measured memory_bytes: 3180
#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>

using namespace std;

class Solution {
 public:
  long long chatInACircle(vector<int>& A) {
    sort(A.begin(), A.end());
    map<int, int> quota;

    long long ans = 0;
    int n = A.size();
    quota[A[n - 1]] = 1;
    for (int i = n - 2; i >= 0; --i) {
      auto it = quota.rbegin();
      ans += it->first;
      if (--it->second == 0) quota.erase(it->first);
      quota[A[i]] += 2;
    }

    return ans;
  }
};

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

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

  Solution sol;
  long long ans = sol.chatInACircle(A);
  cout << ans << endl;
  return 0;
}


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

using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int n;
    long long m;
    cin >> n >> m;
    vector<long long> a(n);
    long long c = 1;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        a[i] /= 2;
        if (c <= m) {
            c = (c*a[i]) / __gcd(c, a[i]);
        }
    }
    bool ok = true;
    for (auto v: a) {
        if ((c/v) % 2 == 0) {
            ok = false;
        }
    }
    long long ans = 0;
    if (ok) {
        ans = (m/c + 1)/2;
    }
    cout << ans << endl;
}



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

int main()
{
  int N, A, B;
  int x;

  cin >> N >> A >> B;

  if (N * A <= B)
    x = N * A;
  else
    x = B;

  if (N * A >= B)
    x = B;
  else
    x = N * A;

  cout << x << endl;
}

Measured memory_bytes: 256
const input = require('fs').readFileSync('/dev/stdin', 'utf-8').trim();
let nums = input.split(/\r?\n/).map(str => str.split(" ")).map(pair => pair.sort(function(a, b){ return a-b; }));
for (let i = 0; i < nums.length-1; i++) {
  console.log(nums[i].join(" "));
}



Measured memory_bytes: 20060
import sys, math
from functools import lru_cache
import numpy as np
import heapq
from collections import defaultdict
sys.setrecursionlimit(10**9)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


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


def main():
    N, M = mi()
    A, B = i2(N)
    ans = 0

    d = defaultdict(list)
    for i in range(N):
        d[A[i]].append(B[i])

    h = []
    heapq.heapify(h)

    for i in range(1, M+1):
        for v in d[i]:
            heapq.heappush(h, -v)
        if h:
            ans -= heapq.heappop(h)
        else:
            continue

    print(ans)



if __name__ == '__main__':
    main()


Measured memory_bytes: 55512
#include<iostream>
#include<vector>
#include <unordered_map>  
#include <algorithm>
#include <functional>
#include <map>
#include <string>
#include <sstream>
using namespace std;


int main() {
	int a, b;
	string s;
	cin >> a >> b;
	cin >> s;
	stringstream ss(s);

	getline(ss, s, '-');
	if (s.size() != a) {
		cout << "No" << endl;
		return 0;
	}

	getline(ss, s, '-');
	if (s.size() != b) {
		cout << "No" << endl;
		return 0;
	}

	if (getline(ss, s, '-')) {
		cout << "No" << endl;
		return 0;
	}

	cout << "Yes" << endl;

	return 0;
}


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

#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define repi(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define uniqueV(x)            \
    sort(x.begin(), x.end()); \
    x.erase(unique(x.begin(), x.end()), x.end());
#define debug(x) cerr << #x << ": " << x << '\n'
#define debug2(x, y) cerr << "(" << #x << ", " << #y << ") = " \
                          << "(" << x << ", " << y << ")" << '\n'

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

const long long INF = 3e18 + 12;
const int inf = 1e9;

// ----------------------------------------------

ll f(ll a, ll b, ll x)
{
    return floorl(double(a * x / b)) - (a * floorl(double(x / b)));
}

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

    ll a, b, n;
    cin >> a >> b >> n;

    cout << f(a, b, min(b - 1, n)) << endl;
    return 0;
}

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

class tsort {
public:
  int V;
  vector<vector<int>> G;
  vector<int> deg, res;
  tsort(int node_size) : V(node_size), G(V), deg(V, 0) {}
  void add(int from, int to) {
    G.at(from).push_back(to);
    deg.at(to)++;
  }
  bool solve() {
    queue<int> que;
    for(int i = 0; i < V; i++) {
      if(deg.at(i) == 0) {
        que.push(i);
      }
    }
    while(!que.empty()) {
      int p = que.front();
      que.pop();
      res.push_back(p);
      for(int v : G.at(p)) {
        if(--deg.at(v) == 0) {
          que.push(v);
        }
      }
    }
    return (*max_element(deg.begin(),deg.end()) == 0);
  }
};

int main() {
  int N, M;
  cin >> N >> M;
  vector<vector<int>> G(N);
  tsort T(N);
  for (int i = 0; i < N - 1 + M; i++) {
    int a, b;
    cin >> a >> b;
    G.at(--b).push_back(--a);
    T.add(a, b);
  }
  T.solve();
  vector<int> V(N);
  int cnt = 0;
  for (auto r : T.res) V.at(r) = cnt++;
  for (int i = 0; i < N; i++) {
    int sz = G.at(i).size();
    if (!sz) cout << 0 << "\n";
    else if (sz == 1) cout << G.at(i).at(0) + 1 << "\n";
    else {
      int mx = 0;
      for (auto g : G.at(i)) mx = max(mx, V.at(g));
      for (auto g : G.at(i)) {
        if (V.at(g) == mx) {
          cout << g + 1 << "\n";
          break;
        }
      }
    }
  }
}

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

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  int now = 1, cnt = 1;
  while (cnt < N) {
    now = a[now - 1];
    if (now == 2) {
      break;
    }
    cnt++;
  }
  if (cnt == N)
    cout << -1 << endl;
  else
    cout << cnt << endl;
}

Measured memory_bytes: 640
#include <iostream>
#include <queue>
#include <algorithm>
#include <vector>
#define ll long long
using namespace std;

int main(void){
    int n, a[300005];
    long long sum_front=0, sum_back=0;
    
    vector<ll> sf, sb;
    priority_queue<ll, vector<ll>, greater<ll> > que_front;
    priority_queue<ll> que_back;
    
    cin >> n;

    for( int i = 0; i< 3 * n; i++ ){
        cin >> a[i];
        if(i < n){
            sum_front += a[i];
            que_front.push(a[i]);
        }else if( 2*n <= i ){
            sum_back += a[i];
            que_back.push(a[i]);
        }
    }

    sf.push_back(sum_front);
    sb.push_back(sum_back);
    
    for( int i = 0; i < n ; i++ ){
        que_front.push(a[i+n]);
        sum_front += a[i+n];
        sum_front -= que_front.top();
        que_front.pop();
        sf.push_back(sum_front);

        que_back.push(a[2*n-1-i]);
        sum_back += a[2*n-1-i];
        sum_back -= que_back.top();
        que_back.pop();
        sb.push_back(sum_back);
    }
    reverse(sb.begin(), sb.end());
    long long ans = sf[0] - sb[0];
    for( int i = 1; i <= n; i++ ){
        ans = max(ans, sf[i] - sb[i]);
    }
    cout << ans << endl;
    return 0;
}

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



int main() {
#ifdef HOME
    freopen("in", "r", stdin);
#endif

    int H, W, h, w;
    while (cin >> H >> W >> h >> w) {
        if (H % h == 0 && W % w == 0) {
            printf("No\n");
            continue;
        } else {
            printf("Yes\n");
            int p1 = ((int)1e9 - 1) / (w * h - 1);
            int p2 = -p1 * (w * h - 1) - 1;
            for (int i = 0; i < H; i++) {
                for (int j = 0; j < W; j++) {
                    int x = p1;
                    if (i % h == h - 1 && j % w == w - 1) {
                        x = p2;
                    }
                    printf("%d%c", x, " \n"[j + 1 == W]);
                }
            }
        }
    }

#ifdef HOME
    cerr << clock() / (double)CLOCKS_PER_SEC << endl;
#endif
    return 0;
}


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

#define rep(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ROF(i,a,b) for(int i=(a);i>(b);i--)
#define all(a) (a).begin(),(a).end()
#define UNIQUE(v) v.erase(unique(all(v)),v.end())
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef long long ll;

main(){
  string s; cin >> s;
  set<char> st;
  rep(i,s.size()) st.insert(s[i]);
  if(st.size() == s.size()) cout << "yes";
  else cout << "no";
  cout << endl;
}

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

#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()

typedef long long ll;
typedef array<int, 3> tri;
typedef long double ld;

template <class T> istream& operator>>(istream& I, vector<T>& v) {for (T &e: v) I >> e; return I;}
template <class T> ostream& operator<<(ostream &O, const vector<T>& v) {for (const T &e: v) O << e << ' '; return O;}



void _main() {
        int n, a, b; cin >> n >> a >> b;
        cout << min(n * a, b);
}



signed main() {
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//        freopen("input.txt", "r", stdin);
        int _t = 1;
//        cin >> _t;
        while (_t--) _main();
        return 0;
}


Measured memory_bytes: 3640
n = int(input())
happiness = [list(map(int, input().split())) for _ in range(n)]

dp = [[0, 0, 0] for _ in range(n+1)]
dp[1] = happiness[0]

for i in range(1, n):
    dp[i+1] = [
        max(dp[i][1:]) + happiness[i][0],
        max(dp[i][0], dp[i][2]) + happiness[i][1],
        max(dp[i][:-1]) + happiness[i][2]
    ]
print(max(dp[n]))

Measured memory_bytes: 80216
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(void){
    //1 100 10000
    int n;
    cin>>n;
    int count=0;
    for(int i=1;i<n+1;i++){
        string s=to_string(i);
        if(s.size()%2==1)count++;
    }
    cout<<count;
}

Measured memory_bytes: 256
//** aman**/
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define dl          double
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define lb lower_bound
#define ub upper_bound
#define bs          binary_search
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
ll find_next_smaller(map<ll,ll> &m, ll x){
	auto it=m.lower_bound(x);
	if(it!=m.begin()){
		it--;
		return it->S;
	}
	else return -1;
} 
void solve(){
	ll n,q;cin>>n;
	ll a[n],b[n];
	map<ll,ll> m;
	for(ll i=0;i<n;i++)cin>>a[i];
	for(ll i=0;i<n;i++)cin>>b[i];
	for(ll i=0;i<n;i++){
		ll x=find_next_smaller(m,a[i]);
		//cout<<x<<endl;
		if(x!=-1)m[a[i]]=x+b[i];
		else m[a[i]]=b[i];
		while(1){
			auto it=m.upper_bound(a[i]);
			if(it!=m.end()&&it->S<=m[a[i]]){
				m.erase(it);
			}
			else break;
		}
	}
	ll mx=0LL;
	for(auto u:m){
		mx=max(mx,u.S);
	}
	cout<<mx<<endl;
}
int main(){
	ll t=1;
	while(t--){
		solve();
	}
}

Measured memory_bytes: 15872
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;

long long gcd(long long a, long long b)
{
	while (b != 0) {
		long long t = b;
		b = a % b;
		a = t;
	}
	return a;
}


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

	long long a, b, g, ans;
	cin >> a >> b;
	g = gcd(a, b);
	ans = a * b / g;
	cout << ans << "\n";

	return 0;
}


Measured memory_bytes: 512
#include <algorithm>
#include <cstring>
#include <iostream>
#include <map>
#include <string>
#include <vector>

using namespace std;

namespace {
#define VERA(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define ANDY(i,a,b) for(ll i=ll(a);i>ll(b);--i)
#define SIZE(x) (ll)(x.size())

typedef long long ll;
typedef double dd;

ll N;
vector<ll> D;

ll res;
vector<bool> was;

void Rec(ll per, ll low) {
  if (low <= res) return;
  if (per == N) {
    res=max(res,low);
    return;
  }
  const ll lef = D[per], rig = (24-D[per]) % 24;
  if (!was[lef]) {
    ll gap=24;
    VERA(k,0,was.size())
      if (was[k])
        gap=min(gap,min(abs(k-lef), 24-abs(k-lef)));
    was[lef]=true;
    Rec(per+1,min(low,gap));
    was[lef]=false;
  }
  if (!was[rig]) {
    ll gap=24;
    VERA(k,0,was.size())
      if (was[k])
        gap=min(gap,min(abs(k-rig), 24-abs(k-rig)));
    was[rig]=true;
    Rec(per+1,min(low,gap));
    was[rig]=false;
  }
  if (was[lef] && was[rig]) {
    res=0;
    return;
  }
}

void Solve() {
  sort(D.begin(), D.end());
  res=0;
  was.resize(24,false);
  was[0]=true;
  Rec(0,D.front());
  cout << res << endl;
}

bool Input() {
  if (!(cin>>N)) return false;
  D.resize(N);
  for(auto& d : D) cin >> d;
  return true;
}

}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  while (Input()) {
    Solve();
  }
  return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Queue;

public class Main {

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

		String str[] = br.readLine().split(" ");

		int n = Integer.parseInt(str[0]);
		int m = Integer.parseInt(str[1]);

		ArrayList<ArrayList<Integer>> edge = new ArrayList<>();

		for (int i = 0; i < n; i++) {
			edge.add(new ArrayList<>());
		}

		for (int i = 0; i < m; i++) {
			str = br.readLine().split(" ");
			int u = Integer.parseInt(str[0]) - 1;
			int v = Integer.parseInt(str[1]) - 1;

			edge.get(u).add(v);
		}

		str = br.readLine().split(" ");
		int s = Integer.parseInt(str[0]) - 1;
		int t = Integer.parseInt(str[1]) - 1;

		int dist[][] = new int[n][3];
		Queue<Integer> queueV = new ArrayDeque<>();
		Queue<Integer> queueK = new ArrayDeque<>();

		for (int i = 0; i < n; i++) {
			Arrays.fill(dist[i], Integer.MAX_VALUE);
		}

		dist[s][0] = 0;
		queueV.add(s);
		queueK.add(0);

		while (!queueV.isEmpty() || !queueK.isEmpty()) {
			int v = queueV.poll();
			int k = queueK.poll();

			for (int u : edge.get(v)) {
				int nextk = (k + 1) % 3;
				if (dist[u][nextk] != Integer.MAX_VALUE)
					continue;
				dist[u][nextk] = dist[v][k] + 1;
				queueV.add(u);
				queueK.add(nextk);
			}
		}

		int ans = dist[t][0];
		if (ans == Integer.MAX_VALUE)
			ans = -1;
		else
			ans /= 3;
		System.out.println(ans);
	}
}


Measured memory_bytes: 73116
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int prev = 0;
		int count = 0;
		int max = 0;
		for (int i = 0; i < n; i++) {
		    int x = sc.nextInt();
		    if (prev >= x) {
		        count++;
		        max = Math.max(max, count);
		    } else {
		        count = 0;
		    }
		    prev = x;
		}
		System.out.println(max);
	}
}


Measured memory_bytes: 52392