akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;  
#define rep(i, a, b) for(ll i = a; i < b; i++)
#define Rep(i, a, b) for(ll i = a; i <= b; i++)
#define repr(i, a, b) for(ll i = b-1; i >= a; i--)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
using ll = long long;
#define ALL(v) (v).begin(),(v).end()
#define endl "\n"
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define co(x) cout << x << endl
#define coel cout << endl
#define pb push_back
#define sz(v) ((ll)(v).size())
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
// const ll INF = 1LL << 60;
#define pp pair<ll, pair<ll, ll>> 
#define fi first
#define se second

////////////////////////////////////////////////////////

int main() {
    ll n, x, t; cin >> n >> x >> t;

    ll a = 1, now = x;

    while(now < n){
        now += x;
        a++;
    }

    co(a*t);

    return 0;
}
 
 


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
int SumOfdigit(int n){
    int sum =0;
    while(n > 0){
        sum += n % 10;
        n /= 10;
    }
    return sum;
}

int main() {
    int n;
    cin >> n;
    if(n % SumOfdigit(n) == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
 
using namespace std;
 
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define ll long long
#define vi vector<int>
#define pi pair<int,int>
#define mp make_pair
 
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
 
const int mod=1e9+7;
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<typename A,typename B> istream& operator>>(istream&,pair<A,B>&);
template<typename A> istream& operator>>(istream&,vector<A>&);
void add(int&,int);
int mul(int,int);
int powz(int,int);
int sub(int,int);
template<typename A> ostream& operator<<(ostream&,vector<A>&);
 
const int N=5000002;

void solve(){
	//~ int n;
	//~ cin>>n;
	//~ vector<vector<int>>a(n,vector<int>(n-1));
	//~ for(int i=0;i<n;i++){
		//~ for(int j=0;j<n-1;j++){
			//~ cin>>a[i][j];
		//~ }
	//~ }
	//~ int ans=0;
	//~ for(int i=0;i<n-1;i++){
		
	//~ }
	int a,b;
	cin>>a>>b;
	cout<<(b+a-3)/(a-1);
			
}
 
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int tc=1;
	//~ cin>>tc;
	for(int _=0;_<tc;_++){
		//~ cout<<"Case #"<<_+1<<": ";
		solve();
		if(_!=tc-1)
		cout<<"\n";
	}
}
 
int mul(int a,int b)
{
	return ((a)*1ll*(b))%mod;
}
 
void add(int &a,int b)
{
	a+=b;
	if(a>=mod)a-=mod;
}
 
int sub(int a,int b){
	a-=b;
	if(a<0){
		a+=mod;
	}
	return a;
}
 
int powz(int a,int b)
{
	int res=1;
	while(b)
	{
		if(b&1)res=mul(res,a);
		b/=2;
		a=mul(a,a);
	}
	return res;
}
 
template <typename A, typename B>
istream& operator>>(istream& input,pair<A,B>& x) {
	input>>x.F>>x.S;
	return input;
}
 
template <typename A>
istream& operator>>(istream& input,vector<A>& x) {
	for(auto& i:x)
		input>>i;
	return input;
}
 
template<typename A>
ostream& operator<<(ostream& output,vector<A>& x) {
	for(auto& i:x)
		output<<i<<' ';
	return output;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string>
#include<utility>
#include<iostream>
#include<queue>
#include<math.h>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<bitset>

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

bool compare_by_b(pair<ll, ll> a, pair<ll, ll> b) {
    if(a.second != b.second){
        return a.second > b.second;
    }else{
        return a.first > b.first;
    }
}

int main(){
    int n;
    ll a;
    ll b;
    vector<pair<ll,ll> > v;
    scanf("%d",&n);
    REP(i,n){
        scanf("%lld%lld",&a,&b);
        v.push_back(make_pair(a,b));
    }
    sort(v.begin(),v.end(),compare_by_b);
    //printf("%lld\n",v[0].first);
    long long int time=v[0].second;
    int j=1;
    REP(i,n){
        if(time>v[i].second)time=v[i].second;
        time-=v[i].first;
        if(time<0)j=0;
    }
    if(j)printf("Yes\n");
    else printf("No\n");
    return 0;
}

Measured memory_bytes: 6256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define REP(i, a, b) for(ll i = ll(a); i <= ll(b); i++)
int main()
{
    ll a,b,n,r=0;
    cin>>n>>a>>b;
    REP(i,1,n)
    {
        ll c=0,t=i;
        REP(j,0,5)
        {
            c+=t%ll(10);
            t/=10;
        }
        if(a<=c && c<=b)
            r+=i;
}
    cout<<r;        
}

Measured memory_bytes: 256
#include<iostream>

constexpr size_t combination(size_t n, size_t r){
    if (r == 0 || r == n){
        return 1;
    }else if(r == 1){
        return n;
    }else{
        return (combination(n - 1, r - 1) + combination(n - 1, r));
    }
}

int main(){

    size_t n, a, b;
    std::cin >> n >> a >> b;

    if(b < a){
        std::cout << 0 << std::endl;
    }else if(b - a > n){
        std::cout << 0 << std::endl;
    }else if(n == 1 && a != b){
        std::cout << 0 << std::endl;
    }else if(n == 1 && a == b){
        std::cout << 1 << std::endl;
    }else{
        std::cout << (b - a) * (n - 2) + 1 << std::endl;
    }

    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using static System.Console;
using static System.Math;
using static MyIO;
using static MyUtil;

public class D { public static void Main() => (new Solver()).Solve(); }

public class Solver
{
	public void Solve()
	{
		long H = GetLong();
		long W = GetLong();
		long D = GetLong();
		var xy = new (long, long)[H * W];
		for(long i = 0; i < H; i++)
		{
			for(long j = 0; j < W; j++)
				xy[GetLong() - 1] = (i, j);
		}

		var dp = new long[H * W];
		for(long i = 0; i < H * W - D; i++)
		{
			var (cx, cy) = xy[i];
			var (nx, ny) = xy[i + D];
			dp[i + D] = dp[i] + Abs(nx - cx) + Abs(ny - cy);
		}
		
		long Q = GetLong();
		var ans = new long[Q];
		for(long i = 0; i < Q; i++)
		{
			long L = GetLong() - 1;
			long R = GetLong() - 1;
			ans[i] = dp[R] - dp[L];
		}
		WriteLine(string.Join("\n", ans));
	}
}

public static class MyIO
{
	private static string[] args = new string[0];
	private static int cnt = 0;
	private static IEnumerable<string> getArgs(long N) => Range(0, N).Select(_ => getArg());
	private static string getArg()
	{
		if(cnt == args.Length) { args = Console.ReadLine().Split(); cnt = 0; }
		return args[cnt++];
	}

	public static int GetInt() => int.Parse(getArg());
	public static long GetLong() => long.Parse(getArg());
	public static double GetDouble() => double.Parse(getArg());
	public static decimal GetDecimal() => decimal.Parse(getArg());
	public static string GetString() => getArg();
	public static char GetChar() => getArg()[0];
	public static int[] GetInts(long N) => getArgs(N).Select(int.Parse).ToArray();
	public static long[] GetLongs(long N) => getArgs(N).Select(long.Parse).ToArray();
	public static double[] GetDoubles(long N) => getArgs(N).Select(double.Parse).ToArray();
	public static decimal[] GetDecimals(long N) => getArgs(N).Select(decimal.Parse).ToArray();
	public static string[] GetStrings(long N) => getArgs(N).ToArray();
}

public static class MyUtil
{
	public static void chmax<T>(ref T x, T y) where T : IComparable<T> { if(x.CompareTo(y) < 0) x = y; }
	public static void chmin<T>(ref T x, T y) where T : IComparable<T> { if(x.CompareTo(y) > 0)	x = y; }
	public static void swap<T>(ref T x, ref T y) { T tmp = x; x = y; y = tmp; }
	public static long rightShift(long x, long y) => (x >> (int)y);
	public static long leftShift(long x, long y) => (x << (int)y);
	public static bool contains(long s, long x) => (rightShift(s, x) & 1L) == 1L;
	public static long gcd(long x, long y) => (y == 0) ? x : gcd(y, x % y);
	public static long lcm(long x, long y) => (x / gcd(x,y)) * y;	
	public static IEnumerable<int> Range(long start, long count) => Enumerable.Range((int)start, (int)count);
	public static void Sort(this List<string> source) => source.Sort(StringComparer.Ordinal);
}


Measured memory_bytes: 51600
#include<stdio.h>
#include<string.h>
int main()
{
  int n,i;
  double x[10],sum;
  char u[10][4];
  
  scanf("%d",&n);
  for(i = 0;i < n;i++)
    scanf("%lf %s",&x[i],u[i]);
  
  for(i = 0;i < n;i++)
    if(u[i][0] == 'J'){
      sum += x[i]; 
    }else
      sum += 380000 * x[i];
  
  printf("%.8lf",sum);
 
  return 0;
}

Measured memory_bytes: 128
import numpy as np
from numba import njit

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

A_list = np.array([0]+list(map(int, input().split())))

@njit
def update(A_list):

  for j in range(min(K,46)):
    new_A=np.zeros(N+2,dtype=np.int64)
    for i in range(1,N+1):
      #print(new_A)
      mi=i-A_list[i]
      ma=i+A_list[i]
      if mi<0:
        mi=0
      if ma>N:
        ma=N
      #new_A[mi:ma+1]+=1
      new_A[mi]+=1
      new_A[ma+1]-=1

    A_list=np.cumsum(new_A)
    #if sum(A_list[1:N+1])==N*N:
    #  return(A_list)    
    #  break
      
  return(A_list)

A_list=update(A_list)
for i in range(1,N+1):
  print(A_list[i],end=" ")


Measured memory_bytes: 118436
h, w = map(int, input().split())
if h == 1 or w == 1:
  print(1)
else:
  if w % 2 == 0:
      a = (w//2) * 2
      if h % 2 == 0:
          count = a * (h//2)
      else:
          count = a * (h//2)
          count += a // 2
  else:
      a = (w//2) * 2 + 1
      if h % 2 == 0:
          count = a * (h//2)
      else:
          count = a * (h//2)
          count += a//2+1

  print(count)

Measured memory_bytes: 3060
<?php
// Your code here!
$n = trim(fgets(STDIN));
$stdin = trim(fgets(STDIN));
// $a = str_split($stdin);
$b = explode(' ', $stdin);
sort($b);
$e = $n%2;
$f = $n/2;
if($e === 1){
    echo 0;
    return;
}


$g = $b[$f - 1];
$h = $b[$f];

$c = 0;
for ($i = $g + 1; $i <= ($h); $i++) {
    $c++;
     // code...
}
echo $c;
?>

Measured memory_bytes: 12792
#include<iostream>
#define ll long long int
using namespace std;
ll cek[(int)2e5+5],a[(int)2e5+5];
ll ps[(int)2e5+5];
ll max(ll a, ll b){
	if(a > b) return a;
	return b;
}
int main(){
	int n;
	cin>>n;
	for(int i = 0;i<n;i++){
		cin>>a[i];
		cek[a[i]]++;
	}
	ll tot = 0;
	for(int i = 0;i<=2e5;i++){
		if(cek[i] > 1) ps[i] = (cek[i] * (cek[i]-1)/2);
		if(cek[i] > 1) tot += ps[i];
	}
//	for(int i = 0;i<=10;i++) cout<<ps[i]<<" ";cout<<"\n";
	for(int i= 0;i<n;i++){
//		cout<<a[i]<<" "<<ps[a[i]]<<
//		 " "<<((cek[i]-1) * (cek[i]) /2)<<"\n";
		if(ps[a[i]]-1 > 1)
			cout<<tot - ps[a[i]] + ((cek[a[i]]-1) * (cek[a[i]]-2) /2)<<"\n";
		else{
			cout<<max(0,tot-ps[a[i]])<<"\n";
		}
	}
	return 0;
}

Measured memory_bytes: 6272
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<queue>
#define FOR(i,l,r) for(register int i=(l),i##R=(r);i<=i##R;i++)
#define DOR(i,r,l) for(register int i=(r),i##L=(l);i>=i##L;i--)
#define loop(i,n) for(int i=0,i##R=(n);i<i##R;i++)
#define mms(a,x) memset(a,x,sizeof a)
#define pii pair<int,int>
#define fi first
#define se second
using namespace std;
typedef long long ll;
template<typename A,typename B>inline void chkmax(A &x,const B y){if(x<y)x=y;}
template<typename A,typename B>inline void chkmin(A &x,const B y){if(x>y)x=y;}
int main(){
	int n;
	scanf("%d",&n);
	printf("%lld\n",3ll*n*n);
	return 0;
}

Measured memory_bytes: 256
import math
import itertools
import statistics
#import numpy as np
import collections

#n = int(input())
a, b, x = list(map(int, input().split()))
#a = list(map(int, input().split()))
low = a//x
higth = b//x
ans = higth-low
if a%x==0:
    ans += 1
print(ans)

Measured memory_bytes: 5148
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			String[] arr = data.split(" ");
			int L = Integer.parseInt(arr[0]);
			int R = Integer.parseInt(arr[1]);
			int d = Integer.parseInt(arr[2]);

			int ans = 0;
			for (int i = L; i <= R; i++) {
				if (i % d == 0) {
					ans++;
				}
			}

			System.out.println(ans);
		}
	}
}


Measured memory_bytes: 35564
// OURL: https://atcoder.jp/contests/abc134/tasks/abc134_b
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define RREP(i,a,n) for(int i=(a),i##_len=(n);i<i##_len;++i)
#define MAT1D(V,T,a) vector<T> V (a)
#define MAT2D(V,T,a,b) vector<vector<T>> V (a, vector<T>(b))
#define MAT3D(V,T,a,b,c) vector<vector<vector<T>>> V (a, vector<vector<T>>(b, vector<T>(c)))

// http://beet-aizu.hatenablog.com/entry/2018/04/08/145516
template<typename T>
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); }

template <typename A>
string to_string(A v) { bool first = true; string res = "{"; for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); } res += "}"; return res; }

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(vector<bool>::reference b) { return to_string(bool(b)); }
template <typename A, typename B>
string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A>
string to_string(vector<vector<A>> v) { string res; for(const auto &x : v) {res+="\n ";res += to_string(x);} return res;}

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...); }

#ifdef LOCAL
#define debug(...) cerr << "[L" << to_string(__LINE__) << ":" <<#__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n,d;
  cin >> n >> d;
  cout << int(n / (2*d+1)) + ((n % (d*2+1)) == 0 ? 0:1) << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<stdio.h>
using namespace std;

//繰り返し
#define REP(i, m, n) for(int i=(int)m; i<(int)n; ++i)
#define rep(i, n) REP(i, 0, n)
#define RREP(i, m, n) for(int i=(int)m; i>=(int)n; --i)
#define rrep(i, m) RREP(i, m, 0)

//簡略化
typedef long long ll;
typedef pair<int, int> pint;
typedef pair<ll, ll> P;

//定義
const int INF = 1e9+7;
const ll LINF = 1e18;
const ll MOD = 1e9+7;

void chmin(ll &a, const ll &b) {
  if(a>b) a = b;
}

void chmax(ll &a, const ll &b) {
  if(a<b) a = b;
}

//GCD&LCM
ll gcd(ll x, ll y) {
  if(y==0) return x;
  else return gcd(y, x%y);
}

ll lcm(ll x, ll y) {
  return (x*y)/gcd(x, y);
}

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

int main() {

  ll l,r, min = 2019, cnt = 0;
  cin >> l >> r;

  if(r-l>=2019) {
    cout << 0 << endl;
    return 0;
  }

  for(ll i=l; i<=r; ++i) {
    for(ll j=i+1; j<=r; ++j) {
      chmin(min, (i*j)%2019);
    }
  }

  cout << min << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
using namespace std;
int main()
{
	int r;
	cin >> r;
	cout << r * r << endl;

}

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

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    String[] str = in.readLine().split(" ");
    int[] p = new int[n];
    int min = 100000*2;
    int count = 0;
    for(int i=0; i<n; i++) {
      p[i] = Integer.parseInt(str[i]);
      min = Math.min(p[i],min);
      if(p[i]>min)
        count++;
    }
    System.out.println(n-count);
  }
}

