akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <random>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define int ll
//#define int unsigned __int128
//#define ll unsigned __int128
typedef pair<int, int   > pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef vector< vvi > vvvi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<string> vst;
typedef vector<vst> vvst;
typedef pair<ld, ld> pld;
typedef complex<double> base;

#define inmin(a, b) a = min(a, (b))
#define inmax(a, b) a = max(a, (b))
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define sqr(x) ((x) * (x))
#define fori(i, n) for(int i = 0; i < (int)(n); ++i)
#define SZ(a) ((int)((a).size()))
#define triple(T) tuple<T, T, T>
#define quad(T) tuple<T, T, T, T>
#define watch(x) cerr << (#x) << " = " << (x) << endl;

#ifdef RUS_HOME
#define cerr cout
#else
#define cerr if (false) cerr
#endif

const double PI = 2 * acos(0.0);

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng_64(chrono::steady_clock::now().time_since_epoch().count());

const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";

template <class T0, class T1>
inline ostream & operator << (ostream &out, pair<T0, T1> &a) {
    return out << "{" << a.first << ", " << a.second << "}";
}

template <class T0, class T1, class T2>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << "}";
}

template <class T0, class T1, class T2, class T3>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2, T3> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << ", " <<  get<3>(a) << "}";
}

template<class T>
inline ostream & operator << (ostream &out, vector<T> &a) {
    out << "[";
    fori (i, a.size())
        out << a[i] << vector<string>{", ", "]  "}[i + 1 == a.size()];
    return out;
}



void smain();

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

#ifdef RUS_HOME
    freopen("input.txt", "r", stdin);
    clock_t start = clock();
#else
    //freopen("dictionary.in", "r", stdin);
    //freopen("dictionary.out", "w", stdout);
#endif
    cout << setprecision(12) << fixed;
    smain();
#ifdef RUS_HOME
    cout << "\n\n\n\nTOTAL EXECUTION TIME: " << float( clock () - start ) /  CLOCKS_PER_SEC << endl;
#endif
    return 0;
}

void smain() {
    int n;
    cin >> n;
    vi a(2 * n);
    for (int i = 0; i < 2 * n; i++)
        cin >> a[i];
    sort(ALL(a));
    int ans = 0;
    for (int i = 0; i < 2 * n; i += 2) {
        ans += min(a[i], a[i + 1]);
    }
    cout << ans;

}

Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;

int main(void) {
	int x;
	cin >> x;
	int sum=0;
	for(int i=1; i<=x; i++){
		sum+=i;
		if(sum>=x){
			cout << i << endl;
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 256
tea = list(map(int,input().split()))
tea[0] *= 4
tea[1] *= 2
N = int(input())
mintea = 0
double = tea[3]
single = min(tea[0:3])
if N == 1:
    print(single)
else:
    print(min(N//2*double + N%2*single,N*single))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vc = vector<char>;
using vvl = vector<vl>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;

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

  stable_sort(S.begin(), S.end());

  if(S == "abc")
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int n,a[101];
	cin>>n;
	for(int i=1;i<=n;i++)
	cin>>a[i];
	for(int i=1;i<=n;i++)
	{
		if(a[i]%2==0)
		{
			if(a[i]%3!=0&&a[i]%5!=0)
			{
				cout<<"DENIED";
				return 0;
			}
		}
	}
	cout<<"APPROVED";
	return 0;
}

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

int main() {
    int n, k; cin >> n >> k;
    vector<int> a(n, 0), b(n, 0);

    for(int i = 0; i < n; ++i) {
        cin >> a[i] >> b[i];
    }
    
    long long ans = 0;

    while(k > 0) {
        int bit = 1;
        while(2 * bit <= k)
            bit *= 2;

        long long temp = 0;
        for(int i = 0; i < n; ++i) {
            if(a[i] < bit) {
                temp += b[i];
            }
        }
        ans = max(ans, temp);
        for(int i = 0; i < n; ++i) {
            if((a[i] & bit)) {
                a[i] -= bit;
            }
        }
        k -= bit;
    }
    
    long long temp = 0;

    for(int i = 0; i < n; ++i) {
        if(a[i] == 0)
            temp += b[i];
    }

    ans = max(ans, temp);
    
    cout << ans << "\n";
}

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

#define N (101)

using namespace std;

typedef long long int Int;

bool field[N][N];

inline int Solve(int w,int h)
{
    int sum = 0;
    for(int i = 0;i < w;i++)
	for(int j = 0;j < h;j++)
	    if(!field[i][j])
		sum++;

    return sum;
}

inline void Paint(int x,int y,int a)
{
    if(a == 1)
    {
	for(int w = 0;w < x;w++)
	    for(int h = 0;h < N;h++)
		field[w][h] = true;
    } else if(a == 2)
    {
	for(int w = x;w < N;w++)
	    for(int h = 0;h < N;h++)
		field[w][h] = true;
    } else if(a == 3) {
	for(int w = 0;w < N;w++)
	    for(int h = 0;h < y;h++)
		field[w][h] = true;
    } else {
	for(int w = 0;w < N;w++)
	    for(int h = y;h < N;h++)
		field[w][h] = true;
    }

    return;
}

int main(void)
{
    int w,h,n;
    cin>>w>>h>>n;
    for(int i = 0;i < n;i++)
    {
	int x,y,a;
	cin>>x>>y>>a;

	Paint(x,y,a);
    }

    cout<<Solve(w,h)<<endl;

    return 0;
}



Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <climits> // FOO_MAX, FOO_MIN
#include <cmath> 
#include <cstdlib> // abs(int), labs(long int), llabs(llint)

#define roundup(n,d) ( ((n) + ((d)-1)) / (d) )
#define ll long long

using namespace std;

int main(void){
    int n, m, x;
    cin >> n >> m >> x;

    vector<int> a(m);
    for(int i = 0;i < m;i++){
        cin >> a[i];
    }

    int tall_count = 0;
    for(int i = 0;i < m;i++){
        if(a[i] >= x){
            break;
        }
        tall_count++;
    }

    cout << min(tall_count, m-tall_count) << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int T = stdIn.nextInt();
		long sum = 0;
		
		int temp = stdIn.nextInt();
		for(int i = 1; i < N; i++) {
			int t = stdIn.nextInt();
			if(t-temp < T) sum += t-temp;
			else sum += T;
			temp = t;
		}
		sum += T;
		
		System.out.println(sum);

	}

}

Measured memory_bytes: 61364
let K = stdin.ReadLine() |> int

let rec gcd a b =
    match (a, b) with
    | (x, 0) -> x
    | (0, y) -> y
    | (a, b) -> gcd b (a % b)

seq {
    for i in 1..K do
        for j in 1..K do
            for k in 1..K do
                yield gcd i (gcd j k)
}
|> Seq.sum
|> stdout.WriteLine


Measured memory_bytes: 31228
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
const ll mod = 1e9+7;
ll a[200005];
void solve(){
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)cin>>a[i];
    ll sum = 0;
    ll ans = 0;
    for(int i=1;i<=n;i++){
        ans+=a[i]*sum;
        ans%=mod;
        sum+=a[i];
        sum%=mod;
    }
    cout<<ans<<endl;
}
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
//    cin>>t;
    while(t--)solve();
    return 0;
}


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

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf=1e9;
const int64_t inf64=1e18;
const double eps=1e-9;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
    os << "[";
    for (const auto &v : vec) {
    	os << v << ",";
    }
    os << "]";
    return os;
}

