akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <math.h>
#include <string>
#include <sstream>
#include <stack>
#include <deque>
#define pb push_back
#define make make_pair
#define kaku(a) cout << a << endl
#define isort(a) sort(a.begin(),a.end())
#define ll long long

using namespace std;


#define rep(i,n) for(ll i=0;i<n;i++)
#define PI 3.14159265359
long long gcd(long long a,long long b){ return b==0?a:gcd(b,a%b);}
long long lcm(long long a,long long b){ return a/gcd(a,b)*b;}

const ll inf =1000000007;
typedef pair<ll,ll> Pair;


typedef vector<ll> vl;

void csolve(){
    long double a,b;
    cin >> a >>b;
    kaku(floor(a*b));
}

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

    ll t=1000000000000000000;
    ll ans=1;
    bool u=false;
    bool ok=false;
    rep(i,n){
        ll a;
        cin >>a;
        ans*=a;
        if(ans>t) u=true;
        if(a==0) ok=true;
    }
    if(ans>t) ans=-1;
    if(u && !ok) ans=-1;
    kaku(ans);
}

void asolve(){
    ll a,b;
    cin >> a >>b;
    kaku(a*b);
}

int main(){
    asolve();
}

Measured memory_bytes: 3668
use std::io::*;
use std::str::FromStr;
use std::collections::HashMap;

//https://qiita.com/tubo28/items/e6076e9040da57368845
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

//refer
//https://atcoder.jp/contests/arc086/submissions/14591609
fn main() {
    let n: usize = read();
    let k: usize = read();
    let a: Vec<u64> = (0..n).map(|_| read()).collect();

    let mut map = HashMap::new();

    //集約処理
    for v in a.into_iter(){
        let count = map.entry(v).or_insert(0);
        *count += 1;
    }

    //集約処理したvalueをVecで取得
    let mut syuuyaku: Vec<u64> = map.values().map(|&n| n).collect();
    //昇順ソート
    syuuyaku.sort();

    if syuuyaku.len() <= k {
        println!("0");
    }else{
        //変更必要な数字の種類を求める
        let diff = syuuyaku.len() - k;
        //diffのインデックスまでの数値を足し込む、これが解答
        let ans:u64 = syuuyaku.iter().take(diff).sum();
        println!("{}",ans);
    }

}

Measured memory_bytes: 10108
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string.h>
#include<math.h>
using namespace std;
#define debug puts("ftyyydsb");
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define REP(i,a,b) for(int i=a;i>=b;i--)
template<class t> inline t read(t &x)
{
	char c=getchar();bool f=0;x=0;
	while(!isdigit(c)) f|=c=='-',c=getchar();
	while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
	if(f) x=-x;return x;
}
template<class t,class ...A> inline void read(t &x,A &...a){
	read(x);read(a...);
}
template<class t> inline void write(t x){
	if(x<0) putchar('-'),write(-x);
	else{if(x>9) write(x/10);putchar('0'+x%10);}
}
template<class t> inline void writeputs(t x){write(x),putchar('\n');}
template<class t> inline void writeputchar(t x){write(x),putchar(' ');}
int n;
int main()
{
	read(n);
	FOR(i,1,n) 
	{
		putchar('A');
		putchar('C');
		putchar('L');
	}
	return 0;
}

Measured memory_bytes: 3564
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define fu(a,b,c) for(int a=b;a<=(int)c;++a)
#define fd(a,b,c) for(int a=b;a>=(int)c;--a)
#define cu(a,b,c) for(int a=b;a<(int)c;++a)
#define cd(a,b,c) for(int a=(b)-1;a>=(int)c;--a)
#define gcd(a,b) __gcd(a,b) 
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define pf push_front
#define uint unsigned int
#define MOD 1000000007
#define MAXN 200005
#define MAXH 4
#define MAXM 100
#define INF 1LL << 30
#define ll long long
#define ull unsigned long long
#define RNG mt19937
#define udist(a,b) uniform_int_distribution<uint32_t> distribution(a,b)
#define max3(a,b,c) max(a, max(b, c))
#define min3(a,b,c) min(a, min(b, c))
#define gmax(a,b) a = max(a, b)
#define gmin(a,b) a = min(a, b)
#define whatis(x) cerr << #x << " is " << x << endl;
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define PI 3.1415926535897932384626433
using namespace std;
const int N = 100005;
int cnt[N];

int main(){
	fast_io();
	ll a,b,c,x,y;
	cin >> a >> b >> c >> x >> y;
	if(2 * c >= a + b){
		cout << x * a + y * b << '\n';
	}
	else{
		int n = min(x,y);
		ll ans = n * 2 * c;
		x-=n;y-=n;
		if(x){
			ans+=min(x * 2 * c, x * a);
		}
		if(y){
			ans+=min(y * 2 * c, y * b);
		}
		cout << ans << '\n';
	}
}



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

typedef long long int ll;
const int mod = 1e9+7;
const ll inf = 1e18;
const double pi = 3.1415926535897932384626;

void solve(){
	//code
	ll n;
	cin>>n;
	string res="";
	while(n>0){
		int index=(n-1)%26;
		res=char(index+'a')+res;
		n=(n-1)/26;
	}
	cout<<res;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	solve();
 	return 0;
}


Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define lll __int128
#define lp(i, a, b) for (ll i = a; i < b; i++)
#define vec(v, type, sz) vector<type> v(sz)
#define in(v) \
    for (auto &i : v) cin >> i
#define all(v) v.begin(), v.end()
#define prv(v)                         \
    for (auto i : v) cout << i << " "; \
    cout << "\n"
