akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define int long long
#define boost() ios_base :: sync_with_stdio(0); cin.tie(); cout.tie(); cout << fixed; cout << setprecision(15); srand(time(NULL))
#define a(x) x.begin(), x.end()
using namespace std;

int n, a[100010];

signed main () {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = n - 2; i >= 0; i--) {
    if (a[i] > a[i + 1]) {
      a[i] -= 1;
    }
  }
  for (int i = 0; i < n - 1; i++) {
    if (a[i] > a[i + 1]) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}

Measured memory_bytes: 1024
X,N = [int(i) for i in input().split()]
p = sorted([int(i) for i in input().split()], key=lambda x: x) if N > 0 else [0]

diffMin = 10**9 
minNum = -10**9
for i in range(0, 100+1+1):
  if i not in p and diffMin > abs( X-i ) :
     diffMin = min(diffMin,abs( X-i ))
     minNum = i
print(minNum)


Measured memory_bytes: 9196
/*
confirm 0LL and 1LL
confirm cornercases such as 0
confirm times of cin < 10^6
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using VecVec = vector<Vec>;
using Graph = vector<VecP>;
template <typename T>
using Vec1 = vector<T>;
template <typename T>
using Vec2 = vector<Vec1<T> >;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPN(i, m, n) for(ll (i) = (m); (i) <= (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m)-1; (i) >= (n); --(i))
#define REPNR(i, m, n) for(ll (i) = (m); (i) >= (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}
template <typename T>
ll pow2(const T n){return (1LL << n);}
template <typename T>
void cosp(const T n){cout << n << ' ';}
template <typename T>
void co(const T n){cout << n << endl;}
template <typename T1, typename T2>
void co(pair<T1, T2> p){cout << p.fs << ' ' << p.sc << endl;}
template <typename T>
void co(const Vec1<T> &v){for(T i : v) cosp(i); cout << endl;}
template <typename T>
void co(initializer_list<T> v){for(T i : v) cosp(i); cout << endl;}
template <typename T>
void ce(const T n){cerr << n << endl;}
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ld PI = acos(-1);
const ld EPS = 1e-11;

Vec fac, finv;

ll PowMod(ll a, ll n){
	if(n == 1) return a;
	if(n%2 == 0) return PowMod(a*a%MOD, n/2);
	return a*PowMod(a*a%MOD, n/2)%MOD;
}

ll combi(ll n, ll k){
	return fac[n]*finv[k]%MOD*finv[n-k]%MOD;
}

void init(ll n){
	fac.resize(n+1);
	fac[0] = 1;
	repn(i, n) fac[i] = (fac[i-1]*i)%MOD;
	finv.resize(n+1);
	finv[n] = PowMod(fac[n], MOD-2);
	repr(i, n) finv[i] = (finv[i+1]*(i+1))%MOD;
	finv[0] = 1;
}

int main(void){
	ll r1, c1, r2, c2;
	cin >> r1 >> c1 >> r2 >> c2;
	init(3e6);

	ll ans = 0;
	REPN(i, r1+1, r2+1){
		ans += combi(c2+i, c2);
		ans %= MOD;
	}
	REPN(i, r1+1, r2+1){
		ans -= combi(c1+i-1, c1-1);
		ans %= MOD;
	}
	ans += MOD;
	ans %= MOD;
	co(ans);

	return 0;
}


Measured memory_bytes: 47232
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);
//cin.tie(0);
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> plpl;
typedef tuple<ll,ll,ll> tl;
//ll mod=1000000007;
ll mod;
ll mod2=998244353;
ll inf=1000000000000000000;
double pi=2*acos(0);
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(int i=n;i>=m;i--)
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
int main(){
    int n,d;cin>>n>>d;
    int x[n][d];
    rep(i,0,n)rep(j,0,d)cin>>x[i][j];
    int ans=0;
    rep(i,0,n-1){
        rep(j,i+1,n){
            int sum=0;
            rep(k,0,d)sum+=(x[i][k]-x[j][k])*(x[i][k]-x[j][k]);
            for(int k=0;;k++){
                if(k*k==sum){
                    ans++;
                    break;
                    
                }
                if(k*k>sum)break;
            }
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mp make_pair
#define pb push_back
#define pll pair<ll,ll>
ll INF = 1000000007;


//-----------------//
  #define amin main
//-----------------//


int amin()
{
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll t,i,j;
	ll n;
	cin>>n;
	ll sum = 0;
	ll pre= 7;
	ll f= 0;
	for(i=0;i<n;i++)
	{
		//cout<<sum<<endl;

		sum += pre%n;
		pre=  pre%n;
		pre= pre*10;
		if(sum%n==0)
		{
				f =1;
				break;
			}
	}
	if(f==0)
		cout<<-1<<endl;
	else
	cout<<i+1<<endl;
	
	
	


	
	return 0;
}

Measured memory_bytes: 3616
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
def adj(n): return [[] for _ in range(n)]

n = iinput()
a = iarr()
cnt = col.Counter(a)
sum = sum(a)

q = iinput()
anss = []
for _ in range(q):
    b,c = imap()
    tmp = cnt[b]
    cnt[b] -= tmp
    cnt[c] += tmp
    sum += (c - b) * tmp
    anss.append(sum)

for ans in anss: print(ans)


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

int main()
{
  int n;
  cin >> n;
  int a[220000];
  set<int> values;
  for (int i = 0; i < n; i++)
  {
    cin >> a[i];
    values.insert(a[i]);
  }
  if (n == values.size())
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}

Measured memory_bytes: 10368
#include<stdio.h>

int main(void){
  int x,y,tmp,z;

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

  if(x<y){
    tmp = x;
    x = y;
    y = tmp;
  }

  z = x%y;
  while(z != 0){
    x = y;
    y = z;
    z = x%y;
  }
  printf("%d\n",y);

  return 0;
}



Measured memory_bytes: 2028
#include<iostream>
#include<numeric>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<map>
#include<utility>
#include<cmath>
#include<tuple>
#include<string>
#include<bitset>
#include<set>
#include<queue>
#include<stack>
#include<cstdio>
using namespace std;
using ll = long long;

int main(){
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    ll ans=max(a*c,max(a*d,max(b*c,b*d)));
    cout<<ans<<endl;
}

Measured memory_bytes: 3672
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,b,e) for(ll i=(ll)b;i<(ll)e;i++)
#define rep0(i,n) REP(i,0ll,n)
#define rep1(i,n) REP(i,1ll,n+1)
const ll longinf=1ll<<60;
const int inf=(1<<30)-1;

ll f(ll b,ll n){
    ll ret=0;
    while(n>0){
        ret+=n%b;
        n/=b;
    }
    return ret;
}

int main(){
    ll n,s;
    cin>>n>>s;
    vector<ll> ans;
    for(ll i=2;i*i<=n;i++){
        if(f(i,n)==s){
            ans.push_back(i);
        }
    }
    for(ll i=1;i*i<n;i++){
        ll a=1+(n-s)/i;
        if((n-s)%i==0){
            ll q=s-i;
            if(q>=0&&q<=a-1){
                ans.push_back(a);
            }
        }
    }
    if(n==s) ans.push_back(n+1);
    sort(ans.begin(),ans.end());
    if(ans.size()) cout<<ans[0]<<endl;
    else cout<<-1<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cstring>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
#define rep(i, n) for(long long i=0; i<n; i++)
#define reps(i, s, e) for(long long i=s; i<e; i++)
#define repr(i, n) for(long long i=n-1; i>=0; i--)
#define reprs(i, s, e) for(long long i=e-1; i>=s; i--)

int main(){

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

    ll n, q; cin >> n >> q;

    vector<int> g[n];

    rep(i, n-1){
        int a, b; cin >> a >> b;
        a--; b--;

        g[a].push_back(b);
        g[b].push_back(a);
    }

    ll cnt[n] = {};
    rep(i, q){
        int p, x; cin >> p >> x;
        p--;

        cnt[p] += x;
    }

    bool isFinished[n];
    fill(isFinished, isFinished+n, false);
    queue<int> que;
    que.push(0);


    while(!que.empty()){
        int node = que.front();
        que.pop();
        isFinished[node] = true;

        for(auto next : g[node]) {
            if(isFinished[next]) continue;

            cnt[next] += cnt[node];
            que.push(next);
        }
    }

    rep(i, n){
        cout << cnt[i] << " ";
    }

    return 0;
}

Measured memory_bytes: 16768
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  vector<int> cnt(26, 1e9);
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    vector<int> temp(26, 0);
    for (int j = 0; j < s.size(); j++) temp[s[j] - 'a']++;
    for (int j = 0; j < 26; j++) {
      cnt[j] = min(cnt[j], temp[j]);
    }
  }
  for (int i = 0; i < 26; i++) {
    for (int j = 0; j < cnt[i]; j++) {
      cout << char('a' + i) << flush;
    }
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define _rep(i,n) _repl(i,0,n)
#define rep(...) GET_MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream &o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream &o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 1120000000

int c[404][4];

using VC = vector<int>;

VC normalize(const VC &v){
  VC cand(v);
  rep(i,1,4){
    VC nv;
    rep(j,4) nv.pb(v[(i+j)%4]);
    if(nv < cand) cand = nv;
  }
  return cand;
}

int main(){
  map<VC, int> ma;
  int n;
  cin>>n;
  rep(i,n) rep(j,4) cin>>c[i][j];
  rep(i,n){
    ma[normalize(VC(c[i], c[i+1]))]++;
  }
// dbg(vector<pair<VC,int>>(all(ma)));
  const int d[4][4] = { {0,3,1,0}, {3,2,2,1}, {2,1,3,2}, {1,0,0,3} };

  // vc をx個選ぶ方法
  auto sel = [&](const VC &vc, int x, int dup){
    if(ma[vc]-dup <= 0) return 0L;
    long mul = 1;
    if(vc[0] == vc[2] && vc[1] == vc[3]){
      if(vc[0] == vc[1]) mul = 4;
      else mul = 2;
    }
    long ret = 1;
    rep(i,x) ret *= (ma[vc]-i-dup)*mul;
    return ret;
  };

  long ans = 0;
  rep(i,n) rep(j,i){
    VC vi = normalize(VC(c[i], c[i+1]));
    VC vj = normalize(VC(c[j], c[j+1]));
    rep(r,4){
      map<VC, int> cur;
      rep(k,4){
        auto vc = normalize({
          c[i][d[k][0]],
          c[i][d[k][1]],
          c[j][(r+d[k][2])%4],
          c[j][(r+d[k][3])%4]
        });
        cur[vc]++;
      }
      long tmp = 1;
      for(auto &pp : cur){
        int dup = 0;
        if(pp.fi == vi) dup++;
        if(pp.fi == vj) dup++;
        tmp *= sel(pp.first, pp.second, dup);
      }
      ans += tmp;
    }
  }

  cout << ans / 3 << endl;

  return 0;
}


Measured memory_bytes: 139904
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int T=sc.nextInt();
		int A=sc.nextInt();
		double H[]=new double [N];
		for(int i=0;i<N;i++) {
			H[i]=sc.nextInt();
		}
		for(int i=0;i<N;i++) {
			H[i]=Math.abs(A-(T-H[i]*0.006));
		}
		double min1=H[0];
		int min2=0;
		for(int i=1;i<N;i++) {
			if(min1>H[i]) {
				min1=H[i];
				min2=i;
			}
		}
		min2+=1;
		System.out.println(min2);
		sc.close();
	}
}


Measured memory_bytes: 23764
fun main() {
    val (n, k) = readLine()!!.split(' ').map { it.toLong() }
    val list = (0 until n).map {
        val (a, b) = readLine()!!.split(' ').map { it.toInt() }
        a to b
    }.sortedBy { it.first }

    var ans = 0
    var cur = 0L
    for ((a, b) in list) {
        if (cur + b >= k) {
            ans = a
            break
        }
        cur += b
    }

    println(ans)
}


Measured memory_bytes: 69588
#include<stdio.h>
int main()
{
	int n,sum=0;
	scanf("%d",&n);
    int a[101],i;
    for(i=0;i<n;i++)
    {
    	scanf("%d",&a[i]);
	}
	for(i=0;i<n-1;i++)
	{
		if(a[i]==a[i+1])
		{
			a[i+1]=20000;
		sum+=1;
	    }
	}
	printf("%d",sum);
	return 0;
}

Measured memory_bytes: 256
package main

import "fmt"

func bubbleSort(a []int) (count int) {
	if len(a) <= 1 {
		return 0
	}

	for i := 0; i < len(a)-1; i++ {
		if a[i] > a[i+1] {
			a[i], a[i+1] = a[i+1], a[i]
			count++
		}
	}
	return count + bubbleSort(a[:len(a)-1])
}

func main() {
	var n int
	fmt.Scan(&n)
	a := make([]int, 0, n)
	for i := 0; i < n; i++ {
		var e int
		fmt.Scan(&e)
		a = append(a, e)
	}

	count := bubbleSort(a)
	for i, e := range a {
		if i > 0 {
			fmt.Print(" ")
		}
		fmt.Print(e)
	}
	fmt.Println()
	fmt.Println(count)
}



Measured memory_bytes: 1168
package main

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

func solve() {
	n := nextInt()
	a := nextInts(n)

	alice := 0
	bob := 0

	sort.Sort(sort.Reverse(sort.IntSlice(a)))
	// sort.Slice(a, func(i, j int) bool {
	// 	return a[i] > a[j]
	// })

	for i, aa := range a {
		// println(i)
		if i%2 == 0 {
			alice += aa
		} else {
			bob += aa
		}
	}
	println(alice - bob)

	return
}

func main() {
	defer out.Flush()
	in.Split(bufio.ScanWords)

	solve()
}

// --- template ---

var (
	in  = bufio.NewScanner(os.Stdin)
	out = bufio.NewWriter(os.Stdout)
)

func println(a ...interface{}) {
	fmt.Fprintln(out, a...)
}

func printf(format string, a ...interface{}) {
	fmt.Fprintf(out, format, a...)
}

func next() string {
	in.Scan()
	return in.Text()
}

func nextInt() int {
	s := next()
	i, e := strconv.Atoi(s)
	if e != nil {
		fmt.Println(e)
	}
	return i
}

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


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int s;
  cin >> s;
  int s1 = s / 100;
  int s2 = (s / 10) % 10;
  int s3 = s % 10;
  cout << s1 + s2 + s3 << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
int main(){
  int n,k;
  std::cin>>n>>k;
  std::vector<double> a(n),b(n);
  for(auto& ai:a)std::cin>>ai;
  auto f = [](double x){return x*(x+1)/2/x;};
  for(int i=0;i<n;++i)b[i]=f(a[i]);
  std::vector<double> acc(n+1);
  for(int i=0;i<n;++i)acc[i+1]=acc[i]+b[i];
  double ans = 0.0;
  for(int i=0;i+k<=n;++i)ans = std::max(ans,acc[i+k]-acc[i]);
  std::cout<<std::fixed<<std::setprecision(10)<<ans<<std::endl;
}


Measured memory_bytes: 8044
#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define DEBUG(x)           cout << '>' << #x << ':' << x << endl;
#define forn(i,n)          for(int i=0;i<(int)n;++i)
#define for1(i,n)          for(int i=1;i<=(int)n;++i)
#define forr(i,n)          for(int i=(int)n-1;i>=0;--i)
#define forre(i,a,b)       for(int i=(int)b;i>=(int)a;--i)
#define fore(i,a,b)        for(int i=(int)a;i<=(int)b;++i)
#define input(i,arr)       for(int& i:arr)cin>>i;
#define output(i,arr)      for(int& i:arr)cout<<i<<" ";
#define for_each(arr)      for(auto& it:arr)
#define ff                 first
#define ss                 second
#define PI                 acos(-1.0)
#define all(a)             a.begin(),a.end()
#define rall(a)            a.rbegin(),a.rend()
#define Unique(a)          sort(all(a)),a.erase(unique(all(a)),a.end())
#define pb(x)              push_back(x)
#define eb(x)              emplace_back(x) 
#define ppb(x)             pop_back(x)
#define pf(x)              push_front(x)
#define ppf(x)             pop_front(x)
#define in(x,y)            insert({x,y})
#define Sort(a)            sort(a.begin(),a.end())
#define mem(arr,a)         memset(arr,a,sizeof arr)
#define ins(a)             insert(a)
#define max2(a,b)          max(a,b)
#define max3(a,b,c)        max(a,max(b,c))
#define max4(a,b,c,d)      max(a,max3(b,c,d))
#define min2(a,b)          min(a,b)
#define min3(a,b,c)        min(a,min(b,c))
#define min4(a,b,c,d)      min(a,min3(b,c,d))
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<char> vc;
typedef vector<double> vd;
/*inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n>>b)&1; }
inline void Set(int & n, int b) { n |= two(b); }
inline void Reset(int & n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) { int res = 0; while(n && ++res) n-=n&(-n); return res; }*/
/*int fx1[]={+1,-1,+0,+0};
int fy1[]={+0,+0,+1,-1};
int fx2={+0,+0,+1,-1,-1,+1,-1,+1};
int fy2={-1,+1,+0,+0,+1,+1,-1,-1};
*/

