akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cstdio>

using namespace std;

const int MAXN = 2e5 + 10;

int k, n;
int a[MAXN];

int main(void) {
  scanf("%d%d", &k, &n);
  for (int i = 0; i < n; ++i)
    scanf("%d", &a[i]);

  int sol = k - a[0] - (k - a[n - 1]);
  for (int i = 1; i < n; ++i)
    sol = min(sol, k - (a[i] - a[i - 1]));

  printf("%d\n", sol);
  return 0;
}


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

using namespace std;

//#define FILE_IO

int ask(int x, int y)
{
    printf("? %d %d\n", x - 1, y - 1); fflush(stdout);
    string s; cin >> s;
    return (s[0] == 'Y');
}

int main()
{
    #ifdef FILE_IO
    freopen("1.in", "r", stdin);
    freopen("1.out", "w", stdout);
    #endif

    int H, U;
    scanf("%d%d", &H, &U);

    if(H <= U)
    {
        printf("Impossible\n"); fflush(stdout);
        exit(0);
    }

    int N = H + U;
    stack<int> stv;
    for(int i = 1; i <= N; i++)
    {
        if(stv.empty()) { stv.push(i); continue; }
        int x = stv.top();
        int ans = ask(x, i);
        if(!ans) stv.pop();
        else    stv.push(i);
    }

    int man = stv.top();
    bitset<4005> ans;

    for(int i = 1; i <= N; i++)
        ans[i] = ask(man, i);

    printf("! ");
    for(int i = 1; i <= N; i++)
        printf("%d", (int)ans[i]);
    printf("\n");
    fflush(stdout);
    return 0;
}


Measured memory_bytes: 724
n,l = map(int,input().split())
 
s=0

if l>=0:
    for val in range(n-1):
        s += val+l+1
        


elif l < 0 and n > -l:
    for val in range(n):
        s += val + l
        
else:
    for val in range(n-1):
        s += val + l



print(s)

Measured memory_bytes: 2940
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void){
  int H, A;
  scanf("%d %d", &H, &A);

  if(H%A == 0)
    printf("%d\n", H/A);
  else
    printf("%d\n", H/A + 1);
  
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
typedef long long int64;

int main() {
    int N, M;
    cin >> N >> M;
    vector<vector<int>> G(N);
    for(int i = 0; i < M; ++i) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        G[a].emplace_back(b);
    }
    int s, t;
    cin >> s >> t;
    --s, --t;
    auto bfs = [&]() {
        vector<vector<int>> dist(N, vector<int>(3, -1));
        queue<pair<int, int>> que;
        dist[s][0] = 0;
        que.emplace(s, 0);
        while(!que.empty()) {
            auto p = que.front();
            que.pop();
            int cur = p.first;
            int nx = (p.second + 1) % 3;
            for(auto &to : G[cur]) {
                if(dist[to][nx] == -1) {
                    dist[to][nx] = dist[cur][p.second] + 1;
                    que.emplace(to, nx);
                }
            }
        }
        return dist;
    };

    auto dist = bfs();
    if(dist[t][0] % 3) cout << -1 << '\n';
    else cout << (dist[t][0] + 2) / 3 << '\n';
    return 0;
}


Measured memory_bytes: 11136
A = [0] * 3

for i in range(3):
    A[i] = list(map(int, input().split()))

N = int(input())

b = [0] * N

for i in range(N):
    b[i] = int(input())

x = [[0,0,0],[0,0,0],[0,0,0]]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if A[j][k] == b[i]:
                x[j][k] = 1

ans = False

for i in range(3):
    if x[i] == [1,1,1]:
        ans = True
    
for i in range(3):
    if x[0][i] == 1 and x[1][i] == 1 and x[2][i] == 1:
        ans = True

if x[0][0] == 1 and x[1][1] == 1 and x[2][2] == 1:
    ans = True

if x[0][2] == 1 and x[1][1] == 1 and x[2][0] == 1:
    ans = True

if ans:
    print('Yes')
else:
    print('No')

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

int main(){
  char s[50];
  int n, k;
  
  cin >> n >> k >> s;
  if(s[k-1]=='A')
  s[k-1] = 'a';
  if(s[k-1]=='B')
  s[k-1] = 'b';
  if(s[k-1]=='C')
  s[k-1] = 'c';
  
  cout << s;
return 0;
}

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

using namespace std;

int main(int argc, char const* argv[])
{
	string str;

	while( getline( cin, str ) ){
		for( int i = 0;i < 26;i++ ){
			for( int j = 0;j < str.size();j++ ){
				if( str[j] >= 'a' && str[j] <= 'y' ) str[j]++;
				else if( str[j] == 'z' ) str[j] = 'a';
			}
			if( str.find( "the" ) != string::npos || str.find( "this" ) != string::npos || str.find( "that" )  != string::npos ) {cout << str << endl; break;}
		}
	}
	return 0;
}

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

