akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define _USE_MATH_DEFINES
#define reb(i,b,n)         for(int i=(int)(b); i<(int)(n); i++)
#define rep(i,n)           reb(i,0,n)
#define each(it,v)         for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define reach(it,v)        for(__typeof((v).rbegin()) it=(v).rbegin();it!=(v).rend();it++)
#define vsort(v)           sort((x).begin(), (x).end()
#define rvsort(v)          sort((x).rbegin(), (x).rend()
#define mp(a, b)           make_pair(a, b)
#define fi                 first
#define se                 second
#define pb                 push_back
#define dbg(x)             cerr<<__LINE__<<": "<<#x<<" = ["<<(x)<<"]"<<endl;
#define dbgArr(table, n)   rep(i,n){cout<<table[i]<<' ';}cout<<'\n';
#define dbg2Arr(table,W,H) rep(y,H){rep(x,W)cout<<table[y][x]<<' ';cout<<'\n';}

using namespace std; using std::stringstream;

typedef long long       ll; typedef unsigned long long ull; typedef long double     ld;
typedef pair <int, int> P;  typedef pair <int, P>      PP;
typedef vector<int>     vi; typedef vector<vi>         vvi; typedef vector<ll>      vl;
typedef vector<P >      vP; typedef vector<char>       vc;  typedef vector<string>  vs;

static const int    INF  = 0x3f3f3f3f;
static const ll     INFL = 0x3f3f3f3f3f3f3f3fLL;
static const double EPS  = 1e-9;
static const ll     MOD  = 1000000007LL;

static const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};

int main(int argc, char *argv[])
{
#if 1
    ull A;
    ld B;
    cin >> A >> B;
    // cout << A << endl;
    // cout << B << endl;
    // // cout << B*10 << endl;
    // cout << B*100 << endl;
    // ull t = B*100;
    // cout << t << endl;
    // ull tt = t;
    // cout << tt << endl;
    // ull ans = A * (B * 100);
    // cout << ans << endl;


    // cout << (A * (ull)(B * 100)) / 100 << endl;
    cout << (ull)(A * B) << endl;
#else
    for (ull i = 1000000000000000; i>999999999999999; i--) {
        for (ld j = 0.00; j<1; j+=0.01) {
            // ull t = j * 100;
            // ull ans = i * t;
            // cout << i << ' ' << j << ' ' << (i * (ull)(j * 100)) / 100 << endl;
            cout << i << ' ' << j << ' ' << (ull)(i * j) << endl;
        }
    }
#endif



    // cout << A * t / 100 << endl;

    return 0;
}


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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

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

template<typename T>
void print1(T begin, T end) {
  while (begin != end) {
    cout << (*begin) << " ";
    *begin++;
  }
  cout << endl;
}

template<typename T>
void print2(T Array, int height, int width) {
  for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
      cout << " " << Array[i][j];
    }
    cout << endl;
  }
}

void print() { std::cerr << endl; }
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  std::cerr << head << " ";
  print(std::forward<Tail>(tail)...);
}

template<class T>
void Add(T &a, const T &b, const T &mod=1000000007) {
  int val = ((a % mod) + (b % mod)) % mod;
  if (val < 0) { val += mod; }
  a = val;
}

