akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include <string>
#include <complex>
#include <functional>
using namespace std;
using ll = long long;
//typedef pair<string,string> P;
//double dat[100][100];
//int dp[6][1010];//動的計画法
//int prime[10000001];
//char str[1010][1010];
//vector<pair<int,int> > pc[100001];
//int ABS(int a){return max(a,-a);}
ll num[200000];
int main(){
	ll n,k,ans,tmp=0,p=0;
	cin>>n>>k;
	for(int i=0;i<n;i++){
		ll a;
		cin>>a;
		num[a]++;
	}
	sort(num,num+200000);
	for(int i=199999;i>=0;i--){
		if(p+1>k) break;
		tmp+=num[i];
		p+=1;
	}
	ans=n-tmp;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define REP(i,j) for(int i=0;i<j;i++)
#define FORN(i,j,k) for(int i=j;i<k;i++)
#define vi vector<int>
#define vvi vector<vi >
#define pii pair<int,int>
#define vpii vector<pii >
using namespace std;
string s;
int main(void){
	cin>>s;
	REP(i,s.size())cout<<"x";
	return 0;
}

Measured memory_bytes: 256
n = int(input())
c = list(input())

if 'R' not in c or 'W' not in c:
    print(0)
    exit()

left, right = 0, len(c) - 1
cnt = 0

while left < right:

    if c[left] == c[right] == 'W':
        right -= 1
        continue

    elif c[right] == c[left] == 'R':
        left += 1
        continue

    elif c[left+1] == 'R' and c[left] == 'W':
        c[left] = 'R'
        left += 1

    elif  c[right-1] == 'W' and c[right] == 'R':
        c[right] = 'W'
        right -= 1

    elif c[left] is 'W' and c[right] is 'R':
        c[left] = 'R'
        c[right] = 'W'

    else:
        left += 1
        right -= 1
        continue

    left += 1
    right -= 1

    cnt += 1

print(cnt) 

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

int main() {
	int s;
	cin >> s;
	int a, b;
	a = s / 100;//上二桁
	b = s % 100;//下二桁
	if (a > 12) {
		if (b > 12) {
			cout << "NA";
		}
		else if (b == 0) {
			cout << "NA";
		}
		else if (b < 13) {
			cout << "YYMM";
		}
	}
	else if (a == 0) {
		if (b == 0) {
			cout << "NA";
		}
		else if (b > 12) {
			cout << "NA";
		}
		else if (b < 13) {
			cout << "YYMM";
		}
	}
	else if (a < 13) {
		if (b == 0) {
			cout << "MMYY";
		}
		else if (b > 12) {
			cout << "MMYY";
		}
		else if (b < 13) {
			cout << "AMBIGUOUS";
		}
	}
}

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

int minimumcost(int n,int k,vector<int>&v)
{
    if(k>=n)
    {
        return abs(v[n-1]-v[0]);
    }

    vector<int>dp(n,0);
    dp[0]=0;
    for(int i=1;i<=k;i++)
    {
        dp[i]= abs(v[i]-v[0]);
    }

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

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

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

	cout<<minimumcost(n,k,v);
} 

Measured memory_bytes: 3876
#include<bits/stdc++.h>
using namespace std;
int a[200005];
int b[1000005];
int main(){
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
        scanf("%d",&a[i]);
    int r=250000;
    int l=250000;
    for(int i=0;i<n;i++){
        if(i==0){
            b[l--]=a[i];
        }
        if(i%2){
            b[l--]=a[i];

        }
        else{
            b[r++]=a[i];
        }

    }

    if(n%2==0){
        for(int i=l+1;i<r;i++){

            printf("%d",b[i]);
            if(i==r-1)
                puts("");
            else
                printf(" ");
        }
    }
    else{
        for(int i=r-1;i>l;i--){
            printf("%d",b[i]);
            if(i==l+1)
                puts("");
                else
                printf(" ");
        }

    }
}


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

#define dump(x) cout << (x) << '\n'
#define Int int64_t
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()

Int INF = 1e18;
Int mod = 1e9+7;
//Int mod = 998244353;

typedef struct {
    Int y, x;
} p_t;


int main() {
    Int n;
    string s;
    cin >> n >> s;
    Int cnt = 0;
    for (Int i = 0; i < n - 2; i++) {
        if (s[i] == 'A' and s[i + 1] == 'B' and s[i + 2] == 'C') {
            cnt++;
        }
    }
    dump(cnt);
    return 0;
}

Measured memory_bytes: 764
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <set>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

using namespace std;
typedef long long int lli;

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

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

using namespace std;
using namespace atcoder;
using usize = ::std::size_t;
using u64 = ::std::int_least64_t;
//using u64 = long long;
static constexpr u64 Inf = ::std::numeric_limits<u64>::max() / 2;


int main(int argc, char *argv[])
{
    
    
    cin.tie(0) ;
    ios::sync_with_stdio(false) ;
    
    int N, M;
    cin >> N >> M;
    mf_graph<u64> graph(N * M + 2);
    vector<vector<char>> grid(N, vector<char>(M));
    int s = N * M, t = N * M + 1;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < M; j++) {
            cin >> grid[i][j];
            if(grid[i][j] == '#') continue;
            int v = i * M + j;
            if ((i + j) % 2 == 0) {
                graph.add_edge(s, v, 1LL);
            } else {
                graph.add_edge(v, t, 1LL);
            }
        }
    }
    
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < M; j++) {
            if((i+j)%2 || grid[i][j] == '#') continue;
            int v0 = i * M + j;
            if(i && grid[i - 1][j] == '.'){
                int v1 = (i - 1) * M + j;
                graph.add_edge(v0, v1, 1LL);
            }
            if (j && grid[i][j - 1] == '.') {
                int v1 = i * M +j - 1;
                graph.add_edge(v0, v1, 1LL);
            }
            if(i + 1 < N && grid[i + 1][j] == '.'){
                int v1 = (i + 1) * M + j;
                graph.add_edge(v0, v1, 1LL);
            }
            if (j + 1 < M && grid[i][j + 1] == '.') {
                int v1 = i * M + j + 1;
                graph.add_edge(v0, v1, 1LL);
            }
        }
    }
    
    cout << graph.flow(s, t) << endl;
    
    auto edges = graph.edges();
    for(auto e : edges){
        if(e.from == s || e.to == t || e.flow == 0) continue;
        int i0 = e.from / M, j0 = e.from % M;
        int i1 = e.to / M, j1 = e.to % M;
        
        if (i0 == i1 + 1) {
            grid[i1][j1] = 'v';
            grid[i0][j0] = '^';
        } else if (j0 == j1 + 1) {
            grid[i1][j1] = '>'; grid[i0][j0] = '<';
        } else if (i0 == i1 - 1) {
            grid[i0][j0] = 'v';
            grid[i1][j1] = '^';
        } else {
            grid[i0][j0] = '>'; grid[i1][j1] = '<';
        }
    }
    
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < M; j++) {
            cout << grid[i][j];
        }
        cout << endl;
    }
    
    return 0;
    
}


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