Measured memory_bytes: 60892
$n,$m,$q = gets.split.map &:to_i
$as = []

$q.times{
	$as << gets.split.map(&:to_i)
}

$max = 0

def x(p, count)
	if count == $n then
		sum = 0
		$as.each{ |a|
			if p[a[1]] - p[a[0]] == a[2] then
				sum += a[3]
			end
		}
		if sum > $max then
			$max = sum
		end
	else
		start = p[-1]
		(start..$m).each{ |i|
			x(p + [i], count + 1)
		}
	end
end

x([1], 0)

puts $max


Measured memory_bytes: 14408
// #include <bits/stdc++.h>
#include <stdio.h>
#define ll long long
#define inf 0x3f3f3f3f
// using namespace std;
const ll mod = 1e9 + 7;
const int maxn = 2e5 + 5;
ll fac[maxn],inv[maxn];

ll modpow(ll a,ll b){return b ? modpow(a*a%mod,b/2)*(b%2?a:1)%mod : 1;}
ll prm(ll n, ll k){
  ll res = 1;
  for(int i=0;i<k;i++){ res = res * (n-i) % mod; }
  return res;
}
ll modinv(ll a, ll p){ return modpow( a, p-2 ); }
ll cmb(ll n,ll k){
	if(k > n-k){ k = n-k; }
	return prm(n,k) * modinv(prm(k,k), mod) % mod;
} 
int main(){
	ll n,a,b;
// 	cin>>n>>a>>b;
	scanf("%lld %lld %lld", &n, &a, &b);
	ll ans = modpow(2,n) - 1 - cmb(n,a) - cmb(n,b);
	ans = (ans % mod + mod) % mod;
	printf("%lld\n", ans);
}