void solve(){
    int n,m,mod=1000000007;
    cin >> n >> m;
    static int64_t dp[301][301][301]; //何日,行ったことのある頂点の数、強連結な頂点の数
    dp[0][1][1]=1;
    rep(i,0,m){
        rep(j,1,n+1){
            rep(k,1,j+1){
                if(j!=n) dp[i+1][j+1][k]=(dp[i+1][j+1][k]+dp[i][j][k]*(n-j)%mod)%mod;
                dp[i+1][j][k]=(dp[i+1][j][k]+dp[i][j][k]*(j-k)%mod)%mod;
                dp[i+1][j][j]=(dp[i+1][j][j]+dp[i][j][k]*k%mod)%mod;
            }
        }
    }
    cout << dp[m][n][n] << endl;
}

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(10);
    solve();
    return 0;
}


Measured memory_bytes: 212608
#include<stdio.h>

int main(void)
{
	int x = 0, y = 0;
	int i, j;
	for (i = 0; i <= 3000; i++) {
		scanf("%d", &x);
		scanf("%d", &y);
		if (y < x) {
			j = x;
			x = y;
			y = j;
		}
		if (x == 0 && y == 0) {
			break;
		}

		printf("%d %d\n", x, y);
		
	}
	
	return 0;
}


Measured memory_bytes: 2040
#include <bits/stdc++.h>
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w
using namespace std;

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
const int INF=1e+9;
const double EPS=1e-9;
const int MOD=1000000007;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