int main() {
    std::string str;
    std::cin >> str;
    int sum = 0;
    for (int i = 0; i < str.length(); i++) {
        sum = (sum + (int)(str[i] - '0')) % 9;
    }
    if (sum == 0) {
        std::cout << "Yes" << std::endl;
    } else {
        std::cout << "No" << std::endl;
    }
}


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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int num = Integer.parseInt(br.readLine());

		String[] vectorX = br.readLine().split(" ");
		String[] vectorY = br.readLine().split(" ");

		int[] vectorElement = new int[num];
		for(int i = 0; i < num;i++){
			int convertX = Integer.parseInt(vectorX[i]);
			int convertY = Integer.parseInt(vectorY[i]);

			vectorElement[i] =Math.abs(convertX - convertY);
		}

		double distanceP1 = 0;
		for(int i = 0; i < num;i++){
			distanceP1 += vectorElement[i];
		}
		System.out.printf("%.6f\n", distanceP1);

		double distanceP2 = 0;
		for(int i = 0; i < num;i++){
			double power2Abs = Math.abs(vectorElement[i] * vectorElement[i]);
			distanceP2 += power2Abs;
		}
		double distanceP2Sqrt = Math.sqrt(distanceP2);
		System.out.printf("%.6f\n", distanceP2Sqrt);

		double distanceP3 = 0;
		for(int i = 0; i < num;i++){
			double power3Abs = Math.abs(vectorElement[i] * vectorElement[i] * vectorElement[i]);
			distanceP3 += power3Abs;
		}
		double distanceP3Cbrt = Math.cbrt(distanceP3);
		System.out.printf("%.6f\n", distanceP3Cbrt);

		double max = vectorElement[0];
		for(int i = 1;i < num - 1;i++){
			max = Math.max(max, vectorElement[i]);
		}
		System.out.printf("%.6f\n", max);

		br.close();
	}
}

Measured memory_bytes: 24812
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int (i) = 0; (i) < n; (i)++)
#define SORT(a) sort((a).begin(), (a).end())
#define MOD 1000000007
typedef long long ll;

