akhauriyash/Code-Regression huggingface dataset:
/* winners never quit and quitters never win.
      #swap                                 */
      
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds;
#pragma GCC optimize ("-O3")
using ll = long long;
using ld = long double;
const ll mod = 1000000007;
const ll inf = 1000000000000000000;
const ll rk = 256;
const ld PI = 3.141592653589793;

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

#define endl '\n'
#define pb push_back
#define mp make_pair
#define vc vector
#define fs first
#define sec second
#define pq priority_queue
#define lb lower_bound
#define ub upper_bound
#define pll pair<ll,ll> 
#define pls pair<ll,string>
#define psl pair<string,ll>
#define plc pair<ll,char>
#define pcl pair<char,ll>
#define pss pair<string,string>
#define all(x) (x).begin(), (x).end()
#define tol(s) transform(s.begin(),s.end(),s.begin(),::tolower);
#define tou(s) transform(s.begin(),s.end(),s.begin(),::toupper);
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define T ll t=0;cin>>t;for(ll test=0;test<t;test++)

ll nxt() {
    ll TemporaryVariable;
    cin >> TemporaryVariable;
    return TemporaryVariable;
}

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

 
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
	//isprime();
	//coeff();
	/*freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);*/
    ll n=nxt();
    ll one=-1,two=-1;
    rep(a,0,1001)
    {
        rep(b,0,a)
        {
            ll p=(ll)pow(a,5),q=(ll)pow(b,5);
            if(p-q==n)
            {
                one=a,two=b;
                break;
            }
            if(p+q==n)
            {
                one=a,two=-b;
                break;
            }
        }
        if(one!=-1)
            break;
    }
    cout<<one<<" "<<two<<endl;
	printclock;
	return 0;
}

Measured memory_bytes: 4312
#include<bits/stdc++.h>
using namespace std;
 