def main():

    S = [int(x) for x in str(input())]

    ans = 'Good'

    for i in range(len(S) - 1):
        if S[i] == S[i + 1]:
            ans = 'Bad'
            break

    print(ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 9160
/*
*/

//#pragma comment(linker, "/STACK:16777216")
#define _CRT_SECURE_NO_WARNINGS

#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>
#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk
#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define have adsgagshdshfhds

#define eps 1e-9
#define M_PI 3.141592653589793
#define bs 1000000007
#define bsize 350

using namespace std;

const int INF = 1e9;
const int N = 600031;

int n;
string st1, st2;

bool ok(string a, string b, int len)
{
	for (int i = 0; i < len; i++)
	{
		if (a[a.size() - len + i] != b[i])
			return false;
	}
	return true;
}

int overlap(string a, string b)
{
	for (int i = n; i>=0; --i)
	{
		if (ok(a, b, i))
			return i;
	}
	return 0;
}

int main(){
	//freopen("fabro.in","r",stdin);
	//freopen("fabro.out","w",stdout);
	//freopen("F:/in.txt", "r", stdin);
	//freopen("F:/output.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
	//cin.tie(0);

	cin >> n;
	cin >> st1;
	cin >> st2;

	int res = overlap(st1, st2);

	cout << n * 2 - res << endl;

	cin.get(); cin.get();
	return 0;
}

Measured memory_bytes: 256
def grade(m, f, r):
    if m == -1 or f == -1:
        return 'F'
    s = m + f
    if s >= 80:
        return 'A'
    if s >= 65:
        return 'B'
    if s >= 50:
        return 'C'
    if s >= 30:
        if r >= 50:
            return 'C'
        else:
            return 'D'
    return 'F'

while True:
    m, f, r = map(int, input().split())
    if m == f == r == -1:
        break
    print(grade(m, f, r))

Measured memory_bytes: 7684
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#include<stdlib.h>
#include<stdio.h>
#define test ll t; cin>>t; while(t--)
#define FOR(p,n) for(ll i=p;i<(ll)n;i++)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define ll long long
#define int long long
#define ull unsigned long long
#define MAX 1000005
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define endl '\n'
#define vs vector<string>
#define mii map<int,int>
#define msi map<string,int>
#define vpii vector< pair<int, int > >
#define vpsi vector< pair< string ,int > >
#define forci(p,q) for(int i=p;i<q;i++)
ll gcd(ll a,ll b){ if(b==0) return a;    return gcd(b,a%b);}
ll lcm(ll a,ll b) { return (a/gcd(a,b)*b);}
ull power(ull a, ull b) {a %= mod;  ull res = 1;  while (b > 0) { if (b & 1) res = res * a % mod;  a = a * a % mod;  b >>= 1; }  return res%mod; }
ll modmul(ll x, ll y){return (x*y)%mod;}
ll modadd(ll x, ll y){return (x+y)%mod;}
ll modsub(ll x, ll y){return (x-y+mod)%mod;}
ll fact[1000007]={0};
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<100007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[r],mod-2)))%mod; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
inline long long toint(const std::string &s) {std::stringstream ss; ss << s; long long x; ss >> x; return x;}
inline std::string tostring(long long number) {std::stringstream ss; ss << number; return ss.str();}
inline std::string tobin(long long x) {return std::bitset<63>(x).to_string();}
/*bool prime[MAX];
ull sieve(){memset(prime,true,sizeof(prime));for(ull p=2;p*p<MAX;p++){if(prime[p]==true){for(ull i=2*p;i<MAX;i+=p){prime[i]=false;}}}prime[0]=0;prime[1]=0;
}
int inv[1000001]={0};
void findinverse(){inv[1] = 1;for(int i = 2; i <=1e6 ; ++i)	inv[i] = (mod - (mod/i) * inv[mod%i] % mod) % mod;}
*/
using namespace std;
int solve()
{
	int a,b;
	cin>>a>>b;
	if(a>9 || b>9)
		cout<<"-1"<<endl;
	else
		cout<<a*b;
	


}
signed main()
{
	fastio;
//	test
		solve();
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int main(void){
	int a;
	while(cin>>a){
		if(a==-1)break;
		double q = (double)a;
		double x = q/2;
		while(abs(x*x*x-q)>=0.00001*q){
			double nx = x-(x*x*x-q)/(3*x*x);
			x = nx;
		}
		printf("%.6lf\n",x);
	}
	return 0;
}

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

int main(){
  int n, a, b;
  string s;
  cin >> n >> a >> b >> s;
  int kakutei = 0;
  int kaigai = 0;
  for(int i = 0; i < n; i++){
    if(s[i] == 'a'){
      if(kakutei < (a + b)){
        cout << "Yes" << endl;
        kakutei++;
      }else{
        cout << "No" << endl;
      }
    }else if(s[i] == 'b'){
      if((kakutei < (a + b)) && (kaigai < b)){
        cout << "Yes" << endl;
        kakutei++;
        kaigai++;
      }else{
        cout << "No" << endl;
      }
    }else{
      cout << "No" << endl;
    }
  }
} 

Measured memory_bytes: 896
N=int(input())
A=[]
B=[]
for i in range(N):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
A.sort()
B.sort()
if N%2==1:
    print(B[N//2]-A[N//2]+1)
else:
    A_chu=(A[N//2-1]+A[N//2])/2
    B_chu=(B[N//2-1]+B[N//2])/2
    ans=(B_chu-A_chu)*2+1
    print(int(ans))

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

int main() {
    int N; cin >> N;
    int64_t ans = 0;
    for(int i = 1; i <= N; ++i) {
        if(i % 3 == 0 || i % 5 == 0) continue;
        ans += i;
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 3636
using System;
using System.Collections.Generic;

using System.Text;


namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] s = Console.ReadLine().Split(' ');

            int a = int.Parse(s[0]);
            int b = int.Parse(s[1]);
            int c = int.Parse(s[2]);

            int n =0;
            for (int x = a; x <= b; x++)
            {
                if (c % x == 0)
                { n++; }



            }
            Console.WriteLine(n);





        }
    }
}    

Measured memory_bytes: 17896
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i=a; i<n; i++)
#define RREP(i, a, n) for(ll i=n-1; i>=a; i--)
typedef long long ll;
const ll mod =1e9+7;
const ll inf =1e18;
using namespace std;

ll n, k;
string s;
int main() {
    cin>>n>>k>>s;
    if(s[k-1]>='A' && s[k-1]<='Z'){
        s[k-1]='a'+(s[k-1]-'A');
    }
    cout<<s<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>
#include <set>
#include <queue>
#include <map>
#include <vector>
using namespace std;
const int maxn=1e5+5;
int main()
{
	int n;
	while(cin>>n)
	{
		if(n%10==0)
		{
			printf("10\n");
			
		}
		else 
		{
			int ans=0;
			while(n)
			{
				ans+=n%10;
				n/=10;
			}
			printf("%d\n",ans);
			
		}
	}
	return 0;
 } 

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mp(a,b) make_pair((a),(b))
#define pii pair<int,int>
//#define pdd pair<double,double>
#define pll pair<LL,LL>
#define pb(x) push_back(x)
#define x first
#define y second
#define sqr(x) ((x)*(x))
#define EPS 1e-6
#define mii map<int,int>
#define MEM(x) memset(x,0,sizeof(x))
#define MEMS(x) memset(x,-1,sizeof(x))
#define pi 3.14159265359
//#define INF 0x7fffffff
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
using namespace std;
typedef long long LL;
map<int,int> m;
int main(){
	char c[200005];
	scanf("%s",c+1);
	int dp[200005];
	dp[0]=0;
	m[0]=0;
	int now=0;
	for(int i=1;c[i]!=0;i++){
		now=now^(1<<(c[i]-'a'));
		int Min=1e9;
		if(m.find(now)!=m.end())
		Min=m[now]; 
		for(int j=0;j<26;j++){
			int k=now^(1<<j);
			if(m.find(k)!=m.end())
			Min=min(m[k],Min);
		}
		dp[i]=Min+1;
		if(m.find(now)==m.end())
		m[now]=Min+1;
		else
		m[now]=min(m[now],Min+1);
	//	printf("%d\n",dp[i]);
	}
	printf("%d\n",dp[strlen(c+1)]);
} 





Measured memory_bytes: 10624
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 
using vs = vector<string>;
using vvs = vector<vs>; 
using vc = vector<char>;
using vvc = vector<vc>; 
using vb = vector<bool>;
using vvb = vector<vb>; 

#define rep(i,n) ;for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define f(i,a,b) for(int i=a;i<b;i++)
#define pri(a)  printf("%.14lf\n",a);
#define MOD 1000000007
bool is_int_lround(double x){
  return std::lround(x)==x;
}
ll keta(ll x){
  ll n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}

ll conbi(int n,int m){
  
  cin>>n>>m;
  vector<ll> a(100);
  a[0] =1;
  for(int i=0;i<14;i++){
    a[i+1]=a[i]*(i+1);
  }
  return a[n] /(a[m] *a[n-m]);
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;//繰り返し二乗法
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
ll kaijoMOD(ll x){
  ll z=1;
  if(x==0){
    return 1;
  }
  while(x>0){
    z *=x;
    z %=MOD;
    x--;
  }
  return z;
}
ll yakusu_num(ll n){
  vl yakusu(n+1,1);
  for(ll i=2;i*i<=n;i++){ 
    while(n%i==0){
      n /=i;
      yakusu[i]++;
    }
  }
  if(n!=1)yakusu[n]++;
  ll num=1;
  for(ll i=0;i<=n;i++){
    num*=yakusu[i];
  }
  return num;
}

int H,W;
vs s(50);
vi dv ={-1,0,1,0};vi du={0,-1,0,1};
int cnt=1;
int dfs(int u,int v){
  s[u][v]='.';
  
  rep(i,4){
   
      int nu =u +du[i],nv=v+dv[i];
      if(nu<0||nu>=H||nv<0||nv>=W)continue;
      if(s[nu][nv]=='.')continue;
      cnt ++;
      dfs(nu,nv);
    
  }
  return cnt;

}
int keta_wa(int x){
  int tot=0;
  while(x>0){
    tot +=x%10;
    x/=10;
  }
  return tot;
}

//vc alp ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
//vc Alp ={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
//cout<<""<<endl;
int main(){
  ll A,B,C,D;cin>>A>>B>>C>>D;
  cout<<max(A*B,C*D)<<endl;
}





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

bool check( int *counts ){
    int cp[10];
    for( int i=0; i<10; i++ )
        cp[i] = counts[i];
    for( int i=0; i<10; i++ ){
        while( cp[i] >= 3 )
            cp[i] -= 3;
        while( i+2<10 && cp[i]>0 && cp[i+1]>0 && cp[i+2]>0 ){
            cp[i]--;
            cp[i+1]--;
            cp[i+2]--;
        }
    }
    for( int i=0; i<10; i++ ){
        if( cp[i] != 0 ){
            return false;
        }
    }
    return true;
}

int main(){
    int counts[10];
    string in;
    while( cin >> in ){
        memset(counts, 0, sizeof(counts));
        for( int i=0; i<13; i++ ){
            counts[in[i]-'0']++;
        }
        
        bool end = false;
        for( int i=1; i<10; i++ ){
            if( counts[i] > 4 ){
                cout << "0" << endl;
                end = true;
            }
        }
        if(end) continue;

        bool first = true;
        for( int i=1; i<10; i++ ){
            if( counts[i] >= 4 )    continue;
            counts[i]++;
            for( int j=1; j<10; j++ ){
                if( counts[j] >= 2 ){
                    counts[j] -= 2;
                    if( check(counts) ){
                        if( first )
                            first = false;
                        else
                            cout << " ";
                        cout << i;
                        counts[j] += 2;
                        break;
                    }
                    counts[j] += 2;
                }
            }
            counts[i]--;
        }
        if(first)
            cout << "0";
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 1188
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int[] a = new int[n];

    for (int i = 0; i < n; i++) {
      a[i] = sc.nextInt();
    }

    int count = 0;

    for (int i = 0; i < n; i++) {
      while (a[i] % 2 == 0) {
        a[i] /= 2;
        count++;
      }
    }

    System.out.println(count);
    sc.close();
  }

}

Measured memory_bytes: 34492
import sys
N = int(input())

a=[]

for i in range(N):
    a.append(int(input()))

x = 0
 
for i in range(N):
    if a[x] == 2:
        print(i+1)
        sys.exit()
    else:
        x = a[x] - 1

print(-1)

Measured memory_bytes: 7084
n = gets.chomp.to_i

n.times do 
  l = gets.chomp.split
  3.times do |i|
    l[i] = l[i].to_i
  end
  l.sort!
  if l[0]**2 + l[1]**2 == l[2]**2
    puts "YES"
  else
    puts "NO"
  end
end



Measured memory_bytes: 6848
#include<stdio.h>
#include<stdlib.h>
int main(){
    int n,i,j,tmp;
    int a[100];
    
    scanf("%d",&n);
    for(i = 0; i < n; i++) scanf("%d",&a[i]);
    
    for(i = 0; i < n-1; i++){
        for(j = i; j < n; j++){
            if(a[i] > a[j]){
                tmp = a[i];
                a[i] = a[j];
                a[j] = tmp;
            }
        }
    }
    printf("%d\n",a[n-1]-a[0]);
    return 0;
}


Measured memory_bytes: 128
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
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var S = ReadLine();
            var nums = new long[26];
            foreach (var s in S)
                ++nums[s - 'a'];
            for (var i = 0; i < 26; ++i)
                if (0 == nums[i])
                {
                    WriteLine((char)(i + 'a'));
                    return;
                }
            WriteLine("None");
        }

        static long Mod = (long)1e9 + 7;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
    }
}

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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

#define LL long long;
#define REP(i,s,N) for (int i=s; i<N; i++)

int main() {
	int A, B;
	cin >> A >> B;
	cout << (A+B)%24 << endl;
}

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

#define ll long long
#define mtv(kit) cout<<#kit<<" - "<<kit<<"\n";
#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

void doit(){
	ll n, m;
	cin >> n >> m;
	if(m < n)
		swap(n,m);
	for(ll i = 0; i < m; i++){
		cout << n;
	}
}

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: 3560
/* Dynamic Programming implementation of LCS problem */
#include<iostream>
#include<cstring>
#include<cstdlib>
using namespace std;

/* Returns length of LCS for X[0..m-1], Y[0..n-1] */
void lcs( string X, string Y, int m, int n )
{
int L[m+1][n+1];

/* Following steps build L[m+1][n+1] in bottom up fashion. Note
	that L[i][j] contains length of LCS of X[0..i-1] and Y[0..j-1] */
for (int i=0; i<=m; i++)
{
	for (int j=0; j<=n; j++)
	{
	if (i == 0 || j == 0)
		L[i][j] = 0;
	else if (X[i-1] == Y[j-1])
		L[i][j] = L[i-1][j-1] + 1;
	else
		L[i][j] = max(L[i-1][j], L[i][j-1]);
	}
}

// Following code is used to print LCS
int index = L[m][n];

// Create a character array to store the lcs string
char lcs[index+1];
lcs[index] = '\0'; // Set the terminating character

// Start from the right-most-bottom-most corner and
// one by one store characters in lcs[]
int i = m, j = n;
while (i > 0 && j > 0)
{
	// If current character in X[] and Y are same, then
	// current character is part of LCS
	if (X[i-1] == Y[j-1])
	{
		lcs[index-1] = X[i-1]; // Put current character in result
		i--; j--; index--;	 // reduce values of i, j and index
	}

	// If not same, then find the larger of two and
	// go in the direction of larger value
	else if (L[i-1][j] > L[i][j-1])
		i--;
	else
		j--;
}

// Print the lcs
cout << lcs;
}

/* Driver program to test above function */
int main()
{
string s1,s2;
getline(cin,s1);
getline(cin,s2);
int m = s1.length();
int n = s2.length();
lcs(s1, s2, m, n);
return 0;
}


Measured memory_bytes: 35456
#include <bits/stdc++.h>
#define re return
#define ll long long
#define pb push_back
using namespace std;
 ll  q,h,n,d,s,qq,hh,m1,m2;

int main()
{
    cin>>q>>h>>s>>d>>n;
    qq=q*4,hh=h*2;
    if (n==1){
        m1=min(qq*n,min(hh*n,s*n));
        cout<<m1;
        re 0;
    }

     if (n%2&&n>1){
        m1=min(qq*n,min(hh*n,s*n));
        d*=((n-1)/2);
        d+=min(qq,min(hh,s));
        m2=min(m1,d);
        cout<<m2;
        re 0;
     }
        m1=min(qq*n,min(hh*n,s*n));
        m2=min(m1,d*(n/2));
        cout<<m2;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#define PI 3.14159265358979323846264338327950L
int main(void){
  int a, b, h, m;
  scanf("%d%d%d%d", &a, &b, &h, &m);
  long double rad=2*PI*((long double)h/12.0-11.0*(long double)m/720.0);
  long double rsq=(long double)(a*a+b*b)-(long double)(2*a*b)*cosl(rad);
  printf("%20.20Lf",sqrtl(rsq));
  return 0;
}
  


Measured memory_bytes: 2488
#include <stdio.h>

int main(void)
{
	char buf;
	int buf_cnt = 0;
	int c[3];
	int my_cards;
	int ok = 0;
	int cnt = 0;
	double probability;
	for (int i = 0; i < 3; i++)
	{
		c[i] = 0;
	}
	
	while ((buf = getchar()) != EOF)
	{
		if (buf >= '0' && buf <= '9')
		{
			buf -= '0';
			c[buf_cnt] = c[buf_cnt] * 10 + buf;
			continue;
		}
		else if (buf != '\n')
		{
			if (c[buf_cnt] != 0)
			{
				buf_cnt++;
				continue;
			}
			else if (buf_cnt < 3)
			{
				continue;
			}
		}
		else
		{
			if (c[2] == 0)
			{
				for (int i = 0; i < 3; i++)
				{
					c[i] = 0;
				}
				continue;
			}
		}

		my_cards = c[0] + c[1];

		for (int i = 1; i <= 10; i++)
		{
			//c[0],2,c3??¨?¢??????´???????????????
			if (i == c[0] || i == c[1] || i == c[2])
			{
				continue;
			}

			if (my_cards + i <= 20)
			{
				ok++;
			}
			cnt++;
		}
		probability = (double)ok / (double)cnt;

		if (probability >= 0.5)
		{
			printf("YES\n");
		}
		else
		{
			printf("NO\n");
		}
		for (int i = 0; i < 3; i++)
		{
			c[i] = 0;
		}
		ok = 0;
		cnt = 0;
		buf_cnt = 0;
	}

	return 0;
}

Measured memory_bytes: 2472
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int n;
  cin>>n;
  int a=0;
  while(n--){
    int l,r;
    cin>>l>>r;
    a+=r-l+1;
  }
  cout<<a<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
using namespace std;
#define rep(i,a,n) for(ll i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define reverse(v)  reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF  UnionFind 
#define Pint pair<int,int>
#define keta(a)  fixed << setprecision(a)
constexpr auto INF = 100000000000;
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで！
struct edge { int to, cost; };

int seen[200001] = { false };
int a[200001] = { 0 };
int ans[200001] = { 0 };
void dfs(int v, int sum,whei(int)&G) {
	seen[v] = true;
	ans[v] = sum;
	for (auto x : G[v]) {
		if (seen[x])continue;
		dfs(x, sum + a[x], G);
	}
}

int main() {
	int n, a, b;
	cin >> n >> a >> b;
	string s;
	cin >> s;
	int x = 0,y=0;
	rep(i, 0, n) {
		if (s[i] == 'c')cout << "No" << endl;
		else {
			if (s[i] == 'a') {
				if (a+b> x) {
					cout << "Yes" << endl;
					x++;
				}
				else {
					cout << "No" << endl;
				}
			}
			if (s[i] == 'b') {
				y++;
				if (a + b > x&&y<=b) {
					cout << "Yes" << endl;
					x++;
				}
				else {
					cout << "No" << endl;
				}
			}
		}
	}
	return 0;
}

Measured memory_bytes: 896
#include <stdio.h>


int main(void)
{
	int N;
	int a[100];
	int sum = 0;
	int num;

	scanf("%d", &N);

	for (int i = 0; i < N; i++){
		scanf("%d", &a[i]);
		sum += a[i];
	}

	double av = 1.0 * sum / N;
	double diffmin = 1000;
	
	for (int i = 0; i < N; i++){
		double temp = av - a[i];
		if (temp < 0){
			temp *= (-1);
		}

		if (temp < diffmin){
			diffmin = temp;
			num = i;
		}
	}

	printf("%d\n", num);
	
	return 0;
}



Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#define N 205
using namespace std;

typedef long long ll;
#define PI pair<ll, ll>
ll n, m, k, mn, a[N], s[N][260], u[15], oo[N][260];
ll v[N];
bool v2[N][260], v3[N][260];

struct st {
 ll c1, c2, c3;
};

bool operator < (st p, st q) {
	return p.c1 < q.c1;
}
priority_queue<st> qu;
vector<ll> b[N], c[N];
void f(ll p, ll q, ll z) {
	if (v[q] != 0) z = (z | u[v[q]]);
	if (v2[q][z] || v3[q][z] && p < oo[q][z]) return;
	v3[q][z] = true;
	oo[q][z] = p;
	qu.push({p, q, z});
}

int main()
{
	ll i, j, t1, t2, t3;
	st t;
	cin >> n >> m >> k;
	for (i = 1; i <= k; i++) {
		scanf ("%lld", &a[i]);
		v[a[i]] = i;
	}
	for (i = 0; i < m; i++) {
		scanf ("%lld %lld %lld", &t1, &t2, &t3);
		b[t1].push_back(t2);
		c[t1].push_back(t3);
		b[t2].push_back(t1);
		c[t2].push_back(t3);
	}
	u[1] = 1;
	for (i = 2; i <= 10; i++) u[i] = u[i - 1] * 2;
	for (i = 1; i <= n; i++) f(0, i, 0);
	while (!qu.empty()) {
		t = qu.top(); qu.pop();
		if (v2[t.c2][t.c3] || t.c1 != oo[t.c2][t.c3]) continue;
		v2[t.c2][t.c3] = true;
		if (t.c3 == u[k + 1] - 1) {
			cout << -t.c1;
			return 0;
		}
		for (i =0; i < b[t.c2].size(); i++) {
			f(t.c1 -c[t.c2][i], b[t.c2][i], t.c3);
		}
	}
    return 0;
}


Measured memory_bytes: 8944
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			String S = sc.next();
			if (S.equals("-")) {
				break;
			}
			char[] C = S.toCharArray();
			int m = sc.nextInt();
			for (int i = 0; i < m; i++) {
				int h = sc.nextInt();
				for (int j = 0; j < h; j++) {
					for (int k = 0; k < C.length- 1; k++) {
						char l = C[k];
						C[k] = C[k + 1];
						C[k + 1] = l;
					}
				}
			}
			for (int i = 0; i < C.length; i++) {
				System.out.print(C[i]);
			}
			System.out.println();
		}
	}
}



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

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。
string upper(string str);       // 英字を大文字に変換する。
string lower(string str);       // 英字を小文字に変換する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define pb            push_back
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())
#define rvsort(v)     sort(rall((v)))
#define vi            vector<int>
#define GCD(a,b)      __gcd((a),(b))
#define LCM(a,b)      (a)/GCD((a),(b))*(b)
#define kiriage(a,b)  ((a)+(b)-1)/(b)

