akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;
constexpr ll INF = (1LL << 55);

int main(){
  int r, g, b, n;
  cin >> r >> g >> b >> n;
  int res = 0;
  for (int i = 0; i <= 3000; i++) {
    for (int j = 0; j <= 3000; j++) {
      int k = n - (i * r + j * g);
      if (k < 0) continue;
      if (k % b != 0) continue;
      res++;
    }
  }
  cout << res << endl;
  return 0;
} 

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <sstream>
#include <limits.h>
#include <stdio.h>
using namespace std;
 
int main()
{
    int n;
    cin >> n;
    /*
    int a[n];
    std::vector<int> v;
    for(int i=0; i<n; i++){
        int tmp;
        cin >> tmp;
        a[i] = tmp;
    }
    */
    int a = n;
    if(n >= 30) cout << "Yes" << endl;
    else cout << "No" << endl;
    //cout << a << endl;
    //cout << "Yes" << endl;
    //printf("%d\n", n);

    
    return 0;
}

Measured memory_bytes: 3628
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long int ll;

const ll MOD = 1000000007;

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

  int r;
  cin >> r;

  cout << 3 * r * r << endl;

  return 0;
}


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

typedef long long ll;

const ll mod = 1000000007;

int main() {
    ll N, K;
    cin >> N >> K;
    vector<ll>sum(N+1);
    
    for (int i = 0; i <= N; i++) {
        if (i == 0) {
            sum[i] = 0;
        } else {
            sum[i] = sum[i-1]+i;
        }
    }
    ll ans = 0;
    for (int i = K; i <= N; i++) {
        ans += ((sum[N]-sum[N-i])-sum[i-1]+1) % mod;
    }
    ans += 1;
    cout << ans % mod << endl;
}


Measured memory_bytes: 4844
#include<bits/stdc++.h>
using namespace std;
int n = 100000;
vector<int>adj[100000];
char colored[100000];
bool marked[100000];
int x=0;
vector<int>v;
void pathfinder(int s)
{
	marked[s]=true;
	int k = v.size()+1;
	v.push_back(s);
	if(s==n-1){
	//	for(auto x:v)
	//		cout<<x<<" ";
	//	cout<<"\n";
		return;
		
		
	}
	bool flag=false;
	for(auto x:adj[s])
	{
		if(!marked[x])
		{
			flag=true;
			pathfinder(x);
		}
	}
	if(flag==false)
	{
		v.pop_back();
		return;
	}
	if(v.size()==k)
		v.pop_back();

}

void dfs(int s, char c)
{
	colored[s]=c;
	for(auto x:adj[s])
	{
		if(colored[x]=='U'||colored[x]==c+32)
			dfs(x,c);
	}
}

int main()
{
	cin>>n;
	for(int i=1;i<n;i++)
	{
		int a,b;
		cin>>a>>b;
		a--;b--;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	for(int i=0;i<n;i++){
		colored[i]='U';
		marked[i]=false;
	}
	colored[0]='W';
	colored[n-1]='B';
	pathfinder(0);
	for(int i=1;i<v.size()-1;i++)
	{
		if(i<(v.size()+1)/2)
			colored[v[i]]='b';
		else
			colored[v[i]]='w';
	}
	dfs(0,'B');
	dfs(n-1,'W');
	int b=0,w=0;
	for(int i=0;i<n;i++)
	{
		if(colored[i]=='W')
			w++;
		else
			b++;
	}
	if(b>w)
		cout<<"Fennec"<<"\n";
	else
		cout<<"Snuke"<<"\n";
}


Measured memory_bytes: 15628
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<algorithm>

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c) c.begin(), c.end()
#define MOD 1000000007
#define MAX 1000000001
#define INF 1410065408
 
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
struct edge{int from, to; ll cost;};

signed main(){
	int n, tmp;
	cin >> n;
	map<int, int> mp;
	rep(n){
		cin >> tmp;
		mp[tmp]++;
	}
	
	int sum_surplus = 0;
	for(auto itr=mp.begin(); itr!=mp.end(); itr++){
		sum_surplus += itr->second - 1;
	}
	if(sum_surplus % 2 == 1){
		sum_surplus++;
	}
	cout << n - sum_surplus;
}

Measured memory_bytes: 4992
let input = readLine()!
    .split(separator: " ")
    .compactMap { Int($0)! }

let a = input[0]
let b = input[1]
let c = input[2]
let d = input[3]

let result = [
    a * c,
    a * d,
    b * c,
    b * d,
].max()!
print(result)


Measured memory_bytes: 8256
#include <stdio.h>

int main(void)
{
  int num_of_codes;
  int num_of_characters;
  int bias;
  scanf("%d%d%d",
    &num_of_codes, &num_of_characters, &bias);

  int character;
  int weights[num_of_characters];

  int i, j;
  int sum;
  int answer = 0;
  for(i = 0; i < num_of_characters; i++)
    {
      scanf("%d", &weights[i]);
    }
  for(i = 0; i < num_of_codes; i++)
    {
      sum = 0;
      for(j = 0; j < num_of_characters; j++)
        {
          scanf("%d", &character);
          sum += weights[j] * character;
        }

      if(sum + bias > 0)
        answer++;
    }
  printf("%d\n", answer);
  return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long; 
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
//constexpr long long MOD = 998244353LL;
template<class T, class U> inline bool chmax(T &a, U b) { if (a < b) { a = b; return true;} return false; }
template<class T, class U> inline bool chmin(T &a, U b) { if (a > b) { a = b; return true;} return false; }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    
    int a,b; cin >> a >> b;
    int ans = 0;
    
    if(a > 9 || b > 9) ans = -1;
    else ans = a*b;
    
    cout << ans << ln;
    return 0;
}

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

using namespace std;

#define pb push_back
#define pp pop_back
#define F first
#define S second
#define endl "\n"

typedef long long ll;
typedef long double ld;

void INeedIt() {
	ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}  