#define ff              first
#define ss              second                            
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int, int>
#define vi              vector<int>
#define mii             map<int, int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int, vi, greater<int>>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());
 


 
void c_p_c(){
    ios_base::sync_with_stdio(0); 
    cin.tie(0); 
    cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
// int gcd (int a, int b) {
//   if (b == 0) return a;
//   else return gcd (b, a % b);
// }
// int lcm (int a, int b)  {
//   return a / gcd(a, b) * b;
// }
// int fact(int n){
//   if(n==0) return 1 ;
//   else return n*fact(n-1); 
// }

void solve(){
 string s, t;
 cin >> s >> t;
 int n = s.length();
 for(int i=0; i<n; i++){
  if(s[i] != t[i]) {
    cout << "No";
    return;
  }
 }
 cout << "Yes"; 
} 
int32_t main(){
  //c_p_c();
  //w(t) 
  solve() ;
  return 0;
}

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

using namespace std;


//repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define euc_dis(x, y) sqrt(x*x + y*y)

#define MOD 1e9+7
#define sp ' '


using ll = long long;


ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll b, ll e, ll m){ll r=1;while(e>0){if(e&1)r=(r%m)*(b%m)%m;b=(b%m)*(b%m)%m;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

template<typename T>
void ppp(T n){cout << n << endl;}

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, m;
    cin >> n >> m;
    map<int, int> mp;
    rep(i, n){
        int k; cin >> k;
        rep(i, k){
            int tmp;
            cin >> tmp;
            mp[tmp]++;
        }
    }
    int cnt = 0;
    for(auto c : mp){
        if(c.second == n){
            cnt++;
        }
    }

    ppp(cnt);


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MOD3 1000000000
#define MOD2 998244353 
float PHI = 1.6180339;
const float  PI_F=3.14159265358979f;
#define MAX 1000 m
#define endl "\n"    
#define manhunt 32 
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define pi 3.1415926535897932384626433
//typedef long long float;
#define int long long
//#define double long double
typedef pair<int, int> pii;
//#define float unsigned long long
#define FAST ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define CHAR_SIZE 26 

int modpow(int x, int n, int m) { if (n == 0) return 1%m; long long u = modpow(x,n/2,m); u = (u*u)%m; if (n%2 == 1) u = (u*x)%m; return u; } 


int add(int x, int y,int m) 
{
	x += y;
	if (x >= m) return x - m;
	return x;
}
int sub(int x, int y) 
{
	x -= y;
	if (x < 0) return x + MOD;
	return x;
}
int inv(int a, int m = MOD2)
{
	return modpow(a, m - 2, m);
}
int mul(int a, int b,int m) 
{
	return (long long) a * b % m;
}


int nCrModp(int n, int r, int p) 
{ 
    int C[r+1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1; 
    for (int i = 1; i <= n; i++) 
    { 
        for (int j = min(i, r); j > 0; j--) 
            C[j] = (C[j] + C[j-1])%p; 
    } 
    return C[r]; 
} 

bool sortinrev(const pair<int,int> &a,  
               const pair<int,int> &b) 
{ 
       return (a.first > b.first); 
}

int32_t main()
{
    /* freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout); */
    FAST
    cout << fixed << setprecision(12);

    int n;
    cin>>n;
    int dp=n;
    string s="";
    while(n>0)
    {
        n--;
        int x=n%26;
        char c=(char)(x+'a');
        s=c+s;
        n/=26;
    }
    cout<<s<<endl;
    
    return 0;
}





Measured memory_bytes: 3648
n = gets.chomp.to_i
s = gets.chomp.to_s
str = 'No'
msg1 = ''
msg2 = '' 

if n % 2 == 0
    for i in 0..n/2-1 
        msg1 << s[i]
    end
    for i in n/2..n-1
        msg2 << s[i]
    end
    if msg1 == msg2
        str = 'Yes'
    end
end
puts str

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

# 自力実装できず
#
# 解説PDFが理解できなかったので
# http://drken1215.hatenablog.com/entry/2019/02/16/224100
# を参考に実装

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys


def str_max(s1, s2):
    if len(s1) > len(s2):
        return s1
    elif len(s1) < len(s2):
        return s2
    if s1 > s2:
        return s1
    else:
        return s2


def main():
    N, M = map(int, input().split())
    As = list(map(int, input().split()))
    
    needs = [0,2,5,5,4,5,6,3,7,6]
    need_to_ch = {}
    for a in sorted(As):
        need = needs[a]
        need_to_ch[need] = str(a)
    
    dp = [None for _ in range(N + 1)]
    dp[0] = ''
    for i in range(1, N + 1):
        for need, ch in need_to_ch.items():
            if i - need < 0 or dp[i - need] is None:
                continue
            cand = dp[i - need] + ch
            if dp[i] is None:
                dp[i] = cand
            else:
                dp[i] = str_max(dp[i], cand)
        # print("dp[{}] = {}".format(i, dp[i]))
    print(dp[N])


main()


Measured memory_bytes: 32040
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

// c++11
#include <array>
#include <tuple>
#include <unordered_map>
#include <unordered_set>

#define mp make_pair
#define mt make_tuple
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

const int INF = 1 << 29;
const ll LL_INF = 1LL << 60;
const double EPS = 1e-9;
const ll MOD = 1000000007;

const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
string S;
int N;
int X, Y;
const int MAX_N = 8010;
bool dp1[MAX_N][MAX_N + MAX_N];
bool dp2[MAX_N][MAX_N + MAX_N];
vector<int> tmpX, tmpY;
int main()
{
    cin >> S;
    N = S.size();
    cin >> X >> Y;
    int cnt = 0;
    for (int i = 0; i < N; i++)
    {
        if (S[i] == 'F')
        {
            cnt++;
        }
        else
        {
            break;
        }
    }
    int x, y;
    x = cnt;
    y = 0;
    bool flag = true;
    int tmp = 0;

    for (int i = cnt; i < N; i++)
    {
        if (S[i] == 'F')
        {
            tmp++;
        }
        else
        {
            if (tmp > 0)
            {
                if (flag)
                {
                    tmpX.push_back(tmp);
                }
                else
                {
                    tmpY.push_back(tmp);
                }
            }
            tmp = 0;
            flag = !flag;
        }
    }
    if (tmp > 0)
    {
        if (flag)
        {
            tmpX.push_back(tmp);
        }
        else
        {
            tmpY.push_back(tmp);
        }
    }
    dp1[0][x+MAX_N] = true;
    for (int i = 0; i < tmpX.size(); i++){
        for (int j = 0; j < 2 * MAX_N; j++){
            if (!dp1[i][j]){
                continue;
            }
            if (j + tmpX[i] < 2 * MAX_N){
                dp1[i + 1][j + tmpX[i]] = true;
            }
            if (j - tmpX[i] >= 0){
                dp1[i + 1][j - tmpX[i]] = true;
            }
        }
    }
    dp2[0][MAX_N] = true;
    for (int i = 0; i < tmpY.size(); i++){
        for (int j = 0; j < 2 * MAX_N; j++){
            if (!dp2[i][j]){
                continue;
            }
            if (j + tmpY[i] < 2 * MAX_N){
                dp2[i + 1][j + tmpY[i]] = true;
            }
            if (j - tmpY[i] >= 0){
                dp2[i + 1][j - tmpY[i]] = true;
            }
        }
    }    
    if (dp1[tmpX.size()][X + MAX_N] and dp2[tmpY.size()][Y + MAX_N]){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }


    return 0;
}


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

int main() {
    int a,b,c,d;
    cin >> a >> b >> c >> d;

    int l,r;

    l = a + b;
    r = c + d;

    if(l > r) {
        printf("Left");
    } else if(l < r) {
        printf("Right");
    } else {
        printf("Balanced");
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); ++i)
#define rep2(i,n) for(int i=1; i<=(n); ++i)
#define all(x) (x).begin(),(x).end()
#define Sort(x) sort((x).begin(),(x).end())
#define Sort2(x) sort((x).begin(),(x).end(), greater<int>())
#define pb push_back
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main()
{
    int n,k; cin >> n >> k;
    int n2 = 2*n;
    vector<int> ans(n,0);
    rep(i,n2){
        int d; cin >> d;
        rep(j,d){
            int a; cin >> a;
            ans[a-1] = 1;
        }
    }
    int an=0;
    rep(i,n){
        if(ans[i]==0) an++;
    }
    cout << an << endl;

}

/*
Ctrl+@ でコンソールを開け、以下で実行。
g++ b.cpp
./a.out

サンプルのダウンロードは oj d URL
テストは oj t
コード変えたらコンパイルする
不正解ならWAが出る
*/

Measured memory_bytes: 3592
package main

import "fmt"

func main() {

	var s, hour, min, sec int
	fmt.Scan(&s)
	
	hour = s / (60*60)
	min = s / 60 - hour*60
	sec = s - hour*60*60 - min*60

	fmt.Printf("%d:%d:%d\n", hour,min,sec)
}


Measured memory_bytes: 1128
#include <iostream>
#include <algorithm>
#include <array>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
#define ll long long
#define rep(i,a,b) for(int i = (a); i < (b); i++)
#define bitget(a,b) (((a) >> (b)) & 1)
#define vint vector<int>
#define vvint vector<vector<int>>
#define vsort(x) sort(x.begin(),x.end())

using int64 = uint64_t;

using namespace std;

int main() {
	int a[5];
	rep(i, 0, 5)
		cin >> a[i];
	int x, y;
	x = a[4] * a[0];
	y = a[1] + max(0, a[4] - a[2])*a[3];
	cout << min(x, y) << endl;
	return 0;
}

Measured memory_bytes: 3080
#![allow(
  non_snake_case,
  unused_variables,
  unused_assignments,
  unused_mut,
  unused_imports,
  unused_macros,
  dead_code
)]
use proconio::fastout;
use proconio::input;
use proconio::marker::*;
use std::cmp::*;
use std::collections::*;
//use std::collections::VecDeque;
macro_rules! debug {
  ($($a:expr),* $(,)*) => {
      #[cfg(debug_assertions)]
      eprintln!(concat!($("| ", stringify!($a), "={:?} "),*, "|"), $(&$a),*);
  };
}
#[fastout]
fn main() {
  input! {
    N:usize,X:usize,M:usize
  }
  let mut a = vec![0; M * 2];
  let mut s = HashMap::new();
  a[0] = X;
  let mut start = 0;
  let mut end = 0;
  for i in 0..M * 2  {
    s.insert(a[i], i);
    a[i + 1] = a[i] * a[i] % M;
    if let Some(j) = s.get(&a[i + 1]) {
      start = *j;
      end = i + 1;
      break;
    }
  }

  if end == 0 {
    let mut ans = 0;
    for i in 0..N {
      ans += a[i];
    }
    println!("{}", ans);
    return;
  }
  let mut ans = 0;
  for i in 0..start {
    ans += a[i];
  }
  let mut some = 0;
  for i in start..end {
    some += a[i];
  }
  let rep = (N - start) / (end - start);
  let amari = (N - start) % (end - start);
  ans += rep * some;
  for i in start..(start + amari) {
    ans += a[i];
  }
  println!("{}", ans);
}


Measured memory_bytes: 3988
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define repr(i,n) for(int i=(n)-1;0<=i;--i)
#define each(e,v) for(auto&& e:(v))
#define all(v) begin(v),end(v)
#define dump(x) cerr<<#x<<": "<<(x)<<endl
#define INF 100000000
#define IINF 9999999999999;
using vint = std::vector<int>;
using ll = long long;
using vll = std::vector<ll>;
template <class T> void chmin(T& a, const T& b) { a = std::min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = std::max(a, b); }

long long int dp[11][101] = {0};
long long int dpA[11][101] = {0};

int main() {
    int N;
    cin >> N;
    int ans = 0;
    int output = 0;
    FOR(i, 1, N + 1) {
        int temp = 0;
        int comp = i;
        while(comp % 2 == 0) {
            ++temp;
            comp /= 2;
        }
        ans = max(ans, temp);
        if(ans == temp) output = i;
    }
    cout << output << endl;
}


Measured memory_bytes: 256
# coding=utf-8
from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop, heapify
import copy
import numpy as np
import sys
INF = float('inf')
mod = 10**9+7
sys.setrecursionlimit(10 ** 6)


def lcm(a, b): return a * b / gcd(a, b)

# 1 2 3
# a, b, c = LI()


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))