const int INF = 1e9;

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

  string s;
  cin >> s;

  bool b1 = false,b2 =false,b3 =false;

  // 1
  if(s[0] == 'A')
  {
    b1 = true;
  }

  // 2
  int cnt = 0;
  int cpos = -1;
  for(int i = 2; i < sz(s) - 1; i++)
  {
    if(s[i] == 'C')
    {
      cnt++;
      cpos = i;
    }
  }
  if(cnt == 1)
  {
    b2 = true;
  }

  // 3
  b3 = true;
  for(int i = 0;i < sz(s);i++)
  {
    if(i == 0 || i == cpos)
    {
      continue;
    }
    else
    {
      if(97 <= s[i] && s[i] <= 122)
      {

      }
      else
      {
        b3 = false;
        break;
      }
    }
  }

  if(b1&&b2&&b3) cout << "AC" << endl;
  else cout << "WA" << endl;



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

string upper(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(97 <= *itr && *itr <= 122)
    {
      *itr = *itr - 32;
    }
  }
  return str;
}

string lower(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(65 <= *itr && *itr <= 90)
    {
      *itr = *itr + 32;
    }
  }
  return str;
}


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

using namespace std;

bool distance_is_int(vector<int> a, vector<int> b) {
  int sum = 0;
  for (int i = 0; i < a.size(); i++) {
    int t = a[i] - b[i];
    sum += t * t;
  }

  double distance = sqrt(sum);
  return distance - floor(distance) == 0;
}

