akhauriyash/Code-Regression huggingface dataset:
# -*- coding: utf-8 -*-                                                                              

N = int(input())
e = [0]	* (N+1)

for i in range(2, N+1):
    cur = i
    for	j in range(2, i+1):
        while cur % j == 0:
            e[j] += 1
            cur //= j

def num(m):
    return len(list(filter(lambda x: x >= m-1, e)))

print(num(75) + num(25) * (num(3)-1) + num(15) * (num(5)-1) + num(5) * (num(5)-1) * (num(3)-2)//2)



Measured memory_bytes: 3064
import math
import itertools
Q = int(input())
query = [list(map(int,input().split())) for i in range(Q)]

def is_prime(n):
        if n <= 0:return None
        if n == 1:return False
        sup = math.floor(pow(n,1/2))
        for i in range(2,sup+1):
                if n % i == 0:
                        return False
        return True

prime = [0]*(10**5+1)
for i in range(1,10**5+1):
        if is_prime(i):
                prime[i] = 1

for p,bit in enumerate(prime[::-1]):
        p = len(prime)-1 - p
        if bit and p % 2 == 1 and prime[(p+1)//2]:
                pass
        else:
                prime[p] = 0

acc = list(itertools.accumulate(prime))
for l,r in query:
        print(acc[r]-acc[l-1])

Measured memory_bytes: 32400
n = int(input())
h = list(map(int,input().split()))
cnt = 0
tmp = h[0]
ans = 0
for i in range(1,n):
    if tmp >= h[i]:
        cnt += 1
    else:
        ans = max(ans,cnt)
        cnt = 0
    tmp = h[i]
ans = max(ans,cnt)
print(ans)

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

using namespace std;

int a[200000];

int main() {
  int n, k; scanf("%d %d", &n, &k);
  for(int i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  int low = 1, high = 1000000000;
  while(low < high) {
    int mid = (low + high) >> 1;
    int need = 0;
    for(int i = 0; i < n; ++i) {
      need += (a[i] + mid - 1) / mid - 1;
    }
    if(need <= k) {
      high = mid;
    }else {
      low = mid + 1;
    }
  }
  cout << low << endl;
  return 0;
}


Measured memory_bytes: 4412
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

template <class T>
struct Doubling {
    Doubling(int n, ll x) : n(n), l(64 - __builtin_clzll(x)), a(l, vector<T>(n)) {
        T::p = this;
    }
    T &operator[](int i) {
        return a[0][i];
    }
    void build() {
        for (int k = 0; k < l - 1; k++) {
            for (int i = 0; i < n; i++) {
                (a[k + 1][i] = a[k][i]).foward2(k);
            }
        }
    }
    int n, l;
    vector<vector<T>> a;
};

struct Node {
    void foward2(int k) {
        const auto &a = p->a[k];
        i = a[i].i;
    }
    Node &foward(ll x) {
        for (int k = 0; k < p->l; k++) {
            if (x >> k & 1) foward2(k);
        }
        return *this;
    }
    inline static Doubling<Node> *p;
    int i;
};

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

    int n;
    cin >> n;

    ll k;
    cin >> k;

    Doubling<Node> db(n, k);

    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        a--;

        db[i] = { a };
    }

    db.build();

    cout << Node{ 0 }.foward(k).i + 1 << endl;

    return 0;
}

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

int main() {
	long long int n, k,m=0,sum=0;
	std::cin >> n;

	std::vector<long long int> a(n + 1);
	for (long long int& x : a) {
		std::cin >> x;
	}

	std::vector<long long int> b(n);
	for (long long int& x : b) {
		std::cin >> x;
	}

	for (int i = 0; i < a.size(); i++) {
		sum += a[i];
	}

	//m = a[0];

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

		if (0 > a[i]) {
			a[i+1] = a[i + 1] + a[i];
			if (0 > a[i + 1]) {
				a[i + 1] = 0;
			}
		}

		if (a[i] < 0) {
			a[i] = 0;
		}

		//m += k;
	}

	for (int i = 0; i < a.size(); i++) {
		m += a[i];
	}


	std::cout << sum - m << std::endl;

	return 0;
}

Measured memory_bytes: 1792
#include <stdio.h>
#define N 10000
#define Q 500

int main(){
	int n,q,i,j,k,cnt=0,f=0,t=0;
	int S[N],T[Q],A[N];

	scanf("%d",&n);

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

	scanf("%d",&q);

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

	for(i=0; i<q; i++){
		A[i] = -1;
	}

	for(j=0; j<q; j++){
		for(i=0; i<n; i++){
			f=0;
			for(k=0; k<t; k++){
				if(A[k]==S[i]) f++;
			}
			if(S[i]==T[j] && f==0){
      	cnt++;
				A[t++] = S[i];
    	}
		}
	}

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

	return 0;
}



Measured memory_bytes: 2108
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll n,m,k; cin>>n>>m>>k;
  ll a[n],b[m];
  for(int i=0;i<n;i++) cin>>a[i];
  for(int i=0;i<m;i++) cin>>b[i];
  ll i=0,j=0,curr=0,cnt=0,ans=0;
  for(i=0;i<n&&(curr+a[i]<=k);i++) curr+=a[i],cnt++;
  for(j=0;j<m&&(curr+b[j]<=k); j++) curr+=b[j],cnt++;
  ans=cnt;
  ll rem=k-curr;
  ll idx1=i-1,idx2=j,cnt1=0,cnt2=0,cs1=0,cs2=0;
  while(idx1>=0&&idx2<m){
    cs1+=a[idx1],idx1--,cnt1++;
    while(idx2<m&&cs2+b[idx2]<=(cs1+rem)) cs2+=b[idx2],idx2++,cnt2++;
    if(cnt2>cnt1) {ans=max(ans,cnt-cnt1+cnt2); }
  }
  cout<<ans<<endl;
}
    
  

