akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep3(i, s, n, a) for (int i = (s); i < (int)(n); i += a)
#define rep2(i, s, n) rep3(i, s, n, 1)
#define rep(i, n) rep2(i, 0, n)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;

int main(){
    int n, sum=0;
    cin >> n;
    vector<int> a;
    vector<bool> b;
    rep(i, n){
        int num;
        cin >> num;
        a.push_back(num);
        sum ^= num;
    }

    rep(i, n){
        int x = sum ^ a[i];
        cout << x << " ";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 4300
import java.io.*;
import java.util.*;
import java.lang.String;
import java.util.Arrays;

import static java.lang.Integer.*;

public class Main extends PrintWriter {
    Main() { super(System.out, true); }
    Scanner sc = new Scanner(System.in);
    public static void main(String[] $) {
        Main o = new Main(); o.main(); o.flush();
    }
    //took bsearch from Dukkha
    private static int binSearch(Integer[] arr, int number){
        int left=0,right=arr.length-1,mid=(left+right)/2,ind=0;
        while(left<=right){
            if(arr[mid]<=number){
                ind=mid+1;
                left=mid+1;
            }
            else
                right=mid-1;
            mid=(left+right)/2;
        }
        return ind;
    }

    void main() {

        String S = sc.next();
        if(S.charAt(2) == S.charAt(3) && S.charAt(4) == S.charAt(5)){
            print("Yes");
        }
        else print("No");

    }
}

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

using namespace std;

int main(void) {
	int N, M, K;
	cin >> N >> M >> K;
	bool res = false;
	for(int a = 0; a <= N; ++a) {
		for(int b = 0; b <= M; ++b) {
			if(a * M + b * N - 2 * a * b == K) {
				res = true;
			}
		}
	}
	if(res) {
		cout << "Yes\n";
	} else {
		cout << "No\n";
	}
	return 0;
}



Measured memory_bytes: 256
n,m=map(int,input().split())
k=list(map(int,input().split()))

f=1
now=n

while f>0:
    a=[]
    b=now
    while b>0:
        a.append(b%10)
        b=b//10
    f2=-1
    for c in a:
        if c in k:
            f2=1
    if f2>0:
        now+=1
    else:
        f=-1

print(now)


Measured memory_bytes: 3060
#include <stdio.h>
int main(){
  char x[1001];
  int sum,i;
  while(1){
    sum=0;
    scanf("%s",x);
    if(x[0]=='0')break;
    for(i=0;i<1001;i++){
      if(x[i]!='\0')sum+=x[i]-'0';
      else break;
    }
    printf("%d\n",sum);
  }

  return 0;
}

Measured memory_bytes: 536
#include<map>
#include<iostream>
#include<deque>
#include<algorithm>
#include<string>
#include<cctype>
#include<iomanip>
#include<vector>
#include<queue>
#include<bitset>
#include<random>
#include<cstdint>
using namespace std;
#define REP(i,b,e) for(ll i=(ll)b;i<(ll)e;i++)
#define rep0(i,n) REP(i,0ll,n)
#define rep1(i,n) REP(i,1ll,n+1)
#define shosu setprecision(17)
 
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<char,P> Q;
ll longinf=(1ll<<60);
ll inf=1ll<<29;


int main(){
      int n;
      cin>>n;
      P u[n];
      rep0(i,n){
            if(i==0) u[i]={1,0};
            else u[i]={0,1};
      }
      int m;
      cin>>m;
      rep0(i,m){
            int x,y;
            cin>>x>>y;
            --x,--y;
            if(u[x].first>=1){
                  u[y].first++;
            }
            else u[y].second++;
            if(u[x].first+u[x].second<=1){
                  u[x]={0,0};
            }
            else if(u[x].second>=1){
                  u[x].second--;
            }
            else{
                  u[x].first--;
            }
      }
      int ans=0;
      rep0(i,n){
            if(u[i].first>=1) ans++;
      }
      cout<<ans<<endl;
      return 0;
}

Measured memory_bytes: 1792
//teja349
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx


using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >

//std::ios::sync_with_stdio(false);   
set<int> seti;
int main(){
    std::ios::sync_with_stdio(false);
    int n,i,val;
    cin>>n;
    rep(i,n){
    	cin>>val;
    	if(seti.find(val)!=seti.end()){
    		seti.erase(val);
    	}
    	else{
    		seti.insert(val);
    	}
    }
    cout<<seti.size()<<endl;
    return 0;  
    
}



Measured memory_bytes: 4992
s=input()
t=input()
i=-1
for j in range(len(s)-len(t)+1):
    if all(a=='?' or a==b for a,b in zip(s[j:],t)):
        i=j
if i==-1:
    print('UNRESTORABLE')
else:
    r=list(s)
    r[i:i+len(t)]=t
    for j in range(len(r)):
        if r[j]=='?':
            r[j]='a'
    print(''.join(r))

Measured memory_bytes: 3064
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
    enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
// #ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
    ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
    *this << "[";
    for (auto it = d.b; it != d.e; ++it)
       *this << ", " + 2 * (it == d.b) << *it;
    ris << "]";
}
// #else
// sim dor(const c&) { ris; }
// #endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

void solve(){
    int n;
    cin>>n;
    long long ans=0ll;
    for(int i=1;i<=n;i++){
        ans+=(n-1)/i;
    }
    cout<<ans<<'\n';
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 3656
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
using ll=long long;
constexpr ll mod=1000000007;
constexpr int inf=1000000000;
constexpr ll linf=1000000000000000000;

int main(){
    ll n,d;
    cin>>n>>d;
    int ans=0;
    rep(i,n){
        ll x,y;
        cin>>x>>y;
        if(x*x+y*y<=d*d)++ans;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3608
//#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"

using namespace std;


int main() {
	int a, b;
	cin >> a >> b;
	if (a % 2 == 0 || b % 2 == 0) cout << "Even" << endl;
	else cout << "Odd" << endl;

}

Measured memory_bytes: 256
def g(x)
    res=(x%4==1 || x%4==2) ? 1 : 0
    (2..50).map{|i|
        b=2**i
        m=x%b
        res|=m>=b/2 && m.even? ? b/2 : 0
    }
    res
end

A, B=gets.split.map &:to_i
p g(B)^g(A-1)

Measured memory_bytes: 1788
#pragma GCC optimize(3,"Ofast","inline")
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vii> vvii;

#define fastIO ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define forw(i,l,r) for(int i=(l);i<(r);i++)
#define forb(i,r,l) for(int i=(r);i>(l);i--)
#define log2i(x) 32 - __builtin_clz((x)) - 1
#define log2ll(x) 64 - __builtin_clzll((x)) - 1
#define Pi acos(-1.0)
#define sz(x) (int)x.size()
#define mt make_tuple
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

const int N = 18;
int n;
int a[N][N];
ll dp[1<<N]={0};

int main() {
#ifndef ONLINE_JUDGE
    //freopen("test.inp","r",stdin);
    //freopen("test.out","w",stdout);
#endif
    fastIO;
    cin >> n;
    forw(i,0,n) {
        forw(j,0,n) cin >> a[i][j];
    }
    forw(i,1,1<<n) {
        ll res=0;
        forw(j,0,n) {
            forw(k,0,j) {
                if(((i>>j)&1)&&((i>>k)&1)) res+=a[j][k];
            }
        }
        for(int j=i;j;j=((j-1)&i)) res=max(res,dp[j]+dp[i-j]);
        dp[i]=res;
    }
    cout << dp[(1<<n)-1];
    return 0;
}


Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    if((a == b and c!=a) or(a==c and a!=b) or (b == c and b!=a))
    {
        cout<<"Yes"<<endl;
    }
    else
        cout<<"No"<<endl;
    return 0;
}


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

int main() {
  int n,m;
  cin >> n >> m;
  vector<int> a(m);
  rep(i,n){
    int k;
    cin >> k;
    rep(j,k){
      int x;
      cin >> x;
      a.at(x-1)++;
    }
  }

  int cnt = 0;
  for(int i: a){
    if(i == n) cnt ++;
  }
  cout << cnt << endl;
}
  


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[]str = Console.ReadLine().Split();
		int N = int.Parse(str[0]);
		int M = int.Parse(str[1]);
		var list = new List<int>[M];
		for(var i=0;i<M;i++){
			list[i] = new List<int>();
			string[]str2 = Console.ReadLine().Split();
			int K = int.Parse(str2[0]);
			for(var j=0;j<K;j++){
				list[i].Add(int.Parse(str2[j+1]));
			}
		}
		int[]C = new int[M];
		string[]str3 = Console.ReadLine().Split();
		for(var i=0;i<M;i++){
			C[i] = int.Parse(str3[i]);
		}
		int MA = (int)Math.Pow(2,N);
		int[]D = new int[11];
		D[0] = 1;
		for(var i=1;i<11;i++){
			D[i] = D[i-1] * 2;
		}
		int ans = 0;
		for(var i=0;i<MA;i++){
			bool flag = true;
			for(var j=0;j<M;j++){
				int ct = 0;
				for(var k=0;k<list[j].Count;k++){
					if(i / D[list[j][k]-1] % 2 == 1){
						ct++;
					}
				}
				if(ct%2!=C[j]){
					flag = false;
				}
			}
			if(flag){
				ans++;
			}
		}
		Console.WriteLine(ans);
	}
}

Measured memory_bytes: 13268
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>

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

using namespace std;
#define int long long
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repr(i,n) for(ll i=n;i>=0;i--)
#define P pair<ll, ll>
#define sz(x) (ll)x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<ll>
#define COUT(x) cout<<(x)<<endl
#define MA map<ll,ll>
#define SE set<ll>
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,VE,greater<ll>>
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define EPS (1e-10)
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
bool prime(ll n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}


const long long MOD = 1000000007;
const long long INF = 1LL << 60;


const int MAX_N = 100010;

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n; cin >> n;
	VE a(n); rep(i, n)cin >> a[i];
	int ans = a[0];
	rep(i, n) {
		ans = gcd(ans, a[i]);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1024
h , w , m = map(int,input().split())
retu = [0 for i in range(w)]
gyo = [0 for i in range(h)]
basyo = set()
for i in range(m):
    a , b = map(lambda x:int(x)-1,input().split())
    retu[b] += 1
    gyo[a] += 1
    basyo.add((a,b))
t = max(retu)
mare = [i for i, v in enumerate(retu) if v == t]
s = max(gyo)
magy = [i for i, v in enumerate(gyo) if v == s]

for i in magy:
    for j in mare:
        if not (i,j) in basyo:
            print(s+t)
            exit()
print(s+t-1)

Measured memory_bytes: 176956
nn, mm = gets.split.map(&:to_i)
aa = gets.split.map(&:to_i)
bc =
  readlines.map do |i|
    i.chomp.split.map(&:to_i)
  end
bc.sort!{|a,b|b[1]<=>a[1]}

# 新カードから大きいのをn枚引く
new_cards = []
0.upto(mm-1) do |i|
  b=bc[i][0]
  c=bc[i][1]
  new_cards.concat([c]*b)
  break if new_cards.size >= nn
end

# 手持ちと新カードの中から大きいのをn枚選ぶ
max = aa.concat(new_cards[0..(nn-1)]).sort{|a,b|b<=>a}[0..(nn-1)].inject(:+)
puts max


Measured memory_bytes: 25592
IDENTIFICATION DIVISION.
       PROGRAM-ID. test1.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 INP PIC X.
       PROCEDURE DIVISION.
       MAIN.
       	ACCEPT INP.
      	IF INP = 'a' THEN
      		DISPLAY "vowel"
      	ELSE IF INP = 'i' THEN
      		DISPLAY "vowel" 
      	ELSE IF INP = 'u' THEN
      		DISPLAY "vowel"
      	ELSE IF INP = 'e' THEN
      		DISPLAY "vowel"
      	ELSE IF INP = 'o' THEN
      		DISPLAY "vowel"
      	ELSE
      		DISPLAY "consonant"
      	END-IF.
        STOP RUN.


Measured memory_bytes: 760
#include<iostream>
using namespace std;
int main() {
    long long K,A,B,bis=1,yen=0,dmy=1;
    cin >> K >> A >> B;
    for (int i=0; i<K; i++) {
        if (yen == 1) {
            yen -= 1;
            bis += B;
        } else if (bis >= A && i<K-1) {
            bis -= A;
            yen += 1;
        } else {
            bis++;
        }
        dmy++;
    }
    if (bis < dmy) bis = dmy;
    cout << bis << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 3e5 + 10;
int n, a[N];
ll check(int x) {
    vector<int> v;
    ll s = 0;
    for(int i = 0; i < n; i++) {
        v.push_back(a[i] % x);
        s += v.back();
    }
    sort(v.begin(), v.end());
    int c = s/x;
    ll ret = 0;
    for(int i = int(v.size())-1; i >= 0 && c; i--) {
        ret += x-v[i];
        c--;
    }
    return ret;
}
int main() {
    ll k;
    cin >> n >> k;
    ll s = 0;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        s += a[i];
    }
    ll ans = 1;
    for(ll i = 1; i*i <= s; i++) {
        if(s % i == 0 && check(i) <= k) ans = max(ans, i);
        if(s % i == 0 && check(s/i) <= k) ans = max(ans, s/i);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <array>
#include <map>
#include <algorithm>
#include <cmath>
#include <vector>
#include <fstream>
#include <string>
#include <random>
#include <queue>
#include <iomanip>
#include <functional>
#include <climits>
#include <tuple>
#include <unordered_map>
#include <limits>
#include <functional>
#include <cassert>
#include <numeric>
#include <bitset>
#include <set>

#define FOR(x,n) for(int x = 0; x < n; x++)
#define INPUT(x) scanf("%d",&x)
#define PUT(x) printf("%d\n",x)
#define DPUT(x) printf("%.15lf\n",x)
#define GET(x,y) std::get<x>(y)
#define CHMAX(x,y) x = std::max(x,y)
#define CHMIN(x,y) x = std::min(x,y)
#define SP_END (i != n - 1 ? ' ' : '\n') ;

using namespace std;

using ll = long long int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vll = std::vector<ll>;
using vpll = std::vector<pll>;
using vpii = std::vector<pii>;
using vi = std::vector<int>;
using vvi = std::vector<vi>;
using vvpii = std::vector<vpii>;
using vch = std::vector<char>;
using vvch = std::vector<vch>;
using tiii = std::tuple<int, int, int>;

const ll mod197 = 1000000007LL;
const ll INF = 10000000000LL;

const double PI11 = 3.14159265359;

const int dis[5] = { 0,1,0,-1,0 };

const int disD[4] = { 0,1,1,0 };
const int disLD[3] = { 0,1,0 };

const char disC[4] = { 'U','D','R','L' };
const char disY[4] = { -1,1,0,0 };
const char disX[4] = { 0,0,1,-1 };

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

int main(void)
{
	ll W, H;
	cin >> W >> H;

	priority_queue<pair<int, bool>,vector<pair<int,bool>>,greater<pair<int,bool>>> s;

	for (int i = 0; i < W; i++) {
		int p;
		cin >> p;
		s.push({ p,0 });
	}
	for (int i = 0; i < H; i++) {
		int q;
		cin >> q;
		s.push({ q,1 });
	}

	int x = 0, y = 0;
	ll cost = 0;

	while (!s.empty()) {
		auto t = s.top();
		s.pop();

		if (t.second == 0) {
			cost += t.first * (H - y + 1);
			x++;
		}
		else {
			cost += t.first * (W - x + 1);
			y++;
		}
		//cerr << t.first << " " << cost << endl;
	}

	cout << cost << endl;

	return 0;
}


Measured memory_bytes: 2420
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        String op = sc.next();
        int b = sc.nextInt();
        int ans = 0;
        if(op.equals("+")){
            ans = a + b;
        }
        if(op.equals("-")){
            ans = a - b;
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 21716
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <string.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <map>
#include <set>
#include <iostream>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define gep(i,g,j) for(int i = g.head[j]; i != -1; i = g.e[i].next)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("-1"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,vector<T>,greater<T> >
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const int MX = 200005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
const double PI = acos(-1);

double s[MX];
double e[MX];

ll f(ll n, double x) {
  ll sum = 0;
  rrep(i,n-1) {
    int l = 0, r = (n-i)/2+1;
    while (l+1<r) {
      int c = (l+r)>>1;
      if (e[c]*e[n-i-c]*s[i]/2 < x) l = c; else r = c;
    }
    sum += l*2;
    if ((n-i)/2 == l && (n-i)%2 == 0) {
      sum--;
    }
  }
  // cout<<n<<" "<<x<<" "<<sum<<endl;
  return sum*n/3;
}

int main() {
  int n;
  scanf("%d",&n);
  rrep(i,n-1) {
    s[i] = sin(PI*i/n);
    e[i] = 2*s[i];
  }
  ll m;
  scanf("%lld",&m);
  double l = 0, r = PI;
  rep(ti,100) {
    double c = (l+r)/2;
    if (f(n,c) < m) l = c; else r = c;
  }
  printf("%.10f\n",l);
  return 0;
}































Measured memory_bytes: 1152
//abc159_c.cpp
//Sat Apr 18 23:00:35 2020

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
#define MOD 1000000007

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

int main(){
	double L;
	cin >> L;

	L = L/3;
	double ans = L*L*L;

	printf("%.10f\n",ans);
}

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

int main(){
    int n, k;
    cin >> n >> k;
    int sum[n+1];
    sum[0] = 0;
    for(int i = 0; i < n; i++){
        int p;
        cin >> p;
        sum[i + 1] = sum[i] + p;
    }

    int ans = 0;
    for(int i = 0; i <= n - k; i++){
        ans = max(ans, sum[i+k]-sum[i]);
    }
    cout << fixed << setprecision(10) << (double)(ans + k) / 2.0 << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
	int N;
	LL A, B, X;
	cin >> N >> A >> B >> X;
	LL pre = X, ans = 0;
	for (int i = 1; i < N; i++) {
		cin >> X;
		ans += min((X - pre) * A, B);
		pre = X;
	}
	cout << ans << endl;
	return 0;

}

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

using namespace std;

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

    for (int i = 0; i < s.length(); ++i) {
        for (int j = i + 1; j < s.length(); ++j) {
            if (s[i] == 'C' and s[j] == 'F') {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
s=input()
if len(s)<2 or (len(s)==2 and s[0]!=s[1]):
    print(-1,-1)
    exit()
if len(s)==2 and s[0]==s[1]:
    print(1,2)
    exit()
for i in range(len(s)-1):
    if s[i]==s[i+1]:
        print(i+1,i+2)
        exit()
for i in range(len(s)-2):
    if s[i]==s[i+2]:
        print(i+1,i+3)
        exit()
print(-1,-1)

Measured memory_bytes: 3188
/* 163-B.cpp
 *     Created on : Apr 19, 2020 
 *     Time       : 6:12:54 PM
 *     Author     : null_ptr
 */
#include<iostream>
#include<vector>

using namespace std;

int main()
{
	int n,m;
	cin>>n>>m;
	vector<int> nums(n);
	long long sum=0;
	for(int i=0;i<m;++i)
	{
		cin>>nums[i];
		sum+=nums[i];
	}
	cout<<(n-sum>=0?n-sum:-1);
}


Measured memory_bytes: 7216
#include<bits/stdc++.h>
#define int long long
#define PB push_back
#define MP make_pair
#define F first
#define S second
using namespace std;

int a, b, ac[5010], bc[5010];
int dp[2][5010];
int ans = 0;

signed main()
{
	cin >> a >> b;
	for(int i = 1; i <= a; i++){
		cin >> ac[i];
	}
	for(int i = 1; i <= b; i++){
		cin >> bc[i];
	}
	
	for(int i = 1; i <= b; i++){
		int mx = 0;
		memset(dp[i % 2], 0, sizeof dp[i % 2]);
		
		for(int j = 1; j <= a; j++){
			if(ac[j] == bc[i]){
				dp[i % 2][j] = mx + 1;
				ans = max(ans, dp[i % 2][j]);
			}
			mx = max(mx, dp[!(i % 2)][j]);
		}
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3268
# coding: utf-8
from functools import reduce
def check(dt,st,lv):
    global p
    if p>=len(dt):
        return st
        
    if not dt[p][-1].isdigit() and lv==len(dt[p]):
        tmp=p
        p+=1
        st.append(reduce(lambda a,b:a+b if dt[tmp][-1]=='+' else a*b,check(dt,[],lv+1)))
        return check(dt,st,lv)

    elif lv==len(dt[p]):
        st.append(int(dt[p][-1]))
        p+=1
        return check(dt,st,lv)
    else:
        return st

    
while 1:
    n=int(input())
    if n==0:
        break
    data=[]
    for i in range(n):
        data.append(list(input()))
    p=0
    print(check(data,[],1)[0])
    



Measured memory_bytes: 6276
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.concurrent.ArrayBlockingQueue;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int A1 = sc.nextInt();
		int A2 = sc.nextInt();
		int A3 = sc.nextInt();
		System.out.println(A1 + A2 + A3 >= 22 ? "bust" : "win");
		
	}
	
	
	
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}


Measured memory_bytes: 22612
#include <iostream>
#include <map>
#include <string>
using namespace std;
int main(){
    int n; cin >> n;
    int max_num = 0;
    int ans = 0;
    for(int i = 0; i < n; i++) {
        int p; cin >> p;
        ans += p;
        max_num = max(max_num, p);
    }
    cout << ans - max_num/2 << endl;
    return 0;
}

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

int main() {
    int a[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int K;
    cin >> K;
    cout << a[K-1] << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 5;
int main(){
    int n;
    cin >> n;
    map<string, int> m;
    for(int i = 0; i < n; i++){
        string s;
        cin >> s;
        sort(all(s));
        m[s]++;
    }
    ll ans = 0;
    for(map<string, int>::iterator it = m.begin(); it != m.end(); it++){
        ll x = (*it).s;
        ans += x * (x-1) / 2;
    }
    cout << ans;
}

Measured memory_bytes: 11136
#include<bits/stdc++.h>
using namespace std;
int main(){
    int A,B,C,D;cin >> A >> B >> C >> D;
    if(A + B > C + D){
        cout << "Left" << endl;
    }
    else if(A + B == C + D){
        cout << "Balanced" << endl;
    }
    else{
        cout << "Right" << endl;
    }
    return 0;
}   

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define FASTIO  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ll long long int
#define ld long double
#define vll vector<ll>
#define pll pair<ll,ll>
#define vl(p) vector<p>
#define W while
#define For(i,s,x) for(i=s;i<x;i++)
#define Fore(i,s,x) for(i=s;i<=x;i++)
#define FOR(i,x) for(i=0;i<x;i++)
#define Rof(i,s,x) for(i=s;i>=x;i--)
#define all(v) v.begin(),v.end()
#define it(r,v) for(auto r=v.begin();r!=v.end();r++)
#define pb push_back
#define in insert
#define sz size()
#define F first
#define S second
#define nl cout<<"\n"
#define pr(a) cout<<a<<" "
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
#define pr3(a,b,c) cout<<a<<" "<<b<<" "<<c<<"\n"
#define mod 1000000007

int main() {
    FASTIO;
  ll n,m;
  cin>>n>>m;
  ll a[n],i,count=0;
  double sum=0,d,s,p;
  d=m;
  FOR(i,n)
  {
  cin>>a[i];
  sum=sum+a[i];
  }
  p=1*sum/(4*d);
  FOR(i,n)
  {
      s=a[i];
      if(s>=p)
      count++;
  }
  if(count>=m)
  cout<<"Yes";
  else
  cout<<"No";
}

Measured memory_bytes: 256
//                _                                      
//  ___ _ __ ___ (_) __ ___      ___   _ _ __ ___  _ __  
// / __| '_ ` _ \| |/ _` \ \ /\ / / | | | '_ ` _ \| '_ \ 
// \__ \ | | | | | | (_| |\ V  V /| |_| | | | | | | |_) |
// |___/_| |_| |_|_|\__, | \_/\_/  \__,_|_| |_| |_| .__/ 
//                  |___/                         |_|  
//code by smigwump
//https://codeforces.com/blog/entry/62393 hashing hack protection
//https://codeforces.com/blog/entry/61587 rand() alternatives
//https://codeforces.com/blog/entry/61675 randomized hack protection
#include <bits/stdc++.h>
typedef long long ll;
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
#define REP(i,a,b) for(ll i = a; i <= b; i++)
#define PER(i,a,b) for(ll i = a; i >= b; i--)

using namespace std;

int main() {
	// #ifndef ONLINE_JUDGE
	//     freopen("input.txt", "r", stdin);
	//     freopen("output.txt", "w", stdout);
	// #endif

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    vector<int> v(n,0);
    REP(i,0,n-1) {
        char ch;
        cin>>ch;
        if(ch=='R') {
            v[i] = 0;
        }
        else {
            v[i] = 1;
        }
    }
    vector<int> sorted = v;
    sort(all(sorted));
    int count01 = 0, count10 = 0;
    REP(i,0,n-1) {
        int gap = sorted[i]-v[i];
        if(gap==1) {
            count01++;
        }
        else if(gap==-1) {
            count10++;
        }
    }
    cout<<min(count10,count01)+abs(count10-count01);
	return 0;
}

Measured memory_bytes: 4776
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
#define swap(a,b) do{ll w=a;a=b;b=w;}while(0)
#define swapd(a,b) do{double w=a;a=b;b=w}while(0)
#define in(a) scanf("%lld", &(a))
#define ind(a) scanf("%lf", &(a))
#define put(a) printf("%lld\n", (a))
#define putd(a) printf("%.15f\n", (a));
//def   puts(a) printf("%s\n", a) 文字はこっち
int cmp(const void *a, const void *b);
//your code here!

int main(void){
    ll AB, BC, w;
    in(AB); in(BC); in(w);
    put(AB*BC/2);    
    return 0;
}

int cmp(const void *a, const void *b){
    ll A=*(ll *)a, B=*(ll *)b;
    if(A==B)return 0;
    else return A>B ? 1:-1;//昇順ソート
}


Measured memory_bytes: 128
while True :
    a, op, b = input().split()
    if op == '+' :
        print(int(a) + int(b))
    elif op == '-' :
        print(int(a) - int(b))
    elif op == '*' :
        print(int(a) * int(b))
    elif op == '/' :
        print(int(a) // int(b))
    elif op == '?' :
        break


Measured memory_bytes: 5596
n = int(input())
a = list(map(int, input().split()))
new_a = []
sum = 0
minus_count = 0

for i in range(n):
	new_a.append(abs(a[i]))

for i in range(n):
	if a[i] < 0:
		minus_count += 1

if minus_count % 2 == 0:
	for i in range(n):
		sum += abs(a[i])
else:
	for i in range(n):
		sum += new_a[i]
	sum = sum - min(new_a) * 2

print(sum)

Measured memory_bytes: 14252
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
//-std=gnu++17
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
//高速素因数分解 O(nlogn)
template <typename T>
vector<T> smallest_prime_factors(T n) //iの最小の素因数
{

    vector<T> spf(n + 1);
    for (int i = 0; i <= n; i++)
        spf[i] = i;

    for (T i = 2; i * i <= n; i++)
    {

        // 素数だったら
        if (spf[i] == i)
        {

            for (T j = i * i; j <= n; j += i)
            {

                // iを持つ整数かつまだ素数が決まっていないなら
                if (spf[j] == j)
                {
                    spf[j] = i;
                }
            }
        }
    }

    return spf;
}
template <typename T>
vector<T> factolization(T x, vector<T> &spf)
{
    vector<T> ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x /= spf[x];
    }
    sort(ret.begin(), ret.end());
    return ret;
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    auto sp = smallest_prime_factors(ll(1000001));
    vector<bool> count(1000001, false);
    bool check = false;
    rep(i, n)
    {
        auto r = factolization(a[n - 1 - i], sp);
        //debug(r);
        r.erase(unique(ALL(r)),r.end());
        for (auto i : r)
        {
            if (count[i]){
                //cout<<i<<"\n";
                check = true;
            }
            else
                count[i] = true;
        }
    }
    if (check)
    {
        int g = a[0];
        for (int i = 1; i < n; i++)
        {
            g = gcd(g, a[i]);
        }
        if (g == 1)
        {
            cout << "setwise coprime"<<"\n";
        }
        else
        {
            cout << "not coprime"<<"\n";
        }
    }
    else
    {
        cout << "pairwise coprime"
             << "\n";
    }
}


Measured memory_bytes: 19052
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)
	ar := make([]int, n)
	for i := range ar {
		fmt.Scan(&ar[i])
	}
	sort.Ints(ar)
	l := n/2 - 1
	r := l + 1
	sum := 0
	for i := ar[l] + 1; i <= ar[r]; i++ {
		sum++
	}
	fmt.Println(sum)
}


Measured memory_bytes: 5504
#include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
 
using namespace std;
int MOD=1000000007;

int main(){
	int A,B,C,D;
	cin >> A >> B >> C >> D;
	if(A*B>=C*D) cout << A*B << endl;
	else cout << C*D << endl;
	}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
	int n; //n円を支払う
	int m; //m種類のコイン
	scanf("%d",&n);   scanf("%d",&m);
	int coin[m]; //コインの金額
	int i,j;
	int dp[50001];
	int min;
	for(i=0;i<m;i++){
		scanf("%d",&coin[i]);
	}
	for(i=0;i<n+1;i++){
    	dp[i]=i;		//求めたい金額につき１円コイン＊金額分の枚数最低かかる
    }
    for(i =1;i<m;i++){		//1以外のコインについて
    	for(j=coin[i];j<n+1;j++){  //そのコインより後ろはそのコインで払える
    		min = dp[j - coin[i]]+1;		//dp[510-500]+1 500円玉に両替
			if( min < dp[j] ){
				dp[j] = min;
			}
		}
	}
	printf("%d\n",dp[n]);
	return 0;
}


Measured memory_bytes: 2112
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <math.h>
#include <cmath>
#include <set>   

using namespace std;


int main() {

	string x, y;

	cin >> x >> y;

	if (x[0] == y[2] && x[1] == y[1] && x[2] == y[0]) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;

	}

	}


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

int main()
{
	int n[10],i=0;

	while (cin >> n[i])
		i++;
	sort(n,n+i,greater<int>());
	for (int j=0; j < 3; j++) {
		cout << n[j] << endl;
	}
	return 0;
}

Measured memory_bytes: 1176
#include <stdio.h>
#include <string.h>

#define ARR_SIZE 36
#define STR_LEN 3

#define SWAP(a, b) {int tmp; tmp = a; a = b; b = tmp;}

void print_array(char arr[][STR_LEN], int size)
{
  int i;

  for(i = 0; i < size; i++){
    if(i > 0) printf(" ");
    printf("%s", arr[i]);
  }

  printf("\n");
  return;
}

void selection_sort(char arr[][STR_LEN], int size)
{
  int i;

  for(i = 0; i < size; i++){
    int minj, j;
    minj = i;
    for(j = minj; j < size; j++){
      if((arr[j][1] - '0') < (arr[minj][1] - '0')){
        minj = j;
      }
    }
    SWAP(arr[minj][0], arr[i][0]);
    SWAP(arr[minj][1], arr[i][1]);
  }

  return;
}

void bubble_sort(char arr[][STR_LEN], int size )
{
  int i = 0;
  int flag = 1;

  while(flag){
    flag = 0;
    for(i = 0; i < size - 1; i++){
      if((arr[i][1] -'0') > (arr[i+1][1] - '0')){
        SWAP(arr[i+1][0], arr[i][0]);
        SWAP(arr[i+1][1], arr[i][1]);
        flag = 1;
      }
    }
  }

  return;
}

int main(void)
{
  int size;
  int i;
  char arr_b[ARR_SIZE][STR_LEN];
  char arr_s[ARR_SIZE][STR_LEN];

  scanf("%2d", &size);

  for(i = 0; i < size; i++) scanf("%2s", arr_b[i]);

  memcpy((void *)arr_s, (void *)arr_b, ARR_SIZE * STR_LEN);

  bubble_sort(arr_b, size);
  print_array(arr_b, size);
  printf("Stable\n");

  selection_sort(arr_s, size);
  print_array(arr_s, size);

  if(memcmp((void *)arr_b, (void*)arr_s, size * STR_LEN) == 0){
    printf("Stable\n");
  }else{
    printf("Not stable\n");
  }

  return 0;
}

Measured memory_bytes: 624
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

using std::string;
using std::vector;
using std::set;
using std::multiset;
using std::unordered_set;
using std::map;
using std::multimap;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

using boost::multiprecision::cpp_int;
using cpp_dec_float_1000 = boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>>;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

constexpr char CRLF  = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;
constexpr int MOD = 1000'000'007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }
template<class T> T modinv(T a, T m) { T b = m, u = 1, v = 0; while (b) { T t = a / b; a -= t * b; boost::swap(a, b); u -= t * v; boost::swap(u, v); } u %= m; if (u < 0) u += m; return u; }
template<class T> inline bool isSosuu(const T& n) { if (n == T(1)) { return false; } for (T i = 2; i*i <= n; ++i) { if (n % i == 0) { return false; } } return true; }
template<class T> vector<vector<T>> split (const vector<T>& S, T delim) { vector<vector<T>> ret{}; vector<T> buff{}; for (auto c : S) { if (c == delim) { if (!buff.empty()) ret.push_back(buff); buff.clear(); } else { buff.push_back(c); } } if (!buff.empty()) ret.push_back(buff); return ret; }

struct Tmp
{
public:
  Tmp(int N);
};

Tmp::Tmp(int N){}

void solve(void)
{
  int N; cin >> N;
  vector<int> A(N);
  for(auto& a : A) { cin >> a; }
  map<int, int> m{};
  for (const auto& a : A) {
    ++m[a];
  }
  int res{};
  for (const auto& p : m) {
    if (p.first == p.second) {
      ;
    } else if (p.first < p.second) {
      res += p.second - p.first;
    } else if (p.first > p.second) {
      res += p.second;
    }
  }
  cout << res << CRLF;
  return;
}

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

  solve();

  return 0;
}


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

using namespace std;

int main(void){
    int n;
    string str;
    cin>>n;
    int arr[4]={0,0,0,0};
    for(int i=0;i<n;i++)
    {
        cin>>str;
        if(str=="AC")
            arr[0]++;
        else if(str=="WA")
            arr[1]++;
        else if(str=="TLE")
            arr[2]++;
        else if(str=="RE")
            arr[3]++;
    }
    cout<<"AC x "<<arr[0]<<"\n";
    cout<<"WA x "<<arr[1]<<"\n";
    cout<<"TLE x "<<arr[2]<<"\n";
    cout<<"RE x "<<arr[3]<<"\n";
}


Measured memory_bytes: 3628
#include<iostream>
#include<cstring>
#include<cmath>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<set>
#include<sstream>
#include<string>
#include<vector>
#include<cstdio>
#include<ctime>
#include<bitset>
#include<algorithm>
#include<string>
#include<unordered_map>
using namespace std;
typedef long long ll;
#define lson l , mid , rt << 1
#define rson mid + 1 , r , rt << 1 | 1

int read() {
	int ans = 0, flag = 1;
	char ch = getchar();
	while ((ch > '9' || ch < '0') && ch != '-') ch = getchar();
	if (ch == '-') flag = -1, ch = getchar();
	while (ch >= '0' && ch <= '9') ans = ans * 10 + ch - '0', ch = getchar();
	return ans * flag;
}


int main()
{
	int t = read();
	char a[1010];
	char b[1010];
	cin >> a >> b;
	for (int i = 0; i < t; i++)
	{
		printf("%c%c", a[i], b[i]);
	}
	return 0;
}













Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i,n) for (int i=0;i<(int)(n);i++)
#define codefor int test;scanf("%d",&test);while(test--)
#define yn(ans) if(ans)printf("Yes\n");else printf("No\n")
#define YN(ans) if(ans)printf("YES\n");else printf("NO\n")
#define vector2d(type,name,h,...) vector<vector<type>>name(h,vector<type>(__VA_ARGS__))
#define umap unordered_map
#define uset unordered_set
using namespace std;
using ll = long long;
const int MOD=1000000007;
//入力系
void scan(int& a){scanf("%d",&a);}
void scan(long long& a){scanf("%lld",&a);}
template<class T> void scan(T& a){cin>>a;}
template<class T> void scan(vector<T>& vec){for(auto&& it:vec)scan(it);}
void in(){}
template <class Head, class... Tail> void in(Head& head, Tail&... tail){scan(head);in(tail...);}
//出力系
void print(const int& a){printf("%d",a);}
void print(const long long& a){printf("%lld",a);}
void print(const double& a){printf("%.15lf",a);}
template<class T> void print(const T& a){cout<<a;}
template<class T> void print(const vector<T>& vec){if(vec.empty())return;print(vec[0]);for(auto it=vec.begin();++it!= vec.end();){putchar(' ');print(*it);}}
void out(){putchar('\n');}
template<class T> void out(const T& t){print(t);putchar('\n');}
template <class Head, class... Tail> void out(const Head& head,const Tail&... tail){print(head);putchar(' ');out(tail...);}
//デバッグ系
template<class T> void dprint(const T& a){cerr<<a;}
template<class T> void dprint(const vector<T>& vec){if(vec.empty())return;cerr<<vec[0];for(auto it=vec.begin();++it!= vec.end();){cerr<<" "<<*it;}}
void debug(){cerr<<endl;}
template<class T> void debug(const T& t){dprint(t);cerr<<endl;}
template <class Head, class... Tail> void debug(const Head& head, const Tail&... tail){dprint(head);cerr<<" ";debug(tail...);}

int main(){
    int a,b,c;
    in(a,b,c);
    double S=a*b*sin(M_PI*c/180);
    double d=sqrt(a*a+b*b-2*a*b*cos(M_PI*c/180));
    out((double)S/2);
    out((double)a+b+d);
    out((double)S/a);
}


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

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#include <map>
#define all(x) (x).begin(),(x).end()

void solve(){

}
int main(){
    int a,b;
    char op;
    cin >> a >> op >> b;
    if (op == '+'){
        cout << a+b << endl;
    } else {
        cout << a-b << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,m,n) for(int i=m;i<n;i++)
ll mod=1e9+7;

int main(){
  char c;
  cin>>c;
  if(c=='a' || c=='i' || c=='u' || c=='e' || c=='o'){
    cout<<"vowel"<<endl;
  }
  else{
    cout<<"consonant"<<endl;
  }
}

Measured memory_bytes: 256