# a = I()


def I(): return int(sys.stdin.buffer.readline())

# abc def
# a, b = LS()


def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()

# a = S()


def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')

# 2
# 1
# 2
# [1, 2]


def IR(n): return [I() for i in range(n)]

# 2
# 1 2 3
# 4 5 6
# [[1,2,3], [4,5,6]]


def LIR(n): return [LI() for i in range(n)]

# 2
# abc
# def
# [abc, def]


def SR(n): return [S() for i in range(n)]

# 2
# abc def
# ghi jkl
# [[abc,def], [ghi,jkl]]


def LSR(n): return [LS() for i in range(n)]

# 2
# abcd
# efgh
# [[a,b,c,d], [e,f,g,h]]


def SRL(n): return [list(S()) for i in range(n)]


def main():
    s = S()
    t = S()
    s_c = Counter(s)
    s_t = Counter(t)
    if sorted(s_c.values()) == sorted(s_t.values()):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()


Measured memory_bytes: 27260
#include<algorithm>
#include<cstdio>
#include<limits>
#define rep(i,a) for(int i=0;i<(a);++i)

const int MAX_M = 20, MAX_N = 50000, INF = std::numeric_limits<int>::max()>>2;

int n, m;
int d[MAX_M];
int dp[MAX_M+1][MAX_N+1];

int main()
{
    scanf( "%d%d", &n, &m );
    rep( i, m )
        scanf( "%d", d+i );

    std::fill( (int*)dp, (int*)(dp+m), INF );
    dp[0][0] = 0;

    rep( i, m ) rep( j, n+1 )
    {
        if( j >= d[i] )
            dp[i+1][j] = std::min( dp[i][j], dp[i+1][j-d[i]]+1 );
        else
            dp[i+1][j] = dp[i][j];
    }

    printf( "%d\n", dp[m][n] );

    return 0;
}

Measured memory_bytes: 6844
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define reps(i,n) for(int i=1;i<(int)(n);i++)

typedef long long ll;
using namespace std;

int gcd(int a, int b) { //最大公約数
  if (b==0) return a;
  else return gcd(b, a%b);
}

int lcm(int a, int b) { //最小公倍数
  return a * b / gcd(a, b);
}


