akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 
  int A, B, C, X;
  cin >> A >> B >> C >> X;
  int res = 0;
 for (int a = 0; a <= A; a++){
  for (int b = 0; b <= B; b++){
	for (int c = 0; c <= C; c++){
 	 int total = 500*a + 100*b + 50*c;
     if(total==X) res++;
   }
  }
 }
  cout << res << endl;
  
   
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define sz(x) ((int) (x).size())

typedef long long ll;

int N;
bool G[200][200];
int L[300];
vector<int> c[300];

void build(int l){
  for(int y : c[l]){
    for(int x=0; x<N; x++){
      if(!G[x][y])
        continue;
      if(L[x] != -1)
        continue;
      int m = l;
      for(int i=0; i<N; i++){
        if(G[x][i])
          m = min(m, L[i]);
      }
      int newl = l+1;
      if(m != -1 && m < l)
        newl = l-1;
      L[x] = newl;
      c[newl].push_back(x);
    }
  }
}

int main(){
  cin >> N;
  for(int i=0; i<N; i++){
    for(int j=0; j<N; j++){
      char x;
      cin >> x;
      G[i][j] = x == '1';
    }
  }
  int res = -1;
  for(int i=0; i<N; i++){
    for(int j=0; j<202; j++){
      L[j] = -1;
      c[j].clear();
    }
    L[i] = 1;
    c[1].push_back(i);
    /*
    for(int j=0; j<N; j++){
      if(G[i][j]){
        L[j] = 2;
        c[2].push_back(j);
      }
    }
    */
    for(int j=1; j<=N; j++){
      build(j);
    }
    bool pos = true;
    for(int j=0; j<N; j++){
      for(int k=0; k<N; k++){
        pos &= !G[j][k] || abs(L[j]-L[k])==1;
      }
    }
    int K = -1;
    for(int j=202; j>=0; j--){ 
      if(sz(c[j]) > 0){
        K = j;
        break;
      }
    }
    if(pos)
      res = max(res, K);
  }
  cout << res << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <array>
using namespace std;
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;
#define rep(i, n) for(UL i = 0; i < (n); i++)

struct Problem {

	UL dp[301][301][301] = {};

	void Solve() {
		string S; cin >> S;
		string rS = S; reverse(rS.begin(), rS.end());
		UL K; cin >> K;
		UL ans = 1;
		for (UL i = 0; i < S.size(); i++) {
			for (UL j = 0; j < rS.size(); j++) {
				if ((i + 1) + (j + 1) > S.size()) continue;
				for (UL k = 0; k <= K; k++) {
					auto &p = dp[i + 1][j + 1][k];
					p = max(p, dp[i][j + 1][k]);
					p = max(p, dp[i + 1][j][k]);
					if (S[i] == rS[j]) p = max(p, dp[i][j][k] + 1);
					if (k != 0) p = max(p, dp[i][j][k - 1] + 1);
					if ((i + 1) + (j + 1) == S.size()) ans = max(ans, p * 2);
					if ((i + 1) + (j + 1) == S.size() - 1) ans = max(ans, p * 2 + 1);
				}
			}
		}
		/*
		for (UL k = 0; k <= K; k++) {
			for (UL i = 0; i <= S.size(); i++) {
				for (UL j = 0; j <= rS.size(); j++) {
					cout << dp[i][j][k] << " ";
				} cout << endl;
			} cout << endl;
		}*/
		cout << ans << endl;
	}


	Problem();
};
int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}
Problem::Problem() {
	cout << fixed << setprecision(10);
}

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



