akhauriyash/Code-Regression huggingface dataset:
import sys
input = sys.stdin.readline

N, P = map(int, input().split())
if N == 1:
  print(P)
  exit(0)
i = 2
x = P + 0
l = []
s = set()
while i * i <= P:
  while x % i == 0:
    x //= i
    l.append(i)
    s.add(i)
  i += 1
if x >= 2:
  l.append(x)
  s.add(x)
#print(l)
res = 1
for y in s:
  t = l.count(y)
  if t >= N:
    res *= pow(y, (t // N))
print(res)

Measured memory_bytes: 40044
#include <bits/stdc++.h>
 
#define ll long long int
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define pb push_back
#define ff first
//#define ss second
#define rep(i,a,b)	for(ll  i=a;i<b;i++)
#define hello777 ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#include <string>
#define pie 3.14159265358979323846
constexpr int MOD = 1e9+7;
const int N= 50000;
using namespace std;


ll gcd(int a, int b)
{ 
    if (a == 0) 
        return b;  
    return gcd(b % a, a);  
 } 
 
ll lcm(int a, int b)  
 {  
    return a/gcd(a, b) *b;  
 }
  
int prime(int n)
{
	rep(i,2,n+1)
	{
		if(n%i==0)return i;
	}
	
}


void solve() 
{
	ll r;
	cin>>r;
	cout<<r*r<<endl;
}

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

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

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long S;
        S = sc.nextLong();

        final Solver solver = new Solver();
        System.out.println(solver.solve(S));
    }
}

class Solver {
    public String solve(long S) {
        long first = S / 100;
        long second = S % 100;

        if ((first >= 1 && first <= 12) && (second >= 1 && second <= 12)) {
            return "AMBIGUOUS";
        }

        if (first >= 1 && first <= 12) {
            return "MMYY";
        }

        if (second >= 1 && second <= 12) {
            return "YYMM";
        }

        return "NA";
    }
}



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

int main(void) {
    
    int n;
    vector<int> a(n);
    
    cin >> n;
    
    int ans = 0;
    int cnt = 1;
    
    int k;
    for(int i = 0; i < n; i++) {
        cin >> k;
        if(cnt == k) {
            cnt++;
        } else {
            ans++;
        }
    }
    
    if(cnt == 1) cout << -1;
    else cout << ans;
    
    return 0;
}


Measured memory_bytes: 256
n = int(input())
S = [int(i) for i in input().split()]
q = int(input())
T = [int(i) for i in input().split()]
counter = 0
for i in range(q):
    left = 0
    right = n
    while left < right:
        mid = (left + right) // 2
        if S[mid] == T[i]:
            counter += 1
            break
        elif S[mid] > T[i]:
            right = mid
        else:
            left = mid + 1
print(counter)


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

long comb(long n){
    return n*(n-1)/2;
}

int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

int main()
{
    int n, m;
    scanf("%d %d", &n, &m);
    int a[n];
    int sum[n];
    int i;
    long result = 0;
    for(i=0;i<n;i++) scanf("%d", &a[i]);
    sum[0] = a[0] % m;
    for(i=1;i<n;i++) sum[i] = (sum[i-1] + a[i]) % m;
    qsort(sum, n, sizeof(int), compare_int);
    int now = 0;
    for(i=1;i<n;i++){
        if(sum[i]==sum[i-1]) now++;
        else if(sum[i-1]==0){
            result += (now+1)*(now+2)/2;
            now = 0;
        }else{
            if(now>=1) result += comb(now+1);
            now = 0;
        }
    }
    if(sum[n-1]==0) result += comb(now+2);
    else if(now>=1) result += comb(now+1);
    
    printf("%ld", result);
    


    return 0;
}

Measured memory_bytes: 1276
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
using namespace std;

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	cout << min(a + b, min(a + c, b + c)) << endl;	
}

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

using ll = long long;
static const ll INF = 1e15;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int h, n;
  cin >> h >> n;
  
  vector<ll> a(n), b(n);
  for(int i = 0; i < n; i++) cin >> a.at(i) >> b.at(i);
  
  vector<vector<ll>> dp(n + 1, vector<ll>(30000, INF));
  for(int i = 0; i <= n; i++) dp.at(i).at(0) = 0;
  
  for(int i = 1; i <= n; i++){
    for(int j = 0; j < 30000; j++){
      if(j < a.at(i - 1)) dp.at(i).at(j) = dp.at(i - 1).at(j);
      else{
        dp.at(i).at(j) = min<ll>(dp.at(i - 1).at(j), dp.at(i).at(j - a.at(i - 1)) + b.at(i - 1));
      }
    }
  }
  
  ll ans = INF;
  for(int i = h; i < 30000; i++){
    ans = min(ans, dp.at(n).at(i));
  }
  
  cout << ans << '\n';
}

Measured memory_bytes: 238612
#include <stdio.h>

int main(void){
  int h1, h2, k1, k2, ansh, ansk;
  int a, b, c, d;

  scanf("%d%d", &h1, &h2);
  scanf("%d%d", &k1, &k2);
  scanf("%d%d%d%d", &a, &b, &c, &d);
  ansh = h1*a + h2*b + (h1/10)*c + (h2/20)*d;
  ansk = k1*a + k2*b + (k1/10)*c + (k2/20)*d;

  if(ansh > ansk){
    printf("hiroshi\n");
  }else if(ansh < ansk){
    printf("kenjiro\n");
  }else{
    printf("even\n");
  }
  return 0;
}

Measured memory_bytes: 1808
#include <algorithm>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;

int main() {
  int K, T;
  while (cin >> K >> T) {
    vector<int> A(T);
    for (int i = 0; i < T; i++) cin >> A[i];
    int mx = *max_element(A.begin(), A.end());
    int res = max(0, (mx - 1) - (K - mx));
    cout << res << endl;
  }
  return 0;
}