int main(int argc, const char *argv[])
{
  int n, d;
  cin >> n >> d;

  vector<vector<int>> coords(n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < d; j++) {
      int x;
      cin >> x;
      coords[i].push_back(x);
    }
  }

  int cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      bool is_int = distance_is_int(coords[i], coords[j]);
      if (is_int) {
        cnt++;
      }
    }
  }

  cout << cnt << "\n";
}

Measured memory_bytes: 256
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    s,t = input().rstrip().split()
    a,b = map(int, input().split())
    u = input().rstrip()
    if s==u:
        print(a-1, b)
    else:
        print(a, b-1)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3316
#include<stdio.h>

int main(void){
	int type,moto,gram[128];
	
	scanf("%d %d",&type,&moto);
	
	for(int i = 0; i < type; i++){
		scanf("%d",&gram[i]);
	}
	
	int min = 0;
	
	for(int j = 0; j < type; j++){
		min += gram[j];
	}
	
	moto = moto - min;
	
	int nokori[128];
	
	for(int k = 0; k < type; k++){
		nokori[k] = moto / gram[k];
	}
	
	int max;
	
	max = nokori[0];
	for(int l = 0; l < type; l++){
		if(nokori[l] > max) max = nokori[l];
	}
	
	printf("%d\n",max + type);
}
	