ll a,b,c,n,ans,cn1,cn2,cn3,t;
string s,s1,s2;


int main()
{
    FIO;
   // #ifndef ONLINE_JUDGE
  //  freopen("input.txt","r",stdin);
  //  freopen("output.txt","w",stdout);
   // #endif
   cin>>a>>b>>c;
   if((a==b&&a!=c)||(a==c&&a!=b)||(b==c&&a!=b))
   	cout<<"Yes"<<endl;
   else cout<<"No"<<endl;
    

    
   	
    #ifdef ONLINE_JUDGE
    cerr<<"Time elapsed: "<<1.0*clock()/CLOCKS_PER_SEC<<"s.\n";
    #endif
   return 0;
}
 


Measured memory_bytes: 256
<?php

fscanf(STDIN, "%s", $IntCode);
$StrCode = (string) $IntCode;
$ArrayCode = array(0,0,0,0);
$Result = "Good";

for($i = 0; $i < 4; $i++)
{
	$ArrayCode[$i] = substr($StrCode, $i, 1);
}

for ($i = 0; $i < 3; $i++) { 
	if($ArrayCode[$i] == $ArrayCode[$i + 1])
	{
		$Result = "Bad";
	}
}


echo $Result;

Measured memory_bytes: 3828
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
using namespace std;
#define DEB(variable) cout << #variable << '=' << variable << endl