int main(){
    int mod = 1000000007;
    int n; cin >> n;
    ll ans = 1; 
    vector<int> flag(n+1, 0);
    for(int i = 2; i <= n; i++){
        int mid = i;
        int k = 2;
        while(1){
            if(mid % k == 0){
                flag[k]++;
                mid = mid / k;
                k = 2;
            }else{
                k++;
            }
            if(k > mid){
                break;
            }
        }
    }
    for(int l = 2; l <= n; l++){
        if(flag[l] != 0){
            ans =  (ans * (flag[l]+1)) % mod;                    
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
using System;
class Program
{
  static void Main(String[] args)
  {
  
    String[] input = Console.ReadLine().Split(' ');
    int a = int.Parse(input[0]);
    int b = int.Parse(input[1]);
    
    if((a*b)%2 == 0)
    {
      Console.WriteLine("Even");
    }else{
      Console.WriteLine("Odd");
    }
    
  }
}

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

using namespace std;

int main(){
  string s;
  int m;
  int h;
  
  while(1)
    {
      cin >> s;
      
      if(s == "-") break;
      
      cin >> m;
      
      for(int i=0;i < m;i++)
	{
	  cin >> h;
	  
	  for(int j=0;j < h;j++)
	    {  
	      s += s[0];
	      s.erase(s.begin());
	    }
	}
      cout << s << endl;
    }
  return 0;
}
      


Measured memory_bytes: 3144
N,L = map(int,input().split())
l1 = []
l2 = []
for i in range(1,N+1):
    a = L+i-1
    l1.append(a)
    l2.append(abs(a))

for j in range(N):
    if abs(l1[j]) == min(l2):
        del l1[j]
        break
print(sum(l1))

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

#define mod 1000000007
#define ten5 100005
#define ten52 200005
#define ten6 1000005
#define PI 3.1415926
#define pb(x) push_back(x)
#define all(x) x.begin(),x.end()

typedef long long int ll;

//ll num[50];
//ll num2[50];
ll num[10];
//set<ll> sll;
//map<string,ll> mp,mp1;
//map<string,ll>::iterator iter;
//deque<char> deq;

int main(void)
{
    double ans=0.0,d,d1,d2;
    //float f,g,h;
    long long int m,n,i,j,k=1;
    long long int a,a1=0,a2=0,a3=0;
    string s;
    char c,c1;
    a=a1=a2=a3=0;
    cin>>a1>>a2>>a;
    //dd=d;dd1=d1;dd2=d2;
    if(a1+a2>=a)
    {
        cout<<"No";
        return 0;
    }
    a=a-a1-a2;
    a=a*a;
    a=a-4*a1*a2;
    if(a<=0) cout<<"No";
    else cout<<"Yes";
    return 0;
}





Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//解説AC
double PI=acos(-1);
int main() {
  double a,b,x,rad,kotae;
  cin>>a>>b>>x;
  double ryou=x/a;
  if(2*ryou>=a*b){
    double h=(a*b-ryou)*2/a;
    rad=atan2(h,a);
  }else{
    double w=ryou*2/b;
    rad=atan2(b,w);
  }
  kotae=rad/(2*PI)*360;
  cout<<fixed<<setprecision(12)<<kotae<<endl;
  return 0;
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n)-1; i >= 0; i--)
using namespace std;
typedef long long ll;

const int INF = 1e9;
int a, b;

int main() {
  cin >> a >> b;
  int ans = 0;

  while (1) {
    if (1 + (a - 1) * ans >= b) break;
    ans++;
  }
  cout << ans << endl;
  return 0;
}


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

int main() {
  int A, B;
  cin >> A >> B;
  
    if ( A % 2 != 0 && B % 2 != 0 ) {
      cout << "Odd" << endl;
    }
    else {
      cout << "Even" << endl;
    }
}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
 
//DEFINE and TYPEDEF--------------------------------------------------------------
 
#define FORG(i,a,n) for(lld i=a;i<n;i++) //for - general
#define FORZ(i,n) for(lld i=0;i<n;i++) //for - zero
#define FORGI(i,a,n,inc) for(lld i=a;i<n;i+=inc) //for - general incremental
#define FORZI(i,n,inc) for(lld i=0;i<n;i+=inc) //for - zero incremental
#define DEBUG(x) cerr<<(#x)<<" is "<<(x)<<"\n" //to debug values of variables
#define ZINDA cerr<<"\nIdhar-ich hai apun!!\n"; //to debug if code reached that point
#define SPEEDUP ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
 
#define SORTall(m) sort(m.begin(),m.end());
 
#define st first
#define nd second
#define mkp make_pair
#define pb push_back
#define endl '\n'
#define mod 1000000007
 
typedef long long int lld;
typedef unsigned long long int ulld;
 
lld power(lld b, lld e)
{
    if(e==0)
        return 1;
    if(e%2==1)
        return b*power(b*b,(e-1)/2);
    else
        return power(b*b,e/2);
}
 
lld power(lld b, lld e, lld m)
{
	if(e==0)
		return 1;
	if(e%2==1)
		return b*power(((b%m)*(b%m))%m,(e-1)/2,m)%m;
	else
		return power(((b%m)*(b%m))%m,e/2,m)%m;
}
 
int nDig(lld n)
{
	if(n<0) 
		n*=-1;
	if(n==0)
		return 1;

    return floor(log10(n) + 1);
}

//endl : changed to '\n', to flush comment that definition
//--------------------------------------------------------------------------------

void swagWaalaFunction()
{
	lld n,k,ai=INT_MIN;
	cin>>k>>n;

	lld v[n];
	FORZ(i,n)
		cin>>v[i];
	
	FORZ(i,n-1)
		ai=max(ai,v[i+1]-v[i]);

	ai=max(ai,k-v[n-1]+v[0]);

	cout<<k-ai;
	return;
}

int main()
{
    SPEEDUP;
 	lld t=1;
 	//cin>>t;

 	while(t--)
 		swagWaalaFunction();

 	return 0;
}

Measured memory_bytes: 1792
import java.util.*;
public class Main{
   public static void main(String[] args) {
     Scanner sc = new Scanner(System.in);
     String  t = sc.next();
     String s = sc.next();
     int ans=0;
     for(int i=0;i<s.length();i++){
       if(t.charAt(i)!=s.charAt(i)){
         ans++;
       }
     }
     System.out.println(ans);

   }
}


Measured memory_bytes: 41188
count = gets.to_i
count2 = count - 1
 
dishes = gets
satisfiedsB = gets
satisfiedsC = gets

dishes = dishes.split(' ')
satisfiedsB = satisfiedsB.split(' ')
satisfiedsC = satisfiedsC.split(' ')

time = 0
sum = 0
 
count.times do 
  time += 1
  if time == 1
    index = time - 1
    dish = dishes[index].to_i
    b_index = dish - 1
    b = satisfiedsB[b_index].to_i
    sum = sum + b
  else
    index = time - 1
    dish = dishes[index].to_i
    b_index = dish - 1
    b = satisfiedsB[b_index].to_i
    sum = sum + b
    
    before_index = index - 1
    before_dish = dishes[before_index].to_i
    
    if dish == before_dish + 1
      c_index = before_dish - 1
      c = satisfiedsC[c_index].to_i
      sum = sum + c
    end
  end
end
 
puts sum




Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define MOD 1000000007
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec; typedef pair<int, int> pi;
int dd[] = { 0, 1, 0, -1, 0 };
#define all(u) begin(u),end(u)
#define mp make_pair
#define pb push_back
	
int main()
{	
	int a, b;
	cin >> a >> b;
	cout << (2 * b - a)  << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using db = double;
using pll = pair < ll, ll >;
 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template < typename Arg1 >
void __f(const char* name, Arg1&& arg1) {
    cerr << name << " : " << arg1 << std :: endl;
}
template < typename Arg1, typename... Args >
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | ";
    __f(comma + 1, args...);
}
#else
#define trace(...)
#endif
 
#define pb push_back
#define mp make_pair
#define fastIo() ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0)
 
const int MOD = 1e9 + 7, INF = INT_MAX, N = 1e6 + 10;

const int m = 2019;

int main(){ 
	string s; cin >> s;
	int n = s.size();
	int dp[n+1];
	fill(dp, dp + n + 1, 0);
	int mul = 1, ans = 0;
	int cnt[2019];
	fill(cnt, cnt + 2019, 0);
	cnt[0] = 1;
	for(int i = n - 1; i >= 0; i--) {
		dp[i] = (dp[i+1] + ((s[i] - '0') * mul % m)) % m;
		mul *= 10;
		mul %= m;

		ans += cnt[dp[i]];
		cnt[dp[i]]++;
	}
	// for(int i = 0; i <= n; i++) cout << dp[i] << " ";
	// cout << endl;
	cout << ans << endl;
}


Measured memory_bytes: 4424
#include<stdio.h>
int main(void){

int n,i,x=0;

scanf("%d",&n);

	for(i=1;i<=n;i++){
		if(i%3 == 0){
		printf(" %d",i);
		}

		else{
 
			if(i%10 == 3){
			printf(" %d",i);
	 		}
 
			else{
				x = i;
				while( x != 0){
					if(x%10 != 3){
					x = x/10;
				}
					else{
						printf(" %d",i); 
						break;
					}
				}
			}
		}
	}
	
 
	printf("\n");


return 0;
}


Measured memory_bytes: 2104
#include <bits/stdc++.h>
using namespace std;
struct ios_accelerate { ios_accelerate() { ios::sync_with_stdio(false); cin.tie(nullptr); } } CALL;

#define REP(i, n) for(auto (i) = (n)*0; (i) < (n); (i)++)
#define RNG(i, a, b) for(auto (i) = (a); (i) < (b); (i)++)
#define RBF(i, v) for(auto& (i) : (v))
#define ALL(x) (x).begin(), (x).end()

using LL = long long;
using UL = unsigned;
using ULL = unsigned long long;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
template<typename T> using P = pair<T, T>;

const double PI = 3.141592653589793;
const int MOD = 1000000007;
const LL INF64 = static_cast<LL>(1e18) + 2;
const int INF = static_cast<int>(1e9) + 2;

template<typename T> inline void upsort(vector<T>& x) { sort(x.begin(), x.end()); }
template<typename T> inline void downsort(vector<T>& x) { sort(x.begin(), x.end(), greater<T>()); }
template<typename T> inline void col(T x) { cout << x << '\n'; }
template<> inline void col(double x) { cout << fixed << setprecision(12) << x << '\n'; }

signed main() {
	int n;
	cin >> n;
	VV<int> g(n);
	map<P<int>, int> idx;
	REP(i, n-1) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		idx.insert({ { a,b }, i });
		g[a].emplace_back(b);
		g[b].emplace_back(a);
	}

	int kmax = 0;
	RBF(gi, g) {
		kmax = max(kmax, static_cast<int>(gi.size()));
	}

	V<int> color(n - 1, 0);
	V<bool> seen(n, false);
	queue<int> que;
	seen[0] = true;
	que.push(0);

	while (!que.empty()) {
		int now = que.front();
		que.pop();

		V<bool> use(kmax + 1, false);
		RBF(gi, g[now]) {
			int a = min(gi, now);
			int b = max(gi, now);
			use[color[idx[{ a, b }]]] = true;
		}

		int k = 1;
		RBF(gi, g[now]) {
			while (use[k]) {
				k++;
			}
			int a = min(gi, now);
			int b = max(gi, now);
			if (color[idx[{ a, b }]] == 0) {
				color[idx[{ a, b }]] = k++;
			}
		}

		RBF(gi, g[now]) {
			if (!seen[gi]) {
				seen[gi] = true;
				que.push(gi);
			}
		}
	}

	col(kmax);
	RBF(c, color) {
		col(c);
	}
	return 0;
}

Measured memory_bytes: 15548
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
        int N = readInt(r);
        String[] numStrings = r.readLine().split(" ");
        int[] A = new int[N];
        for (int i = 0;i < N;i++) {
            A[i] = Integer.parseInt(numStrings[i]);
        }
        insertionSort(A, N);
    }
    
    public static void insertionSort(int[] A, int N) {
        System.out.println(dump(A, N));
        for (int i = 1;i <= (N - 1);i++) {
            int v = A[i];
            int j = i - 1;
            while (j >= 0 && A[j] > v) {
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = v;
            System.out.println(dump(A, N));
        }
    }
    
    public static String dump(int[] A, int N) {
        StringBuilder builder = new StringBuilder();
        for (int i = 0;i < N;i++) {
            if (i != 0) {
                builder.append(" ");
            }
            builder.append(A[i]);
        }
        return builder.toString();
    }
    
    public static int readInt(BufferedReader r) throws Exception {
        return Integer.parseInt(r.readLine());
    }
}