int a[100005];
map <int, int> m;        
int main () {
	INeedIt();
	int n, k, q;
	cin>>n>>k>>q;
	for (int i=1;i<=q;i++) {
		cin>>a[i];
		m[a[i]]++;
	}
	for (int i=1;i<=n;i++) {
		if (k - (q - m[i])<=0) {
			cout<<"No"<<endl;
		}
		else cout<<"Yes"<<endl;
	}
	return 0;
}
 

Measured memory_bytes: 5760
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();

int main() {
    int n; cin >> n;
    vector<int> ABC(3, 0);
    for(int& val: ABC)
        cin >> val;
    vector<int> arr(n, 0);
    for(int& val: arr)
        cin >> val;
    int cost = INT_MAX;
    for(int state = 0; state < (1 << (n*2)); state++) {
        vector<int> bin(4, 0);
        vector<int> cnt(4, 0);
        int num = state;
        for(int i = 0; i < n; i++) {
            int idx = num % 4;
            if (idx != 3) {
                bin[idx] += arr[i];
                cnt[idx] += 1;
            }
            num /= 4;
        }
        if (cnt[0] != 0 && cnt[1] != 0 && cnt[2] != 0) {
            int tmp = (cnt[0]+cnt[1]+cnt[2]-3) * 10;
            for(int i = 0; i < 3; i++)
                tmp += abs(bin[i]-ABC[i]);
            cost = min(cost, tmp);
        }
    }
    cout << cost << endl;
    return 0;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int,int> II;
typedef tuple<int,int,int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');
// debug cerr
template<class Iter> void __kumaerrc(Iter begin, Iter end) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; }
void __kumaerr(istream_iterator<string> it) { (void)it; cerr<<endl; }
template<typename T, typename... Args> void __kumaerr(istream_iterator<string> it, T a, Args... args) { cerr<<*it<<"="<<a<<", ",__kumaerr(++it, args...); }
template<typename S, typename T> std::ostream& operator<<(std::ostream& _os, const std::pair<S,T>& _p) { return _os<<"{"<<_p.first<<','<<_p.second<<"}"; }
#define __KUMATRACE__ true
#ifdef __KUMATRACE__
#define dump(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); __kumaerr(_it, args); }
#define dumpc(ar) { cerr<<#ar<<": "; FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
#define dumpC(beg,end) { cerr<<"~"<<#end<<": "; __kumaerrc(beg,end); }
#else
#define dump(args...)
#define dumpc(ar)
#define dumpC(beg,end)
#endif

// $ cp-batch Teleporter | diff Teleporter.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address Teleporter.cpp && ./a.out

/*
 
 5/10/2020
 
 5:12-
 
 */

const int MAX_N=1e6+1;
int A[MAX_N];
int N;
LL K;

int nex[MAX_N][64];
void solve() {
  REP(i,N) nex[i][0]=A[i];
  REP(x,63)REP(i,N) nex[i][x+1]=nex[nex[i][x]][x];
  
  int res=0;
  REP(i,61)if((K>>i)&1) res=nex[res][i];
  cout<<res+1<<endl;
}

void solve_wrong() {
  int i=0,step=0;
  VI viz(N,-1);
  while(viz[i]==-1) {
    viz[i]=step;
    i=A[i],++step;
    dump(i,step);
  }
  LL c=step-viz[i];
  LL rem=(K-viz[i])%c;
  dump(K,c,rem);
  
  while(rem--) i=A[i];
  cout<<i+1<<endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<setprecision(12)<<fixed;
  
  cin>>N>>K;
  REP(i,N) cin>>A[i],A[i]--;
  solve();
  
  return 0;
}


Measured memory_bytes: 54452
N = gets.to_i
a = gets.strip.split.map(&:to_i)
answer = 0

if a.any?{|x| 1 <= x && x <= 399}

    answer += 1

end

if a.any?{|x| 400 <= x && x <= 799}

    answer += 1

end

if a.any?{|x| 800 <= x && x <= 1199}

    answer += 1

end

if a.any?{|x| 1200 <= x && x <= 1599}

    answer += 1

end

if a.any?{|x| 1600 <= x && x <= 1999}

    answer += 1

end

if a.any?{|x| 2000 <= x && x <= 2399}

    answer += 1

end

if a.any?{|x| 2400 <= x && x <= 2799}

    answer += 1

end

if a.any?{|x| 2800 <= x && x <= 3199}

    answer += 1

end

if a.any?{|x| 3200 <= x} 

    if answer == 0

        puts "#{1} #{a.select{|x| 3200 <= x}.size}"

    elsif 1 <= answer && answer <= 7

        puts "#{answer} #{answer+a.select{|x| 3200 <= x}.size}"

    elsif answer == 8

        puts "#{8} #{8+a.select{|x| 3200 <= x}.size}"

    end

else

    puts "#{answer} #{answer}"

end


    

