akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
 
using namespace std;

template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << v.first << ' ' << v.second; return os; }
template <class T, class S> ostream& operator << (ostream &os, const map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; }
 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <class Arg1> void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << endl; }
    template <class Arg1, class... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args) {
        const char* sep = strchr(names + 1, ',');
        cerr.write(names, sep - names) << " : " << arg1 << "  ";
        __f(sep + 1, args...);
    }
#else
#define trace(...) 0
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#endif

#define fast_cin() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX 1000000
#define ll long long
#define db double
#define str string
#define pb push_back
#define For(i,s,e) for (ll i=(s); i<(e); i++)
#define Forrev(i,s,e) for (ll i=(s); i>=(e); i--)
#define all(v) v.begin(),v.end()

#define vll vector<ll>
#define vs vector<string>
#define mapll map<ll,ll>
#define pll pair<ll,ll>
#define initialise(a, x) memset(a, x, sizeof(a))
#define maxheap priority_queue<ll>
#define minheap priority_queue<ll,vector<ll> ,greater<ll>>

#define ff first
#define ss second
#define endl "\n"
#define mp make_pair
const ll mod=1e9 + 7;

ll takemod(ll a) {
    return ((a%mod)+mod)%mod;
}

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

ll fast_exp(ll base, ll expo) {
    ll res=1;
    while(expo>0) {
        if(expo&1) res=(res*base)%mod;
        base=(base*base)%mod;
        expo>>=1;}
    return res;
}

ll modinv(ll a) {
    return takemod(fast_exp(takemod(a), mod-2));
}

void solve()
{
	ll n;
	cin>>n;

	ll arr1[n+1];
	ll arr2[n+1]={0};
	For(i,0,n-1)
	{
		cin>>arr1[i];
		arr2[arr1[i]]++;
	}
	For(i,1,n+1)
		cout<<arr2[i]<<endl;
}

signed main() 
{
    fast_cin();
    // #ifndef ONLINE_JUDGE
    // freopen("C:/IO/in.txt", "r", stdin);
    // freopen("C:/IO/out.txt", "w", stdout);
    // #endif
    
    int t=1;
    //cin>>t;
    while(t--)
    {
    	solve();
    }
    
    
    return 0;    
}

Measured memory_bytes: 6748
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String a = scanner.next();
        String b = scanner.next();
        String c = scanner.next();

        Set<String> mySet = new HashSet<>();
        mySet.add(a);
        mySet.add(b);
        mySet.add(c);

        if(mySet.size() == 2) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

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

int main(){

  char s[128];
  
  scanf("%s", s); 
 
  if((strcmp(s,"hi")==0)||(strcmp(s,"hihi")==0)||(strcmp(s,"hihihi")==0)||(strcmp(s,"hihihihi")==0)||(strcmp(s,"hihihihihi")== 
                                                                              0)){
   printf("Yes");
  }else{
   printf("No");
  }
  
  return 0;
}

Measured memory_bytes: 128
#include<iostream>
    #include<stdio.h>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<float.h>
    #include<iomanip>
    #include<algorithm>
    #include<string>
    #include<cstring>
    #include<math.h>
    #include<cmath>
    #include<sstream>
    #include<set>
    #include<map>
    #include<queue>
    #include<cassert>
    #include<cmath>
    #include<cstdint>
    #include<numeric>
    #include<array>
     
    #define INF 1e9
    #define rep(i,n)for(int i=0;(i)<(int)(n);i++)
    #define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
    #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
    #define vec(type,n) vector<type>(n)
    #define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
    #define ALL(a)  (a).begin(),(a).end()
    #define chmin(a, b) a = min(a, b)
    #define chmax(a, b) a = max(a, b)
    #define Vl vector<ll>
     
    using namespace std;
    using ll = long long;
    using Graph = vector<vector<int>>;
    using P = pair<ll, ll>;
     
const ll MOD = 1e9 + 7;
const ll ZER = 0;


//Osa_k法
vector<ll> sieve(ll n){
    vector<ll> res(n);
    iota(ALL(res), 0);
    for(int i = 2; i * i < n; i++){
        if(res[i] < i)continue;
        for(int j = i * i; j < n; j += i){
            if(res[j] == j)res[j] = i;
        }
    }
    return res;
}

vector<ll> factor(ll n, const vector<ll> & min_factor){
    //min_factorはsieve()で得られたもの
    vector<ll> res;
    while(n > 1){
        res.push_back(min_factor[n]);
        n /= min_factor[n];
    }
    return res;
}

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

int main(){
   int n;
   cin >> n;
   vector<ll> a(n);
   rep(i, n)cin >> a[i];

   ll GCD = a[0];
   rep(i, n){
       GCD = gcd(GCD, a[i]);
   }

   if(GCD != 1){
       cout << "not coprime" << endl;
       return 0;
   }

   auto mf = sieve(1000000);
   
   vector<ll> r;
   map<ll, ll> mp;
   rep(i, n){
       auto r = factor(a[i], mf);
       r.erase(unique(ALL(r)), r.end());
       int rs = r.size();
       rep(i, rs){
           mp[r[i]]++;

           if(mp[r[i]] > 1){
               cout << "setwise coprime" << endl;
               return 0;
           }
       }
   }
   cout << "pairwise coprime" << endl;
}


Measured memory_bytes: 18748
#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}
int dx[4]={0,1,-1,0};
int dy[4]={1,0,0,-1};
long double eps = 1e-9;
long double pi = acos(-1);


signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    int n;
    cin>>n;
    int used[n];
    for(int i=0;i<n;i++)used[i] = 1e9;
    queue<array<int,2>> q;
    q.push({1,1});
    int ans = 1e9;
    while(q.size()){
        int now = q.front()[0], cost = q.front()[1];
        q.pop();
        if(used[now] <= cost)continue;
        used[now] = cost;
        if(now == 0){
            chmin(ans,cost);
        }
        if(used[(now+1)%n] > cost+1)q.push({(now+1)%n,cost+1});
        if(used[(now*10)%n] > cost)q.push({now*10%n,cost});
    }
    cout << ans << endl;

}


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


int main(void){
	int a,b;
	int add,sub,mal;

	scanf("%d %d",&a,&b);

	add = a + b;
	sub = a - b;
	mal = a * b;

	if(add > sub){
		if(add > mal){
			printf("%d\n",add);

		}
		else{
			printf("%d\n",mal);

		}
	}
	else{
		if(sub > mal){
			printf("%d\n",sub);
		}
		else{
			printf("%d\n",mal);

		}
	}




	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using lint = long long;

signed main(){
  string s; cin >> s;
  lint N = s.size();
  lint ans = 0;
  for(lint i = 1; i < N; i++){
    if(s[i] != s[i - 1]) ans++;
  }
  cout << ans << endl;
}

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

#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl
#define rep(i, n) for (int i = (int)(0); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define dump(v)                  \
    cerr << #v ":[ ";            \
    for (auto macro_vi : v) {    \
        cerr << macro_vi << " "; \
    }                            \
    cerr << "]" << endl;
#define ddump(v)                           \
    cerr << #v ":" << endl;                \
    for (auto macro_row : v) {             \
        cerr << "[";                       \
        for (auto macro__vi : macro_row) { \
            cerr << macro__vi << " ";      \
        }                                  \
        cerr << "]" << endl;               \
    }
using lint       = long long;
const int INF    = 1e9;
const lint LINF  = 1e18;
const double EPS = 1e-10;

int main() {
    string X;
    lint N, K;
    cin >> X >> K;
    N = X.size();

    vector<vector<vector<lint>>> cnt(
        N + 1, vector<vector<lint>>(2, vector<lint>(5, 0)));
    cnt[0][false][0] = 1;

    rep(i, N) rep(le, 2) rep(k, 5) {
        int a = int(X[i] - '0');
        for (int x = 0; x <= (le ? 9 : a); x++) {
            cnt[i + 1][le || (x < a)][min(4, k + (x != 0 ? 1 : 0))] +=
                cnt[i][le][k];
        }
    }

    cout << cnt[N][0][K] + cnt[N][1][K] << endl;
    return 0;
}

Measured memory_bytes: 3660
#include<bits/stdc++.h> 
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp> 
#define mod 1000000007
#define mod2 998244353
#define int long long
#define endl "\n"
#define p_b push_back
#define fastIO ios_base::sync_with_stdio(false),cin.tie(NULL)
using namespace std;
using namespace __gnu_pbds;
template <class T> 
using _ost = tree<
		T, 
		null_type, 
		less<T>, 
		rb_tree_tag, 
        tree_order_statistics_node_update>;
// char alphabet[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
void swap(int* a,int* b){
    int temp = *a;
    *a=*b;
    *b=temp;
}	
int32_t main(){
 	fastIO;
 	string s;cin>>s;
 	if(s[2]==s[3]&&s[4]==s[5])cout<<"Yes"<<endl;
 	else cout<<"No"<<endl;
} 	

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

#ifdef SG
	#include <debug.h>
#else
	template<typename T> struct outputer;
	struct outputable {};
	#define PRINT(...)
	#define OUTPUT(...)
	#define show(...)
	#define debug(...)
	#define deepen(...)
	#define timer(...)
	#define fbegin(...)
	#define fend
	#define pbegin(...)
	#define pend
#endif

#define ARG4(_1,_2,_3,_4,...) _4

#define forn3(i,l,r) for (int i = int(l); i < int(r); ++i)
#define forn2(i,n) forn3 (i, 0, n)
#define forn(...) ARG4(__VA_ARGS__, forn3, forn2) (__VA_ARGS__)

#define ford3(i,l,r) for (int i = int(r) - 1; i >= int(l); --i)
#define ford2(i,n) ford3 (i, 0, n)
#define ford(...) ARG4(__VA_ARGS__, ford3, ford2) (__VA_ARGS__)

#define ve vector
#define pa pair
#define tu tuple
#define mp make_pair
#define mt make_tuple
#define pb emplace_back
#define fs first
#define sc second
#define all(a) (a).begin(), (a).end()
#define sz(a) ((int)(a).size())

typedef long double ld;
typedef int64_t ll;
typedef uint64_t ull;
typedef uint32_t ui;
typedef uint16_t us;
typedef uint8_t uc;
typedef pa<int, int> pii;
typedef pa<int, ll> pil;
typedef pa<ll, int> pli;
typedef pa<ll, ll> pll;
typedef ve<int> vi;

template<typename T> inline auto sqr (T x) -> decltype(x * x) {return x * x;}
template<typename T1, typename T2> inline bool umx (T1& a, T2 b) {if (a < b) {a = b; return 1;} return 0;}
template<typename T1, typename T2> inline bool umn (T1& a, T2 b) {if (b < a) {a = b; return 1;} return 0;}

const int N = 100000;
const int M = 100000;

struct Input {
	int n, m;
	int x[M], y[M];
	
	bool read () {
		if (!(cin >> n >> m)) {
			return 0;
		}
		forn (i, m) {
			scanf("%d%d", &x[i], &y[i]);
			--x[i];
			--y[i];
		}
		return 1;
	}

	void init (const Input &input) {
		*this = input;
	}
};

struct Data: Input {
	bool ans;
	
	void write () {
		puts(ans ? "YES" : "NO");
	}
};


namespace Main {
	
	struct Solution: Data {
		int cnt[N];
		
		void solve () {
			memset(cnt, 0, sizeof cnt);
			forn (i, m) {
				cnt[x[i]] ^= 1;
				cnt[y[i]] ^= 1;
			}
			forn (i, n) {
				if (cnt[i]) {
					ans = 0;
					return;
				}
			}
			ans = 1;
		}
		
		void clear () {
			*this = Solution();
		}
	};
}


Main::Solution sol;

int main () {
	cout.setf(ios::showpoint | ios::fixed);
	cout.precision(20);

	#ifdef SG
		freopen((problemname + ".in").c_str(), "r", stdin);
//		freopen((problemname + ".out").c_str(), "w", stdout);
		while (sol.read()) {
			sol.solve();
			sol.write();
			sol.clear();
		}
	#else
		sol.read();
		sol.solve();
		sol.write();
	#endif
	
	/*
	int t;
	cin >> t;
	forn (i, t) {
		sol.read();
		sol.solve();
		sol.write();
		sol.clear();
	}
	*/
	
	return 0;
}


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

int main(){
    int n, t=1, a,b;
    cin >> n;
    VI p(n), q(n);

    VI per(n);
    rep(i,n)per[i] = i+1;
    rep(i,n)cin >> p[i];
    rep(i,n)cin >> q[i];

    do{
        int key1=0, key2 = 0;
        rep(i,n){
            if(per[i] != p[i])key1 = 1;
            if(per[i] != q[i])key2 = 1;
        }
        if(key1 == 0)a = t;
        if(key2 == 0)b = t; 
        ++t;
    }while (next_permutation(per.begin(), per.end()));

    cout << abs(a-b) << endl;
}

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

using namespace std;

#define pb push_back
#define mp make_pair
#define x first
#define y second

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;

template <class T>
void read(T &x)
{
	char ch;
	for (ch=getchar();(ch<'0'||ch>'9')&&ch!='-';) ch=getchar();
	x=0;int t=1;if (ch=='-') {ch=getchar();t=-1;}
	for (;ch>='0'&&ch<='9';ch=getchar()) x=x*10+ch-'0';
	x*=t;
}

const double pi=acos(-1.0);

struct node
{
	int x,y;
	bool operator <(const node &a)const {return x<a.x;}
}a[200010],b[200010];

int c[200010];

int main()
{
	int x1,y1,x2,y2;scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
	int n;scanf("%d",&n);
	for (int i=0;i<n;i++) scanf("%d%d",&a[i].x,&a[i].y);
	int m=0;
	for (int i=0;i<n;i++) if (abs(x1-x2)==abs(x1-a[i].x)+abs(x2-a[i].x)&&abs(y1-y2)==abs(y1-a[i].y)+abs(y2-a[i].y)) b[++m]=a[i];
	if (m==0) {printf("%.11lf\n",100.0*(abs(x1-x2)+abs(y1-y2)));return 0;}
	if (x1<x2&&y1>y2||x1>x2&&y1<y2) for (int i=1;i<=m;i++) b[i].y=-b[i].y;
	sort(b+1,b+m+1);int ans=0;
	for (int i=1;i<=m;i++)
	{
		int l=1,r=ans;
		while (l<=r)
		{
			int mid=(l+r)>>1;
			if (b[i].y<c[mid]) r=mid-1; else l=mid+1;
		}
		if (l>ans) ans++;c[l]=b[i].y;
	}
	printf("%.11lf\n",100.0*(abs(x1-x2)+abs(y1-y2))-(20-5*pi)*ans+5*pi*(ans>min(abs(x1-x2),abs(y1-y2))));
	return 0;
}



Measured memory_bytes: 4096
# 最大で1009まで見れば良いアプローチ

A, B = map(int, input().split())

ans = -1
for i in range(1010):
    # i は元の金額
    # そこから 8% と 10% を求めた時に等しくなれば終了
    if i*8//100 == A and i//10 == B:
        ans = i
        break

print(ans)


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

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

int main() {
	ios::sync_with_stdio(false);
	
	int n;
	int sa, sb, a, b;
	while(1) {
		cin >> n;
		if(!n)break;
		sa = 0;
		sb = 0;
		rep(i, n) {
			cin >> a >> b;
			if(a>b) sa += a+b;
			else if(b>a) sb += a+b;
			else {
				sa += a;
				sb += b;
			}
		}
		cout << sa << " " << sb << endl;
	}	
	return 0;
}

Measured memory_bytes: 1196
#include <bits/stdc++.h>
#include <unistd.h>
using namespace std;
using ll = long long;

void dfs(vector<ll> &cnt, vector<vector<ll>> &g, unordered_map<ll, ll> &m, ll x = 0, ll now = 1, ll parent = -1) {
  if (m.count(now)) x += m[now];
  cnt[now] = x;
  for (ll next : g[now]) {
    if (next == parent) continue;
    dfs(cnt, g, m, x, next, now);
  }
}

int main() {
  ll n, q, a, b, p, x;
  cin >> n >> q;

  vector<ll> cnt(n + 1, 0);
  vector<vector<ll>> g(n + 1);

  for (ll i = 0; i < n - 1; i++) {
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }

  unordered_map<ll, ll> m;
  for (ll i = 0; i < q; i++) {
    cin >> p >> x;
    if (m.count(p) == 0) m[p] = 0;
    m[p] += x;
  }

  dfs(cnt, g, m);

  for (ll i = 1; i < n + 1; i++) {
    cout << cnt[i] << " ";
  }
  cout << endl;
}


Measured memory_bytes: 38600
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0 ; i < n ; i++ )
 