Measured memory_bytes: 27004
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <utility>
#include <vector>
#include <map>
#include <set>
#include <queue>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int inf = 1e9+123;
void yes()
{cout << "Yes" << endl;}
void no()
{cout <<  "No" << endl;}
void q()
{cout << -1 << endl;}

int cnt = inf;
int n, m, x;
int c[12];
int a[12][12];
void rec(int count, int arr[], int mon)
{
	if(count==n)
		{
			for(int i=0; i<m; i++)
				if(arr[i]<x)
					return;
			for(int i=0; i<m; i++)
			cnt = min(mon, cnt);
			return;
		}
	
	for(int i=0; i<m; i++)
		arr[i] += a[count][i];
	rec(count+1, arr, mon+c[count]);

	for(int i=0; i<m; i++)
		arr[i] -= a[count][i];
	rec(count+1, arr, mon);
}
void solve()
{	
	cin >> n >> m >> x;
	for(int i=0; i<n; i++)
	{
		cin >> c[i];
		for(int j=0; j<m; j++)
			cin >> a[i][j];
	}
	int ar[m];
	for(int i=0; i<m; i++)
		ar[i]=0;
	rec(0, ar, 0);
	if(cnt!=inf)
		cout << cnt << endl;
	else
		return q();
}
int main()
{	
//	int t;
//	cin >> t;
//	while(t--)
		solve();
}

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

int main () {
    int N;
    string S;
    cin >> N >> S;
    int count=0;
    
    for (int i=0; i<N-2; i++) {
        if (S.at(i)=='A' && S.at(i+1)=='B' && S.at(i+2)=='C') {
            count++;
        }
    }
    cout << count << endl;
}            


Measured memory_bytes: 3596
fn main() {
    let mut reader = acio::Reader::new();
    let s = reader.read::<String>();
    let mut prev = None;
    let mut bad = false;
    for c in s.chars() {
        if prev == Some(c) {
            bad = true;
        }
        prev = Some(c);
    }
    println!("{}", if bad { "Bad" } else { "Good" });
}

/// IO Module for AtCoder
#[allow(dead_code)]
mod acio {
    use std::fmt::Debug;
    use std::io::{stdin, Stdin};
    use std::str::FromStr;

    pub struct Reader {
        input: Stdin,
        stack: Vec<String>,
    }

    impl Reader {
        pub fn new() -> Self {
            Reader {
                input: stdin(),
                stack: vec![],
            }
        }

        pub fn read_by<F>(&mut self, count: usize) -> Vec<F>
        where
            F: FromStr,
            <F as FromStr>::Err: Debug,
        {
            let mut v = vec![];
            for _ in 0..count {
                v.push(self.read());
            }
            return v;
        }

        pub fn read<F>(&mut self) -> F
        where
            F: FromStr,
            <F as FromStr>::Err: Debug,
        {
            if self.stack.is_empty() {
                let mut line = self.read_line();
                self.stack.append(&mut line);
                self.stack.reverse();
            }
            self.stack.pop().unwrap().parse().unwrap()
        }