int main()
{
  string a;
  ll ans=0;
  cin>>a;
  if(a[0]=='1')ans++;
  if(a[1]=='1')ans++;
  if(a[2]=='1')ans++;

  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 3604
import itertools
import math
N = int(input())
xy = [list(map(int,input().split())) for i in range(N)]
num = [i for i in range(N)]
C = []
sum = 0
for _ in itertools.permutations(num):
    C.append(list(_))
for a in C:
    for i in range(len(a)-1):
        sum += math.sqrt((xy[a[i]][0]-xy[a[i+1]][0])**2+(xy[a[i]][1]-xy[a[i+1]][1])**2)
print(sum/math.factorial(N))

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

int main() {
  int64_t N, Q;
  cin >> N >> Q;
  vector<pair<pair<int64_t, int64_t>, int64_t>> event;
  for (int64_t i = 0; i < N; i++) {
    int64_t s,t,x;
    cin >> s >> t >> x;
    event.push_back(make_pair(make_pair(s-x, 1), x));
    event.push_back(make_pair(make_pair(t-x, -1), x));
  }  
  sort(event.begin(), event.end());
  event.push_back(make_pair(make_pair(10000000000, 1), 10000000000));
  vector<int64_t> pos(Q);
  for (int64_t i = 0; i < Q; i++) {
    int64_t x;
    cin >> x;
    pos.at(i) = x;
  }
  cout << endl;
  set<int64_t> S;
  int64_t cnt = 0;
  int64_t m = 10000000000;
  vector<int64_t> ans;
  for (int64_t p : pos) {
    while (event.at(cnt).first.first <= p) {
      int64_t s, f, x;
      s = event.at(cnt).first.first;
      f = event.at(cnt).first.second;
      x = event.at(cnt).second;
      cnt++;
      if (f == 1) {
        S.insert(x);
        m = *begin(S);
      }
      else {
        S.erase(x);
        if (m == x) {
          if (S.empty()) {
            m = 10000000000;
          }
          else {
            m = *begin(S);
          }
        }
      }
    }
    if (S.empty()) {
      ans.push_back(-1);
    }
    else {
      ans.push_back(m);
    }
  }
  for (int64_t val : ans) {
    cout << val << endl;
  }
}

Measured memory_bytes: 28392
#include <iostream>

using namespace std;

int main(){


    int alp[26];

    string s;
    cin >> s;

    for (int i = 0; i < 26; i++){
        alp[i] = 0;
    }


    for (int i = 0; i < s.size(); i++){
        alp[((s[i] - '0') - 49)]++;
    }

    bool beautiful = true;

    for (int i = 0; i < 26; i++){
        if (alp[i] % 2 != 0){
            beautiful = false;
        }
    }


    if (beautiful){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.lang.*;

public class Main {
	static long mod = 998244353;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int t = sc.nextInt();
		System.out.println(t / a * b);
	}
}

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

int main() {
  int N ;
  cin >> N ;
 
  int sen, hyaku, juu, ichi;
  	sen = N / 1000;
    hyaku = (N / 100) - 10 * sen;
    juu = (N / 10) - 100 * sen - 10 * hyaku;
    ichi = N - 1000 * sen - 100 * hyaku - 10 * juu;
      
  if ( (sen == hyaku && hyaku == juu) || (hyaku == juu && juu == ichi) ) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }  
    
}

Measured memory_bytes: 256
n, m = map(int, input().split())
l = list(map(int, input().split()))
l = sorted(l)
le = []
if n >= m:
    print(0)
else:
    for i in range(m - 1):
        le.append(l[i + 1] - l[i])
    le = sorted(le)
    if n == 1:
        print(sum(le))
    else:
        print(sum(le[:-n+1]))

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

const int INF = 1000000;

struct Tool {int a, e, r;};
bool operator<(const Tool& lhs, const Tool& rhs) {return lhs.r < rhs.r;}

int solve(int D, vector<Tool> tool) {
  sort(begin(tool), end(tool));
  vector<vector<int>> dp(D + 1, vector<int>(101, INF));
  dp[D][0] = 0;
  for(const auto& t: tool) {
    for(int hp = D; 0 <= hp; --hp) {
      for(int exp = 0; exp <= 100; ++exp) {
        if(exp < t.r) continue;
        int next_hp = max(0, hp - t.a);
        int next_exp = min(100, exp + t.e);
        dp[next_hp][next_exp] = min(dp[next_hp][next_exp], dp[hp][exp] + 1);
      }
    }
  }

  int result = INF;
  for(const auto& i: dp[0]) result = min(result, i);
  return result;
}

int main() {
  int D, N;
  while(cin >> D >> N, D | N) {
    vector<Tool> tool(N);
    for(auto& t: tool) cin >> t.a >> t.e >> t.r;

    int answer = solve(D, tool);
    if(answer == INF) cout << "NA" << endl;
    else              cout << answer << endl;
  }
}

Measured memory_bytes: 1260
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(V) V.begin(),V.end()
#define MOD 1000000007

int main() {
	ll K;
	cin >> K;
	int C[15];
	using P = pair<ll, ll>;
	priority_queue<P, vector<P>, greater<P>> pd;
	queue<P> cd;
	for (ll i = 0;i < 10;i++)pd.push({ i,i });

	P g;
	ll nd = 10, cnt = 0;
	while (1) {
		while (!pd.empty()) {
			if (pd.top().first != 0) {
				cnt++;
			}
			if (cnt == K) {
				cout << pd.top().second << endl;
				return 0;
			}
			cd.push(pd.top());
			pd.pop();
		}
		while (!cd.empty()) {
			g = cd.front();
			cd.pop();
			if (g.first == 0) {
				//pd.push({ g.first - 1,g.second + (g.first - 1) * nd });
				pd.push({ g.first,g.second + g.first * nd });
				pd.push({ g.first + 1,g.second + (g.first + 1) * nd });
			}
			else if (g.first == 9) {
				pd.push({ g.first - 1,g.second + (g.first - 1) * nd });
				pd.push({ g.first,g.second + g.first * nd });
				//pd.push({ g.first + 1,g.second + (g.first + 1) * nd });
			}
			else {
				pd.push({ g.first - 1,g.second + (g.first - 1) * nd });
				pd.push({ g.first,g.second + g.first * nd });
				pd.push({ g.first + 1,g.second + (g.first + 1) * nd });
			}
		}
		nd *= 10;
	}
}

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


int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	
	int n, k;
	cin >> n >> k;
	vector<int> h(n + 2 + k, (int) 1e9);
	for (int i = 1; i - 1 < n; ++i) cin >> h[i];

	vector<int> dp(n + 2 + k, (int) 1e9);

	dp[1] = 0;
	
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= k; ++j) 
			dp[i + j] = min(dp[i + j], dp[i] + abs(h[i] - h[i + j]));
	}

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



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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pii> pipii;
typedef pair<pii, pii> piipii;

#define mp make_pair
#define fi first
#define se second
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()
#define eb emplace_back