Measured memory_bytes: 1788
#include <cstdio>
#include <iostream>
using namespace std;
long long gcd(long long x, long long y) {
    if (x % y == 0) {
        return y;
    }
    return gcd(y, x % y);
}
long long cnt(long long a, long long b, long long x) {
    long long start = a / x;
    if (a % x != 0) {
        ++start;
    }
    long long end = b / x;
    return end - start + 1;
}
int main() {
    long long a, b, c, d;
    while (cin >> a >> b >> c >> d) {
        long long l = c / gcd(c, d) * d;
        printf("%lld\n", b - a + 1 - (cnt(a, b, c) + cnt(a, b, d) - cnt(a, b, l)));
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define bFOR(i,n1,n2) for(ll i=n1;i>=n2;i--)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<ll,ll> Pi;
typedef tuple<ll,ll,ll> Tu;
const int INF=(ll)(1LL<<30)-1;
const double INFd=100000000000.0;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
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;}
int dx[4]={0,-1,0,1},dy[4]={-1,0,1,0};
int mdx[8]={0,1,0,-1,1,1,-1,-1},mdy[8]={-1,0,1,0,1,-1,1,-1};


template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int n,q;
string s;
char t[200100],d[200100];
int ans=0;
int main(){
	cin>>n>>q;
	cin>>s;
	REP(i,q)cin>>t[i]>>d[i];
	int lb=-1,ub=n;
	while(ub-lb>1){
		int flag=0;
		int mid=(lb+ub)/2;
		int now=mid;
		for(int i=0;i<q;i++){
			if(t[i]==s[now]){
				if(d[i]=='L'){
					now--;
				}else{
					now++;
				}
			}
			if(now==-1){
				flag=1;
				break;
			}
			if(now==n){
				break;
			}
		}
		if(flag){
			lb=mid;
		}else{
			ub=mid;
		}
	}
	ans+=lb+1;
	lb=-1,ub=n;
	while(ub-lb>1){
		int flag=0;
		int mid=(lb+ub)/2;
		int now=mid;
		for(int i=0;i<q;i++){
			if(t[i]==s[now]){
				if(d[i]=='L'){
					now--;
				}else{
					now++;
				}
			}
			if(now==n){
				flag=1;
				break;
			}
			if(now==-1){
				break;
			}
		}
		if(flag){
			ub=mid;
		}else{
			lb=mid;
		}
	}
	//cout<<ub;
	ans+=(n-ub);
	cout<<n-ans<<endl;
	return 0;
}

Measured memory_bytes: 900
// スタックサイズ: 100MB

#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
#include <queue>
#include <list>
#include <set>
using namespace std;

typedef int64_t ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
const ll INF = 1e18;
const double EPS = 1e-10;
#define fastio  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define fori(i, a, b) for (ll i = (a); i < (b); ++i)
#define ford(i, a, b) for (ll i = (b - 1); (a) <= i; --i)
#define rep(i, n) fori(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define fst first
#define snd second
ll pw(ll x, ll y) { ll r = 1;  rep(i, y) { r *= x; }; return r; }



int main() {
	fastio;

	ll r, g;
	cin >> r >> g;
	cout << r + (g - r) * 2 << endl;
}

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

int main() {
    int h,w,k; cin >> h >> w >> k;
    vector<string> s(h);
    for (int i = 0; i < h; i++) cin >> s[i];

    int answer = h + w;
    for (int mask = 0; mask < (1 << (h - 1)); mask++) {
        int block = __builtin_popcount(mask) + 1;
        int cut = block - 1;
        vector<int> count(block, 0);
        for (int i = 0; i < w; i++) {
            int block_num = 0;
            vector<int> count_new(block, 0);
            for (int j = 0; j < h; j++) {
                count_new[block_num] += s[j][i] - '0';
                block_num += mask >> j & 1;
            }
            bool possible = true;
            for (int j = 0; j < block; j++) {
                if (count_new[j] > k) {
                    possible = false;
                    break;
                }
            }
            if (!possible) {
                cut = h + w;
                break;
            }
            bool pass = true;
            for (int j = 0; j < block; j++) {
                if (count[j] + count_new[j] > k) {
                    pass = false;
                    break;
                }
            }
            if (pass) {
                for (int j = 0; j < block; j++)
                    count[j] += count_new[j];
            } else {
                if (i == 0) {
                    cut = h + w;
                    break;
                }
                count = count_new;
                cut += 1;
            }
        }
        answer = min(answer, cut);
    }
    cout << answer << endl;
    return 0;
}


Measured memory_bytes: 256
import sys
import numpy as np

stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split())) # applies to only numbers
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces
sys.setrecursionlimit(10 ** 7)

N, L = rl()
A = np.array(rl())
couple = A[:-1] + A[1:]
if couple.max() < L:
    print('Impossible')
    exit()
print('Possible')
index = np.nonzero(couple>=L)[0][0] + 1
for i in range(1, N):
    if i == index:
        break
    print(i)
for i in range(N-1, 0, -1):
    if i == index:
        break
    print(i)

print(index)
# 43


Measured memory_bytes: 23128
n = int(input())
h = list(map(int, input().split()))

max_jump = 0
tmp_jump = 0
for i in range(n - 1):
    if h[i] >= h[i + 1]:
        tmp_jump += 1
        max_jump = max(max_jump, tmp_jump)
    else:
        tmp_jump = 0

print(max_jump)

Measured memory_bytes: 20440
#include<stdio.h>
int main()
{
	long long f[100],i,t;
   while(scanf("%lld",&t)!=EOF)
   {
   	f[0]=2;f[1]=1;
   	for(i=2;i<=t;i++)
   	{
	  f[i]=f[i-1]+f[i-2]; 	
	   }
	   printf("%lld\n",f[t]);
   }
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
namespace mp = boost::multiprecision;

using ll =  long long;
using P = pair<mp::cpp_int, ll>;

constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

ll a, b, c, d, n;

P f(mp::cpp_int prev_cost, ll prev_n,  ll base, bool increase) {
    ll next_n; mp::cpp_int cost;
    if(increase) {
        next_n = (prev_n + base - 1) / base;
        cost = prev_cost + mp::cpp_int(next_n * base - prev_n) * d;
    } else {
        next_n = prev_n / base;
        cost = prev_cost + mp::cpp_int(prev_n - next_n * base) * d;
    }
    if(next_n) cost += ((base==2)?a:((base==3)?b:c));
    return { cost, next_n };
}

void solve() {
    cin >> n >> a >> b >> c >> d;
    
    map<ll, mp::cpp_int> mp;
    mp[n] = 0;
    mp[0] = mp::cpp_int(d) * n;
    priority_queue<P, vector<P>, greater<P>> que;
    que.emplace(0, n);
    while(!que.empty()) {
        P p = que.top(); que.pop();
        if(mp.find(p.second) != mp.end() && mp[p.second] < p.first) continue;

        P q[6];
        q[0] = f(p.first, p.second, 2LL, true);
        q[1] = f(p.first, p.second, 2LL, false);
        q[2] = f(p.first, p.second, 3LL, true);
        q[3] = f(p.first, p.second, 3LL, false);
        q[4] = f(p.first, p.second, 5LL, true);
        q[5] = f(p.first, p.second, 5LL, false);
        for(int i=0;i<6;++i) {
            if(mp.find(q[i].second) == mp.end() || q[i].first < mp[q[i].second]) {
                que.push(q[i]);
                mp[q[i].second] = q[i].first;
            }
        }
        if(p.first + mp::cpp_int(d) * p.second < mp[0]) {
            mp[0] = p.first + mp::cpp_int(d) * p.second;
        }
    }

    cout << mp[0] << endl;
}

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int t;
    cin >> t;
    while(t--) {
        solve();
    }
}