        fn read_line(&mut self) -> Vec<String> {
            let mut buf = String::new();
            self.input.read_line(&mut buf).unwrap();
            buf.split_whitespace().map(|s| s.to_string()).collect()
        }
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<ll, ll>;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
ll bpow(ll b, ll p, ll m = 1000000007LL) {
  ll rt = 1;
  for (; p; p >>= 1, b = b * b % m)
    if (p & 1)
      rt = rt * b % m;
  return rt;
}
ll a[100005];
ll psum[100005];
int main() {
  IOS;
  int n, k;
  cin >> n >> k;
  vector<ll> v;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    psum[i] = psum[i - 1] + a[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      v.pb(psum[j] - psum[i - 1]);
    }
  }
  ll ans = 0;
  for (int i = 60; i >= 0; i--) {
    vector<ll> tmp;
    int cnt = 0;
    for (ll x : v) {
      if ((1LL << i) & x)
        cnt++, tmp.pb(x);
    }
    if (cnt >= k)
      v.clear(), v = tmp, ans |= (1LL << i);
  }
  cout << ans << endl;
}


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

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

int main() {
    int N, L;
    cin >> N >> L;
    vector<int> aji(N);

    int sum = 0;
    rep(i, N) {
        aji.at(i) += L + i;
        sum += aji.at(i);
    }

    int minv = 0;
    for (int i = 0; i < N; i++) {
        int tmp = 0;
        for (int j = 0; j < N; j++) {
            if (j == i)
                continue;
            tmp += aji.at(j);
        }

        if (i == 0) {
            minv = tmp;
        }
        if (abs(sum - minv) > abs(sum - tmp))
            minv = tmp;
    }

    cout << minv << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<queue>
#include<cstdio>
#include<cmath>
using namespace std;
long long a,b,c,d,res;
vector<long long>v1,v2;
int main(){
//	freopen("1.txt","r",stdin);
	cin>>a>>b>>c>>d;
	res = a*c;
	v1.push_back(a);
	v1.push_back(b);
	if(a<0&&b>0) v1.push_back(0);
	v2.push_back(c);
	v2.push_back(d);
	if(c<0&&d>0) v2.push_back(0);
	for(int i=0;i<v1.size();i++){
		for(int j=0;j<v2.size();j++){
			res=(long long)max(res,v1[i]*v2[j]);
		}
	}
	cout<<res<<endl;
	return 0;
}




Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
 
const long long INF = 1LL << 60;
 
int main(){
    int N;
    int h[110000];
    cin >> N;
    for(int i=0;i<N;++i) cin >> h[i];
    long long dp[110000];
    fill(dp,dp+N,INF);
    dp[0] = 0;
    
    for(int i=1;i<N;++i){
        // for(int k=1;k<=K;++k){
        dp[i] = min(dp[i],dp[i-1]+abs(h[i]-h[i-1]));
        if(i>1) dp[i] = min(dp[i],dp[i-2]+abs(h[i]-h[i-2]));
        // }
    }
 
    cout << dp[N-1] << endl;
    
    return 0;
 
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define ll long long
#define int long long
#define MOD 1000000007
#define mod 998244353
#define ff first
#define ss second
#define pb push_back
#define vi vector<int>
#define si set<int>
#define pii pair<int,int>
#define vii vector<pii>
#define vvi vector<vi>
#define vvii vector<vii>
#define vsi vector<si>
#define endl "\n"
#define rep(i, n) for(i = 0; i < (n); i++)
#define rrep(i, n) for(i = (n - 1); i >= 0; i--)
#define MAXN 200001
#define read(arr,n) for(int i=0;i<n;i++)cin>>arr[i]
using namespace std;
void solve1();

int power(int x, unsigned int y, int p)
{
    int res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0)
    {
        if (y & 1)res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
bool comp(pii a,pii b)
{
    return a.ss<b.ss;
}
void solve()
{
    int t;cin>>t;
    while(t--)
    {
        solve1();
    }
}
signed main()
{
    std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    solve1();
    return 0;
}
void solve1()
{
    //int n;cin>>n;
    string str;cin>>str;
    if(str[str.length()-1]=='s')cout<<str<<"es"<<endl;
    else cout<<str<<"s"<<endl;
}




Measured memory_bytes: 3648
import java.util.Scanner;

public class Main {

	public Main() {
		// TODO 自動生成されたコンストラクター・スタブ
	}

	public static void main(String[] args){
			Scanner sc = new Scanner(System.in);
			// 整数の入力
			int x,a,b,p;
			int result;
			x = sc.nextInt();
			a = sc.nextInt();
			sc.close();
			if (x<a) {
				System.out.println("0");
			}
			else {
			System.out.println("10");
			}

			// 出力

	}
}

Measured memory_bytes: 21716
#include<stdio.h>
#define N 500000
int tem[N];
int c=0;
void MG(int x[ ], int left, int right)
{
  int mid, i, j, k;
        
  if (left >= right)             
    return;                                                      
  mid = (left + right) / 2;      
  MG(x, left, mid);       
  MG(x, mid + 1, right);
  for (i = left; i <= mid; i++)
    tem[i] = x[i];     
  for (i = mid + 1, j = right; i <= right; i++, j--)
    tem[i] = x[j];
  i = left;        
  j = right;       
  for (k = left;k<= right; k++)   
    if (tem[i]<= tem[j]){        
      x[k]=tem[i++];c++;
    }
    else{
      x[k]=tem[j--];c++;
    }
}

int main(){
  int o1;
   int i,j;
   int A1[N];
 scanf("%d",&o1);
  for(i=0;i<o1;i++){
    scanf("%d",&A1[i]);
  }

  MG(A1,0,o1-1);
for (i = 0; i < o1; i++)
  {
    printf("%d",A1[i]);
 
 if(i!=o1 - 1)printf(" ");
  }
 printf("\n");
 printf("%d\n",c);
  return 0;
}




Measured memory_bytes: 5600
N, M = map(int, input().split())
if abs(N-M) > 1:
  print(0)
else:
  num = max(N, M)
  dp = [1] * (num+1)
  for i in range(2, num+1):
    dp[i] = (i * dp[i-1])%(10**9+7)
  if N == M:
    print((dp[N]*dp[M]*2)%(10**9+7))
  else:
    print((dp[N]*dp[M])%(10**9+7))
  


Measured memory_bytes: 6900
import java.util.Scanner;

class Main {

  /**
   * -2進数表記での桁数を求めるメゾット
   *
   * @param 10進数
   * @return -2進数表記での桁数
   */
  public static int ketasu(int n) {
    if (n >= 0) {
      int ketasu = 1;
      long jougen = 1;
      long base = 1;
      for (int i = 0; n > jougen; i++) {
        ketasu = ketasu + 2;
        base *= 4;
        jougen += base;
      }
      return ketasu;
    } else {
      int ketasu = 0;
      long jougen = 0;
      long base = -2;
      for (int i = 0; n < jougen; i++) {
        ketasu = ketasu + 2;
        jougen += base;
        base *= 4;
      }
      return ketasu;
    }
  }

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    scanner.close();
    int ketasu = ketasu(n);
    char[] ans = new char[ketasu];
    for (int index = ketasu - 1; index >= 0; index--) {
      if (n % 2 == 0) {
        ans[index] = '0';
        n /= -2;
      } else {
        ans[index] = '1';
        n = n - 1;
        n /= -2;
      }
    }
    System.out.println(String.valueOf(ans));
  }

}


Measured memory_bytes: 23508
//#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

typedef pair<double, int> P;

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

double x[1010], y[1010], r[1010], e[1010], d[1010][1010];
bool used[1010];
signed main(void)
{
  double sx, sy, gx, gy;
  cin >> sx >> sy >> gx >> gy;
  int n;
  cin >> n;
  REP(i, n) {
    cin >> x[i] >> y[i] >> r[i];
  }

  REP(i, n) {
    REP(j, n) {
      d[i][j] = d[j][i] = max(sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]))-r[i]-r[j], 0.0);
    }
  }
  REP(i, n) {
    d[n][i] = d[i][n] = max(sqrt((x[i]-sx)*(x[i]-sx)+(y[i]-sy)*(y[i]-sy))-r[i], 0.0);
  }
  REP(i, n) {
    d[n+1][i] = d[i][n+1] = max(sqrt((x[i]-gx)*(x[i]-gx)+(y[i]-gy)*(y[i]-gy))-r[i], 0.0);
  }
  d[n][n] = d[n+1][n+1] = 0;
  d[n][n+1] = d[n+1][n] = sqrt((sx-gx)*(sx-gx)+(sy-gy)*(sy-gy));