template <typename X, typename T> auto vectors(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto vectors(X x, Y y, Z z, Zs... zs) { auto cont = vectors(y, z, zs...); return vector<decltype(cont)>(x, cont); }

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

const int mod = 1e9 + 7;

int n;
string s;
int al[111111][30];

using ll = long long;
ll f(ll a, ll b) {
   ll ans = 1;
   while (b > 0) {
      if (b&1) {
        //  ans *= a;
        ans = ((ans%mod) * (a%mod))%mod;
      }
      // a *= a;
      a = ((a % mod) * (a % mod))%mod;
      b /= 2;
   }
   return ans;
}

signed main() {
  cin >> n >> s;
  rep (i, n) {
    int place = s[i] - 'a';
    al[i][place] = 1;
  }

  for (int i = n-1; i > 0; i--) {
    rep (j, 26) {
      al[i-1][j] += al[i][j];
    }
  }

  int ans = 0;
  rep (i, n) {
    int place = s[i] - 'a';
    al[i][place]--;
    int tmp = 1;
    int cnt = 0;
    rep (j, 26) {
      if (j == place) continue;
      if (al[i][j] >= 2) {
        // tmp *= (al[i][j] + 1);
        tmp = ((tmp % mod) * ((al[i][j]+1)%mod)) % mod;
      }
      if (al[i][j] == 1) {
        cnt++;
      }
    }
    // ans += tmp * (1LL << cnt);
    Add(ans, (tmp%mod) * (f(2, cnt)%mod)%mod);
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 25088
import bisect
N=int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort()
C.sort()
d=0
for i in B:
 d+=bisect.bisect_right(A,i-0.1)*(N-bisect.bisect_left(C,i+0.1))
print(d)


Measured memory_bytes: 105444
// inputに入力データ全体が入る
function Main(input) {
  // 1行目がinput[0], 2行目がinput[1], …に入る
  input = input.split("\n");
  
  A = parseInt(input[0],10);
  B = parseInt(input[1],10);
  C = parseInt(input[2],10);
  X = parseInt(input[3],10);
  
  var count = 0;
  
  for(i=0; i<=A; i++){
    for(j=0; j<=B; j++){      
      for(k=0; k<=C; k++){
        x = 500*i + 100*j + 50*k;
        if(x == X){
          count += 1; 
        }
      }
    }
  }
  
  console.log('%d', count);

}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

int main()
{
    ll n;
    cin >> n;
    ll x = (int)sqrt(n);
    while(n%x != 0){
        x--;
    }
    x = n / x;
    int cnt = 1;
    while(x/10 != 0){
        x /= 10;
        cnt++;
    }

    cout << cnt << endl;
    return 0;
}

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

using namespace std;
using ll = long long;

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

struct UnionFind {
  vector<int> p;
  UnionFind(int n) : p(n, -1) {}

  bool unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return false;
    if (-p[x] < -p[y]) swap(x, y);
    p[x] += p[y];
    p[y] = x;
    return true;
  }

  int find(int x) {
    if (p[x] < 0) return x;
    return p[x] = find(p[x]);
  }

  int same(int x, int y) { return find(x) == find(y); }
  int size(int x) { return -p[find(x)]; }
};

int main() {
  int n, m;
  cin >> n >> m;
  UnionFind uf(n);
  rep(i, m) {
    int x, y, z;
    cin >> x >> y >> z;
    --x, --y;
    uf.unite(x, y);
  }

  set<int> s;
  rep(i, n) s.insert(uf.find(i));
  cout << s.size() << endl;
  return 0;
}


Measured memory_bytes: 8272
#include<cstdio>
#include<bits/stdc++.h>
typedef long long int ll;
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOR_IN(i, a, b) for(int i = (a); i < (b); i++)
#define BETWEEN(x, a, b) ((x) >= (a) && (x) <= (b))
#define BIT(b, i) (((b) >> (i)) & 1)
#define LOG_F 1
#define LOG(...) if(LOG_F) fprintf(stderr, __VA_ARGS__)

using namespace std;

ll pow(int x, int n){
  return n == 0 ? 1 : x * pow(x, n - 1);
}


/*
s
200
 */
string s;

int main(){
  cin>>s;
  int l = s.size();
  int ans=1;
  for(int i=1; 2*i < l; i++){
    bool same = true;
    REP(j,i){
      same = same && s[j] == s[j+i];
    }
    if(same)
      ans = 2*i;
  }

  cout<< ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<cmath>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
typedef long long ll;

int main(){
    int N;
    cin >> N;
    vector<ll> a(N);
    rep(i,N) cin >> a[i];
    vector<ll> L(N), R(N);
    L[0] = a[0];
    for(int i=1; i<N; i++) L[i] = L[i-1] + a[i];
    R[N-1] = a[N-1];
    for(int i=N-2; i>=0; i--) R[i] = R[i+1] + a[i];
    ll ans = 1000000000000000000;
    for(int i=0; i<N-1; i++){
        //cout << L[i] << R[i+1] << endl;
        ll sub = abs(L[i]-R[i+1]);
        if(sub < ans){
            ans=sub;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4992
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define mod 1000000007
#define MAX 1000000000000000
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(i=(ll)a;i<(ll)b;i++)
#define revrep(i,a,b) for(i=(ll)a;i>=(ll)b;i--)
#define ii pair<ll,pair<ll,ll> >
#define MP make_pair
#define pb push_back
#define f first
#define se second
#define ll long long int
#define vi vector<ll>
ll modexp(ll a,ll b){ ll res = 1; while(b > 0){  if(b & 1) res = (res * a)%mod;  a = (a * a)%mod;  b/=2;  }  return res; }
#define rs resize
typedef tree< ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update > OST;
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

const ll N = 109;
ll n,i,j,cnt;
ll a[N];
int main()
{
    std::ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin>>n;
    rep(i,0,n) cin>>a[i];
    sort(a,a + n);
    rep(i,0,n){
        j = i;
        while(j < n and a[i] == a[j]) j++;
        cnt++;
        i = j - 1;
    }
    cout<<cnt;
    return 0;
}

Measured memory_bytes: 256
#https://oneminutepython.com/atcoder/abc126_d.html

from collections import deque
N = int(input())
S = [[] for _ in range(N)]  #indexとu（繋がってる点）とwを格納する
for i in range(N-1):
    u,v,w = map(int,input().split())
    S[u-1].append([v-1,w])
    S[v-1].append([u-1,w])

Node = [None]*N #黒白を格納する
Node[0] = True
queue = deque([0])  #調べる根
while queue != deque([]):
    p = queue.popleft()
    for u,w in S[p]:    #複数ある、根本の方から判定
        if Node[u] == None: #まだ判定していない子なら
            queue.append(u) #それ（繋がってる点）をqueueに追加
            Node[u] = Node[p]^(w%2==1)  #黒白の判定

#普通にfor i in range(N)でも可能

for i in range(N):
    print([0,1][Node[i]])   #これで片方のみ出力できるらしい


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

#define V vector
typedef long long ll;
typedef unsigned long long ull;

typedef V<int> vi;
typedef V<ll> vll;
typedef V<string> vs;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define f(i,a) for(int i = 0 ; i < a ; i++)
#define fll(i,a) for(ll i = 0 ; i < a ;i++)
#define forab(i,a,b) for(int i = a ; i < b ; i++)
#define prec(x) cout<<fixed<<setprecision(x)
#define ff first
#define ss second

#define pb push_back
#define mp make_pair
#define numberofdigits(x) floor(log10(x)) + 1
#define M 1000000007

long long binpow(long long a, long long b) {
	long long res = 1;
	while (b > 0) {
		if (b & 1)
			res = (res * a) % M;
		a = (a * a) % M;
		b >>= 1;
	}
	return res;
}

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

	set<int> hon = { 2 , 4 , 5 , 7 , 9 };
	set<int> pon = {0 , 1 , 6 , 8};
	set<int> bon = {3};

	int d = n % 10;

	if (hon.count(d) > 0)
	{
		cout << "hon\n";
		return;
	}

	if (pon.count(d) > 0)
	{
		cout << "pon\n";
		return;
	}

	if (bon.count(d) > 0)
	{
		cout << "bon\n";
		return;
	}
}

int main() {

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

	int t = 1;
	//cin>>t;
	while (t--)
		solve();

	return 0;
}


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

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

using namespace std;

using ll = long long;
using P = pair<int, int>;

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

  int result = 0;
  rep(i, 2) {
    if (a > b) {
      result += a;
      a--;
    } else {
      result += b;
      b--;
    }
  }
  cout << result << endl;

  return 0;
}


Measured memory_bytes: 256
K = int(input())
if K % 2 == 0 or K % 5 == 0:
    print(-1)
    exit()

tmp1 = 0
for i in range(1, K + 1):
    tmp1 += 7 * pow(10, i, K)
    if tmp1 % K == 0:
        print(i)
        exit()

print(-1)

Measured memory_bytes: 63508
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) throws FileNotFoundException{

		Scanner scan = new Scanner(System.in);

		int k = scan.nextInt();
		int sum = 0;

		for(int i =1;i<=k;i++) {
			for(int j=1;j<=k;j++) {
				for(int l=1;l<=k;l++) {

			sum += Euqlid(i,Euqlid(j,l));
				}
			}
		}

		System.out.println(sum);
		scan.close();
	}

	public static int Euqlid(int a,int b){

		if(b == 0) {
			return a;
		}else

		return Euqlid(b,a%b);
	}
}


Measured memory_bytes: 27244
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <ctype.h>
#include <vector>
#include <numeric>
using namespace std;

#define ll long long int
#define rep(i, a, n) for (int i = a; i < n; i++)
#define INF 1e9
#define LINF 1e17
#define MOD (int)(1e9 + 7)
#define pi 3.141592653589
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define ALL(a) (a).begin(), (a).end()
#define sort_v(a) sort(a.begin(), a.end())
#define fi first
#define se second

void print(bool a)
{
    if (a == true)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

ll gcdll(ll a, ll b)
{
    while (1)
    {
        if (a < b)
            swap(a, b);
        if (b == 0)
            break;
        a %= b;
    }
    return a;
}

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

typedef struct CITY
{
    string name;
    int point;
    int sp;
} City;
City c[1000];

bool cmp(const City &a, const City &b)
{
    if (a.name != b.name)
        return a.name < b.name;
    return a.point > b.point;
}

int main()
{
    int n;
    cin >> n;
    rep(i, 0, n)
    {
        cin >> c[i].name >> c[i].point;
        c[i].sp = i + 1;
    }
    sort(c, c + n, cmp);
    //rep(i, 0, n) cout << c[i].name << " " << c[i].point << endl;
    rep(i, 0, n) cout << c[i].sp << endl;
}

Measured memory_bytes: 256
/**
 
   Author : sea_26
 
**/

#include "bits/stdc++.h"
using namespace std;

#define vsort(v)   sort(v.begin(),v.end())
#define M          1000000007
#define PI         acos(-1.0)
#define bitc(n)    __builtin_popcount(n)
#define fill(a,x)  memset(a,x,sizeof(a))
#define fastScan   ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);


#define db  double
#define ldb long double
#define ll  long long


#define mp  make_pair
#define pb  push_back
#define pf  push_front
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pcc pair <char, char>
#define pic pair <int, char>
#define pil pair <int, ll>
#define pli pair <ll, int>
#define pdd pair<double,double>
#define vp  vector<pii> v;


#define rep(i,n)       for(int i=0;i<n;i++)
#define repp(i,a,b)    for(int i=a;i<=b;i++)
#define reppi(i,a,b,c) for(int i=a;i<=b;i+=c)
#define ref(i,n)       for(int i=n;i>1;i--)
#define reff(i,a,b)    for(int i=a;i>=b;i--)
#define fornm(n,m)     for(int i =0; i<=n; i ++) for(int j =0; j <=m; j++)
#define fornmo(n,m,o)  for(int i =0; i<=n; i ++) for(int j =0; j <=m; j++) for(int k =0; k <= o; k++)


#define si 				cin >> str;
#define sc(x) 			scanf("%d",&x)
#define scc(x1,x2) 		scanf("%d%d",&x1,&x2)
#define sccc(x1,x2,x3)  scanf("%d%d%d",&x1,&x2,&x3)
#define scl(x)	        scanf("%lld",&x)
#define sccl(x1,x2)     scanf("%lld%lld",&x1,&x2)
#define scccl(x1,x2,x3) scanf("%lld%lld%lld",&x1,&x2,&x3)
#define pr(x)      		printf("%d\n",x)
#define prl(x) 			printf("%lld\n",x)
#define prrl(x1,x2)     printf("%lld %lld\n",x1,x2)
#define inp 			cin >> a >> b
#define r	        	cout << res << endl


int gcd(int a, int b) { return (b == 0 ? a : gcd(b, a % b));}
ll lcm(int a, int b) { return (a * (b / gcd(a, b)));}
ll max(ll a,ll b,ll c){return max(a,max(b,c));}

const int INF = INT_MAX;


int main(){

    fastScan;
    int n;
    cin >> n;
    int a[n],sum=0,res;
    rep(i,n){
        cin >> a[i];
        sum += a[i];
    }
    int mn = INF;
    rep(i,n){
        if(mn>abs(sum-a[i]*n)){
            mn = abs(sum-a[i]*n);
            res = i;
        }
    }

    cout << res << endl;
return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n, i;
  string s;
  set<string> ss;
  cin >> n;
  for(i = 1; i <= n; i++)
  {
    cin >> s;
    ss.insert(s);
  }
  cout << ss.size() << endl;
  return 0;
}

Measured memory_bytes: 19120
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    System.out.println(Math.max(0, c - (a - b)));
    sc.close();
  }
}

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

int main(){
  string N;
  cin >> N;
  
 if ((N.at(0) == N.at(1)) &&  (N.at(1)== N.at(2))
     			||(N.at(1) == N.at(2)) &&  (N.at(2)== N.at(3))){
    cout << "Yes" << endl;
  }

  else{
    cout << "No" << endl;
  }
}

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

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

using ll = long long;

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main() {
  int N,K;
  cin>>N>>K;
  vector<char> S(N);
  int cntp = 0,cntn = 0;
  for(int i = 0; i < N; i++) {
    cin >> S[i];
    if(i >0){
      if(S[i-1]=='R' && S[i]=='L') {
        cntp++;
      }
      if(S[i-1]=='L' && S[i]=='R') {
        cntn++;
      }
    }
  }
  int ans = 0;
  for(int i = 0; i <N; i++) {
    if(N==1){ 
      ans=0;
      break;
    }
    else {
      if(i==0){
        if(S[i]=='R'&&S[i+1]=='R')ans++;
      }
      else if(i==N-1){
        if(S[i]=='L'&&S[i-1]=='L')ans++;
      }
      else{
        if((S[i]=='R'&&S[i+1]=='R')||(S[i]=='L'&&S[i-1]=='L'))ans++;
      }
    }
  }
  if(2*K>=cntn+cntp) {
    ans=N-1;
  }
  else{
    ans+=2*K;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 384
// warm heart, wagging tail,and a smile just for you!
//                                                                     ███████████
//                                                                   ███╬╬╬╬╬╬╬╬╬╬███
//                                                                ███╬╬╬╬╬████╬╬╬╬╬╬███
//                                            ███████████       ██╬╬╬╬╬████╬╬████╬╬╬╬╬██
//                                      █████████╬╬╬╬╬████████████╬╬╬╬╬██╬╬╬╬╬╬███╬╬╬╬╬██
//                               ████████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬██╬╬╬╬╬╬╬██
//                             ████╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬╬╬╬╬╬██
//                           ███╬╬╬█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬███╬╬╬╬╬╬╬█████
//                         ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬████████╬╬╬╬╬██
//                       ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬███
//                     ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬██
//                 ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬████
//     █████████████╬╬╬╬╬╬╬╬██╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬██████
//   ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬██████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████╬╬╬╬╬╬╬███████████╬╬╬╬╬╬╬╬██╬╬╬██╬╬╬██
// ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬█╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬██
// ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬▓▓▓▓▓▓╬╬╬████╬╬████╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬███
// ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬█████
// ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████
//   ███╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██
//       ██████████████  ████╬╬╬╬╬╬███████████████████████████╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████
//                         ███████                           █████  ███████████████████  
//
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF (1LL<<60)
#define fs first
#define sc second
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for(int i = (b-1);i>=(a);--i)
#define REP(i,n)  FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " << 
#define MSB(x) (63-__builtin_clzll(x))
#define pcnt(x) (__builtin_popcountll(x))
#define parity(i,j) (i&(1LL<<j))
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

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

  int k,x;
  cin >> k >> x;

  if(k*500 >= x) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}

Measured memory_bytes: 256
/*
 * wafuIroha.cpp
 *
 *  Created on: 2020/02/23
 *      Author: black
 */
#include <iostream>
#include <string>
using namespace std;

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

	unsigned long long power = 1;

	for (int i = 1; i <= n; ++i){
		power *= i;
		power %= 1000000000 + 7;
	}

	cout << power << endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define inf 0x7fffffff
#define RG register
#define maxn 500005
#define maxm 205
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
inline ll read(){
    ll x = 0, f = 1;
    char ch = getchar();
    while(ch > '9' || ch < '0') {if(ch == '-') f = -1;ch = getchar();}
    while(ch >= '0' && ch <= '9'){x = x *10 + ch -'0';ch = getchar();}
    return x * f;
}

int n, m, f1[maxn], f2[maxn], x, ans;
char ch[maxn], s[maxn];
int main(){
	int i, j, k;
	scanf("%s", ch + 1);
	n = strlen(ch + 1);
	for(i = 2, j = 0;i <= n;i++){
		while(j && ch[j + 1] != ch[i]) j = f1[j];
		if(ch[j + 1] == ch[i]) j++;
		f1[i] = j;
	}
	for(i = 1;i <= n;i++) s[i] = ch[n - i + 1];
	for(i = 2, j = 0;i <= n;i++){
		while(j && s[j + 1] != s[i]) j = f2[j];
		if(s[j + 1] == s[i]) j++;
		f2[i] = j;
	}
	if(n % (n - f1[n]) != 0 || f1[n] == 0) {printf("1\n1");return 0;} 
	if(n - f1[n] == 1) {printf("%d\n1", n);return 0;}
	for(i = 1;i < n;i++){
		k = n - i;
		if((i % (i - f1[i]) != 0 || f1[i] == 0) && (k % (k - f2[k]) != 0 || f2[k] == 0)) ans++;
	}
	printf("2\n%d",ans);
	return 0;
}


Measured memory_bytes: 8716
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] strChar = new char[str.length()];
        for(int i = 0; i<str.length(); i++){
            strChar[i] = str.charAt(i);
        }

        boolean judge = false;
        if(strChar[2] == strChar[3]){
            if(strChar[4] == strChar[5]){
                judge = true;
            }
        }
        System.out.println(judge ? "Yes" : "No");
    }
}