Measured memory_bytes: 5072
#include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	long long n, a; char b;
	for (int h = 0; h < 100; h++) {
		int sum = 0;
		for (int i = 0; i < 5; i++) {
			cin >> n >> a;
			if (n == 0 && a == 0) {
				cin >> n; return 0;
			}
			if (n + a > sum) {
				sum = n + a;
				if (i == 0) { b = 'A'; }
				if (i == 1) { b = 'B'; }
				if (i == 2) { b = 'C'; }
				if (i == 3) { b = 'D'; }
				if (i == 4) { b = 'E'; }
			}
		}
		cout << b << ' ' << sum << endl;
	}
	cin >> n;
}


Measured memory_bytes: 3096
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	n := scanInt()
	k := scanInt()

	arr := []int{}
	for i := 1; i*i <= n; i++ {
		arr = append(arr, i, n/i)
	}
	sort.Ints(arr)
	num := make([]int, len(arr))
	pre := 0
	for i := 0; i < len(arr); i++ {
		num[i] = arr[i] - pre
		pre = arr[i]
	}
	
	dp := make([][]int, k+1)
	dp[0] = make([]int, len(arr))
	dp[0][0] = 1
	for i := 0; i < k; i++ {
		dp[i+1] = make([]int, len(arr))
		sum := 0
		for j := 0; j < len(arr); j++ {
			sum += dp[i][j] * num[j]
			sum %= MOD
			dp[i+1][len(arr)-1-j] = sum
		}
	}

	ans := 0
	for i := 0; i < len(arr); i++ {
		ans += dp[k][i] * num[i]
		ans %= MOD
	}

	fmt.Fprintln(wr, ans)

}

// MOD constant
const MOD = 1000000007


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

int main() {
  int n,k;
  cin>>n>>k;
  int A[100000];
  for(int i=0;i<n;i++){
    cin>>A[i];
  }
  
  int sum=0;
   for(int i=0;i<n;i++){
     if(A[i]>=k)sum++;
   }
 cout<<sum<<endl;
}
  
  

Measured memory_bytes: 640
def f(a,b):
    return max(len(str(a)),len(str(b)))
def solve():
    n = int(input())
    l = f(n,1)
    for i in range(1,int(n**.5)+1):
        if n%i==0:
            l_ = f(i,n//i)
            if l>l_:
                l=l_
    print(l)
solve()

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

int main() {
  int D;
  cin >> D;
  
  cout << "Christmas";
  if( D == 24 ){
    cout << " Eve";
  }else if( D == 23 ){
    cout << " Eve Eve";
  }else if( D == 22 ){
    cout << " Eve Eve Eve";
  }
  cout << endl;
  
}

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

using namespace std;
#define ll long long

#define rep(i, a) for (int i = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int i = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int i = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int i = (int) (a)-1; (i) >= (int) (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x
#define TRUE__  "Yes"
#define FALSE__ "No"
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}

#ifdef LOCAL
#define lcout(a) cout << a;
#define lcoutln(a) cout << a << endl;
#define lcerr(a) cerr << a;
#define lcerrln(a) cerr << a << endl;
#else
#define lcout(a) 
#define lcoutln(a) 
#define lcerr(a) 
#define lcerrln(a) 
#endif

#define MOD 1000000007

void init();
void solve();

signed main()
{
	init();
	solve();
}

struct comb {
#define MOD_COMB 1000000007
	vector<ll> fact;
	vector<ll> facti;
	comb(int n) {
		init(n);
	}
	void init(int n) {
		fact.resize(n);
		facti.resize(n);
		fact[0] = 1;
		for (int i = 1; i < n; i++) {
			fact[i] = fact[i-1] * i % MOD_COMB;
		}
		facti[n-1] = po(fact[n-1], MOD_COMB - 2);
		for (int i = n-2; i >= 0; i--) {
			facti[i] = facti[i+1] * (i + 1) % MOD_COMB;
		}
	}
	ll nCr(int a, int b) {
		return (fact[a] * facti[b] % MOD_COMB) * facti[a-b] % MOD_COMB;
	}
private:
	ll po(ll next, int cnt) {
		ll res = 1;
		if (cnt == 0) return 1;
		if (cnt & 1) res = res * next % MOD_COMB;
		return res * po(next * next % MOD_COMB, cnt >> 1) % MOD_COMB;
	}
};

int N, M;
vector<int> v;

void init()
{
	cin >> N >> M;
	int t = 2;
	while (M != 1) {
		v.PB(0);
		while (M % t) t++;
		while (M % t == 0) {
			v.back()++;
			M /= t;
		}
	}
}

void solve()
{
	ll res = 1;
	comb c(1000000);
	rep(i, v.size()) {
		res = res * c.nCr(N-1+v[i], v[i]) % MOD;
	}
	cout << res << endl;
}


Measured memory_bytes: 15872
#include<stdio.h>
#include<string.h>
int main(){
	int i,j,d[5][105][105],h,w,a;
	memset(d,0,sizeof(d));
	for(i=0;i<103;i++){
		d[1][i][1]=d[3][1][i]=1;
	}
	//d[1]=ツ凝按つェツづァツつクツづ可可コツつゥツづァツ猟按つス
	//d[2]=ツ凝按つェツづづ可コツつゥツづァ
	//d[3]=ツ凝按つェツづァツつクツづ可債カツつゥツづァ
	//d[4]=ツ凝按つェツづづ債カツつゥツづァ
	while(1){
		scanf("%d%d",&h,&w);
		if(h==0 && w==0)break;
		for(i=2;i<=h;i++){
			for(j=2;j<=w;j++){
				d[1][i][j]=(d[1][i-1][j]+d[2][i-1][j])%100000;
				d[2][i][j]= d[3][i-1][j]%100000;
				d[3][i][j]=(d[3][i][j-1]+d[4][i][j-1])%100000;
				d[4][i][j]= d[1][i][j-1]%100000;
			}
		}
		a=0;
		for(i=1;i<=4;i++)a+=d[i][h][w],a=a%100000;
		printf("%d\n",a);
	}
	return 0;
}

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