Measured memory_bytes: 128
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);

		int n=scanner.nextInt();

		Integer[] data=new Integer[n];

		for(int i=0;i<n;i++) {
			data[i]=scanner.nextInt();
		}

		Arrays.sort(data,Comparator.reverseOrder());

		int scoreAlice=0;
		int scoreBob=0;

		for(int i=0;i<n;i++) {

			if(i%2==0) {
				scoreAlice+=data[i];
			}else {
				scoreBob+=data[i];
			}

		}

		int result=scoreAlice-scoreBob;

		System.out.println(result);



		scanner.close();

	}

	public static int getsumofkakuketa(int n) {

		int result=0;

		while(true) {

			result+=n%10;

			if(n/10!=0) {
				n/=10;
			}else {
				return result;
			}
		}



	}

	public static boolean isMacthed(int a,int b,int sum) {

		if(sum>=a && sum<=b) {
			return true;
		}else {
			return false;
		}

	}



}







Measured memory_bytes: 21716
#include "bits/stdc++.h"
#include "math.h"
 
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define SIZE(a) int((a).size();
const int INF=1e9;
int main(){
  int n,x;
  cin>>n;
  if(n%4==0||n%7==0){cout<<"Yes"<<endl;}
  else{
    x=n/7;bool ok=true;
    while(x>0){
      int copy=n;
      copy-=x*7;
      if(copy%4==0){cout<<"Yes"<<endl;ok=false;break;}
      x--;
    }
    if(ok){cout<<"No"<<endl;}
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
typedef long double ld;
#define mod 1000000007

int main()
{
ll n;
cin>>n;
ll arr[n+1]={0};

for(ll i=1;i<=n/2;i++)
{
	for(ll j=2*i;j<=n;j=j+i)
		arr[j]++;
}

ll ans=0;
for(ll i=1;i<=n;i++)
	ans=ans+(arr[i]+1)*i;

cout<<ans;


  return 0;
}





Measured memory_bytes: 81720
#include <bits/stdc++.h>
#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(auto it=(X).begin();it!=(X).end();it++)
#define numa(x,a) for(auto x: a)
#define ite iterator
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define pf push_front
#define sec second
#define sz(x) ((int)(x).size())
#define ALL( c ) (c).begin(), (c).end()
#define gcd(a,b) __gcd(a,b)
#define mem(x,n) memset(x,n,sizeof(x))
#define endl "\n"
using namespace std;
template <int POS, class TUPLE> void deploy(std::ostream &os, const TUPLE &tuple){}
template <int POS, class TUPLE, class H, class ...Ts> void deploy(std::ostream &os, const TUPLE &t){ os << (POS == 0 ? "" : ", ") << get<POS>(t); deploy<POS + 1, TUPLE, Ts...>(os, t); }
template <class T,class U> std::ostream& operator<<(std::ostream &os, std::pair<T,U> &p){ os << "(" << p.first <<", " << p.second <<")";return os; }
template <class T> std::ostream& operator<<(std::ostream &os, std::vector<T> &v){ int remain = v.size(); os << "{"; for(auto e: v) os << e << (--remain == 0 ? "}" : ", "); return os; }
template <class T> std::ostream& operator<<(std::ostream &os, std::set<T> &v){ int remain = v.size(); os << "{"; for(auto e: v) os << e << (--remain == 0 ? "}" : ", "); return os; }
template <class T, class K> std::ostream& operator<<(std::ostream &os, std::map<T, K> &mp){ int remain = mp.size(); os << "{"; for(auto e: mp) os << "(" << e.first << " -> " << e.second << ")" << (--remain == 0 ? "}" : ", "); return os; }
#define DEBUG1(var0) { std::cerr << (#var0) << "=" << (var0) << endl; }
#define DEBUG2(var0, var1) { std::cerr << (#var0) << "=" << (var0) << ", ";DEBUG1(var1); }
#define DEBUG3(var0, var1, var2) { std::cerr << (#var0) << "=" << (var0) << ", ";DEBUG2(var1,var2); }
#define DEBUG4(var0, var1, var2, var3) { std::cerr << (#var0) << "=" << (var0) << ", ";DEBUG3(var1,var2,var3); }
using ll = long long;



int main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  map <int,int> memo;
  int N;
  cin >> N;
  rep(i,N){
    int x;
    cin >> x;
    memo[x] += 1;
  }
  vector <int> unum;
  vector <int> eve;
  numa(x,memo){
    if (x.sec % 2 == 1) {
      unum.pb(x.fir);
    } else {
      eve.pb(x.fir);
    }
  }
  if (sz(eve) % 2 == 0) {
    cout << sz(unum) + sz(eve) << endl;
  } else {
    cout << sz(unum) + sz(eve) - 1<< endl;
  }
  
  return 0;
}



Measured memory_bytes: 5632
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int a[5];
    int i;
    int min[2];
    min[1]=10;
    for(i=0;i<5;i++) {
        cin >> a[i];
        if(min[1]>a[i]%10 && a[i]%10!=0)min[1]=a[i]%10,min[0]=i;
    }
    int ans=0;
    for(i=0;i<5;i++){
        
       if (min[0]==i) ans+=a[i];
       else {
         if(a[i]%10!=0)ans+=a[i]/10*10+10;
        else ans+=a[i];
       }
    }
  cout << ans<< endl;

}


Measured memory_bytes: 256
#include<iostream>
#include<string.h>
using namespace std;
int main(){
  int k,s;
  int x,y,z;
  int cnt=0;

  cin>>k>>s;
  for(x=0;x<=k;x++){
    for(y=0;y<=k;y++){
      if(s-x-y<=k&&s-x-y>=0) cnt++;
    }
  }
  cout<<cnt<<endl;
  return 0;
}

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

using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> vec(n);
  int numEvens=0;
  for(int i=0; i<n; ++i){
    cin >> vec[i];
    if(vec[i]%2==0){
      numEvens ++;
    }
  }
  
  const auto allSimilars = pow(3, n);
  const auto odds = pow(2, numEvens);
  
  cout << allSimilars-odds << endl;
  
}