Measured memory_bytes: 35588
#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;

long long n, cnt = 0;
vector<pair<long long, long long>> v;
map<pair<long long, long long>, long long> mp;

int main() {
  cin >> n;
  v.resize(n);
  for(int i = 0; i < n; ++i) cin >> v[i].fi >> v[i].se;
  for(int i = 0; i < n; ++i)
    for(int j = i + 1; j < n; ++j) {
      int x = v[i].fi - v[j].fi, y = v[i].se - v[j].se;
      if(x < 0) {
        x *= -1;
        y *= -1;
      }
      if(x == 0) y = max(y, -y);
      cnt = max(cnt, ++mp[make_pair(x, y)]);
    }

  cout << n - cnt << endl;
  return 0;
}


Measured memory_bytes: 384
// J'aime
// Chemise Blanche

#include <bits/stdc++.h>
using namespace std;

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()
#define dbg(x) cerr << __LINE__ << " > " << #x << " = " << (x) << endl

void MAIN() {
  string s;
  cin >> s;
  int b = 0;
  for (auto &i : s) {
    if (b == 0 && i == 'C') b++;
    if (b == 1 && i == 'F') b++;
  }
  if (b == 2) cout << "Yes" << '\n';
  else cout << "No" << '\n';
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) MAIN();
}