int n, h[21600], cnt;

int main(){
    cin >> n;
    for(int i = 0;i < n;i++)cin >> h[i];
    int cnt = 0;
    while(true){
        bool allzero = true;
        for(int i = 0;i < n;i++)
        if(h[i] != 0)
        allzero = false;

        if(allzero)break;

        int l = 0;
        while(h[l] == 0)l++;
        int r = l;
        while(r < n && h[r+1] != 0)r++;
        cnt++;

        for(int i = l;i <= r;i++)h[i]--;
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<vector>
#include<queue>
#include<utility>
using namespace std;

struct edge {int to, cost;};
typedef pair<long long, int> P;

const int MAX_N = 100000;
long long dy[MAX_N];
long long ds[MAX_N];
vector<edge> Gy[MAX_N];
vector<edge> Gs[MAX_N];
long long ans[MAX_N];
int n;
const long long INF = 1000000000000000;

void add_edge(int u, int v, int a, int b) {
	Gy[u].push_back({v, a});
	Gy[v].push_back({u, a});
	Gs[u].push_back({v, b});
	Gs[v].push_back({u, b});
}

void dijkstra(vector<edge> G[], long long d[], int s) {
	priority_queue<P, vector<P>, greater<P> > que;
	fill(d, d+n, INF);
	d[s] = 0;
	que.push(P(0, s));
	while(!que.empty()) {
		P p = que.top(); que.pop();
		int v = p.second;
		if(d[v] < p.first) continue;
		for(int i=0;i<G[v].size();i++) {
			edge e = G[v][i];
			if(d[e.to] > d[v] + e.cost) {
				d[e.to] = d[v] + e.cost;
				que.push(P(d[e.to], e.to));
			}
		}
	}
}

int main() {
	int m, s, t;
	scanf("%d %d %d %d", &n, &m, &s, &t);
	s--; t--;
	for(int i=0;i<m;i++) {
		int u, v, a, b;
		scanf("%d %d %d %d", &u, &v, &a, &b);
		add_edge(u-1, v-1, a, b);
	}
	dijkstra(Gy, dy, s);
	dijkstra(Gs, ds, t);
	for(int i=n-1;i>=0;i--) {
		ans[i] = dy[i] + ds[i];
		if(i < n-1 && ans[i] > ans[i+1]) ans[i] = ans[i+1];
	}
	for(int i=0;i<n;i++) {
		printf("%lld\n", INF - ans[i]);
	}
	return 0;
}


Measured memory_bytes: 16252
#include<bits/stdc++.h>
using namespace std;
#define int long
using pi=pair<int,int>;
main(){
  int n,k;
  cin>>n>>k;
  vector<pi> v(n);
  for(int i=0;i<n;++i)cin>>v[i].first>>v[i].second;
  sort(v.begin(),v.end());
  for(int i=0;i<n;++i){
    k-=v[i].second;
    if(k>0)continue;
    cout<<v[i].first;
    return 0;
  }
}

Measured memory_bytes: 1792
fn main() {
    input! {
        a: usize,
        b: usize
    }

    let mut grid = vec![vec!['#'; 100]; 50];
    grid.append(&mut vec![vec!['.'; 100]; 50]);

    let mut cnt = a - 1;
    for i in (0..50).step_by(2) {
        if cnt == 0 {
            break;
        }
        let start_j = if i % 2 == 0 { 0 } else { 2 };
        for j in (start_j..100).step_by(4) {
            grid[i][j] = '.';
            cnt -= 1;
            if cnt == 0 {
                break;
            }
        }
    }

    let mut cnt = b - 1;
    for i in (51..100).step_by(2) {
        if cnt == 0 {
            break;
        }
        let start_j = if (100 - i) % 2 == 0 { 0 } else { 2 };
        for j in (start_j..100).step_by(4) {
            grid[i][j] = '#';
            cnt -= 1;
            if cnt == 0 {
                break;
            }
        }
    }

    println!("{} {}", 100, 100);
    for s in grid {
        println!("{}", s.into_iter().collect::<String>());
    }
}

#[macro_export(local_inner_maccros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}
#[macro_export(lcal_inner_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[macro_export(lcal_inner_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}


Measured memory_bytes: 2236
use std::io::{Read, stdin};

fn main() {
    let stdin = stdin();
    let mut stdin = stdin.lock();

    let mut buf = String::new();
    stdin.read_to_string(&mut buf).unwrap();
    let buf: Vec<_> = buf.split_whitespace().map(|x| x.parse::<i32>().unwrap()).collect();

    let a = *buf.get(0).unwrap();
    let b = *buf.get(1).unwrap();

    println!("{} {}", a * b, (a + b) * 2);
}



Measured memory_bytes: 5028
#include <iostream>

using namespace std;

typedef long long ll;

//0~aまでのxor
ll func(ll a) {
	if (a % 4 == 3) return 0LL;
	else if (a % 4 == 2) return a + 1LL;
	else if (a % 4 == 1) return 1LL;
	else return a;
}

int main() {
	ll A, B;

	cin >> A >> B;

	ll ans;
	if (A > 0) ans = func(A - 1) ^ func(B);
	else ans = func(B);

	cout << ans << endl;
}

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

class Ans
{
private:
	int m, f, r;
	
	void Input(){
		cin >> m >> f >> r;
	}
	bool judge();
public:
	bool answer();
};

bool Ans::judge(){
	int score = m + f;
	
	if(m == -1 && f == -1 && r == -1)return false;
	
	if( m == -1 || f == -1 )cout << "F" << endl;
	else if( score >= 80 )cout << "A" << endl;
	else if( score >= 65 )cout << "B" << endl;
	else if( score >= 50 || r >= 50 )cout << "C" << endl;
	else if( score >= 30 )cout << "D" << endl;
	else cout << "F" << endl;
	
	return true;
}
bool Ans::answer(){
	Ans::Input();
	return Ans::judge();
}

int main()
{
	Ans ans;
	while(ans.answer());
	
	return 0;
}

Measured memory_bytes: 1152
N,A,B,C,D=map(int,input().split())

if N%A==0:
    a=N//A*B
else:
    a=(N//A+1)*B
    
if N%C==0:
    b=N//C*D
else:   
    b=(N//C+1)*D

print(min(a,b))


Measured memory_bytes: 5596
import math
import queue
import bisect
import heapq
import time
import itertools

mod = 1e9+7

def swap(a,b):
    return (b,a)

def gcd(a,b): #最大公約数
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): #素数判定
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): #素数列挙
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def main():
    x = int(input())
    if x<100:
        print(0)
        return
    buy = x//100
    sur = x%100
    num = (sur+4)//5
    if num<=buy:
        print(1)
    else:
        print(0)
    return

if __name__=='__main__':
    main()


Measured memory_bytes: 38560
using System;
using System.Collections.Generic;
using System.Linq;
public class Hello{
    public static void Main(){
        int n = int.Parse(Console.ReadLine());
        
        var list = new List<int>();
        for(var i = 0;i < n;i++){
            list.Add(int.Parse(Console.ReadLine()));
        }
        
        int now = list.First();
        
        for(var i = 0;i < n;i++){
            if(now == 2){
                Console.WriteLine(i + 1);
                return;
            }
            now = list[now - 1];
        }
        Console.WriteLine(-1);
    }
}


Measured memory_bytes: 14048
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<int, int>;
#define INF 1000000000
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repX(i, n ,x) for (int i = x; i < (int)(n); i++)
#define repBack(i, n) for (int i = n; i > 0; i--)

int main() {
    int N,K;
    cin >> N >> K;
    int ans = 0;
    rep(i,N){
        int h;
        cin >> h;
        if(h >= K)ans ++;
    }
    cout << ans << endl;

    return 0;
}

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

int main() {
	string b,e;
	cin>>b;
	int n=b.size();
	
	for(int i=0;i<n;i++){
		switch (b[i]){
			case 'D' : b[i]='A';
				break;
			case 'E' : b[i]='B';
				break;
			case 'F' : b[i]='C';
				break;
			case 'G' : b[i]='D';
				break;
			case 'H' : b[i]='E';
				break;
			case 'I' : b[i]='F';
				break;
			case 'J' : b[i]='G';
				break;
			case 'K' : b[i]='H';
				break;
			case 'L' : b[i]='I';
				break;
			case 'M' : b[i]='J';
				break;
			case 'N' : b[i]='K';
				break;
			case 'O' : b[i]='L';
				break;
			case 'P' : b[i]='M';
				break;
			case 'Q' : b[i]='N';
				break;
			case 'R' : b[i]='O';
				break;
			case 'S' : b[i]='P';
				break;
			case 'T' : b[i]='Q';
				break;
			case 'U' : b[i]='R';
				break;
			case 'V' : b[i]='S';
				break;
			case 'W' : b[i]='T';
				break;
			case 'X' : b[i]='U';
				break;
			case 'Y' : b[i]='V';
				break;
			case 'Z' : b[i]='W';
				break;
			case 'A' : b[i]='X';
				break;
			case 'B' : b[i]='Y';
				break;
			case 'C' : b[i]='Z';
				break;
		}
	}
	cout<<b<<endl;
	
	return 0;
}

Measured memory_bytes: 1180
import java.util.Scanner;

class Main {
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int val = scanner.nextInt();
        int s = val % 3600 % 60;
        int m = val % 3600 / 60 ;
        int h = val / 3600;
        System.out.println(h + ":" + m + ":" + s);
    }
}


Measured memory_bytes: 26288
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>

#define int long long
#define MOD7 1000000007
#define MOD9 1000000009

#define rep(i, n) for (int i = 0; i < (n); i++)
#define itrep(i, a) for (auto i = (a).begin(); i != (a).end(); i++)
#define REP(i, a, n) for (int i = (a); i <= (n); i++)
#define all(a) (a).begin(), (a).end()
#define mp(a, b) make_pair((a), (b))

using namespace std;

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

template<class T> void inputVector(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < v.size(); i++) cin >> v[i];
}

