akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;

#define INIT_MIN_PRICE 3000000

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

  int lst_c[N], arr_a[N][M];
  rep(i, N) {
    cin >> lst_c[i];
    rep(j, M) cin >> arr_a[i][j];
  }

  int min_price = INIT_MIN_PRICE;
  for (int flag = 0; flag < (1 << N); flag++) {
    int price = 0;
    int lst_skill[M];
    rep(i, M) lst_skill[i] = 0;
    rep(i, N) {
      if (flag >> i & 1) {
        price += lst_c[i];
        rep(j, M) lst_skill[j] += arr_a[i][j];
      }
    }

    int is_enough = 1;
    rep(i, M) is_enough &= (lst_skill[i] >= X);
    if (is_enough && (min_price > price)) min_price = price;
  }

  if (min_price == INIT_MIN_PRICE) {
    cout << -1 << endl;
  } else {
    cout << min_price << endl;
  }

  return 0;
}


Measured memory_bytes: 3636
//#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <vector>
#include <string>

//Some constants don't work
#ifndef INT_MAX
#define INT_MAX 2147483647
#endif
#ifndef INT_MIN
#define INT_MIN -2147483648
#endif
//short hand tricks
typedef long long ll;

using namespace std;

int main(int argc, char * argv[]) {
    ios_base::sync_with_stdio(false);
    int N;
    cin >> N;
    string s;
    cin >> s;
    //two pointers approach
    //WRWWRWRR
    //RRWWRWRW 1
    //RR WWRW RW
    //solution will be in the format of
    //RRR.. WWWW..
    //Red prefix white suffix
    //make the longest R prefx and W suffix possible
    // then count the number of R W out of order
    int right=N-1;
    int left = 0;
    int ops = 0;
    while(left<N && right>=0 && left<=right) {
        while(left<N && s[left]=='R') {
            left++;
        }
        while(right>=0 && s[right]=='W') {
            right--;
        }
        if(left<N && right>=0 && left<right) {
            swap(s[left], s[right]);
            ops++;
        }
    }
    cout << ops << "\n";
    return 0;
}


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

using namespace std;
using ll = long long;

const vector<vector<int>> dir4 = {{0, 1}, {1, 0}, {-1, 0}, {0, -1}};
const vector<vector<int>> dir8 = {{0, 1}, {1, 0}, {-1, 0}, {0, -1}, {1, 1}, {-1, 1}, {1, -1}, {-1, -1}};

int main()
{
	int h, w;
	cin >> h >> w;
	vector<vector<bool>> grid(h + 2, vector<bool>(w + 2, true));
	vector<vector<int>> dist(h + 2, vector<int>(w + 2, 0));
	queue<pair<int,int>> que;

	for(int i = 1; i <= h; i++) {
		for(int j = 1; j <= w; j++) {
			char c; cin >> c;
			grid[i][j] = (c == '#');
			if(c == '#') {
				que.emplace(i, j);
			}else {
				dist[i][j] = -1;
			}
		}
	}

	while(que.size()) {
		auto cur = que.front(); que.pop();
		for(auto d : dir4) {
			if(dist[cur.first + d[0]][cur.second + d[1]] != -1)continue;
			dist[cur.first + d[0]][cur.second + d[1]] = dist[cur.first][cur.second] + 1;
			que.emplace(cur.first + d[0], cur.second + d[1]);
		}
	}

	//for(int i = 1; i <= h; i++) {for(int j = 1; j <= w; j++)cout << dist[i][j] << " "; cout << endl;}

	int nax = 0;
	for(int i = 0; i <= h; i++) {
		nax = max(nax, *max_element(dist[i].begin(), dist[i].end()));
	}
	cout << nax << endl;
}

Measured memory_bytes: 12560
#include <bits/stdc++.h> 
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define _GLIBCXX_DEBUG
typedef long long ll;
using namespace std;
int main(){
  ll n;
  cin>>n;
  ll m=sqrt(n);
  ll k;
  for(int j=m;j>0;j--){
    if(n%j==0){k=j;break;}}
  cout<<k+n/k-2<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
#define all(v) (v).begin(), (v).end()
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int N, M;
	cin >> N >> M;
	ll input[N][3];
	rep(i, 0, N) cin >> input[i][0] >> input[i][1] >> input[i][2];

	ll rsl = -(1ll << 60);
	for(int mask = 0; mask < 1 << 3; mask++) {
		vector<ll> v;
		rep(j, 0, N) {
			ll tmp = 0;
			rep(i, 0, 3) {
				if(mask & 1 << i) {
					tmp += input[j][i];
				} else tmp -= input[j][i];
			}
			v.push_back(tmp);
		}
		sort(v.begin(), v.end());
		reverse(v.begin(), v.end());
		ll tmp = 0;
		rep(i, 0, M) tmp += v[i];
		rsl = max(rsl, tmp);
	}

	cout << rsl << endl;

}


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

dp=[-1]*(n)
dp[0]=0
dp[1]=abs(h[1]-h[0])
for i in range(2,n):
	dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]))

print(dp[n-1])

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define rep(i,k,n) for (ll i = k; i < n; ++i)
#define inputar(a,n) ll a[n];rep(i,0,n)cin>>a[i]
#define PI 3.14159265
const int MOD=1e9+7;
const int N=1e5+10;


#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a)  (a).begin(),(a).end()


#define test4(x,y,z,a) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<"		a is "<<a<<endl;
#define test3(x,y,z) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<endl;
#define test2(x,y) cout<<"x is "<<x<<"		y is "<<y<<endl;
#define test1(x) cout<<"x is "<<x<<endl;