  /*REP(i, n+2) {
    REP(j, n+2) {
      cout << d[i][j] << " ";
    }
    cout << endl;
  }*/

  priority_queue<P, vector<P>, greater<P>> que;
  fill(e, e+n+2, -1);
  e[n] = 0;
  que.push(MP(0.0, n));

  while(que.size()) {
    P p = que.top(); que.pop();
    int v = p.second;
    //cout << p.first << " " << v << endl;
    if(e[v] < p.first) continue;
    REP(i, n+2) {
      if(i == v) continue;
      if(e[i] < 0 || e[i] > e[v] + d[v][i]) {
        e[i] = e[v] + d[v][i];
        que.push(MP(e[i], i));
      }
    }
  }

  cout << fixed << setprecision(15) << e[n+1] << endl;
  return 0;
}


Measured memory_bytes: 14192
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <map>

//#include <bits/stdc++.h>
using namespace std;
#define print(x) cout<<(x)<<endl
#define prints(x, y) cout<<(x)<<" "<<(y)<<endl
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define r_rep(i, n) for(int i = n; i >= 0; i--)
#define ll long long 
#define pb push_back

int main() {
  ll a;
  string b;
  cin >> a >> b;
  long double ans = 0;
  ll c = (ll)(b[0]-'0')*100 + (ll)(b[2]-'0')*10 + (ll)(b[3]-'0');
  print(a*c/100);
  
}


Measured memory_bytes: 3196
#include <cstdio>
#include <cstdlib>
#include <cstring>
char buf[256], res[256];
char* s = "z.?! ";
int main()
{
    while (fgets(buf, 256, stdin)) {
        int k = 0;
        bool ok = true;
        for (int i = 0; i < strlen(buf)-1; i+=2) {
            if ('1' <= buf[i] && buf[i] <= '5') {
                if ('1' <= buf[i+1] && buf[i+1] <= '5')
                    res[k++] = 'a' + 5 * (buf[i]-'1') + (buf[i+1]-'1');
                else ok = false;
            }
            else if (buf[i] == '6' && '1' <= buf[i+1] && buf[i+1] <= '5') {
                res[k++] = s[buf[i+1]-'1'];
            }
            else {
                ok = false;
            }
        }
        res[k] = '\0';
        if (ok) puts(res); else puts("NA");
    }
    return 0;
}

Measured memory_bytes: 0
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
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; }

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x;
    cin >> x;
    int ans = 1;
    if(x < 600) ans = 8;
    else if(x < 800) ans = 7;
    else if(x < 1000) ans = 6;
    else if(x < 1200) ans = 5;
    else if(x < 1400) ans = 4;
    else if(x < 1600) ans = 3;
    else if(x < 1800) ans = 2;
    else ans = 1;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3648
#include<iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main(){
  string S;
  cin >> S;
  int first = 0;
  while(S[first]!='A') first++;

  int l = S.size();
  int last = l-1;

  while(S[last]!='Z') last--;

  cout << last - first + 1 <<endl;
  return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int n,i,a,t,ans;