ll f(ll b, ll n){
    if(n < b) return n;
    return f(b, n/b) + n%b;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll n, s, ans = -1;
    cin >> n >> s;
    if(n == s) ans = s+1;
    for(ll b=2;b*b<=n;b++){
        if(f(b, n) == s){
            ans = b;
            break;
        }
    }
    if(ans == -1){
        for(ll x=1;x*x<n;x++){
            ll l = n/(x+1)+1, r = n/x;
            if(l <= x) break;
            if(s-x >= 0){
                ll a = n%r, b = n%l;
                if(a <= s-x && s-x <= b && (s-x-a)%x == 0){
                    ll res = r - (s-x-a)/x;
                    if(ans == -1 || ans > res) ans = res;
                }
            }
        }
    }

    printf("%lld\n", ans);
}

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

int main(){
	bool end = false;
	int gate[ 8 ];
	string capacity = "12121414", result;
	int slide, waitMin;

	while ( !end ){
		for ( int i = 0; i < 8; ++i ){
			end = !( cin >> gate[ i ] );
			if ( end ) break;
		} if ( end ) continue;

		slide = 0;
		waitMin = 0;
		result = "";

		for ( int i = 0; i < 8; ++i ){
			int wait = 0;
			string pattern;
			for ( int j = 0; j < 8; ++j ){
				pattern += capacity[ ( j + i ) % 8 ];
				int t = gate[ j ] - static_cast< int >( pattern[ j ] - '0' );
				wait += ( t > 0 ? t : 0 );
			}
			if ( result == "" || wait < waitMin ){
				waitMin = wait;
				result = pattern;
				slide = i;
			}else if ( wait == waitMin ){
				istringstream sp( pattern ), sr( result );
				int ip, ir;
				sp >> ip;
				sr >> ir;
				if ( ip < ir ){
					waitMin = wait;
					result = pattern;
					slide = i;
				}
			}
		}

		bool first = true;
		for ( int i = 0; i < 8; ++i ){
			if ( first ){
				first = false;
				cout << capacity[ ( i + slide ) % 8 ];
			}else{
				cout << " " << capacity[ ( i + slide ) % 8 ];
			}
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 0
use std::cmp;

#[allow(dead_code)]
pub struct Scanner<'a> {
    _buf: &'a str,
    iter: ::std::str::SplitWhitespace<'a>,
}

#[allow(dead_code)]
impl<'a> Scanner<'a> {
    pub fn new(buf: &'a str) -> Self {
        Scanner {
            _buf: buf,
            iter: buf.split_whitespace(),
        }
    }

    pub fn array<T>(&mut self, n: usize) -> Vec<T>
        where T: ::std::str::FromStr,
              T::Err: ::std::fmt::Debug,
    {
        let mut res = Vec::with_capacity(n);
        for _ in 0..n {
            res.push(self.value());
        }
        res
    }

    pub fn value<T>(&mut self) -> T
        where T: ::std::str::FromStr,
              T::Err: ::std::fmt::Debug,
    {
        self.next().parse().unwrap()
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.next().chars().collect()
    }

    fn next(&mut self) -> &str {
        self.iter.next().unwrap()
    }
}

// パティ数
fn h(level: i64) -> i64 {
    if level == 0 { return 1; }
    2*h(level-1) + 1
}

// 総数
fn g(level: i64) -> i64 {
    if level == 0 { return 1; }
    2*g(level-1) + 3
}

fn f(level: i64, x: i64) -> i64 {
    let total = g(level);
    //eprintln!("{} {} {}", level, x, total);
    assert!(x <= total);

    if level == 0 { return x; }
    if x <= 1 { return 0; }

    if x <= total/2 {
        f(level-1, x-1)
    }
    else {
        let total_nex = g(level-1);
        h(level-1) + 1 + f(level-1, cmp::min(total_nex, x-g(level-1)-2))
    }
}

fn main() {
    let mut _input = String::new();
    {
        use ::std::io::Read;
        ::std::io::stdin().read_to_string(&mut _input).unwrap();
    }
    let mut sc = Scanner::new(&_input);

    let n = sc.value::<i64>();
    let x = sc.value::<i64>();

    let ans = f(n, x);

    println!("{}", ans);
}


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

constexpr int M = 1e9+7;

int main() {
    int N;
    cin >> N;
    vector<int> cnt(N);
    bool ok = true;
    for(int i=0; i<N; ++i) {
        int a;
        cin >> a;
        if(!ok) {
            continue;
        } else {
            if(N % 2 == a % 2 || cnt[a] >= 2 || (a == 0 && cnt[a] >= 1)) {
                ok = false;
            }
        }
        cnt[a]++;
    }
    if(!ok) {
        cout << 0 << endl;
        return 0;
    }
    N = N/2;
    int res = 1;
    while(N > 0) {
        res *= 2;
        res %= M;
        N -= 1;
    }
    cout << res << endl;
}


Measured memory_bytes: 640
n=int(input())
t,a=map(int,input().split())
hl=list(map(int,input().split()))

best=float('inf')
bp=1
for i in range(n):
    avr = t-(hl[i]*0.006)
    dif = abs(avr-a)
    if dif < best:
        best = dif
        bp = i+1
print(bp)

Measured memory_bytes: 3064
let () =
  try
    while true do
      let x = ref 0 in
      let n = read_int () in
      for a = 0 to 9 do
        for b = 0 to 9 do
          for c = 0 to 9 do
            for d = 0 to 9 do
              if a + b + c + d = n then incr x;
            done
          done
        done
      done;
      Printf.printf "%d\n" !x;
    done
  with _ -> ()

Measured memory_bytes: 2200
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int w = sc.nextInt();
		int n = sc.nextInt();
		int[] values = new int[w];
		for (int i = 0; i < w; i++) {
			values[i] = i + 1;
		}
		for (int i = 0; i < n; i++) {
			String[] ab = sc.next().split(",");
			int a = 0;
			int b = 0;
			int C = 0;
			a = Integer.parseInt(ab[0]) - 1;
			b = Integer.parseInt(ab[1]) - 1;

			C = values[a];
			values[a] = values[b];
			values[b] = C;
		}
		for (int i = 0; i < w; i++) {
			System.out.println(values[i]);
		}

	}
}