signed main(){
	int n,s[500],c[500],f[500];
	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 t = 0;
		for(int j = i;j < n - 1;j++){
			t = max(t,s[j]);
			t = (((int)((t - 1) / f[j])) + 1) * f[j];
			t += c[j];
		}
		cout << t << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <algorithm>
#define _USE_MATH_DEFINES
#include<math.h>
using namespace std;

int main() {
	int R;
	cin >> R;
	cout << 2 * R * M_PI << endl;

	return 0;
}

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

typedef long long ll;
typedef vector<int> Vi;
typedef vector<ll> Vl;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;


//===

const ll mod = ll(1e9 + 7);

class ModComb {
private:
	Vl fac, inv, finv;
public:
	ModComb(ll n) : fac(n), inv(n), finv(n) {
		fac[0] = fac[1] = 1;
		finv[0] = finv[1] = 1;
		inv[1] = 1;
		for (ll i = 2; i < n; ++i) {
			fac[i] = fac[i - 1] * i % mod;
			inv[i] = mod - inv[mod % i] * (mod / i) % mod;
			finv[i] = finv[i - 1] * inv[i] % mod;
		}
	}

	ll comb(ll n, ll k) {
		if (n < k) return 0;
		if (n < 0 || k < 0) return 0;
		return fac[n] * (finv[n - k] * finv[k] % mod) % mod;
	}

	ll get_fac(ll n) {
		return fac[n];
	}
};




ll mpow(ll a, ll n) {
	ll res = 1;
	while (n != 0) {
		if (n & 1) res = res * a % mod;
		n >>= 1;
		a = a * a % mod;
	}
	return res;
}

int main() {
	int N, K;
	cin >> N >> K;
	int M = N - K;

	ModComb mc(N + 1);
	Vl ans(K);
	for (int i = 0; i < K; ++i) {
		ll a = mc.comb(K - 1, i);
		ll b = mc.comb(M + 1, i + 1);
		ll tmp = a * b % mod;
		ans[i] = tmp;
	}
	for (const auto& v : ans) {
		cout << v << endl;
	}
}


Measured memory_bytes: 256
N, M, V, P = map(int, input().split())
As = list(map(int, input().split()))

As.sort(reverse=True)

scoreP = As[P-1]

def isOK(k):
    if k < P or As[k] == scoreP:
        return True

    scoreK = As[k] + M
    if scoreK < scoreP:
        return False

    rest = M*(V-1)
    rest -= M*(P-1)
    if rest <= 0:
        return True

    for i in range(P-1, N):
        if i != k:
            rest -= min(M, scoreK-As[i])
    if rest <= 0:
        return True

    return False


ng, ok = N, -1
while abs(ok-ng) > 1:
    mid = (ng+ok) // 2
    if isOK(mid):
        ok = mid
    else:
        ng = mid

print(ok+1)


Measured memory_bytes: 62780
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>

using namespace std;

#define REP(i,n) for(int i=0;i<int(n);i++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef long long ll;
typedef pair<int,int> P;

int main(void){
	int i;

	cin.tie(0);
	ios_base::sync_with_stdio(false);

	string s;
	cin >> s;
	int n=s.size(),x=-1,y=-1;
	for(i=0;i<n;i++){
		if(s[i]=='C'){
			x=i; break;
		}
	}
	for(i=n;i>=0;i--){
		if(s[i]=='F'){
			y=i; break;
		}
	}

	if(x==-1 || y==-1 || x>y) cout << "No" << endl;
	else cout << "Yes" << endl;



	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long a,b,c,k;
	scanf("%lld %lld %lld",&a,&b,&c);
	if(a%2==0||b%2==0||c%2==0)printf("0");
	else 
	{
		for(int i=1;i<10;i++)
		{
			if(a>b)
			{
				k=a;
				a=b;
				b=k;
			}
			if(b>c)
			{
				k=b;
				b=c;
				c=k;
			}	
		}
		printf("%lld",a*b);
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define req(i,n) for(long long i=n-1; i>=0; i--)
#define range(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define onBoard(y,x) (y>=0 && y<h && x>=0 && x<w)
#define pri_que priority_queue
#define vint vector<int>
#define vvint vector<vector<int>>
#define vi vector<int>
#define vvi vector<vector<int>>
#define vs vector<string>
#define vvc vector<vector<char>>
#define vc vector<char>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define show(x) cout<<#x<<"="<<x<<endl;
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a/gcd(a,b)*b;}
const long long dx[8]={1,0,-1,0,1,-1,-1,1};
const long long dy[8]={0,1,0,-1,1,1,-1,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;

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

    int n; cin>>n;
    vint a(n); rep(i,n)cin>>a[i];
    int res=0;
    range(i,1,n-1){
        if(a[i-1]<a[i] && a[i]<a[i+1]) res++;
        if(a[i-1]>a[i] && a[i]>a[i+1]) res++;
    }
    cout<<res<<endl;

}

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

int check(string s,string t){
  int ss=s.size(),tt=t.size();
  for(int i=0;i<tt;i++){
    for(int d=1;1+i+d*(ss-1)<=tt;d++){
      bool f=1;
      for(int p=0;p<ss;p++){
        if(s[p]!=t[i+p*d]){
          f=0;
          break;
        }
      }
      if(f)return 1;
    }
  }
  return 0;
}

int main(){
  int n;
  int count=0;
  string s,t;
  cin>>n>>s;
  for(int i=0;i<n;i++){
    cin>>t;
    count+=check(s,t);
  }
  cout<<count<<endl;
  return 0;
}

Measured memory_bytes: 3148
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    let n: usize = io.read();
    let a = io.readn::<i64>(n);
    let mut ans = 0i64;

    for d in 0..60 {
        let mut czero = 0;
        let mut cone = 0;
        for i in 0..n {
            if a[i] >> d & 1 == 1 {
                cone += 1;
            } else {
                czero += 1;
            }
        }
        let mut t = (1i64 << d) % MOD;
        let c = (cone * czero) % MOD;
        t = (t * c) % MOD;
        ans = (ans + t) % MOD;
    }
    io.writeln(ans);
}

static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}


Measured memory_bytes: 8444
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
    string str;
    ll n; cin>>n;
    while(n){
        str+='a'-1+(n%26==0?26:n%26);
        if(n%26==0)n--;
        n/=26;
    }
    reverse(str.begin(),str.end());
    cout<<str<<'\n';
}

Measured memory_bytes: 3628
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());

		sc.close();

		if(N <= 599) {
			System.out.println(8);
		}else if(N <= 799) {
			System.out.println(7);
		}else if(N <= 999) {
			System.out.println(6);
		}else if(N <= 1199) {
			System.out.println(5);
		}else if(N <= 1399) {
			System.out.println(4);
		}else if(N <= 1599) {
			System.out.println(3);
		}else if(N <= 1799) {
			System.out.println(2);
		}else if(N <= 1999) {
			System.out.println(1);
		}

	}

}

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

#ifdef _DEBUG
#define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " ->  " << #x << " = " << x << endl
#else
#define debug(x)
#endif

#define all(s) begin(s), end(s)
#define rall(s) rbegin(s), rend(s)
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = ((a)-1); i >= (b); i--)
#define pb push_back
#define sz(a) int((a).size())
#define put(a) ((cout) << (a) << (endl))
#define putf(a, n) ((cout) << (fixed) << (setprecision(n)) << (a) << (endl))
#define deg2rad(x) (((x)*PI) / (180.0))
#define rad2deg(x) (((x) * (180.0)) / PI)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_ll = pair<ll, ll>;
using d_ll = pair<double, ll>;
using ll_d = pair<ll, double>;
using d_d = pair<double, double>;
template <class T> using vec = vector<T>;