#define MOD 1000000007
#define INF 1e9
#define INFL 1e18
#define fast_io                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define vi vector<int>
#define vl vector<ll>
#define vii(v, n, m, val) vector<vector<int>> v(n, vector<int>(m, val))
#define viii(v, i, j, k, val)        \
    vector<vector<vector<int>>> v(i, \
                                  vector<vector<int>>(j, vector<int>(k, val)))
#define pii pair<ll, ll>
#define pb push_back
#define file_io                       \
    freopen("input.txt", "r", stdin); \
    freopen("output.txt", "w", stdout);

int main() {
	fast_io;
	ll k,n; cin>>k>>n;
	vl v(n); in(v);
	ll m=-1;
	lp(i,1,n)
		m=max(m,v[i]-v[i-1]);
	m=max(m,v[0]+k-v[n-1]);
	cout<<k-m;
}

Measured memory_bytes: 1792
#include <stdio.h>

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

int map[12][12];

void dfs(int y, int x)
{
  int i;
  if (y < 0 || x < 0 || 11 < y || 11 < x){
    return;
  }
  if (map[y][x] == 0){
    return;
  }

  map[y][x] = 0;
  for (i = 0; i < 4; i++){
    dfs(y + dy[i], x + dx[i]);
  }
}

int main()
{
  int i, j;

  while (1){
    for (i = 0; i < 12; i++){
      for (j = 0; j < 12; j++){
        if (scanf("%1d", &map[i][j]) == EOF) {
          return (0);
        }
      }
    }

    int cnt = 0;
    for (i = 0; i < 12; i++){
      for (j = 0; j < 12; j++){
        if (map[i][j] == 0) continue;
        cnt++;
        dfs(i, j);
      }
    }

    printf("%d\n", cnt);
    scanf("%*c");
  }
}

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

typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<db, db> pdd;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define loop(i, a, b) for(int i = a; i < b; i++)
#define pb push_back

const int maxn = 1e5+5;
const int Mod=1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const double e=exp(1);
const db PI = acos(-1);
const db ERR = 1e-10;

#define MAX 1002

char grid[MAX][MAX];
ull dp[MAX][MAX] = {};




int main()
{
	int h, w;
	fastIO;

	cin >> h >> w;
	loop(i, 0, h)
	loop(j, 0, w)
		cin >> grid[i][j];
	dp[0][0] = 0;
	if(grid[0][1] == '.')
		dp[0][1] = 1;
	if(grid[1][0] == '.')
		dp[1][0] = 1;

	loop(i, 0, h)
	loop(j, 0, w)
	{
		if(grid[i][j] == '.')
		{	
			if(grid[i - 1][j] == '.')
				dp[i][j] = ((dp[i][j])%Mod + (dp[i - 1][j])%Mod) % Mod;
			if(grid[i][j - 1] == '.')
				dp[i][j] = ((dp[i][j]) % Mod + (dp[i][j - 1]) % Mod) % Mod;
		}
	}

	cout << dp[h - 1][w - 1];

	return 0;
}

Measured memory_bytes: 9088
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define MAX 100000
void inarray(int a[], int n){
    for(int i = 0; i < n; i++) cin >> a[i];
}