Measured memory_bytes: 3616
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
constexpr ll mod = 998244353;
const ll INF = mod * mod;
typedef pair<int, int>P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);

ll mod_pow(ll x, ll n) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * x%mod;
		x = x * x%mod; n >>= 1;
	}
	return res;
}
struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 20;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}


void solve() {
	int n; cin >> n;
	vector<int> a(n);
	int x = 0;
	rep(i, n) {
		cin >> a[i];
		x ^= a[i];
	}
	vector<int> ans(n);
	rep(i, n)ans[i] = x ^ a[i];
	rep(i, n) {
		if (i > 0)cout << " ";
		cout << ans[i];
	}
	cout << "\n";
}


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init_f();
	//int t; cin >> t; rep(i, t)
		solve();
	stop
		return 0;
}


Measured memory_bytes: 21016
#include<bits/stdc++.h>
using namespace std;
void END(){
  cout<<"yes"<<endl;
  exit(0);
}
int main(){
  int n,m,x;
  cin>>n;
  vector<vector<int> >v(n);
  if(n>4)END();
  for(int i=0;i<n;i++){
    for(int j=0;j<3;j++) v[i].push_back(j);
    cin>>m;
    while(m--){
      cin>>x;
      if(x)swap(v[i][1],v[i][2]);
      else swap(v[i][0],v[i][1]);
    }
  }
  sort(v.begin(),v.end());
  do{
    for(int i=0;i<n;i++){
      int a[]={1,2,3},tmp[3];
      for(int j=0;j<=i;j++){
        for(int k=0;k<3;k++)tmp[k]=a[k];
        for(int k=0;k<3;k++)a[k]=tmp[v[j][k]];
      }
      if(a[0]==1&&a[1]==2&&a[2]==3)END();
    }
  }while(next_permutation(v.begin(),v.end()));
  cout<<"no"<<endl;
}