multiset<int>s;
multiset<int>::iterator it;
int main() {
	scanf("%d",&n);
	for(i=1; i<=n; i++) {
		scanf("%d",&a),it=s.lower_bound(a);
		if(it!=s.begin())it--,s.erase(it);
		else ans++;
		s.insert(a);
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 4992
#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 ll long long

const int MAXN = 60;
int niz[MAXN];

int main(){
    ll n,a,b,c,d;
    cin>>n>>a>>b>>c>>d;
    REP(i,n){
        if(c*(n-1ll-i)-d*i<=b-a && b-a<=-c*i+d*(n-1ll-i)){
            cout<<"YES";
            return 0;
        }
    }
    cout<<"NO";
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>//本当は必要なヘッダファイルだけインクルードするべきです
using namespace std;//本当は個別にusingするか変数や関数ごとにstd::をつけるべきです
//本当は関数内に宣言し明示的に初期化するべきです
int m,f,r;
int main(void){
  while(cin>>m>>f>>r){
    if(m==-1&&f==-1&&r==-1)break;
    if(m==-1||f==-1)cout<<'F'<<endl;
    else if(m+f>=80)cout<<'A'<<endl;
    else if(m+f>=65)cout<<'B'<<endl;
    else if(m+f>=50)cout<<'C'<<endl;
    else if(m+f>=30&&r>=50)cout<<'C'<<endl;
    else if(m+f>=30&&r<50)cout<<'D'<<endl;
    else cout<<'F'<<endl;
  }
  return 0;
}



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

typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(),a.end())
#define REP(i,n) for (int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
 
using namespace std;

signed main(){
    
    int  n;
    cin >> n;
    
    int ans = 0;
    int p[n],q[n];
    REP(i,n){
        cin >> p[i];
      p[i]--;
    }
    REP(i,n){
        q[p[i]] = i;
    }
    int cnt = 1;
    REP(i,n){
        if(i == n-1){
            ans = max(ans,cnt);
        }else if(q[i] < q[i+1]){
            cnt++;
        }else{
            ans = max(ans,cnt);
            cnt = 1;
        }
    }

    

    cout << n-ans << endl;
    
    return 0;
}
//g++ -std=c++14 code1.cpp


Measured memory_bytes: 3328
use proconio::{input, fastout};
use std::usize::MAX;

#[fastout]
fn main() {
    input! {
        n: usize,
        m: usize,
        sc: [(usize, usize); m],
    }

    let mut ansvec = vec![MAX; n];
    for (s, c) in sc {
        let curr_c = ansvec[s-1];
        if (curr_c!=c && curr_c!=MAX) || (s==1 && c==0 && n!=1) {
            println!("-1");
            return;
        } else { ansvec[s-1] = c }
    }

    if ansvec[0]==MAX && n>1 { ansvec[0] = 1; }
    let ans = ansvec.iter()
        .map(|d| {
            if d == &MAX { "0".to_string() }
            else { d.to_string() }
        }).collect::<String>();
    println!("{}", ans);
}


Measured memory_bytes: 2180
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
    int h, i, j, k, l;
    cin >> h >> i >> j >> k >> l;
    if (h == 0) {
        cout << 1;
    }
    else if (i == 0) {
        cout << 2;
    }
    else if (j == 0) {
        cout << 3;
    }
    else if (k == 0) {
        cout << 4;
    }
    else {
        cout << 5;
    }

}

Measured memory_bytes: 3604
n = int(input())
a = list(map(int, input().split()))
end = sorted(a)[1]

for i in range(end + 1, 0, -1):
    x = 0
    for j in a:
        if j % i != 0:
            x += 1
        if x >= 2:
            break
    if x <= 1:
        print(i)
        break

Measured memory_bytes: 14208
#include <stdlib.h>
#include <iostream>
#include <stack>
using namespace std;
#define REP(i,n) for(int i=0; i<(int)(n); ++i)

class point{
private:
	int next_num;
public:
	int next[9];
	point();
	void add_next(int i);
	int get_next_num();
};

point::point(){
	next_num = 0;
}
void point::add_next(int i){
	next[next_num] = i;
	next_num++;
}
int point::get_next_num(){
	return next_num;
}


bool visited[9];
point nodes[9];
int ans = 0;

void dfs(int i, int n);

int main(){
	int n, m;

	cin >> n >> m;

	int in, out;
	REP(i, m){
		cin >> in >> out;
		nodes[in].add_next(out);
		nodes[out].add_next(in);
	}
	REP(i, n){
		visited[i] = false;
	}
	visited[1] = true;
	dfs(1, n);
	cout << ans << endl;

	return 0;
}

void dfs(int i, int n){
	bool all_visited = true;
	for(int j = 1; j <= n && all_visited; ++j){
		if(!visited[j]) all_visited = false;
	}
	if(all_visited){
		ans++;
	}else{
		for(int k = 0; k < nodes[i].get_next_num(); ++k){
			if(!visited[nodes[i].next[k]]){
				visited[nodes[i].next[k]] = true;
				dfs(nodes[i].next[k], n);
				visited[nodes[i].next[k]] = false;
			}
		}
	}

}


Measured memory_bytes: 256
// C++ 14
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <math.h>

#define ll long long
#define Int int
#define loop(x, start, end) for(Int x   = start; x < end; x++)
#define loopdown(x, start, end) for(int x = start; x > end; x--)
#define span(a,x,y) a.begin()+x,a.begin()+y
#define span_all(a) a.begin(),a.end()
#define len(x) (x.size())
#define last(x) (*(x.end()-1)) 

using namespace std;

Int X, Y;

Int gcd(Int x, Int y) {
  if (x > y) swap(x, y);
  
  Int r;
  while (y > 0) {
    r = x % y;
    x = y;
    y = r;
  }
  return x;
}

void input() {
  cin >> X >> Y;
}

void solve() {
  cout << gcd(X, Y) << endl;
}

int main() {
  input();
  solve();
  return 0;
}


Measured memory_bytes: 3080
import java.io.*;

class Main{
	public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int in[] = parseInts(br.readLine().split(" "));
		long in1[][] = new long[in[0]][in[1]];
		long in2[][] = new long[in[1]][in[2]];
		long in3[][] = new long[in[0]][in[2]];
		for(int i=0; i<in[0]; i++){
			in1[i] = parseLongs(br.readLine().split(" "));
		}
		for(int i=0; i<in[1]; i++){
			in2[i] = parseLongs(br.readLine().split(" "));
		}
		for(int n=0; n<in[0]; n++){
			for(int l=0; l<in[2]; l++){
				for(int m=0; m<in[1]; m++){
					in3[n][l] += in1[n][m] * in2[m][l];
				}
			}
		}
		println(in3);
	}

	static int[] parseInts(String[] s){
		int[] x = new int[s.length];
		for(int i=0; i<s.length; i++){
			x[i] = Integer.parseInt(s[i]);
		}
		return x;
	}

	static int sum(int[] x){
		int t = 0;
		for(int a : x){
			t += a;
		}
		return t;
	}

	static void println(long[][] x){
		for(int n=0; n<x.length; n++){
			for(int m=0; m<x[0].length; m++){
				if(m == x[0].length-1){
					System.out.println(x[n][m]);
				}else{
					System.out.print(x[n][m] + " ");
				}
			}
		}
	}
	
	static long[] parseLongs(String[] s){
		long[] x = new long[s.length];
		for(int i=0; i<s.length; i++){
			x[i] = Long.parseLong(s[i]);
		}
		return x;
	}
	
}