int main(){
    int n,m; cin >> n >> m;
    int a[n];
    int c = 0, sum = 0;
    for(int i = 0; i < n; i++){
        cin >> a[i]; sum += a[i];
    }
    sort(a,a+n);
    for(int i = 0; i < m; i++){
        if(a[n-1-i]*4*m >= sum) c++;
    }
    if(c >= m) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



int main(){

	int table[13] = {0,1,2,1,3,1,3,1,1,3,1,3,1};

	int x,y;
	scanf("%d %d",&x,&y);

	if(table[x] == table[y]){

		printf("Yes\n");

	}else{

		printf("No\n");
	}

	return 0;
}


Measured memory_bytes: 3644
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S, T;
    cin >> S >> T;
    cout << T << S << endl;

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

typedef unsigned long long int lint;

lint fact(lint n)
{	
	if (n < 2) return (1);
	return (n * fact(n - 1));
}

int main(void)
{
	int n;
	scanf("%d", &n);
	printf("%llu\n", fact(n));
	return (0);
}

Measured memory_bytes: 592
n = int(input())

l = list(range(1, n+1))
s = sum(l)
graph = []
graph_set = set()
cnt = 0

if n % 2 == 0:
    for i in range(1, n+1):
        for j in range(1, n+1):
            if i + j == n + 1:
                continue
            elif i == j:
                continue
            else:
                if (i, j) not in graph_set:
                    graph.append([i, j])
                    graph_set.add((i, j))
                    graph_set.add((j, i))
                    cnt += 1

else:
    for i in range(1, n+1):
        for j in range(1, n+1):
            if i + j == n:
                continue
            elif i == j:
                continue
            else:
                if (i, j) not in graph_set:
                    graph.append([i, j])
                    graph_set.add((i, j))
                    graph_set.add((j, i))
                    cnt += 1

print(cnt)
for i, j in graph:
    print(i, j)

Measured memory_bytes: 5232
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using ll = long long int;
using vec = vector<int>;
using P = pair<int,int>;
const int INF = 1e9+7;

int main() {
  int n; cin >> n;
  int c = 0;
  rep (i,n) {
    int a, b; cin >> a >> b;
    if (a == b) {
      c++;
    } else {
      c = 0;
    }

    if (c >= 3) {
      cout << "Yes" << endl;

      return 0;
    }
  }

  cout << "No" << endl;
}


Measured memory_bytes: 3592
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<queue>
using namespace std;

inline int read(){
	int x;char c;
	while((c=getchar())<'0'||c>'9');
	x=c-48;
	while((c=getchar())>='0'&&c<='9')x=x*10+c-48;
	return x;
}
void write(int x){
	if(x>9)write(x/10);
	putchar(x%10+'0');
}

const int maxn=5e5+10;
int n,k,p[maxn],rk[maxn],deg[maxn],ans[maxn];
int st[maxn<<2],tag[maxn<<2];
priority_queue<int> q;

inline int min_(int a,int b){
	return a<=b?a:b;
}
inline int max_(int a,int b){
	return a>=b?a:b;
}
void update1(int rt,int l,int r,int pos){
	++st[rt];
	if(l==r)
		return;
	int mid=l+r>>1;
	if(pos<=mid)
		update1(rt<<1,l,mid,pos);
	else
		update1(rt<<1|1,mid+1,r,pos);
}
int query(int rt,int l,int r,int x,int y){
	if(l==x&&r==y)
		return st[rt];
	int mid=l+r>>1;
	if(y<=mid)
		return query(rt<<1,l,mid,x,y);
	else if(x>mid)
		return query(rt<<1|1,mid+1,r,x,y);
	else
		return query(rt<<1,l,mid,x,mid)+query(rt<<1|1,mid+1,r,mid+1,y);
}
inline void push_up(int rt){
	st[rt]=min_(st[rt<<1],st[rt<<1|1]);
}
inline void push_down(int rt){
	if(tag[rt]){
		st[rt<<1]-=tag[rt];
		tag[rt<<1]+=tag[rt];
		st[rt<<1|1]-=tag[rt];
		tag[rt<<1|1]+=tag[rt];
		tag[rt]=0;
	}
}
void build(int rt,int l,int r){
	if(l==r){
		st[rt]=deg[l]+1;
		return;
	}
	int mid=l+r>>1;
	build(rt<<1,l,mid);
	build(rt<<1|1,mid+1,r);
	push_up(rt);
}
void update2(int rt,int l,int r,int x,int y){
	if(l==x&&r==y){
		if(st[rt]==1)
			if(l==r){
				q.push(l);
				st[rt]=1e9;
			}
			else{
				int mid=l+r>>1;
				push_down(rt);
				update2(rt<<1,l,mid,x,mid);
				update2(rt<<1|1,mid+1,r,mid+1,y);
				push_up(rt);
			}
		else{
			--st[rt];
			++tag[rt];
		}
		return;
	}
	push_down(rt);
	int mid=l+r>>1;
	if(y<=mid)
		update2(rt<<1,l,mid,x,y);
	else if(x>mid)
		update2(rt<<1|1,mid+1,r,x,y);
	else{
		update2(rt<<1,l,mid,x,mid);
		update2(rt<<1|1,mid+1,r,mid+1,y);
	}
	push_up(rt);
}

int main(){
	n=read();k=read();
	for(int i=1;i<=n;++i)
		p[i]=read(),rk[p[i]]=i;
	for(int i=n;i;--i){
		deg[rk[i]]=query(1,1,n,max_(rk[i]-k+1,1),min_(rk[i]+k-1,n));
		update1(1,1,n,rk[i]);
	}
	build(1,1,n);
	update2(1,1,n,1,n);
	for(int i=n;i;--i){
		int pos=q.top();q.pop();
		ans[pos]=i;
		update2(1,1,n,max_(pos-k+1,1),min_(pos+k-1,n));
	}
	for(int i=1;i<=n;++i)
		write(ans[i]),putchar('\n');
	return 0;
}

Measured memory_bytes: 25968
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int a;
  int b;
  int c;
  cin>> a >> b >> c ;
  int sum = a+b+c;
  string ans = "YES";
  if(sum -5 - 5 -7 != 0){
  	ans = "NO";
  }
  cout << ans <<endl;
}

