akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<math.h>
main()
{
        int px, py, cx, cy, r;
        double p, s, f, len, ax[2], ay[2];
        scanf("%d %d%*c%d %d %d", &px, &py, &cx, &cy, &r);
        len = sqrt(pow(px - cx, 2) + pow(py - cy, 2));
        s = atan2(py - cy, px- cx);
        f = acos(r / len);
        ax[0] = r * cos(s + f);
        ay[0] = r * sin(s + f);
        ax[1] = r * cos(s - f);
        ay[1] = r * sin(s - f);
        if(ax[0] < ax[1] || (ax[0] == ax[1] && ay[0] < ay[1])){
                printf("%.6f %.6f\n%.6f %.6f\n",
                           ax[0] + cx, ay[0] + cy, ax[1] + cx, ay[1] + cy);
        }else{
                printf("%.6f %.6f\n%.6f %.6f\n",
               ax[1] + cx, ay[1] + cy, ax[0] + cx, ay[0] + cy);
        }
}

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

using namespace std;

// solve func


int main(){
    // code here
    int n;
    cin >> n;
    n %= 10;
    switch(n){
    case 2:
    case 4:
    case 5:
    case 7:
    case 9:
        cout << "hon" <<endl;
        break;
    case 0:
    case 1:
    case 6:
    case 8:
        cout << "pon" <<endl;
        break;
    default:
        cout << "bon" <<endl;
    }
    return 0;
}


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

using namespace std;
const int maxn = 2e5+10;

int n;
int h[maxn], a[maxn];
long long loga[maxn];
long long dp[maxn];

void update(int x, long long val) {
	for (x++; x < maxn; x += x & -x)
		loga[x] = max(loga[x], val);
} 

long long query(int x) {
	long long out = 0;
	for (x++; x > 0; x -= x & -x)
		out = max(out, loga[x]);
	return out;
}

int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
		scanf("%d", h+i);
	for (int i = 0; i < n; i++)
		scanf("%d", a+i);
	
	long long sol = 0;
	for (int i = 0; i < n; i++) {
		dp[i] = query(h[i]) + a[i];
		update(h[i], dp[i]);
		sol = max(sol, dp[i]);
	}
	printf("%lld", sol);
	return 0;
}


Measured memory_bytes: 4992
import java.util.*;
public class Main {
	void doIt() {
		Scanner stdIn = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<Integer>();
		Stack<Integer> q = new Stack<Integer>();
		
		int count = 0;
		while(stdIn.hasNext()) {
			int num = stdIn.nextInt();
			if(num == 0) {
				int temp = q.pop();
				list.add(temp);
			} else {
				q.add(num);
			}
		}
		for(int r = 0; r < list.size(); r++) {
			System.out.println(list.get(r));
		}
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new Main().doIt();
	}
}

Measured memory_bytes: 17212
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);

  int N;

  long long X;

  std::cin >> N >> X;

  long long x[55], p[55], b[55];

  x[0] = (p[0] = 1) + (b[0] = 0);

  for (int i = 1; i < 55; i ++)
    x[i] = (p[i] = p[i - 1] * 2 + 1) + (b[i] = b[i - 1] * 2 + 2);

  int L = N;

  long long P = 0;

  for ( ; X; L --)
    if (X == x[L]) {
      P += p[L];

      break;
    }
    else if (X <= x[L - 1] + 1) {
      X --;
    }
    else {
      X -= x[L - 1] + 1 + 1;
      P += p[L - 1] + 1;
    }

  std::cout << P << std::endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
     int t,i,n,k,a,b,d,o,m,r,n1,n2,l,j,n3;
    string s,c;
    cin>>k>>s;
    l=s.size();
    if(l<=k)
    {
            cout<<s;
    }
    else if(k<l)
    {
        for(i=0;i<k;i++)
          {
            cout<<s[i];
          }
          cout<<"...\n";
    }

}





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

int main() {
    std::string N;
    std::cin >> N;

    if (N[0] == '7' || N[1] == '7' || N[2] == '7') {
        std::cout << "Yes\n";
    } else {
        std::cout << "No\n";
    }    

    return 0;
}


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

using namespace std;

#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

const int MAX_K = 2e5+10;

ll dp[MAX_K];

int main() {
    int n, k;
    cin >> n >> k;
    vi a(n);
    rep(i, n) cin >> a[i];
    dp[0] = 1LL;
    rep(i, n) {
        vector<ll> s(k*2+10);
        for (int l = k; l >= 0; --l) {
            auto x = dp[l];
            (s[l+1] += x) %= MOD;
            (s[l+a[i]+1] += MOD - x) %= MOD;
        }
        REP(i, 1, s.size()) {
            (s[i] += s[i-1]) %= MOD;
            (dp[i] += s[i]) %= MOD;
        }
    }
    cout << dp[k] << endl;
    return 0;
}

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

int n, a[100], ta = 0;

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


Measured memory_bytes: 3108
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    while(true)
    {
        c-=b;
        if(c<=0) return 0*printf("Yes\n");
        a-=d;
        if(a<=0) return 0*printf("No\n");
    }
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int MX=60;
const ll mod=1000000007;
string s;
int main(){
    cin>>s;
    if(s.size()<4){
        puts("No");
        return 0;
    }
    string t="";
    for(int i=0;i<4;i++)t+=s[i];
    if(t=="YAKI"){
        puts("Yes");
        return 0;
    }
    puts("No");
}


Measured memory_bytes: 256
#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 ll long long
#define ld long double
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define SZ(x) (int)(x).size()
template <typename T> using ord_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 2e5 + 123;
int n, a[N];