signed main() {
	int N;
	cin >> N;
	vector<int> P;
	inputVector(P, N);

	map<int, int> m;
	rep(i, N) {
		m[P[i]] = i;
	}

	int ret = 0;
	int val = 0;
	int prev = -1;
	itrep(it, m) {
		int pt = it->second;
		if (prev < pt) {
			val++;
		} else {
			val = 1;
		}
		prev = pt;
		ret = max(ret, val);
	}

	cout << N - ret << endl;

    return 0;
}


Measured memory_bytes: 14336
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
typedef pair<int, int> P;

void solve()
{
	int n;
	while(cin >> n, n)
	{
		vector<P> Vec(n);
		for(int i = 0; i < n; ++i)
		{
			cin >> Vec[i].second;
			int sum = 0;
			for(int j = 0; j < 8; ++j)
			{
				int temp;
				cin >> temp;
				if(j % 2 == 0)
				{
					sum += temp * 60;
				}
				else
				{
					sum += temp;
				}
			}
			Vec[i].first = sum;
		}
		sort(Vec.begin(), Vec.end());
		cout << Vec[0].second << endl;
		cout << Vec[1].second << endl;
		cout << Vec[n - 2].second << endl;
	}
}

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

Measured memory_bytes: 0
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

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

// Self settings
// clang-format off
#define MAX_N 100000
#define REP(i, N) for (int i = 0; i < (int)(N); ++i)
// clang-format on