Measured memory_bytes: 256
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {//
        n:usize,
        mut a:[i64;n+1],
        mut b:[i64;n],
    }
    let mut ans = 0;
    for i in 0..n {
        ans += min(b[i], a[i]);
        if b[i] > a[i] {
            b[i] -= min(b[i], a[i]);
            ans += min(a[i + 1], b[i]);
            a[i + 1] -= min(a[i + 1], b[i]);
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 5620
/* cerberus97 - Hanit Banga */

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>

using namespace std;

#define pb push_back
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

const int N = 1e5 + 10;

int a[N];

vector<int> solve(int n, set<int>& ids, multiset<int>& all_ai);

int main() {
	fast_cin();
	int n; cin >> n;
	set<int> ids;
	multiset<int> all_ai;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
		ids.insert(i);
		all_ai.insert(a[i]);
	}
	auto ans = solve(n, ids, all_ai);
	for (auto& i : ans) {
		cout << i << ' ';
	}
	cout << endl;
}

vector<int> solve(int n, set<int>& ids, multiset<int>& all_ai) {
	int cur_banned = 0;
	vector<int> ans;
	for (int i = n; i >= 1; --i) {
		if (i <= 4) {
			vector<int> temp;
			for (auto& id : ids) {
				temp.pb(id);
			}
			do {
				if (cur_banned == temp[0]) {
					continue;
				}
				int sz = temp.size();
				bool ok = true;
				for (int j = 0; j < sz - 1; ++j) {
					if (a[temp[j]] == temp[j + 1]) {
						ok = false;
						break;
					}
				}
				if (ok) {
					for (auto& id : temp) {
						ans.pb(id);
					}
					return ans;
				}
			} while (next_permutation(temp.begin(), temp.end()));
			return {-1};
		} else if (*all_ai.begin() == *prev(all_ai.rbegin()) and ids.count(*all_ai.begin())) {
			int id = *all_ai.begin();
			if (cur_banned == id) {
				return {-1};
			}
			ans.pb(id);
			ids.erase(id);
			all_ai.erase(all_ai.find(a[id]));
			cur_banned = a[id];
		} else if (*next(all_ai.begin()) == *all_ai.rbegin() and ids.count(*all_ai.rbegin())) {
			int id = *all_ai.rbegin();
			if (cur_banned == id) {
				return {-1};
			}
			ans.pb(id);
			ids.erase(id);
			all_ai.erase(all_ai.find(a[id]));
			cur_banned = a[id];
		} else {
			int id = *ids.begin();
			if (cur_banned == id) {
				id = *next(ids.begin());
			}
			ans.pb(id);
			ids.erase(id);
			all_ai.erase(all_ai.find(a[id]));
			cur_banned = a[id];
		}
	}
	return ans;
}


Measured memory_bytes: 10624
import math
import sys

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


x = int(input())
for i in range(x, 10**5 + 4):
    if is_prime(i):
        print(i)
        sys.exit()

Measured memory_bytes: 38896
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, StdoutLock, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
#[allow(unused_macros)]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , bytes ) => { read_value ! ( $ next , String ) . into_bytes ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }
#[allow(dead_code)]
pub fn with_bufwriter<F: FnOnce(BufWriter<StdoutLock>) -> ()>(f: F) {
    let out = stdout();
    let writer = BufWriter::new(out.lock());
    f(writer)
}
#[allow(unused_macros)]
macro_rules ! debug { ( $ ( $ a : expr ) ,* ) => { eprintln ! ( concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) } ; }

fn num(n: u64, e: &Vec<u64>) -> u64 {
    let mut ans = 0;
    for x in e {
        if x >= &(n - 1) {
            ans += 1;
        }
    }
    //debug!(n);
    //debug!(ans);
    ans
}

#[allow(dead_code)]
fn main() {
    input!{
        n: u64,
    }
    let mut e: Vec<u64> = vec![0; (n+1) as usize];
    for i in 2..n+1 {
        let mut tmp = i;
        for div in 2..i+1 {
            while tmp % div == 0 {
                e[div as usize] += 1;
                tmp /= div;
            }
        }
    }
    //debug!(e);
    println!("{}", num(75, &e) + num(25, &e) * (num(3, &e) - 1) + num(15, &e) * (num(5, &e) - 1) + num(5, &e) * (num(5, &e) - 1) * (num(3, &e) - 2 ) / 2);
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll findTrailingZeros(ll n)
{
    ll cnt = 0;
    for (ll i = 5; n / i >= 1; i *= 5)
        cnt += n / i;

    return cnt;
}
int32_t main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	ll t;
	t=1;
	while(t--)
    {
        ll n;
        cin>>n;
        if(n&1)
        {
            cout<<0<<"\n";
            continue;
        }
        else
        {
            cout<<findTrailingZeros(n/2);
        }
    }
}


Measured memory_bytes: 256
n = int(input())
s = input()
ans = s.count('R') * s.count('G') * s.count('B')
for i in range(n):
  for diff in range(n):
    j = i + diff
    k = j + diff
    if k >= n:
      break
    if s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
      ans -= 1
print(ans)

Measured memory_bytes: 9088
// D - Wizard in Maze

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const ll MOD = 1e9 + 7;

char field[1000][1000];
bool visited[1000][1000];

struct Search {
	int r;
	int c;
	int cost;
};

// 移動ベクトル
vector<int> dr;
vector<int> dc;
map<int, int> mv_to_cost;

// sr: スタート行, cs: スタート列, gr: ゴール行, gc: ゴール列
int bfs(int H, int W, int sr, int sc, int gr, int gc) {
	deque<Search> search_queue;
	search_queue.push_back(Search{sr, sc, 0});

	while(!search_queue.empty()) {
		// キューから探索対象の位置情報を取り出す
		Search search = search_queue.front();
		search_queue.pop_front();

		int r = search.r;
		int c = search.c;
		int cost = search.cost;

		if (visited[r][c]) continue;
		visited[r][c] = true;

		//cout << r << ' ' << c << " (" << cost << ")" << endl; // **** debug ****

		if (r == gr && c == gc) return cost; // ゴールに到達

		// 探索を予約
		for (int mv = 0; mv < dr.size(); mv++) {
			int next_r = r + dr[mv];
			int next_c = c + dc[mv];

			if (next_r < 0 || next_r >= H || next_c < 0 || next_c >= W) continue; // 範囲外
			if (field[next_r][next_c] == '#') continue; // 壁
			//if (visited[next_r][next_c]) continue; // 探索済み

			if (mv_to_cost[mv] == 0) {
				search_queue.push_front(Search{next_r, next_c, cost});
			} else {
				search_queue.push_back(Search{next_r, next_c, cost + 1});
			}
		}
	}

	return -1; // ゴールできなかった場合
}

int main(){
  int H, W;
	int sr, sc, gr, gc;
	cin >> H >> W;
	cin >> sr >> sc;
	cin >> gr >> gc;

	for (int r=0; r<H; r++) {
		for (int c=0; c<W; c++) {
			cin >> field[r][c];
		}
	}

	// 移動ベクトルを作成
	int mv = 0;
	for (int i=-2; i<=2; i++) {
		for (int j=-2; j<=2; j++) {
			if (i == 0 && j == 0) continue;
			dr.push_back(i);
			dc.push_back(j);

			int cost = 1;
			if (i == 1 && j == 0) cost = 0;
			if (i == -1 && j == 0) cost = 0;
			if (i == 0 && j == 1) cost = 0;
			if (i == 0 && j == -1) cost = 0;
			mv_to_cost[mv] = cost;
			mv++;
		}
	}

	int ans = bfs(H, W, sr - 1, sc - 1, gr - 1, gc - 1);

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 6792
h, w = map(int, input().split())
a = [list(map(int, input().split())) for i in range(h)]
r, c, d, dr, dc = 0, 0, 0, 0, 1
ret = []
for i in range(h * w - 1):
    if not (0 <= r + dr < h and 0 <= c + dc < w and a[r + dr][c + dc] >= 0):
        d = (d + 1) % 4
    dr, dc = [(0, 1), (1, 0), (0, -1), (-1, 0)][d]
    if a[r][c] % 2 != 0:
        ret.append((r, c, r + dr, c + dc))
        a[r + dr][c + dc] += 1
    a[r][c] = -1
    r, c = r + dr, c + dc
print(len(ret))
for r1, c1, r2, c2 in ret:
    print(r1 + 1, c1 + 1, r2 + 1, c2 + 1)

Measured memory_bytes: 75356
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int n = sc.nextInt();
			if (n == 0)
				break;
			int a = 0;
			int b = 0;
			for (int i = 0; i < n; i++) {
				int ta = sc.nextInt();
				int tb = sc.nextInt();
				if (ta > tb)
					a += ta + tb;
				else if (ta < tb)
					b += ta + tb;
				else {
					a += ta;
					b += tb;
				}
			}
			System.out.println(a + " " + b);
		}
		sc.close();
	}
}