Measured memory_bytes: 3160
#include <bits/stdc++.h>
using namespace std;
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; }
typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MOD (1000000007)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<int> res;
    while(1){
        int n;
        deque<int> rec;
        cin >> n;
        if(n == 0) break;
        for(int i=0;i<n;i++){
            int tmp;
            cin >> tmp;
            rec.push_back(tmp);
        }
        sort(rec.begin(), rec.end());
        rec.pop_front();
        rec.pop_back();
        int ans = 0;
        for(int i=0;i<n-2;i++){
            ans += rec[i];
        }
        res.push_back(ans/(n-2));
    }
    for(int i=0;i<res.size();i++) cout << res[i] << endl;
    return 0;
}


Measured memory_bytes: 3092
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <ios>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <map>
using namespace std;
typedef long long ll;
#define mp make_pair;
#define pb push_back;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll W,H,x,y;
  cin >> W >> H >> x >> y;
  std::cout << std::fixed;
  std::cout << std::setprecision(10) << (double)(W*H)/2.0 << " ";
  if(W == x*2 && H == y*2){
    cout << 1 << endl;
  }else{
    cout << 0 << endl;

  }
  return 0;
    

}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
   int N;
   cin >> N;
   
   int C0 = 0;
   int C1 = 0;
   int C2 = 0;
   int C3 = 0;
   
   for(int i = 0; i < N; i++ ){
       string S;
       cin >> S;
       if(S == "AC"){
           C0++;
       }
       if(S == "WA"){
           C1++;
       }
       if(S == "TLE"){
           C2++;
       }
       if(S == "RE"){
           C3++;
       }
   }
   
   cout << "AC x " << C0 << endl;
   cout << "WA x " << C1 << endl;
   cout << "TLE x " << C2 << endl;
   cout << "RE x " << C3 << endl;
}


Measured memory_bytes: 3520
#include <iostream>
#include <string>

using namespace std;