Measured memory_bytes: 28680
import sys
input = sys.stdin.readline


lst = []
nn,mm,qq = (int(x) for x in input().split())
for i in range(1,mm+1):#1
    for j in range(i,mm+1):#2
        for k in range(j,mm+1):#3
            for l in range(k,mm+1):#4
                for m in range(l,mm+1):#5
                    for n in range(m,mm+1):#6
                        for o in range(n,mm+1):
                            for p in range(o,mm+1):
                                for q in range(p,mm+1):
                                    for r in range(q,mm+1):
                                        lst.append([i,j,k,l,m,n,o,p,q,r])
qlst = []

for i in range(qq):
    qlst.append([int(x) for x in input().split()])
score = 0
for combo in lst:
    cur_score = 0
    for a,b,c,d in qlst:
        if combo[b-1] - combo[a-1] == c:
            cur_score += d
    score = max(score, cur_score)
print(score)


Measured memory_bytes: 90956
Scanf.scanf "%d %d" (fun n x ->
    let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun a -> a)) in

    let rec loop i acc =
        if i = n then acc else
            if a.(i) + a.(i - 1) <= x then loop (i + 1) acc else
                let d = min a.(i) (a.(i) + a.(i - 1) - x) in
                let () = a.(i) <- a.(i) - d in
                let acc = acc + d in
                if a.(i) + a.(i - 1) <= x then loop (i + 1) acc else
                    let e = min a.(i - 1) (a.(i) + a.(i - 1) - x) in
                    let () = a.(i - 1) <- a.(i - 1) - e in
                    loop (i + 1) (acc + e)
    in
    loop 1 0 |> Printf.printf "%d\n"
)

Measured memory_bytes: 6664
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;

int main() {
	int n, d;
	cin >> n >> d;
	int ans = n  / ((d * 2) + 1);
	if (n % ((d * 2) + 1) != 0) {
		ans++;
	}
	cout << ans;
}



















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

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

  string ans = "";
  ll num     = n;

  for (int i = 0; num != 0; i++) {
    int b = num % 2;
    if (b < 0) b += 2;
    ans = ans + to_string(b);
    num = (num - b) / -2;
  }
  reverse(ans.begin(), ans.end());
  if (ans.empty()) {
    cout << 0 << endl;
  } else {
    cout << ans << endl;
  }
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))

ans = 0
S = A[0]
right = 1
for l, a in enumerate(A):
    while right < N and S + A[right] == S ^ A[right]:
        S += A[right]
        right += 1
    ans += right - l
    S -= a

print(ans)

Measured memory_bytes: 23560
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>
#include<set>
#include<cstdio>

using namespace std;

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

typedef vector<int> vec;
typedef vector<vec> mat;

const ll mod = 1000000007;

int main(){
    int a, b;
    cin >> a >> b;
    if(a < 10 && b < 10) cout << a * b << endl;
    else cout << -1 << endl;
}

Measured memory_bytes: 3656
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>
#include<queue>
#include<stack>
#include<numeric>
#include<set>
#include<iomanip>
#include<map>
#include<type_traits>
#include<tuple>
#include<deque>
#include<cassert>
#include<bitset>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
const int mod = 1000000007;
const int INF = 1001001001;
ll dp[110][100100];

int main() {
  int n, W;
  cin >> n >> W;
  rep(i, n) {
    int w, v;
    cin >> w >> v;
    for(int j = 0; j <= W; ++j) {
      chmax(dp[i + 1][j], dp[i][j]);
      if(j + w > W) continue;
      chmax(dp[i + 1][j + w], dp[i][j] + v);
    }
  }
  cout << dp[n][W] << endl;
}

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

using namespace std;

#define LIMIT 100
typedef pair<int64_t, int64_t> ii;
typedef int64_t ll;
int gcd(ll a, ll b) { return (b==0)?a:gcd(b, a%b); }
int lcm(ll a, ll b) { ll i=(a/gcd(a,b))*b; assert(i>0); return i; }

//  ***** MAIN *****
int main(){
  //ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  map<ll, ll> m;
  ll a;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    m[a]++;
  }
  ll o = 0;
  for(auto p : m){
    if (p.first > p.second){
      o += p.second;
    }
    else {
      o += p.second - p.first;
    }
  }

  std::cout << o << std::endl;
  return 0;
}



Measured memory_bytes: 6272
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		double x,y;    //变量
		int a,b,c,d,e,f;    //参数
		while(in.hasNext()) {
			a = in.nextInt();
			b = in.nextInt();
			c = in.nextInt();
			d = in.nextInt();
			e = in.nextInt();
			f = in.nextInt();
			if(c*e-b*f==0)
				x=0;
			else
			    x = ((double)c*e-b*f)/((double)a*e-b*d);
			if(c*d-a*f==0)
				y=0;
			else
			    y = ((double)c*d-a*f)/((double)b*d-a*e);
			System.out.format("%.3f %.3f\n", x , y);
		}
		in.close();
	}
}


Measured memory_bytes: 26232
import java.util.Scanner;

//Unit Fraction Partition
public class Main{

	static int p, q, a, n;
	static int c;
	
	static void dfs(int num, int den, int x, int k){
		if(p*den==q*num){
			c++;
			return;
		}
		if(k==n)return;
		if(p*den<q*num)return;
		for(int i=x;i*den<=a;i++){
			int nn = num*i+den;
			int nd = i*den;
			dfs(nn, nd, i, k+1);
		}
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			p = sc.nextInt();
			q = sc.nextInt();
			a = sc.nextInt();
			n = sc.nextInt();
			if((p|q|a|n)==0)break;
			c = 0;
			dfs(0,1,1,0);
			System.out.println(c);
		}
	}
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
#define X first
#define Y second
#define LL long long
#define INF 1000 * 1000 * 1000
#define PB push_back
const int MAX = 505;
using namespace std;
const int mod = 1000 * 1000 * 1000 + 7;