int main() {
	ios_base::sync_with_stdio(false), cin.tie(NULL);
	#ifdef LOCAL
		freopen("input.txt", "r", stdin);
	#endif
	
	cin >> n;
	for (int i = 0; i < n; i++) cin >> a[i];
	sort(a, a + n), reverse(a, a + n);
	ll res = a[0];
	int cnt = 1;
	for (int i = 1; i < n; i++) {
		if (cnt == n - 1) break;
		if (cnt <= n - 3) {
			res += 2 * a[i];
			cnt += 2;
		}	else {
			res += a[i];
			cnt++;
		}
	}
	cout << res;
}


Measured memory_bytes: 4372
#include<bits/stdc++.h>
using namespace std;
int n,a[100],flag,temp,sum;
int main(){
 cin >> n;
 for(int i = 0;i < n;i++) scanf("%d",&a[i]);

 flag = 1;
 while(flag)
 {
  flag = 0;
        for(int j = n-1;j >=  1;j--)
        {
        
         if(a[j] < a[j - 1])
         {
          temp = a[j-1];
                a[j-1] = a[j];
                a[j] = temp;
    sum++;
                flag = 1;
         }

        }
 }
 for(int i = 0;i < n;i++)
 {
  if(i != n-1) printf("%d ",a[i]);
        else printf("%d\n",a[i]);
 }
 printf("%d\n",sum);
}



Measured memory_bytes: 3240
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<bitset>
using namespace std;

typedef long long ll;
#define rep(i, n) for(int i = 0;i < (n);i++)
#define repr(i, n) for(int i = (n);i >= 0;i--)
#define repf(i, m, n) for(int i = (m);i < (n);i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1;} return 0;}
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
//////////////////////////////////////////////////


int main() {
    int n, k, c; cin >> n >> k >> c;
    string s; cin >> s;
    vector<int> left(n+1), right(n+1);
    int rev = -c-10;
    rep(i,n) {
        if (s[i]=='o' && rev+c < i) {
            left[i+1] = left[i]+1;
            rev = i;
        } else {
            left[i+1] = left[i];
        }
    }
    rev = n+c+10;
    repr(i,n-1) {
        if (s[i]=='o' && rev-c > i) {
            right[i] = right[i+1]+1;
            rev = i;
        } else {
            right[i] = right[i+1];
        }
    }

    rep(i,n) {
        if (left[i]+right[i+1] < k) {
            cout << i+1 << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 3332
#include <vector>
#include <algorithm>
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    int N,K;
    scanf("%d %d",&N,&K);
    vector <int> A(N,0);
    for (int i = 0; i < N; i++) {
        cin >> A.at(i);
    }

    sort(A.begin(),A.begin()+N);



    double L = 1;
    double R = A[N-1];

    while(ceil(R) > ceil(L)+0.5){
        double m = (L+R)/2;
        int cnt = 0;
        for (int i = 0; i < N; i++){
            if(A[N-1-i] > m){
                cnt += ceil(A[N-1-i]/m)-1;
            }
            else break;
        }
        if(cnt > K) L = m;
        else R = m;
    }

    cout << int(ceil(R));

    return(0);
}


Measured memory_bytes: 3952
import java.io.*;

class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int prime = 0;
        for (int i = 0; i < n; i++) {
            int element = Integer.parseInt(br.readLine());
            if (isPrime(element)) prime++;
        }
        System.out.println(prime);
    }

    static boolean isPrime (int n) {
        for (int i = 2; i*i <= n; i++) {
            if (n%i == 0) return false;
        }
        return true;
    }
}

Measured memory_bytes: 29308
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();
		
		if(n / 100 == 1) {
			n += 800;
		}else if(n / 100 == 9) {
			n -= 800;
		}
			
		if((n % 100)/10 == 1) {
			n += 80;
		}else if((n % 100)/10 == 9) {
			n -= 80;
		}
		
		if(n % 10 == 1) {
			n += 8;
		}else if(n % 10 == 9) {
			n -= 8;
		}
		
		System.out.println(n);
	}
}


Measured memory_bytes: 21460
#include<stdio.h>

int main(){
  int num[1000];
  int N;
  int i, j, k, v, len;  
  
  scanf("%d",&N);
  len=N;
    
  for( i = 0; i < len; i++){
    scanf("%d", &num[i]);
  }
  for(k = 0; k < len ; k++){
      if(k != len-1)printf("%d ",num[k]);
      else printf("%d\n",num[k]);
    }
  
  for( i = 1; i < len ; i++){
    v = num[i];
    j = i-1;
    while(j >= 0 && num[j]>v){
      num[j+1] = num[j];
      j--;
    }
    num[j+1] = v;
    for(k = 0; k < len ; k++){
      if(k != len-1)printf("%d ",num[k]);
      else printf("%d\n",num[k]);
    }

  }
  return 0;

}

Measured memory_bytes: 604
<?php

fscanf(STDIN, "%d %d", $n, $l);

$total = $n * $l - $n + $n * ($n + 1) / 2;

$min_index = 1;
$min = abs($l + 1 - 1);
for ($i = 2; $i <= $n; ++$i) {
    if (abs($l + $i - 1) < $min) {
        $min_index = $i;
        $min = abs($l + $i - 1);
    }
}

// echo "min_index: $min_index", PHP_EOL;
echo $total - ($l + $min_index - 1);


Measured memory_bytes: 4728
#include <cstdio>
#include <algorithm>

using namespace std;

#define MAX 300000

int n, p, d1, d2;

int main() {
	while (1) {
		scanf("%d", &n);
		if (n == 0)
			return 0;

		int mp = 0, md = -1;
		while(n-- > 0) {
			scanf("%d %d %d", &p, &d1, &d2);
			if(md < d1 + d2) {
				mp = p;
				md = d1 + d2;
			}
		}

		printf("%d %d\n", mp, md);
	}
}