int main() {
  string S;
  cin >> S;
  int N = static_cast<int>(S.size());
  int i = 0;
  int j = (N - 3) / 2;
  int k = (N + 1) / 2;
  int l = N - 1;
  const char* result = "Yes";
  while (i <= j) {
    if ((S[i] != S[l]) ||
        (S[j] != S[k]) ||
        (S[i] != S[j]) ||
        (S[k] != S[l])) {
      result = "No";
      break;
    }
    ++i; --j; ++k; --l;
  }
  cout << result << endl;
  return 0;
}


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

typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> PLL;
typedef pair<P,P> PP;
typedef vector<ll> llVEC;
typedef vector<P> PVEC;
typedef priority_queue<P,PVEC,greater<P> > PPQ;
typedef priority_queue<ll, llVEC, greater<ll> > llPQ;

#define rep(i,a,n) for(ll i = a;i < n;i++)
#define rrep(i,a,n) for(ll i = n-1; i >= a;i--)
#define LINF (ll)1e18
#define INF (int)1e9
#define fs first
#define sc second

template<typename T>
ll sz(vector<T> &vec){ return (ll)vec.size(); }
template<typename T>
ll sz(priority_queue<T, vector<T>> &pq) {return (ll)pq.size(); }
template<typename T>
ll sz(priority_queue<T, vector<T>, greater<T>> &pq) {return (ll)pq.size(); }
ll sz(string &s) {return (ll)s.size(); } 
ll gcd(ll a,ll b){ return ((!b) ?a :gcd(b, a%b)); }
ll lcm(ll a,ll b){ return a / gcd(a,b) * b; }
bool checkindex(ll i,ll n){ return (i < n && i >= 0); }

int main(){
    ll n,x,m;
    cin >> n >> x >> m;
    
    vector<ll> vec;
    vec.push_back(x);
    ll check[m] = {};
    rep(i,0,m) check[i] = -1;
    check[x] = 0;
    ll cnt = 1;
    while(cnt < n){
        ll temp = vec[sz(vec)-1];
        temp *= temp;
        temp %= m;
        if(temp == 0){
            ll ans = 0;
            rep(i,0,sz(vec)){
                ans += vec[i];
            }
            cout << ans << endl;
            return 0;
        }
        else if(check[temp] == -1){
            check[temp] = cnt;
            vec.push_back(temp);
        }
        else{
            ll temp1 = 0,ans = 0;
            rep(i,0,sz(vec)){
                if(i < check[temp]) ans += vec[i];
                else temp1 += vec[i];
            }
            temp1 *= (n-check[temp])/(sz(vec)-check[temp]);
            ans += temp1;
            temp1 = check[temp];

            rep(i,0,(n-check[temp])%(sz(vec)-check[temp])){
                ans += vec[temp1++];
            }
            cout << ans << endl;
            return 0;
        }
        cnt++;
    }
    ll ans = 0;
    rep(i,0,sz(vec)){
        ans += vec[i];
    }
    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 4600
N = int(input())
HList = input().split()
res = 0
mv = 0
for i in range(len(HList) -1):
    if(int(HList[i]) >= int(HList[i + 1])):
        mv += 1
    else:
        if(res < mv):
            res = mv
        mv = 0
if(res < mv):
    res = mv
print(res)

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

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

    int sum = 0; 
    while (n) {
        sum += n % 10; 
        n = n/10; 
    }

    sum == 1 ? cout << 10 : cout << sum; 

}

Measured memory_bytes: 256
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define DB double
#define SG string
#define LL long long
#define Fp(A,B,C,D) for(A=B;A<=C;A+=D)
#define Fm(A,B,C,D) for(A=B;A>=C;A-=D)
#define Clear(A) memset(A,0,sizeof(A))
using namespace std;
const LL Max=1e3+5;
const LL Mod=1e9+7;
const LL Inf=1e18;
LL A,B,C,K,Ans,_Max;
inline LL Read(){
	LL X=0;char CH=getchar();bool F=0;
	while(CH>'9'||CH<'0'){if(CH=='-')F=1;CH=getchar();}
	while(CH>='0'&&CH<='9'){X=(X<<1)+(X<<3)+CH-'0';CH=getchar();}
	return F?-X:X;
}
inline void Write(LL X){
	if(X<0)X=-X,putchar('-');
	if(X>9)Write(X/10);
	putchar(X%10+48);
}
int main(){
	LL I,J,K;
	A=Read(),B=Read(),C=Read();K=Read();
	if(A>=B&&A>=C){
		_Max=A;
		A=0;
	} else if(B>=A&&B>=C){
		_Max=B;
		B=0;
	} else {
		_Max=C;
		C=0;
	}
	Fp(I,1,K,1){
		_Max<<=1;
	}Write(_Max+A+B+C);
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
 int n,i,j,k,l,m;
 int peo[4][3][10]={0};
 int b[1000],f[1000],r[1000],v[1000];


 scanf("%d",&n);

 for(i=1;i<=n;i++){
  scanf("%d %d %d %d",&b[i],&f[i],&r[i],&v[i]);

  peo[b[i]-1][f[i]-1][r[i]-1]+=v[i];

 }




 for(j=0;j<4;j++){

   for(k=0;k<3;k++){

    for(l=0;l<=9;l++){
     printf(" %d",peo[j][k][l]);
    }
    printf("\n");
}
   

if(j!=3){
 for(m=1;m<=19;m++){
  printf("#");
 }
  printf("#\n");
}

 }


return 0;
}