static constexpr ll LL_INF = 1LL << 60;
static constexpr int I_INF = 1 << 28;
static constexpr double PI = static_cast<double>(3.14159265358979323846264338327950288);
static constexpr double EPS = numeric_limits<double>::epsilon();

static map<type_index, const char* const> scanType = {
    {typeid(int), "%d"}, {typeid(ll), "%lld"}, {typeid(double), "%lf"}, {typeid(char), "%c"}};

template <class T> static void scan(vector<T>& v);
[[maybe_unused]] static void scan(vector<string>& v, bool isWord = true);
template <class T> static inline bool chmax(T& a, T b);
template <class T> static inline bool chmin(T& a, T b);
template <class T> static inline T gcd(T a, T b);
template <class T> static inline T lcm(T a, T b);
template <class A, size_t N, class T> static void Fill(A (&arr)[N], const T& val);
template <class T> T mod(T a, T m);

int main(int argc, char* argv[]) {
  long long N;
  scanf("%lld", &N);
  std::vector<long long> T(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &T[i]);
  }
  sort(all(T));
  T.erase(unique(all(T)), end(T));

  ll ans = 1;
  rep(i, 0, sz(T)) { ans = lcm(ans, T[i]); }
  put(ll(ans));
  return 0;
}

template <class T> static void scan(vector<T>& v) {
  auto tFormat = scanType[typeid(T)];
  for (T& n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string>& v, bool isWord) {
  if (isWord) {
    for (auto& n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

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;
}

template <class T> inline T gcd(T a, T b) { return __gcd(a, b); }

template <class T> inline T lcm(T a, T b) {
  T c = min(a, b);
  T d = max(a, b);
  return c * (d / gcd(c, d));
}

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

template <class T> T mod(T a, T m) { return (a % m + m) % m; }


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

using namespace std;

#define int ll

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

ii get(int x){
	ii ret = {0, 0};
	while(x%2 == 0){
		x /= 2;
		ret.first ++;
	}
	while(x%5 == 0){
		x /= 5;
		ret.second ++;
	}
	return ret;
}

const int N = 2e5+100, M = 51;

ii a[N];
int cnt[M];

signed main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	int n;cin >> n;
	int ans=0;
	for(int i=0 ; i<n ; i++){
		string s;cin >> s;
		int d=0, m=0;
		bool f = false;
		for(int i=0 ; i<s.size() ; i++){
			if(s[i] == '.'){
				f = true;
				continue;
			}
			d *= 10;
			if(f)
				m ++;
			d += int(s[i] - '0');
		}
		ii p = get(d), q = ii(m, m);
		a[i] = ii(p.first - q.first, p.second - q.second);
		if(a[i].first >= 0 && a[i].second >= 0)
			ans --;
	}
	sort(a, a+n);
	int it = n-1;
	for(int i=0 ; i<n ; i++){
		while(it>=0 && a[i].first + a[it].first >= 0)
			cnt[a[it --].second + 25] ++;
		int c = 25-a[i].second;
		for(int j=c ; j<M ; j++)
			ans += cnt[j];
	}
	cout << ans/2 << "\n";
    return 0;
}


Measured memory_bytes: 6756
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#include<queue>

using namespace std;

typedef long long ll;
typedef std::pair<int, int> ipair;

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

int N;

vector<ll> compress(ll *x1, ll *x2) {
   vector<ll> xs(0);

   for (int i = 0; i < N; i++) {
      xs.push_back(x1[i]);
      xs.push_back(x2[i]);
   }
   
   sort(xs.begin(), xs.end());
   xs.erase(unique(xs.begin(), xs.end()), xs.end());

   return xs;
}

int main() {
   int K;
   cin >> N >> K;
   ll X1[N], Y1[N], Z1[N], X2[N], Y2[N], Z2[N];

   for (int i = 0; i < N; i++) {
      cin >> X1[i] >> Y1[i] >> Z1[i] >> X2[i] >> Y2[i] >> Z2[i];
   }

   vector<ll> XS = compress(X1, X2);
   vector<ll> YS = compress(Y1, Y2);
   vector<ll> ZS = compress(Z1, Z2);
   int XL = XS.size();
   int YL = YS.size();
   int ZL = ZS.size();

   ll ans = 0;
   for (int x = 0; x < XL - 1; x++) {
      for (int y = 0; y < YL - 1; y++) {
         for (int z = 0; z < ZL - 1; z++) {
            int cnt = 0;
            for (int i = 0; i < N; i++) {
               if (X1[i] > XS[x]) continue;
               if (X2[i] < XS[x + 1]) continue;
               if (Y1[i] > YS[y]) continue;
               if (Y2[i] < YS[y + 1]) continue;
               if (Z1[i] > ZS[z]) continue;
               if (Z2[i] < ZS[z + 1]) continue;
               cnt++;
            }
            if (cnt >= K) {
               ans += (XS[x + 1] - XS[x]) * (YS[y + 1] - YS[y]) * (ZS[z + 1] - ZS[z]);
            }
         }
      }
   }
   cout << ans << endl;

   return 0;
}



Measured memory_bytes: 3148
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;
ll MOD = 1e9 + 7;

int N, A, B, C;
vector<int> l;

int dfs(int cur, int a, int b, int c) {
    if (cur == N) {
        if (min(a, min(b, c)) > 0) {
            return abs(A - a) + abs(B - b) + abs(C - c) - 30;
        } else {
            return 1e9;
        }
    }
    // cout << cur << endl;
    int ret0 = dfs(cur + 1, a, b, c);
    int ret1 = dfs(cur + 1, a + l[cur], b, c) + 10;
    int ret2 = dfs(cur + 1, a, b + l[cur], c) + 10;
    int ret3 = dfs(cur + 1, a, b, c + l[cur]) + 10;
    return min(ret0, min(ret1, min(ret2, ret3)));
}

int main() {
    cin >> N >> A >> B >> C;
    l.resize(N);
    for (int i = 0; i < N; i++) {
        cin >> l[i];
    }
    cout << dfs(0, 0, 0, 0) << endl;
    return 0;
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(v) v.bigin(),v.end()
#define MAX(a,b) a=a>b?a:b
#define MIN(a,b) a=a<b?a:b
#define R(a) a=sqrt(a)
#define POW(a,b) a=pow(a,b)
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int main(){
    FAST;
    ll n,x,t,ans;
    cin>>n>>x>>t;
    if(n%x==0){
        ans=n/x*t;
    }
    else{
        ans=(n/x+1)*t;
    }
    cout<<ans;
    
}



Measured memory_bytes: 3608
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author yosiiii
 */


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

class ABlackjack {
public:
	void solve(std::istream& in, std::ostream& out) {
        int a[3];
        int su=0;
        rep(i,3){
            in >> a[i];
            su+=a[i];
        }
        if(su>=22){
            out << "bust" << endl;
        }else{
            out << "win" << endl;
        }
	}
};


int main() {
	ABlackjack solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
//int a = stoi(c); 文字列をintへ
//小文字から大文字
//transform(a.begin(), a.end(), a.begin(), ::toupper);
//数値計算 個数以外はdouble
//map<キー,値> p は辞書。p[キー] = 値
//map 全探索
//auto begin = p.begin(), end = p.end();
//for (auto it = begin; it != end; it++) {}
//mapのキー：it->first mapのバリュー：it->second
//大文字判定 isupper(文字) 小文字判定 islower(文字)
//do{}while(next_permutation(ALL(配列)))
//小文字に対応する文字コード：S[i] - 'a'
//文字コード→小文字：(char)(数字+'a')
//グラフの距離:隣接行列で扱う
//bool型　初期値はTrue
//島渡りの問題：中間ノードに着目
//背反な事象にちゃんとわける
//チェックリストはマップを使う
//数が大きい時の比較はstring型で行う
//全て0になったか調べたい->0になるたびにcntする
//例外処理は最初にする
//x = p^m + q^n...の約数の個数:(n+1)*(m+1)....
//N!のどの素因数で何回割れるか
//⇔1~Nまでの数がそれぞれどの素因数で何回割り切れるかの和
//パズルの問題->一般化して全探索
//数が大きい時のせぐふぉはコードテストで試してみる
//stack<ll> s;
//s.push(要素);s.top();s.pop();
//queue<ll> q;
//q.push(要素);q.front();q.pop();
//同じ作業繰り返す系の問題：収束先を見つける
//関係性は隣接行列で記録
//過半数：N/2.0で判定
//ある量からある量を引く系の問題：端から定義してやる
#include <bits/stdc++.h>
#define rep(i,N) for(int i = 0; i < N;i++)
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
using namespace std;

//円周率
const double PI = 3.14159265358979323846;
//割るやつ
const ll MOD = (pow(10, 9) + 7);

// K進数でのNの桁数
ll dig(ll N, ll K) {
	ll dig = 0;
	while (N) {
		dig++;
		N /= K;
	}
	return dig;
}
// a,bの最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}

//a,bの最小公倍数
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}

//階乗計算
ll f(ll n) {
	if (n == 0 || n == 1) return 1;
	else return (n * f(n - 1));
}

//Nのd桁目の数
ll dignum(ll N, ll d) {
	ll x = pow(10, d);
	N %= x;
	ll y = pow(10, d - 1);
	N /= y;
	return N;
}

//Nをdで何回割れるか
ll divcnt(ll N, ll d) {
	ll ans = 0;
	while (1) {
		if (N%d == 0) {
			ans++;
			N /= d;
		}
		else break;
	}

	return ans;
}

//素数判定
bool prime(ll num) {
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false;
	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2) {
		if (num % i == 0) return false;
	}
	return true;
}

//フィボナッチ数列
vector<ll> memo(pow(10, 6) + 1);
ll fibo(ll n) {
	if (n == 1) return 1;
	else if (n == 2) return 1;
	else if (memo[n] != 0) return memo[n];
	else return memo[n] = fibo(n - 1) + f(n - 2);
}

int main() {
	string S; cin >> S;
	if (S == "ABC") cout << "ARC" << endl;
	else cout << "ABC" << endl;
}

Measured memory_bytes: 10880
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    ans = 1
    threshold = 1000000000000000000
    if 0 in A:
        print(0)
        exit()

    for x in A:
        ans *= x
        if (ans > threshold):
            print(-1)
            exit()
    print(ans)


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()


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

using namespace std;
const int maxn = 1010;
const int maxw = 2e4+10;

int n;
struct block {
    int w, s, v;

    block() {}
    block(int w, int s, int v) {
        this->w = w;
        this->s = s;
        this->v = v;
    }
} niz[maxn];

bool cmp(block &a, block &b) {
    return a.w + a.s < b.w + b.s;
}
long long dp[maxn][maxw];

int main() {
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        int a, b, c;
        scanf("%d%d%d", &a, &b, &c);
        niz[i] = block(a, b, c);
    }
    sort(niz, niz+n, cmp);

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j < niz[i - 1].w; j++)
            dp[i][j] = max(dp[i][j - 1], dp[i - 1][j]);

        for (int j = niz[i - 1].w; j <= niz[i - 1].s + niz[i - 1].w + 0; j++)
            dp[i][j] = max(dp[i][j - 1], max(dp[i - 1][j], dp[i - 1][j - niz[i - 1].w] + (long long)niz[i - 1].v));

        for (int j = niz[i - 1].s + niz[i - 1].w + 1; j < maxw - 5; j++)
            dp[i][j] = max(dp[i][j - 1], dp[i - 1][j]);
    }

    /**
    for (int i = 0; i < n; i++)
        printf("%d %d %d\n", niz[i].w, niz[i].s, niz[i].v);
    printf("\n");
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= 10; j++) {
            printf("%lld ", dp[i][j]);
        }
        printf("\n");
    }
    **/

    printf("%lld", dp[n][maxw - 10]);
    return 0;
}