Measured memory_bytes: 768
import java.util.*;
import java.io.*;
import java.text.*;
//Solution Credits: Taranpreet Singh
public class Main{
    //SOLUTION BEGIN
    void pre(){}
    void solve(int TC) throws Exception {
        int x = ni();
        int mx = 2*x;
        int[] pr = new int[mx];
        for(int i = 2; i< mx; i++)
            if(pr[i] == 0)
                for(int j = i; j< mx; j+= i)
                    if(pr[j] == 0)
                        pr[j] = i;
        int ans = x;
        while(pr[ans] < ans)ans++;
        pn(ans);
    }
    //SOLUTION ENDS
    long mod = (int)1e9+7, IINF = (long)3e18;
    final int MAX = (int)1e6+1, INF = (int)1e9, root = 3;
    DecimalFormat df = new DecimalFormat("0.00000000000");
    double PI = 3.141592653589793238462643383279502884197169399375105820974944, eps = 1e-8;
    static boolean multipleTC = false, memory = true;
    FastReader in;PrintWriter out;
    void run() throws Exception{
        long ct = System.currentTimeMillis();
        in = new FastReader();
        out = new PrintWriter(System.out);
        pre();
        int T = (multipleTC)?ni():1;
//      Solution Credits: Taranpreet Singh
        for(int i = 1; i<= T; i++)solve(i);
        out.flush();
        out.close();
        System.err.println(System.currentTimeMillis()-ct);
    }
    public static void main(String[] args) throws Exception{
        if(memory)new Thread(null, new Runnable() {public void run(){try{new Main().run();}catch(Exception e){e.printStackTrace();}}}, "1", 1 << 28).start();
        else new Main().run();
    }
    long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
    int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
    int bit(long n){return (n==0)?0:(1+bit(n&(n-1)));}
    void p(Object o){out.print(o);}
    void pn(Object o){out.println(o);}
    void pni(Object o){out.println(o);out.flush();}
    String n(){return in.next();}
    String nln(){return in.nextLine();}
    int ni(){return Integer.parseInt(in.next());}
    long nl(){return Long.parseLong(in.next());}
    double nd(){return Double.parseDouble(in.next());}

    class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){br = new BufferedReader(new InputStreamReader(System.in));}
        public FastReader(String s) throws Exception{br = new BufferedReader(new FileReader(s));}
        String next(){
            while (st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (IOException  e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        String nextLine(){
            String str = "";
            try{str = br.readLine();}catch (IOException e){e.printStackTrace();}
            return str;
        }
    }
}

Measured memory_bytes: 25940
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.HashMap;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DisjointSetofCommonDivisors solver = new DisjointSetofCommonDivisors();
        solver.solve(1, in, out);
        out.close();
    }

    static class DisjointSetofCommonDivisors {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            long a = in.nextLong();
            long b = in.nextLong();
            HashMap<Long, Long> amap = primeFactorize(a);
            HashMap<Long, Long> bmap = primeFactorize(b);
            long result = 1;
            for (long key : amap.keySet()) {
                if (bmap.containsKey(key)) {
                    result++;
                }
            }
            out.println(result);

        }

        static HashMap<Long, Long> primeFactorize(long x) {
            HashMap<Long, Long> result = new HashMap<>();
            for (long i = 2; i * i <= x; i++) {
                if (x % i != 0) {
                    continue;
                }
                long ex = 0;
                while (x % i == 0) {
                    ex++;
                    x /= i;
                }
                result.put(i, ex);
            }
            if (x != 1) {
                result.put(x, 1L);
            }
            return result;
        }

    }
}



Measured memory_bytes: 38372
//D
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(v) v.begin(), v.end()

using namespace std;
typedef long long LL;
const LL MOD = 1e9 + 7;

int main() {
	int S;
	cin >> S;
	int dp[S + 1];
	dp[0] = 1; dp[1] = 1; dp[2] = 1;
	for (int i = 3; i <= S; i++) {
		dp[i] = dp[i - 1] + dp[i - 3];
		dp[i] %= MOD;
	}
	LL ans = dp[S] - dp[S - 1];
	while (ans < 0) ans += MOD;
	cout << ans << "\n";
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 
  int N, X, a;
  cin >> N;
  X = N;
  a = 0;
  
    while(N > 0){
      a += N % 10;
      N = (N - N % 10) / 10;
    }
  
    if(X % a == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
 
}

Measured memory_bytes: 256
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <cmath>         // sqrt
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <bits/stdc++.h> // isupper, islower, isdigit, toupper, tolower
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, n) for (int i = (a); i < (n); i++)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> Pl;
typedef pair<int, int> P;
typedef tuple<ll, ll, string> Tlls;

// Greatest Common Divisor (最大公約数)
ll gcd(ll a, ll b)
{
  // Eucledean algorithm
  while (a)
  {
    if (a < b)
    {
      std::swap(a, b);
    }
    a %= b;
  }
  return b;
}

// Least Common Multiple 最小公倍数
ll lcm(ll a, ll b)
{
  return a / gcd(a, b) * b;
}

// key: value of prime factor素因数分解
// value: number of prime factor
map<ll, ll> prime_factorization(ll n)
{
  map<ll, ll> prime_factors;
  for (ll i = 2; i * i <= n; i++)
  {
    while (n % i == 0)
    {
      prime_factors[i]++;
      n /= i;
    }
  }
  if (n != 1)
    prime_factors[n] = 1;
  return prime_factors;
}

// 約数リスト約数の列挙
vector<ll> get_divisors(const ll n)
{
  vector<ll> divs;
  for (ll i = 1; i < (ll)sqrt((ld)n) + 1; i++)
  {
    if (n % i == 0)
    {
      divs.push_back(i);
      if (i != n / i)
      {
        divs.push_back(n / i);
      }
    }
  }

  // 必要に応じてソート
  // sort(divs.begin(), divs.end());

  return divs;
}