Measured memory_bytes: 128
import math
MOD = 10 ** 9 + 7
N = int(input())
S = list(input())

if S[0] == 'W' or S[-1] == 'W':
    print (0)
    exit()

lst = [0] * (2 * N + 1)
ans = [-1] * (2 * N + 1) #左で選んだ時1, 右で選んだ時0
lst[0] = 1
ans[0] = 1
for i in range(1, 2 * N):
    if S[i] == 'B': #奇数にする必要
        if (lst[i - 1] + lst[i]) % 2 == 0: #前が偶数
            lst[i] += lst[i - 1] + 1
            ans[i] = 1
        else: #前が奇数
            lst[i] += lst[i - 1]
            lst[i + 1] -= 1
            ans[i] = 0

    if S[i] == 'W': #偶数にする必要
        if (lst[i - 1] + lst[i]) % 2 == 0: #前が偶数
            lst[i] += lst[i - 1]
            ans[i] = 0
            lst[i + 1] -= 1
        else: #前が奇数
            lst[i] += lst[i - 1] + 1
            ans[i] = 1

count = 1
tmp = 0
for i in range(2 * N - 1, -1, -1):
    if ans[i] == 0:
        tmp += 1
    else:
        count *= tmp
        count %= MOD
        tmp -= 1
if tmp != 0:
    print (0)
    exit()
    