Measured memory_bytes: 157824
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <bitset>
#include <numeric>
#include <unordered_set>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <numeric>
#include <cstdlib>
#include <random>
#include <bits/stdc++.h>


using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;

const ll mod=1000000007ll;
const ll inf=1000000000000000ll;

const ll MAX_N=1000;

ll a,b;

int main(){
  cin>>a>>b;
  ll N=b-a;
  ll ans=0;
  for(ll i=1;i<=N;i++){
    ans+=i;
  }
  ans-=b;
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import static java.lang.Integer.parseInt;

/**
 * Tile
 */
public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		String[] words;

		int N, K;
		N = parseInt(br.readLine());
		K = parseInt(br.readLine());

		for (int i = 0; i < K; i++) {
			line = br.readLine();
			
			int a, b;
			a = parseInt(line.substring(0, line.indexOf(' ')));
			b = parseInt(line.substring(line.indexOf(' ') + 1));

			int min;
			min = Math.min(Math.min(a - 1, N - a), Math.min(b - 1, N - b));
			System.out.println((min % 3) + 1);
		}
	}
}

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

const int maxn=100010;
int a[maxn],n;
char s[20];

void get(int x)
{
	printf("%d\n",x);
	fflush(stdout);
	scanf("%s",s);
	if (s[0]=='M')
	{
		a[x]=2;
	}
	if (s[0]=='F')
	{
		a[x]=3;
	}
	if (s[0]=='V')
	{
		a[x]=1;
	}
}
int ha;
void doit(int l,int r)
{
	while (l<=r)
	{
		int mid=(l+r)>>1;
		get(mid);
		if (a[mid]==1)	return;
		if (((mid&1)^ha)!=a[mid])	r=mid-1;else l=mid+1;
	}
	return;
}
int main()
{
	scanf("%d",&n);
	get(0);
	if (a[1]==1)	return 0;
	get(n/2);
	if (a[n/2]==1) 	return 0;
	ha=a[0];
	if ((((n/2)&1)^ha) != a[n/2])	doit(1,n/2-1);else doit(n/2+1,n-1);
	return 0;
}