int main()
{
  char I;
  cin >> I;
  if ('a' <= I && I <= 'z')
  {
    cout << 'a' << endl;
  }
  else
  {
    cout << 'A' << endl;
  }

  return 0;
}


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

int main(void) {
    int S;cin>>S;
    int sec = S % 60;
    S /= 60;
    int minute = S % 60;
    S /= 60;
    int hour = S;
    cout << hour << ":" << minute << ":" << sec << endl;
    return 0;
}


Measured memory_bytes: 3092
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, begin, end) for(ll i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(ll i=(begin)-1;i>=(end);i--)
#define IREP(i, n) IFOR(i,n,0)
#define SORT(a) sort(a.begin(), a.end())
#define ISORT(a) sort(a.begin(), a.end(),greater<ll>())
#define REVERSE(a) reverse(a.begin(), a.end())
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=(" << v[0]; FOR(i_debug, 1, v.size()){ cout << "," << v[i_debug]; } cout << ")" << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;}
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)

#define ll long long
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define INF 1000000000000000000

using vec = vector<ll>;
using mat = vector<vec>;
using Pii = pair<ll, ll>;
using PiP = pair<ll, Pii>;
using PPi = pair<Pii, ll>;
using bvec = vector<bool>;
using Pvec = vector<Pii>;


template<typename T> void readv(vector<T> &a) { REP(i, a.size()) cin >> a[i]; }
void readv_m1(vector<int> &a) { REP(i, a.size()) {cin >> a[i]; a[i]--;} }

ll mod = 1000000007;

int main()
{
	ll N, M;
	cin >> N >> M;

	mat B(M + 1, vec(0));

	ll A, Btemp;

	REP(i, N) {
		cin >> A >> Btemp;
		if (A > M) {
			Btemp = 0;
			A = 0;
		}
		B[A].emplace_back(Btemp);
	}

	priority_queue<ll> Bav;

	ll ans = 0;

	REP(i, M) {
		REP(j, B[i + 1].size()) {
			Bav.push(B[i + 1][j]);
		}
		if (!Bav.empty()) {
			ans += Bav.top();
			Bav.pop();
		}
	}

	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 5632
#include <iostream>

using namespace std;

int main()
{
   int a,b,c,x,i;
   cin >> a >> b >> c ;
   x = 0;
   if (c%a  == 0)  
     x = x + 1;
   for(i=1; i<=10000; i++)
   {
     a = a + 1; 
     if (a > b)
     break;
     else if (c%a  == 0)  
     x = x + 1;
     else
     x = x;
    }
   cout << x << endl;
   return 0;
}


Measured memory_bytes: 3116
import sys
readline = sys.stdin.buffer.readline

from collections import deque
import copy

def myinput():
    return map(int,readline().split())

def mycol(data,col):
    return [ row[col] for row in data ]

ls_ans = []

w,h = myinput()
c = [ list(myinput()) for _ in range(h) ]

while w!=0 or h!=0:
    def dfs(sx,sy):
        stack = deque()
        stack.append([sx,sy])
        while stack:
            x,y = stack.pop()
            if c[x][y]==1:
                c[x][y] = 0
                for i in range(-1,2):
                    for j in range(-1,2):
                        if i==0 and j==0:
                            continue
                        else:
                            nx = x + i
                            ny = y + j
                            if nx==-1 or ny==-1 or nx==h or ny==w:
                                pass
                            else:
                                if c[nx][ny]==1:
                                    stack.append([nx,ny])
                                else:
                                    pass
            else:
                pass

    ans = 0
    for i in range(h):
        for j in range(w):
            if c[i][j]==1:
                dfs(i,j)
                ans += 1
            else:
                pass
    # print(ans)
    ls_ans.append(ans)

    w,h = myinput()
    c = [ list(myinput()) for _ in range(h) ]

for i in range(len(ls_ans)):
    print(ls_ans[i])


Measured memory_bytes: 6560
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.Pattern;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            String[] tokens = line.split(" ");
            int a = Integer.parseInt(tokens[0]);
            int b = Integer.parseInt(tokens[1]);
            int c = greateCommonDivisor(a, b);
            System.out.println(c);
        }
    }

    static int greateCommonDivisor(int a, int b) {
        if (a % b == 0) {
            return b;
        } else {
            int c = Math.abs(a - b);
            int d = Math.min(a, b);
            return greateCommonDivisor(Math.max(c,d), Math.min(c,d));
        }
    }

    static boolean isNumber(String num) {
        return Pattern.compile("^\\-?[0-9]*\\.?[0-9]+$").matcher(num).find();
    }

    static int[] createListInt(BufferedReader br) throws IOException {
        String[] lines = br.readLine().split(" ");
        int n = lines.length;
        int[] list = new int[n];
        while (n-- > 0) {
            list[n] = Integer.parseInt(lines[n]);
        }
        return list;
    }

    static int ip(BufferedReader s) throws IOException {
        return Integer.parseInt(s.readLine());
    }
}

Measured memory_bytes: 24120
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
static const int INF (1<<30);

int main() {
  int N; cin >> N;
  vector<int> p(N+1);
  
  int cnt = 0;

  rep(i, N) {
    int x; cin >> x;
    if (x != i+1) cnt++;
  }

  if (cnt <= 2) cout << "YES" << endl;
  else cout << "NO" << endl;

  return 0;
}

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

#define REP(i,n) for(int i=0;i<(n);++i)
#define ll long long
const long long INF = 1LL<<60;
const long long mod = 1e9 + 7;