Measured memory_bytes: 256
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector as V
import qualified Data.ByteString.Char8 as C
import Debug.Trace
import Data.List
import Control.Monad
import Control.Arrow
import Data.Ord


r :: Int -> IO (U.Vector Int)
r n = U.unfoldrN n (C.readInt . C.dropWhile (==' ')) <$> C.getLine

r' :: IO [Int]
r'  =   unfoldr    (C.readInt . C.dropWhile (==' ')) <$> C.getLine



main :: IO ()
main = do
    [a,b,c,d] <- r'
    putStrLn $ if di a d >= di c b then "Yes" else "No"

di x y = ceiling $ (fromIntegral x)/(fromIntegral y)

Measured memory_bytes: 3844
#ifndef _TEMPLATE_ROOT
#define _TEMPLATE_ROOT
#include "bits/stdc++.h"
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define repl(i, a, b) for(ll i = a; i < (b); ++i)
#define repd(i, a, b) for(int i = b; i >= (a); --i)
#define repdl(i, a, b) for(ll i = b; i >= (a); --i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
template<typename H> bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return true; } return false; }
template<typename H> bool ihmax(H& v1, const H v2) { if (v1 < v2) { v1 = v2; return true; } return false; }
#endif
#ifndef _TEMPLATE_IO
#define _TEMPLATE_IO