Measured memory_bytes: 852
#include<cstdio>
#include<algorithm>
#include<functional>
#include<cstring>
using namespace std;
int main(void)
{
	int i,n,cnt,len;
	char s[101];
	scanf("%s",s);
	len=strlen(s);
	cnt=0;
	for(i=0;i<len/2;i++)	{
		if(s[i]!=s[len-i-1])	cnt++;
	}
	printf("%d\n",cnt);
	return 0;
}


Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define Nmax 200010
#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
typedef long long ll;

int main() {
	int N;
	vector<ll> A(100010);
	cin >> N;
	REP(i,N) cin >> A[i];
	sort(A.begin(), A.end());
	reverse(A.begin(), A.end());
	ll fin=0,ans=1;
	REP(i,N-1){
      	if(A[i]==0) break;
		if(A[i]==A[i+1]){ ans*=A[i]; fin++; i++;}
		if(fin==2) break;
	}
  	if(fin==0 || fin==1) ans=0;
	cout << ans << endl;
	return 0;
}

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


void solve(long long N, std::vector<std::string> S){
    map<string, long long> votes;
    for(int i=0; i < N; i++){
        votes[S[i]]++;
    }
    long long current_max = 0;
    for(auto iter: votes){
        current_max = max(current_max, iter.second);
    }
    for(auto iter: votes){
        if(iter.second == current_max){
            cout << iter.first << endl;
        }
    }
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<std::string> S(N);
    for(int i = 0 ; i < N ; i++){
        std::cin >> S[i];
    }
    solve(N, std::move(S));
    return 0;
}