Measured memory_bytes: 26064
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#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 REP(i, n) FOR(i, 0, n)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define PB push_back
#define MP make_pair
using ll = long long;
using Pii = pair<int, int>;
const int MOD = 1000000007;
const int INF = 1000000000;

int main(){
    vector<int> a(3);
    REP(i, 3) cin >> a[i];
    SORT(a);
    int ans;
    if(a[0] != a[1]) ans = a[0];
    else ans = a[2];
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,k;
	cin>>a>>b>>c;
	cin>>k;
	while(b<=a && k>0)
	{
		b=b*2;
		k--;
	}
	while(k && b>=c)
	{
		c=c*2;
		k--;
	}
	if(a<b && b<c)
	{
		cout<<"Yes"<<"\n";
	}
	else
	{
		cout<<"No"<<"\n";
	}
}

Measured memory_bytes: 3620
import os
import sys
import heapq

def main():
    H , K = map(int , input().split())
    n_list = [s for s in input().split()]
    n_list = list(map(int,n_list))
    #print (n_list)
    #c = sum(int(i) for i in list)
    list_small = []
    new_list = []
    if K >= len(n_list) :
        print (str(0))
    elif K == 0 :
        c = sum(int(i) for i in n_list)
        print (str(c))
    else :
        list_small = heapq.nlargest(K,n_list)
        list_small = list(map(int,list_small))
        #print (list_small)
        #new_list = list(set(n_list)-set(list_small))
        #new_list = list_difference(n_list, list_small)
        #print (list_small)
        #print (new_list)
        c = sum(int(i) for i in n_list)
        d = sum(int(i) for i in list_small)
        print (str(c-d))
    #print (str(X))

if __name__ == '__main__':
    main()

Measured memory_bytes: 34752
#include<iostream>
#include<algorithm>
using lint=long long;
using namespace std;

int main()
{	
	lint N,W;
	lint w[110]={},v[110]={};
	lint dp[110][100010]={};
	
	cin >> N >> W;
	for(int i=1;i<=N;i++)
		cin >> w[i] >> v[i];
	
	for(int i=1;i<=N;i++)
	{
		for(int j=0;j<=100000;j++)
		{
			dp[i][j]=dp[i-1][j];
			if(j-w[i]>=0)
				dp[i][j]=max(dp[i][j],dp[i-1][j-w[i]]+v[i]);
		}
	}
	
	cout << dp[N][W] << endl;
	return 0;
}



Measured memory_bytes: 86144
#include <cstdio>
#include <algorithm>
#include <vector>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>
#define INF (1ll<<60)
#define MOD 1000000007
#define BOUND 27182818284

typedef long long ll;
typedef long long int lli;

#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)

template<class T>bool umax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool umin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

using namespace std;