#define FOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(long long int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

using llint = long long int;

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr long long int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

int main(){
    llint a,b;
    cin >> a >> b;
    llint plug = 1,result=0;
    while(plug<b){
        result++;
        plug += a - 1;
    }
    cout << result << endl;
    return 0;
}


Measured memory_bytes: 256
n,k = map(int,input().split())
a = list(map(int,input().split()))
flag = True
went = {1}
go = [1]
i = 0
while flag:
  if a[i] not in went:
    go.append(a[i])
    went.add(a[i])
    i = a[i]-1
  else:
    flag = False
loop = go[go.index(a[i]):]
if len(go) > k:
  print(go[k])
else:
  k -= len(go)-len(loop)
  ans = k % len(loop)
  print(loop[ans])

Measured memory_bytes: 131852
N, K = map(int,input().split())
S = input()

aaaa = False

# K >= 14ぐらいでSは辞書順最小の文字で埋め尽くされる。

# あまり意味はないが計算結果が大きすぎてバグっても嫌なので上限を作っておく
if K >= 15:
    aaaa = True
elif 2 ** K >= N:
    aaaa = True

# 最小の文字だけで埋め尽くされる場合
if aaaa:
    print(min(S)*N)
    exit()

def get_last_dict(s_str):
    U = s_str + s_str[::-1]
    c = min(s_str)
    p = U.index(c)
    minindex = p
    p += 1
    while p <= N:
        if U[p] == c:
            if check_normal_dict(U, minindex, p):
                minindex = p
        p += 1
    return U[minindex:minindex+N]