Measured memory_bytes: 6728
package main

import "fmt"

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

	res := true
	for i := 0; i < n; i++ {
		if a[i]%2 == 0 {
			if (a[i]%3 == 0) || (a[i]%5 == 0) {
			} else {
				res = false
				break
			}
		}
	}

	if res {
		fmt.Println("APPROVED")
	} else {
		fmt.Println("DENIED")
	}
}


Measured memory_bytes: 512
#pragma GCC optimize("O3")
//#pragma GCC target("avx")
#include <bits/stdc++.h>
using namespace std;
#define re return
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define make_unique(x) sort(all(x)),x.resize(unique(all(x))-x.begin())
#define fi first
#define se second
#define ss second.second
#define sf second.first
#define ff first.first
#define fs first.second
#define sqrt(x) sqrt(abs(x))
#define mp make_pair
#define PI 3.14159265358979323846
#define E 2.71828182845904523536
#define er erase
#define in insert
#define fo(i,n) for((i)=0;(i)<(n);(i)++)
#define ro(i,n) for((i)=n-1;(i)>=0;(i)--)
#define fr(i,j,n) for((i)=(j);(i)<(n);(i)++)
#define rf(i,j,n) for((i)=((n)-1);(i)>=(j);(i)--)
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
    const int N=(int)1e5+100;
    const int M=(int)2e6+100;
    const int inf=(int)1e9+100;
#define filename ""

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //freopen(filename".in","r",stdin);
    //freopen(filename".out","w",stdout);
    //freopen("ans.txt","w",stdout);
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    srand(time(0));
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int a,b;
    cin>>a>>b;
    if (a>b) swap(a,b);
    while(b--)
    {
        cout<<a;
    }
}


Measured memory_bytes: 256
a, b = input().split()
a = int(a)
a1 = a % 10
a2 = a % 100
b0 = int(b[0])
b1 = int(b[2])
b2 = int(b[3])

c1 = a * b0
c2 = a // 10 * b1
c3 = a1 * b1 * 0.1
c4 = a // 100 * b2
c5 = a2 * b2 * 0.01
c6 = int(c3 + c5)
print(c1 + c2 + c4 + c6)


Measured memory_bytes: 61720
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(int (i)=(n);(i)>0;(i)--)
#define INF (1ll<<60)
typedef long long lint;
const lint MOD =1000000007;
const lint MAX = 10000000;

 
lint fac[MAX], finv[MAX], inv[MAX];

void COMinit() // 二項係数を求める時は前処理としてCOMinit()をする
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (lint i = 2; i < MAX; 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;
    }
}
 
// 二項係数計算
long long COM(lint n, lint k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

lint primary(lint num)
{
    if (num < 2) return 0;
    else if (num == 2) return 1;
    else if (num % 2 == 0) return 0; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return 0;
        }
    }

    // 素数である
    return 1;
}
int main(){
  pair<lint,lint> k[100001];
  k[1]=make_pair(0,0);
  k[2]=make_pair(0,1);
  repp(i,3,100001){
    if(i%2==0)k[i]=make_pair(0,0);
    else k[i]=make_pair(k[(i+1)/2].second&primary(i),primary(i));
  }
  lint x[100005];
  x[0]=0;
  x[1]=0;
  x[2]=0;
  repp(i,3,100001){
      x[i]=x[i-1]+k[i].first;
  }
  lint Q;
  cin>>Q;
  pair<lint,lint>l[100005];
  rep(i,Q){
    lint a,b;
    cin>>a>>b;
  l[i]=make_pair(a,b);
  }
  rep(i,Q){
   lint g,f;
   tie(g,f)=l[i];
   cout<<x[f]-x[g-1]<<endl;
  }
}

Measured memory_bytes: 4480
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<bitset>
#include<vector>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int INF = 1 << 28;
const double EPS = 1e-10;
//cout << fixed << std::setprecision(9)
//memset(a, 0, sizeof(a));
//--------------------------

ll n, k, x, y;

int main()
{
	cin >> n >> k >> x >> y;

	if (n <= k) {
		cout << n * x << endl;
	}
	else {
		cout << k * x + (n - k) * y << endl;
	}

	return 0;
}








Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
#define int long long
#define ull unsigned long long
#define ld long double
#define rep(a) rep1(i,a)
#define rep1(i,a) rep2(i,0,a)
#define rep2(i,b,a) for(int i=(b); i<((int)(a)); i++)
#define rep3(i,b,a) for(int i=(b); i>=((int)(a)); i--)
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define sz(a) ((int)a.size())
#define pow2(x) (1ll<<(x))
#define ceiling(a,b) (((a)+(b)-1)/(b))
#define print0(a) cout << (a) << ' '
#define print1(a) cout << (a) << '\n'
#define print2(a,b) cout << (a) << ' ',print1(b)
#define print3(a,b,c) cout << (a) << ' ',print2(b,c)
#define print4(a,b,c,d) cout << (a) << ' ',print3(b,c,d)
#ifdef i_am_noob
#define debug(a) print2(#a,a)
#else
#define debug(a) 
#endif
#define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>
 
using namespace std;
using namespace __gnu_pbds;
 
const int Mod=1000000007,Mod2=998244353;
const int MOD=Mod2;
 