Measured memory_bytes: 51772
#include<iostream>
using namespace std;
int main(){
  int n,game[201][3],flg,sum[201]={};
  cin >> n;
  for(int i=0;i<n;i++){
    for(int j=0;j<3;j++){
      cin >> game[i][j];
    }
  }
  for(int i=0;i<3;i++){
    for(int j=0;j<n;j++){
      flg=0;
      for(int k=j+1;k<n;k++){
	if(game[j][i]==game[k][i]){
	  game[k][i]=0;
	  flg++;
	}
      }if(flg!=0){
	game[j][i]=0;
      }
    }
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<3;j++){
      sum[i]+=game[i][j];
    }
  }
  for(int i=0;i<n;i++){
    cout << sum[i] << endl;
  }
  return 0;
}

Measured memory_bytes: 1164
#include <iostream>
#include <string>

using namespace std;


int main() {

    int x, a, b;

    cin >> x >> a >> b;

    int lim = a - b;

    if(lim >= 0) {
        cout << "delicious" << endl;
    }
    else if(lim >= -x){
        cout << "safe" << endl;
    }
    else {
        cout << "dangerous" << endl;
    }

    return 0;
}

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

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

    int len = s.size();

    for(int i = 0; i < len - 1; i++) {
        if(s[i] == s[i + 1]) {
            printf("%d %d\n", i + 1, i + 2);
            return 0;
        }

        if(s[i] == s[i + 2]) {
            printf("%d %d\n", i + 1, i + 3);
            return 0;
        }
    }

    printf("-1 -1\n");
    return 0;
}


Measured memory_bytes: 512
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int digits(long long n){
	if(n == 0) return 1;
	int res = 0;
	while(n > 0){
		n /= 10;
		res++;
	}
	return res;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    int s[m];
    char c[m];
    rep(i,m) cin >> s[i] >> c[i];
    rep(i,1000){
    	if(digits(i) != n) continue;
    	bool ok = true;
    	string t = to_string(i);
    	rep(j,m){
    		if(t[s[j]-1] != c[j]) ok = false;
    	}
    	if(ok){
    		cout << t << endl;
    		return 0;
    	}
    }
    cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d", &n)
	answer := maxHappiness(n)
	fmt.Println(answer)
}

func maxHappiness(x int) int {
	point := x / 500 * 1000
	point += (x % 500) / 5 * 5
	return point
}


Measured memory_bytes: 512
#include<stdio.h>

int main(void){
    int n;
    int j;
    int k;
    int c;
    int i;
    int count = 0;
    int hi[100];

    scanf("%d", &n);
    for(i = 0; i < n; i++){
        scanf("%d", &hi[i]);
    }

    for(j = 0; j < n; j++){
        c = 0;
        for(k = 0; k <= j; k++){
            if(hi[j] >= hi[k]){
                c++;
            }
        }
        if(c == j + 1){
            count++;
        }
    }

    printf("%d\n", count);

    return 0;
}

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

int main() {
  int a, b, c, d, e, k;
  cin >> a >> b >> c >> d >> e >> k;
  if ((e - a) > k){
    cout << ":(" << endl;
  }
  else{
    cout << "Yay!" << endl;
  }
}


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

int main()
{
    int N, M;
    bool lock = true;
    map<string, int> list;
    cin>>N;
    while(N-- > 0) {
        string U;
        cin>>U;
        list.insert(make_pair(U, 1));
    }
    cin>>M;
    while(M-- > 0) {
        string T;
        cin>>T;
        if(list.count(T)) {
            if(lock) cout<<"Opened by "<<T<<endl;
            else cout<<"Closed by "<<T<<endl;
            lock = !lock;
        } else {
            cout<<"Unknown "<<T<<endl;
        }
    }
}

Measured memory_bytes: 1236
/*
 * FileName:     C
 * CreatedDate:  2020-04-14 19:19:37 +0900
 * LastModified: 2020-04-14 19:42:10 +0900
 */

#include <stdio.h>
#include <string.h>
int main(void){
    int n;
    scanf("%d",&n);
    int s[n],count=0;
    for(int i=0;i<n;i++){
        scanf("%d",&s[i]);
        count+=s[i];
    }
    int dp[n+1][count+1];
    memset(dp,0,sizeof(dp));
    dp[0][0]=1;
    for(int i=0;i<n;i++){
        for(int j=0;j<count+1;j++){
            if(j<s[i]){
                dp[i+1][j]=dp[i][j];
            }
            else{
                if(dp[i][j-s[i]]==1||dp[i][j]==1){
                    dp[i+1][j]=1;
                }
                else{
                    dp[i+1][j]=0;
                }
            }
        }
    }
/*    for(int i=0;i<n+1;i++){
        for(int j=0;j<count+1;j++){
            printf("%d ",dp[i][j]);
        }
        printf("\n");
    }*/
    int tmp=0;
    for(int i=count;i>=0;i--){
        if(dp[n][i]==1&& i>tmp &&i%10!=0){
            tmp=i;
        }
    }
    printf("%d\n",tmp);
    return 0;
}