int main(void){
  int n, k;
  cin >> n >> k;
  vector<int> hozon(1e6, 0);
  rep(i, n){
    int tmp;
    cin >> tmp;
    hozon[tmp]++;
  }
  sort(hozon.begin(), hozon.end(), greater<int>());
  ll sum = 0;
  for(int i = k; i < hozon.size(); i++){
    sum += hozon[i];
  }
  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 4096
#include <bits/stdc++.h>
	#include <iostream>
	#include <string>
	#include <math.h>
	#include <vector>
	#include <signal.h> 
	#include <locale> 

#define fo(i,n) for(long long int i=0;i<n;i++)
#define fo1(i, n) for (long long int i = 1; i <= (long long int)(n); i++)
#define pb push_back
#define fill_vector(n,v) for(long long int i=0;i<n;i++){double temp;cin>>temp;v.push_back(temp); }
#define print_vector(n,v) for(long long int i=0;i<n;i++){cout<<v[i]<<"\n"; } 
#define sortv(v) sort(v.begin(), v.end())
#define sortvo(v) sort(v.begin(), v.end(),greater<long long int>())
#define f(i,l,r) for(ll i=l;i<=r;i++)
#define rf(i,r,l) for(ll i=r;i>=l;i--)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector< int>
#define vs vector<string>
#define y() cout<<"YES"<<"\n"
#define n() cout<<"NO"<<"\n"
#define logbase(x,y) {log10(y)/log10(x)}

typedef int long long ll;
using namespace std;

//freopen("input.txt", "r", stdin); 
//freopen("output.txt", "w", stdout);

//to convert string into int ;
/*string temp1;
stringstream degree(temp1);
int x = 0;
degree >> x;
cout<<x;*/
bool sortbysec(const pair<int,int> &a, 
              const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
} 
ll min_v(vi v,ll n)
{	sortv(v);
	return v[0];
}
ll gcd(ll a, ll b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
ll sol(vi v,ll n,int sum)
{
	ll low=0,high=n-1,mid;
	while(low<=high)
	{   mid=low+(high-low)/2;
		if(v[mid]==sum)
		{mid++;
			return mid;}
		else if(v[mid]>sum)
		{
		 high=mid-1;}
		 else if(v[mid]<sum)
		 {low=mid+1;
			}
	}
	low++;
	return low;
	}
	

int main()
{ 
	fast;
	ll t=1;
	//cin>>t;
	while(t--)
	{
		string s;
		ll count=0,m=0;
		cin>>s;
		for(ll i=0;i<3;i++)
		{
			if(s[i]=='R')
			{count++;
				m=max(count,m);
				//cout<<"hi";}
				
			}
			else
			{
				m=max(count,m);
				count=0;}
		}
		cout<<m;
	}
		return 0;
}



Measured memory_bytes: 3608
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string.h>
using namespace std;
typedef long long int lli;
#define urept(soeji, start, n) for (int soeji = start; soeji < n; soeji++)
#define drept(soeji, start, n) for (int soeji = start; soeji > n; soeji--)
int main(void)
{
    int N, H, W;
    cin >> N >> H >> W;
  	cout << (N-H+1)*(N-W+1) <<endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.text.*;
import java.util.*;

public class Main {

    static InputReader sc = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        solver s = new solver();
        int t = 1;
        while (t > 0) {
            s.solve();
            t--;
        }
        out.close();
    }

    static class InputReader {

        public BufferedReader br;
        public StringTokenizer token;

        public InputReader(InputStream stream) {
            br = new BufferedReader(new InputStreamReader(stream), 32768);
            token = null;
        }

        public String sn() {
            while (token == null || !token.hasMoreTokens()) {
                try {
                    token = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return token.nextToken();
        }

        public int ni() {
            return Integer.parseInt(sn());
        }

        public String snl() throws IOException {
            return br.readLine();
        }

        public long nlo() {
            return Long.parseLong(sn());
        }

        public double nd() {
            return Double.parseDouble(sn());
        }

        public int[] na(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = sc.ni();
            return a;
        }

        public long[] nal(int n) {
            long a[] = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = sc.nlo();
            return a;
        }
    }

    static int inf = 5000013;

    static class solver {
        DecimalFormat df = new DecimalFormat("0.00000000000000000000");
        long max = 1000000000000000l, min = -10000000000000000l;
        long mod = (long) 1e9 + 7;

        long pro(long a, long b) {
            return (a % mod * b % mod) % mod;
        }

        long add(long a, long b) {
            return (a + b) % mod;
        }

        long sub(long a, long b) {
            return ((a % mod - b % mod) + mod) % mod;
        }

        long ncr3(long n) {
            return (n * (n - 1) * (n - 2)) / 6l;
        }

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

        long modPow(long x, long y) {
            long res = 1;
            x = x % mod;
            while (y > 0) {
                if (y % 2 != 0)
                    res = pro(res, x);
                x = pro(x, x);
                y = y >> 1;
            }
            return res;
        }

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

        final int maxn = 1000005;

        void solve() {
            int r=sc.ni();
            double cir=2*Math.PI*r;
            out.println(df.format(cir));
        }
    }
}


Measured memory_bytes: 35512
#include<iostream>
#include<map>
#include<unordered_map>
#include<set>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<queue>
#include<stack>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef long double ld;
#define mp make_pair
#define pb push_back

#define rep(i, N) for(ll i = 0; i < N; i++)
#define repa(i, a, N) for(ll i = a; i < N; i++)
#define repr(i, N) for(ll i = N-1; i >= 0; i--)

#define drep(i, N, j, M) rep(i, N) rep(j, M)
#define trep(i, N, j, M, k, L) rep(i, N) rep(j, M) rep(k, L)

#define all(A) A.begin(), A.end()

const ll mod = 1e9 + 7;
// const ll mod = 998244353;

const ll LLMAX = numeric_limits<long long>::max();

void No() {
	cout << "No" << endl;
}

void Yes() {
	cout << "Yes" << endl;
}


int main() {


	ll N;
	cin >> N;

	ll K = 1 << N;
	vi S(K);

	rep(i, K) {
		cin >> S[i];
	}
	sort(all(S));

	multiset<ll> src;
	src.insert(-S.back());

	multiset<ll> rest;
	rep(i, K - 1) {
		rest.insert(-S[i]);
	}


	rep(xxx, N) {

		// cout << "__" << xxx << endl;
		// for (auto s : src) { cout << s << " "; }cout << endl;
		// for (auto s : rest) { cout << s << " "; }cout << endl;

		vi tmp;
		for (auto s: src) {
			auto it = rest.upper_bound(s);
			// cout << ":: " s << ", " << *it << endl;

			if (it == rest.end()) {
				No();
				return 0;
			}

			tmp.pb(*it);
			rest.erase(it);

			// for (auto s : src) { cout << s << " "; }cout << endl;
			// for (auto s : rest) { cout << s << " "; }cout << endl;
		}

		for (auto t : tmp) {
			src.insert(t);
		}
	}

	Yes();
	return 0;
}

Measured memory_bytes: 15616
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#define INF         1e9
#define EPS         1e-9
#define REP(i,n)    for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)   for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)   for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)  for(ll i=(n);i>0;--i)
#define REPC(i,obj) for(auto i:obj)
#define R_UP(a,b)   (((a)+(b)-1)/(b))
#define ALL(obj)    (obj).begin(),(obj).end()
#define SETP        cout << fixed << setprecision(8)
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T x; cin >> x; return x; }

signed main()
{
	int n = in(), m = in();
	vector<int>roads(n, 0);
	REP(i, m) {
		int a = in(), b = in();
		++roads[a - 1];
		++roads[b - 1];
	}
	REPC(i, roads) {
		cout << i << endl;
	}
}

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

int main(int argc, const char * argv[]) {
    int N;
    
    cin >> N;
    
    vector<int> W(N);
    for (int i = 0; i < N; i++) cin >> W[i];
    
    vector<int> sum(N + 1, 0);
    for (int i = 0; i < N; i++) {
        sum[i + 1] = sum[i] + W[i];
    }
    
    int T = 0;
    int minv = 100000000;
    while (T < N) {
        int a1 = sum[T] - sum[0];
        int a2 = sum[N] - sum[T];
        int a3 = abs(a1 - a2);
        minv = min(minv, a3);
        T++;
    }
    
    cout << minv << endl;
    
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
const int INF = 1001001001;
const int MOD = 1000000007;
typedef long long ll;

template<typename T> void print(const T & v);


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

    ll N, K;
    cin >> N >> K;

    if(K == 0){
        cout << N * N << endl;
        return 0;
    }

    ll ans = 0;
    for(ll b = 1; b <= N; b++){
        ll d = N / b;
        ans += d * max(0LL, b - K);
        if(N % b != 0){
            ans += max(0LL, N % b - K + 1);
        }
    }
    cout << ans << endl;
}


// Use For Debug
template <typename T>
void print(T const & v){
    for(int i = 0; i < v.size(); i++){
        if(i) cout << " ";
        cout << v[i];
    }
    cout << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
	int n,a,y,x[1000];
	scanf("%d",&n);
	
	for(y=0;y<n;y++){
		scanf("%d",&a);
		x[y]=a;
		
	}
	
	for(y=n-1;y>-1;y--){
		printf("%d",x[y]) ;
		if( y!=0 ) printf(" ") ;
	}
	printf("\n") ;
	
	return 0;
}

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

int main() {
  int N, cnt = 0;
  cin >> N;
  
  vector<int> vec(N);
  for (int i = 0; i < N; i++){
    cin >> vec.at(i);
  }
  
  // for (int i = 0; i < N; i++){
  //   if (vec.at(i)%2 == 0){
  //     cnt++;
  //   }else{
  //     break;
  //   }
  
  while (true){
    bool exist_odd = false;
    for (int i = 0; i < N; i++){
      if(vec.at(i)%2 != 0) exist_odd = true;
    }
    
    if (exist_odd == true) break;
    
    for (int i = 0; i < N; i++){
      vec.at(i) /= 2;
    }
    
    cnt++;
  }
  cout << cnt << endl;
  
}






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

import sys
import os

d = {}
d['A'] = ['11', '11']
d['B'] = ['1', '1', '1', '1']
d['C'] = ['1111']
d['D'] = ['01', '11', '10']
d['E'] = ['110', '011']
d['F'] = ['10', '11', '01']
d['G'] = ['011', '110']

DEBUG = False

A = []
for s in sys.stdin:
    s = s.strip()
    if s == '':
        continue

    A.append(s)

    if len(A) == 8:
        # solve
        # ...
        answer = None

        for key in d.keys():
            figure = d[key]
            W = len(figure[0])
            H = len(figure)

            for x in range(8 - W + 1):
                for y in range(8 - H + 1):
                    # check
                    is_fit = True
                    for i, row in enumerate(figure):
                        if not row == A[y+i][x:x+W]:
                            is_fit = False
                            break
                    if is_fit:
                        if DEBUG:
                            print()
                            print('all fit', key)
                            print('A', A)
                            print('x, y', x, y)
                            print('W, H', W, H)
                            print('figure', figure)
                        answer = key
        print(answer)
        A = []

Measured memory_bytes: 7336
//Author: master19
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long int
#define ff first 
#define ss second 
#define pb push_back
#define endl "\n"
#define mod 1000000007LL // fixed...
#define modd 1000000007LL // Can be changed for global use
#define all(arr) arr.begin(),arr.end()
#define x(arr) arr.begin(),arr.end()
#define ulli unsigned long long int
#define assign(x,val) memset(x,val,sizeof(x))
#define prec(val, dig) fixed << setprecision(dig) << val
#define Sort(arr) sort(arr.begin(), arr.end())
#define lower(str) transform(str.begin(), str.end(), str.begin(), ::tolower);
#define upper(str) transform(str.begin(), str.end(), str.begin(), ::toupper);
#define crap ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define get(arr, num) vector < ll > arr(num); for(int i=0; i<num; i++)cin >> arr[i];
#define get_set(arr, num, st, type) set < type > st; for(int i=0; i<num; i++) st.insert(arr[i]);
#define put(arr, num) for(int i=0; i<num; i++)cout << arr[i] << " "; cout << endl;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update > new_ds; 
void debug_out() { cerr << endl; }
template <typename HeadStart, typename... TailEnd>
void debug_out(HeadStart H, TailEnd... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
ll lets_do_it();
pair < ll, ll > xy[] = {{-1, 0}, {1, 0} , {0, -1}, {0, 1}};
pair < ll, ll > dig[] = {{-1, -1}, {-1, 1}, {1, 1}, {1, -1}};
bool isValid(ll x, ll y, ll row, ll col){
    return ((x>=0) && (y >=0)  && (x < row) && (y < col));
}
int main(int argc, const char** argv) {
    crap;
    ll test = 1;
    // cin >> test;
    for(int loop=0; loop<test; loop++){
        // cout << "Case #" << (loop+1) << ": "; 
        lets_do_it();
    }
    return 0;
}
ll lets_do_it(){
    // Your code goes by here !!
    ll a, b, c;
    cin >> a >> b >> c;
    if(a%2 == 0 || b%2 == 0 || c%2 ==0)
        cout << "0\n";
    else{
        cout << min(a*b, min(b*c, a*c)) << endl;
    }




    return 0;
}


Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(int (i) = 0; (i) < (N); (i)++)
#define all(v) (v).begin(), (v).end()
#define eb emplace_back
#define Cout(s) cout << s << endl
string Yes(bool b) {if(b){return "Yes";} else {return "No";}}
string YES(bool b) {if(b){return "YES";} else {return "NO";}}


int main(){
	int A, B;
	cin >> A >> B;

	if(A == 1) A = 14;
	if(B == 1) B = 14;

	if(A > B) Cout("Alice");
	else if(A < B) Cout("Bob");
	else Cout("Draw");
}


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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

/////////////////////////////////////////////////////////////
ll mypow_core(ll x, int n, ll result) {
  if (n == 0) {
    return result;
  }

  if (n % 2 == 0) {
    return mypow_core(x * x, n / 2, result);
  } else {
    return mypow_core(x, n - 1, x * result);
  }
}

ll mypow(ll x, int n) { return mypow_core(x, n, 1); }
/////////////////////////////////////////////////////////////

const int MAX_N = (int)(2e5 + 5);

int n;
ll a[MAX_N];
ll b[MAX_N];

ll decide(int k) {
  ll t = mypow(2LL, k);

  vector<ll> ma;
  vector<ll> mb;

  for (int i = 0; i < n; ++i) {
    ma.push_back(a[i] % (2LL * t));
    mb.push_back(b[i] % (2LL * t));
  }

  sort(mb.begin(), mb.end());

  ll cnt = 0LL;

  for (auto &e : ma) {
    ll fst = upper_bound(mb.begin(), mb.end(), 2LL * t - e - 1LL) - lower_bound(mb.begin(), mb.end(), t - e);
    ll snd = upper_bound(mb.begin(), mb.end(), 4LL * t - e - 1LL) - lower_bound(mb.begin(), mb.end(), 3LL * t - e);
    cnt += fst + snd;
  }

  return cnt % 2LL;
}

int main(void) {
  // Here your code !
  scanf("%d", &n);

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

  for (int i = 0; i < n; ++i) {
    scanf("%lld", &(b[i]));
  }

  vector<ll> target_bits;

  for (int i = 0; i < 30; ++i) {
    target_bits.push_back(decide(i));
  }

  ll base = 1LL;
  ll ans = 0LL;

  for (int i = 0; i < target_bits.size(); ++i) {
    ans += target_bits[i] * base;
    base *= 2LL;
  }

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

  return 0;
}


Measured memory_bytes: 9276
#include<stdio.h>
#include<string>
#include<iostream>
#include<math.h>
#include<vector>
#include<set>
#include<algorithm>
#include<list>
using namespace std;

int main() {
	int N, K, x = 0;
	cin >> N >> K;
	int *l;
	l = (int*)malloc(sizeof(int)*N);
	for (int i = 0;i < N;i++)cin >> l[i];
	sort(l, l + N);
	for (int i = 1;i <=K;i++) {
		x += l[N - i];
	}
	cout << x << endl;
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <random>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
typedef map<int, int> mii;
typedef set<int> si;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STLL(s) strtoll(s.c_str(), NULL, 10)
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int
#define endl '\n';
#define fi first
#define se second
#define NONVOID [[nodiscard]]
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
inline string getline(){string s; getline(cin,s); return s;}
inline void yn(const bool b){b?fin("yes"):fin("no");}
inline void Yn(const bool b){b?fin("Yes"):fin("No");}
inline void YN(const bool b){b?fin("YES"):fin("NO");}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;



int main() {
    
    int n,_;
    cin>>n>>_;
    vector<queue<int>> s(n);
    int t,x;
    while(_--){
        int Q;
        cin>>Q;
        switch(Q){
        case 0:
            cin>>t>>x;
            s[t].push(x);
            break;
        case 1:
            cin>>t;
            if(!s[t].empty())cout<<s[t].front()<<endl;
            break;
        case 2:
            cin>>t;
            if(!s[t].empty())s[t].pop();
            break;
        }
    }
}




Measured memory_bytes: 4264
/*
      author : nishi5451
      created: 11.08.2020 22:19:54
*/

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


int main(){
    int n;
    cin >> n;
    cout << n*n*n << endl;
    return 0;
}

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

int H,W;
char p[101][101];
char temp;
int dv[4]={1,0,-1,0},du[4]={0,1,0,-1};

void dfs(int v,int u){
    temp=p[v][u];
    p[v][u]='a';
    for(int i=0;i<4;i++){
        int nv=v+dv[i],nu=u+du[i];
        if(nv>=0&&nv<W&&nu>=0&&nu<H&&p[nv][nu]==temp){
            dfs(nv,nu);
        }
    }
}

void input(){
    cin >> H >> W;
    for(int u=0;u<H;u++){
        for(int v=0;v<W;v++){
            cin >> p[v][u]; //p[x][y]
        }
    }
}


int main(){
    while(1){
        int count=0;
        input();
        if(H==0&&W==0) break;
        for(int u=0;u<H;u++){
            for(int v=0;v<W;v++){
                if(p[v][u]!='a'){
                    dfs(v,u);
                    count++;
                }
            }
        }
    cout << count << endl;
    }
    return 0;
}

Measured memory_bytes: 3400
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]


from collections import defaultdict, Counter
import math
from bisect import bisect_left, bisect_right
import numpy as np

#### START
n = int(input())
a = list(map(int,input().split()))

a.sort()
c = 0
ans = 0
vc = 0
for ai in a:
    if 0<=ai and ai <400 and c<1:
        ans+=1
        c=1
    elif 400<=ai and ai<800 and c<2:
        ans+=1
        c=2
    elif 800<=ai and ai<1200 and c<3:
        ans+=1
        c=3
    elif 1200<=ai and ai<1600 and c<4:
        ans+=1
        c=4
    elif 1600<=ai and ai<2000 and c<5:
        ans+=1
        c=5
    elif 2000<=ai and ai<2400 and c<6:
        ans+=1
        c=6
    elif 2400<=ai and ai<2800 and c<7:
        ans+=1
        c=7
    elif 2800<=ai and ai<3200 and c<8:
        ans+=1
        c=8
    elif 3200<=ai:
        vc+=1

if ans!=0:
    print("{} {}".format(ans, ans+vc))
else:
    print("{} {}".format(1, ans+vc))


Measured memory_bytes: 21256
import sys
import numpy as np

#n=int(sys.stdin.readline())
n,m=map(int,sys.stdin.readline().split())
a=np.array(sys.stdin.readline().split(),dtype='int64')
#a=np.array([sys.stdin.readline().split() for i in range(n)],dtype='int64')

a=np.sort(a)[::-1]
to=np.sum(a)

if a[m-1]<to*(1/4/m):
    print('No')
else:
    print('Yes')


Measured memory_bytes: 21648
def f(e):
 a=list([*map(int,input().split())]for _ in range(int(e)))
 s,t=a[0]
 b={tuple(map(int,input().split()))for _ in range(int(input()))}
 for x,y in b:
  for u,v in a[1:]:
   if(x+u-s,y+v-t)not in b:break
  else:return print(x-s,y-t)
for e in iter(input,'0'):f(e)


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

const int MOD = 1000000007;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define copy(from, to) copy(from.begin(), from.end(), back_inserter(to))
#define sort(a) sort(a.begin(), a.end())
#define reverse(s) reverse(s.begin(), s.end())
#define p(s) cout << (s) << endl

typedef long long ll;
using namespace std;

template<class T>
void load(vector<T> &v, int n) {
  for (int i = 0; i < n; ++i) {
    T t;
    cin >> t;
    v.push_back(t);
  }
}

template<class T>
T max(vector<T> &v) {
  return *max_element(v.begin(), v.end());
}

template<class T>
T min(vector<T> &v) {
  return *min_element(v.begin(), v.end());
}

void py(bool isUpper = false) {
  if (isUpper) {
    p("YES");
  } else {
    p("Yes");
  }
}

void pn(bool isUpper = false) {
  if (isUpper) {
    p("NO");
  } else {
    p("No");
  }
}

int main() {
  int x[5] = {0};
  rep(i, 3) {
    int a, b;
    cin >> a >> b;
    x[a]++;
    x[b]++;
  }

  if (x[1] == 3 || x[2] == 3 || x[3] == 3 || x[4] == 3) {
    pn(true);
  } else {
    py(true);
  }
}

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

int main(){
  vector<int> x(4,0);
  REP(i,4) cin>>x.at(i);
  cout<<min(x.at(0),x.at(1))+min(x.at(2),x.at(3));
}

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

using namespace std;

const int INF = 1 << 30;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  int64_t K;
  cin >> N >> K;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    A[i]--;
  }
  int base = -1, lcnt = 0;
  vector<int> B(N, -1);
  function<void(int, int, int64_t k)> f = [&](int idx, int cost, int64_t k) {
    if (k == 0) {
      cout << idx + 1 << '\n';
      return;
    }
    if (B[idx] != -1) {
      if (base == -1) {
        base = cost;
        lcnt = cost - B[idx];
        k %= lcnt;
        if (k == 0) {
          cout << idx + 1 << '\n';
          return;
        }
      }
    }
    B[idx] = cost;
    f(A[idx], cost + 1, k - 1);
  };
  f(0, 0, K);
  return 0;
}


Measured memory_bytes: 12704
N,yen=map(int, input().split())

for X in range(N+1):
    for Y in range(N+1):
        if(X +Y > N):
            break
        elif(10000*X+5000*Y+1000*(N-X-Y) == yen):
            print(str(X)+" "+str(Y)+" "+" "+str(N-X-Y))
            exit()
                       
print("-1 -1 -1")

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll h,n; cin >> h >> n;
    vector<int> a(n);
    ll sum =0;
    for(int i=0;i<n;i++){
        cin >> a[i] ;
        sum += a[i];
    }

    if(sum<h) cout << "No" << endl;
    else cout << "Yes" << endl;
}

Measured memory_bytes: 640
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace ABC133D
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));

            return;
        }

        public void Solve(ConsoleInput cin)
        {

            var N = cin.ReadInt;
            var A = cin.ReadLongArray(N);
            var sumA = A.Sum();

            var ans = new long[N];

            ans[0] = sumA - 2 * A.Where((value, index) => index %2 == 1).Sum();
            for(int i = 1; i < N; i++)
            {
                ans[i] = 2 * A[i - 1] - ans[i - 1];
            }

            Console.WriteLine(string.Join(" ", ans));
        }
    }

    public static class Extensions
    {
        public static string Reverse(this string sourse)
        {
            char[] chrAry = sourse.ToCharArray();
            Array.Reverse(chrAry);
            return new string(chrAry);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}


Measured memory_bytes: 33500
#include<stdio.h>
int main(){
	int a,b;
	scanf("%d %d",&a,&b);
	if(a==2||b==2){
		printf("No\n");
	}
	else{
			if(a==1||a==3||a==5||a==7||a==8||a==10||a==12){
		if(b==4||b==6||b==9||b==4||b==11){
			printf("No\n");
		}
		else{
			printf("Yes\n");
		}
	}
	else if(a==4||a==6||a==9||a==4||a==11){
		if(b==4||b==6||b==9||b==4||b==11){
			printf("Yes\n");
		}
		else{
			printf("No\n");
		}
	}
	}

}

Measured memory_bytes: 128
#include <iostream>

using namespace std;

int main() {

    bool isA = false;
    bool isB = false;
    for(int i = 0; i < 3; ++i) {
        char ch;
        cin >> ch;

        if(ch == 'A')
            isA = true;
        if(ch == 'B')
            isB = true;

    }

    if(isA && isB)
        cout << "Yes";
    else
    {
        cout << "No";
    }
    
    cout << endl;

    return 0;

}

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

#define X first
#define Y second

using namespace std;
#define INFLL 1223372036854775808
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define clr(x) memset(x, 0, sizeof(x))
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector< int > vi;
typedef vector< ll > vl;
typedef vector< pii > vpii;
typedef vector< pll > vpll;
#define f(i,a,b) for(int i=a;i<b;i++)
const int MOD = 1e9+7;

ll power(ll a, ll b) {ll ret=1;while(b) {if(b&1) ret*=a;a*=a;if(ret>=MOD) ret%=MOD;if(a>=MOD)a%=MOD;b>>=1;}return ret;}
ll inv(ll x) {return power(x,MOD-2);}

const int N = 1e5+5;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int n,minm=1e9;
	string s;
	cin>>n;
	int pre[n+1],suff[n+1];
	cin>>s;
	s="#"+s;
	pre[0]=0;suff[0]=0;
	for(int i=1;i<=n;i++)
        pre[i]=pre[i-1]+(s[i]=='W');
    for(int i=1;i<=n;i++)
        suff[i]=suff[i-1]+(s[n-i+1]=='E');
    for(int i=1;i<=n;i++)
    {
        minm=min(minm,pre[i-1]+suff[n-i]);
    }
    cout<<minm<<endl;

}


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