inline int add(int a, int b){return (a+b>=MOD?a+b-MOD:a+b);}
inline int sub(int a, int b){return (a+MOD-b>=MOD?a-b:a+MOD-b);}
int Pow(int a, int b){
	if(!b) return 1;
	int tmp=Pow(a*a%MOD,b>>1);
	return (b&1?tmp*a%MOD:tmp);
}
inline int inverse(int n){return Pow(n,MOD-2);}
 
const int maxn=100005;
//i_am_noob
string str;

signed main(){
	ios_base::sync_with_stdio(0),cin.tie(0);
	cin >> str;
	if(str[0]!=str[1]&&str[1]!=str[2]&&str[2]!=str[3]) print1("Good");
	else print1("Bad");
	return 0;
}


Measured memory_bytes: 256
fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());
    let a = sc
        .read::<String>()
        .chars()
        .map(|c| c as usize - 'a' as usize)
        .collect::<Vec<_>>();
    let n = a.len();
    let mut seg = vec![0; n];
    let mut set: usize = 0;
    let mut cur = 0;
    for i in (0..n).rev() {
        set |= 1 << a[i];
        seg[i] = cur;
        if set.count_ones() == 26 {
            cur += 1;
            set = 0;
        }
    }

    let ans = calc(cur, seg, a);
    let s =
        ans.into_iter()
            .map(|i| (i as u8 + 'a' as u8) as char)
            .fold(String::new(), |mut s, c| {
                s.push(c);
                s
            });
    println!("{}", s);
}

fn calc(mut cur: usize, seg: Vec<usize>, a: Vec<usize>) -> Vec<usize> {
    let mut pos = vec![vec![]; 26];
    let n = a.len();
    for i in 0..n {
        pos[a[i]].push(i);
    }

    let mut ans = vec![];
    let mut cur_pos = 0;
    loop {
        for i in 0..26 {
            let idx = pos[i].binary_search(&cur_pos).unwrap_or_else(|x| x);
            match pos[i].get(idx) {
                Some(&idx) => {
                    if seg[idx] < cur {
                        ans.push(i);
                        cur_pos = idx + 1;
                        cur -= 1;
                        break;
                    }
                }
                None => {
                    ans.push(i);
                    return ans;
                }
            }
        }
    }
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: std::ops::Deref<Target = str>>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 10492
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ');
            Console.WriteLine("{0} {1} {2}", input[2], input[0], input[1]);
            Console.ReadKey();
        }
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
 
const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);
 