def check_normal_dict(u, pointer1, pointer2):
    for i in range(N):
        if u[pointer1 + i] > u[pointer2 + i]:
            return True
        elif u[pointer1 + i] < u[pointer2 + i]:
            return False
    return False

S = get_last_dict(S)

if K == 1:
    print(S)
else:
    count = 0
    for c in S:
        if c == S[0]:
            count += 1
        else:
            break
    if count * (2 ** (K - 1)) >= N:
        print(S[0] * N)
    else:
        S = S[0] * (count * ((2 ** (K - 1)) - 1)) + S
        print(S[0:N])

Measured memory_bytes: 3064
#include "iostream"
#include "vector"
#include "string"
#include "algorithm"
 
using namespace std;
typedef long long ll;
 
int main()
{
  int n;
  cin >> n;
  cout << "Christmas ";
  for (int i = 0; i < 25 - n; i++)
  {
    cout << "Eve ";
  }
  cout << "\n";
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <array>
#include <algorithm>
#include <list>
#include <iomanip>
#include <queue>
#include <functional>
#include <cassert>
#include <cmath>
#include <set>
#include <map>
#include <numeric>

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repe(i, n) for(int i = 0; i <= (n); i++)
#define fo(i, a, b) for(int i = (a); i < (b); i++)
#define foe(i, a, b) for(int i = (a); i <= (b); i++)
#define NL << endl

using namespace std;
using ll = long long;
const int INTMAX = numeric_limits<int>::max();
const int INTMIN = numeric_limits<int>::min();
const ll LLMAX = numeric_limits<long long>::max();
const ll LLMIN = numeric_limits<long long>::min();
const int MOD = 1000000007;
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }

using namespace std;

int main() {

	vector<int> c = { 400, 800, 1200, 1600, 2000, 2400, 2800, 3200 };
	vector<int> b(c.size(), 0);
	int pro = 0;

	int n;
	cin >> n;
	rep(i, n) {
		int r;
		cin >> r;
		rep(j, c.size()) {
			if (r < c[j]) {
				b[j] = 1;
				break;
			}
		}
		if (r >= 3200) pro++;
	}

	int cnt = 0;
	rep(i, b.size()) {
		if (b[i] == 1) cnt++;
	}
	int max = cnt + pro;
	if (cnt == 0) cnt = 1;

	cout << cnt << ' ' << max NL;


	return 0;

}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <map>
#include <sstream>
// #include <bits/stdc++.h>
#define req(i,h) for(int i = 0; i < h; i++)