int main(void)
{
  map<char, int> m;
  char s[5];
  scanf("%s", s);
  for (int i = 0; i < 4; i++) m[s[i]]++;

  bool f = true;
  for (auto i = m.begin(); i != m.end(); i++) {
    if (i->second != 2) {
      f = false;
    }
  }
  printf("%s\n", (f ? "Yes" : "No"));
  return 0;
}


Measured memory_bytes: 888
#pragma GCC optimize(2)
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, int> pdd;

const ll mod = 23333333333333333;
const int N = 1e5 + 10, M = 1e5 + 10;
const ll INF = 5e17;
const int inf = 0x3f3f3f3f;
const double eps = 1e-4;

#define pi acos(-1)
#define mk make_pair

int main()
{
    int k, a, b;
    cin >> k >> a >> b;
    for (int i = a; i <= b; i++)
    {
        if (i % k == 0)
        {
            puts("OK");
            return 0;
        }
    }
    puts("NG");
    return 0;
}


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

const int N = 1e5 + 7;

void adjust(long long ara[], int l, int r, int mid) {
    int first = mid - l + 1;
    int second = r - mid;
    long long ara1[first];
    long long ara2[second];
    int pos1 = 0, pos2 = 0, pos = l;

    for(int i = 0 ; i < first ; ++i) {
        ara1[i] = ara[i + l];
    }
    for(int i = 0 ; i < second ; ++i) {
        ara2[i] = ara[i + mid + 1];
    }
    for( ; pos1 < first && pos2 < second ;) {
        if(ara1[pos1] < ara2[pos2]) {
            ara[pos] = ara1[pos1];
            pos1++;
        }
        else {
            ara[pos] = ara2[pos2];
            pos2++;
        }
        pos++;
    }
    for( ; pos1 < first ; ) {
        ara[pos] = ara1[pos1];
        pos++;
        pos1++;
    }
    for( ; pos2 < second ; ) {
        ara[pos] = ara2[pos2];
        pos++;
        pos2++;
    }
}

void mergesort(long long ara[], int l, int r) {
    if(l < r) {
        int mid = (l + (r - l) / 2);
        mergesort(ara, l, mid);
        mergesort(ara, mid + 1, r);
        adjust(ara, l, r, mid);
    }
}

long long Max(long long x, long long y) {
    if(x > y) return x;
    else return y;
}

int main() {
    int n;
    scanf("%d",&n);
    long long *ara = (long long*)malloc(sizeof(long long) * n);
    int i = 0;
    for(i = 0 ; i < n ; ++i) {
        scanf("%lld",&ara[i]);
    }
    mergesort(ara, 0, n - 1);
    int can = 1;
    for(int i = 1 ; i < n ; ++i) {
        if(ara[i] == ara[i - 1]) {
            can = 0;
            break;
        }
    }
    if(can) {
        printf("YES\n");
    }
    else {
        printf("NO\n");
    }
    return 0;
}


Measured memory_bytes: 4732
#include <ctype.h>
#include <stdio.h>
   
int main(void){
  int i=0;
  char str[1210];
   
  gets(str);
   
  while(str[i]){
    if(islower(str[i]))  str[i]=toupper(str[i]);
    else if(isupper(str[i]))  str[i]=tolower(str[i]);
    i++;
  }
   
  printf("%s\n",str);
   
  return 0;
}

Measured memory_bytes: 524
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/standard_policies.hpp>


/* 
*    coder :: ATUL_PANDEY_2608
*        >>> INDIA <<<
*/
using namespace std;
using namespace __gnu_pbds;

// #define  part ..
#define pb(a) push_back(a)
#define all(a) a.begin(),a.end() 
#define mod 1000000007
//#define maxx 200006
#define ll long long 
#define quick    ios_base::sync_with_stdio(NULL),cin.tie(0);
#define listll vector< long long > 
#define listi vector< int> 
#define pii   pair<int , int> 
#define pll pair<long long , long long > 
#define minheap priority_queue<long long , vector< long long >, greater<long long > >
#define rep(i,a,b) for(int i=a;i<b;i++)
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}


template < class T > using oset = tree< T , null_type, less  < T  > , rb_tree_tag , tree_order_statistics_node_update > ;


// end of #define 

// define globals ...
const int maxx = 2e5+26;

//write function from here ...







int Main(){
  
  
  
  int n;
  cin>>n;
  int p;
  cin>>p;
  
  string  s;
  
  cin>>s;
  
  
  
  
  
  int arr[100000];
  memset(arr,0,sizeof(arr));
  
  
  ll power = 1;
  
  
  ll ans  =0 ;
  
  if(p==2 || p==5 ){
	
	for( int i=0 ; i < n;i++){
		ans+= ( s[i]-'0' )%p==0? i+1:0;		
	}
	
	
	cout<<ans<<endl;
	
	return 0 ;   
	  
  }
  
  
  
  
  
  ll suf =0 ;
  arr[suf]++;
  for(int i = n-1;~i;i--){
	  
	  ll x = s[i]- '0';
	  suf  = power*x + suf;
	  suf %= p;
	  ans+= arr[suf] ;
	  arr[suf]++;
	  power*=10;
	  power %= p;
	  
	  
  }
  
  
	  
cout<<ans<<endl;


 


return 0;

}






int main(){
 quick;
int t =1; 
//cin>>t;
while(t-- )
 Main();

 return 0;


}




Measured memory_bytes: 4072
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int[][] a=new int[4][13];
        int n=sc.nextInt();
        for(int i=0;i<n;i++){
        	String w=sc.next();
            int s=sc.nextInt();

            if(w.equals("S")){
                a[0][s-1]=1;
            }else if(w.equals("H")){
            	a[1][s-1]=1;
            }else if(w.equals("C")){
            	a[2][s-1]=1;
            }else{
            	a[3][s-1]=1;
            }
        }
        for(int i=0;i<4;i++){
        	for(int j=0;j<13;j++){
                if(a[i][j]==0){
                    if(i==0){
                        System.out.println("S "+(j+1));
            		}else if(i==1){
            			System.out.println("H "+(j+1));
           	 		}else if(i==2){
                    	System.out.println("C "+(j+1));
           		 	}else{
            			System.out.println("D "+(j+1));
                    }
                }
            }
        }
        sc.close();
    }
}