int main(){
  int A,B,C;
  cin >> A >> B >> C;
  int ans = A+B;
  ans = min(ans,A+C);
  ans = min(ans,B+C);
  cout << ans << endl;
}

    
  

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



void __print(int x) {cerr << x;}; void __print(long x) {cerr << x;}; void __print(long long x) {cerr << x;}; void __print(unsigned x) {cerr << x;}; void __print(unsigned long x) {cerr << x;}; void __print(unsigned long long x) {cerr << x;}; void __print(float x) {cerr << x;}; void __print(double x) {cerr << x;}; void __print(long double x) {cerr << x;}; void __print(char x) {cerr << '\'' << x << '\'';}; void __print(const char *x) {cerr << '\"' << x << '\"';}; void __print(const string &x) {cerr << '\"' << x << '\"';}; void __print(bool x) {cerr << (x ? "true" : "false");}


template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}


#ifndef ONLINE_JUDGE
#define dbg(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif


#define int                                         long long
#define setbits(x)                                     __builtin_popcountll(x)
#define zerobits(x)                                 __builtin_ctzll(x)
#define mod                                         1000000007
#define inf                                            1e18
#define endl                                        '\n'
#define pb                                          push_back
#define all(x)                                      x.begin(),x.end()
#define ff                                          first
#define ss                                          second
#define rep(i,n)                                      for(int i = 0; i < n; i++)
#define set(n)                                      fixed << setprecision(n)