bool isPrime(int n) 
{ 
    if (n <= 1) 
        return false; 
    for (int i = 2; i < n; i++) 
        if (n % i == 0) 
            return false; 
  
    return true; 
} 
int binomialCoeff(int n, int k)  
{
    if (k == 0 || k == n)  
        return 1;  

    return binomialCoeff(n - 1, k - 1) +  
                binomialCoeff(n - 1, k);  
}  
long long power(ll a, ll b)
{
    ll ans=1;
    while(b)
    {
        if(b&1)
            ans=(ans*a)%MOD;
        b/=2;
        a=(a*a)%MOD;
    }
    return ans;
}

int gcd(int a, int b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b);  
      
}






int main()
{
    IOS;
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    float ans=a[0]*1.0;
    for(int i=0;i<n;i++)
    {
        ans=((ans+a[i])*1.0)/2.0;
        // cout<<ans<<endl;
    }
    cout<<ans<<endl;

}

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

int main() {
    int N, A[30], B[30], C[30];
    cin >> N;
    for (int i = 0; i < N; ++i) cin >> A[i];
    for (int i = 0; i < N; ++i) cin >> B[i];
   	for (int i = 0; i < N-1; ++i) cin >> C[i];

   	int ans = 0;
    for (int i = 0; i < N; ++i) ans += B[i];
    for (int i = 0; i < N-1; ++i) {
    	if(A[i]+1 == A[i+1]) ans += C[A[i]-1];
    }	
	cout << ans << endl;
	return 0;
}

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

#define REP(_i, _cnt) for(int _i = 0; _i < _cnt; _i++)
#define MP make_pair
#define PB push_back
#define FI first
#define SE second

#define MAX_N 110000

using namespace std;

class UnionFind {
  public :
    void init(int n) {
      par.resize(n + 1);
      rnk.resize(n + 1);
      for (int i = 0; i <= n; i++) {
        par[i] = i;
        rnk[i] = 0;
      }
    }
    
    int find(int x) {
      if (par[x] == x) return x;
      else return par[x] = find(par[x]);
    }

    void unite(int x, int y) {
      x = find(x); y = find(y);
      if (x == y) return;
      
      if(rnk[x] < rnk[y]) {
        par[x] = y;
      } else {
        par[y] = x;
        if (rnk[x] == rnk[y]) rnk[x]++;
      }
    }

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

  private:
    vector<int> par;
    vector<int> rnk;
};

int main()
{
  vector<pair<int, int>> vx;
  vector<pair<int, int>> vy;
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int x, y;
    cin >> x >> y;
    vx.PB(MP(x, i));
    vy.PB(MP(y, i));
  }
  sort(vx.begin(), vx.end());
  sort(vy.begin(), vy.end());

  vector<pair<int, pair<int, int>>> edge;
  for (int i = 0; i < N - 1; i++) {
    int v1, v2, cost;

    v1 = vx[i].SE;
    v2 = vx[i + 1].SE;
    cost = vx[i + 1].FI - vx[i].FI;
    edge.PB(MP(cost, MP(v1, v2)));

    v1 = vy[i].SE;
    v2 = vy[i + 1].SE;
    cost = vy[i + 1].FI - vy[i].FI;
    edge.PB(MP(cost, MP(v1, v2)));
    
  }
  sort(edge.begin(), edge.end());

  UnionFind uf;
  uf.init(N);
  int ans = 0;
  for (auto e : edge) {
    int v1 = e.SE.FI;
    int v2 = e.SE.SE;
    int cost = e.FI;
    if (! uf.same(v1, v2)) {
      ans += cost;
      uf.unite(v1, v2);
    }
  }
  cout << ans << endl;

  return 0;
}


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

namespace _001_FindingMissingCards
{

    class Program
    {
        static void Main()
        {

            string line1 = Console.ReadLine();
            int num = Convert.ToInt32(line1);
            int ScoreTaro = 0, ScoreHanako = 0;


            for (int i = 0; i < num; i++)
            {
                string inputWords = Console.ReadLine();
                string[] inputWordsSplit = inputWords.Split(' ');
                string wordTaro = inputWordsSplit[0];
                string wordHanako = inputWordsSplit[1];
                int iCompare = string.Compare(wordTaro,wordHanako);

                if (iCompare == 0)
                {
                    ScoreTaro += 1;
                    ScoreHanako += 1;
                }
                else if (iCompare < 0)
                {
                    ScoreHanako += 3;
                }
                else
                {
                    ScoreTaro += 3;
                }
                
            }
            Console.WriteLine("{0} {1}", ScoreTaro, ScoreHanako);
        }
    }
}

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

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int getRand(int l, int r)
{
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}
  
#define int long long 
#define pb push_back
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int,int>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define precise(x) fixed << setprecision(x) 

const int MOD = 1e9+7;

int mod_pow(int a,int b,int M = MOD)
{
    int res = 1;
    
    while(b)
    {
        if(b&1) res=(res*a)%M;
        a=(a*a)%M;
        b>>=1;
    }
    
    return res;
}

const int N = 1e6 + 10;

int fre[N];
int sieve[N];

void solve()
{
   int n;
    cin >> n;
    
   int a[n];
    f(i,n) cin >> a[i];
    
   f(i,n) fre[a[i]]++;
    
   for(int i=1;i<N;i++)
   {
       for(int j=i;j<N;j+=i) sieve[j]+=fre[i];
   }
    
   int res = 0;
    
   for(int i=0;i<n;i++) if(sieve[a[i]] == 1) res++;
       
   cout <<res;
    
}

signed main()
{
    fast;
    
    int t = 1;
    
//    cin >> t;
    
    while(t--)
        
    solve();
}


Measured memory_bytes: 20696
#include<iostream>
#include<iomanip>

using namespace std;