Measured memory_bytes: 256
n = int(input())
a_list = [int(i) for i in input().split()]

turn = 0
alice = 0
bob = 0

for i in range(n):
    turn += 1
    if turn%2 != 0:
        alice += max(a_list)
        
    else:
        bob += max(a_list)
    a_list.remove(max(a_list))

print(alice - bob)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define reg register
#define M 200005
int fir,sec;
int A[M],n;
int B[M],m;
int main() {
	scanf("%d",&n);
	for(int i=1; i<=n; i++)scanf("%d",A+i);
	for(int i=n; i>=1; --i) {
		int t=upper_bound(B+1,B+1+m,A[i])-B;
		if(t==m+1)B[++m]=A[i];
		else B[t]=A[i];
	}
	printf("%d",m);
}



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


def main():
    N, M = map(int, input().split())
    
    C = [0]*M
    for _ in range(N):
        A = list(map(int, input().split()))
        for i in range(1, A[0]+1):
            C[A[i]-1] += 1
    
    print(C.count(N))


if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
w1 = input()

wl1 = []
for i in w1:
  wl1.append(i)
#print(wl1)

n = len(wl1)
wl2 = [""] * n
for i in wl1:
  wl2[n-1] = i
  n -= 1
#print(wl2)

c = 0
for i in range(len(wl1)):
  if wl1[i] != wl2 [i]:
    c += 1
print(c//2)

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <cstring>
#include <map>
#include <stack>
#include <tuple>
#include <queue>
#include <vector>
#include <cmath>
#include <math.h>
#include <random>



#define REP(i, n) for(int (i) = 0; (i) < (n); ++(i))
#define rREP(i, n) for(int (i) = (n) - 1; (i) >= 0; --(i))
#define ALL(TheArray) TheArray.begin(), TheArray.end()

using lli = long long int;
using pii = std::pair<int, int>;

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

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



/* (考察欄)
    n = 1 : {1}, {1}
    n = 2 : ダメそう
    n = 3 : {1, 2}, {2, 3}, {3, 1}
    n = 4 : ダメ
    n = 5 :
    {1, 2, 3}
    {1, 4, 5}
    {2, 4, 6}
    {3, 5, 6}

    {1, 2, 3, 4}
    {1, 5, 6, 7}
    {2, 5, 8, 9}
    {3, 6, 8, 10}
    {4, 7, 9, 10}
*/


int main(void){
    int n; scanf("%d", &n);
    int pn = sqrt(n);
    while(pn * (pn + 1) < 2 * n) pn++;
    if(pn * (pn + 1) != 2 * n){
        puts("No");
        return 0;
    }

    printf("Yes\n%d\n", pn+1);

    std::vector<std::vector<int>> Ans(pn+1, std::vector<int>(pn));
    int notAppear = 1;
    for(int i = 0; i <= pn; ++i){
        printf("%d ", pn);
        int j;
        for(j = 0; j < i; ++j){
            Ans[i][j] = Ans[j][i-1];
        }
        for(; j < pn; ++j){
            Ans[i][j] = notAppear++;
        }
        REP(j, pn){
            printf("%d", Ans[i][j]);
            putchar(j == pn - 1 ? '\n' : ' ');
        }
    }




    return 0;
}

Measured memory_bytes: 2176
#include<iostream>
#include<bits/stdc++.h>
#include<iomanip>
#include<math.h>
#include<vector>
#include<cctype>
#include<string>
#include<set>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
std::string line;
typedef long long ll;

int main(){

   int a,b,c;
   cin >> a >> b >> c;

   if( c <= a+b ) cout << "Yes" << endl;
   else cout << "No" << endl;



   return 0;
}

Measured memory_bytes: 256
#define R register
#define ll long long
#include <bits/stdc++.h>

using namespace std;

const int maxn = 2e5 + 5;

char s[maxn];
int cnt[30];

int main()
{
	scanf("%s", s + 1);
	ll len = strlen(s + 1), ans = 1ll * len * (len + 1) / 2;
	for (R int i = 1; i <= len; ++i) ++cnt[s[i] - 'a'];
	for (R int i = 0; i <= 'z' - 'a'; ++i)
		ans -= (1ll * cnt[i] * (cnt[i] - 1) / 2);
	printf("%lld", ans - len + 1);
}

Measured memory_bytes: 384
from fractions import Fraction

N,K = map(int, input().split())

proba = 0
for i in range(1,N+1):
	deme = i
	con = 0
	while deme < K:
		deme *= 2
		con += 1
	proba += (1/N)*((1/2)**con)

print(float(proba))
    

Measured memory_bytes: 5048
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static long Mod = (long)1e9 + 7;
        static void Main(string[] args)
        {
            SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            Out.Flush();
            Read();
        }
        static void Solve()
        {
            var NM = Sarray()[0];
            var Ai = Sarray();
            if (Ai.Any(a => a == 0))
            {
                WriteLine(0);
                return;
            }
            BigInteger ans = 1;
            foreach (var a in Ai)
            {
                ans *= a;
                if ((long)1e18 < ans)
                {
                    WriteLine(-1);
                    return;
                }
            }
            WriteLine(ans);
        }
    }
}

Measured memory_bytes: 41692
#include <algorithm>
#include <climits>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <vector>

using namespace std;
constexpr long long int INF = std::numeric_limits<long long int>::max();
#define int long long int

void solve() {
  // int x;
  // cout << endl;
}

signed main() {
  int n, k;
  cin >> n >> k;
  n -= k;
  int ans = 1 + n / (k - 1);
  if (n % (k - 1) != 0) {
    ans++;
  }
  cout << ans << endl;
  // solve();
  return 0;
}