int N;
int l[1001];
int r[1001];
int res = 0;

int main(){
  cin >> N;
  for(int i = 0;i < N;++i){
    cin >> l[i] >> r[i];
    res += r[i] - l[i] + 1;
  }
  cout << res << endl;
}

Measured memory_bytes: 256
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
#![macro_use]

use std::cmp::*;
use std::collections::*;
use std::io::prelude::*;
use std::mem::*;
use std::num::*;
use std::slice::*;

const MOD: isize = 1_000_000_007;

fn main() {
    let s: String = read();
    let s: Vec<char> = s.chars().collect();

    println!(
        "{}",
        if s[2] == s[3] && s[4] == s[5] {
            "Yes"
        } else {
            "No"
        }
    );
}
fn read<T>() -> T
where
    T: std::str::FromStr,
{
    let stdin = std::io::stdin();
    let next: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    next.parse().ok().unwrap()
}


Measured memory_bytes: 4352
n, k, q = map(int, input().split())
a = [0] * q

for i in range(q):
    a[i] = int(input())
a_copy = [0] * n

for i in a:
    a_copy[i-1] += 1

for i in a_copy:
    if q - i < k:
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 51544
N = int(raw_input())
S = raw_input()

num_W = [0]*N
num_E = [0]*N
for i in range(N):
    if S[i] == "W":
        num_W[i] = 1
    else:
        num_E[i] = 1