int powmod(int a, int b) {int res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) {if (b & 1)res = res * a % mod; a = a * a % mod;} return res;}
int fast_pow(int a, int b) {if (b == 1) return a; if (b == 0) return 1; int x = fast_pow(a, b / 2); x *= x; if (b & 1) x *= a; return x;}

void t_c_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    /*#ifndef ONLINE_JUDGE
        freopen("inp.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif*/
    int n, x, c; cin >> n >> x >> c;
    if (n < x) {
        cout << c << endl;
    }
    else {
        int k = (n / x);
        int kk = n % x;
        if (kk) {
            cout << (k + 1)*c << endl;
        }
        else {
            cout << k*c << endl;
        }
    }
}

int32_t main()
{
    t_c_c();
    return 0;
}


Measured memory_bytes: 3652
#include <cstdio>
#include <cmath>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <map>
#include <set>
#include <array>
#include <queue>
#include <string>
#include <vector>
#include <numeric>
#include <algorithm>
#include <functional>
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef unsigned long long int LL;
typedef std::pair<int, int> P;

LL N, A, B;
LL v[114514];
std::map<LL, LL>tmp;
long double avg_ans;
LL how_ans;

void comb(std::vector<std::vector <LL> > &v) {
	for (LL i = 0; i <v.size(); i++) {
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (LL k = 1; k <v.size(); k++) {
		for (LL j = 1; j<k; j++) {
			v[k][j] = (v[k - 1][j - 1] + v[k - 1][j]);
		}
	}
}

int main()
{
	in >> N >> A >> B;
	rep(i, N) { in >> v[i]; }

	std::sort(v, v + N, std::greater<LL>());
	std::vector<std::vector<LL> > aaa(100 + 1, std::vector<LL>(100 + 1, 0));
	comb(aaa);
	rep(i, N)
	{
		++tmp[v[i]];
	}
	for (LL num = A; num <= B; ++num)
	{
		LL sum = 0;
		std::map<LL, LL>list;
		for (int i = 0; i < num; ++i)
		{
			sum += v[i];
			++list[v[i]];
		}
		if (avg_ans < (long double)sum / (long double)num)
		{
			avg_ans = (long double)sum / (long double)num;
			how_ans = 1;
			// tmp[list[i].first] C list[i].second
			for (auto x : list)
			{
				how_ans *= aaa[tmp[x.first]][x.second];
			}
		}
		else if (avg_ans == (long double)sum / (long double)num)
		{
			LL res = 1;
			// tmp[list[i].first] C list[i].second
			for (auto x : list)
			{
				res *= aaa[tmp[x.first]][x.second];
			}
			how_ans += res;
		}
	}

	out << std::fixed << std::setprecision(114514);
	out << avg_ans << std::endl << how_ans << std::endl;
	return 0;
}

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

int main() {
    int n;
    cin >> n;
    vector<long> h(n);
    string ans = "Yes";

    for (int i = 0; i < n; i++) {
        cin >> h.at(i);
    }
    for (int i = n - 1; i > 0; i--) {
        if (h.at(i-1) > h.at(i)) h.at(i-1)--;
    }
    for (int i = 0; i < n-1; i++) {
        if (h.at(i) > h.at(i+1)) {
            ans = "No";
            break;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<set>
#include<cstdio>
using namespace std;

int N, a[200000], idx[200001];


int main(){
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> a[i];
        idx[a[i]] = i;
    }
    set<int> st;
    st.insert(-1);
    st.insert(N);
    long long ans = 0;
    for(int i = 1; i <= N; i++){
        int j = idx[i];
        set<int>::iterator itr = st.upper_bound(j);
        int r = *itr;
        int l = *(--itr);
        ans += (long long)i * (r-j) * (j-l);
        st.insert(j);
    }
    cout << ans << endl;

}

Measured memory_bytes: 11136
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;

int main() {
    int n,res=1;cin>>n;
    vector<int> vec(n);rep(i,n)cin>>vec.at(i);
    sort(all(vec));
    rep(i,vec.size()-1) if(vec.at(i)<vec.at(i+1)) res++;
    cout<<res<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
long long X, Y, Z, K, A[1010], B[1010], C[1010];

vector<long long int> v;
 
int main() {
	cin >> X >> Y >> Z >> K;
	for (int i = 0; i < X; i++) 
      cin >> A[i]; 
  
  sort(A, A + X, greater<long long>());
	for (int i = 0; i < Y; i++) 
      cin >> B[i]; 
  
  sort(B, B + Y, greater<long long>());
	for (int i = 0; i < Z; i++) 
      cin >> C[i]; 
  
  sort(C, C + Z, greater<long long>());
	
	for (int i = 0; i < X; i++) {
		for (int j = 0; j < Y; j++) {
			for (int k = 0; k < Z; k++) {
				if ((i + 1) * (j + 1) * (k + 1) <= K) v.push_back(A[i] + B[j] + C[k]);
				else break;
			}
		}
	}
	sort(v.begin(), v.end(), greater<long long>());
  
	for (int i = 0; i < K; i++) cout << v[i] << endl;
	
}


Measured memory_bytes: 1400
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define INF (1<<30)-1
using ll = long long;
using namespace std;
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; }

int main(){
  int l,r,d; cin >> l >> r >> d;
  int ans = 0;
  for(int i = l; i <= r; i++) if(i % d == 0) ans++;
  cout << ans;
  return 0;
}


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

int main(void) {
    int N, K;
    cin >> N >> K;
    vector< int > H(N);
    for (int i = 0; i < N; i++) {
        cin >> H[i];
    }
    sort(H.begin(), H.end());
    reverse(H.begin(), H.end());
    long long round = 0;
    for (int i = K; i < N; i++) {
        round += H[i];
    }
    printf("%lld\n", round);
    return 0;
}


Measured memory_bytes: 1024
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 1000005
#define inf 1e9
#define pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

inline int read()
{
	int x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}

char s[maxn];
map <int,ll> mp;

const ll mod=2019;

int main()
{
	scanf("%s",s+1); int len=strlen(s+1);
	ll ans=0,nw=0,b=1; mp[0]=1;
	for(int i=len;i>=1;i--)
	{
		nw=((s[i]-'0')*b+nw)%mod; b=(b*10)%mod;
		ans+=mp[nw]; mp[nw]++;
		//cout<<ans<<endl;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3924
using System;
using System.Collections.Generic;

namespace ConsoleApp1
{
    public class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();

            if (a < 3200)
            {
                Console.WriteLine("red");
                return;
            }

            Console.WriteLine(s);
        }



    }
}


Measured memory_bytes: 13140
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>

using namespace std;

const int MOD = 1000000007;

int solve(const vector<int>& w, int W){
    if(w.back() > W || w.size() == 1) return 1;
    int sum = accumulate(w.begin(), w.end(), 0);
    if(sum <= W) return 1;
    vector<int> dp(W+1, 0);
    dp[0] = 1;
    int res = 0;
    for(int i=0;i<w.size();i++){
        for(int j=W-w[i];j>=0;j--){
            dp[j+w[i]] += dp[j];
            dp[j+w[i]] %= MOD;
        }
        sum -= w[i];
        for(int j=max(0, W-sum-w[i]+1);j<=W-sum-(i==w.size()-1?0:w[i+1]);j++){
            res = (res + dp[j]) % MOD;
        }
    }
    return res;
}

int main(){
    int N, W;
    while(cin >> N >> W){
        vector<int> w(N);
        for(auto& t : w) cin >> t;
        sort(w.rbegin(), w.rend());
        cout << solve(w, W) << endl;
    }
}


Measured memory_bytes: 3148
import java.util.Scanner;

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

      long a = sc.nextInt();
      long b = sc.nextInt();
      long c = sc.nextInt();
      long x = sc.nextInt();
      long y = sc.nextInt();

      long ans_1 = 0L;
      long ans_2 = 0L;
      long tmp_1 = 0L;
      long tmp_2 = 0L;

      ans_1 = a*x + b*y;

      if(a < b) {
        ans_2 += c*y*2;
        if(x >= y) {
          ans_2 += (x-y)*a;
        }
      } else if (b > a) {
        ans_2 += c*x*2;
        if(y >= x) {
          ans_2 += (y-x)*b;
        }
      } else {
        tmp_1 += c*y*2;
        if(x > y) {
          tmp_1 += (x-y)*a;
        }
        tmp_2 += c*x*2;
        if(y > x) {
          tmp_2 += (y-x)*b;
        }
        ans_2 = Math.min(tmp_2,tmp_1);
      }

      System.out.println(Math.min(ans_1,ans_2));
  }
}

Measured memory_bytes: 21716
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
using namespace std;
typedef long long ll;

int main() {
  ll n;
  cin >> n;
  
  map<string, ll> mp;

  for(ll i = 0; i < n; i++){
    string s;
    cin >> s;
    sort(all(s));
    mp[s]++;
  }
  
  ll ans = 0;
  
  for(auto i: mp){
    ans += (i.second) * (i.second - 1) / 2;
  }
  
  cout << ans << endl;

}



Measured memory_bytes: 11136
using System;
using System.Collections.Generic;
using System.Linq;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = ReadInt();
            var h = ReadArrayInt();
            var ans = 0;
            if (h.Min() != 0)
            {
                ans = h.Min();
                h = h.Select(i => i - ans).ToArray();
            }
            while (true)
            {
                var start = -1;
                var end = -1;
                var min = int.MaxValue;
                for (int i = 0; i < N; i++)
                {
                    if (h[i] != 0)
                    {
                        start = i;
                        end = i;
                        min = h[i];
                        break;
                    }
                }
                if (start == -1) break;
                for (int i = start + 1; i < N; i++)
                {
                    if (h[i] == 0) break;
                    else
                    {
                        end = i;
                        if (h[i] < min) min = h[i];
                    }
                }
                ans += min;
                for (int i = start; i <= end; i++)
                {
                    h[i] -= min;
                }
            }

            Console.WriteLine(ans);
            Console.ReadLine();
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}