using namespace std;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int K,S;
    cin >> K >> S;
    ll ans = 0;
    for(int X=0;X<=K;X++){
        for(int Y=0;Y<=K;Y++){
            if(X+Y<=S && S-X-Y<=K)ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
const int MAX = 1e6;
typedef long long ll;

bool prime[MAX+1];
ll dp[MAX+1];

void is_prime(){
  fill(prime,prime+MAX+1,true);

  prime[0] = prime[1] = false;
  for(int i = 2 ; i*i <= MAX ; i++){
    if(prime[i]){
      for(int j = i*i ; j <= MAX ; j+=i){
	prime[j] = false;
      }
    }
  }

}

int eulerPhi(int n){
  int res = n;

  for(int i = 2 ; i*i <= n ; i++){
    if(n % i == 0){
      res -= res / i;
      while(n % i == 0) n /= i;
    }
  }

  if(n > 1) res -= res / n;

  return res;
}

void init(){
  is_prime();

  dp[1] = 2; // 0/1 , 1/1

  for(int i = 2 ; i <= MAX ; i++){
    if(prime[i]){
      dp[i] = dp[i-1] + (i-1);
    }
    else{
      dp[i] = dp[i-1] + eulerPhi(i);
    }
  }

}

int main(){
  int T,in;

  init();

  cin >> T;
  while(T--){
    cin >> in;
    cout << dp[in] << endl;
  }

  return 0;
}

Measured memory_bytes: 9944
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<int,int>;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)

constexpr double PI = acos(-1);

int main() {
    int k,n;
    cin >> k >> n;
    vector<int> v(n,0);
    rep(i,n) cin >> v.at(i);
    v.emplace_back(k+v.at(0));
    int l = 0;
    rep(i,n) {
    	l = max(l,v.at(i+1)-v.at(i));
    }
    cout << k-l << "\n";
    return 0;
}

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

typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
typedef pair<ll,ll> lll;

const ll MOD = 1000000007;
const ll INF = 1e9+5;
const double eps = 1e-7;
const double PI = acos(-1.0);

#define FOR(i,a,b) for(long long i = (long long)(a); i < (long long)(b); i++)
#define RFOR(i,a,b) for(long long i = (long long)(a); i >= (long long)(b); i--)
#define ull unsigned long long
#define deb(x )     cerr << #x << " = "<< x << endl;
#define endl    "\n"
#define coud(a,d) cout << fixed << showpoint << setprecision(d) << a;
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define fill(x, y) memset(x, y, sizeof(y))
#define all(x) (x).begin(), (x).end()
#define bitcount(x) __builtin_popcount(x)
#define cps CLOCKS_PER_SEC
#define verify(x) if(x >= MOD) x -= MOD;

inline void debug_vi(vi a) {FOR(i, 0, a.size()) cout<<a[i]<<" ";}
inline void debug_vll(vll a) {FOR(i, 0, a.size()) cout<<a[i]<<" ";}
inline void print_case(int tn) {cout<<"Case #"<<tn<<": ";}

template<typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;

template<typename T>
using maxpq = priority_queue<T>;
/*----------------------------------------------------------------------*/

int main(){
    std::ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int a; cin>>a;
    cout << a + (a * a) + (a * a * a);

    return 0;
}

Measured memory_bytes: 3636
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
using ll = long long;

typedef long long ll;
typedef vector<ll> VL;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define INF 999999999
ll V,E,Q;
vector<ll> G[10010];
vector<ll> rG[10010];
ll com[10010]; //頂点の成分番号
bool used[10010];
bool rused[10010];
vector<ll> vs;

void dfs(ll v){
  used[v]=true;
  REP(i,G[v].size()){
    if(!used[G[v][i]]){
      dfs(G[v][i]);
    }
  }
  vs.push_back(v);
}

void rdfs(ll v,ll c){
  rused[v]=true;
  com[v]=c;
  REP(i,rG[v].size()){
    if(!rused[rG[v][i]]){
      rdfs(rG[v][i],c);
    }
  }
}

int main(){
  cin>>V>>E;
  ll s,t;
  REP(i,E){
    scanf("%lld %lld",&s,&t);
    G[s].push_back(t);
    rG[t].push_back(s);
  }
  memset(used,0,sizeof(used));
  memset(rused,0,sizeof(rused));
  
  REP(i,V){
    if(!used[i])dfs(i);
  }
  
  ll group=0;
  REPR(i,V-1){
  if(!rused[vs[i]])rdfs(vs[i],group);
  group++;
  }
  
  cin >> Q;
  REP(i,Q){
    scanf("%lld %lld ",&s,&t);
    if(com[s]==com[t])printf("1\n");
    else printf("0\n");
  }
}


Measured memory_bytes: 4820
def main():
    N, K = map(int, input().split())
    h = []
    for _ in range(N):
        h.append(int(input()))
    h.sort()
    ans = pow(10, 10)
    for k in range(N-K+1):
        ans = min(ans, abs(h[k]-h[K-1+k]))
    print(ans)

if __name__ == "__main__":
    main()


Measured memory_bytes: 13244
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <numeric>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF 1e18
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define PI (acos(-1))

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

ll an(ll k){
    return pow(2, k) * 4 - 3;
}

ll pn(ll k){
    return pow(2, k) * 2 - 1;
}

ll burger(ll n, ll k){
    if (n == 0) return 1;
    if (k == 1) return 0;
    if (k <= an(n - 1) + 1) return burger(n - 1, k - 1);
    if (k == an(n - 1) + 2) return pn(n - 1) + 1;
    if (k < an(n)) return pn(n - 1) + 1 + burger(n - 1, k - an(n - 1) - 2);
    if (k == an(n)) return 2 * pn(n - 1) + 1;

    cout << "error" << n << " " << k << endl;
    cout << (1 << n) << endl;
    return 0;
}

int main() {
    ll n , x;
    cin >> n >> x;
    cout << burger(n, x) << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
#define pii pair<int,int>
#define int long long
#define gcd __gcd
const int inf = 0x3f3f3f3f;
const int maxn = 201110;
const int M = 1e9+7;
int n,m,k;

int p[maxn];
int sum[maxn];

signed main()
{
    cin>>n>>k;
    int ans = 0;
    for(int i = 1; i <= n; i++) 
    {
        cin>>p[i];
        sum[i] = sum[i-1] + p[i];
        if(i >= k)
        {
            ans = max(ans,sum[i] - sum[i-k]);
        }
    }
    double res = (ans+k)*1.0/2;
    printf("%.7lf\n",res);
    return 0;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define perm(c) sort(ALL(c));for(bool c##p=1;c##p;c##p=next_permutation(ALL(c)))
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
#define to_s to_string
#define len(v) (ll)v.size()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define print(x) cout << (x) << '\n'
#define drop(x) cout << (x) << '\n', exit(0)
#define debug(x) cout << #x << ": " << (x) << '\n'
using namespace std;
using ll = long long;
typedef pair<ll, ll> P;
typedef vector<ll> vec;
typedef vector<vector<ll>> vec2;
typedef vector<vector<vector<ll>>> vec3;
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; }
ll MOD = 1e9 + 7;
ll devc(ll x, ll y) { return 1 + (x - 1) / y; }

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

    ll N;
    cin >> N;
    ll ans = 0;
    rep(i, N){
        ll a;
        cin >> a;
        while(a % 2 == 0){
            a /= 2;
            ++ans;
        }
    }
    print(ans);

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cstdlib>
#include <algorithm>
using namespace std;
int main()
{
    int k;
    cin >> k;
    string s;
    cin >> s;
    //s.erase(remove(s.begin(), s.end(), '\n'), s.end());
    string t;
    if(s.size() >k) {
        while(s.size()!=k)
            s.pop_back();
        cout << s << "..." << endl;
    }
    else{
        cout << s <<  endl;   
    }
    
    //int len1=s.size()-k;
    //cout << len1 << endl;
    //int len=abs(len1);
    //cout << len << endl;
    //if (len<5)
    //    cout << s << endl;
    //else if(len>=5 && s.size()-k>=5){
    //    while(s.size()!=k)
    //        s.pop_back();
    //    cout << s << "..." << endl;
    //}
    return 0;
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	string s;
	cin>>s;
	queue<int>ind;
	int c=0;
	for(int i=n-1;i>=0;i--)
	{
		if(s[i]=='R')
			ind.push(i);
	}
	for(int i=0;i<n;i++)
	{
		if(s[i]=='W'&&!ind.empty()&&i<ind.front())
		{
			int x = ind.front();
			ind.pop();
			s[x]='W';
			s[i]='R';
			c++;
		}
	}
	cout<<c<<"\n";
	//cout<<s<<"\n";
}

Measured memory_bytes: 4400
require 'complex'

N = gets.chomp.to_i
Towns = N.times.map { |n| 
  x, y = gets.chomp.split(' ').map(&:to_i)
  [x, y]
}

average = 0;
count = 0;
(0...N).to_a.permutation(N) do |t|
  distance = (1...N).map do |n|
    ima = Towns[t[n-1]]
    tsugi = Towns[t[n]]
    dx = tsugi[0] - ima[0]
    dy = tsugi[1] - ima[1]
    Math.sqrt(dx*dx + dy*dy)
  end
  count += 1
  average += distance.reduce(&:+)
end

puts average / count


Measured memory_bytes: 1916
import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array;


void main() {
    writeln(readln.chomp.replace(" ", "").to!int % 4 ? "NO" : "YES");
}



void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

std::string S;

int main()
{
	in >> S;
	if (S.length() < 26)
	{
		for (char c = 'a'; c <= 'z'; ++c)
		{
			bool flag = true;
			for (auto i : S)
			{
				if (i == c)
				{
					flag = false;
					break;
				}
			}
			if (flag)
			{
				out << S << c << std::endl;
				return 0;
			}
		}
	}
	else
	{
		auto def = S;
		std::next_permutation(S.begin(), S.end());
		if (def > S)
		{
			out << -1 << std::endl;
			return 0;
		}
		rep(i, S.length())
		{
			if (def[i] < S[i])
			{
				out << S.substr(0, i + 1) << std::endl;
				return 0;
			}
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <tuple>
#include <iomanip>
#include <random>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <chrono>
#include <stack>
#include <string>
#include <bitset>
#include <unordered_map>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>

using namespace std;

#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x.size())
#define pb push_back
#define endl "\n" // TODO: remove
#define int long long

const int N = (int)(1e6) + 322;
const long long inf = (long long)(2e18) + 322;
const int mod = (int)(1e9) + 7; // check modulo

int a[N], n, k;

bool check(int len) {
    int cnt = 0;
    for(int i = 1; i <= n; ++i) {
        cnt += (a[i] - 1) / len;
    }
//    cout << cnt << endl;
    return cnt <= k;
}

void solve() {
    cin >> n >> k;
    for(int i = 1; i <= n; ++i) cin >> a[i];
    int ans = -1, l = 1, r = inf;
    while (l <= r) {
        int mid = (l + r) / 2;
        if (check(mid)) {
            ans = mid;
            r = mid - 1;
        }else {
            l = mid + 1;
        }
    }
    cout << ans;
}

signed main () {
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL);

    int test = 1;//  cin >> test;
    for(int t = 1; t <= test; ++t) {
        solve();
    }
    return 0;
}



Measured memory_bytes: 4728
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for (ll i = 0; i < (n); ++i)


void solve(std::string S){
    if(S.size() == 3){
        swap(S.at(0), S.at(2));
    }
    cout << S << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;

int main() {
	char b;
	cin >> b;

	if (b == 'A') {
		cout << 'T' << endl;
	}
	else if (b == 'T'){
		cout << 'A' << endl;
	}
	else if (b == 'C') {
		cout << 'G' << endl;
	}
	else {
		cout << 'C' << endl;
	}
}

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


int main() {
  int n,k,i;
  cin>>n>>k;
  long long int x[n],ans=10e9;
  for(i=0;i<n;i++)
    cin>>x[i];
  for(i=0;i<=n-k;i++){
    if(x[i+k-1]<=0)
      ans=min(ans,-x[i]);
    else if(x[i]<0 && x[i+k-1]>0){
      ans=min(ans,2*x[i+k-1]-x[i]);
      ans=min(ans,-2*x[i]+x[i+k-1]);
    }
    else ans=min(ans,x[i+k-1]);
  }
  cout<<ans;
  
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <typeinfo>
#include <algorithm>
using namespace std;
int main(void){
    int n, m, k;
    cin >> n >> m >> k;
    for(int x=0; x<=n; x++){
        for(int y=0; y<=m; y++){
            if(k==x*y+(n-x)*(m-y)){
                cout << "Yes" << endl;
                exit(0);
            }
        }
    }
    cout << "No" << endl;
}

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

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

int main(){
    ll a,b,c,x,y;
    cin >> a >> b >> c >> x >> y;
    ll M=max(x,y);
    ll m=x+y-M;
    ll ans=2*M*c;
    
    ans=min(ans,a*x+b*y);

    if(M==x) b=a;

    ans=min(ans,m*2*c+b*(M-m));

    cout << ans << endl;

}

Measured memory_bytes: 3684
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
using ll = long long;
int main()
{
	ll n,k;
    cin >> n >> k;
    ll arr[n];
    for(ll i=0;i<n;i++) cin >> arr[i];
    for(ll i = k;i<n;i++)
    {
        if(arr[i] > arr[i - k])
        {
            cout << "Yes" << endl;
            
        }
        else
        {
            cout << "No" << endl;
        }
    }
	return 0;
}

Measured memory_bytes: 5192
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, b) for (int i = (a); i <= (b); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i, n)
    {
        cin >> a[i];
    }
    int prev_score = 0;
    bool flag = false;
    for (int i = k; i < n; i++)
    {
        if (a[i - k] >= a[i])
            cout << "No" << endl;
        else
            cout << "Yes" << endl;
    }
    return 0;
}


Measured memory_bytes: 3980
#include<iostream>

int main() {
  int a,b,c;
  std::cin >> a >> b >> c;
  if(a==b && a!=c || b==c && b!=a || a==c && b!=c) {
    std::cout << "Yes" << std::endl;
  } else {
    std::cout << "No" << std::endl;
  }
  return 0;
}

Measured memory_bytes: 888
import bisect

def sieve(n):
    is_prime =[1]*n
    is_prime[0]=0

    for i in range(2,int((n**0.5)//1+2)):
        if is_prime[i-1]:
            j=i*2
            while j<=n:
                is_prime[j-1]=0
                j+=i
    table=[i for i in range(3,n+1) if is_prime[i-1] and is_prime[i//2]]
    return table

q=int(input())
L=sieve(10**5+1)
ans=[]

for i in range(q):
    l,r=map(int,input().split())
    ans.append(bisect.bisect_right(L,r)-bisect.bisect_left(L,l))

print(*ans,sep="\n")

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

int main() 
{
    int a,b,y;
    double x;
    cin >> a >> b;
    x = (a + b) / 2;
    if((a % 2 == 1 && b % 2 == 1) || (a % 2 == 0 && b % 2 == 0))
    {
        cout << x << endl;
    }
    else
    {
        y = (a + b) / 2;
        y++;
        cout << y << endl;
    }
    
}


Measured memory_bytes: 3652
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

string v[55000];
string s;
int K;

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

    int cnt = 0;
    for(int i=1; i<=K; i++) {
        for(int j=0; j+i<=s.size(); j++) {
            v[cnt++] = s.substr(j,i);
        }
    }

    sort(v,v+cnt);
    unique(v,v+cnt);

    cout << v[K-1] << endl;
    return 0;
}

Measured memory_bytes: 1792
## coding: UTF-8
#最後の方のテストケースでREになってしまう。時間切れ。
from decimal import *
from itertools import permutations, combinations,combinations_with_replacement,product

N = int(input())

s = input().split()
p = [int(w) for w in s]
#print('p:{}'.format(p))

number_list = [0 for i in range(N)]
'''
for i in range(N):
    counter = 0
    for j in range(N):
        if(p[j] == i+1):
            counter +=1
    number_list.append(counter)
'''
#print(number_list)

for i in range(N):
    number_list[p[i] - 1] += 1
#print(number_list)



def n_C_2(n):
    if(n == -1):
        return 0
    else:
        return int(n * (n-1) / 2)


full_combi = []
pickup_combi = []
print_combi = []

for i in range(N):
    full_combi.append(n_C_2(number_list[i]))
    pickup_combi.append(n_C_2(number_list[i] - 1))
#print('full_combi:{}'.format(full_combi))
#print('pickup_combi:{}'.format(pickup_combi))

all_full = sum(full_combi)
for i in range(N):
    print_combi.append(all_full - full_combi[i] + pickup_combi[i])
#print('print_combi:{}'.format(print_combi))

for i in range(N):
    index = p[i] - 1
    print(print_combi[index])

Measured memory_bytes: 44940
#include <iostream>
#include <climits>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <deque>
#define INF_INT (INT_MAX / 2)
#define INF_LONG (LONG_MAX / 2)
//#define DEBUG true
#define DEBUG false
using namespace std;

const int MAX = 100001;
const int MOD = 1000000007;

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef pair< ll, int > pli;
typedef pair< int, ll > pil;

int ceil(int x, int y){
  return (x % y == 0) ? x / y : x / y + 1;
}

int gcd(int x, int y){
  return y ? gcd(y, x % y) : x;
}

int lcm(int x, int y){
  return x / gcd(x, y) * y;
}

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

  int n;
  cin >> n;

  int n2 = 2 * (n / 2);

  set< pii > edges;
  for(int v = 1; v <= n; v++){
    for(int w = v + 1; w <= n; w++){
      if(w != (n2 + 1) - v) edges.insert(make_pair(v, w));
    }
  }

  string buf;
  buf += to_string(edges.size()) + "\n";
  for(pii e: edges){
    buf += to_string(e.first) + " " + to_string(e.second) + "\n";
  }

  cout << buf;

  return 0;
}


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

const ll ma = 5000*5000 + 10;
ll dp[5][ma];

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

    ll N;
    vector<ll> AS(4, 0), BS(4, 0);
    cin >> N >> AS[0] >> AS[1] >> AS[2] >> BS[0] >> BS[1] >> BS[2];
    AS[3] = 1;
    BS[3] = 1;

    //const ll ma = 10000;
    REP(i, 5)REP(j, ma) dp[i][j] = 0;

    // former
    ll limit = N;
    REP(i, 4){
    	REP(j, limit+1){
    		if(j < AS[i]) dp[i+1][j] = dp[i][j];
    		else dp[i+1][j] = max(dp[i][j], dp[i+1][j-AS[i]]+BS[i]);
    	}
    }
    
    ll M = dp[4][limit];


    // latter
    REP(i, 5)REP(j, ma) dp[i][j] = 0;
    limit = M;

    REP(i, 4){
    	REP(j, limit+1){
    		if(j < BS[i]) dp[i+1][j] = dp[i][j];
    		else dp[i+1][j] = max(dp[i][j], dp[i+1][j-BS[i]]+AS[i]);
    	}
    }

    cout << dp[4][limit] << endl;
    return 0;
}

Measured memory_bytes: 976768
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define For(i,a,b) for(i=a;i<b;i++)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
int main(){
  ll i,N,sum=0,psum=0,mount;
  cin>>N;
  vector<ll> dam(N);
  rep(i,N){
    cin>>dam[i];
    if(i%2)psum+=dam[i];
    sum+=dam[i];
  }
  cout<<(mount=sum-psum*2)<<" ";
  rep1(i,N)cout<<(mount=dam[i-1]*2-mount)<<" ";
  cout<<endl;
  return 0;
}


Measured memory_bytes: 2048
X, Y, A, B, C = map(int, input().split())
P = [-1] + sorted(list(map(int, input().split())))
Q = [-1] + sorted(list(map(int, input().split())))
R = [-1] + sorted(list(map(int, input().split())))

ans = 0
r = 0
N = X+Y
while N > 0:
  max_V = max(P[-1], Q[-1], R[-1])
  if P[-1] == max_V:
    P.pop(-1)
    if X < 1:
      continue
    X -= 1
  elif Q[-1] == max_V:
    Q.pop(-1)
    if Y < 1:
      continue
    Y -= 1
  else:
    R.pop(-1)
    r += 1
    
  ans += max_V
  N = X+Y-r
  
print(ans)

Measured memory_bytes: 23284
# coding: utf-8
from functools import reduce
from queue import Queue
from collections import deque

s = input()
t = input()

saisho_kyori = 1001
for i in range(len(s) - len(t)+1):
    kyori = 0
    for j in range(len(t)):
        if s[i + j] != t[j]:
            kyori += 1
    saisho_kyori = min(kyori, saisho_kyori)

print(saisho_kyori)


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

int main() {
  int n, a, s = 0;
  cin >> n;
  for(int i = 1;i <= n;i++) {
    cin >> a;
    if(a != i) s++;
  }
  cout << ((s == 0 || s == 2) ? "YES" : "NO") << endl;
}

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

using namespace std;
#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
//rep…「0からn-1まで」の繰り返し
#define rep2(i,s,n) for(long long i=s; i<=(long long)(n);i++)
//rep2…「sからnまで」の繰り返し
#define repr(i,s,n) for(long long i=s;i>=(long long)(n);i--)
//repr…「ｓからnまで」の降順の繰り返し

typedef long long ll;

const int inf = 1e9+7;
const int mod = 1e9+7;

int main(){
    string A,B,C;
    cin>>A>>B>>C;

    reverse(A.begin(),A.end());
    reverse(B.begin(),B.end());
    reverse(C.begin(),C.end());

    char x='a',ans;

    for(;;){
        if(x=='a'){
            if(A.size()==0){
                ans='A';
                break;
            }
            x=A[A.size()-1];

            A.pop_back();
        }
        else if(x=='b'){
            if(B.size()==0){
                ans='B';
                break;
            }
            x=B[B.size()-1];

            B.pop_back();
        }
        else if(x=='c'){
            if(C.size()==0){
                ans='C';
                break;
            }
            x=C[C.size()-1];
            C.pop_back();
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3612
from sys import stdin, setrecursionlimit


def gcd(x, y):
    if x % y == 0:
        return y
    return gcd(y, x % y)


def main():
    input = stdin.buffer.readline
    n = int(input())
    a = list(map(int, input().split()))

    l = [0] * (n - 1)
    r = [0] * (n - 1)
    l[0] = a[0]
    r[-1] = a[-1]

    for i in range(1, n - 1):
        l[i] = gcd(l[i - 1], a[i])
        r[n - 2 - i] = gcd(r[n - 1 - i], a[n - 1 - i])

    ans = 0
    for i in range(n):
        if i == 0:
            ans = max(ans, r[i])
        elif i == n - 1:
            ans = max(ans, l[i - 1])
        else:
            ans = max(ans, gcd(l[i - 1], r[i]))

    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()


Measured memory_bytes: 58224
#include <stdio.h>
int main (){
int n,t,i,x[102]={0},k,min=1003,ya=0;
	scanf("%d %d",&n,&t);
	for(i=0;i<n;i++){
	scanf ("%d %d",&x[i],&k);
		if(k<=t)
		{
			if(min>x[i])
			{
				min=x[i];
			}
		}
		else
		{
		ya++;
		}	
	}
	if(ya==n)
	{
	printf("TLE");	
	}
	else
	{
	printf("%d",min);	
	}
	return 0;
	}


Measured memory_bytes: 128
#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <ctype.h>
#include <algorithm>
#include <cmath>
#include <vector>

#define REP(i, n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
#define square(x) (x) * (x)

const int INF = 1e9;

using namespace std;

int main() {
    int x, y;
    while(1) {
        cin >> x >> y;
        if (x == 0 && y == 0)
            break;
        cout << (x < y ? x : y) << " " << (x < y ? y : x) << endl;
    }
    return 0;
}

Measured memory_bytes: 1160
#include <stdio.h>

int main(void)
{
	int ab[60];
	int result[30];
	int w, n;
	int i, j;
	int tmp;
	
	scanf("%d", &w);
	scanf("%d", &n);
	
	for (i = 0; i < w; i++){
		result[i] = i + 1;
	}
	for (i = 0; i < n * 2; i += 2){
		scanf("%d%*c%d", &ab[i], &ab[i + 1]);
	}
	for (i = 0; i < n * 2; i += 2){
		tmp = result[ab[i] - 1];
		result[ab[i] - 1] = result[ab[i + 1] - 1];
		result[ab[i + 1] - 1] = tmp;
	}
	for (i = 0; i < w; i++){
		printf("%d\n", result[i]);
	}
	return (0);
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
#define modulo 998244353
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 100000000000000000


int main(){
	
	int N,C;
	cin>>N>>C;
	
	vector<vector<pair<int,int>>> V(C,vector<pair<int,int>>());
	
	for(int i=0;i<N;i++){
		int s,t,c;
		cin>>s>>t>>c;
		s--;
		c--;
		V[c].emplace_back(s,t);
	}
	
	for(int i=0;i<C;i++){
		sort(V[i].begin(),V[i].end());
	}
	
	vector<vector<pair<int,int>>> V2(C,vector<pair<int,int>>());
	
	for(int i=0;i<C;i++){
		for(int j=0;j<V[i].size();j++){
			if(V2[i].size()==0){
				V2[i].emplace_back(V[i][j].first,V[i][j].second);
				continue;
			}
			
			if(V2[i].back().second >= V[i][j].first){
				V2[i].back().second = V[i][j].second;
			}
			else{
				V2[i].emplace_back(V[i][j].first,V[i][j].second);
			}
		}
	}
	
	vector<int> imos(1000000,0);
	
	for(int i=0;i<C;i++){
		for(int j=0;j<V2[i].size();j++){
			imos[V2[i][j].first]++;
			imos[V2[i][j].second]--;
		}
	}
	
	int ans = imos[0];
	for(int i=1;i<100000;i++){
		imos[i] += imos[i-1];
		ans = max(ans,imos[i]);
	}
	
	cout<<ans<<endl;
	
    return 0;
}


Measured memory_bytes: 6272
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/math/common_factor_rt.hpp>

using namespace std;

int main()
{
    int64_t H, W, D;
    std::cin >> H >> W >> D;

    boost::multi_array<int64_t, 2> A(boost::extents[H][W]);
    for (auto p = A.data(); p < (A.origin() + A.num_elements()); ++p) {
        std::cin >> *p;
    }

    struct Pos {
        int64_t x;
        int64_t y;
    };

    std::map<int64_t, Pos> B;
    for (int64_t h = 0; h <H; ++h) {
        for (int64_t w = 0; w <W; ++w) {
            B[ A[h][w] ] = {w+1, h+1};
        }
    }

    std::vector<int64_t> C(H*W+1);
    for (size_t i = D+1; i <= H*W; ++i) {
        C[i] = std::abs(B[i].x - B[i-D].x) + std::abs(B[i].y - B[i-D].y);
        if (i - D >= 1) {
            C[i] += C[i-D];
        }
    }

    int64_t Q;
    std::cin >> Q;

    for (int64_t i = 0; i < Q; ++i) {
        int64_t l, r;
        std::cin >> l >> r;

        std::cout << C[r] - C[l] << std::endl;
    }

    return 0;
}


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

#include <iostream>
#include <fstream>

#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 BPowerSocket {
public:
	void solve(std::istream& in, std::ostream& out) {
        int a,b;
        in >> a >> b;
        int t=1,ans=0;
        while(t<b){
            t+=a-1;
            ans++;
        }
        out << ans << endl;
	}
};


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


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

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(lol i=0;i<lol(n);i++)
#define REPD(i,n) for(lol i=n-1;i>=0;i--)
#define FOR(i,a,b) for(lol i=a;i<=lol(b);i++)
#define FORD(i,a,b) for(lol i=a;i>=lol(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() //sortなどの引数を省略したい
#define SIZE(x) lol(x.size()) //sizeをsize_tからllに直しておく
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//最大値最小値
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main()
{
    lol num;
    lol n; cin >> n;
    bitset<64> a[n];
    bitset<64> b;
    //int k; cin >> k;
    
    //vector<int> a(n);
    REP(i, n)
    {
        cin >> num;
        a[i] = bitset<64>(num);
        b = b xor a[i];
    }
    REP(i, n)
    {
        a[i] = a[i] xor b;
        cout << a[i].to_ullong() << " ";
    }
    cout << endl;

    //cout << result << endl;
    return 0;
}

Measured memory_bytes: 5116
using System;
using static System.Console;
using static System.Math;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TemplateAlgorithm
{
    class Program
    {
        public const long Inf = (long)1e18;
        public const double eps = 1e-6;
        public const string alfa = "abcdefghijklmnopqrstuvwxyz";
        public const string ALFA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        public const int MOD = 1000000007;
        
        // c ot i
        static int ToInt(char c) => c - '0';

        static void Main(string[] args)
        {
            int N = IO.ReadInt();
            int[] H = IO.ReadIntArr();
            
            long cnt = 1;
            bool isVisible = true;
            for (var i = 1; i< N; i++)
            {
                for (var j = i-1; j >= 0; j--)
                {
                    if (H[i] < H[j])
                    {
                        isVisible = false;
                    }
                }
                if (isVisible) cnt++;
                isVisible = true;
            }
            WriteLine(cnt);
        }

        #region  範囲

        public static bool InRange<T>(T begin, T end, T value) where T : IComparable<T> 
            => value.CompareTo(begin) >= 0 && value.CompareTo(end) <= 0;

        #endregion

        #region MIN,MAX

        /// <summary>
        /// 最大値を返す
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="vals"></param>
        /// <returns></returns>
        public static T MaxValue<T>(params T[] vals) => vals.Max();

        /// <summary>
        /// 最小値を返す
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="vals"></param>
        /// <returns></returns>
        public static T MinValue<T>(params T[] vals) => vals.Min();
        #endregion
    }

    #region IO

    /// <summary>
    /// IO
    /// </summary>
    public class IO
    {
        public static string ReadStr(bool isTrim = false) => (isTrim) ? ReadLine().Trim() : ReadLine();
        public static int ReadInt() => int.Parse(ReadStr());

        public static long ReadLong() => long.Parse(ReadStr());

        public static decimal ReadDecimal() => decimal.Parse(ReadStr());
        public static double ReadDouble() => double.Parse(ReadStr());
        public static string[] ReadStrArr(char separator = ' ') => ReadLine().Split(separator);
        public static int[] ReadIntArr() => Array.ConvertAll(ReadStrArr(), int.Parse);
        public static long[] ReadLongArr() => Array.ConvertAll(ReadStrArr(), long.Parse);

        public static decimal[] ReadDecimalArr() => Array.ConvertAll(ReadStrArr(), decimal.Parse);
        public static double[] ReadDoubleArr() => Array.ConvertAll(ReadStrArr(), double.Parse);        
    }

    #endregion    
}


Measured memory_bytes: 11220