Measured memory_bytes: 26880
#include<bits/stdc++.h>
using namespace std;
#define MAXLOG	31
#define MAXN	100005
#define P	1000000007
long long unblock[3][3] = {{2, 2, 1}, {1, 1, 1}, {1, 0, 1}};
long long blocked[3][3] = {{1, 2, 1}, {0, 1, 1}, {0, 0, 1}};
long long now[1][3], tmp[1][3], matrix[MAXLOG][3][3];
int n, m, x[MAXN];
void Unblock(int s) {
	for (int p = 0; p < MAXLOG; p++) {
		int tnp = 1 << p;
		if (tnp & s) {
			memset(tmp, 0, sizeof(tmp));
			for (int i = 0; i <= 0; i++)
			for (int j = 0; j <= 2; j++)
			for (int k = 0; k <= 2; k++) {
				tmp[i][j] += now[i][k] * matrix[p][k][j];
				tmp[i][j] %= P;
			}
			for (int i = 0; i <= 2; i++)
				now[0][i] = tmp[0][i];
		}
	}
}
void Blocked() {
	memset(tmp, 0, sizeof(tmp));
	for (int i = 0; i <= 0; i++)
	for (int j = 0; j <= 2; j++)
	for (int k = 0; k <= 2; k++) {
		tmp[i][j] += now[i][k] * blocked[k][j];
		tmp[i][j] %= P;
	}
	for (int i = 0; i <= 2; i++)
		now[0][i] = tmp[0][i];
}
int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= m; i++)
		scanf("%d", &x[i]);
	now[0][0] = 1;
	for (int i = 0; i <= 2; i++)
	for (int j = 0; j <= 2; j++)
		matrix[0][i][j] = unblock[i][j];
	for (int p = 1; p < MAXLOG; p++)
	for (int i = 0; i <= 2; i++)
	for (int j = 0; j <= 2; j++)
	for (int k = 0; k <= 2; k++) {
		matrix[p][i][j] += matrix[p - 1][i][k] * matrix[p - 1][k][j];
		matrix[p][i][j] %= P;
	}
	for (int i = 1; i <= m; i++) {
		Unblock(x[i] - x[i - 1] - 1);
		Blocked();
	}
	Unblock(n - x[m]);
	printf("%lld\n", now[0][2]);
	return 0;
}

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

int main(){
  int arr[3];
  for(int i=0; i<3; i++) cin >> arr[i];
  sort(arr, arr+3);
  if(arr[0] == 5 && arr[1] == 5 && arr[2] == 7) cout << "YES" << endl;
  else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
using ull = unsigned long long;
constexpr ull mod = 1e9 + 7;
int main(){
  int n;
  bool flag = true;
  cin >> n;
  vector<int> a(n);
  vector<int> cnt((n+1)/2, 0);
  for(int i = 0; i < n; i++){
    cin >> a[i];
    if(n%2){
      if(a[i] < n && a[i]%2==0){
        cnt.at(a[i]/2)++;
      }
    }else{
      if(a[i] < n && a[i]%2){
        cnt.at(a[i]/2)++;
      }
    }
  }

  if(n%2 && cnt[0] != 1)
    flag = false;
  ull ans = 1;
  for(int i = n%2; i < (n+1)/2; i++){
    if(cnt[i] != 2){
      flag = false;
      break;
    }
    ans = ((ans%mod)*2)%mod;
  }
  if(flag) cout << ans << "\n";
  else cout << 0 << "\n";

  return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
  }

  int sum = 0;
  for (auto v : m) {
    int tmp = v.second - v.first;
    if (tmp < 0) {
      sum += v.second;
    } else {
      sum += tmp;
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 5120
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){

  int n,q;
  vector<int> a(1000);
  cin>>n;
  for(int i=0;i<n;i++) cin>>a[i];
  cin>>q;
  for(int i=0;i<q;i++){
    int b,e;
    cin>>b>>e;
    reverse(a.begin()+b,a.begin()+e);
  }
  for(int i=0;i<n;i++){
    if(i) cout<<" ";
    cout<<a[i];
  }
  cout<<endl;
  return 0;
}



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

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
#define MP make_pair
#define PB push_back
#define X first
#define Y second

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))
#define debug(a) cerr << #a << " = " << a << endl;

template<typename T> void setmax(T& x, T y) {x = max(x, y);}
template<typename T> void setmin(T& x, T y) {x = min(x, y);}

const double PI = acos(-1.0);
const LL INF = 1e9 + 47;
const LL LINF = INF * INF;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	
	set<int> s;
	int x, y, z;
	cin >> x >> y >> z;
	s.insert(x);
	s.insert(y);
	s.insert(z);
	cout << (SZ(s) == 2 ? "Yes" : "No") << endl;
	
	cerr << "Time elapsed: " << clock() / (double)CLOCKS_PER_SEC << endl;
	return 0;
}



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

int main(void){
	bool t[3] = {true,false,false};
	char a,b,ch;

	while(cin>>a>>ch>>b){
		swap(t[a-'A'],t[b-'A']);
	}
	if(t[0]) cout<<"A\n";
	else if(t[1]) cout<<"B\n";
	else if(t[2]) cout<<"C\n";

	return 0;
}