Measured memory_bytes: 13396
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        while(sc.hasNextDouble()){
            double n = sc.nextDouble();
            if(n <= 48.0){
                System.out.println("light fly");
            }else if(n <= 51.0){
                System.out.println("fly");
            }else if(n <= 54.0){
                System.out.println("bantam");
            }else if(n <= 57.0){
                System.out.println("feather");
            }else if(n <= 60.0){
                System.out.println("light");
            }else if(n <= 64.0){
                System.out.println("light welter");
            }else if(n <= 69.0){
                System.out.println("welter");
            }else if(n <= 75.0){
                System.out.println("light middle");
            }else if(n <= 81.0){
                System.out.println("middle");
            }else if(n <= 91.0){
                System.out.println("light heavy");
            }else{
                System.out.println("heavy");
            }
        }
    }
}


Measured memory_bytes: 28028
#coding:utf-8
import sys,os
from collections import defaultdict, deque
from fractions import gcd
from math import ceil, floor
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

    X,Y,A,B,C = LMIIS()
    P = LMIIS()
    Q = LMIIS()
    R = LMIIS()
    P.sort(reverse=True)
    Q.sort(reverse=True)
    R.sort(reverse=True)
    i_p = 0
    i_q = 0
    i_r = 0

    sum_d = 0
    while i_p + i_q + i_r < X+Y:
        if i_r < len(R) and (i_p == X or P[i_p] < R[i_r]) and (i_q == Y or Q[i_q] < R[i_r]):
            sum_d += R[i_r]
            i_r += 1
        elif i_p < X:
            if i_q < Y:
                if P[i_p] < Q[i_q]:
                    sum_d += Q[i_q]
                    i_q += 1
                else:
                    sum_d += P[i_p]
                    i_p += 1
            else:
                sum_d += P[i_p]
                i_p += 1
        else:
            sum_d += Q[i_q]
            i_q += 1


        
    # while i_p < X and i_q < Y and i_r < len(R) and i_p + i_q + i_r < X+Y:
    #     if P[i_p] < R[i_r] or Q[i_q] < R[i_r]:
    #         sum_d += R[i_r]
    #         i_r += 1
    #     elif P[i_p] < Q[i_q]:
    #         sum_d += Q[i_q]
    #         i_q += 1
    #     else:
    #         sum_d += P[i_p]
    #         i_p += 1
    # while i_p < X and i_r < len(R) and i_p + i_q + i_r < X+Y:
    #     if P[i_p] < R[i_r]:
    #         sum_d += R[i_r]
    #         i_r += 1
    #     else:
    #         sum_d += P[i_p]
    #         i_p += 1
    # while i_p < X and i_p + i_q + i_r < X+Y:
    #     sum_d += P[i_p]
    #     i_p += 1
    
    # while i_q < Y and i_r < len(R) and i_p + i_q + i_r < X+Y:
    #     if Q[i_q] < R[i_r]:
    #         sum_d += R[i_r]
    #         i_r += 1
    #     else:
    #         sum_d += Q[i_q]
    #         i_q += 1
    
    # while i_q < Y and i_p + i_q + i_r < X+Y:
    #     sum_d += Q[i_q]
    #     i_q += 1

    print(sum_d)

    