int dp[2][2][100005];
int a[205];
int fact[205];
int c[205][205];
int inv[205];
/*int binPow(int a , int step)
{
	int ans = 1;
	while(step)
	{
		if(step & 1)
			ans = mult(ans , a);
		a = mult(a , a);
		step >>= 1;
	}
	return ans;
}*/
int mult(int a , int b)
{
	return a * (LL)b % mod;
}
/*
int ob(int a)
{
	return binPow(a ,  mod - 2);
}*/
void add(int &a , int b)
{
	a = a + b >= mod ? a + b - mod : a + b;
}
/*void init()
{
	fact[0] = inv[0] = 1;
	for(int i = 1; i <= 200; i++)
	{
		fact[i] = mult(fact[i - 1] , i);
		inv[i] = ob(fact[i]);
	}
}*/
int main()
{
	//init();
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	int n , x;
	cin >> n >> x;
	for(int i = 0; i < n; i++)
		cin >> a[i];
	sort(a , a + n);
	reverse(a , a + n);
	dp[0][0][x] = 1;
	int nxt = 1;
	for(int i = 0; i < n; i++)
	{
			for(int k = 0; k <= x; k++)
			{
				add(dp[nxt][1][k] , mult(n - i - 1 , dp[nxt ^ 1][0][k]));
				add(dp[nxt][1][k] , mult(n - i - 1 , dp[nxt ^ 1][1][k]));
				add(dp[nxt][0][k % a[i]] , dp[nxt ^ 1][1][k]);
				add(dp[nxt][0][k % a[i]] , dp[nxt ^ 1][0][k]);
			}
	
		
		for(int j = 0; j < 2; j++)
		{
			for(int k = 0; k <= x; k++)
			{
				dp[nxt ^ 1][j][k] = 0;
			}
		}
		nxt ^= 1;
	}
	nxt ^= 1;
	int ans = 0;
	for(int y = 0; y <= x; y++)
	{
		add(ans , mult(y , dp[nxt][0][y]));
	}
	
	cout << ans;
		
    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define repz(i, z, n) for (decltype(n) i = (z); i < (n); i++)
#define rep(i, n) for (decltype(n) i = 0; i < (n); i++)

#define REPZ(i, z, n) for (decltype(n) i = (z); i <= (n); i++)
#define REP(i, n) for (decltype(n) i = 0; i <= (n); i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(v) ((ll)(v).size())
#define MAX(v) (*max_element(ALL(v)))
#define MIN(v) (*min_element(ALL(v)))
#define INF 1000000000000  // 1E+12

// 略
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define READ cin >>
#define PRINT cout <<
#define PYES cout << "YES" << endl
#define pyes cout << "Yes" << endl
#define POK cout << "OK" << endl
#define PNO cout << "NO" << endl
#define pno cout << "No" << endl
#define PNG cout << "NG" << endl
#define ret return 0

using namespace std;

// デバッグ用
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

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

#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

// typedef
typedef long long ll;
typedef unsigned long long ul;
typedef long double ld;
typedef pair<ll, ll> pl;

// const
// 円周率
const ld pi = acos(-1);
// mod用
// 1E+9 +7
const ll mod = (ll)1e+9 + 7;
// 1s間で可能なループ回数2E+8回
// ll        最大値2147483647         〜2E+9
// long long  最大値9223372036854775807〜9E+18
// 総和accumulate
// 単純リストvector<type> push_back
// 連想配列map<key,value> insert,
// 集合set<type>
// pair キーとバリューを格納 firstとsecondでアクセス
// 小数点指定 cout << fixed << setprecision(15) << endl;
// to_string<->stoi
// stoll(longlong)
// stod(double)
// deep copy v1->v2 copy(v1.begin(), v1.end(), back_inserter(v2) );
// 大文字65-90(-32)
// 小文字97-122(+32)
//  priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>>
//  ba;
signed main() {
  // faster
  // C言語流の入出力は使用できない
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  ll n;
  cin >> n;
  vector<ll> a(n);
  ll sum = 0;
  rep(i, n) {
    cin >> a[i];
    sum ^= a[i];
  }
  vector<ll> l(n + 1);
  vector<ll> r(n + 1);
  l[0] = 0;
  repz(i, 1, n + 1) { l[i] = l[i - 1] ^ a[i - 1]; }
  r[n] = 0;
  for (ll i = n - 1; i >= 0; i--) {
    r[i] = r[i + 1] ^ a[i];
  }
  rep(i, n) {
    ll temp = l[i] ^ r[i + 1];
    cout << temp;
    if (i == n - 1)
      cout << endl;
    else
      cout << " ";
  }

  ret;
}


Measured memory_bytes: 7888
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
const ll MOD = 1e9+7;
 
int main(){
  int t, x;
  cin >> t >> x;
  printf("%10lf\n", (double)t/x);
  return 0;
}

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

int main(){
    int n, d, x;
    cin >> n >> d >> x;
    int total = 0;
    for(int i = 0; i < n; i++){
        int a;
        cin >> a;
        int j = 0;
        while(1){
            if(j * a + 1 <= d){
                total += 1;
                j++;
            }
            else break;
        }
    }
    cout << total + x << endl; 

    return 0;
}

Measured memory_bytes: 256
MOD=10**9+7

class Combi
    def initialize(max_n, mod = 10**9+7)
        @mod = mod
        @max_n = max_n

        @fac = Array.new(@max_n+1)
        @inv = Array.new(@max_n+1)
        @finv = Array.new(@max_n+1)

        @fac[0] = @fac[1] = 1
        @finv[0] = @finv[1] = 1
        @inv[1] = 1
        2.upto(@max_n) do |i|
            @fac[i] = @fac[i-1] * i % @mod
            @inv[i] = @mod - @inv[@mod%i] * (@mod/i) % @mod
            @finv[i] = @finv[i-1] * @inv[i] % @mod
        end
    end

    def nCk(n,k)
      return 0 if n<k 
      return 0 if k<=0

      @fac[n] * @finv[n - k] * @finv[k] % @mod
    end
end

combi = Combi.new(200000)

n,k=gets.chomp.split.map(&:to_i)
a=gets.chomp.split.map(&:to_i).sort

ans=0

0.upto(n-1) do |i|
  ans += a[i] * combi.nCk(i,k-1)
  ans %= MOD
end

0.upto(n-1) do |i|
  ans -= a[i] * combi.nCk((n-1-i),k-1)
  ans %= MOD
end
puts ans




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

int main(){

    long long n; cin >> n;
    for(long long x = 1; x <= n; x++){

        if((x * (x + 1)) / 2 >= n){
            
            for(long long y = x; y >= 1; y--){
                //cout << y << "" << n << endl;
                if(n >= y){
                    cout << y << endl;
                    n -= y;
                }
            }

            break;
        }
    }

    return 0;
}

Measured memory_bytes: 256