for i in range(N-1):
    num_W[i+1] += num_W[i]
    num_E[i+1] += num_E[i]

ans = num_E[N-1]

for i in range(N):
    num_E[i] = num_E[N-1] - num_E[i]

for i in range(1, N):
    num = num_W[i-1] + num_E[i] - num_E[N-1]
    ans = min(ans, num)
#    print i, num, num_W[i-1], num_E[i]- num_E[N-1]                                                    

print ans


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

#define INF (1e9)
#define INF_LL (1e17)
#define YJ 1145141919810

using LL = long long;
using ULL = unsigned long long;

using namespace std;

#define MAX_N 55

int N;
int A, B;
LL V[MAX_N];

LL dp[MAX_N][MAX_N];

int main()
{
  cin >> N >> A >> B;
  for (int i = 0; i < N; i++) {
    cin >> V[i];
  }

  sort(V, V+N, greater<LL>());

  int k = 1;
  int s = 0;
  double ue = 0;
  for (int i = 0; i < A-1; i++) {
    if(V[i] == V[A-1]){
      k++;
    }
  }

  for (int i = 0; i < N; i++) {
    if(V[i] == V[A-1]){
      s++;
    }
    if(i < A){
      ue += V[i];
    }
  }

  dp[0][0] = 1;
  for (int i = 1; i < MAX_N; i++) {
    dp[i][0] = dp[i][i] = 1;
    for (int j = 1; j < i; j++) {
      dp[i][j] += dp[i-1][j-1] + dp[i-1][j];
    }
  }

  //cerr << s << " " << k << endl;

  printf("%.10f\n", ue/A);
  LL ans = dp[s][k];
  for (int i = A; i < B; i++) {
    if(V[0] == V[i]){
      ans += dp[s][++k];
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stack>
#include <queue>
#include <string>
#include <map>
#include <unordered_map>
#include <bitset>
#include <numeric>
#include <vector>
#include <unordered_set>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <numeric>
#include <cstdlib>
#include <bits/stdc++.h>


using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;

const ll mod=1000000007ll;
const ll inf=1000000000000000ll;

const ll nmax=50;

bool visited[nmax+1][nmax+1];
ll field[nmax+1][nmax+1];

ll h,w;

ll dx[8]={1,0,-1,0,1,1,-1,-1};
ll dy[8]={0,1,0,-1,1,-1,1,-1};


int main() {
    ll x;
    cin>>x;
    if(x==3||x==5||x==7)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


Measured memory_bytes: 256
// A Dynamic Programming based solution for 0-1 Knapsack problem 
#include<bits/stdc++.h> 
using namespace std;
#define int long long

int knapSack(int W, int wt[], int val[], int n) 
{ 
    int i, w; 
    int dp[n+1][W+1]; 
    // Build table K[][] in bottom up manner 
    for (i = 0; i <= n; i++) 
    { 
        for (w = 0; w <= W; w++) 
        { 
            if (i==0 || w==0) 
                dp[i][w] = 0; 
            else if (wt[i-1] <= w) 
                    dp[i][w] = max(val[i-1] + dp[i-1][w-wt[i-1]], dp[i-1][w]); 
            else
                    dp[i][w] = dp[i-1][w]; 
        } 
    } 
    return dp[n][W]; 
} 

signed main() 
{ 
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	int n,W;
  	cin>>n>>W;
	int val[n];
	int wt[n];
  	for(int i=0;i<n;i++)
    {
      cin>>wt[i]>>val[i];
    } 
	cout<<knapSack(W, wt, val, n); 
	return 0; 
} 


Measured memory_bytes: 79104
n = int(input())
robo = []
for _ in range(n):
    robo.append(list(map(int, input().split())))
robo.sort()
#print(robo)
cnt = 0
i = 0
j = 0
#remove_robo = []
while i < n-1:
    j = i+1
    while j < n:
        if (robo[i][0]+robo[i][1]) > (robo[j][0] - robo[j][1]):
            #remove_robo.append(j)
            cnt+=1
            if (robo[i][0]+robo[i][1]) > (robo[j][0]+robo[j][1]):
                i = j
                j+=1
            else:
                j+=1
            if j == n:
                i = j
                break
        else:
            i=j
            break

print(n-cnt)


Measured memory_bytes: 27872
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		double d = l;
		double dd = d / 3;
		double ddd = dd * dd * dd;
		BigDecimal bi = BigDecimal.valueOf(ddd);
		System.out.println(bi);

		sc.close();
	}

}


Measured memory_bytes: 23892
from itertools import accumulate

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

a_acc = [0] + list(accumulate(a))  # aを0冊読む=1冊も読まない場合があるので
b_acc = [0] + list(accumulate(b))  # 今度は[0]が必要です

ans = 0
for an in range(n + 1):
    rem = k - a_acc[an]
    if rem < 0:
        break

    # 最初は 0 <= x < m + 1 の範囲で、この範囲を狭めていきます
    ok = 0
    ng = m + 1   
    # ng = ok + 1のとき、ok <= x < ng は ok <= x < ok + 1で、x = okに確定します
    while abs(ng - ok) > 1:
        mid = (ok + ng) // 2
        # bをmid冊読めるか？
        if b_acc[mid] <= rem:
        # 読めるならok
            ok = mid
        else:
        # 読めないならng
            ng = mid

    bn = ok
    ans = max(ans, an + bn)

print(ans)

Measured memory_bytes: 135496
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

		String S = sc.next();
		
		String s = S.replace("/", "");
		int date = Integer.parseInt(s);

		String answer = "";

		if(date <= 20190430){
			answer = "Heisei";
		}else{
			answer = "TBD";
		}
		
        System.out.println(answer);
    }
}