int main(){
    int N, M;
    cin >> N >> M;
    int L[M], R[M];
    REP(i,M) cin >> L[i] >> R[i];
    int l, r;
    l =1;
    r = N;
    REP(i,M){
        l = max(L[i],l);
        r = min(R[i],r);
    }
    if(r - l < 0) cout << 0 << endl;
    else cout << r - l + 1 << endl;
}

Measured memory_bytes: 1024
# include <cmath>
# include <iostream>
# include <queue>
# include <set>
# include <stack>
# include <string>
# include <vector>


using namespace std;


int main() {
    int n, x; cin >> n >> x;
    if (500*n >= x) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}



Measured memory_bytes: 256
from copy import copy
n, k = map(int, input().split())
ns = list(map(int, input().split()))
for i in range(k):
    imosur = [0] * n
    imosul = [0] * n
    ans = [0] * n
    for i in range(n):
        imosur[i] += 1
        if i + ns[i] + 1 < n:
            imosur[i + ns[i] + 1] -= 1
        imosul[n - i - 1] += 1
        if n - i - 2 - ns[n - i - 1] >= 0:
            imosul[n - i - 2- ns[n - i -1]] -= 1
    r=0
    l=0
    for i in range(n):
        r += imosur[i]
        ans[i] += r
        l += imosul[n - i - 1]
        ans[n - i - 1] += l - 1
    if min(ans) == n:
        print(*[n for _ in range(n)])
        exit()
    ns = copy(ans)
print(*ans)
            

Measured memory_bytes: 172392
import java.util.*;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int M = Integer.parseInt(sc.next());
        int [] H = new int[N];
        int [] T = new int[N];
        Arrays.fill(T, 1);
        int count = 0;
        for(int i = 0; i < N; i++){
            H[i] = Integer.parseInt(sc.next());
        }
        for(int i = 0; i < M; i++){
            int A = Integer.parseInt(sc.next())-1;
            int B = Integer.parseInt(sc.next())-1;
            if(H[A] > H[B]){
            	T[B] = 0;
            }
          	else if(H[A] < H[B]){
              	T[A] = 0;
            }
          	else if(H[A] == H[B]){
           		 T[A] = 0;
           		 T[B] = 0;
            }
        }
        
        
        for(int i = 0; i < N; i++){
            if(T[i] != 0){
                count++;
            }
        }
        System.out.println(count);
    }

}


Measured memory_bytes: 59552
#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;

typedef pair <int,int> pii;
typedef vector <pii> vpii;
typedef vector <int> vi;
typedef vector <vi> vvi;
typedef long long int lli;
typedef vector <lli> vlli;
typedef vector <vlli> vvlli;
typedef vector <string> vs;
typedef vector <bool> vb;

#define rep(i, n) for( i = 0; i < (n); ++i)
#define repA(i, a, n) for( i = a; i <= (n); ++i)
#define repD(i, a, n) for( i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sortr(x) sort(x.begin(),x.end(),greater <int> ())
#define mod 1000000007
#define ff first
#define ss second
#define fill(a,c)  memset(a, c, sizeof (a))
#define formap(i,v) for(auto &i: v)
#define dbg(x) cout << #x << " = " << x << '\n'
#define dbg2(x,y) cout<<#x<<" = "<<x<<" & "<<#y<<" = "<<y<<endl;
#define dbgstl(v) cout<<#v<<" = \n"; { int c=0; formap(it,v) \
cout<<"    "<<#v<<"["<< ++c <<"] = "<<it<<endl;} cerr<<endl
#define dbgstlp(v) cout<<#v<<" = \n"; { int c=0; formap(it,v) \
cout<<"    "<<#v<<"["<< ++c <<"] = "<<it.first<<" , "<<it.second<<endl;} cerr<<endl
#define PI  3.14159265358979323846
#define pb push_back




int main() {
	cin.sync_with_stdio(0);cin.tie(0);
    cin.exceptions(cin.failbit);
    
    lli i,j,k,n;
    string s;
    char x,y;
    cin>>n;
    n--;
    while (n>=0){
        k= n%26;
        x= k+'a';
        s=x+s;
        n=n-k;
        n=n/26;
        n--;
    }
    cout<<s<<endl;
    
    
    
    
   
   
    
    
   
   
   
   
   
   
	return 0;
}


Measured memory_bytes: 3620
w = input()

group = set(w)

count = []
for i in group:
    count.append(w.count(i))

ans = 0

for j in count:
    if j % 2 == 1:
        ans = 1
    else:
        pass

if ans == 0:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 9052
# 2**15=32000ちょいなのであらかじめ誰が正直者で誰がそうでないかのテーブルを作成し、それをもとにして探索。
# 矛盾がないことを探索していくような判定とデータ構造が浮かばん
# 正直者と、真偽不明の人、というのが味噌 嘘つきではない
# bit操作がわからんので配列でやった
# まじで判定とデータ構造どうすっかわからん

n = int(input())
syougen = [[] for _ in range(n)]
for i in range(n):
    a = int(input())
    for _ in range(a):
        x, y = map(int, input().split())
        syougen[i].append((x - 1, y))


def f(n, cur=[]):
    # 1と0からなる長さNの組み合わせを全2**n個出すジェネレータ
    if len(cur) == n:
        yield cur
    else:
        for i in range(2):
            _next = cur[:]
            _next.append(i)
            yield from f(n, _next)


def check(arr):
    for i in range(n):
        if arr[i] == 0:
            continue
        for x, y in syougen[i]:
            if arr[x] == 1 and y == 0:
                return False
            if arr[x] == 0 and y == 1:
                return False
    return True


ans = 0
for g in f(n):
    if check(g):
        ans = max(ans, sum(g))
print(ans)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define ALL(A) (A).begin(),(A).end()
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)