Measured memory_bytes: 4096
#include<string>
#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
#include<iomanip>
#include<map>
#include <string.h>
using namespace std;
int n;
int t, x, y, pt, px, py;
int c[505];
int s[505];
int f[505];
int r[505];
int csi[505];
int csd[505];
int rs[505];

int main() {
	cin >> n;
	for (int i = 0; i < n - 1; i++) {
		cin >> c[i] >> s[i] >> f[i];
	}
	for (int i = 0; i < n; i++) {
		int sum = c[i] +s[i];
		for (int j = i+1;j < n - 1; j++) {
			if (sum < s[j]) sum = c[j] + s[j];
			else if (sum % f[j] == 0) sum += c[j];
			else sum = c[j] + (sum/f[j]+1)*f[j];
		}
		cout << sum << endl;
	}
	return 0;
}

Measured memory_bytes: 256
N=int(input())
X=input()
popcount=X.count('1')
bi1=[]
bi0=[]
Xnum1 = 0
Xnum0 = 0
if popcount != 1:
    for i in range(N):
        if i==0: bi1.append(1)
        else: bi1.append(bi1[i-1]*2%(popcount-1))
        Xnum1 = (Xnum1 + int(X[N-i-1])*bi1[i])%(popcount-1)
for i in range(N):
    if i==0: bi0.append(1)
    else: bi0.append(bi0[i-1]*2%(popcount+1))
    Xnum0 = (Xnum0 + int(X[N-i-1])*bi0[i])%(popcount+1)
for i in range(N):
    if popcount==1 and X[i]=='1':
        print(0)
        continue
    if X[i]=='1':
        Xi = (Xnum1 - bi1[N-i-1])%(popcount-1)
    else:
        Xi = (Xnum0 + bi0[N-i-1])%(popcount+1)
    ans = 1
    while Xi!=0:
        Xi = Xi % bin(Xi).count('1')
        ans += 1
    print(ans)

Measured memory_bytes: 88428
# -*- coding: utf-8 -*-
def main():
    S = list(str(input()))
    #print(S)
    for i in range(len(S)):
        if i == 0:
            t = int(S[0])
            continue
        else:
            t = int(S[i-1])
            #print(t)
            if t == int(S[i]):
                print('Bad')
                return
    print('Good')


if __name__ == '__main__':
    main()

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

using namespace std;

const auto MOD = 1000000007;