if __name__ == '__main__':
    main()

Measured memory_bytes: 118164
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <climits>
using namespace std;
typedef long long int ll;

int dp[18][18];
int b[18][18];

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	while(1){
		int n,m; cin >> n >> m;
		if(n==0&&m==0)break;
		int q; cin >> q;
		for(int i=0;i<n;i++){
		    for(int j=0;j<m;j++){
		        dp[i][j]=0;
		        b[i][j]=0;
		    }
		}
		for(int i=0;i<q;i++){
			int x,y; cin >> x >> y;
			x--; y--;
			b[x][y]=1;
		}
		dp[0][0]=1;
		for(int i=0;i<n;i++){
			for(int j=0;j<m;j++){
				if(!b[i][j]){
					dp[i+1][j]+=dp[i][j];
					dp[i][j+1]+=dp[i][j];
				}
			}
		}
		cout << dp[n-1][m-1] << endl;
	}
}


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

using namespace std;

using ll = long long;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int x;
    cin >> x;
    ll ans = x / 500 * 1000;
    x %= 500;
    ans += x / 5 * 5;
    cout << ans << endl;
    return 0;
}

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

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

Measured memory_bytes: 4048
#include <bits/stdc++.h>
using namespace std;
int a,b,x;
int main () {
cin >> a>>b>>x;
if (a>x) {
	cout << "NO" << endl;
} else if ((a+b)<x) {
	cout << "NO"<<endl;
} else {
	cout <<"YES"<<endl;
}
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
#include<assert.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
const int inf = 1e17;
const int mod = 1000000007;
typedef pair<int, int> P;
typedef pair<int, P> PP;
int a[100006];
int dis[100006];
vector<int>G[100006];
int ans,n,k;

int dfs(int now,int par){
	if(dis[now]!=-1)return dis[now];
	int res=-1,p=0;
	if(G[now].size()==1&&now){
		return dis[now]=0;
		}
	for(int e:G[now]){
		if(e==par)continue;
		int k2=dfs(e,now);
		if(k2==k-1)p++;
		else res=max(res,k2);
		}
	res++;	
	if(now)ans+=p;
	//cout<<now<<' '<<res<<endl;		
	return dis[now]=res;	
}

signed main(){
	cin>>n>>k;
	rep(i,n)cin>>a[i];
	if(a[0]!=1){
		a[0]=1;ans++;
		}
	for(int i=1;i<n;i++){
		a[i]--;
		G[a[i]].push_back(i);
		G[i].push_back(a[i]);
	}
	rep(i,n)dis[i]=-1;
	
	dfs(0,-1);
	cout<<ans<<endl;	
}


Measured memory_bytes: 13568
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
const int inf = 1 << 30;
template<class T> void chmin(T& x, T y){if(x > y) x = y;}
template<class T> void chmax(T& x, T y){if(x < y) x = y;}

class BIT{
private:
    int N;
    vector<int> bit;

public:
    BIT(int n = 0){
        N = n;
        bit.resize(n + 1);
    }

    int val(int i){
        int s = 0;
        while(i <= N){
            s += bit[i];
            i += i & -i;
        }
        return s;
    }

    void add(int r, int x){
        while(r > 0){
            bit[r] += x;
            r -= r & -r;
        }
    }

    int search(int d){
        int sum = 0;
        for(int i = d; i <= N; i += d){
            sum += val(i);
        }
        return sum;
    }
};

struct seg{
    int l, d;
    bool operator < (const seg& s1) const {
        return d < s1.d;
    }
};

int N, M;

int main(){
    cin >> N >> M;
    BIT bit(M);
    vector<seg> ds;

    for(int i = 0; i < N; i++){
        int l, r;
        cin >> l >> r;
        ds.push_back(seg{l, r - l + 1});
    }

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

    int idx = 0;
    int base = N;
    for(int i = 1; i <= M; i++){
        for(; idx < N; idx++){
            seg s = ds[idx];
            if(s.d < i){
                base--;
                bit.add(s.l + s.d - 1, 1);
                bit.add(s.l - 1, -1);
            }else{
                break;
            }
        }
        cout << base + bit.search(i) << endl;
    }
    return 0;
}

Measured memory_bytes: 6512
import java.io.*;
import java.util.*;
import static java.lang.System.out;

public class Main {
    static MyReader in = new MyReader();

    public static void main(String[] args) {
        int N = in.i();

        long t1 = 1;
        long a1 = 1;
        for (int i = 0; i < N; i++) {
            long t2 = in.i();
            long a2 = in.i();
            long k = 1 + Math.max((t1 - 1) / t2, (a1 - 1) / a2);
            t1 = k * t2;
            a1 = k * a2;
        }
        out.println(t1 + a1);
    }
}

class MyReader extends BufferedReader {
    char[] cbuf = new char[1024];
    int head = 0;
    int tail = 0;

    MyReader() {
        super(new InputStreamReader(System.in));
    }

    char next() {
        if (head == tail) {
            try {
                tail = super.read(cbuf, 0, cbuf.length);
            } catch (IOException e) {
                e.printStackTrace();
            }
            head = 0;
        }
        return cbuf[head++];
    }

    void back() {
        head--;
    }

    boolean minus() {
        boolean minus;
        while (true) {
            char c = next();
            if (!isDelimiter(c)) {
                if (!(minus = c == '-')) back();
                return minus;
            }
        }
    }

    void skip() {
        while (isDelimiter(next()));
        back();
    }

    char[] s(int N) {
        char[] cbuf = new char[N];
        read(cbuf, 0, N);
        return cbuf;
    }

    public int read(char[] cbuf, int off, int len) {
        skip();
        int i;
        for (i = 0; i < cbuf.length; i++) {
            char c = next();
            if (isDelimiter(c)) {
                break;
            }
            cbuf[i] = c;
        }
        return i;
    }

    boolean isDelimiter(char c) {
        return c == ' ' || c == '\n' || c == '\r';
    }

    int i() {
        boolean minus = minus();
        int n = 0;
        while (true) {
            int k = next() - '0';
            if (k < 0 || 9 < k) break;
            n = 10 * n + k;
        }
        return minus ? -n : n;
    }

    int[] ii(final int N) {
        int[] a = new int[N];
        for (int j = 0; j < a.length; j++) a[j] = i();
        return a;
    }

    long l() {
        boolean minus = minus();
        long n = 0;
        while (true) {
            int k = next() - '0';
            if (k < 0 || 9 < k) break;
            n = 10 * n + k;
        }
        return minus ? -n : n;
    }
}


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

int main(){
	int N, M;
	cin >> N >> M;
	vector<int> A(M);
	for(int i = 0; i < M; i++) cin >> A.at(i);
	vector<long> step(N+1);
	step.at(0) = 1;
	step.at(1) = 1;
	for(int i = 2; i < N+1; i++){
		step.at(i) = step.at(i - 1) + step.at(i - 2);
		step.at(i) %= 1000000007;
	}
	long long ans = 1;
	int now = 0;
	for(int i = 0; i < M + 1; i++){
		long long tmp_ans = 0;
		int num_step;
		if(i < M) num_step = A.at(i) - 1 - now;
		else num_step = N - now;
		if(num_step < 0) tmp_ans = 0;
		else tmp_ans = step.at(num_step);
		ans *= tmp_ans;
		ans %= 1000000007;
		if(!ans) break;
		if(i < M) now = A.at(i) + 1;
		// cout << i << " " << ans << endl;
	}
	cout << ans << endl;
}


Measured memory_bytes: 1408
/* ＵＴＦ－８ */
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <array>
#include <queue>
#include <stack>
#include <algorithm>
#include <tuple>
#include <numeric>
#include <type_traits>
#include <limits>

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>

#define USE_COLORED 1

#ifdef USE_COLORED
static const char stdout_pre[]  = "\033[1m"; // bold black
static const char stderr_pre[]  = "\033[31;1m"; // bold red
static const char stdxxx_post[] = "\033[m";

// 当然ながら GCC(g++)/libstdc++ 依存
#include <ext/stdio_filebuf.h>
using stdio_filebuf = __gnu_cxx::stdio_filebuf<char>;
class colored_stdio_filebuf : public stdio_filebuf {
private:
	const char* const pre_;
	const char* const post_;

public:
	colored_stdio_filebuf(FILE* fp, const char* pre, const char* post) : stdio_filebuf(fp, std::ios_base::out), pre_(pre), post_(post)
	{
	}

protected:
	std::streamsize xsputn(const char* s, std::streamsize count) override
	{
		stdio_filebuf::xsputn(pre_, strlen(pre_));
		auto ret = stdio_filebuf::xsputn(s, count);
		stdio_filebuf::xsputn(post_, strlen(post_));
		return ret;
	}
};
#endif

int main()
{
#ifdef USE_COLORED
	if (getenv("DEBUG")) {
		std::cout.rdbuf(new colored_stdio_filebuf(stdout, stdout_pre, stdxxx_post));
		std::cerr.rdbuf(new colored_stdio_filebuf(stderr, stderr_pre, stdxxx_post));
	} else
#endif
	{
		int fd = open("/dev/null", O_WRONLY);
		dup2(fd, 2);
		close(fd);
	}
	
	int A, B;
	std::cin >> A >> B;
	if (A+B<10)
		std::cout << (A+B) << "\n";
	else
		std::cout << "error\n";
}


Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#define Cin(T, x) T x; cin >> x
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cout(x) cout << (x) << "\n"
#define Couts(xs) for(const auto &e : xs) cout << e << " "; cout << "\n"
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) find(Range(c), x) != c.end()
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Vec2(T, vs, n, m) vector<vector<T>> vs(n, vector<T>(m))
#define Sum(a) accumulate(Range(a), 0)
#define Cusum(T, n, xs, sxs) vector<T> sxs(n+1); For(i, n) sxs[i+1] = sxs[i] + xs[i]