template<typename H> void read(H& head) { cin >> head; }
template<typename H, typename ...T> void read(H& head, T& ...tail) { cin >> head; read(tail...); }
template<typename H> void write(H head) { cout << head << '\n'; }
template<typename H, typename ...T> void write(H head, T ...tail) { cout << head << " "; write(tail...); }
template<typename ...T> void die(T ...tok) { write(tok...); exit(0); }
#endif
#ifndef _TEMPLATE_BS
#define _TEMPLATE_BS

template<class T, class U>
T lower_bound_on(T first, T last, const U& value, const function<U(T)>& fn) {
	T it, step, count = last - first;
	while (count > 0) {
		it = first + (step = count / 2);
		if (fn(it) < value)
			first = ++it, count -= step + 1;
		else
			count = step;
	}
	return first;
}
template<class T, class U>
T upper_bound_on(T first, T last, const U& value, const function<U(T)>& fn) {
	T it, step, count = last - first;
	while (count > 0) {
		it = first + (step = count / 2);
		if (!(value < fn(it)))
			first = ++it, count -= step + 1;
		else	
			count = step;
	}
	return first;
}
#endif
using namespace std;

int n;
ll k;
int a[200005];

int can(const ll x) {
  ll ttl = 0;
  for (int i = 0; i < n; i++) {
    ttl += (a[i] - 1) / x;
  }
  return int(ttl <= k);

}

int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);

  read(n, k);
  rep(i, 0, n) read(a[i]);

  {
    ll first = 1ll, last = 1000000000ll;
    ll it, step, count = last - first;
    while (count > 0) {
      it = first + (step = count / 2);
      if (can(it) < 1) 
        first = ++it, count -= step + 1;
      else count = step;
    }
    write(first);
  }
}