using namespace std;


int main(void) {
    int n;
    string a;
    cin >> n;
    double ans = 0.00;
    vector<double> x(n);
    req(i,n) {
        cin >> x.at(i);
        cin >> a;
        if(a == "BTC") {
            x.at(i) = x.at(i) * 380000.0;
        }
        ans += x.at(i);
    }
    cout << ans;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll unsigned long long int
#define pb push_back
#define mp make_pair
#define M 10e9+7
int main(){
ll n,a,b;
cin>>n>>a>>b;
  ll ans=a*(n/(a+b));
  ll r=n%(a+b);
  if(r>=a)ans+=a;
  else ans+=r;
  cout<<ans;
}

Measured memory_bytes: 384
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <array>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
#include <map>
#include <set>

#define INF_LL 9000000000000000000
#define INF 2000000000

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

using namespace std;

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

class Union_find{
private:
	vector<int> par;
	vector<int> rank;
	int n;

public:
	Union_find(int a){
		n = a;
		for(int i = 0;i < n;i++){
			par.push_back(i);
			rank.push_back(0);
		}
	}

	int find(int x){
		if(par[x] == x){
			return x;
		}else{
			return par[x] = find(par[x]);
		}
	}

	void unite(int x, int y){
		x = find(x);
		y = find(y);
		if(x == y) return;

		if(rank[x] < rank[y]){
			par[x] = y;
		}else{
			par[y] = x;
			if(rank[x] == rank[y]) rank[x]++;
		}
	}

	bool same(int x, int y){
		return find(x) == find(y);
	}
};

int main(void){
	int n;
	int k;
	while(cin >> n >> k && n && k){
	string card[10];
	set<string> ans;
	REP(i, n){
		cin >> card[i];
	}
	for(int i = 0;i < n;i++){
		string s = card[i];
		for(int j = 0;j < n;j++){
			if(j == i) continue;
			string t = s;
			t += card[j];
			for(int p = 0;p < n && 2 < k;p++){
				if(p == i || p == j) continue;
				string u = t;
				u += card[p];
				for(int q = 0;q < n && 3 < k;q++){
					string v = u;
					if(q == i || q == j || q == p) continue;
					v += card[q];
					ans.insert(v);
				}
				if(k == 3){
					ans.insert(u);
				}
			}
			if(k == 2){
				ans.insert(t);
			}
		}
	}
	cout << ans.size() << endl;
	}
	return 0;
}

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

S = A - B - D * (N - 1)
if S > 0:
    print("NO")
else:
    if C == D == 0:
        if A == B:
            print("YES")
        else:
            print("NO")
    else:
        X = (-S) % (C+D)
        if X <= (D-C) * (N-1) and A - B + D * (N - 1) >= 0:
            print("YES")
        else:
            print("NO")

Measured memory_bytes: 3064
n=int(input())
l=list(map(int,input().split()))
cnt=0
for i in range(n):
    if l[i]<0:
        cnt+=1
        l[i]=abs(l[i])
if cnt%2==0:
    print(sum(l))
else:
    l.sort()
    print(sum(l)-l[0]*2)

Measured memory_bytes: 14224
#include<iostream>
#include<stdlib.h>
using namespace std;
const int Max=300;
int Stack[Max];
int top=0;
bool isFull()
{
    return (top>=Max);
       
}
bool isEmpty(){
    return top==0;
}
void push(int x){
    if (!isFull()){
        Stack[top++]=x;
    }
    
}
 
 int pop(){
     if(!isEmpty())
     return Stack[--top];
 }
 int main(){
     
     int a,b;
     char c[100];
     top=0;
     while(cin>>c){
         if(c[0]=='+'){
             a=pop();
             b=pop();
             push(a+b);
         }
         else if(c[0]=='-'){
              a=pop();
             b=pop();
             push(b-a);
         }
         else if(c[0]=='*'){
               a=pop();
             b=pop();
             push(a*b);
         }
         else push(atoi(c));
     }
     cout<<Stack[--top]<<endl;
     return 0;
 }


Measured memory_bytes: 3080
void main() {
	auto ip = readAs!(int[]), N = ip[0], M = ip[1];

	auto arr = new int[][](N);

	foreach(i; 0..M) {
		auto ip2 = readAs!(int[]), A = ip2[0], B = ip2[1];
		arr[A-1] ~= B-1;
		arr[B-1] ~= A-1;
	}
	alias Pair = Tuple!(int, "edge", int, "cnt");
	auto visited = new bool[](N);
	auto res = new int[](N);
	Pair[] queue = [Pair(0, 0)];
	while(queue != []) {
		auto p = queue.front;
		queue.popFront;
		debug writeln(p);

		foreach(i; arr[p.edge]) {
			if(!visited[i]) {
				visited[i] = true;
				res[i] = p.edge+1;
				queue ~= Pair(i, p.cnt+1);
			}
		}
	}
	writeln("Yes");
	res[1..$].each!writeln;
}
// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

long rl() {
	return readAs!long;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

Measured memory_bytes: 25492
import numpy as np
def main():
  n, k  = list(map(int,(input().split())))
  a = np.array([])
  for i in range(k):
    d  = int(input())
    ak = list(map(int,(input().split())))
    a = np.append(a,ak)
    #print(ak,a)

  a = set(a)
  ans = n - len(a)
  print(ans)
  
  
  
  
if __name__ == '__main__':
  main()
  
  
  
  

Measured memory_bytes: 27024
#include<bits/stdc++.h>
using namespace std;
inline int inp(int x,int y){
	int c=0,z=x&y;
	while(z) c^=1,z-=z&-z;
	return c;
}
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=1;i<(1<<n);i++){
		for(int j=1;j<(1<<m);j++){
			printf("%d",inp(i^(i-1),j^(j-1)));
		}
		puts("");
	}
	return 0;
}