using namespace std;
using ll = long long;

int main(void){
    Cin(int, n);
    Cin(int, d);
    Cin(int, x);
    For(i, n){
        Cin(int, a);
        x += (d+a-1)/a;
    }
    Cout(x);
}


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

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
long ans=0;


int count_753(long key,long N,int f3, int f5, int f7){
    int ans=0;
    if(key>N) return ans;

    if(f3+f5+f7==3) ans++;

    ans+=count_753((key*10+3),N,1,f5,f7);
    ans+=count_753((key*10+5),N,f3,1,f7);
    ans+=count_753((key*10+7),N,f3,f5,1);

    return ans;
}

int main(void){
    long N;
    scanf("%ld",&N);

    ans=count_753(0,N,0,0,0);

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

    return 0;
}

Measured memory_bytes: 128
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

int n, m;
int h[100100];
int a[100100], b[100100];

vector<int> G[100100];

int solve() {
    for (int i = 0; i < m; i++) {
        G[a[i]].push_back(b[i]);
        G[b[i]].push_back(a[i]);
    }

    int res = 0;
    for (int i = 0; i < n; i++) {
        bool f = true;
        for (int v : G[i]) {
            if (h[i] <= h[v]) {
                f = false;
                break;
            }
        }
        if (f)
            res++;
    }
    return res;
}