Measured memory_bytes: 4440
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
using namespace std;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
const array<pair<int,int>,4> fd{make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 
//llじゃなく

int n;
vector<string> semi;
void dfs(bool three, bool five, bool seven, string s, int len){
  if(len>=10)return;
  if(three&&five&&seven)semi.push_back(s);
  dfs(true,five,seven,s+'3',len+1);
  dfs(three,true,seven,s+'5',len+1);
  dfs(three,five,true,s+'7',len+1);
}

int main(){
  cin>>n;
  string s;
  dfs(false,false,false,s,0);
  int ans = 0;
  rep(i,semi.size()){
    int nn = stoi(semi[i]);
    if(nn<=n){
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 2044
#include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) for (int i = (int)(n-1); i >= 0; i--)
#define sz(x) int(x.size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define INF 2e9
#define LINF 1e18
template<class T> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> P;

int main() {
    int n; cin >> n;
    if (n>=82) {
        cout << "No" << endl;
        return 0;
    }
    REP(i,1,10) {
        if (n%i==0) {
            if (n/i<=9) {
                cout << "Yes" << endl;
                return 0;
            }
            
        }
    }

    cout << "No" << endl;
    

}

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

using System.Collections;

class Program
{
    static void Main()
    {
        int[] nk = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

        int[] candles = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

        int N = nk[0];
        int K = nk[1];

        int minTime = int.MaxValue;

        for(int i = 0; i < N; i++)
        {
            if (i + K - 1 >= N) break;

            var first = candles[i];
            var last = candles[i + K - 1];

            var time1 = Math.Abs(last) + last - first;
            var time2 = Math.Abs(first) + last - first;

            var time = Math.Min(time1, time2);

            minTime = Math.Min(time, minTime);
        }


        Console.WriteLine(minTime);

    }
}


static class MathUtil
{
    public static IEnumerable<IEnumerable<int>> GetPermutation(int n)
    {
        if (n == 0)
        {
            yield return Single(0);
            yield break;
        }

        for (int i = 0; i <= n; i++)
        {
            foreach (var x in GetPermutation(n - 1))
            {
                yield return Single(i).Concat(x.Select(itm => itm < i ? itm : itm + 1));
            }
        }
    }

    private static IEnumerable<int> Single(int x)
    {
        yield return x;
    }

    public static IEnumerable<int> EnumeratePrimeNumbers()
    {
        List<int> primes = new List<int>() { 2 };
        yield return 2;

        for (int i = 3; i < int.MaxValue; i++)
        {
            bool isPrime = true;
            int Sqrt = (int)Math.Sqrt(i) + 1;

            foreach (var prime in primes)
            {
                if (prime > Sqrt)
                {
                    break;
                }
                if (i % prime == 0)
                {
                    isPrime = false;
                    break;
                }
            }

            if (isPrime)
            {
                primes.Add(i);
                yield return i;
            }
        }
    }
}


Measured memory_bytes: 21728
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#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 <stdexcept>

using namespace std;

//conversion
//------------------------------------------
inline int toint(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class t> inline string tostring(t x) { ostringstream sout; sout << x; return sout.str(); }

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (l" << __line__ << ")" << " " << __file__ << endl

// type alias
using ll = long long;
using ull = unsigned long long;

// constant value
const ll mod = 1000000007ll;

template<class ll>
inline ll getCeilExponent(ll a)
{
	if (a <= 0)
	{
		throw invalid_argument("vaule equal to or less than 0 should not be valid");
	}

	ll index = 0;
	--a;
	for (; a != 0; a >>= 1)
	{
		++index;
	}
	return index;
}

template<class ll>
inline ll getFloorExponent(ll a)
{
	if (a <= 0)
	{
		throw invalid_argument("vaule equal to or less than 0 should not be valid");
	}

	ll index = 0;
	a >>= 1;
	for (; a != 0; a >>= 1)
	{
		++index;
	}
	return index;
}

// computational complexity: o(log(max(a, b))) 
template<class ll>
inline ll getGcd(ll a, ll b)
{
	if (b == 0)
	{
		return a;
	}
	return getGcd(b, a % b);
}

// computational complexity: o(log(max(a, b))) 
template<class ll>
inline pair<ll, ll> getBezoutsIdentitySolution(ll a, ll b)
{
	if (b == 0)
	{
		return { 1, 0 };
	}
	auto sol = getBezoutsIdentitySolution(b, a % b);
	return { sol.second, sol.first - (a / b) * sol.second };
}

inline ll getModValue(ll a, ll m)
{
	return (a % m + m) % m;
}

// computational complexity: o(log(max(a, n))) 
inline ll getModInverse(ll a, ll m)
{
	auto sol = getBezoutsIdentitySolution(a, m);
	if (a * sol.first + m * sol.second != 1)
	{
		return -1;
	}
	return getModValue(sol.first, m);
}

ll getModCombinatorialNumber(ll n, ll r, ll m)
{
	ll res = 1;
	for (; n > 0; --n, --r)
	{
		res = (((res * n) % m) * getModInverse(n, m)) % m;
	}
	return getModValue(res, m);
}

ll getModPower(ll base, unsigned t, ll m)
{
	if (t == 0)
	{
		return 1ll;
	}

	auto res = getModPower(base, t >> 1, m);
	res = getModValue(res * res, m);
	if (t % 2 == 1)
	{
		res = getModValue(res * base, m);
	}
	return res;
}

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

	ll N, K;
	string S;
	cin >> N >> S >> K;

	char ch = S[K - 1];

	for (ll i = 0; i < N; ++i)
	{
		if (S[i] != ch)
		{
			S[i] = '*';
		}
	}

	cout << S << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
int n, k, p;
int res = 0;
int main() {
    std::cin >> n >> k;
    for (int i = 0; i < n; i++) {
        std::cin >> p;
        if (p >= k) {
            res++;
        }
    }
    std::cout << res << std::endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int a,b,c;
	scanf("%d %d %d",&a,&b,&c);
		if(a<b && a<c && b<c)
		{
		printf("Yes\n");
		}
		else
		{
		printf("No\n");
		}



	return 0;
}

Measured memory_bytes: 2696