Measured memory_bytes: 1280
n=int(input())
i= list(map(int, input().split()))
flag=0
lis=[0]*n
for j in range(n-1):
    if i[j+1]>=i[j]+1:
        i[j+1]-=1
    elif i[j+1]<i[j]:
        flag=1
        break
if flag==0:
    print("Yes")
elif flag==1:
    print("No")
    

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


  int a,b;

  cin >>a>>b;
  
  if (a<b) { cout <<"a < b"<<"\n";  
          
  } else if (a>b) { cout <<"a > b"<<"\n";

  } else if (a==b) { cout <<"a == b"<<"\n";

  }



  return 0;

}

Measured memory_bytes: 1124
#include <bits/stdc++.h>
#define ll long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define deb(x) cout<<#x<<"="<<x<<endl;
#define endl '\n'
#define M 1000000007
#define int long long
#define max_n 1000000

using namespace std;

void solve()
{
	ll n;
	cin>>n;
	ll ans=0;
	for (int i = 1; i <= n; ++i)
	{
		for (int k = 1; k <= n; ++k)
		{
			for (int j = 1; j <= n; ++j)
			{
				ans+=__gcd(__gcd(i,j),k);
			}
		}
	}
	cout<<ans<<endl;
}

int32_t main() 
{
	IOS	
	ll T=1;
	// cin>>T;
	for(ll i=1;i<=T;++i)
	{		
		// cout<<"Case #"<<i<<": ";
    	solve();
	}
	return 0;
}

Measured memory_bytes: 3640
/*
  AtCoder Regular Contest 096
  C - Half and Half
*/

#include<iostream>
#include<cmath>
using namespace std;

int A, B, C, X, Y;

int main() {
  scanf("%d%d%d%d%d", &A, &B, &C, &X, &Y);

  long long sum = 0;

  if (A + B <= 2 * C) { // 個別に買う方がコスパがいい場合
    sum = A * X + B * Y;
  }
  else {                // ABピザの方がコスパがいい場合
    if (X < Y) {
      sum = 2 * C * X + B * (Y - X);
      if (sum > 2 * C * Y) sum = 2 * C * Y;
    }
    else {
      sum = 2 * C * Y + A * (X - Y);
      if (sum > 2 * C * X) sum = 2 * C * X;
    }
  }

  printf("%lld\n", sum);
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		
		String ans = "Impossible";
		
		if (a%3==0||b%3==0||(a+b)%3==0) {
			ans = "Possible";
		}
		System.out.println(ans);
		scanner.close();

	}

}

Measured memory_bytes: 21716
N, M = map(int, input().split())
H = list(map(int, input().split()))
A = [0] * M
B = [0] * M

for m in range(M):
    A[m], B[m] = map(int, input().split())

c = [True] * N

for m in range(M):
    a = A[m] - 1
    b = B[m] - 1
    if H[a] > H[b]:
        c[b] = False
    elif H[a] < H[b]:
        c[a] = False
    else:
        c[a] = False
        c[b] = False

ans = c.count(True)

print(ans)


Measured memory_bytes: 21764
class Dice:
    def __init__(self, top: str, front: str, right: str, left: str, back: str, bottom: str) -> None:
        self.top = top
        self.front = front
        self.right = right
        self.left = left
        self.back = back
        self.bottom = bottom

    def print_top(self):
        print(self.top)

    def print_right(self):
        print(self.right)

    def roll(self, direction: str) -> None:
        if direction == 'S':
            self.south()
        elif direction == 'N':
            self.north()
        elif direction == 'E':
            self.east()
        elif direction == 'W':
            self.west()

    def north(self):
        [self.top, self.back, self.bottom, self.front] = [self.front, self.top, self.back, self.bottom]

    def south(self):
        [self.top, self.back, self.bottom, self.front] = [self.back, self.bottom, self.front, self.top]

    def east(self):
        [self.top, self.right, self.bottom, self.left] = [self.left, self.top, self.right, self.bottom]

    def west(self):
        [self.top, self.right, self.bottom, self.left] = [self.right, self.bottom, self.left, self.top]

    def rotate_right(self) -> None:
        for direction in 'SWN':
            dice.roll(direction)


def solve(dice: Dice, top: str, front: str) -> None:
    # find top
    found = False
    for direction in 'SSSS':
        dice.roll(direction)
        if dice.top == top:
            found = True
            break
    if not found:
        for direction in 'EEE':
            dice.roll(direction)
            if dice.top == top:
                break

    # find front
    for _ in range(4):
        dice.rotate_right()
        if dice.front == front:
            break

    # answer right
    dice.print_right()


labels = input().split()
dice = Dice(*labels)
n = int(input())
for i in range(n):
    top, front = input().split()
    solve(dice, top, front)



Measured memory_bytes: 5604
#include<bits/stdc++.h>
using namespace std;
void solve(){
  long long n;
  cin>>n;
  for(int i=0;i<n;i++){
    cout<<"ACL";
  }
  cout<<endl;
}
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t=1;
  while(t--){
    solve();
  }
  return 0;
}   

Measured memory_bytes: 3636
fun main(args: Array<String>) {
    val partS = partSum(readLine()!!)
    val partT = partSum(readLine()!!)
    val q = readLine()!!.toInt()
    for (i in 1..q) {
        val (a, b, c, d) = readLine()!!.split(' ').map(String::toInt)
        println(if (modd(partS, a, b) == modd(partT, c, d)) "YES" else "NO")
    }
}