Measured memory_bytes: 628
N,K=map(int,input().split())
h=list(map(int,input().split()))
dp=[0]*N
dp[1]=abs(h[1]-h[0])
for i in range(1,N):
    ddp=dp[i-1]+abs(h[i]-h[i-1])
    for j in range(1,K+1):
        if i-j<0:
            continue
        elif ddp>=dp[i-j]+abs(h[i]-h[i-j]):
            ddp=dp[i-j]+abs(h[i]-h[i-j])
    dp[i]=ddp

print(dp[-1])

Measured memory_bytes: 52704
import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)



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


def II():
    return int(input())

directions=np.array([[1,0],[0,1],[-1,0],[0,-1]])
directions = list(map(np.array, directions))

mod = 10**9+7


def factorial(n):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
    return fact



def serch(x, count):
    #print("top", x, count)
            

    for d in directions:
        nx = d+x
        #print(nx)
        if np.all(0 <= nx) and np.all(nx < (H, W)):
            if field[nx[0]][nx[1]] == "E":
                count += 1 
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)  
                continue
            if field[nx[0]][nx[1]] == "#":
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)    
                 
    return count


def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X % n)
    return str(X % n)

N,K=acinput()
s=Base_10_to_n(N,K)
print(len(s))


Measured memory_bytes: 12484
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define Cout(s) cout << s << endl;
#define CoutV(vec)     \
    for (auto v : vec) \
        Cout(v);
#define CoutVV(vecvec)      \
    for (auto vec : vecvec) \
        CoutV(vec);

using ll = long long;
using P = pair<int, int>;

const ll INF = 1ll << 60;
ll MOD = 1e9 + 7;
//int t[10010];

int main()
{
    int n, t;
    cin >> n >> t;
    vector<int> C(n), T(n);
    REP(i, n)
    cin >> C[i] >> T[i];
    int best = 1001;
    REP(i, n)
    {
        if (t >= T[i])
        {
            best = min(best, C[i]);
        }
    }

    if (best == 1001)
    {
        Cout("TLE");
    }
    else
    {
        Cout(best);
    }

    return 0;
}

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

main () {
  int n, m;
  scanf("%d %d", &n, &m);

  if (n >= m) {
    printf("0\n");
    return 0;
  }

  //入力は昇順ソード
  vector<int> x(m);
  rep(i,m) scanf("%d", &x[i]);
  sort(x.begin(), x.end(), less<int>());

  //開区間(x[i], x[i+1])を計算し、降順ソート
  vector<int> l(m-1);
  rep(i,m-1) l[i] = x[i+1] - x[i];
  sort(l.begin(), l.end(), greater<int>());

  int ans = x.back() - x.front();
  rep(i,n-1) ans -= l[i];

  printf("%d\n", ans);

  return 0;
}


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

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

        String[] nums = br.readLine().split(" ");
        int n = Integer.parseInt(nums[0]);
        int m = Integer.parseInt(nums[1]);
        int l = Integer.parseInt(nums[2]);

        long[][] matrixA = new long[n][m];
        long[][] matrixB = new long[m][l];
        long[][] matrixC = new long[n][l];

        //input matrixA
        for(int i = 0; i < n; i++){
            String[] input = br.readLine().split(" ");
            for(int j = 0; j < m; j++){
                matrixA[i][j] = Long.valueOf(input[j]);
            }
        }

        //input matrixB
        for(int i = 0; i < m; i++){
            String[] input = br.readLine().split(" ");
            for(int j = 0; j < l; j++){
                matrixB[i][j] = Long.valueOf(input[j]);
            }
        }

        //input matrixC(matrixA * matrixB)
        for(int i = 0; i < n; i++){
            for(int j = 0; j < l; j++){
                for(int k = 0; k< m; k++){
                    matrixC[i][j] += matrixA[i][k] * matrixB[k][j];
                }
            }
        }

        //output matrixC
        StringBuilder sb = new StringBuilder();
        for(int i = 0; i < n; i++){
            for(int j = 0; j < l; j++){
                sb.append(matrixC[i][j]);
                if(j != l-1) sb.append(" ");
            }
            if(i != n-1) sb.append("\n");
        }
        System.out.println(sb);

    }
}

Measured memory_bytes: 32100
n, q = map(int, input().split())
s = str(input())
ls = [list(map(int, input().split())) for i in range(q)]
t = [0] * (n + 1)
for i in range(n):
    t[i + 1] = t[i] + (1 if s[i:i + 2] == 'AC' else 0)
for i in range(q):
    l, r = ls[i][0], ls[i][1]
    ans = t[r - 1] - t[l - 1]
    print(ans)

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

int main(void){
 string S;
  cin >> S;
  int count = 0;
  int max_count = 0;
  for(int i = 0; i < S.length(); i++){
   if(S[i] == 'A' || S[i] == 'C' || S[i] == 'G'  || S[i] == 'T' ){
     count++;
   }
   else{
     if(count > max_count) max_count = count;
     count = 0;
   }
  }
  if(count > max_count) max_count = count;
  cout << max_count;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
	int A,B,a,b,i,n;
	while(1){
	scanf("%d",&n);
	if(n==0) {break;}
	A=0;
	B=0;
	for(i=1;i<n+1;i++){
		scanf("%d %d",&a,&b);
			if(a>b) {A+=a+b;}
			else if(a<b) {B+=a+b;}
				else {A+=a,B+=b;}
			}
	printf("%d %d\n",A,B);
	}
return 0;
}

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

public class Main {
	
	static int H;
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		H=in.nextInt();
		int A[]=new int[H+1];
		