int main()
{
    double W,H,x,y;cin >> W>> H >> x >> y;
    double S;
    cout<<fixed;
    cout << setprecision(12);
    S = W * H /2;
    cout << S << " ";

    if(2 * x == W && 2 * y == H)
    {
        cout << 1 << endl;
    }else
    {
        cout << 0<< endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <iomanip>
#include <ios>
using namespace std;
int main(void){
  int n;
  cin >> n;
  
  string s;
  cin >> s;
  
  int l = s.length();
  
  for(int i=0;i<l;i++){
    s[i] = 'A' + (s[i] - 'A' + n) % 26;
  }
  
  cout << s << endl;
  
  return 0;
}

  
  

Measured memory_bytes: 256
//#include"pch.h"
//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<iostream>

using namespace std;
int main() {

	int N, K;
	int x[100000];
	int ans = 1e9;

	cin >> N >> K;
	for (int i = 0; i < N; i++) {
		cin >> x[i];
	}
	sort(x, x + N);
	for (int i = 0; i < N; i++) {
		if (i + K - 1 == N)break;
		ans = min(ans, abs(x[i]) + abs(x[i + K - 1] - x[i]));
		ans = min(ans, abs(x[i + K - 1]) + abs(x[i + K - 1] - x[i]));
	}

	cout << ans << endl;

	return(0);
}


Measured memory_bytes: 640
#include <iostream>

using namespace std;

int n, x, ways;

int main()
{
    while(true)
    {
        cin >> n >> x;
        
        if(n == 0 && x == 0) { break; }
        
        ways = 0;
        
        for(int i = 1; i <= n; i++)
        {
            for(int j = i + 1; j <= n; j++)
            {
                if(x - i - j > j && x - i - j <= n)
                {
                    ways++;
                }
            }
        }
        
        cout << ways << endl;
    }
    
    return 0;
}

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

int m, n;
vector<P> v[100][2];
vector<int> e[100];
bool saw[100];

bool f(int x, int ori){
	if(x == ori && saw[x] == true) return false;
	if(saw[x]) return true;
	saw[x] = true;
	rep(i,e[x].size()){
		if(!f(e[x][i],ori)) return false;
	}
	return true;
}

int main(){
	cin >> m >> n;
	rep(i,m){
		int k; cin >> k;
		rep(j,k){
			int s ,t;
			string cond;
			cin >> s >> cond >> t;
			s--;
			if(cond[0] == '>'){
				v[s][0].push_back(P(t,i));
			} else{
				v[s][1].push_back(P(t,i));
			}
		}
	}
	rep(i,n){
		rep(j,v[i][0].size()){
			P p1 = v[i][0][j];
			rep(k,v[i][1].size()){
				P p2 = v[i][1][k];
				if(p1.first > p2.first){
					if(p2.second == p1.second){
						puts("No");
						return 0;
					}
					e[p2.second].push_back(p1.second);
				}
			}
		}
	}
	rep(i,m) sort(e[i].begin(),e[i].end());
	rep(i,m) e[i].erase(unique(e[i].begin(),e[i].end()),e[i].end());
	rep(i,m){
		rep(j,100) saw[j] = false;
		if(!f(i,i)){
			puts("No");
			return 0;
		}
	}
	puts("Yes");
}

Measured memory_bytes: 2152
import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True
def main():
    n = int(input())
    for k in range(n, n*n, 1):
        if is_prime(k):
            print(k)
            break

if __name__ == '__main__':
    main()


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


const int INF=1e+9;

int main(){
   int n;
   cin>>n;
   vector<int> a(n);

   for (int i = 0; i < n; ++i){
      cin>>a[i];
   }

   a.erase(unique(a.begin(), a.end()), a.end());

   int cnt=0;
   for (int i = 0; i < a.size(); ++i){
      cnt++;
      if(a[i]<a[i+1]){
         while(a[i]<a[i+1]&&i+1<n){
            i++;
         }
      }else{
         while(a[i]>a[i+1]&&i+1<n){
            i++;
         }
      }
   }

   cout<<cnt<<endl;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>

using namespace std;

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

const ll mod = 1000000007;

ll modinv(ll x, ll m = mod) {
  ll b = m;
  ll u = 1;
  ll v = 0;
  ll tmp;
  while (b) {
    ll t = x / b;
    x -= t * b;
    tmp = x;
    x = b;
    b = tmp;
    u -= t * v;
    tmp = u;
    u = v;
    v = tmp;
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}

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

  ll r1, c1, r2, c2;
  cin >> r1 >> c1 >> r2 >> c2;
  r1--;
  c1--;

  vector<ll> factorial(5000000);
  factorial[0] = 1;
  factorial[1] = 1;
  for (int i = 2; i < 5000000; i++) factorial[i] = (factorial[i-1] * i) % mod;

  ll r1c1 = ((((c1 + 2) * ((factorial[r1+c1+2] * modinv((factorial[r1] * factorial[c1+2]) % mod)) % mod)) % mod - r1 - 1) * modinv(r1 + 1)) % mod;
  ll r2c1 = ((((c1 + 2) * ((factorial[r2+c1+2] * modinv((factorial[r2] * factorial[c1+2]) % mod)) % mod)) % mod - r2 - 1) * modinv(r2 + 1)) % mod;
  ll r1c2 = ((((c2 + 2) * ((factorial[r1+c2+2] * modinv((factorial[r1] * factorial[c2+2]) % mod)) % mod)) % mod - r1 - 1) * modinv(r1 + 1)) % mod;
  ll r2c2 = ((((c2 + 2) * ((factorial[r2+c2+2] * modinv((factorial[r2] * factorial[c2+2]) % mod)) % mod)) % mod - r2 - 1) * modinv(r2 + 1)) % mod;

  ll ans = (r2c2 - r1c2 - r2c1 + r1c1) % mod;
  if (ans < 0) ans += mod;

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 39296
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = (s), i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = (s), i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = (s); i < (n); ++i)
#define VFORS(i, s, n) for(int i = (s); i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = (s), i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = (s), i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define REV(x) reverse(ALL(x))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

using ld = long double;
using ll = long long;
using ui = unsigned int;
using ull = unsigned long long;
using Pi_i = pair<int, int>;
using Pll_ll = pair<ll, ll>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;
using VULL = vector<ull>;

const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;
const double EPS = 1E-10;

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

void dfs(int rest, int used, string st){
    if(!rest){
        cout << st << endl;
        return;
    }
    REPS(i, used+1){
        char c = 'a' + i;
        if(i == used+1)
            dfs(rest-1, used+1, st+c);
        else dfs(rest-1, used, st+c);
    }
}

int main(){
    int N; cin >> N;
    dfs(N, -1, "");
    return 0;
}


Measured memory_bytes: 1536
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix

# strlist = "abcdefghijklmnopqrstuvwxyz"

rows = [int(input()) for _ in range(5)]

lis = []
for num in rows:
    if num%10 == 0:
        lis.append(num)
    else:
        num = (num//10 + 1)*10
        lis.append(num)

snum = sum(lis)
ans = snum
for i in range(5):
    var = snum - lis[i] + rows[i]
    ans = min(ans,var)

print(ans)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))


Measured memory_bytes: 3060
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

fn main() {
    input! {
        a: isize,
        b: isize,
        c: isize,
        d: isize,
    }

    let mut takahashi_monster_health = a;
    let mut aoki_monster_health = c;

    loop {
        aoki_monster_health -= b;
        if aoki_monster_health <= 0 {
            println!("Yes");
            break;
        }

        takahashi_monster_health -= d;
        if takahashi_monster_health <= 0 {
            println!("No");
            break;
        }
    }
}


Measured memory_bytes: 2116
n,k=map(int,input().split())
a=list(map(int,input().split()))
mod=10**9+7

if n==k:
  # n==kなら全部選ぶ必要がある
  ans=1
  for q in a:
    ans*=q
    ans%=mod
  print(ans)
  exit()
  
if all(q>=0 for q in a):
  # 全部正なら大きい方から
  ans=1
  a.sort()
  for _ in range(k):
    ans*=a.pop()
    ans%=mod
  print(ans)
  exit()

if all(q<0 for q in a):
  # 全部負なら
  # kが奇数の時は大きい方(絶対値が小さい方)から
  # kが偶数のときは小さい方(絶対値が大きい方)から
  ans=1
  a.sort()
  if k%2==0:
    for i in range(k):
      ans*=a[i]
      ans%=mod
  else:
    for _ in range(k):
      ans*=a.pop()
      ans%=mod
  print(ans)
  exit()
  
pos=[]
neg=[]
for q in a:
  if q>=0:
    pos.append(q)
  else:
    neg.append(q)

pos.sort()
neg.sort()
neg=neg[::-1]
# arr[-1]の絶対値が最大となるようにソート

kk=k
# kが奇数のときは、posの最大は絶対とって良い
if kk%2==1:
  ans=pos.pop()%mod
  kk=kk-1
else:
  ans=1

# 2個ずつ比較しながら掛け算
# 片方の長さが2に満たない場合は、もうそちらからは取らない
while kk>0:
  if len(pos)<2:
    ans=ans*neg.pop()%mod*neg.pop()%mod
    kk-=2
  elif len(neg)<2:
    ans=ans*pos.pop()%mod*pos.pop()%mod
    kk-=2
  else:
    if pos[-1]*pos[-2]>=neg[-1]*neg[-2]:
      ans=ans*pos.pop()%mod*pos.pop()%mod
      kk-=2
    else:
      ans=ans*neg.pop()%mod*neg.pop()%mod
      kk-=2
      
print(ans)


Measured memory_bytes: 109976
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#include <queue>
#include <climits>
#include <utility>
typedef long long ll;
using namespace std;

int main(void){
  int n, i;
  vector<ll> a;
  vector<ll> cnt;
  vector<pair<ll,ll> > com;

  cin >> n;
  a.resize(n);
  cnt.resize(n+1,0);
  com.resize(n+1);
  for(i=0;i<n;i++){
    cin >> a[i];
    ++cnt[a[i]];
  }

  ll sum = 0;

  for(i=0;i<=n;i++){
    if(cnt[i]>0){
      com[i].first = cnt[i] * (cnt[i]-1) / 2;
      com[i].second = (cnt[i]-1) * (cnt[i]-2) / 2;
    }
    else{
      com[i].first = com[i].second = 0;
    }

    sum += com[i].first;
  }

  for(i=0;i<n;i++){
    cout << sum - com[a[i]].first + com[a[i]].second << " ";
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 8832
N = int(input())
A = [int(x) for x in input().split()]

ans = 0
flag = True
while flag:
	for i in range(N):
		if A[i] % 2 == 0:
			A[i] = A[i] // 2
		else:
			flag = False
	if flag:
		ans += 1

print(ans)

Measured memory_bytes: 3060
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

w, h, x, y = getList()
ans = float(w * h / 2)
if x == w/2 and y == h/2 :
    ans2 = 1
else:
    ans2 = 0
print(ans, ans2)


Measured memory_bytes: 38384
n=int(input())
l=[]
cnt=0

for i in range(0,n):
            a=int(input())
            l.append(a)
j=0
for i in range(0,n+1):
            if l[j]!=2:
                        cnt+=1
                        j=int(l[j])-1
                        #print('j',j)
            else:
                         print(cnt+1)
                         exit()
print(-1)
exit()


Measured memory_bytes: 7084
let () =
  let rec f i j = match i with
    | 0 -> ""
    | _ -> (if j = 0 then "#" else ".") ^ f (i-1) ((j+1) mod 2) in
  let rec loop () = 
    let h, w = Scanf.scanf "%d %d\n" (fun h w -> h, w) in
    if h = 0 && w = 0 then ()
    else
      (for i = 1 to h do
        print_endline (f w ((i+1) mod 2))
      done;
      print_endline "";
      loop ())
  in loop ()

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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

int main() {
  ll n, mina = 0, minb = 0, suma = 0, sumb = 0;
  cin >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];

  rep(i, n) {
    suma += a[i];
    if (i % 2 == 0) {
      if (suma <= 0) {
        mina += abs(suma) + 1;
        suma += abs(suma) + 1;
      }
    } else {
      if (suma >= 0) {
        mina += abs(suma) + 1;
        suma -= abs(suma) + 1;
      }
    }
  }

  rep(i, n) {
    sumb += a[i];
    if (i % 2 != 0) {
      if (sumb <= 0) {
        minb += abs(sumb) + 1;
        sumb += abs(sumb) + 1;
      }
    } else {
      if (sumb >= 0) {
        minb += abs(sumb) + 1;
        sumb -= abs(sumb) + 1;
      }
    }
  }

  cout << min(mina, minb) << endl;
  return 0;
}


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

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

int main(){
    string S;
    cin >> S;
    int N = (int)S.size();
    vector<bool> used(30, false);
    if(N != 26){
        char w;
        rep(i, N) used[S[i] - 'a'] = true;
        rep(i, 26){
            if(!used[i]){
                w = char(i + 'a');
                break;
            }
        }
        S.push_back(w);
        cout << S << endl;
        return 0;
    }else{
        string T;
        T = S;
        bool exist = next_permutation(S.begin(), S.end());
        if(!exist){
            cout << -1 << endl;
            return 0;
        }
        string ans;
        rep(i, N){
            ans.push_back(S[i]);
            if(S[i] > T[i]){
                break;
            }
        }
        cout << ans << endl;
        return 0;
    }
}

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

using ll=int64_t;
#define int ll

#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(),x.end()
#ifdef MAROON_LOCAL
#define cerr (cerr<<"-- line "<<__LINE__<<" -- ")
#else
class CerrDummy{}cerrDummy;
template<class T>
CerrDummy& operator<<(CerrDummy&cd,const T&){
	return cd;
}
using charTDummy=char;
using traitsDummy=char_traits<charTDummy>;
CerrDummy& operator<<(CerrDummy&cd,basic_ostream<charTDummy,traitsDummy>&(basic_ostream<charTDummy,traitsDummy>&)){
	return cd;
}
#define cerr cerrDummy
#endif
#define REACH cerr<<"reached"<<endl
#define DMP(x) cerr<<#x<<":"<<x<<endl
#define ZERO(x) memset(x,0,sizeof(x))
#define ONE(x) memset(x,-1,sizeof(x))

using pi=pair<int,int>;
using vi=vector<int>;
using ld=long double;

template<class T,class U>
ostream& operator<<(ostream& os,const pair<T,U>& p){
	os<<"("<<p.first<<","<<p.second<<")";
	return os;
}

template<class T>
ostream& operator <<(ostream& os,const vector<T>& v){
	os<<"[";
	REP(i,(int)v.size()){
		if(i)os<<",";
		os<<v[i];
	}
	os<<"]";
	return os;
}

ll read(){
	ll i;
	scanf("%" SCNd64,&i);
	return i;
}

void printSpace(){
	printf(" ");
}

void printEoln(){
	printf("\n");
}

void print(ll x,int suc=1){
	printf("%" PRId64,x);
	if(suc==1)
		printEoln();
	if(suc==2)
		printSpace();
}

string readString(){
	static char buf[3341000];
	scanf("%s",buf);
	return string(buf);
}

char* readCharArray(){
	static char buf[3341000];
	static int bufUsed=0;
	char* ret=buf+bufUsed;
	scanf("%s",ret);
	bufUsed+=strlen(ret)+1;
	return ret;
}

template<class T,class U>
void chmax(T& a,U b){
	if(a<b)
		a=b;
}

template<class T,class U>
void chmin(T& a,U b){
	if(b<a)
		a=b;
}

template<class T>
T Sq(const T& t){
	return t*t;
}

#define CAPITAL
void Yes(bool ex=true){
	#ifdef CAPITAL
	cout<<"YES"<<endl;
	#else
	cout<<"Yes"<<endl;
	#endif
	if(ex)exit(0);
}
void No(bool ex=true){
	#ifdef CAPITAL
	cout<<"NO"<<endl;
	#else
	cout<<"No"<<endl;
	#endif
	if(ex)exit(0);
}

const ll infLL=LLONG_MAX/3;

#ifdef int
const int inf=infLL;
#else
const int inf=INT_MAX/2-100;
#endif

const int OpMax=50;
const int Vmax=51;

bool dp[2][51];
bool Sub(int src,int tar,vi op){
	ZERO(dp);
	int cur=0;
	dp[cur][src]=1;
	for(int i=OpMax;i>=1;i--){
		int nx=cur^1;
		ZERO(dp[nx]);
		REP(j,Vmax)dp[nx][j]=dp[cur][j];
		if(op[i-1])REP(j,Vmax)dp[nx][j%i]|=dp[cur][j];
		cur=nx;
	}
	return dp[cur][tar];
}

bool Waf(int n,vi a,vi b,vi op){
	bool ok=true;
	REP(i,n)
		if(!Sub(a[i],b[i],op))
			ok=false;
	return ok;
}

signed main(){
	int n=read();
	vi a(n),b(n);
	REP(i,n)a[i]=read();
	REP(i,n)b[i]=read();
	vi op(OpMax,1);
	if(!Waf(n,a,b,op)){
		cout<<-1<<endl;
		return 0;
	}
	for(int i=OpMax;i>=1;i--){
		op[i-1]=0;
		if(!Waf(n,a,b,op))
			op[i-1]=1;
	}
	int ans=0;
	REP(i,OpMax)
		ans+=op[i]*(int(1)<<(i+1));
	cout<<ans<<endl;
}


Measured memory_bytes: 384
using System;
using System.Collections.Generic;
using System.Text;

namespace codeTester.contest190629
{
    class ProblemA
    {
        static string value = "";
        static string answer = "";

        public static void Main(string[] args)
        {
            Input();
            Logic();
            Output();
        }

        static void Input()
        {
            value = Console.ReadLine();
        }

        static void Logic()
        {
            // １文字目と２文字目が同じ場合
            if (value[0] == value[1])
            {
                if (value[2] != value[0] && value[2] == value[3])
                {
                    answer = "Yes";
                }
                else
                {
                    answer = "No";
                }
                return;
            }

            // １文字目と２文字目が異なる場合
            int word1Count = 1;
            int word2Count = 1;
            if (value[2] == value[0])
            {
                word1Count++;
            }
            if (value[2] == value[1])
            {
                word2Count++;
            }
            if (value[3] == value[0])
            {
                word1Count++;
            }
            if (value[3] == value[1])
            {
                word2Count++;
            }
            if (word1Count == 2 && word2Count == 2)
            {
                answer = "Yes";
                return;
            }
            answer = "No";
        }

        static void Output()
        {
            Console.WriteLine(answer);
        }
    }
}


Measured memory_bytes: 11092
def main(argv)
  s = gets.chomp
  n = s.size + 1

  a = [0] * n
  s.size.times do |i|
    if s[i] == '<' then
      a[i + 1] = a[i] + 1
    else # s[i] == '>'
      a[i + 1] = a[i] - 1
    end
  end

  bs = []
  j = 0
  (s.size - 1).times do |i|
    if s[i] != s[i + 1] then
      bs.push(a[j..i + 1].dup)
      j = i + 1
    end
  end
  bs.push(a[j...a.size].dup)

  bs.each do |b|
    m = b.min
    if m < 0 then
      b.map!{|x| x += m.abs}
    elsif m > 0 then
      b.map!{|x| x -= m}
    end
  end

  (bs.size - 1).times do |i|
    m = [bs[i][bs[i].size - 1], bs[i + 1][0]].max
    bs[i][bs[i].size - 1] = m
    bs[i + 1][0] = m
  end

  bs.map!{|b| [b.reduce(:+), b[0]]}

  s = bs[0][0]
  (bs.size - 1).times do |i|
    s += bs[i + 1][0] - bs[i + 1][1]
  end
  puts s.to_s
end

if self.to_s == 'main' then
  main(ARGV)
end

Measured memory_bytes: 35724
n = int(input())
d = list(map(int,input().split()))

d.sort()

if n%2 == 0:
  ans = d[n//2] - d[n//2 - 1]
elif n%2 == 1:
  ans = d[n//2 + 1] - d[n//2 - 1]
  
print(ans)

Measured memory_bytes: 14396
#include <stdio.h>

int main()
{
	int a,b,c;
	scanf ("%d %d %d",&a,&b,&c);
	if (a+b<a+c && a+b<b+c)
	{
		printf ("%d\n",a+b);
	}
	else if (a+c<a+b && a+c<b+c)
	{
		printf ("%d\n",a+c);
	}
	else printf ("%d\n",b+c);
}

Measured memory_bytes: 128
<?php
$p='';
while(1){
  list($h,$w)=explode(' ',trim(fgets(STDIN)));
  if($h||$w){
 
    $la='';
    $lb='';
    for($i=0;$i<$w;$i++){
      if($i%2){$la.='#';$lb.='.';}
      else{$la.='.';$lb.='#';}
    }
    $la.=PHP_EOL;
    $lb.=PHP_EOL;
 
    for($i=0;$i<$h;$i++){$p.=($i%2)? $la:$lb;}
    $p.=PHP_EOL;
  }
  else break;
}
print $p;

Measured memory_bytes: 15524
N = int(input())
ans = ''
for i in range(1, 99):
    if N <= 26 ** i:
        N -= 1
        for j in range(i):
            ans += chr(ord('a') + N % 26)
            N //= 26
        break
    else:
        N -= 26 ** i
print(ans[::-1]) 

Measured memory_bytes: 9140
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 1000000007;

template<class _T> static void getint(_T& a) {
	const char* fmt = " %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld";
	}

	if (scanf(fmt, &a) < 0) {
		printf("g1int Error\n");
	}
}
template<class _T> static void getint(_T& a, _T& b) {
	const char* fmt = " %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld";
	}

	if (scanf(fmt, &a, &b) < 0) {
		printf("g2int Error\n");
	}
}
template<class _T> static void getint(_T& a, _T& b, _T& c) {
	const char* fmt = " %d %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld %lld";
	}

	if (scanf(fmt, &a, &b, &c) < 0) {
		printf("g3int Error\n");
	}
}

static void ABC042C();

#if 1
int main()
{
	ABC042C();
	fflush(stdout);
	return 0;
}
#endif

static void ABC042C()
{
	int N, K;
	getint(N, K);

	std::set<int> dn;
	for (int i = 0; i < K; i++) {
		int tmp;
		getint(tmp);
		dn.insert(tmp);
	}

	std::set<int> use;
	for (int i = 0; i < 10; i++) {
		if (dn.find(i) == dn.end()) {
			use.insert(i);
		}
	}
	int nowPrice = N;
	int digitCount = use.size();

	while (1) {
		int now = nowPrice;
		while (now) {
			int lsb = now % 10;
			if (use.find(lsb) == use.end()) {
				break;
			}
			now /= 10;
		}

		if (!now) break;
		nowPrice++;
	}

	printf("%d\n", nowPrice);
}


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

int main(){
	int n;
	long long int ans=0;
	cin>>n;
	vector<int> a(n+1);
	vector<int> b(n);
	for (int i = 0; i < n+1; i++) {
		cin>>a[i];
	}
	for (int i = 0; i < n; i++) {
		cin>>b[i];
	}
	for (int i = 0; i < n; i++) {
		ans+=min(b[i],a[i]);
		b[i]-=min(b[i],a[i]);
		ans+=min(b[i],a[i+1]);
		a[i+1]-=min(b[i],a[i+1]);
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std; 
string s;
int ans,x,a,f;
int main(){
    cin>>s;
    for(int i=0;i<=1;i++)
    {
    	a=s[i]-48;
    	x=x*10+a;
	}
	if(x<=12&&x>0) ans++,f=1;
	x=0;
	for(int i=2;i<=3;i++)
	{
		a=s[i]-48;
    	x=x*10+a;
	}
	if(x<=12&&x>0) ans++,f=2;
	if(ans==0) cout<<"NA";
	if(ans==2) cout<<"AMBIGUOUS";
	if(ans==1)
	{
		if(f==1) cout<<"MMYY";
		else cout<<"YYMM";
	}
	return 0;
} 

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

int main() {
 int n, k;
 cin >> n >> k;
 vector<int> h(n);
 rep(i, n) cin >> h[i];
 int count = 0;
 rep(i,n) {
   if(h[i] >= k) {
     count++;
   }
 }
 cout << count << endl;
}


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

int main() {
  long N,i,L[87],D = 0;cin >> N;
  L[0] = 2;L[1] = 1;
  for(i = 2 ; i <= N; i++){
    L[i] = L[i-1] + L[i-2];
  }
  cout << L[N];
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin,(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    string a,b;
    cin >> a >> b;
    if(a.length() > b.length()){
        cout << "GREATER" << endl;
        return 0;
    }
    else if(a.length() < b.length()){
        cout << "LESS" << endl;
        return 0;
    }

    REP(i,a.length()){
        if(a[i] > b[i]){
            cout << "GREATER" << endl;
            return 0;
        }
        else if(a[i] < b[i]){
            cout << "LESS" << endl;
            return 0;
        }
    }
    cout << "EQUAL" << endl;
    return 0;
}

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

int main(void){
    double W,H,x,y;
    double constant;
    scanf("%lf %lf %lf %lf",&W,&H,&x,&y);
//printf("%lld,%lld %lld %lld",W/2,x,H/2,y);
    constant=W*H;
    if ((x==W/2)&&(y==H/2)){
        printf("%f 1\n",constant/2);
    }
    else{
        printf("%f 0\n",constant/2);
    }
    return 0;
}

Measured memory_bytes: 128
import math

N = int(input())
log = int(math.log(N, 10))

ans = 0
for i in range(log):
    if i % 2 == 0:
        ans += 10 ** (i + 1) - 10 ** i

if log % 2 == 0:
    ans += N + 1 - (10 ** log)

print(ans)


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

int main() {
    //ios::sync_with_stdio(0);
	string s;
	bool f = 1;
	cin>>s;
	for(int i=0;i<s.size();i++) {
		if(i%2==0 && s[i]!='h') f=0;
		if(i%2 && s[i]!='i') f=0;
	}
	if(s.size()<2 || s.size()%2==1) f=0; 
	puts(f?"Yes":"No");
    return 0;
}


Measured memory_bytes: 256
H,W,K = map(int,input().rstrip().split(" "))
s= []
ans = 0
for i in range(H):
    s.append(list(input()))

for i in range(2 ** H):
    l = [0 for i in range(W)]
    for i2 in range(H):
        if (i >> i2) & 1:
            for i3 in range(W):
                if s[i2][i3] == "#":
                    l[i3] += 1
    for i2 in range(2 ** W):
        q = 0
        for i3 in range(W):
            if (i2 >> i3) & 1:
                q += l[i3]
        if q == K:
            ans += 1
print(ans)


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

typedef long long int ll;
#define pb push_back
#define ff first
#define ss second
#define INF 1999999999
#define MODA 1000000007
#define PI 3.1415926535897932384626433
//cout << fixed << setprecision(2);


int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll a, b;
    cin >> a >> b;
    cout << a*b << endl;
    return 0;
}


Measured memory_bytes: 3644
n=int(input())

def dfs(x):
    if int(x)>n:
        return 0
    else:
        check=True
        for i in "753":
            if x.count(i)==0:
                check=False
        if check:
            ans=1
        else:
            ans=0
    
    for i in "753":
        ans+=dfs(x+i)
    
    return ans

print(dfs("0"))

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

//0103
int main(){
	int n;
	string s;

	cin >> n;
	int point=0;
	int out=0;
	int base[3]={0, 0, 0};

	while(cin >> s){

		if(s=="HIT"){
			if(base[2]==1){
				++point;
				base[2]=0;
			}
			if(base[1]==1){
				base[2]=1;
				base[1]=0;
			}
			if(base[0]==1){
				base[1]=1;
				base[0]=0;
			}
			base[0]=1;

		}else if(s=="HOMERUN"){
			for(int i=0; i<3; ++i){
				point += base[i];
			}
			point++;
			base[0]=0;
			base[1]=0;
			base[2]=0;

		}else{
			++out;
			if(out>=3){
				cout << point << endl;
				point=0;
				out=0;
				base[0]=0;
				base[1]=0;
				base[2]=0;
				continue;
			}
		}
		
	}
	return 0;
}

Measured memory_bytes: 0
#include<stdio.h>
int main(void){
   int x[10001],y[10001],i,j;

   for(i=1;i<=10000;i++){
      scanf("%d %d",&x[i],&y[i]);
      if(x[i]==0 && y[i]==0){
         j=i;
         break;
      }
   }

   for(i=1;i<=j-1;i++){
      if(x[i]<y[i]){
         printf("%d %d\n",x[i],y[i]);
      }
      else{
         printf("%d %d\n",y[i],x[i]);
      }
   }


   return 0;
}


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

public class Main {

	static int m,c,x,i;
	public static StringBuilder sb = new StringBuilder();

	//空白で区切る
	public static String[] cutStr(String str){
		String[] twoStr = new String[2];
		twoStr = str.split(" ");
		return twoStr;
	}

	//文字を数字にする
	public static int toNumber(String str1){
		int number = 0;
		int k=0;

		sb.delete(0, 10);

		sb.append(str1);

		m = sb.indexOf("m");
		c = sb.indexOf("c");
		x = sb.indexOf("x");
		i = sb.indexOf("i");

		if(m==-1){
		}else if(m == k){
			number += 1000;
			k++;
		}else {
			number += Integer.parseInt(sb.substring(k,k+1)) * 1000;
			k+=2;
		}

		if(c==-1){
		}else if(c == k){
			number += 100;
			k++;
		}else{
			number += Integer.parseInt(sb.substring(k,k+1)) * 100;
			k+=2;
		}

		if(x==-1){
		}else if(x == k){
			number += 10;
			k++;
		}else{
			number += Integer.parseInt(sb.substring(k,k+1)) * 10;
			k+=2;
		}

		if(i==-1){
		}else if(i == k){
			number += 1;
			k++;
		}else{
			number += Integer.parseInt(sb.substring(k,k+1)) * 1;
			k+=2;
		}

		return number;
	}

	//数字を足して文字に直す
	public static String addStr(int n, int m){
		String addedStr = null;

		int sum = n + m;
		int sum_m = sum / 1000;
		int sum_c = (sum % 1000) / 100;
		int sum_x = (sum % 100) / 10;
		int sum_i = sum % 10;

		StringBuilder ans = new StringBuilder();
		if (sum_m >= 2) {
			ans.append(sum_m);
		}
		if (sum_m >= 1) {
			ans.append("m");
		}

		if (sum_c >= 2) {
			ans.append(sum_c);
		}
		if (sum_c >= 1) {
			ans.append("c");
		}

		if (sum_x >= 2) {
			ans.append(sum_x);
		}
		if (sum_x >= 1) {
			ans.append("x");
		}

		if (sum_i >= 2) {
			ans.append(sum_i);
		}
		if (sum_i >= 1) {
			ans.append("i");
		}

		addedStr = ans.toString();

		return addedStr;
	}



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

		BufferedReader br = new  BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();

		int numMax = Integer.parseInt(str);

		String[] answer = new String[numMax];

		for(int j=0;j<numMax;j++){
			str = br.readLine();
			String[] twoStr = cutStr(str);
			int n = toNumber(twoStr[0]);
			int m = toNumber(twoStr[1]);
			str = addStr(n,m);

			answer[j] = str;
		}

		for(int j=0;j<numMax;j++){
		System.out.println(answer[j]);
		}
	}

}



Measured memory_bytes: 29020
#include<bits/stdc++.h>
#include<algorithm>
#include<string.h>
using namespace std;
int main()
{
    string a,b;
    cin>>a>>b;
    if(a[0]=='H' && b[0]=='H'){cout<<"H";}
    else if(a[0]=='H' && b[0]=='D'){cout<<"D";}
    else if(a[0]=='D' && b[0]=='H'){cout<<"D";}
    else if(a[0]=='D' && b[0]=='D'){cout<<"H";}

}


Measured memory_bytes: 3572
import java.util.*;
class Main
{
    public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] a = new int[200000];
        Arrays.fill(a, 0);
        for(int i = 0; i < n; i++)
            a[sc.nextInt()-1]++;
        Arrays.sort(a);
        int ans = 0;
        for(int i = 0; i < a.length - k; i++){
            ans += a[i];
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 72688
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
   
int main()
{
	int size;
	char a[101],b[101];
	cin >> a >> b;
	size = sizeof a;
	char *c = new char[size*2+1];
	strcpy(c,a);
	strcat(c,a);
	if(strstr(c,b))
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	delete [] c;
	return 0;
}

Measured memory_bytes: 3088
#include <bits/stdc++.h>
         
typedef long long ll;
using namespace std;
        
#define F first
#define S second
#define sqr(x) x*x
#define pb push_back
#define mp make_pair
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()
#define repit(i, n) for(auto it = n.begin(); it != n.end(); ++it)
       
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0);for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b){if(b==0)return a;else return gcd(b,a%b);}
int lcm(int a,int b){return abs(a*b)/gcd(a,b);}
          
bool comp(pair<string, int> a, pair<string, int> b){
    return a.S < b.S;
}

int main(){ios_base::sync_with_stdio(0);cin.tie(0);
    string s;
    cin >> s;
    for(int i = 0; i < sz(s); i++){
        if(i % 2 == 0) cout <<s[i];
    }
}


Measured memory_bytes: 592
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n=int(input())
a=lnii()

ans=0
for i in range(1,n):
  if a[i-1]>a[i]:
    sa=a[i-1]-a[i]
    ans+=sa
    num=a[i]+sa
    a[i]=num

print(ans)

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

namespace ProblemA
{
    class Program
    {
        static void Main(string[] args)
        {
            var S = Console.ReadLine();
            Console.WriteLine(S.Substring(0, 3));
        }
    }
}


Measured memory_bytes: 25640