count *= math.factorial(N)
print (count % MOD)

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

using namespace std;

int main() {
	int r, g, b;
	cin >> r >> g >> b;
	if ((10 * g + b) % 4 == 0) cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}

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

#define all(a) a.begin(), a.end()
#define allr(a) a.rbegin(), a.rend()
#define rev(v) reverse(v.begin(), v.end());
#define io() ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); srand(time(NULL));
 
using namespace std;

using ll = long long;
using ld = long double;
using ull = unsigned long long;

signed main(){
    io();
    int n; cin >> n;
    string s; cin >> s;
    int k = n/2;
    cout << (s.substr(0,k) == s.substr(k,n) ? "Yes" : "No") << '\n';
    return 0;
}

Measured memory_bytes: 3652
#include<iostream>
#include<algorithm>


using namespace std;


int main()
{
	int n; 
	int x = 0;
	cin >> n;
	if((n%100)%10==7) x=1;
	if((n%100)/10==7) x=1;
	if(n/100==7) x=1;
	if(x)cout<<"Yes"<<endl;
	else cout<<"No"<<endl ;
	return 0;
}

Measured memory_bytes: 3620
import numpy
N=int(input())
S=input()
S_modify = list(map(int,S.replace('.','0').replace('#','1')))
count_list = []

sum_list=numpy.cumsum(S_modify)
sum_list_reverse=numpy.cumsum(S_modify[::-1])
for i in range(N):
    count = sum_list[i]+((N-i-1)-sum_list_reverse[N-i-1])
    count_list.append(count)
print(min(count_list))