Measured memory_bytes: 0
#include<stdio.h>
int n,m,t[110],p,x,st;
int main()
{
	scanf("%d",&n);
	for(register int i=1;i<=n;++i)
	{
		scanf("%d",&t[i]);
		st+=t[i];
	}
	scanf("%d",&m);
	while(m--)
	{
		scanf("%d%d",&p,&x);
		printf("%d\n",st-t[p]+x);
	}
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
using namespace std;
 
int main() {
	char a,b;
	cin>>a>>b;
	int c,d;
	if(a=='A'){
		c=1;
	}
	if(a=='B'){
		c=2;
	}
	if(a=='C'){
		c=3;
	}
	if(a=='D'){
		c=4;
	}
	if(a=='E'){
		c=5;
	}
	if(a=='F'){
		c=6;
	}
	if(b=='A'){
		d=1;
	}
	if(b=='B'){
		d=2;
	}
	if(b=='C'){
		d=3;
	}
	if(b=='D'){
		d=4;
	}
	if(b=='E'){
		d=5;
	}
	if(b=='F'){
		d=6;
	}
	if(c<d){
		cout<<"<"<<endl;
	}
	else if(c>d){
		cout<<">"<<endl;
	}
	else {
		cout<<"="<<endl;
	}
}

Measured memory_bytes: 256
#include <stdio.h>
#include <ctype.h>
#include <string.h>

int main(){
    char search[21], word[21];
    int count=0;
    int i;
    
    scanf("%s", search);
    while(1){
        scanf(" %s", word);
        if(strcmp(word, "END_OF_TEXT")==0)break;
        for(i=0;word[i]!='\0';i++){
            word[i]=tolower(word[i]);
        }
        if(strcmp(word, search)==0){
            count++;
        }
    }
    printf("%d\n", count);

    return 0;
}

Measured memory_bytes: 548
# Python program to find LCM of two numbers 

# Recursive function to return gcd of a and b 
def gcd(a,b): 
	if a == 0: 
		return b 
	return gcd(b % a, a) 

# Function to return LCM of two numbers 
def lcm(a,b): 
	return (a*b) / gcd(a,b) 

# Driver program to test above function 
l=list(map(int, input().strip().split(' ')))
a = l[0]
b = l[1]
print(int(lcm(a, b))) 

# This code is contributed by Danish Raza 


Measured memory_bytes: 2940
import sys

def warshall_floyd(v_count: int, matrix: list) -> list:
    """ ワーシャルフロイド
    :param v_count: 頂点数
    :param matrix: 隣接行列
    """
    for i in range(v_count):
        for j, c2 in ((j, matrix[j][i]) for j in range(v_count)):
            for k, (c1, c3) in enumerate(zip(matrix[j], matrix[i])):
                if c1 > c2+c3:
                    matrix[j][k] = c2+c3
    return matrix


def has_negative_cycle(matrix: list) -> bool:
    """ 負閉路チェック
    :param matrix: 隣接行列(ワーシャルフロイドの結果)
    """
    return any(row[i] < 0 for i, row in enumerate(matrix))


V, E = map(int, input().split())
inf = float("inf")
matrix = [[inf]*V for _ in [0]*V]
for i in range(V):
    matrix[i][i] = 0
for s, t, d in (map(int, l.split()) for l in sys.stdin):
    matrix[s][t] = d
warshall_floyd(V, matrix)
if has_negative_cycle(matrix):
    print("NEGATIVE CYCLE")
else:
    for row in matrix:
        print(" ".join(map(lambda n: str(n) if n!=inf else "INF", row)))


Measured memory_bytes: 6240
#include <bits/stdc++.h>
#define show(x) std::cerr << #x << " = " << (x) << std::endl
using ll = long long;
using ld = long double;
constexpr ll MOD = 1000000007LL;
template <typename T>
constexpr T INF() { return std::numeric_limits<T>::max() / 16; }
std::mt19937 mt{std::random_device{}()};
template <typename T, typename A>
std::ostream& operator<<(std::ostream& os, const std::vector<T, A>& v)
{
    os << "[";
    for (const auto& p : v) { os << p << ","; }
    return (os << "]\n");
}
int main()
{
    int N;
    std::cin >> N;
    std::vector<ll> a(3 * N);
    for (int i = 0; i < 3 * N; i++) { std::cin >> a[i]; }
    std::vector<ll> lmax(3 * N, 0);
    std::multiset<ll> lbuf;
    for (int i = 0; i < 3 * N; i++) {
        if (i < N) {
            lbuf.insert(a[i]), lmax[i] = (i == 0 ? 0LL : lmax[i - 1]) + a[i];
        } else {
            lbuf.insert(a[i]);
            lmax[i] = lmax[i - 1] + a[i] - *lbuf.begin();
            lbuf.erase(lbuf.begin());
        }
    }
    std::vector<ll> rmin(3 * N, 0);
    std::multiset<ll, std::greater<ll>> rbuf;
    for (int i = 3 * N - 1; i >= 0; i--) {
        if (i >= 2 * N) {
            rbuf.insert(a[i]), rmin[i] = (i == 3 * N - 1 ? 0LL : rmin[i + 1]) + a[i];
        } else {
            rbuf.insert(a[i]);
            rmin[i] = rmin[i + 1] + a[i] - *rbuf.begin();
            rbuf.erase(rbuf.begin());
        }
    }
    //    show(lmax), show(rmin);
    ll ans = -(1LL << 60);
    for (int i = N - 1; i < 2 * N; i++) { ans = std::max(ans, lmax[i] - rmin[i + 1]); }
    std::cout << ans << std::endl;
    return 0;
}


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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  
  if (A + B == C + D) {
  	cout << "Balanced" << endl;
  }
  else if (A + B > C + D) {
  	cout << "Left" << endl;
  }
  else if (A + B < C + D) {
  	cout << "Right" << endl;
  }
}

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

fi = 1
se = 1
tot = 1
mod = 10**9 + 7
for i in range(0,n):
    fi*=8
    fi%=mod
    se*=9
    se%=mod
    tot*=10
    tot%=mod
se*=2
se-=fi
print((tot - se)%mod)


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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)     (a).begin(),(a).end()
#define VI         vector<int>
#define MOD 1000000007

using ll = long long int;
using P = pair<int,int>;

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

const ll INF=(ll)1e19;
//const int INF=(1<<30);

int main(){
  int a,b,c;
  cin >> a >> b >>c;
  cout << min(b/a, c) << endl;
}



Measured memory_bytes: 256