Measured memory_bytes: 22868
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
template <class T> inline void chmin(T &a, const T& b) { if (b < a) a = b; }
template <class T> inline void chmax(T &a, const T& b) { if (b > a) a = b; }
/* clang-format on */

const ll INF = 1ll << 60;

int main() {
#ifdef DEBUG
  ifstream cin("in.txt");
#endif
  int A, B, Q;
  while (cin >> A >> B >> Q) {
    vector<ll> a(A), b(B);
    for (int i = 0; i < A; i++) cin >> a[i];
    for (int i = 0; i < B; i++) cin >> b[i];
    for (int q = 0; q < Q; q++) {
      ll x;
      cin >> x;
      int ra = distance(a.begin(), lower_bound(a.begin(), a.end(), x));
      int la = ra - 1;
      int rb = distance(b.begin(), lower_bound(b.begin(), b.end(), x));
      int lb = rb - 1;
      ll res = INF;
      for (int xa : {ra, la}) {
        for (int xb : {rb, lb}) {
          if (0 <= xa && xa < A && 0 <= xb && xb < B) {
            ll cost = min(abs(a[xa] - x), abs(b[xb] - x)) + abs(a[xa] - b[xb]);
            chmin(res, cost);
          }
        }
      }
      cout << res << endl;
    }
  }
  return 0;
}


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

int main() {
    int n, cnt = 0;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
        if (a[i] == cnt + 1) cnt++;
    }
    if (cnt == 0)
        cout << -1 << endl;
    else
        cout << n - cnt << endl;
    return 0;
}

Measured memory_bytes: 1024