const ll mod = 1e9+7;
const ll INF = -1*((1LL<<63)+1);
const int inf = -1*((1<<31)+1);

using namespace std;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(20);
    int N,M;
    string s;
    int p;
    cin >> N >> M;
    vector<int> pena(N+1);
    int pena_num = 0;
    set<int> st;
    rep(i,M){
        cin >> p >> s;  
        if(s=="AC"){
            if(st.count(p))continue;
            st.insert(p);
            pena_num += pena[p];
        }else{
            if(st.count(p))continue;
            else pena[p]++;
        }
    }
    cout << st.size() << " " << pena_num << endl;
}

Measured memory_bytes: 5376
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(0);
  while(N!=0){
    if(N%2!=0){
      A.push_back(1);
      if(N<0) N-=2;
    }
    else{
      A.push_back(0);
    }
    N/=-2;
  }
  int b=A.size();
  for(int i=b-1; i>=0; i--){
    cout << A[i];
  }
  if(b==0) cout << 0;
  cout << endl;
}

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

int dx[] = {1 , -1 , 0 ,  0};
int dy[] = {0 ,  0 , 1 , -1};
#define ll long long
#define vi vector <int>
#define pi pair< int , int >
#define pl pair< ll , ll >
#define pii pair< pi , int >
#define fr first
#define sc second
#define pb push_back
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define PI acos(-1)
#define eps 1e-6
#define OO   INT_MAX
#define infin LLONG_MAX
#define mod 1000000007
#define SPEED_UP ios_base::sync_with_stdio(false); cin.tie(NULL);
#define SZ(x) ((int)(sizeof(x)))
#define sz(v) (int)v.size()
#define all(t) t.begin(),t.end()
#define frei freopen("in.in","r",stdin)
#define freo freopen("out.out","w",stdout)
#define SET(x,y)    x|=(1<<y)
#define CLEAR(x,y)  x&= ~(1<<y)
#define TOGGLE(x,y) x^=(1<<y)
#define READ(x,y)   ((bool)((ll)(x&(1<<y)) != 0))
#define I(x) scanf("%d",&x)
#define I2(x,y) scanf("%d%d",&x,&y)
#define I3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define I4(x,y,z,r) scanf("%d%d%d%d",&x,&y,&z,&r)
#define L(x) scanf("%I64d",&x)
#define L2(x,y) scanf("%I64d%I64d",&x,&y)
#define L3(x,y,z) scanf("%I64d%I64d%I64d",&x,&y,&z)
#define L4(x,y,z,r) scanf("%I64d%I64d%I64d%I64d",&x,&y,&z,&r);
#define D4(x,y,z,r) scanf("%lf%lf%lf%lf",&x,&y,&z,&r);
#define MAX (int)1e5+100
int n,a[MAX];
ll dp[MAX];
ll get(int i = 0)
{
    if(i >= n)return 1e15;
    if(i == n-1)return 0;
    if(dp[i] + 1)return dp[i];
    return dp[i] = min(get(i+1) + abs(a[i] - a[i+1]),get(i+2)+abs(a[i] - a[i+2]));
}
int main()
{
    memset(dp,-1,SZ(dp));
    scanf("%d",&n);
    FOR(i,0,n)scanf("%d",&a[i]);
    printf("%I64d\n",get());
    return 0;
}


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

using namespace std;

int N;

void dfs(string s,char mx)
{
    if(s.length() == N)
    {
        cout << s << endl;
    }
    else
    {
        for (char c = 'a'; c <= mx; c++)
        {
            if (c < mx)
            {
                dfs(s + c, mx);
            }
            else
            {
                dfs(s + c, (char)(mx + 1));
            }
        }
        
    }
    
}