Measured memory_bytes: 26212
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define rep(i,s,t) for(int i=s ; i<t ; i++)
typedef long long ll;
typedef pair<ll,ll> P;
int main(){
  string s; int q;
  cin >> s >> q;
  int rev = 0;
  deque<char> que(s.size());
  rep(i,0,s.size()) que[i]=s[i];
  rep(i,0,q){
    int x;  cin >> x;
    if(x==1){
      rev = 1-rev;
    }else{
      int y;  char k;
      cin >> y >> k;
      --y;
      if(rev) y=1-y;
      if(y==0) que.push_front(k);
      else que.push_back(k);
    }
  }
  if(rev) reverse(que.begin(),que.end());
  while(que.size()){
    cout << que.front();
    que.pop_front();
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 896
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <assert.h>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main(){
  ll h,w,m;
  cin>>h>>w>>m;
  map<ll,ll> ma1,ma2;
  vector<pair<ll,ll> > vp;
  rep(i,0,m){
    ll a,b;
    cin>>a>>b;
    ma1[a]++;
    ma2[b]++;
    vp.pb(mp(a,b));
  }
  ll mx1 = 0;
  ll mx2 = 0;
  map<ll,ll>::iterator itr1 = ma1.begin();
  while(itr1!=ma1.end()){
    ll a = (*itr1).fi;
    ll b = (*itr1).se;
    mx1 = max(mx1,b);
    itr1++;
  }
  map<ll,ll>::iterator itr2 = ma2.begin();
  while(itr2!=ma2.end()){
    ll a = (*itr2).fi;
    ll b = (*itr2).se;
    mx2 = max(mx2,b);
    itr2++;
  }
  ll count1 = 0;
  map<ll,ll> ma3;
  map<ll,ll>::iterator itr3 = ma1.begin();
  while(itr3!=ma1.end()){
    ll a = (*itr3).fi;
    ll b = (*itr3).se;
    if(b==mx1){
      ma3[a]=1;
      count1++;
    }
    itr3++;
  }
  ll count2 = 0;
  map<ll,ll> ma4;
  map<ll,ll>::iterator itr4 = ma2.begin();
  while(itr4!=ma2.end()){
    ll a = (*itr4).fi;
    ll b = (*itr4).se;
    if(b==mx2){
      ma4[a]=1;
      count2++;
    }
    itr4++;
  }
  ll ans = 0;
  rep(i,0,vp.sz){
    ll a = vp[i].fi;
    ll b = vp[i].se;
    if(ma3[a]==1&&ma4[b]==1){
      ans++;
    }
  }
  if(ans==count1*count2){
    cout << mx1+mx2-1 << endl;
  }
  else{
    cout << mx1+mx2 << endl;
  }
  return 0;
}

Measured memory_bytes: 83032
import numpy as np
S=input()
a_list = "abcdefghijklmnopqrstuvwxyz"
c_list = np.zeros(26)

for i in range(len(S)):
  c_list[a_list.index(S[i])] = c_list[a_list.index(S[i])] + 1

if not 0 in c_list: print('None')
else:
  c_list = c_list.tolist()
  print(a_list[c_list.index(0)])

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

using namespace std;
using ll = long long int;
using ld = long double;

int main(void){

    ld a, b, c;
    cin >> a >> b >> c;

    cout << (a + b + 2 * sqrtl(a*b) < c ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 256
import itertools
n,m,R=map(int,input().split())
r=list(map(int,input().split()))
abc=[list(map(int,input().split())) for i in range(m)]
inf=float("inf")
data=[[inf]*(n+1) for i in range(n+1)]
for i in range(n+1):
    data[i][i]=0
for u in abc:
    a,b,c=u
    data[a][b]=c
    data[b][a]=c
for k in range(1,n+1):
    for i in range(1,n+1):
        for j in range(1,n+1):
            data[i][j]=min(data[i][j],data[i][k]+data[k][j])
ans=inf
for h in itertools.permutations(r):
    l=0
    for j in range(1,R):
        l+=data[h[j-1]][h[j]]
    ans=min(ans,l)
print(ans)

Measured memory_bytes: 72280
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int k=sc.nextInt();
		String str=sc.next();
		
		int len=str.length();
		
		if(k>=len){
			System.out.println(str);
		}
		else{
			for(int i=0;i<k;i++){
				char ch=str.charAt(i);
				System.out.print(ch);
			}
			System.out.println("...");
		}
	}
}


Measured memory_bytes: 35776
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;
int gcd(int a, int b) {
	if (b == 0)return a;
	return gcd(b, a%b);
}
int lcm(int a, int b) {
	return a / gcd(a, b)*b;
}
int modpow(int a,int b){
    if(!b)return 1;
    if(b%2)return modpow(a,b-1)*a%MOD;
    return modpow(a,b/2)*modpow(a,b/2)%MOD;
}
int fac(int a){
    int Ans=1;
    for(int i=1;i<=a;i++){
        Ans*=i;
        Ans%=MOD;
    }
    return Ans;
}//kaijo
int comb(int a,int b){
    return fac(a)*modpow(fac(a-b),MOD-2)%MOD*modpow(fac(b),MOD-2)%MOD;
}
int main(){
	int n,m;
	ll a[100010],b[100010];
	ll r[100010];
	ll ans=0;
	cin>>n>>m;
	rep(i,n)cin>>a[i];
	rep(i,m)cin>>b[i];
	sort(b,b+m);
	rep(i,m){
		if(i)r[i]=r[i-1]+b[i];
		else r[i]=b[i];
	}
	rep(i,n){
		auto ITR=upper_bound(b,b+m,a[i])-1;
		ans+=r[ITR-b]+((m-(ITR-b)-1)*a[i]);
	}
	cout<<ans<<endl;
	return 0;
}




Measured memory_bytes: 5420