Measured memory_bytes: 256
Y,N = gets.split.map(&:to_i)
a = 0
while a * 10000 <= N
  b = 0
  while b * 5000 + a * 10000 <= N
    c = (N - (a * 10000 + b * 5000)) / 1000
    if(a+b+c==Y&&a*10000+b*5000+c*1000==N)
      puts "#{a} #{b} #{c}"
      exit
    end
    b += 1
  end
  a += 1
end
puts "-1 -1 -1"


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

int main(){
    int N;
    long long A;
    cin >> N;
    long long sum=0;
    bitset<2000*2000+1> dp(1);
    for(int i=0;i<N;i++){
        cin >> A;
        sum+=A;
        dp=(dp|(dp<<A));
    }

    long long ms;
    for(ms=sum/2+(sum%2);!(dp[ms]);ms++);

    cout << ms << endl;

    return 0;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(long long i=0;i<x;i++)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;


int main(){	
	long long W;
	long long N;
	long long H;
	scanf("%lld",&H);
	scanf("%lld",&W);
	scanf("%lld",&N);
	vector<long long> a(N-1+1);
	vector<long long> b(N-1+1);
	set<P> s;
	for(int i = 0 ; i <= N-1 ; i++){
		scanf("%lld",&a[i]);
		scanf("%lld",&b[i]);
		s.insert(P(a[i],b[i]));
	}
	vector<ll> res(10);
	for (auto x : s) {
		// cout << x.first << " " << x.second  << endl;
		for (ll i = x.first-1; i <= x.first+1; i++) {
			for (ll j = x.second-1; j <= x.second+1; j++) {
				if (i <= 1 || i >= H || j <= 1 || j >= W) continue;
				ll cnt = 0;
				for (ll k = i-1; k <= i+1; k++) {
					for (ll l = j-1; l <= j+1; l++) {
						if (s.find(P(k,l)) != s.end()) cnt ++;
					}
				}
				// cout << i << " " << j << " :" << cnt << endl; 
				if (cnt >= 0) res[cnt]++;
			}
		}
	}
	repn(i, 9) {
		res[i] /= i;
	}
	res[0] = (H-2)*(W-2);
	repn(i, 9) {
		res[0] -= res[i];
	}
	rep(i, 10) {
		cout << res[i] << endl;
	}
	return 0;
}



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

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> A(N);
    for(int i = 0; i < N; i++) {
        cin >> A.at(i);
    }
    int mn, mx, a;
    for(int j = 1; j <= K; j++) {
        vector<int> B(N + 1, 0);
        for(int i = 0; i < N; i++) {
            a = A.at(i);
            mn = max(i - a, 0);
            mx = min(i + a, N - 1);
            B.at(mn)++;
            B.at(mx + 1)--;
        }
        for(int i = 1; i <= N; i++) {
            B.at(i) = B.at(i - 1) + B.at(i);
        }

        B.pop_back();
        if(A == B) {
            break;
        }
        A = B;
    }

    for(int i = 0; i < N; i++) {
        if(i != 0) {
            cout << " ";
        }
        cout << A.at(i);
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 4840
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
ll ans = 1LL<<60;

int main()
{
ll n ;
cin >> n ;
if(n==1){
cout << 0 << endl;
return 0;
}
vector<ll> a(n),b(n);
rep(i, n){
  cin >> a[i];
  b[n-i-1]=a[i]*2;
}
b[0]=b[1];
vector<ll> v(n),vv(n);
stack<ll> s;
for (ll i = n-2; i >= 0; i--)
{
  ll r=a[i+1];
  v[i]=v[i+1];
  rep(j,20){
    if(a[i]<=r){
      rep(l,20){
        r=r>>2;
        if(a[i]<=r){s.push(2*(n-1-i));continue;}
        break;
      }
      break;
    }
    v[i]+=2*(n-1-i);
    if(s.size()>0){v[i]-=s.top();s.pop();}
    r=r<<2;
  }
}
while(!s.empty())s.pop();
for (ll i = n-2; i >= 0; i--)
{
  ll r=b[i+1];
  vv[i]=vv[i+1];
  rep(j,20){
    if(b[i]<=r){
      rep(l,20){
        r=r>>2;
        if(b[i]<=r){s.push(2*(n-1-i));continue;}
        break;
      }
      break;
    }
    vv[i]+=2*(n-1-i);
    if(s.size()>0){vv[i]-=s.top();s.pop();}
    r=r<<2;
  }
}
rep(i,n){
  ans=min(ans,v[i]+vv[n-1-i]+i);
}
cout << ans << endl;
return 0;
}

Measured memory_bytes: 6528
#include<iostream>
#include<cstdio>
#define mod 1000000007
using namespace std;
long long ans,x,y,n,q,a[3001],t[3001][3001],T[3001][3001],sum[3001][3001],Sum[3001][3001];
int read()
{
  char c=0;
  int sum=0;
  while (c<'0'||c>'9')
    c=getchar();
  while ('0'<=c&&c<='9')
    {
      sum=sum*10+c-'0';
      c=getchar();
    }
  return sum;
}
long long fast_pow(long long a,int b)
{
  if (b==0)
    return 1;
  if (b&1)
    return fast_pow(a*a%mod,b/2)*a%mod;
  else
    return fast_pow(a*a%mod,b/2);
}
int main()
{
  n=read(),q=read();
  for (int i=1;i<=n;++i)
    a[i]=read();
  for (int i=1;i<=n;++i)
    for (int j=i+1;j<=n;++j)
      {
	if (a[i]>a[j])
	  t[i][j]=1;
	if (a[i]<a[j])
	  T[i][j]=1;
      }
  int a,b,c,d;
  for (int i=1;i<=q;++i)
    {
      x=read(),y=read();
      if (x>y)
	swap(x,y);
      for (int j=x+1;j<=y-1;++j)
	{
	   a=t[x][j],b=T[x][j],c=t[j][y],d=T[j][y];
	   t[x][j]=T[j][y]=(a+d)%mod*fast_pow(2,mod-2)%mod;
	   T[x][j]=t[j][y]=(b+c)%mod*fast_pow(2,mod-2)%mod;
	 }
      for (int j=1;j<=x-1;++j)
	 {
	   a=t[j][x],b=T[j][x],c=t[j][y],d=T[j][y];
	   t[j][x]=t[j][y]=(a+c)%mod*fast_pow(2,mod-2)%mod;
	   T[j][x]=T[j][y]=(b+d)%mod*fast_pow(2,mod-2)%mod;
	 }
      for (int j=y+1;j<=n;++j)
	{
	  a=t[x][j],b=T[x][j],c=t[y][j],d=T[y][j];
	  t[x][j]=t[y][j]=(a+c)%mod*fast_pow(2,mod-2)%mod;
	  T[x][j]=T[y][j]=(b+d)%mod*fast_pow(2,mod-2)%mod;
	}
      a=t[x][y],b=T[x][y];
      t[x][y]=T[x][y]=(a+b)%mod*fast_pow(2,mod-2)%mod;
    }
  for (int i=1;i<=n;++i)
    for (int j=i+1;j<=n;++j)
      ans=(ans+t[i][j]*fast_pow(2,q)%mod)%mod;
  printf("%lld\n",ans);
  return 0;
}

Measured memory_bytes: 141824
#include<iostream>
#include<vector>
#include<algorithm>
#define lli long long
#define all(i) i.begin(),i.end()
#define rall(i) i.rbegin(),i.rend()
#define rep0(i,j) for(int i=0;i<j;i++)
#define rep1(i,j) for(int i=1;i<=j;i++)
#define rep0d(i,j) for(int i=j-1;i>=0;i--)
#define MAX 1000000007

using namespace std;



int main() {
    lli n,mi=1e17,min=0;
    cin >> n;
    vector<lli> vec(5,0);
    rep0(i,5){
        cin >> vec[i];
    
        if(vec[i]<mi){
            min=i;
            mi = vec[i];
        }
    }
    
    cout << ((n%vec[min])?(5+n/vec[min]):(4+n/vec[min]));
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<cassert>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define rep(i,s,n) for(int i=(s); i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))
#define print(x) printf("%d\n",x)

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const int _dx[] = {0,1,0,-1};
const int _dy[] = {-1,0,1,0};

int getInt(){
  int ret = 0,c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

int memo[20][20];
bool f[20][20];

int main(){
  while(true){
    int w = getInt();
    int h = getInt();

    if(w + h == 0) break;

    int n = getInt();

    REP(i,h) REP(j,w) memo[i][j] = 0;
    REP(i,h) REP(j,w) f[i][j] = true;
    
    REP(i,n){
      int x = getInt() - 1;
      int y = getInt() - 1;

      f[y][x] = false;
    }

    memo[0][0] = 1;
    REP(i,h) REP(j,w) if(f[i][j]){
      int tmp = 0;
      if(i != h - 1) memo[i+1][j] += memo[i][j];
      if(j != w - 1) memo[i][j+1] += memo[i][j];
    }

    print(memo[h-1][w-1]);
  }

  return 0;
}

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

int main() {
	string s;
	cin >> s;
	char ans[100];
	int i = 0;
	for (; i < s.length(); i++) ans[i] = 'x';
	ans[i++] = '\0';
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>

using namespace std;

bool less_strnum(const string &a, const string &b)
{
	if (a.length() < b.length()) {
		return true;
	}
	if (b.length() < a.length()) {
		return false;
	}
	return a < b;
}

struct greater_strnum
{
	bool operator()(const string &a, const string &b) const
	{
		return less_strnum(b, a);
	}
};

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

	vector<int> A(M);
	for (auto &x : A) {
		cin >> x;
	}

	const vector<int> v = { 0, 2, 5, 5, 4, 5, 6, 3, 7, 6 };


	vector<string> dp(N + 1);

	dp[0] = "*";

	for (int i = 0; i < N; ++i) {
		if (dp[i].empty()) {
			continue;
		}
		if (dp[i] == "*") {
			dp[i] = "";
		}
		for (int x : A) if (i + v[x] <= N) {
			
			string t = dp[i];
			t += ('0' + x);
			sort(t.rbegin(), t.rend());
			auto &u = dp[i + v[x]];

			if (less_strnum(u, t)) {
				int vx = v[x];
				u = t;
			}
		}
	}

	cout << dp[N] << endl;
}


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

import sys

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

S=input()

if S.count('x')>=8:
    NO()
else:
    YES()


Measured memory_bytes: 3064
#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 fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

const long long mod = 1000000007;
const long long inf = 1e18;

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n;
    cin>>n;
    vi v;
    for(int i=0;i<n;i++){
        int k;
        cin>>k;
        v.pb(k);
    }
    sort(v.begin(),v.end());
    v.pb(-1);
    int ans=0;
    int count=1;
    int t=v[0];
    for(int i=1;i<=n;i++){
        if(v[i]!=t){
            if(count<t){
                ans+=count;
                count=1;
                t=v[i];
            }
            else if(count>t){
                ans=ans+count-t;
                count=1;
                t=v[i];
            }
            else{
                t=v[i];
                count=1;
            }
        }
        else{
            count+=1;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 892
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.TreeSet;
import java.io.InputStream;

/**
 * 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;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = in.nextIntArray(n);

            TreeSet<Integer> set = new TreeSet<>();
            set.add(1);
            int now = 1;
            for (int i = 0; i < n; i++) {
                now = a[now - 1];
                if (now == 2) {
                    out.println(set.size());
                    return;
                } else if (set.contains(now)) {
                    out.println(-1);
                    return;
                }
                set.add(now);
            }
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tok;

        public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

        public int[] nextIntArray(int n) {
            int[] res = new int[n];
            for (int i = 0; i < n; i++) {
                res[i] = nextInt();
            }
            return res;
        }

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        }

    }
}



Measured memory_bytes: 44804
#include<bits/stdc++.h>
using namespace std;
#define me(a,x) memset(a,x,sizeof(a))
#define sc scanf
#define pr printf
#define IN freopen("in.txt","r",stdin);
#define OUT freopen("out.txt","w",stdout);
typedef long long ll;
typedef unsigned long long ull;
const int N=1e6+6;
const int mod=1e9+7;
template<typename T>int O(T s){cout<<s<<endl;return 0;}
template<typename T>void db(T *bg,T *ed){while(bg!=ed)cout<<*bg++<<' ';pr("\n");}
template<typename T>void db(vector<T>it){for(auto i:it)cout<<i<<' ';pr("\n");}
inline ll mul_64(ll x,ll y,ll c){return (x*y-(ll)((long double)x/c*y)*c+c)%c;}
inline ll ksm(ll a,ll b,ll c){ll ans=1;for(;b;b>>=1,a=a*a%c)if(b&1)ans=ans*a%c;return ans;}
inline void exgcd(ll a,ll b,ll &x,ll &y){if(!b)x=1,y=0;else exgcd(b,a%b,y,x),y-=(a/b)*x;}
int main(){
    int L;cin>>L;
    double x=1.0*L/3;
    pr("%f\n",x*x*x);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<vector>
#include<string.h>
#include<math.h>
#include<queue>
#include<cstring>
#include<new>
#include<cmath>
#include<sstream>
#define fo(i,w,n) for(int i=(int) w;i<(int) n;i++)
#define qi queue<int>
#define vi vector<int>
#define ll long long
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define pii pair<int,int>
#define mp make_pair
#define sz size()
#define em empty()
#define all(a) (a).begin(),(a).end()
#define fi first
#define se second
#define sett(a,b) memset(a,b,sizeof(a))
#define copy(a,b) memcpy(a,b,sizeof(a))
using namespace std;
int n,m,q,u,v,ans[101010];
vi ed[101010];
int p[101010],dist[101010],c[101010],mindis[101010];
void dfs(int x,int y,int color){
	if(y<=mindis[x])return;
	mindis[x]=y;
	if(ans[x]==0)ans[x]=color;
	fo(i,0,ed[x].sz)dfs(ed[x][i],y-1,color);
}
int main(){
	cin>>n>>m;
	fo(i,0,n)mindis[i]=-1;
	fo(i,0,m){
		cin>>u>>v;
		--u;--v;
		ed[u].pb(v);
		ed[v].pb(u);
	}
	cin>>q;
	fo(i,0,q)cin>>p[i]>>dist[i]>>c[i];
	for(int i=q-1;i>=0;i--)dfs(p[i]-1,dist[i],c[i]);
	fo(i,0,n)cout<<ans[i]<<endl;
	return 0;
}

Measured memory_bytes: 8440
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

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

const ll INF=1e9+7;

int main()
{
    double r;
    cin >> r;
    double x=3.14159265;
    cout << fixed << setprecision(30);
    cout << 2*r*x << endl;
    return 0;
} 

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

#define f(i,a,b) for( ll  i = a; i < (ll) b ; i++ ) 
#define af(i,a,b) for( ll i = a; i >= b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define inter   ios::sync_with_stdio(false);cin.tie(0)

// policy-based



using namespace std;


typedef long long ll; // int or long long
typedef long double ld;
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;



 
const ll MAX = 1e6+1;
const ll inf = 1e9;
const ll mod = 998244353;

ll d[MAX];

int main(){
	fastio;
	f(i,1,MAX){
		rep(j,i,MAX,i) d[j]++;
	}
	ll ans = 0,n;
	d[0] = 1;
	cin >> n;
	f(i,1,n) ans += d[i];
	cout << ans << endl;
	return 0;
} 

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

//const long double PIL = 3.141592653589793238462643383279502884L;
//const double PI = 3.14159265358979323846;

#define sz(a) int((a).size())
#define all(c) (c).begin(), (c).end()
#define debug(v) {for (auto z : v) {cerr << z << ' ';} cerr << endl;}

using ll = long long;
using ii = pair<int,int>;
using vi = vector<int>;
using vll = vector<long long>;
using vii = vector<pair<int,int>>;

int main() {
	//~ ios::sync_with_stdio(0);
	//~ cin.tie(0);
	//~ cout.tie(0);
	int n, m;
	cin >> n >> m;
	cout << (m == n? "Yes" : "No") << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <set>
#include <map>
#include <cassert>
#include <cstring>
#include <cstdio>
#include <cstdlib>
using namespace std;

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

	int a, b, c;
	cin >> a >> b >> c;
	int x = min(a, min(b, c));
	int z = max(a, max(b, c));
	int y = a + b + c - x - z;

	int ans = z - y;
	ans += (y - x) / 2;
	if ((y-x) % 2) ans += 2;
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl '\n'
#define int long long
#define lint long long
#define pii pair<int,int>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define SZ(v) ((int)v.size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MINF(a) memset(a,0x3f,sizeof(a))
#define POW(n) (1LL<<(n))
#define POPCNT(n) (__builtin_popcount(n))
#define IN(i,a,b) (a <= i && i <= b)
using namespace std;
template <typename T> inline bool CHMIN(T& a,T b) { if(a>b) { a=b; return 1; } return 0; }
template <typename T> inline bool CHMAX(T& a,T b) { if(a<b) { a=b; return 1; } return 0; }
template <typename T> inline void SORT(T& a) { sort(ALL(a)); }
template <typename T> inline void REV(T& a) { reverse(ALL(a)); }
template <typename T> inline void UNI(T& a) { sort(ALL(a)); a.erase(unique(ALL(a)),a.end()); }
template <typename T> inline T LB(vector<T>& v, T a) { return *lower_bound(ALL(v),a); }
template <typename T> inline int LBP(vector<T>& v, T a) { return lower_bound(ALL(v),a) - v.begin(); }
template <typename T> inline T UB(vector<T>& v, T a) { return *upper_bound(ALL(v),a); }
template <typename T> inline int UBP(vector<T>& v, T a) { return upper_bound(ALL(v),a) - v.begin(); }
template <typename T1, typename T2> ostream& operator<< (ostream& os, const pair<T1,T2>& p) { os << p.first << " " << p.second; return os; }
template <typename T1, typename T2> istream& operator>> (istream& is, pair<T1,T2>& p) { is >> p.first >> p.second; return is; }
template <typename T> ostream& operator<< (ostream& os, const vector<T>& v) { REP(i,v.size()) { if (i) os << " "; os << v[i]; } return os; }
template <typename T> istream& operator>> (istream& is, vector<T>& v) { for(T& in : v) is >> in; return is; }
template <typename T = int> vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }
template <typename T, typename V> typename enable_if<is_class<T>::value == 0>::type fill_v(T &t, const V &v) { t = v; }
template <typename T, typename V> typename enable_if<is_class<T>::value != 0>::type fill_v(T &t, const V &v) { for(auto &e : t) fill_v(e,v); }
const lint MOD = 1000000007;
const lint INF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-10;


void _main() {
    int N;
    cin >> N;
    vector<int> d(N);
    cin >> d;
    int ans = 0;
    REP(i, N) {
        FOR(j, i + 1, N) {
            ans += d[i] * d[j];
        }
    }    
    cout << ans << endl;
}

signed main(signed argc, char **argv) {
    if (argc > 1) {
        if (strchr(argv[1], 'i'))
            freopen("input.txt", "r", stdin);
        if (strchr(argv[1], 'o'))
            freopen("output.txt", "w", stdout);
    }
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    _main();
    return 0;
}

Measured memory_bytes: 256
from collections import Counter

h, w, n = map(int, input().split())
dots = [list(map(int, input().split())) for _ in range(n)]

c = Counter()

for dot in dots:
	for i in range(-2, 1):
		for j in range(-2, 1):
			if 1 <= dot[0] + i < h - 1 and 1 <= dot[1] + j < w - 1:
				c[(dot[0] + i) * w + dot[1] + j] += 1

#print(c)
ans = [0] * 10

for v in c.values():
	ans[v] += 1

ans[0] = (h - 2) * (w - 2) - sum(ans[1:])

for a in ans:
	print(a)

Measured memory_bytes: 125608
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <queue>

#pragma warning( disable: 4996 )

using namespace std;

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

#define INF 100000000
#define EPS 1e-9


ll N;


int main(){

	cin >> N;

	ll ans = 1;
	ll tmp = 3;

	while (tmp < N){
		ans++;
		tmp *= 3;
	}

	cout << ans << endl;

	return 0;

}

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

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める

#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)

#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

int main(void)
{
    int n,x, cnt=0;
    cin>>n>>x;
    vector<int> a(n);
    while(!(0==n&&0==x)) {
        FOR(i,1,n-2) {
            FOR(j,i+1,n-1) {
                FOR(k,j+1,n) if(x==i+j+k) cnt++;
            }
        }
        cin>>n>>x;
        cout<<cnt<<endl;
        cnt=0;
    }
}



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

typedef long long ll;
#define rep(i, n) for (int i = 2; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))

bool is_prime(int a){
  int b = sqrt(a) + 1;
  rep(i, b){
    if(a%i == 0) return false;
  }
  return true;
}

int main(){
  int X;
  cin >> X;
  for(int i = 0;;i++){
    if(is_prime(X+i)){
      cout << X + i <<endl;
      break;
    }
  }
}
  

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var n, a, b, c, d, e int
	result := 0
	fmt.Scanf("%d", &n)
	fmt.Scanf("%d", &a)
	fmt.Scanf("%d", &b)
	fmt.Scanf("%d", &c)
	fmt.Scanf("%d", &d)
	fmt.Scanf("%d", &e)
  	basic := a
	canTrasnportNum := &[5]int{a, b, c, d, e}
	for _, current := range canTrasnportNum {
		if current < basic {
			basic = current
		}
	}
    if basic >= n {
		result = 5
    }else{
  	  result = len(canTrasnportNum)
      if (n - basic) < basic  {
        result = result + 1
      }else{
        result = result + (n - basic) / basic
        if (n-basic)%basic != 0 {
          result = result + 1
      	}	
      }
    }
    fmt.Printf("%d", result)
}


Measured memory_bytes: 512
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)){
			int n = scanner.nextInt();
			int loopCnt = 0;
			List<Integer> list = new ArrayList<>();
			while(loopCnt < n){
				list.add(scanner.nextInt());
				loopCnt++;
			}
			Collections.reverse(list);
			System.out.println(list.stream().map(a->""+a).reduce((a,b)->a+" "+b).get());
		}
	}
}

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

#define ll long long
#define ff first
#define ss second
#define pb push_back
#define rep(i,a,b) for(i=a;i<b;i++)
#define pii pair<ll , ll>
#define all(x) x.begin(),x.end()
#define nl "\n"
#define ump unordered_map
#define mtv(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)

vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out( 
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx, 
__attribute__ ((unused)) int LINE_NUM) { cout << endl; } 
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    stringstream ss; ss << H;
    cout << args[idx] << "- " << ss.str() << ", ";
    debug_out(args, idx + 1, LINE_NUM, T...);
}


void doit(){
	ll n, i, k, ans = 1e18;
	cin >> k >> n;
	vector< ll >v(n);
	for(i = 0; i < n; i++)cin>>v[i];
	rep(i,0,n){
		ll i1 = i - 1,i2 = i + 1;
		if(i1 < 0)i1 = n - 1;
		if(i2 == n)i2 = 0;
		ll d1,d2;
		if(v[i1] > v[i])d1 = v[i1] - v[i];
		else d1 = k - (v[i] - v[i1]);
		if(v[i2] < v[i])d2 = v[i] - v[i2];
		else d2 = k - (v[i2] - v[i]);
		// mtv(i,d1,d2);
		ans = min({ans , d1, d2});
	}
	cout << ans << nl;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("input1.txt","r",stdin);
    freopen("output1.txt","w",stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t = 1;
    // cin >> t;
    for(ll i = 1; i <= t; i++){
        doit();
    }
}


Measured memory_bytes: 4780
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll a[100];
ll c(ll a, ll b){
    ll ans=1, i;
    for(i=1;i<=b;i++)
    {
        ans*=a-i+1;
        ans /=i;
    }
    return ans;
}
int main(){
	long long n, p, ans1=0, ans2=0, ans;
	cin>>n>>p;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		if(a[i]%2 == 1) ans1++;
		else ans2++;
	}
	//cout<<ans2<<ans1<<endl;
	ans = 0;
	if(p == 1){
		for(int i=1;i<=ans1;i+=2){
			ans += c(ans1, i);
		}
		cout<<ans*(1LL<<ans2)<<endl;
	}
	else{
		for(int i=0;i<=ans1;i+=2){
			ans += c(ans1, i);
		}
		//cout<<ans<<endl;
		cout<<ans*((1LL<<ans2))<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int main() {
    long long x,a,b;
    cin>>x;
    for(b=-63;;b++){
        a=pow(b*b*b*b*b+x,0.2);
        if(a*a*a*a*a-b*b*b*b*b==x){
            cout<<a<<" "<<b;
            break;
        }
    }
    
	return 0;
}

Measured memory_bytes: 4112
#include <bits/stdc++.h>
using namespace std;
 
#define all(v) v.begin(), v.end()
#define rep(i, n) REP(i, 0, n)
#define REP(i, x, n) for (int i = x; i < n; i++)
#define REPE(i, x, n) for (int i = x; i <= n; i++)
#define OP(x) cout << x << endl;
template<typename T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<class T> void chmax(T& a, T b) { if(a > b) a = b; }
template<class T> void chmin(T& a, T b) { if(a < b) b = a; }
typedef long long ll;
 
int main() {
    int d, n; cin >> d >> n;
    int s = 0;
    if(n < 100){
        s = pow(100, d) * n;
    }else{
        s = pow(100, d) * 101;
    }
    cout << s << endl;
}
 

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

#define ll long long

#define rep(i, n) for (int i = 0; i < (int)(n); i++)  //(i, 10) i=0～i=9まで
#define repr(i, n) for (int i = n; i >= 0; i--)   // (i, 10) i=10～i=0まで
#define FOR(i, m, n) for (int i = m; i < n; i++)  // (i, 3, 10) i=3～i=9まで

int main() {
    int i = 0;

    while (true) {
        int x;
        cin >> x;
        if (x == 0) break;
        cout << "Case " << ++i << ": " << x << "\n";
    }
    return 0;
}



Measured memory_bytes: 3016
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
const int Maxn = 200010;
struct lnode {
	int x, id;
	bool operator<(const lnode &A) const { return x < A.x; }
}list[Maxn];
int n;
int ans[Maxn];
int main() {
	int i, j, k;
	scanf("%d", &n);
	for(i = 1; i <= n; i++) scanf("%d", &list[i].x), list[i].id = i;
	sort(list+1, list+n+1);
	for(i = 1; i <= n/2; i++) ans[list[i].id] = list[n/2+1].x;
	for(i = n/2+1; i <= n; i++) ans[list[i].id] = list[n/2].x;
	for(i = 1; i <= n; i++) printf("%d\n", ans[i]);
	return 0;
}

Measured memory_bytes: 4480
n = int(input())
h = list(map(int, input().split()))
MAX = 0

step = 0
for i in range(n-1):
    if h[i]-h[i+1]>=0:
        step += 1
    else:
        MAX = max(MAX, step)
        step = 0
MAX = max(MAX, step)
print(MAX)

Measured memory_bytes: 20444
#include <bits/stdc++.h>
#define REP(i, a, b) for (int i = a; i <= b; ++i)
#define PER(i, a, b) for (int i = a; i >= b; --i)
#define RVC(i, S) for (int i = 0; i < S.size(); ++i)
#define mp make_pair
#define pb push_back
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define fi first
#define se second
using namespace std;
 
typedef long long LL;
typedef pair<int, int> pii;
typedef vector<int> VI;

const int N = 200005;
int r, c, n, tot;

struct Point{
	pii p;
	int w;
} pts[N];

int on_line(int x, int y){
	return x == 0 || x == r || y == 0 || y == c;
}

int eval(pii p){
	if (p.se == 0) return 0;
	if (p.fi == r) return 1;
	if (p.se == c) return 2;
	return 3;
}

int cmp(pii p, pii q){
	if (eval(p) != eval(q)) return eval(p) < eval(q);
	if (eval(p) == 0) return p.fi < q.fi;
	if (eval(p) == 1) return p.se < q.se;
	if (eval(p) == 2) return p.fi > q.fi;
	return p.se > q.se;
}

int cmq(Point p, Point q){
	return cmp(p.p, q.p);
}

int stk[N], tp;

int main(){
	cin >> r >> c >> n;
	REP(i, 1, n){
		int xa, ya, xb, yb;
		cin >> xa >> ya >> xb >> yb;
		if (on_line(xa, ya) && on_line(xb, yb)){
			pii p = mp(xa, ya), q = mp(xb, yb);
			if (!cmp(p, q)) swap(p, q);
			pts[++tot] = (Point){p, i};
			pts[++tot] = (Point){q, -i};
		}
	}
	sort(pts + 1, pts + tot + 1, cmq);
	// REP(i, 1, tot) debug("(%d, %d) , %d\n", pts[i].p.fi, pts[i].p.se, pts[i].w);
	// cerr << eval(pts[2].p) << ' ' << eval(pts[3].p) << endl;
	// debug("cmp = %d\n", cmq(pts[2], pts[3]));
	for (int sum = 0, i = 1; i <= tot; ++i){
		if (pts[i].w < 0){
			if (stk[tp] + pts[i].w != 0) return puts("NO"), 0;
			--tp;
		}
		else stk[++tp] = pts[i].w;
	}
	puts("YES");
	return 0;
}

Measured memory_bytes: 2816
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main ()
{
	int n;
	scanf("%i",&n);
	char s1[n+1],s2[n+1];
	scanf("%s%s",&s1,&s2);
	char s3[2*n+1];
	int j=0;
	for(int i=0;i<2*n+1;i+=2)
	{
		s3[i]=s1[j];
		s3[i+1]=s2[j];
		j++;
	}
	printf("%s",s3);
	return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define pb push_back
#define f(i,n) for(int i=0; i<n; ++i)
#define fi(i,st,n) for(int i=st; i<=n; ++i)
#define veci vector<int>
#define vecp vector<pair<int,int> >
#define vecl vector<ll>
int prime[100000+10];

ll lcm(ll a, ll b) {
	return a*b/__gcd(a,b);
}

ll power(ll a, ll n, ll mod) {
	ll res = 1;
	while(n > 0) {
		if(n&1) {
			res = (res*a)%mod;
		}
		a = (a*a)%mod;
		n = n/2;
	}
	return res;
}

ll sum(int arr[], int n) {
	ll res = 0;
	f(i,n) {
		res += arr[i];
	}
	return res;
}

void seive() {
	prime[1] = 0;
	for(int i=2; i<=100000; i++) {
		prime[i] = 1;
	}
	for(ll i=2; i<=100000; i++) {
		if(prime[i]) {
			for(ll j=i*i; j<=100000; j+=i) {
				prime[j] = 0;
			}
		}
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t = 1;
//	cin>>t;
	while(t--){
		int n,k;
		cin>>n>>k;
		int arr[n];
		f(i,n) cin>>arr[i];
		for(int i=k; i<n; i++) {
			if(arr[i] > arr[i-k]) cout<<"Yes\n";
			else cout<<"No\n";
		}
 	}
 	return 0;
}


Measured memory_bytes: 4440
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(1e5 + 5);
const double EPS = 1e-8;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define ALL(v) (v).begin(), (v).end()

int main() {
    int n, k, h[MAX_N], ans = IINF;
    cin >> n >> k;
    REP(i,n){
        cin >> h[i];
    }
    sort(h,h+n);
    REP(i,n-k+1){
        ans = min(ans, h[i+k-1]-h[i]);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 640
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <unordered_map>
#include <climits>
#include <set>
#include <unordered_set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <complex>
#include <regex>

using namespace std;

#define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOW_MAP(v){std::cerr << #v << endl; for(const auto& xxx: v){std::cerr << xxx.first << " " << xxx.second << "\n";}}

int main() {

    long long H, W;
    cin >> H >> W;

    long long ans = LONG_LONG_MAX;

    {
        if (H >= 3) {
            vector<long long> h(3);
            for (int i = 0; i < 3; i++) h[i] = H / 3;
            for (int i = 0; i < H % 3; i++) h[i]++;
            long long maxV = *max_element(h.begin(), h.end());
            long long minV = *min_element(h.begin(), h.end());
            ans = min(ans, (maxV - minV) * W);
        }
    }

    {
        for (long long i = 1; i < W; i++) {
            long long h1 = H / 2;
            long long h2 = H / 2;
            if (H % 2) h1++;
            long long area1 = H * i;
            long long area2 = h1 * (W - i);
            long long area3 = h2 * (W - i);
            long long d = max({area1, area2, area3}) - min({area1, area2, area3});
            ans = min(ans, d);
        }
    }

    swap(H, W);
    {
        if (H >= 3) {
            vector<long long> h(3);
            for (int i = 0; i < 3; i++) h[i] = H / 3;
            for (int i = 0; i < H % 3; i++) h[i]++;
            long long maxV = *max_element(h.begin(), h.end());
            long long minV = *min_element(h.begin(), h.end());
            ans = min(ans, (maxV - minV) * W);
        }
    }

    {
        for (long long i = 1; i < W; i++) {
            long long h1 = H / 2;
            long long h2 = H / 2;
            if (H % 2) h1++;
            long long area1 = H * i;
            long long area2 = h1 * (W - i);
            long long area3 = h2 * (W - i);
            long long d = max({area1, area2, area3}) - min({area1, area2, area3});
            ans = min(ans, d);
        }
    }

    cout << ans << endl;

}















































Measured memory_bytes: 256
#include <iostream>
using namespace std;
 
int main() {
    int A, B, C, D;
    cin >> A >> B >> C >> D;

    if (A + B > C + D){
      cout << "Left" << endl;
    } else if (A + B < C + D) {
      cout << "Right" << endl;
    } else {
      cout << "Balanced" << endl;
    }
}

Measured memory_bytes: 256