Measured memory_bytes: 34976
/**
 *    author:  tourist
 *    created: 06.01.2020 23:01:53       
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<vector<int>> g(n);
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    --x; --y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  vector<int> was(n, 0);
  deque<int> path(1, 0);
  was[0] = 1;
  while (true) {
    bool found = false;
    for (int x : g[path.back()]) {
      if (!was[x]) {
        path.push_back(x);
        was[x] = 1;
        found = true;
        break;
      }
    }
    if (!found) {
      break;
    }
  } 
  while (true) {
    bool found = false;
    for (int x : g[path.front()]) {
      if (!was[x]) {
        path.push_front(x);
        was[x] = 1;
        found = true;
        break;
      }
    }
    if (!found) {
      break;
    }
  } 
  cout << path.size() << '\n';
  for (int i = 0; i < (int) path.size(); i++) {
    if (i > 0) {
      cout << " ";
    }
    cout << path[i] + 1;
  }
  cout << '\n';
  return 0;
}


Measured memory_bytes: 7168
#include <stdio.h>

int main(void) {
	int H, W;
	char a[100][101], b[102][102];
	
	scanf("%d %d", &H, &W);
	
	for (int i = 0; i < H; i++) {
		scanf("%s", a[i]);
	}
	
	for (int i = 0; i < H + 2; i++) {
		for (int j = 0; j < W + 2; j++) {
			b[i][j] = '#';
		}
	}
	
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			b[i + 1][j + 1] = a[i][j];
		}
	}
	
	for (int i = 0; i < H + 2; i++) {
		for (int j = 0; j < W + 2; j++) {
			printf("%c", b[i][j]);
		}
		printf("\n");
	}
	
	return 0;	
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define ll long long
#define ld long double
#define vi vector<long long>
#define mkp make_pair
#define sz(x) (int)x.size()
#define pi pair<long long, long long>
#define watch(x) cout << (#x) << " is " << (x) << endl; cout.flush()
#define endl '\n'
#define _ << ' '
#define min3(a, b, c) min(a, min(b, c))
#define min4(a, b, c, d) min(min(a, d), min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define max4(a, b, c, d) max(max(a, d), max(b, c))
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> idxset;
//find_by_order(i) : iterator to the value at index i, order_of_key(x) : the index of value x
const ll mod = (ll)1e9+7;
const ll INF = (ll)1e9+1;

int n;
int a[100][10];
int p[100][11];

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    #ifndef ONLINE_JUDGE
    //freopen("A.txt", "r", stdin);
    #endif
    cin >> n;
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<10; j++)
        {
            cin >> a[i][j];
        }
    }
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<=10; j++)
        {
            cin >> p[i][j];
        }
    }
    int M = (1<<10), ans=-INF;
    for(int mask=1; mask<M; mask++)
    {
        int tot=0;
        for(int i=0; i<n; i++)
        {
            int cur=1, cnt=0;
            for(int c=0; c<10; c++)
            {
                if((mask&cur)&&a[i][c])
                {
                    cnt++;
                }
                cur <<= 1;
            }
            tot += p[i][cnt];
        }
        ans = max(ans, tot);
    }
    cout << ans;
}



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

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

    int m, nmin, nmax;
    while (cin >> m >> nmin >> nmax, m||nmin||nmax) {
        vector<int> P(m);
        for (int i = 0; i < m; i++) cin >> P[i];

        int max_gap = -1;
        int ans_n = 0;
        for (int i = nmin; i <= nmax; i++) {
            int gap = P[i-1] - P[i];
            if (gap >= max_gap) {
                max_gap = gap;
                ans_n = i;
            }
        }

        cout << ans_n << endl;
    }

    return 0;
}

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

typedef long long int ll;

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n, r;
    
    cin >> n >> r;
    
    if (n >= 10)
        cout << r << "\n";
    else
        cout << r + 100 * (10 - n) << "\n";

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define ll long long
#define vi vector<int>
#define pi pair<int,int>
#define mp make_pair

#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
#define int ll
const int mod=1e9+7;
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<typename A,typename B> istream& operator>>(istream&,pair<A,B>&);
template<typename A> istream& operator>>(istream&,vector<A>&);
void add(int&,int);
int mul(int,int);
int powz(int,int);
int sub(int,int);
template<typename A> ostream& operator<<(ostream&,vector<A>&);

const int N=500001;
int n,k;
int flag=0;
vi adj[N];
int dfs(int u,int p,int ps){
	int cn=k-2;
	if(p==-1){
		cn++;
	}
	int an=ps;
	for(auto i:adj[u]){
		if(i!=p){
			if(cn<=0){
				flag++;
			}
			an=mul(an,dfs(i,u,cn));
			cn--;
		}
	}
	return an;
	
}
	
void solve(){
	cin>>n>>k;
	for(int i=0;i<n-1;i++){
		int a,b;
		cin>>a>>b;
		a--;b--;
		adj[a].pb(b);
		adj[b].pb(a);
	}
	int ans=dfs(0,-1,k);
	if(flag)cout<<0;
	else
	cout<<ans;
	
	
}
	
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int tc=1;
	//~ cin>>tc;
	for(int _=0;_<tc;_++){
		//~ cout<<"Case #"<<_+1<<": ";
		solve();
		if(_!=tc-1)
		cout<<"\n";
	}
}
 
int mul(int a,int b)
{
	return ((a)*1ll*(b))%mod;
}
 
void add(int &a,int b)
{
	a+=b;
	if(a>=mod)a-=mod;
}

int sub(int a,int b){
	a-=b;
	if(a<0){
		a+=mod;
	}
	return a;
}
 
int powz(int a,int b)
{
	int res=1;
	while(b)
	{
		if(b&1)res=mul(res,a);
		b/=2;
		a=mul(a,a);
	}
	return res;
}
 
template <typename A, typename B>
istream& operator>>(istream& input,pair<A,B>& x) {
	input>>x.F>>x.S;
	return input;
}
 
template <typename A>
istream& operator>>(istream& input,vector<A>& x) {
	for(auto& i:x)
		input>>i;
	return input;
}
 
template<typename A>
ostream& operator<<(ostream& output,vector<A>& x) {
	for(auto& i:x)
	    output<<i<<' ';
	return output;	
}


Measured memory_bytes: 19840
/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
     public static int minCost(int []h , int curr_ind , int n , int []dp , int curr_cost){
	        if(curr_ind > n-1  )
	        return 0;
	        
	        if(dp[curr_ind]!=-1) return dp[curr_ind];
	        
	        
	        int a = (Math.abs(h[curr_ind] - h[curr_ind + 1]) + minCost(h , curr_ind + 1 , n ,dp , 0)) ;
	        
	        int b = Integer.MAX_VALUE;
	        
	        if(curr_ind+2<=n){
	        b =   (Math.abs(h[curr_ind] - h[curr_ind + 2]) + minCost(h , curr_ind + 2 , n ,dp , 0)) ;
	        }
	        
	        return dp[curr_ind] =  Math.min(  a, b );
	        
	        
	    }
    
	public static void main (String[] args) throws java.lang.Exception
	{
	    
	   
	    
	    
		// your code goes here
		 Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = sc.nextInt();
		int h[] = new int[n+1];
		for(int i =1;i<=n;i++){
		    h[i] = sc.nextInt();
			}
			
			int dp[]=new int[n+1];
			for(int j =0;j<n+1;j++)
			dp[j] = -1;
			
			System.out.println(minCost(h , 1 , n , dp , 0));
	}
}


Measured memory_bytes: 62800
#include <bits/stdc++.h> 
using namespace std; 
long long divi[10000007];  
void findDivisors(int n) 
{ 

	 
	for(int i=0;i<=n;i++)
        divi[i] = 0;
	for (int i = 1; i <= n; i++) { 

		for (int j = 1; j * i <= n; j++) 
			divi[i * j]++; 
	} 

    long long int ans = 0;
	for (long long i = 1; i <= n; i++) 
		ans+=(long long)(i*divi[i]);
    cout << ans << endl; 
} 

// Driver code 
int main() 
{ 
	int n;
    cin >> n; 
	findDivisors(n); 

	return 0; 
} 


Measured memory_bytes: 81716
// abc154_b
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <type_traits>
#include <typeindex>
#include <unordered_map>
#include <unordered_set>
#endif

template <typename A, typename B> bool cmin(A &a, const B &b) {
  return a > b ? (a = b, true) : false;
}
template <typename A, typename B> bool cmax(A &a, const B &b) {
  return a < b ? (a = b, true) : false;
}
const double PI = acos(-1);
const double EPS = 1e-9;
int inf = sizeof(int) == sizeof(long long) ? 2e18 : 1e9 + 10;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main()
{
  string s;
  cin>>s;
  int strSize=(int)s.size();
  rep(i,strSize){
    cout<<"x";
  }
  cout<<endl;
  return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    map<int, int> mp;
    rep(i, 0, n){
        int a, b;
        cin >> a >> b;
        mp[a] += b;
    }
    int now = 0;
    for(auto i : mp){
        now += i.second;
        if(now >= k){
            cout << i.first << endl;
            return 0;
        }        
    }
}

Measured memory_bytes: 4224
# initialize stack
Stack = []

A = [i for i in input().split()]

for inputData in A:
    if inputData == "+":
        x = Stack.pop()
        y = Stack.pop()
        Stack.append(x+y)

    elif inputData == "-":
        y = Stack.pop()
        x = Stack.pop()
        Stack.append(x-y)

    elif inputData == "*":
        x = Stack.pop()
        y = Stack.pop()
        Stack.append(x*y)

    else:
        Stack.append(int(inputData))

print(Stack[0])


Measured memory_bytes: 5604
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

using smallpque = priority_queue<ll,vector<ll>,greater<ll> >;

const int VMAX = 1e6+10, EMAX = 1e6+10;
int V,E;

class UnionFind{
  private:
    vector<int> Parent;
  public:
    UnionFind(int N){
      Parent = vector<int>(N,-1);
    }

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

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

    bool unite(int x, int y){
      x = find(x);
      y = find(y);
      if(x==y) return false;

      if(size(x)<size(y))swap(x,y);
      Parent[x] += Parent[y];
      Parent[y] = x;
      return true;
    }

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

int main(void){
  SPEEDUP
  cout << setprecision(15);
  cin >> V >> E;
  vector<ll> cost(V);
  UnionFind uni = UnionFind(V);
  rep(v,V)cin >> cost[v];
  rep(e,E){
    int x,y;cin >> x >> y;
    uni.unite(x,y);
  }

  if(V-1==E){
    cout << 0 << endl;
    return 0;
  }
  vector<smallpque> spques(V);
  rep(v,V) spques[uni.find(v)].push(cost[v]);
  smallpque pque;
  ll ans = 0;
  int count = 0;
  rep(v,V){
    if(uni.find(v)!=v)continue;
    ++count;
    ans += spques[v].top();
    spques[v].pop();
    while(!spques[v].empty()){
      pque.push(spques[v].top());
      spques[v].pop();
    }
  }
  rep(i,2*(V-E-1)-count){
    if(pque.empty()){
      cout << "Impossible" << endl;
      return 0;
    }
    ans += pque.top();
    pque.pop();
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 7680
n,k=map(int,input().split())
A=list(map(int,input().split()))
for i in range(k):
  B=[0]*(n+1)
  for j in range(n):
    B[max(0,j-A[j])]+=1
    B[min(n,j+A[j]+1)]-=1
  A[0]=B[0]
  for j in range(1,n):
    A[j]=A[j-1]+B[j]
  if A==[n]*n:
    print(*A)
    exit()
print(*A)

Measured memory_bytes: 169092
N, *H = map(int, open(0).read().split())
diff = [H[i + 1] - H[i] <= 0 for i in range(N - 1)]

ans = 0
tmp = 0
for v in diff:
    if v:
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0
        

print(max(ans, tmp))


Measured memory_bytes: 71228
#pragma GCC optimize("O3,no-stack-protector")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target("avx")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <random>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>

using namespace std;

#define rep(i, n) for (int i = 0; i < n; i++) //0から
#define REP(i, n) for (int j = i; j < n; j++) //iから
#define in(a) cin >> a
#define out(a) cout << a << endl
typedef long long ll;

//cout<<fixed<<setprecision(10);

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

    int n;
    cin >> n;
    vector<int> a(n), end;
    rep(i, n) {
        cin >> a[i];
    }

    end.push_back(a[0]);
    int ans = 0;
    for (int i = 1; i < n; i++) {
        for (int j = 0; j < end.size(); j++) {
            if (a[i] > end[j]) {
                end[j] = a[i];
                a[i] = -1;
                break;
            }
        }
        if (a[i] != -1) {
            end.push_back(a[i]);
        }
    }

    ans = end.size();

    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 1276
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


using i64 = ::std::int_fast64_t;
using u64 = ::std::uint_fast64_t;
using i32 = ::std::int_fast32_t;
using u32 = ::std::uint_fast32_t;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

int main() {
  char alpha;
  std::cin >> alpha;
  std::cout << (std::isupper(alpha) ? 'A' : 'a') << std::endl;
  return 0;
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int H,W,N,K;
int A[51][51];

int ask(int a,int b,int c,int d) {
	int r;
	_P("? %d %d %d %d\n",a,b,c,d);
	fflush(stdout);
	scanf("%d",&r);
	return r;
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	scanf("%d%d%d%d",&H,&W,&N,&K);
	ll ret=0;
	ll p2=1;
	FOR(y,H) FOR(x,W) {
		A[y][x]=ask(y,x,y,x);
		ret += A[y][x]*p2%K;
		p2=p2*2%K;
	}
	_P("! %lld\n",ret%K);
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}


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

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

    char c = N.at(N.size() - 1);
    if (c == '3')
    {
        cout << "bon" << endl;
    }
    else if (c == '0' || c == '1' || c == '6' || c == '8')
    {
        cout << "pon" << endl;
    }
    else
    {
        cout << "hon" << endl;
    }
}

Measured memory_bytes: 3628
from collections import Counter
from functools import reduce
# import statistics
import bisect
import copy
import fractions
import math
import pprint
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers):
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))
def unite(x, y):
    # それぞれのノードの根を求める
    x = root(x)
    y = root(y)
    if x == y:
        return
    # node[x]の根をyに変更する
    node[x] = y
def same(x,y): return bool(root(x) == root(y))
def root(x):
    if node[x] == x:  # xが根の場合
        return x
    else:
        node[x] = root(node[x])  # 経路圧縮
        return node[x]
def dfs(v):
    # ノードに訪れた
    visited[v] = True
    for v2 in range(n):
        if graph[v][v2] == False:  # そもそもvとv2が辺でつながっていない
            continue
        if visited[v2] == True:  # もう見た
            continue
        dfs(v2)


H, W = MI()
mini_a = INF
mini_b = INF
mini1 = INF
mini2 = INF
mini3 = INF
mini4 = INF
for h in range(1,H):
    sa = h * W
    sb = (H-h) * math.floor(W/2)
    sc = (H-h) * (W - math.floor(W/2))
    sd = (math.floor((H-h)/2)) * W
    se = (H-h-math.floor((H-h)/2)) * W
    mini1 = min(mini1, max(sa,max(sb,sc)) - min(sa,min(sb,sc)))
    mini2 = min(mini2, max(sa,max(sd,se)) - min(sa,min(sd,se)))
    mini_a = min(mini1,mini2)
for w in range(1,W):
    sa = H * w
    sb = (W-w) * math.floor(H/2)
    sc = (W-w) * (H - math.floor(H/2))
    sd = (math.floor((W-w)/2)) * H
    se = (W-w-math.floor((W-w)/2)) * H
    mini3 = min(mini3, max(sa,max(sb,sc)) - min(sa,min(sb,sc)))
    mini4 = min(mini4, max(sa,max(sd,se)) - min(sa,min(sd,se)))
    mini_b = min(mini3,mini4)
print(min(mini_a,mini_b))


Measured memory_bytes: 8116
#include<cstdio>
#include<cmath>
#include<climits>
#include<algorithm>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<utility>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<unordered_set>
#include<unordered_map>
#include<set>
#include<map>
#include<list>

using namespace std;
using ll = long long;

#define in(s) cin >> s
#define out(s) cout << s << endl
#define rep(i,n) for(int i=0; i<n; i++)
#define rept(i,a,b) for(int i=a; i<b; i++)
#define pcnt __builtin_popcount
#define pcntll(x) __builtin_popcountll(x)
#define DMAX DBL_MAX;
#define IMIN INT_MIN;
#define IMAX INT_MAX;

const long long MOD = 1e9+7;
const long long MAX = 3e5+1;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);

    int K;
    string S;
    in(K);
    in(S);

    int n = S.size();
    if (n <= K) out(S);
    else {
        S = S.substr(0, K);
        S += "...";
        out(S);
    }

    return 0;
}


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

int main()
{
    cin.tie(0); ios::sync_with_stdio(false);
    string S;
    int N;
    int P;
    cin >> N >> P >> S;

    ll ans = 0;
    if(10%P==0)
    {
        for(int i=0;i<N;++i)
        {
            if((S[i]-'0') % P == 0)
            {
                ans+=i+1;
            }
        }
        cout << ans << endl;
        return 0;
    }

    
    vector<int> cnt(P);
    int cu=0;
    int ten=1;
    for(int i=N-1;i>=0;--i)
    {
        cu = (cu+ten*(S[i]-'0')) % P;
        ten=(ten*10)%P;
        ans+=cnt[cu];
        if(cu==0)
        {
            ans++;
        }
        cnt[cu]++;
    }
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 720
#include<iostream>
#include<string>
#include<map>
using namespace std;
map<string,int> table;
int main(){
    string word,longest,frequent;
    size_t N=0;
    while(cin>>word){
        table[word]+=1;
        if(table[word]>N){
            N=table[word];
            frequent=word;}
        if(word.size()>longest.size()){
                longest=word;
        }
        
    }
    cout<<frequent<<" "<<longest<<endl;
    return 0;
}

Measured memory_bytes: 3152
import sys
import os
import bisect
from operator import itemgetter

N, M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
B = [ 0  for _ in range(M)]
for i in range(M):
    b,c = map(int,input().split())
    B[i] = [b,c]
B = sorted(B,key=itemgetter(1),reverse=True)
ans = 0
for i in range(M):
    id = bisect.bisect_left(A,B[i][1])
    if id > 0:
        for j in range(min(B[i][0],id+1)):
            if len(A) > 0 and A[0] < B[i][1]:
                ans += B[i][1]
                del A[0]
    else:
        break
print(sum(A)+ans)


Measured memory_bytes: 25916
#include<stdio.h>
int main(void)
{
	int a;
	int b;
	int c;
	int d;
	scanf("%d", &a);
	b = a / 3600;
	c = (a % 3600) / 60;
	d = (a % 3600) % 60;
	printf("%d:%d:%d\n", b, c, d);
	return 0;
}


Measured memory_bytes: 2116
#include<iostream>
#include<algorithm>
#include<string>
#include<set>
#include<math.h>
using namespace std;

int main(){
    string divide[4] = {"maerd", "remaerd", "esare", "resare"};
    string S, T;
    cin >> S;
    reverse(S.begin(), S.end());
    //cout << S << endl;
    
    bool can = true;
    for(int i=0; i<S.size();){
        bool can2 = false; // 4 個の文字列たちどれかで divide できるか
        for(int j=0; j<4; ++j){
            string d = divide[j];
            if(S.substr(i, d.size()) == d) { // d で divide できるか
                can2 = true;
                i += d.size(); // divide できたら i を進める
            }
        }
        if (!can2) { // divide できなかったら
            can = false;
            break;
        }
    }
    if (can) cout << "YES" << endl;
    else cout << "NO" << endl;
    
    
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

typedef long long ll;

const ll MOD = 1000000000+7;

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

    int N = S.size();

    vector<int> ans(N);

    int i = 0;
    while (i < N) {
        int r = 0, l = 0;

        while (S[i+r] == 'R') r++;
        while (S[i+r+l] == 'L') l++;

        ans[i+r-1] = (r+1) / 2 + l / 2;
        ans[i+r] = r / 2 + (l+1) / 2;

        i+= r+l;
    }

    for (int i = 0; i < N; i++) {
        cout << ans[i] << (i < N-1 ? " ": "\n");
    }
}


Measured memory_bytes: 1024
'''
INPUT SHORTCUTS
N, K = map(int,input().split())
N ,A,B = map(int,input().split())
string = str(input())
arr = list(map(int,input().split()))
N = int(input())
'''

string = str(input())
ans = [ 'x' for _ in range(len(string)) ]
print(''.join(ans))

Measured memory_bytes: 38256
from collections import defaultdict

N, M = map(int, input().split())
a_list = list(map(int, input().split()))

num_dict = defaultdict(int)
for a in a_list:
    num_dict[a] += 1
for _ in range(M):
    b, c = map(int, input().split())
    num_dict[c] += b

ans = 0
num_list = sorted(num_dict.items(), key=lambda x: x[0], reverse=True)

for num, cnt in num_list:
    for _ in range(cnt):
        ans += num
        N -= 1
        if N == 0:
            print(ans)
            exit()

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

using namespace std;

using int64 = long long;


int main() {
  int H, W;
  string S[50];

  cin >> H >> W;
  for(int i = 0; i < H; i++) cin >> S[i];

  const int vy[] = {1, 0, -1, 0};
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) {
      if(S[i][j] == '#') {
        bool f = false;
        for(int k = 0; k < 4; k++) {
          int ny = i + vy[k], nx = j + vy[(k + 1) % 4];
          if(ny < 0 || nx < 0 || ny >= H || nx >= W) continue;
          if(S[ny][nx] == '#') f = true;
        }
        if(!f) {
          puts("No");
          exit(0);
        }
      }
    }
  }
  puts("Yes");
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
	int a,b,d[10000];
	int i=1,j;
	char c;
	while(1){
		scanf("%d %c %d",&a,&c,&b);
		if(c=='?')break;
		else if(c=='+')d[i]=a+b;
		else if(c=='-')d[i]=a-b;
		else if(c=='*')d[i]=a*b;
		else if(c=='/')d[i]=a/b;
		i++;
	}
	for(j=1;j<i;j++)printf("%d\n",d[j]);
	return 0;
}



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

int main()
{
    long N,K,r;
    r=0;
    cin >>N>>K;
    vector<long>H(N);
    for(int i=0;i<N;i++){
        cin>>H.at(i);
    }
    sort(H.begin(),H.end());
    reverse(H.begin(),H.end());

    for(int i=K;i<N;i++){
        r+=H.at(i);
    }
    cout<<r<<endl;
}

Measured memory_bytes: 1920
#include<stdio.h>
int main(){
  int a, b, c, count=0, i;
  scanf("%d %d %d", &a, &b, &c);
  for(i=a;i<=b;i++){
    if(c%i==0){
      count ++;
    }
  }
  printf("%d\n", count);
  return 0;
}

Measured memory_bytes: 1852
from operator import mul
from functools import reduce

def nCr(n, r):
    r = min(r, n-r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n-r, -1), 1)
    under = reduce(mul, range(1, r+1), 1)
    return over // under

A = input()
strs = set(list(A))

ans = len(A) * (len(A)-1) // 2
for s in strs:
    num = A.count(s)

    if num >= 2:
        ans -= nCr(num, 2)

print(ans+1)

Measured memory_bytes: 5464