// gcd
int gcd(int a, int b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
// gcd array
int findGCD(int arr[], int n){
    int result = arr[0];
    for (int i=1; i < n; i++)
        result = gcd(arr[i], result);

    return result;
}

// sort big to small
// sort(A,A+N, greater<int>());

// v.front() = -BOUND;
// v.back() = BOUND;

// Iterator
// v.begin
// v.end

int main() {
    unsigned int N;
    int answer = 0;

    cin >> N;

    vector<int> h(N,0);
    rep(i,N){
        cin >> h[i];
    }

    int active=0;

    for(int i=0; i<N; i++){
        if(active >= h[i])
            active = h[i];
        else{
            answer+=(h[i]-active);
            active=h[i];
        }
    }
    cout << answer << endl;
    return 0;
}



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

int main(void) {

  int n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int all = pow(3,n);
  int odd = 1;
  for (int i = 0; i < n; i++) {
    if (a[i]%2 == 0) {
      odd *= 2;
    }
  }
  printf("%d\n", all-odd);

  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <algorithm>
using namespace std;

typedef unsigned int uint;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vint;
typedef vector<uint> vuint;
typedef vector<ull> vull;
typedef vector<ll> vll;

#define init(type,var) type var;cin>>var;
#define vinit(vtype,var,n) vtype var((uint)n);loop(i,0,n)cin>>var[i];
#define range(container) container.begin(),container.end()
#define loop(i,first,end) for(ull i=(first);i<(end);i++)
#define outl(out) cout<<(out)<<endl;

const ull INF = (ull)(-1LL);

int main(void){
	init(ull, n);
	vinit(vull, b, n - 1);

	vull a(n, INF);

	loop(i, 0, n - 1){
		if (a[i] > b[i])a[i] = b[i];
		a[i + 1] = b[i];
	}
	ull sum = 0;
	loop(i, 0, n)sum += a[i];

	outl(sum);

	return 0;
}

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

const int mod=1000000007;
inline void add(int &a,int b){
    a+=b;
    if(a>=mod)a-=mod;
}
int mpow(int n,int m){
    int ret=1;
    while(m){
        if(m&1)ret=ret*n%mod;
        n=n*n%mod;
        m>>=1;
    }
    return ret;
}
const int FACT_SIZE=1111111;
int fact[FACT_SIZE];
int inv[FACT_SIZE];
struct fact_exec{
    fact_exec(){
        fact[0]=1;
        for(int i=1;i<FACT_SIZE;i++)fact[i]=fact[i-1]*i%mod;
        inv[FACT_SIZE-1]=mpow(fact[FACT_SIZE-1],mod-2);
        for(int i=FACT_SIZE-2;i>=0;i--)inv[i]=inv[i+1]*(i+1)%mod;
    }
}factexec;
int nCk(int n,int k){
    return fact[n]*inv[k]%mod*inv[n-k]%mod;
}
int nPk(int n,int k){
    return fact[n]*inv[n-k]%mod;
}


int N;
vint G[5555];
int sz[5555];

pint dfs(int v,int p){
    sz[v]=1;
    int m=0;

    pint ret(INT_MAX,-1);
    for(auto u:G[v]){
        if(u==p)continue;
        chmin(ret,dfs(u,v));
        sz[v]+=sz[u];
        chmax(m,sz[u]);
    }
    chmax(m,N-sz[v]);
    chmin(ret,pint(m,v));
    return ret;
}

int dp[2][5555];

signed main(){
    cin>>N;
    rep(i,N-1){
        int a,b;
        cin>>a>>b;
        a--;b--;
        G[a].pb(b);G[b].pb(a);
    }

    int c=dfs(0,-1).se;
    dfs(c,-1);

    vint v;
    for(auto u:G[c])v.pb(sz[u]);

    int n=v.size();
    dp[0][0]=1;
    rep(i,n){
        rep(j,N+1){
            rep(k,v[i]+1){
                if(j+k>N)break;
                int tmp=nCk(v[i],k)*nCk(v[i],k)%mod;
                tmp=tmp*fact[k]%mod;
                add(dp[(i+1)&1][j+k],dp[i&1][j]*tmp%mod);
            }
            dp[i&1][j]=0;
        }
    }

    int ans=0;
    for(int i=0;i<N;i++){
        int tmp=dp[n&1][i];
        tmp=tmp*fact[N-i]%mod;
        if(i&1)add(ans,mod-tmp);
        else add(ans,tmp);
    }
    cout<<ans<<endl;
    return 0;
}


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

int main(){
    int n,m; cin >> n >> m;

    vector<ll> H(n);
    for(int i=0; i<n; i++) cin >> H[i];

    vector<int> Truths(n,1);

    for(int i=0; i<m; i++){
        int a,b; cin >> a >> b;
        if(H[a-1] > H[b-1]){
            Truths[b-1] = 0;
        }else if(H[a-1] == H[b-1]){
            Truths[a-1] = 0;
            Truths[b-1] = 0;
        }else{
            Truths[a-1] = 0;
        }
    }

    int ans = 0;
    for(int i=0; i<n; i++){
        if(Truths[i] == 1) ans++;
    }

    cout << ans << endl;
}

Measured memory_bytes: 4220
#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
using namespace std;
using uint = unsigned int;

int main() {
	uint N;
	cin >> N;
	
	vector<uint> P(N);
	for(uint i=0; i<N; i++) cin >> P[i];
	
	vector<uint> Q(N);
	for(uint i=0; i<N; i++) cin >> Q[i];
	
	vector<uint> B(N);
    iota(B.begin(), B.end(), 1);
	
	int ans = 0;
	int idx = 0;
	
	do {
		if(equal(B.cbegin(), B.cend(), P.begin())) ans = abs(ans - idx);
		if(equal(B.cbegin(), B.cend(), Q.begin())) ans = abs(ans - idx);
		idx++;
	} while (std::next_permutation(B.begin(), B.end()));
	
	cout << ans;	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;
 
#define endl '\n'
#define loop(i, m, n) for (lli i = m; i < n; i++)
#define loope(i, m, n) for (lli i = m; i <= n; i++)
#define epool(i, m, n) for (lli i = m; i >= n; i--)
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define vt vector<lli>
#define fi first
#define se second
#define pb push_back
#define umap unordered_map
#define mmap multimap
#define MP make_pair
#define empf emplace_front
#define empb emplace_back
#define ret(x) return cout << x << endl, 0;
#define all(v) v.begin(),v.end()

#define fast_io                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
using namespace std;
 
lli gcd(lli a, lli b){
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
 
lli lcm(lli a, lli b){
    return (a * b) / gcd(a, b);
}
 
lli modi( lli n, lli m=mod ){ 
    n%=m;
    n+=m;
    n%=m;
    return n;
}

lli mpow(lli base, lli exp){
    base %= mod;
    lli result = 1;
    while (exp > 0){
        if (exp & 1)
            result = ((lli)result * base) % mod;
        base = ((lli)base * base) % mod;
        exp >>= 1;
    }
    return result;
}

const lli MIN=-1*1e18;
const lli INF=1e18+999999999999999999;
const lli N=2e5+5;
const ldb pi=4*atan(1);

int32_t main(){
    fast_io
    lli i = 0,j = 0;
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //cout << fixed << setprecision(22);
   
   lli n,k;
   cin >> n >> k;
   map<lli,lli> mp;
   loop(i,0,k){
       lli d;
       cin >> d;
       loop(j,0,d){
           lli a;
           cin >> a;
           mp[a]++;
       }
   }
    lli ans=0;
   loope(i,1,n){
       if(mp[i]==0) ans++;
   }

   cout << ans << endl;


}



Measured memory_bytes: 3680
#include "bits/stdc++.h"

using namespace std;

void solve()
{
	long n, as[5];
	cin >> n;
	for (int i = 0; i < 5; i++) cin >> as[i];
	long neck = *min_element(as, as+5);
	long ans = 5;
	ans += (n - 1) / neck;
	cout << ans << endl;
}

int main()
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define range(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, b) for (int i = 0; i < (b); i++)
#define ranger(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define repr(i, b) for (int i = (b) - 1; i >= 0; i--)
#define all(a) (a).begin(), (a).end()
#define show(x) cerr << #x << " = " << (x) << endl;
#define int long long
using namespace std;

template <typename X, typename T>
auto vectors(X x, T a) {
	return vector<T>(x, a);
}
template <typename X, typename Y, typename Z, typename... Zs>
auto vectors(X x, Y y, Z z, Zs... zs) {
	auto cont = vectors(y, z, zs...);
	return vector<decltype(cont)>(x, cont);
}

template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
	rep(i, v.size()) { os << v[i] << (i == v.size() - 1 ? "" : " "); }
	return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, pair<T, S>& p) {
	os << '(' << p.first << ',' << p.second << ')';
	return os;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
	for (T& x : v) { is >> x; }
	return is;
}

signed main() {
	int a, b, c;
	cin >>a>>b>>c;
	if(a <= c){
		cout << 0 << ' ' << max(b - (c - a),0LL)  << endl;
	}else{
		cout << a - c << ' ' << b << endl;
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define intt long long int
#define intu unsigned long long int
#define vi vector<intt>
#define ii pair<int,int>
#define pb push_back
#define ff first
#define ss second
#define fast_io ios::sync_with_stdio(0);cin.tie(NULL);std::cout.tie(NULL);
# define PI           3.14159265358979323846 
#define all(a) a.begin(),a.end()
#define for0(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define loop(i,a,b) for (int i = a; i < b; i++)
#define bloop(i,a,b) for (int i = a ; i>=b;i--)
#define tc(t) int t; cin >> t; while (t--)
int mod = 1000000007;
intt gcd(intt a, intt b) {return b ? gcd(b, a % b) : a;}
intt lcm(intt a, intt b) {return a * b / gcd(a, b); }
intt bpow(intt a,intt b) 
{
  intt res = 1;
  while (b > 0) {
    if (b & 1)res = ((res) * (a))%mod;
      a = ((a) * (a))%mod;
      b >>= 1;
  }
  return res;
}
intt fact(intt n) { 
   if ((n==0)||(n==1))
      return 1; 
   else
      return n*fact(n-1);
}
void go()
{
#ifndef ONLINE_JUDGE
  freopen("ino.txt","r",stdin);
  freopen("onc.txt","w",stdout);
  #endif
}


int main(){

   // go();
    fast_io
    intt n;cin>>n;
    vi v(n);
    for0(i,n){
      cin>>v[i];
    }
    intt ans=0,prev_max=v[0];
    for1(i,n-1){
      if(prev_max>v[i]){
        ans+=(prev_max-v[i]);
      }
      prev_max=max(v[i],prev_max);
    }
    cout << ans <<'\n'; 
}



/*
3
17
4
*/






















Measured memory_bytes: 4780
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// #define debug(a) cout << "["; rep(i,a.size()) cout << a[i] << ", "; cout<<"]"<< endl;

const ll mod = 1000000007;

int main() {
    int n; cin >> n;
    vector<int> As(n);
    rep(i,n) cin >> As.at(i);

    int ans = 0;
    for(int i = 0; i < n; i = i + 2){
        int a = As.at(i);
        if(a % 2 == 1){
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main(){
	int N, K; cin >> N >> K;
	ll V[N];
	for(int i=0; i<N; i++){
		cin >> V[i];
	}
	ll ans = 0;
	for(int i=1; i<=K && i<=N; i++){
		for(int j=0; j<=i; j++){
			ll sum = 0;
			vector<ll> w;
			for(int k=0; k<j; k++){
				w.push_back(V[k]);
				sum += V[k];
			}
			for(int k=0; k<i-j; k++){
				w.push_back(V[N-1-k]);
				sum += V[N-1-k];
			}
			sort(w.begin(), w.end());
			for(int k=0; k<K-i; k++){
				if(w[k] < 0){
					sum -= w[k];
				}else{
					break;
				}
			}
			if(sum > ans) ans = sum;
		}
	}
	cout << ans << endl;
	return 0;
}


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

#define REP(i, n, m) for(int i = n; i < m; i++)
#define REPR(i, n, m) for(int i = n; i >= m; i--)
#define LREP(i, n, m) for(ll i = n; i < m; i++)
#define LREPR(i, n, m) for(ll i = n; i >= m; i--)


const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;

typedef long long ll;


//---functions---//
int gcd(int a, int b){
    if(a < b) swap(a, b);
    return b?gcd(b, a%b):a;
}

int s2i(string num){stringstream ss; ss << num << flush; int n; ss >> n; return n;}
string i2s(int n){stringstream ss; ss << n << flush; return ss.str();}
//---------------//

int main(){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    int N, K, idx;
    int A[N];
    cin >> N >> K;
    REP(i, 0, N) cin >> A[i];
    int ans;
    ans = (N - 1)%(K - 1) == 0 ? (N - 1)/(K - 1) : (N - 1) / (K - 1) + 1;
    cout << ans << endl;
}


Measured memory_bytes: 2688
using System;
class Program{
	static void Main(string[] args){
    	string[] input = Console.ReadLine().Split('/');
      	int[] IntIn = new int[3];
      
      	for(int i = 0;i < IntIn.Length ;i ++){
        	IntIn[i] = int.Parse(input[i]);
        }
      if(IntIn[0] >= 2019 && IntIn[1] > 4){
      	Console.WriteLine("TBD");
      }else{
      	Console.WriteLine("Heisei");
      }
      
      
    }
}

Measured memory_bytes: 11092
fn main() {
    let mut input = String::new();
    std::io::stdin().read_line(&mut input).unwrap();
    let s: &str = &input.trim();
    
    let mut t = String::new();

    let mut tmp = String::new();
    let erase = "erase".chars().rev().collect::<String>();
    let eraser = "eraser".chars().rev().collect::<String>();
    let dream = "dream".chars().rev().collect::<String>();
    let dreamer = "dreamer".chars().rev().collect::<String>();

    for word in s.chars().rev() {
        tmp.push(word);
        if ( tmp == erase ) {
            t.push_str(erase.trim());
            tmp.clear();
        } else if ( tmp == dream ) {
            t.push_str(dream.trim());
            tmp.clear();
        } else if ( tmp == eraser ) {
            t.push_str(eraser.trim());
            tmp.clear();
        } else if ( tmp == dreamer ) {
            t.push_str(dreamer.trim());
            tmp.clear();
        } 
    }

//    println!("input:{}", s.chars().rev().collect::<String>().trim());
//    println!("t    :{}", t);
    if (s.chars().rev().collect::<String>().trim() == t.trim() ) {
        println!("YES");
        return;
    }
    println!("NO");
}

Measured memory_bytes: 4352