void input() {
    cin >> n >> m;
    for (int i = 0; i < n; i++) cin >> h[i];
    for (int i = 0; i < m; i++) {
        cin >> a[i] >> b[i];
        a[i]--;
        b[i]--;
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);

    input();
    cout << solve() << endl;
}


Measured memory_bytes: 9428
#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstring>
#include<cctype>
#include<cstdlib>
using namespace std;

class dice {
public:
	int face[7];
	int get;

	dice(int x[]) {
		for (int i = 1; i <= 6; i++) {
			face[i] = x[i];
		}
	}

	void makesure(dice c1,dice c2) {
		for (int i = 1; i <= 6; i++) {
			for (int j = 1; j <= 4; j++) {
				if (c2.face[1] == c1.face[1] && c2.face[2] == c1.face[2])
					if (c2.face[3] == c1.face[3] && c2.face[4] == c1.face[4])
						if (c2.face[5] == c1.face[5] && c2.face[6] == c1.face[6]) {
							cout << "Yes" << endl;
							exit(0);
						}

				c2.roll();
			}
			if (i % 2)c2.round('W');
			else c2.round('N');
		}
		cout << "No" << endl;
	}

	void roll() {
		get = face[2];
		face[2] = face[3];
		face[3] = face[5];
		face[5] = face[4];
		face[4] = get;
	}

	void round(char x) {
		switch (x) {
		case 'E':
			get = face[1];
			face[1] = face[4];
			face[4] = face[6];
			face[6] = face[3];
			face[3] = get;
			break;
		case 'W':
			get = face[1];
			face[1] = face[3];
			face[3] = face[6];
			face[6] = face[4];
			face[4] = get;
			break;
		case 'N':
			get = face[1];
			face[1] = face[2];
			face[2] = face[6];
			face[6] = face[5];
			face[5] = get;
			break;
		case 'S':
			get = face[1];
			face[1] = face[5];
			face[5] = face[6];
			face[6] = face[2];
			face[2] = get;
			break;
		}
	}
};

int main() {
	int face1[7], face2[7];

	for (int i = 1; i <= 6; i++) {
		cin >> face1[i];
	}

	for (int i = 1; i <= 6; i++) {
		cin >> face2[i];
	}

	dice dice1(face1), dice2(face2);

	dice1.makesure(dice1, dice2);

	return 0;
}

Measured memory_bytes: 1160
package main

import "fmt"

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func main() {
	var n, k int
	fmt.Scan(&n, &k)

	if k == 0 {
		fmt.Println(n * n)
		return
	}

	ans := 0
	for b := 1; b <= n; b++ {
		p, r := n/b, n%b
		ans += p * max(0, b-k)
		ans += max(0, r-k+1)
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512