int main(){
    cin >> N;
    dfs("", 'a');
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define ss(x) (int) x.size()
#define pb push_back
#define ll long long
#define cat(x) cerr << #x << " = " << x << endl
#define FOR(i, n) for(int i = 0; i < n; ++i)

using namespace std;	

int n, m, v, p;
int a[111111];
ll sum[111111];
			
int main() {
	scanf("%d %d %d %d", &n, &m, &v, &p);
	for(int i = 1; i <= n; ++i) {
		scanf("%d", a + i);
	}
	sort(a + 1, a + n + 1);
	reverse(a + 1, a + n + 1);
	for(int i = 1; i <= n; ++i)
		sum[i] = sum[i - 1] + a[i];
	int ans = p;
	for(int i = p + 1; i <= n; ++i) {
		ll pula = 1ll * v * m;
		ll ja = a[i] + m;
		if(ja < a[p]) continue;
		if(p - 1 + n - i + 1 >= v) {
			ans++;
			continue;
		}
		pula -= 1ll * m * (p - 1 + n - i + 1);
		int dl = i - p;
		ll e = 1ll * dl * (a[i] + m) - (sum[i - 1] - sum[p - 1]);
		if(pula <= e) {
			ans++;
		}
	}
	printf("%d\n", ans);
		
		
		
	
	
	return 0;
}



Measured memory_bytes: 1408
#include<iostream>
#include<vector>
#include <cmath>

using namespace std;
int main()
{   
    // 整数の入力
    int a;
//    vector<string> vect1;
//  vector<string> vect2;
    string str1, result;
    result = "Yes";
    cin >> a;
    cin >> str1;

    if((a%2)==1){
        result = "No";
        cout << result;
        return 0;
    }

for(int i = 0; i < a/2; ++i){
    int n = i + a/2;
    if(str1[i]==str1[n]){

    }else{
        result = "No";
       break;
    }
}



    cout << result ;
    return 0;
}

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

#define mo 998244353
#define ran 202202

struct modular_arithmetic{
	int mod;

	modular_arithmetic(){
		mod = 998244353;
	}
	//No specific settings.
	int add(int x,int y){return (x+=y)<mod?x:x-mod;}
};
modular_arithmetic ma;

struct Node {
	int pos, det;
} a[ran];

int n;
int nxt[ran];
pair<int, int> q[ran]; int lq;
int f[ran];

int cmp(const Node &a, const Node &b) {
	return a.pos < b.pos;
}

int main() {
	scanf("%d", &n);
	for(int i=0;i<n;i++)
		scanf("%d%d", &a[i].pos, &a[i].det);
	sort(a, a+n, cmp);
	
	lq = 0;
	for(int i=n-1;i>=0;i--) {
		int r = a[i].pos + a[i].det - 1;
		nxt[i] = i+1;
		while(lq>0 && r>=a[q[lq-1].first].pos) {
			lq--;
			nxt[i] = max(nxt[i], q[lq].second);
		}
			
		q[lq++] = make_pair(i, nxt[i]);
	}
	
	f[n] = 1;
	for(int i=n-1;i>=0;i--)
		f[i] = ma.add(f[i+1], f[nxt[i]]);
	printf("%d\n", f[0]);
	
	return 0;
}

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

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

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

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

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

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

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

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

use std::cmp;

fn main() {
    input! {
        n: usize,
        costs: [i32; n],
    }

    let inf = 1 << 29;

    let mut dp = vec![inf; n];
    dp[0] = 0;

    for i in 1..n {
        dp[i] = cmp::min(dp[i], dp[i - 1] + (costs[i - 1] - costs[i]).abs());
        if i > 1 {
            dp[i] = cmp::min(dp[i], dp[i - 2] + (costs[i - 2] - costs[i]).abs());
        }
    }

    println!("{}", dp[n - 1]);
}

Measured memory_bytes: 4352
import java.util.Scanner;

public class Main
{

  public static void main(String[] args)
  {
    try (Scanner sc = new Scanner(System.in))
    {
      while (sc.hasNext())
      {
        final int A = sc.nextInt();
        final int B = sc.nextInt();

        int ans = B / A;
        if (B % A != 0)
        {
          ans++;
        }
        System.out.println(ans);
      }
    }

  }
}



Measured memory_bytes: 26372
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using pii = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
#define all(c) begin(c), end(c)
#define rall(c) rbegin(c), rend(c)
#define fore(x, c) for(auto &&x : c)
#define rep(i, a, n) for(int i = a, i##len = (int)(n); i < i##len; ++i)
#define rrep(i, a, n) for(int i = (int)(n - 1); i >= a; --i)
#define sz(c) ((int)c.size())
#define contains(c, x) (c.find(x) != end(c))
#define inseg(l, x, r) ((l) <= (x) && (x) < (r))
#define dump(...)
#define pb push_back
#define eb emplace_back
#define _ 0
const signed INF_ = 1001001001; const long long INF = 1001001001001001001LL;
const int DX[9] = {0,1,0,-1,1,1,-1,-1,0}, DY[9] = {-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os, const vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is, vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
  is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a, const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a, const U &b){return a>b?a=b,1:0;}
template <class T> void psum(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap = priority_queue<T, deque<T>, greater<T>>;
struct before_main_function {
  before_main_function() {
      cin.tie(nullptr); ios::sync_with_stdio(0);
      cout << setprecision(15) << fixed;
  }
} before_main_function;
// clang-format on
//------------------8<------------------------------------8<--------------------

signed main() {
  string S;
  cin >> S;
  rep(i, 0, sz(S)) {
    if (S[i] == '?') {
      S[i] = 'D';
    }
  }
  cout << S << endl;
  return (0 ^ _ ^ 0);
}



Measured memory_bytes: 3772
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String ans = "APPROVED";
        for (int i = 0; i < N; i++) {
            int A = sc.nextInt();
            if (A%2 == 0) {
                if (A%3 == 0 || A%5 == 0) {
                    ;
                } else {
                    ans = "DENIED";
                }
            }
        }
        System.out.println(ans);
    }
}



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