fun modd(z: IntArray, a: Int, b: Int): Int {
    return (z[b] - z[a - 1] + b - a) % 3
}

fun partSum(s: String): IntArray {
    val res = IntArray(s.length + 1)
    for ((i, c) in s.withIndex()) {
        res[i + 1] = res[i] + (if (c == 'A') 1 else 0)
    }
    return res
}


Measured memory_bytes: 64528
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        System.out.println(Main.time());
    }

    public static String time(){
        Scanner scan = new Scanner(System.in);
        int S = scan.nextInt();
        int h = (S-S%3600)/3600;
        int m = ((S-h*3600)-(S-h*3600)%60)/60;
        int s = (S-h*3600-m*60);
        return h+":"+m+":"+s;
    }
}



Measured memory_bytes: 26416
/**
 * 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 CSumOfGcdOfTuplesEasy {
public:
    ll gcd(ll a,ll b){
        if(b==0) return a;
        else{
            return gcd(b,a%b);
        }
    }

    ll lcm(ll a,ll b){
        return a/gcd(a,b)*b;
    }

	void solve(std::istream& in, std::ostream& out) {
        int k;
        in >> k;
        ll su = 0L;
        for (int i = 1; i <= k; i++) {
            for (int j = 1; j <= k; j++) {
                for (int l = 1; l <= k; l++) {
                    su += gcd(i, gcd(j, l));
                }
            }
        }
        out << su << endl;
    }
};


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


Measured memory_bytes: 3636
#include<stdio.h>
#include<string.h>
#include<math.h>
#include <stdlib.h>
#include<ctype.h>
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

int main () {
	long long N,K;
	scanf("%lld %lld",&N,&K);
	
	long long sakoda = N%K;
	
	if( sakoda < llabs(sakoda-K) ) {
		printf("%lld",sakoda);
		return 0;
	}
	printf("%lld",llabs(sakoda-K));
	
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>

#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,x,n) for(int i=x; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back

using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

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 (a>b) { a=b; return 1; } return 0; }

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

const ll INF = 0x3fffffff;


int main(){
	//ios_base::sync_with_stdio(0);
	ll N;
	ll a[100005], ans[100005]={};
	vector<ll> va;

	cin >> N;
	rep(i,N){
		cin >> a[i];
		va.push_back(a[i]);
	}
	sort( all(va) );

	vector<int> v;
	v.push_back(0);
	rep(i,N) if( a[v.back()] < a[i] ) v.push_back(i);
	v.push_back(N);
	a[N] = INF;

	ll pre = 0, c = 0;
	rep(i,N){
		if( va[i] < a[ v[c] ] ){
			//cout << va[i] << " ans[" << v[c] << "] += " << va[i] - pre << endl;
			ans[ v[c] ] += va[i] - pre;
		}else{
			//cout << va[i] << " ans[" << v[c] << "] += " << (N-i) * (va[i]-pre) << "\tchange" << endl;
			ans[ v[c] ] += (N-i) * (va[i]-pre);
			pre = a[ v[c] ];
			c++;
		}
	}

	rep(i,N) cout << ans[i] << endl;

	return 0;
}


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

typedef long long LL;
typedef long double LD;
typedef pair < int, int > PII;
typedef pair < LL, LL > PLL;
typedef pair < LD, LD > PDD;

#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
template < typename _T > inline void _DBG(const char *s, _T x) { cerr << s << " = " << x << "\n"; }
template < typename _T, typename... args > void _DBG(const char *s, _T x, args... a) { while(*s != ',') cerr << *s++; cerr << " = " << x << ','; _DBG(s + 1, a...); }

#ifdef LOCAL
#define DBG(...) _DBG(#__VA_ARGS__, __VA_ARGS__)
#else
#define DBG(...) (__VA_ARGS__)
#define cerr if(0) cout
#endif

// ********************** CODE ********************** //

int t[3];

int main()
{
    _upgrade
    int n; cin >> n;
    for(int i = 0; i < n; i++)
    {
        int x; cin >> x;
        if(x % 4 == 0)
            t[2]++;
        else if(x % 2 == 0)
            t[1]++;
        else
            t[0]++;
    }
    if(t[0] <= t[2])
    {
        puts("Yes");
    }
    else if(t[0] == t[2] + 1 && t[1] == 0)
    {
        puts("Yes");
    }
    else
    {
        puts("No");
    }
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long int lint;
typedef pair<lint, lint> plint;
typedef pair<double long, double long> pld;
#define Alint(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1ll << (n))
#define FOR(i, begin, end) for(lint i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(lint i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
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; }
template<typename T1, typename T2> pair<T1, T2> operator+(const pair<T1, T2>& l, const pair<T1, T2>& r) { return make_pair(l.first + r.first, l.second + r.second); }
template<typename T1, typename T2> pair<T1, T2> operator-(const pair<T1, T2>& l, const pair<T1, T2>& r) { return make_pair(l.first - r.first, l.second - r.second); }
const lint MOD = 1e9 + 7, MAX = 1e18, INF = -1e9;
typedef long double ld;

map< int64_t, int > prime_factor(int64_t n) {
	map< int64_t, int > ret;
	for (int64_t i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			ret[i]++;
			n /= i;
		}
	}
	if (n != 1) ret[n] = 1;
	return ret;
}

lint N, dp[1000000];
int main() {
	cin.tie(0); ios_base::sync_with_stdio(false);
	cin >> N;
	auto vec = prime_factor(N);
	lint cnt = 0;
	REP(i, 1000000) {
		dp[i] = i * (i + 1) / 2;
	}
	for (auto itr : vec) {
		cnt += (upper_bound(dp, dp + 1000000, itr.second) - dp) - 1;
	}
	cout << cnt;
}

Measured memory_bytes: 11472
#include<iostream>
#include<vector>

using namespace std;

int main(){
 int n,time;
  
  cin >> n >> time;
  
  vector<int> c(n);
  vector<int> t(n);
  
  
  for(int i = 0; i < n;i++){
    cin >> c[i] >> t[i];
  }
  
  bool judge = false;
  int ans = 99999;
  
  for(int i =0; i < n;i++){
    if(t[i] <=time && c[i] < ans){
        ans = c[i];
        judge = true;
    }
    
  }
  
  if(judge){
    cout << ans << endl;
    
    
  }else{
   cout << "TLE" << endl; 
  }
  
  
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long cnt = 0;
		int K = input.nextInt();
		int S = input.nextInt();
		for (int i = 0; i <= K; i++) {
			for (int j = 0; j <= K; j++) {
				int k = S-i-j;
				if (k>=0&&k<=K) cnt++;
			}
		}
		System.out.println(cnt);
	}
	public static boolean Three(int a, int b, int c) {
		if (a!=b&&b!=c&&c!=a) return true;
		return false;
	}
	public static boolean One(int a, int b, int c) {
		if (a==b&&b==c&&c==a) return true;
		return false;
	}
}

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

const int mod = 1e9 + 7;

int main()
{
    int n, m, x, y;
    std::cin >> n >> m >> x >> y;

    std::vector<int> x_vec(n);
    for (int i = 0; i < n; i++) {
        std::cin >> x_vec[i];
    }

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

    int x_max = *std::max_element(x_vec.begin(), x_vec.end());
    int y_max = *std::min_element(y_vec.begin(), y_vec.end());
    if (x_max < y_max && x_max < y && y_max > x) {
        std::cout << "No War" << std::endl;
        return 0;
    }
    std::cout << "War" << std::endl;
}


Measured memory_bytes: 256
import bisect
import math
def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

n = int(input())
ans = list(get_sieve_of_eratosthenes(n*10))
index = bisect.bisect_left(ans,n)
print(ans[index])

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

bool check(char*& c, char ec = '\0') {
	if(*c == ec) return true;
	int cstep = 0;
	while(*c) {
		if(cstep == 0 && *c == 'm'){
			cstep++;
			if(!check(++c, 'e')) return false;
		}
		else if(cstep == 1 && *c == 'e'){
			cstep++;
			if(!check(++c, 'w')) return false;
		}
		else if(cstep == 2 && *c == 'w'){
			return (*++c == ec);
		}
		else {
			return false;
		}
	}
	return false;
}

int main(void) {

	char str[512];
	std::cin >> str;

	char *c = str;
	if(check(c)) {
		std::cout << "Cat\n";
	}else{
		std::cout << "Rabbit\n";
	}

	return 0;
}

Measured memory_bytes: 3092
import sys
import numpy as np
import math
import collections
import copy
import decimal
import itertools
from collections import deque 
from functools import reduce
from itertools import product
from itertools import combinations
 
# input = sys.stdin.readline
N = int(input())
An = list(map(int, input().split()))
An_l = list(itertools.accumulate(An))
An_l.insert(0, 0)
ans = 0
for i, A in enumerate(An):
    tt = An_l[-1] - An_l[i+1]
#     print(i, An_l[-1], An_l[i], tt)
    At = A * tt
#     print(A, tt, At)
    ans = (ans+At) % (10**9+7)
#     print(ans)
print(ans)

Measured memory_bytes: 50080
import java.util.Scanner;
import java.io.IOException;

class Main {
	public static void main(String[] args) throws IOException {
		Scanner scan = new Scanner(System.in);
		while (true) {
			String[] strAry = scan.nextLine().split(" ");
			int h = Integer.parseInt(strAry[0]);
			int w = Integer.parseInt(strAry[1]);
			if (h == 0 && w == 0) {
				break;
			}
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
	}
}

Measured memory_bytes: 37880
// At Corder.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
#include <algorithm>
#include <iostream>
using namespace std;
#include <vector>
#include <numeric>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using p = pair<int, int>;//<key,value>

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

	return 0;
}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


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

int main(){
    int n;cin>>n;
    long long a[n+1],b[n];
    for(int i=0;i<n+1;i++) cin>>a[i];
    for(int i=0;i<n;i++) cin>>b[i];
    long long sum=0;
    for(int i=0;i<n;i++){
        if(b[i]==0) continue;
        else if(b[i]<=a[i])sum+=b[i];
        else if(b[i]<=a[i]+a[i+1]){
            sum+=b[i];
            b[i]-=a[i];
            a[i+1]-=b[i];
        }
        else{
            sum+=a[i]+a[i+1];
            a[i+1]=0;
        }
    }
    cout<<sum<<endl;
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <functional>
#include <ctime>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iomanip>
#include <float.h>
#include <math.h>
using namespace std;
using ll = long long;


unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

class UnionFind {
public:
    vector <ll> par;
    vector <ll> siz;
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    ll root(ll x) {
        while (par[x] != x) {
            x = par[x] = par[par[x]];
        }
        return x;
    }
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) {
        return root(x) == root(y);
    }

    ll size(ll x) {
        return siz[root(x)];
    }
};

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

long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

int main() {
    ll n;
    cin >> n;
    vector<ll> z(100001);
    ll ans = 0;
    for (int i = 0; i < n; i++) {
        ll a;
        cin >> a;
        z[a]++;
        ans += a;
    }
    ll q;
    cin >> q;
    for (int i = 0; i < q; i++) {
        ll a, b;
        cin >> a >> b;
        z[b] += z[a];
        ans += (b-a) * z[a];
        z[a] = 0;
        cout << ans << endl;
    }
}

Measured memory_bytes: 4048