		for(int i=1;i<=H;i++) {
			int k=Integer.parseInt(in.next());
			A[i]=k;
		}
		
		buildMaxHeap(A);
		
		PrintWriter out=new PrintWriter(System.out);
		for(int i=1;i<=H;i++)out.print(" "+A[i]);
		out.println();
		out.flush();
		
	}
	
	static void maxHeapify(int A[],int index) {
		int l=index*2, r=index*2+1, L;
		
		if(l<=H && A[l]>A[index]) L=l;
		else L=index;
		if(r<=H && A[r]>A[L])L=r;
		
		if(L!=index) {
			int t=A[index];
			A[index]=A[L];
			A[L]=t;
			
			maxHeapify(A,L);
		}
	}
	
	static void buildMaxHeap(int A[]) {
		for(int i=H/2;i>0;i--) {
			maxHeapify(A,i);
		}
	}
}



Measured memory_bytes: 105700
import java.util.*;
public class Main { 
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String ans = "No"; 
        if((N % 2) == 0 && N / 2 <= 9){
            ans = "Yes";
        }else if((N % 3) == 0 && N / 3 <= 9){
                ans = "Yes";
        }else if((N % 1) == 0 && N / 1 <= 9){
            ans = "Yes";
        }else if((N % 4) == 0 && N / 4 <= 9){
            ans = "Yes";
        }else if((N % 5) == 0 && N / 5 <= 9){
            ans = "Yes";
        }else if((N % 6) == 0 && N / 6 <= 9){
            ans = "Yes";
        }else if((N % 7) == 0 && N / 7 <= 9){
            ans = "Yes";
        }else if((N % 8) == 0 && N / 8 <= 9){
            ans = "Yes";
        }else if((N % 9) == 0 && N / 9 <= 9){
            ans = "Yes";
        }
		System.out.println(ans);
     }
}

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

int a[10000][10];
int main(){
	int r,c;
	while(cin>>r>>c,r|c){
		int n,ans=0;
		for(int i=0;i<r;i++){
			for(int j=0;j<c;j++){
				cin>>a[j][i];
			}
		}
		for(int i=0;i<(1<<r);i++){
			n=0;
			for(int j=0;j<c;j++){
				int s=0;
				for(int k=0;k<r;k++)
					s += a[j][k]^(1&i>>k);
				n += max(s,r-s);
			}
			ans = max(ans,n);
		}
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 1548
#include <cmath>
#include <cstdio>
#include <limits>
#include <tuple>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <numeric>
#include <string>
#include <array>
#include <iomanip>

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

using namespace std;
using ll = long long;

int main() {
  ios::sync_with_stdio(false);
  ll n, k, x, y;
  cin >> n >> k >> x >> y;
  ll ans = 0;
  rep(i, n) {
    ans += i >= k ? y : x;
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _0361
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] xy = RArInt();
            int x = xy[0], y = xy[1];
            Console.WriteLine(x + y - Gcd(x, y) + 1);
        }

        ///最大公約数
        /// </summary>
        public static long Gcd(long a, long b)
        {
            if (a < b) return Gcd(b, a);  // 引数を入替えて自分を呼び出す
            if (b == 0) return a; //一方が0の場合は、もう片方の数自身がGCD

            long d = 0;
            do
            {
                d = a % b;
                a = b;
                b = d;
            } while (d != 0);
            return a;
        }
        static string RSt() { return Console.ReadLine(); }
        static int RInt() { return int.Parse(Console.ReadLine().Trim()); }
        static long RLong() { return long.Parse(Console.ReadLine().Trim()); }
        static double RDouble() { return double.Parse(Console.ReadLine()); }
        static string[] RArSt(char sep = ' ') { return Console.ReadLine().Trim().Split(sep); }
        static int[] RArInt(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => int.Parse(e)); }
        static long[] RArLong(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => long.Parse(e)); }
        static double[] RArDouble(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => double.Parse(e)); }
        static string WAr<T>(IEnumerable<T> array, string sep = " ") { return string.Join(sep, array.Select(x => x.ToString()).ToArray()); }
    }
}



Measured memory_bytes: 17972
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;


public class Main {

    public static void main(String[] args) throws IOException {
        Scanner s = new Scanner(System.in);
        String s1 = s.next(),s2=s.next();
        int a = s.nextInt(),b=s.nextInt();
        String word =s.next();
        if(word.equals(s1)){
            System.out.println((a-1)+" "+b);
        }
        else System.out.println(a+" "+(b-1));

    }
}




class Scanner
{
    StringTokenizer st;
    BufferedReader br;

    public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

    public String next() throws IOException
    {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    public int nextInt() throws IOException {return Integer.parseInt(next());}

    public long nextLong() throws IOException {return Long.parseLong(next());}

    public String nextLine() throws IOException {return br.readLine();}

    public double nextDouble() throws IOException
    {
        String x = next();
        StringBuilder sb = new StringBuilder("0");
        double res = 0, f = 1;
        boolean dec = false, neg = false;
        int start = 0;
        if(x.charAt(0) == '-')
        {
            neg = true;
            start++;
        }
        for(int i = start; i < x.length(); i++)
            if(x.charAt(i) == '.')
            {
                res = Long.parseLong(sb.toString());
                sb = new StringBuilder("0");
                dec = true;
            }
            else
            {
                sb.append(x.charAt(i));
                if(dec)
                    f *= 10;
            }
        res += Long.parseLong(sb.toString()) / f;
        return res * (neg?-1:1);
    }

    public boolean ready() throws IOException {return br.ready();}


}

Measured memory_bytes: 25384