int main()
{
  char s[11];
  if (fgets(s,10,stdin) == NULL ){
    exit(1);
  }
  int len = strlen(s);
  int i, judge = 0;
  s[len-1] = '\0';
  for (i = 0; i < len-1; i++){
    if (s[i] == 'h'){
      if (s[i+1] == 'i'){
        judge = 1;
        i += 1;
      }else{
        judge = 0;
        break;
      }
    }else{
      judge = 0;
      break;
    }
  }
  if (judge == 1){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
}

Measured memory_bytes: 128
a = input()
if len(a)==5:
    b = int(a)
    c = b - 9999 + 9 + 900
elif len(a)==4:
    b = int(a)
    c = 9 + 900
elif len(a)==3:
    b = int(a)
    c = b - 99 + 9
elif len(a)==2:
    b = int(a)
    c = 9
elif len(a)==1:
    b = int(a)
    c = b
elif len(a)==6:
    c = 90000 + 900 +9
print(c)

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

int main() {
  char S;
  cin >> S;

//  for(int i =0;i<cnt;i++)
//  {
//  }
  	if(S == 'a' || S == 'i' || S == 'u'
  	            || S == 'e' || S == 'o')
  	{
  		cout << "vowel" << endl;
  	}
  	else
  	{
  		cout << "consonant" << endl;
  	}
//  cout << sum << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
main(){
  int a,b,k;
  cin>>a>>b>>k;
if(a!=b){
  int closs[204];
  int temp;
  if(a+k>=b) temp=b;
  else temp=a+k;
  for(int i=a;i<temp;i++){
      cout<<i<<endl;
    closs[i-a]=i;
  }
  if(b-k<=a) temp=a;
  else temp=b-k;
  for(int i=temp+1;i<=b;i++){
    int ju=0;
    for(int j=0;j<k;j++){
      if(closs[j]==i) ju=1;
    }
    if(!ju) cout<<i<<endl;
  }
}else cout<<a<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
int exsearch(int*, int, int);
main()
{
        int i, n, q, m, *a;
        scanf("%d", &n);
        a = (int*)malloc(sizeof(int) * n);
        for(i = 0; i < n; i++){
        scanf("%d%*c", &a[i]);
        }
        scanf("%d", &q);
        for(i = 0; i < q; i++){
                scanf("%d%*c", &m);
                if(exsearch(a, m, n)){
                        printf("yes\n");
                }else{
                        printf("no\n");
                }
        }
        free(a);
}
int exsearch(int *a, int m, int n)
{
        int result = 0;
        if(!m){
        return 1;
        }else if(!n || m < 0 ){
                return 0;
        }else{
                result = exsearch(a, m - a[n - 1], n - 1) || exsearch(a, m, n - 1);
        }
        return result;
}

Measured memory_bytes: 1808
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
#define rep(i, n) for(int i=0; i<n; ++i)
#define REP(i, n) for(int i=1; i<=n; ++i)
#define all(obj) (obj).begin(), (obj).end()
using P = pair<int, int>;
const int inf = 1e9;
const ll INF = 1e18;
const ll MOD = 1e9+7;
const ll MAX = 1e9+7;

int main(){
    int n, d; cin >> n >> d;
    int ans = 0;
    while(n > 0){
        ans++;
        n -= 2*d + 1;
    }
    cout << ans <<endl;
    return 0;
}

Measured memory_bytes: 256
ss = input()
count = 0
ans  = 0
for s in ss:
    if count%2 == 0 and s != "L":
        pass
    elif count%2 == 0:
        ans += 1
    elif count%2 == 1 and s != "R":
        pass
    elif count%2 == 1:
        ans += 1
    count += 1
if ans == 0:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3064
#include <iostream>
using namespace std;
const int N=1e6+10;
int max(int a,int b){return a>b?a:b;}
int a[N];
int main(){
	string s;
	int n,cnt;
	long long int ans=0;
	cin>>s;
	n=(int)s.size();
	for(int i=0;i<=n;i++)a[i]=0;
	for(int i=0;i<n;i++){
		cnt=0;
		while(i+1<s.size()){
			if(s[i+1]==s[i]){
				i++;
				cnt++;
			}
			else break;
		}
		for(int j=i-cnt;j<=i+1;j++){
			if(s[i]=='<')a[j]=max(j-i+cnt,a[j]);
			else a[j]=max(i-j+1,a[j]);
		}
	}
	for(int i=0;i<=n;i++)ans+=a[i];
	cout<<ans<<endl;
}



Measured memory_bytes: 2820
n = int(input())
A = list(map(int, input().split()))

# 奇数に3倍しても偶数になる(2で割れる)ことはないので、
# aの各項が何回2で割れるかを数え上げればよい
cnt = 0
for a in A:
    while a%2 == 0 and a > 0:
        a//=2
        cnt += 1
print(cnt)

Measured memory_bytes: 4148
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

a,b,k = map(int, input().split())

if a > k:
    print(a - k ,b)
else:
    if b - (k - a) > 0:
        print(0,b - (k - a))
    else:
        print(0,0)

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    vector<pair<double, double> > v;
    double a,b;
    for(int i=0;i<n;i++){
    	cin>>a>>b;
    	v.push_back({a,b});
    }
    double ans=0;
    for(int i=0;i<n;i++)for(int j=i+1;j<n;j++)ans+=hypot(abs(v[i].first-v[j].first),abs(v[i].second-v[j].second));
    doublecout(ans/((double)n/2.0));
    return 0;
}


Measured memory_bytes: 256
// Copyright: lzt
#include<stdio.h>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<cmath>
#include<iostream>
#include<queue>
#include<string>
#include<ctime>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<long long,long long> pll;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i,j,k)  for(register int i=(int)(j);i<=(int)(k);i++)
#define rrep(i,j,k) for(register int i=(int)(j);i>=(int)(k);i--)
#define Debug(...) fprintf(stderr, __VA_ARGS__)

ll read(){
	ll x=0,f=1;char c=getchar();
	while(c<'0' || c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0' && c<='9'){x=x*10+c-'0';c=getchar();}
	return x*f;
}

const int maxn = 200200;
int n, a, b, c, d;
char s[maxn];

void work() {
	n = read(), a = read(), b = read(), c = read(), d = read();
	scanf("%s", s + 1);
	rep(i, a, c - 1) if (s[i] == '#' && s[i + 1] == '#') {
		puts("No"); return;
	}
	rep(i, b, d - 1) if (s[i] == '#' && s[i + 1] == '#') {
		puts("No"); return;
	}
	if (c > d) {
		rep(i, b - 1, d - 1) if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
			puts("Yes"); return;
		}
		puts("No"); return;
	}
	puts("Yes");
}

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

	work();

	#ifdef LZT
		Debug("My Time: %.3lfms\n", (double)clock() / CLOCKS_PER_SEC);
	#endif
}


Measured memory_bytes: 384
using System;

class Program {
  static void Main(string[] args) {
    string[] buf = Console.ReadLine().Split(' ');
    int N = int.Parse(buf[0]);
    int K = int.Parse(buf[1]);
    int rep = K;

    for (int i = 1; i < N; ++i) {
      rep *= K - 1;
    }
    
    Console.WriteLine(rep);
  }
}


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

int main() {
  int N, K, s=1;
  cin >> N >> K;

  for (int i = 0; i < N; i++) {
   if ( s + K > s * 2) s*= 2;
    else s+= K;
  }

  cout << s << endl;

return 0;
}

Measured memory_bytes: 256