long long powMod(long long x, long long k, long long m) {
    if (k == 0) return 1;
    if (k % 2 == 0) return (powMod((x * x + m) % m, k / 2, m) + m) % m;
    else return (x * powMod(x, k - 1, m) + m) % m;
}

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

    // sum 1/A[i]の計算
    vector<long long> a(n);
    long long ans = 0;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        ans += powMod(a[i], MOD - 2, MOD);
        ans %= MOD;
    }

    // 最小公倍数Lの計算
    map<long long, long long> lcm;
    for (auto x:a) {
        auto tmp = x;
        for (int j = 2; j * j <= tmp; j++) {
            if (tmp == 1) break;
            if (tmp % j == 0) {
                long long cnt = 0;
                while (tmp % j == 0) {
                    cnt++;
                    tmp /= j;
                }
                lcm[j] = max(lcm[j], cnt);
            }
        }
        if (tmp > 1 and lcm[tmp] == 0) lcm[tmp] = 1;
    }

    // L*sum 1/A[i]の計算
    for (auto x:lcm) {
        ans *= powMod(x.first, x.second, MOD);
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(), a.end()
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
#define pb push_back
#define sz(x) (int)(x).size()
#define PQ(T) priority_queue<T, v(T), greater<T>>
#define bn(x) ((1 << x) - 1)
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int mod = 1000000007;

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

    int ans = 0;

    rep(i, 1000){
        int hyaku = i/100;
        int ju = (i/10)%10;
        int iti = i%10;

        bool flag_100 = false;
        bool flag_10 = false;
        bool flag_1 = false;

        rep(j, n){
            if(!flag_100){
                if(s[j]-'0'==hyaku){
                    flag_100=true;
                    continue;
                }
            }
            if(flag_100 && !flag_10){
                if(s[j]-'0'==ju){
                    flag_10=true;
                    continue;
                }
            }
            if(flag_10 && !flag_1){
                if(s[j]-'0'==iti){
                    ans++;
                    //printf("%d, %d, %d\n", hyaku, ju, iti);
                    flag_1=true;
                    continue;
                }
            }
            if(flag_1) break;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3680
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;

template <class T1, class T2>
ostream& operator << (ostream& out, pair <T1, T2> p)
{
	out << '(' << p.first << ',' << p.second << ')';
	return out;
}

template <class T1, class T2>
istream& operator >> (istream& in, pair<T1, T2> &p)
{
	in >> p.first >> p.second;
	return in;
}

template <class T>
istream& operator >> (istream& in, vector<T> &v)
{
	for (T &x : v)
		in >> x;
	return in;
}

template <class T>
ostream& operator << (ostream& out, vector<vector<T>> &v)
{
	for (vector<T> &x : v)
		out << x << '\n';
	return out;
}

template <class T>
ostream& operator << (ostream& out, vector<T> &v)
{
	for (T &x : v)
		out << x << ' ';
	return out;
}

long long gcd (long long a, long long b)
{
	if (b > a)
		swap(a, b);
	return (b ? gcd(b, a % b) : a);
}

using ll   = long long;
using pii  = pair<int, int>;
using pll  = pair<long long, long long>;
using tiii = pair<pair<int, int>, int>;
using vi   = vector<int>;
using vl   = vector<long long>;
using vvi  = vector<vector<int>>;
using vvl  = vector<vector<long long>>;

#define F          first
#define S          second
#define First      first.first
#define Second     first.second
#define Third      second
#define mp         make_pair
#define rep(i,a,b) for (int i = a; i < b; i++)
#define per(i,b,a) for (int i = b; i > a; i--)
#define all(x)     x.begin(), x.end()
#define ret(x)     return cout << x, 0;
#define throwex    throw runtime_error ("Found the error.");

const int h = 1000000007;

signed main()
{
	ios::sync_with_stdio(false);
	#ifdef ONLINE_JUDGE
	cin.tie(nullptr);
	cout.tie(nullptr);
	cerr.setstate(ios::failbit);
	#endif

	int n;
	cin >> n;
	string s;
	cin >> s;
	vi v(s.size() - 1);
	rep(i,0,s.size() - 1)
		v[i] = abs(int(s[i+1]) - int(s[i]));

	vi f(v.size());
	f[0] = 0;
	rep(i,1,v.size())
	{
		f[i] = f[i-1];
		int x = i;
		while(x % 2 == 0)
		{
			x /= 2;
			f[i]++;
		}
	}
	
	int parity = 0;
	rep(i,0,v.size())
		parity ^= (f[v.size()-1] - f[i] - f[v.size()-1-i] == 0 and (v[i] & 1));
	if(parity == 1)
		ret(1);
	
	for(int& x : v)
		if(x == 1) ret(0) else x /= 2;
	
	parity = 0;
	rep(i,0,v.size())
		parity ^= (f[v.size()-1] - f[i] - f[v.size()-1-i] == 0 and (v[i] & 1));
	if(parity == 1)
		ret(2);
	ret(0);
}


Measured memory_bytes: 9116
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > > 
#define pq_pair_ts priority_queue <pair<ll,ll> > //第二成分の大きさが関係ない
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}


map<pair<ll,ll> , bool> check;
// redはyの大きいものを先にする。
bool forR(pair<ll,ll> a, pair<ll,ll> b){
    return a.second > b.second;
}

// blueはxの小さいものを先にする。
bool forB(pair<ll,ll> a, pair<ll,ll> b){
    return a.first < b.first ;
}

bool chk(pair<ll,ll> red, pair<ll,ll> blue){
    if((red.first < blue.first) && (red.second < blue.second) && (check[red] == false)){
        check[red] = true;
        return true;
    }
    return false;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll N ; cin >> N ;
    vector<pair<ll,ll> > red, blue;

    
    rep(i,N){
        ll a,  b; cin >> a >> b;
        red.pb(mp(a,b));
        check[mp(a,b)] = false;
    }
    rep(i,N){
        ll a, b; cin >> a >> b ;
        blue.pb(mp(a,b));
    }
    sort(all(red), forR);
    sort(all(blue), forB);

    ll ans = 0;
    rep(i, blue.size()){
        rep(j, red.size()){
            if(chk(red[j], blue[i])){
                ans ++;
                break;
            }
        }
    }
    
    cout << ans << endl;
    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using vi=vector<int>;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
template<typename T> void ndarray(vector<T> &vec, int len) { vec.resize(len); }
template<typename T, typename... Args> void ndarray(vector<T> &vec, int len, Args... args) { vec.resize(len); for (auto &v : vec) ndarray(v, args...); }

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    vector<int> a(4,0);
    rep(i,n){
        string s;
        cin >> s;
        if(s[0]=='A') ++a[0];
        else if(s[0]=='W') ++a[1];
        else if(s[0]=='T') ++a[2];
        else if(s[0]=='R') ++a[3];
    }
    cout << "AC" << " " << "x" << " " << a[0] << "\n";
    cout << "WA" << " " << "x" << " " << a[1] << "\n";
    cout << "TLE" << " " << "x" << " " << a[2] << "\n";
    cout << "RE" << " " << "x" << " " << a[3] << "\n";
    return 0;
}   

Measured memory_bytes: 3652
n = int(input())
d = {}
a = list(map(int,input().split()))
for i in range(len(a)):
    d[a[i]+1] = 0
    d[a[i]-1] = 0
    d[a[i]] = 0
for i in range(len(a)):
    d[a[i]+1]+=1
    d[a[i]-1]+=1
    d[a[i]]+=1
l = 0
for key in d:
    if(d[key]>l):
        l=d[key]
print(l)


Measured memory_bytes: 61548
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0; i<n; ++i)
#define rep1(i,n) for(ll i=1; i<=n; ++i)
#define revrep(i,n) for(ll i=n-1; n>=0; --i)
inline constexpr ll Inf = (1ULL << 62) -1;
#define fastio cin.tie(nullptr); ios_base::sync_with_stdio(false);
#define endl '\n'
template <class T> bool updmax(T& a, T b) { if (b > a) { a = b; return true;} return false;}
template <class T> bool updmin(T& a, T b) { if (b < a) { a = b; return true;} return false;}
template <class T> T permutation(ll n, ll k) { T f(1); for (ll i=0; i<k; ++i, --n) f *= n; return f; }
template <class T> T factorial(ll n) { return permutation<T>(n,n); }
template <class T> T binomial(ll n, ll k) { return permutation<T>(n,k) /= factorial<T>(k); }

int main() {
    fastio;
    ll ans=0;
    ll N;
    cin >> N;
    vector<int> p(N), q(N);
    rep(i,N) cin >> p[i];
    rep(i,N) cin >> q[i];
    auto f = [&](vector<int>& v) {
        vector<int> z(N);
        iota(begin(z), end(z), 1);
        int n = 1;
        do {
            if (z == v)
                return n;
            ++n;
        } while (next_permutation(begin(z), end(z)));
        return n;
    };
    int a = f(p);
    int b = f(q);
    ans = abs(a-b);
    cout << ans << endl;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
#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(obj) obj.begin(), obj.end()
#define debug(x) cerr << #x << ":" << x << "\n"
#define vdebug(vec) cerr << #vec << ":"; for (auto e : vec) cerr << e << " "; cout << "\n"
#define YN(f) cout << (f ? "YES" : "NO") << endl
#define Yn(f) cout << (f ? "Yes" : "No") << endl
#define yn(f) cout << (f ? "yes" : "no") << endl
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;

int main () {
	string S, T; cin >> S >> T;
	int A, B; cin >> A >> B;
	string U; cin >> U;
	if (S == U) A--;
	else B--;
	cout << A << " " << B << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a.at(i);
  }
  sort(a.begin(),a.end());
  int ans=0;
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      for(int k=j+1;k<n;k++){
        if(a.at(i)!=a.at(j)&&a.at(j)!=a.at(k)&&a.at(k)!=a.at(i)){
          if(a.at(i)+a.at(j)>a.at(k)&&
          a.at(j)+a.at(k)>a.at(i)&&
          a.at(k)+a.at(i)>a.at(j)){
              ans++;
            }
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}

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

using namespace std;
const int N = 1e5 + 5, OO = 1e9 + 6;
int main() {
#ifndef ONLINE_JUDGE
//	freopen("input.in", "r", stdin);
#endif
	
	int n, k;
	scanf("%d %d", &n, &k);
	long long cnt = n / k, res = cnt * cnt * cnt;
	if (k % 2 == 0) {
		cnt = n / (k / 2);
		cnt = (cnt + 1) / 2;
		res += cnt * cnt * cnt;
	}
	printf("%lld\n", res);
	return 0;
}



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

int main() {
	int n, k;
	cin >> n >> k;
	ll ans = 0;
	for (int i = 0; i < n; i++) {
		int h;
		cin >> h;
		if (h >= k)ans++;
	}
	cout << ans << endl;
}

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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

typedef long long ll;

/* --- INFやMODの値が適切か確認する --- */
// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
// const ll MOD = 1000000007;

int main() {
  int n;
  cin >> n;
  vector<ll> a(n), cnt(n + 1, 0);
  rep(i, n) {
    cin >> a[i];
    cnt[a[i]]++;
  }

  ll ans = 0;
  rep(i, n + 1) ans += cnt[i] * (cnt[i] - 1) / 2;

  rep(i, n) {
    ll tmp = ans;
    tmp -= cnt[a[i]] * (cnt[a[i]] - 1) / 2;
    tmp += (cnt[a[i]] - 1) * (cnt[a[i]] - 2) / 2;
    cout << tmp << endl;
  }
}


Measured memory_bytes: 5760
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

# レベルnバーガー
def f(n, x):
    if n == 0:
        return 0 if x <= 0 else 1
    elif x <= 1 + a[n-1]:
        return f(n-1, x-1)
    else:
        return p[n-1] + 1 + f(n-1, x-2-a[n-1])

n, x = MAP()
a = [0]*n
p = [0]*n
a[0] = 1
p[0] = 1
for i in range(1, n):
    a[i] = a[i-1]*2 + 3
    p[i] = p[i-1]*2 + 1

print(f(n, x))

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

int main(){
    int n, x;
    cin>>n>>x;
    int l[n];
    for(int i=0;i<n;i++){
        cin>>l[i];
    }
    int num = 1;
    int acc = 0;
    for (int i=0;i<n;i++){
        acc += l[i];
        if(acc > x){
            break;
        }
        num += 1;
    }
    cout<<num<<endl;
    return 0;
}


Measured memory_bytes: 256
A,B,C = map(int, input().split())
cnt = 0
if A%2 or B%2 or C%2:
    print(cnt)
    exit()
if A == B and B == C:
    print(-1)
    exit()
while True:
    if A%2 or B%2 or C%2:
        print(cnt)
        break
    temp_a = A//2
    temp_b = B//2
    temp_c = C//2
    A += 2*temp_a + temp_b + temp_c
    B += 2*temp_b + temp_a + temp_c
    C += 2*temp_c + temp_a + temp_b
    cnt += 1

Measured memory_bytes: 38256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
#include <numeric>
#include <fstream>
#include <queue>
#include <cstdio>
#include <deque>
#define fol(i,n) for(int i=0;i<n;i++)
#define db(a) cout << a<< endl;
using namespace std;

int main(){
    int a,b;
    cin >>a>>b;
    if (a%3==0||b%3==0||(a+b)%3==0) cout << "Possible"<<endl;
    else cout << "Impossible" <<endl;
    return 0;
}


Measured memory_bytes: 768
#include <cstdio>

int main()
{
  using namespace std;

  int H, W;
  scanf("%d %d", &H, &W);
  
  char* c = new char[W];
  for (auto i = 0; i < H; ++i)
  {
    scanf("%s", c);
    printf("%s\n%s\n", c, c);
  }
  delete[] c;
  
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
 
int main(void){
    int n, x;
    cin>>n>>x;
    vector<int> v(n);
    rep(i, n) cin>>v[i];
    sort(v.begin(), v.end());
    x -= accumulate(v.begin(), v.end(), 0);
    int ans = v.size();
    while(x>=0){
        x -= v[0];
        if(x>=0) ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256