akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair

#define forn(i,s,n) for(i=s;i<n;i++)
#define all(c)  c.begin(),c.end()
#define boost ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(0);srand(time(NULL));
#define tc(t) ll t;cin >> t; while(t--)
/* cout << fixed << setprecision(12) << ans << endl;*/
#define pii pair<long long,long long>
#define vii vector<pii>
#define vvi vector<vector <long long> >

#define ff first
#define ss second

#define pqmax priority_queue<int>
#define pqmin priority_queue<int,vector<int> , greater<int> >

#define deb1(x) cout<<#x<<" : "<<x<<endl;
#define deb2(x,y) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<endl;
#define deb3(x,y,z) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<"\t"<<#z<<" : "<<z<<endl;
#define deba(a,n) for(ll i=0;i<n;++i) {  cout<<a[i]<<" "; };cout<<"\n"

#define MOD 1000000007
#define INF LONG_LONG_MAX
#define MINF LONG_LONG_MIN
ll mx=1e5 + 5;
vector<ll> a(mx,0),b(mx,0),c(mx,0);
vector<vector<ll> > sl(mx, vector<ll>(3,-1));
ll solve(ll i , ll s )
{
	
/*	if(n==0)
	return 0;
	else */ 
	if(i==0)
	{
		if(s==0)
		return sl[i][s]=a[0];
		else if(s==1)
		return sl[i][s]=b[0];
		else
		return sl[i][s]=c[0];
    }
    else
    {
    /*	ll ain=solve(i-1,1) + max(b[i],c[i] );
    	ll bin=solve(i-1,2) + max(a[i],c[i] ) ;
    	ll cin=solve(i-1,3) + max(b[i],a[i] ) ; */
    	ll ain ,bin,cin;
    	
    	if(sl[i-1][0]==-1)
        {ain=solve(i-1,0) ; 
         sl[i-1][0]=ain;
		}
		else
		ain=sl[i-1][0];
		
		
		if(sl[i-1][1]==-1)
        {bin=solve(i-1,1) ; 
         sl[i-1][1]=bin;
		}
		else
		bin=sl[i-1][1];
		
		if(sl[i-1][2]==-1)
        {cin=solve(i-1,2) ; 
         sl[i-1][2]=cin;
		}
		else
		cin=sl[i-1][2];
		
    	
    	
    	
    	ll s1=a[i] + max(bin,cin);
    	ll s2=b[i] + max(cin,ain);
    	ll s3=c[i] + max(ain,bin);
    	
    	if(s==0)
    	return s1;
    	else if(s==1)
    	return s2;
    	else
    	return s3;
    	
    //	return max(s1 , max (s2 , s3 ));
    	
	}
}






int main()
{
 boost;
 ll n;
 cin >> n;
 ll i=0;
 forn(i,0,n)
 {
 	cin >> a[i] >> b[i] >> c[i];
 }
 cout << max( solve(n-1,0) , max ( solve(n-1,1) , solve(n-1,2) ) );

}






Measured memory_bytes: 14336
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define mod 1000000007
using namespace std;
int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,x,t;
    cin>>n>>x>>t;
    int rem=n%x;
    int ans=n/x;
    ans*=t;
    if(rem!=0) ans+=t;
    cout<<ans;    
    return 0;
}

Measured memory_bytes: 3632
# include <bits/stdc++.h>
# define INF 1e9
using namespace std;

int main(){

  string S;
  cin >> S;
  int k = S.size();
  int win = 15-k;
  for(int i=0; i<k; ++i){
    if(S[i] == 'o') win++;
  }
  if(win >=8) cout << "YES" << endl;
  else cout << "NO" << endl;

}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
int a[5],x,y,max,i;
while(scanf("%d %d",&x,&y),x||y){
max=0;
a[0]=x+y;
for(i=1;i<5;i++){
scanf("%d %d",&x,&y);
a[i]=x+y;
}
for(i=0;i<5;i++)
if(max<a[i])
max=a[i];
for(i=0;i<5;i++)
if(a[i]==max)
printf("%c %d\n",'A'+i,max);
}
return 0;
}

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

int main(void)
{
	int in;
	int zi, hun;

	cin >> in;

	zi = in / 3600;
	in -= (zi*3600);

	hun = in / 60;
	in -= (hun*60);

	cout << zi << ":" << hun << ":" << in << endl;

	return 0;
}


Measured memory_bytes: 3100
n = int(input())
h = list(map(int, input().split()))
dp = [0]*n
dp[0] = 0
dp[1] = abs(h[1]-h[0])
for i in range(2, n):
    dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]))
print(dp[n-1])


Measured memory_bytes: 13980
#include <stdio.h>

int main (void)
{

int i, a, b, c, count;

count = 0; 

scanf("%d %d %d", &a, &b, &c);

for(i = a; i <= b; i++)
{
	if ( c % i == 0)
	{
		count += 1;
	}
	
}

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

return 0;
}

Measured memory_bytes: 1816
#include <bits/stdc++.h>
#include <string>
#include <cmath>
#include <sstream>
#include <unordered_map>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORD(i, a, b) for(int i = (a-1); i >= (b); i--)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ff first
#define ss second
typedef long long int ll;
using namespace std;
//ll mod=1000000007;
ll mod=67280421310721;
//ll mod=998244353;
ll INF=1e18;
ll po(ll a,ll b)
{
	ll re=1;
	while(b)
	{
		if(b%2==1)
		{
			re=(re*a);
			re%=mod;
		}
		a=(a*a);
		a%=mod;
		b>>=1;
	}
	return re;
}
bool che(string a,string b)
{
return a.size()<b.size();
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int test=1;
//	cin>>test;
	while(test--)
	{
		int n;
		cin>>n;
		string s[n];
		unordered_map<ll , int> cnt[27];
		ll hash;
		FOR(i,0,n)
		{
			cin>>s[i];
		}
		sort(s,s+n,che);
		ll ans=0;
		FOR(i,0,n)
		{
			hash =0;
			int cn[26]={0};
			FORD(j,s[i].size(),0)
			{
				if(cnt[26][hash]>0)
				{
					FOR(k,0,26)
					{
						cn[k]+=cnt[k][hash];
					}
				}
				ans+=cn[s[i][j]-'a'];
				cn[s[i][j]-'a']=0;
				if(j==0)
				{			
					cnt[s[i][0]-'a'][hash]++;
					cnt[26][hash]++;
				}
				hash*=31;
				hash+=(s[i][j]-'a'+2);
				hash%=mod;
			}
		}
		cout<<ans;
	}
	return 0;
}

Measured memory_bytes: 63108
#include<iostream>
#include<vector>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
int main() {
	int N, A, B;
	cin >> N >> A >> B;
	if (N * A <= B) {
		std::cout << N * A;
	}
	else std::cout << B;
	
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

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

    string A, B, C;
    cin >> A;
    cin >> B;
    cin >> C;
    char turn = 'a';
    int a = 0, b = 0, c = 0;

    while (true) {
        if (turn == 'a') {
            if (a == A.length()) {
                cout << "A" << endl;
                break;
            } else {
                turn = A[a++];
            }
        } else if (turn == 'b') {
            if (b == B.length()) {
                cout << "B" << endl;
                break;
            } else {
                turn = B[b++];
            }
        } else if (turn == 'c') {
            if (c == C.length()) {
                cout << "C" << endl;
                break;
            } else {
                turn = C[c++];
            }
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
template <class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

int main() {
    int d;
    cin >> d;
    vector<int> c(26);
    rep(i, 26) cin >> c[i];
    vector<vector<int>> s(d, vector<int>(26));
    rep(i, d) rep(j, 26) cin >> s[i][j];
    int t;
    vector<int> last(26, -1);
    int satisfy = 0;
    vector<int> ans(365);
    rep(i, 365) {
        int an=1;
        rep(j, 26) {
            int sa = satisfy;
            vector<int> la = last;
            sa += s[i][j];
            la[j] = i;
            int decrease = 0;
            rep(k, 26) decrease += c[k] * (i - last[k]);
            sa -= decrease;
            if (chmax(satisfy, sa))
                an = j;
        }
        ans.push_back(an);
    }
	rep(i,365)
        cout << ans[i]+1 << endl;
}

Measured memory_bytes: 3688
// includes {{{
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<random>
#include<cassert>
#include<bitset>
#include<cstdlib>
// #include<deque>
// #include<multiset>
// #include<cstring>
// #include<bits/stdc++.h>
// }}}
using namespace std;
using ll = long long;

int main() {
  std::ios::sync_with_stdio(false), std::cin.tie(0);
  int a, b, c;
  cin >> a >> b >> c;
  cout << min({a + b, b + c, c + a}) << endl;
  return 0;
}


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

int main() {
	int n;
	cin>>n;
	
	map<string,int> keihin;
	rep(i,n){
		string s;
		cin>>s;
		
		keihin[s]=1;
	}
	
	cout<<keihin.size()<<endl;
	
}


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

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

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
while(1){ 
cin>>n;
if(!n) break;
vector<int> v(n);

int sum=0;
 for(int i=0;i<n;++i){
cin>>v[i];
}
sort(begin(v),end(v));
for(int i=1;i<n-1;++i){
sum+=v[i];}
cout<<sum/(n-2)<<endl;
}}

Measured memory_bytes: 3128
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	n, _ := strconv.Atoi(nextLine())
	fmt.Printf("%.0f\n", math.Pow(float64(n), 3))
}


Measured memory_bytes: 640
#include <iostream>
#include <cmath>
#include <vector>
#include <list>
#include <numeric>

using namespace std;

template <template<class T, class Allocator = allocator<T> > class Container>
double mean(Container<double> & x)
{
	return accumulate(x.begin(), x.end(), 0.0) / x.size();
}
template <template<class T, class Allocator = allocator<T> > class Container>
double var(Container<double> & x)
{
	double size = x.size();
	double x_mean = mean(x);
	return (inner_product(x.begin(), x.end(), x.begin(), 0.0) - x_mean * x_mean * size)/ size;
}
template <template<class T, class Allocator = allocator<T> > class Container>
double sd(Container<double> & x)
{
	return sqrt(var(x));
}
int main()
{
	while(1){
		int count;
		cin >> count;
		if (count == 0)break;
		std::vector<double> x;
		for(int i = 0; i < count; i++){
			int s;
			cin >> s;
			x.push_back(s);
		}
		cout << sd(x) << endl;
	}
	return 0;
}

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

int n;

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


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>

using namespace std;

long calc_putty(long n, long x, vector<long>& putty, vector<long>& size) {
  if (n<=0) return (x>0? 1 : 0);

  long res = 0;
  if (size[n] == x) res = putty[n];
  if (size[n-1]+1 < x) res =  putty[n-1]+1 + calc_putty(n-1,x-size[n-1]-2,putty,size);
  else res = calc_putty(n-1,x-1,putty,size);

  // cout << n << " " << x << " " << res << endl;
  return res;
}


int main() {
  long n,x;
  long ans = 0;
  cin >> n >> x;
  vector<long> putty(n+1);
  vector<long> size(n+1);

  putty[0] = 1;
  size[0] = 1;
  for (int i=1; i<=n; i++) {
    putty[i] = putty[i-1]*2 +1;
    size[i] = size[i-1]*2 +3;
  }

  ans = calc_putty(n,x,putty,size);
  cout << ans << endl;
}

/*
0 : 1 - 1
1 : 5 - 3
2 : 13 - 7
BPPPB
B(L1)P(L1)B
B(BPPPB)P(BPPPB)B
BBPPPBPBPPPBB
*/

Measured memory_bytes: 888
#include<bits/stdc++.h>
#define MAXN 100005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n,a[MAXN];
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    int ans=0;
    for(int i=1;i<=n;i+=2) ans+=(a[i]&1);
    printf("%d\n",ans);
}

Measured memory_bytes: 3764
import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        if (k%2 == 0) {
            System.out.println((k/2)*(k/2));
        }else{
            System.out.println(((k-1)/2)*((k+1)/2));
        }
    }
}

Measured memory_bytes: 21716
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <random>
#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;
using ll = long long;

int a, b;

int pn() {
    auto num = b/100-a/100+1;
    auto from = (a/100)*100+a/1000%10*10+a/10000;
    cerr<<from<<endl;
    auto to = (b/100)*100+b/1000%10*10+b/10000;
    cerr<<to<<endl;
    if (a > from) num--;
    if (b < to) num--;
    return num;
}

int main() {
    cin>>a>>b;
    
    cout<<pn();
    
}



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

namespace abc119d
{
    class Program
    {
        static void Main(string[] args)
        {
            var S = Console.ReadLine();
            var cnt = 0;
            var max = 0;
            foreach (var s in S)
            {
                if (s == 'A' || s == 'C' || s == 'G' || s == 'T')
                {
                    cnt++;
                }
                else
                {
                    max = (max < cnt) ? cnt : max;
                    cnt = 0;
                }
            }
            Console.WriteLine(max = (max < cnt) ? cnt : max);
#if DEBUG
            Console.ReadKey();
#endif
        }

        private static bool IsRange(int a, int from, int to) => (from <= a && a <= to);
        private static int ReadInt() => int.Parse(Console.ReadLine());
        private static List<int> ReadIntList() => Console.ReadLine().Split().Select(int.Parse).ToList();
        private static double ReadDouble() => double.Parse(Console.ReadLine());
        private static List<double> ReadDoubleList() => Console.ReadLine().Split().Select(double.Parse).ToList();
        private static long ReadLong() => long.Parse(Console.ReadLine());
        private static List<long> ReadLongList() => Console.ReadLine().Split().Select(long.Parse).ToList();
        private static List<int> Int2Digits(int a) => a.ToString().ToCharArray().Select(_ => int.Parse(_.ToString())).ToList();
        private static int BinarySearch<Type>(IReadOnlyList<Type> s, Type target) // target 以下の最大要素のインデックスを返す
            where Type : IComparable
        {
            var lower = 0;
            var upper = s.Count - 1;
            while (upper - lower > 1)
            {
                var mid = lower + (upper - lower) / 2;
                if (s[mid].CompareTo(target) <= 0)
                {
                    lower = mid;
                }
                else
                {
                    upper = mid;
                }

            }
            return lower;
        }
    }
}


Measured memory_bytes: 11092
use proconio::{input, fastout};
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
      }
  }

#[fastout]
fn main() {
    input!{
        n: usize,
    }

    for x in 0..n/4+1 {
        for y in 0..n/7+1 {
            if 4*x+7*y==n {
                println!("Yes");
                return;
            }
        }
    }

    println!("No");

}


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

int main() {
  string S;
  cin >> S;
  int ai=S.size(), zi=0;
  for (int i=0; i<S.size(); i++) {
    if (S[i]=='A') {
      ai=min(ai, i);
    }
    if (S[i]=='Z') {
      zi=max(zi, i);
    }
  }
  cout << zi-ai+1 << endl;
}

Measured memory_bytes: 3652
package main

import (
	"fmt"
)

var (
	finv, inv, fac [MAX]int
)

func COM(n, k int) int {
	if n < k {
		return 0
	}
	if n < 0 || k < 0 {
		return 0
	}
	return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD
}

func init() {
	fac[0] = 1
	fac[1] = 1
	finv[0] = 1
	finv[1] = 1
	inv[1] = 1
	for 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
	}
}

const (
	MOD = 1000000007
	MAX = 510000
)

func ModAdd(a, b int64) int64 {
	return (a + b) % MOD
}

func ModMul(a, b int64) int64 {
	return a * b % MOD
}

func ModSub(a, b int64) int64 {
	r := (a%MOD - b%MOD) % MOD
	if r < 0 {
		r += MOD
	}
	return r
}

func ModDiv(a, b int64) int64 {
	return a % MOD * ModInv(b) % MOD
}

func ModPow(a, n int64) int64 {
	var r int64 = 1
	for n > 0 {
		if n&1 == 1 {
			r = r * a % MOD
		}
		a = a * a % MOD
		n >>= 1
	}
	return r
}

func ModInv(a int64) int64 {
	var b, u, v int64 = MOD, 1, 0
	for b > 0 {
		t := a / b
		a -= t * b
		a, b = b, a
		u -= t * v
		u, v = v, u
	}
	u %= MOD
	if u < 0 {
		u += MOD
	}
	return u
}

type Q struct {
	value int
	index int
	A, B  int
}

type QS []*Q

func (p QS) Len() int           { return len(p) }
func (p QS) Less(i, j int) bool { return p[i].value > p[j].value }
func (pq QS) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	pq[i].index = i
	pq[j].index = j
}

func (pq *QS) Push(x interface{}) {
	n := len(*pq)
	item := x.(*Q)
	item.index = n
	*pq = append(*pq, item)
}

func (pq *QS) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	old[n-1] = nil  // avoid memory leak
	item.index = -1 // for safety
	*pq = old[0 : n-1]
	return item
}

func FactoredPrimeNumber(num int) map[int]int {
	m := map[int]int{}
	return factor(m, num, 2)
}

func factor(result map[int]int, num, pnum int) map[int]int {
	if pnum*pnum > num {
		if num != 1 {
			result[num] += 1
		}
		return result
	}

	if num%pnum == 0 {
		num /= pnum
		result[pnum]++
	} else {
		pnum++
	}
	return factor(result, num, pnum)
}

func GCD(a, b int64) int64 {
	if b == 0 {
		return a
	}
	return GCD(b, a%b)
}

func LCM(a, b int64) int64 {
	return a * b / GCD(a, b)
}

func main() {
	var N, K int
	fmt.Scanf("%d %d\n", &N, &K)
	A := make([]int, N)
	for i := 0; i < N; i++ {
		var a int
		fmt.Scan(&a)
		A[i] = a - 1
	}
	queue := []int{0}
	m := map[int]int{
		0: 0,
	}
	d := []int{}
	cnt := 0
	var q, last int
	for len(queue) > 0 && K > cnt {
		q = queue[0]
		last = A[q]
		queue = queue[1:]
		cnt++
		if m[last] == 0 {
			queue = append(queue, last)
			d = append(d, q)
			m[last] = cnt
		} else {
			d = append(d, q)
		}
	}
	if K == cnt {
		fmt.Println(last + 1)
	} else if q == last {
		fmt.Println(q + 1)
	} else {
		start := m[last]
		cycle := cnt - start
		idx := (K - start) % cycle
		fmt.Println(d[start:][idx] + 1)
	}
}

func Reverse(runes []rune) []rune {
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return runes
}


Measured memory_bytes: 31120
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <cstring>
#include <math.h>
#include <bitset>
#include <time.h>
#include <set>
#include <algorithm>
#define MAXN 100000
#define ll long long
using namespace std;


ll D(ll x) {
    int ct=0;
    while(x) {
       ct++;
        x/=10;
    }
    return ct;
}
int main() {
    ll N;
    cin>>N;
    ll ans=N+100;
    for(ll x=1;x*x<=N;x++) {
        if (N%x==0) {
            ans = min(ans, max(D(x),D(N/x)));
        }
    }
    
    cout << ans << endl;
    
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
MOD = 10**9 + 7
ans = 1
memo = {}
for i in range(n+2):
    memo[i] = 0
memo[0] = 3

for i in range(n):
    ans *= memo[a[i]]
    memo[a[i]] -= 1
    memo[a[i]+1] += 1
    ans %= MOD
print(ans)

Measured memory_bytes: 62124
import sys
def Ii():return int(sys.stdin.buffer.read())
def Mi():return map(int,sys.stdin.buffer.readline().split())
def Li():return list(map(int,sys.stdin.buffer.readline().split()))

x = Ii()

for i in range(121):
  for j in range(-119,120):
    if x == i**5 - j**5:
      print(i,j)
      exit(0)

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

using namespace std;


int main() {
    int n;
    cin>>n;
    int num[9]={0};
    for (int i = 0; i < n; ++i) {
        int ra;
        cin>>ra;
        if(ra<3200)num[ra/400]++;
        else num[8]++;
    }
    int count=0;
    for (int j = 0; j < 8;j++){
        if(num[j]>0)count++;
    }
    if(count==0){
        cout<<1<<" "<<num[8]<<endl;
        return 0;
    }
    cout<<count<<" "<<count+num[8]<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
    int n,i,j,cnt;

    while(cnt=0,scanf("%d",&n),n){
        for(i=1;i<n+1;i++){
            for(j=5;n/j;j*=5){
                if(i%j==0)cnt++;
            }
        }
        printf("%d\n",cnt);
    }
    return 0;
}

Measured memory_bytes: 600
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate, product, combinations_with_replacement
import sys
import bisect
import string
import math
import time


def I(): return int(input())
def S(): return input()
def MI(): return map(int, input().split())
def MS(): return map(str, input().split())
def LI(): return [int(i) for i in input().split()]
def LI_(): return [int(i)-1 for i in input().split()]
def StoI(): return [ord(i)-97 for i in input()]
def ItoS(nn): return chr(nn+97)
def input(): return sys.stdin.readline().rstrip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def print_matrix(mat):
    for i in range(len(mat)):
        print(*['IINF' if v == IINF else "{:0=4}".format(v) for v in mat[i]])


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
show_flg = False
# show_flg = True


def main():
    X, Y = MI()
    ans = 0

    for i in range(100):
        for j in range(100):
            if X == (i + j) and (2 * i + 4 * j) == Y:
                ans += 1

    print(yn[ans >= 1])


if __name__ == '__main__':
    main()


Measured memory_bytes: 10012
#include <bits/stdc++.h>
#define FASTIO cin.tie(NULL); ios_base::sync_with_stdio(false);
#define ll long long int
#define ii pair<int,int>
#define endl '\n'
using namespace std;

int a[100001];
void solve()
{
    int n, t, q;
    ll sum = 0;
    cin >> n;
    while(n--)
        cin >> t, a[t]++, sum+=t;
    cin >> q;
    while(q--)
    {
        int st, en;
        cin >> st >> en;
        a[en] += a[st];
        sum += (en-st) * (ll)a[st];
        a[st] = 0;
        cout << sum << endl;
    }
}
int main()
{
   FASTIO
/* 	int t;
	cin >> t;
	while (t--) */
        solve();
}

Measured memory_bytes: 4040
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define ALL(vec) (vec).begin(), (vec).end()
#define SUM(...) accumulate(ALL(__VA_ARGS__),0LL)
#define DSUM(...) accumulate(ALL(__VA_ARGS__),0.0)
using namespace std;
using ll = long long;
using P = pair<int, int>;

// 便利関数
template <class T> inline bool chmin(T &a, T b) {if (a > b){a = b;return true;}return false;}
template <class T> inline bool chmax(T &a, T b) {if (a < b){a = b;return true;}return false;}
template<class T> inline auto max(const T& a){ return *max_element(ALL(a)); }
template<class T> inline auto min(const T& a){ return *min_element(ALL(a)); }
inline ll gcd(ll a,ll b){if(b == 0) return a;return  gcd(b,a%b);}
inline ll lcm(ll a,ll b){ll g = gcd(a,b);return a / g * b;}

// 出力
void print() { std::cout << '\n'; }
template <class T>void print(const T &x) {std::cout << x <<'\n';}
template <class T, class... Args>void print(const T &x, const Args &... args) {std::cout << x << " ";print(args...);}

const ll INF = 2002002002;

void solve(long long A, long long B, long long C, long long D){
    ll mini = max(A, C);
    ll maxi = min(B, D);
    if (mini >= maxi) print(0);
    else print(maxi - mini);
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long C;
    scanf("%lld",&C);
    long long D;
    scanf("%lld",&D);
    solve(A, B, C, D);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define puf push_front
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
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; }

int main() {
    int N; cin >> N;
    vei a(N); rep(i,N) cin >> a[i];

    int sum = acc(all(a), 0);
    double av = (double) sum / N;
    ld mina = INF; int index;
    rep(i,N) {
      ld temp = abs(a[i] - av);
      if(mina > temp) {mina = temp; index = i;}
    }
    cout << index << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int c,sum,box,n,i,b,a,s;
	scanf("%d %d %d",&n,&a,&b);
	for(i=1;i<=n;i++){
		box=i;
		sum=0;
		while(box>0){
			c=box%10;
			sum=sum+c;
			box=box/10;
		}
		if(sum>=a && sum<=b){
		s=s+i;
		}
	}
	printf("%d\n",s);
	return 0;
}

Measured memory_bytes: 128
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(N: int, D: int, X: "List[List[int]]"):
    ret = 0
    for i in range(N):
        for j in range(i + 1, N):
            tmp = 0
            for k in range(D):
                tmp += (X[i][k] - X[j][k]) ** 2
            if tmp == int(tmp ** 0.5) * int(tmp ** 0.5):
                ret += 1
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    X = [ [ int(next(tokens)) for _ in range(D) ] for _ in range(N) ]  # type: "List[List[int]]"
    solve(N, D, X)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3188
// ABC150C - Count Order

#include <bits/stdc++.h>
using namespace std;

typedef unsigned long long int ull;
typedef long long int ll;

int main() {
	int N;
	cin >> N;
	vector<int> p(N), q(N);
	for (int i = 0; i < N; i++) {
		cin >> p[i];
	}
	for (int i = 0; i < N; i++) {
		cin >> q[i];
	}

	vector<int> t(N);
	for (int i = 0; i < N; i++) {
		t[i] = i + 1;
	}

	map<vector<int>, int> order;
	int no = 1;
	do {
		order[t] = no;
		++no;
	} while (next_permutation(t.begin(), t.end()));

//	cout << order[p] << "," << order[q] << endl;

	cout << abs(order[p] - order[q]) << endl;

	return 0;
}


Measured memory_bytes: 5248
#include<bits/stdc++.h>
using namespace std;
void odd(int n)
{
    int h[100001];
    for(int i = 0;i<n;i++)
    {
        int a;
        cin>>a;
        h[a] = i+1;
    }
for(int i = 1;i<=n;i++)
    cout<<h[i]<<" ";
}
int main()
{
    int n;
    cin>>n;
    odd(n);
    return 0;
}

Measured memory_bytes: 1152
#include <iostream>
#define llint long long

using namespace std;

llint n;
llint d[13];
bool used[25];

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

  cin >> n;
  d[0] = 1;
  llint x;
  for(int i = 1; i <= n; i++){
    cin >> x;
    d[x]++;
  }
  for(int i = 0; i <= 12; i++){
    if(d[i] >= 3){
      cout << 0 << endl;
      return 0;
    }
  }
  if(d[0] >= 2 || d[12] >= 2){
    cout << 0 << endl;
    return 0;
  }

  llint N = 1 << 13, ans = 0;
  for(int i = 0; i < N; i++){
    for(int j = 0; j <= 24; j++) used[j] = false;
    for(int j = 0; j <= 12; j++){
      if(j == 0 || j == 12){
        if(d[j]) used[j] = true;
      }
      else{
        if(d[j] >= 2) used[j] = used[24-j] = true;
        if(d[j] == 1){
          if(i & (1<<j)) used[j] = true;
          else used[24-j] = true;
        }
      }
    }
    used[24] = true;

    llint mn = 25, pre = 0;
    for(int j = 1; j <= 24; j++){
      if(used[j]){
        mn = min(mn, j-pre), pre = j;
      }
    }
    ans = max(ans, mn);
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
import math
 
A,B,C,D = map(int, input().split())
a = B//C - (A-1)//C
b = B//D - (A-1)//D
lcm = C*D//math.gcd(C,D)
c = B//lcm - (A-1)//lcm
print(B-(A-1)-(a+b-c))

Measured memory_bytes: 9088
#include <bits/stdc++.h>
#define gcd std::__gcd
#define EB emplace_back

typedef std::vector <int> vector;
const int N = 100054;

int n;
vector a;

inline bool judge(const vector &v) {
	int c[2] = {0}, g = 0; bool one = false; vector u(v);
	for (int x : v) ++c[x & 1], one |= x == 1;
	if (*c & 1) return true;
	if (one || c[1] > 1) return false;
	for (int &x : u) g = gcd(g, x &= -2);
	for (int &x : u) x /= g;
	return !judge(u);
}

int main() {
	int i, x;
	scanf("%d", &n), a.reserve(n);
	for (i = 1; i <= n; ++i) scanf("%d", &x), a.EB(x);
	return puts(judge(a) ? "First" : "Second"), 0;
}

Measured memory_bytes: 9984
N,A,B = map(int,input().split())
src = [int(input()) for i in range(N)]
src.sort(reverse=True)

def isok(n):
    if all(h <= n*B for h in src):
        return True
    m = 0
    for h in src:
        h -= n*B
        m += (h-1)//(A-B) + 1
        if m > n:
            return False
    return True

ok = 10**9
ng = 0
while ok-ng > 1:
    m = (ok+ng) // 2
    if isok(m):
        ok = m
    else:
        ng = m
print(ok)

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

int main(){
  const double pi=3.141592653589793;
  double a,b,x; cin>>a>>b>>x;
  double all=a*a*b;
  double ans;
  if(a * a * b / 2.0 <= x) {
        ans = atan(2 * (a * a * b - x) / (a * a * a));
    } else {
        ans = pi / 2 - atan(2 * x / (a * b * b));
    }cout<<setprecision(15)<<ans*180.0/pi<<endl;
}

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


int main() {
int x,a,b;
cin >> x >>a >>b;
if(a>=b) {cout <<"delicious" << endl;
return 0;}

if(b-a<=x) {
    cout << "safe" <<endl;
    return 0;
}
else cout << "dangerous" <<endl;
} 

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

void solve() {
  int n;
  cin >> n;
  vector<vector<int>> to(n);
  vector<vector<int>> cost(n);
  rep(i, n-1) {
    int u, v, w;
    cin >> u >> v >> w;
    u--;
    v--;
    to[u].push_back(v);
    cost[u].push_back(w);
    to[v].push_back(u);
    cost[v].push_back(w);
  }
  vector<int> ans(n, -1);
  queue<int> q;
  ans[0] = 0;
  q.push(0);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    rep(i, to[u].size()) {
      int v = to[u][i];
      int w = cost[u][i];
      if(ans[v] != -1) continue;
      ans[v] = (ans[u] + w) % 2;
      q.push(v);
    }
  }
  rep(i, n) cout << ans[i] << endl;
}

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

Measured memory_bytes: 11904
<?php
  fscanf(STDIN, "%d", $n);
function getColKey($target) {
    for($i = 0; $i < 26; $i++){
        $alphabet[] = strtoupper(chr(ord('a') + $i));
    }
    $one = fmod($target, 26);
    $result = $alphabet[$one];
    $carry = ($target - $one) / 26;
    while($carry != 0) {
        $one = fmod($carry - 1, 26);
        $result = $alphabet[$one].$result;
        $carry = ($carry - 1 - $one) / 26;
    }
    return $result;
}
echo strtolower(getColKey($n-1));

Measured memory_bytes: 16392
#define _USE_MATH_DEFIMES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

const int MOD = 1'000'000'007;
const int INF = 1'000'000'000; //1e9
const int NIL = -1;
const long long LINF = 1'000'000'000'000'000'000; // 1e18
const long double EPS = 1E-10;

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


struct edge{
    int from, to, cost;
    edge(int From, int To, int Cost): from(From), to(To), cost(Cost){}
};

void bellmanFord_Cost(int V, std::vector<edge>& es, std::vector<long long>& d, int s){
    d.resize(V, LINF);
    d[s] = 0;
    while(1){
        bool update = false;
        for(auto &e : es){
            if(d[e.from] != LINF && d[e.to] > d[e.from] + e.cost){
                d[e.to] = d[e.from] + e.cost;
                update = true;
            }
        }
        if(!update) break;
    }
}

bool find_negative_loop_Cost(int V, std::vector<edge>& es, std::vector<long long>& d, int s){
    d.resize(V, LINF);
    d[s] = 0;
    for(int i(0); i < V; ++i){
        for(auto &e : es){
            if(d[e.from] != LINF && d[e.to] > d[e.from] + e.cost){
                d[e.to] = d[e.from] + e.cost;
                
                //V回目に更新なら負閉路あり
                if(i == V-1) return true;
            }
        }
    }
    return false;
}


int main(){
    int N, M; std::cin >> N >> M;
    std::vector<edge> es;
    {
        int a, b, c;
        for(int i(0); i < M; ++i){
            std::cin >> a >> b >> c;
            --a; --b;
            es.emplace_back(a, b, -c);
        }
    }
    std::vector<long long> d;
    find_negative_loop_Cost(N, es, d, 0);
    std::vector<bool> negativeloop(N, false);
    for(int i(0); i < N; ++i){
        for(auto &e : es){
            if(d[e.from] != LINF && d[e.to] > d[e.from] + e.cost){
                d[e.to] = d[e.from] + e.cost;
                negativeloop[e.to] = true;
            }
            if(negativeloop[e.from]) negativeloop[e.to] = true;
        }
    }
    if(negativeloop[N-1]){
        std::cout << "inf" << std::endl;
    }else{
        std::cout << -d[N-1] << std::endl;
    }
    return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"strings"
)

func main() {
	var n, k int
	var s string
	fmt.Scan(&n, &k, &s)

	s2 := strings.ToLower(s)

	fmt.Println(s[:k-1] + string(s2[k-1]) + s[k:])
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)
#define RREP(i, n) for (ll i = (n) - 1; i >= 0; --i)
#define ALL(v) (v).begin(), (v).end()
template<class T>
using reverse_priority_queue = priority_queue<T, vector<T>, greater<T>>;


vector<ll> enumerate_divisors(ll n){
    vector<ll> ret;
    for(ll d = 1; d * d <= n; ++d){
        if(n % d == 0){
            ret.push_back(d);
            if(d != n / d){
                ret.push_back(n / d);
            }
        }
    }
    return ret;
}

int main(){
    ll n;
    cin >> n;
    vector<ll> ds = enumerate_divisors(2 * n);

    ll ans = 2 * n;

    for(ll d : ds){
        const auto p = crt({0LL, - 1LL}, {d, 2 * n / d});
        if(p == make_pair(0LL, 0LL)){ continue; }
        const ll k = p.first;
        if(k <= 0){ continue; }
        // cerr << "d=" << d << ", k=" << k << endl;
        // assert((k * (k + 1) / 2) % n == 0);
        ans = min(ans, k);
    }

    cout << ans << endl;
    return 0;
}


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

#define int ll
#define FOR(i,n,k) for(int i=n;i<k;i++)
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int32_t main()
{
    IOS;
    int w,h,n,x,y,a,xl,xr,yd,yu;
    cin>>w>>h>>n;
    xl = 0,xr = w,yd = 0, yu = h;
    while(n--)
    {
        cin>>x>>y>>a;
        if(a==1) xl = max(x,xl);
        else if(a==2) xr = min(x,xr);
        else if(a==3) yd = max(y,yd);
        else yu = min(y,yu);
    }
    cout<<max(xr-xl,0LL) * max(yu-yd,0LL)<<"\n";
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  int temp[] = {100,101,102,103,104,105};
  vector<int> vec(n+1,0);
  vec[0]=1;
  for(int i=1;i<=n;i++){
	for(int j=0;j<6;j++){
		if(i<temp[j])continue;
      	vec[i] = max(vec[i-temp[j]],vec[i]);
    }
  }
  cout << vec[n];
}

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

int main()
{
	std::string S;
	in >> S;

	LL ans = 0;
	if (S == "SUN") ans = 7;
	if (S == "SAT") ans = 1;
	if (S == "FRI") ans = 2;
	if (S == "THU") ans = 3;
	if (S == "WED") ans = 4;
	if (S == "TUE") ans = 5;
	if (S == "MON") ans = 6;

	out << ans << std::endl;
}


Measured memory_bytes: 256
import bisect
import sys
input = sys.stdin.readline
n = int(input())
a = [int(input()) for i in range(n)]
app = [0 for i in range(200001)]
mod = 10**9+7
pair = []
for i in range(n):
  x = a[i]
  if app[x] != 0 and i != app[x]:
    pair.append([app[x],i+1])
  app[x] = i+1
pair.sort()
ps = len(pair)
cntls = []
order = []
sumtot = []
for i in range(ps-1,-1,-1):
  [s,t] = pair[i]
  if i == ps-1:
    cntls.append([-s,1])
    order.append(-s)
    sumtot.append([-s,1])
  elif t>-cntls[0][0]:
    cntls.append([-s,1])
    order.append(-s)
    sumtot.append([-s,sumtot[-1][1]+1])
  else:
    x = bisect.bisect_right(order,-t)
    cntls.append([-s,sumtot[x-1][1]+1])
    order.append(-s)
    sumtot.append([-s,(sumtot[-1][1]+sumtot[x-1][1]+1)%mod])
if pair == []:
  print(1)
else:
  print((sumtot[-1][1]+1)%mod)

Measured memory_bytes: 117792
def main():
    data0 = input()
    data1 = input()

    flag = True
    data_tmp = data0
    count = 0
    len_data = len(data0)
    while True:
        if data0 == "":
            break

        data0 = data0.replace(data0[0], "")
        data1 = data1.replace(data1[0], "")

        if len(data0) != len(data1):
            print('No')
            exit()

    print('Yes')

if __name__ == "__main__":
    main()

Measured memory_bytes: 3760
# coding: utf-8
# Your code here!
K,A,B=map(int,input().split())



if A + 1 < B:
    bis = 1
    add = B - A # 増える数
    moving = (K//A)  #交換可能回数
    #print(moving)
    if moving > 0:
        #print("m")
        bis = B
        K-=A+1
    else:
        print(K+1)
        exit()
    #print(bis)
    
    bis+=add*(K // 2)
    if K % 2 != 0:
        bis+=1
    #print(bis,moving)
    print(bis)
    
else:
    print(K+1)


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

int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> a(n);
  int size;
  int d;
  for (int i = 0; i < n; i++) {
    cin >> size;
    for (int j = 0; j < size; j++) {
      cin >> d;
      a.at(i).push_back(d);
    }
  }
  int sum;
  int res = 0;
  for (int k = 1; k <= m; k++) {
    sum = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < (int)a.at(i).size(); j++) {
        if (a.at(i).at(j) == k) {
          sum++;
        }
      }
    }
    if (sum == n) {
      res++;
    }
  }
  cout << res << endl;
}


Measured memory_bytes: 256
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
typedef long long LL;

int main() {
  double sum = 0;
  int N; std::cin >> N;
  for (int i = 0; i < N; ++i) {
    std::string x, u; std::cin >> x >> u;
    if (u == "JPY") {
      int v = std::stoi(x);
      sum += v;
    } else {
      double v = std::stof(x);
      sum += v* 380000.0;
    }
  }

  std::cout << sum << std::endl;
}


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

int N, K;
vector<double> A;

int main(){
    cin >> N >> K;
    A.resize(N+1);
    unsigned int input;
    for(int i = 1; i <= N; i++){
        cin >> input;
        A.at(i) = (double)input/pow(10, 5);
        //cout << A[i] << endl;
    }

    for(int i = K+1; i <= N; i++){
        if(A[i]/A[i-K] > 1){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }

    /*double K_i = 1;
    double K_i_1 = 1;
    for(int i = 1; i <= N; i++){
        if(i <= K){
            K_i *= A[i];
            //cout << K_i << endl;
        }
        else{
            cout << i << "学期目" << endl;
            K_i_1 = (K_i/A[i-K])*A[i];
            if(K_i_1 > K_i){
                cout << "Yes" << endl;
            }
            else{
                cout << "No" << endl;
            }
            K_i = K_i_1;
        }
    }*/
    return 0;
}

Measured memory_bytes: 4820
import bisect
import math

n,m = map(int,input().split())
a = [int(i) for i in input().split()]

a.sort(reverse=True)

ans=[math.ceil(-a[0]/2)]
num = 0
now = 1

if n == 1:
    print(a[0] // 2**m)
    exit()
    
for i in range(m-1):
    #print(ans[0],a[now],now,ans)
    if now >= n:
        tmp = math.ceil(ans[0] / 2)
        idx = bisect.bisect_right(ans,tmp)
        #print(ans,idx,tmp)
        ans.insert(idx,tmp)
        del ans[0]
        continue
    if ans[0] <= -a[now]:
        tmp = math.ceil(ans[0] / 2)
        idx = bisect.bisect_right(ans,tmp)
        #print(ans,idx,tmp)
        ans.insert(idx,tmp)
        del ans[0]
    else:
        ans.append(math.ceil(-a[now]/2))
        now += 1
#print(ans,ans,ans,ans)
        
if len(ans) == len(a):
    print(-sum(ans))
    exit()
        
print(-sum(ans)+sum(a[len(ans):]))
exit()
for i in range(1,n):
 if num >= m:
   break
 if -a[i]>=ans[-1]: #i番目の要素がansの最小値以下であればansに付け加える
   ans.append(-a[i]//2)
   num+=1
 else:
   pos=bisect.bisect_right(ans,-a[i]) #i番目の要素以下の値で、最も大きい値の位置を求める
   ans[pos]=-a[i] #その位置の値をi番目の要素と置き換える

print(ans)
print(-sum(ans))
exit()

a = [-a]
print(a)
exit()

tmp = a[0] // 2

del a[0]

idx = bisect.bisect_right(a,tmp)
a.insert(idx,tmp)
print(a,idx)
exit()

if a[0] >= a[1]:
    a[0] = a[0] // 2
else:
    a[1] = a[1] // 2
    
print(a)

Measured memory_bytes: 14164
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef long int li;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
typedef pair<double, double>P;
typedef tuple<ll, int, int>T;
#define PI 3.14159265358979
int N, Q;
int const INF = 0;

struct SegmentTree {
private:    
    ll n;
    vector<ll> node;
public:
    SegmentTree(vector<ll> v) {
        ll sz = v.size();
        n = 1; while (n < sz) n *= 2;
        node.resize(2 * n - 1, INF);
        for (ll i = 0; i < sz; i++) node[i + n - 1] = v[i];
        for (ll i = n - 2; i >= 0; i--) node[i] = max(node[2 * i + 1], node[2 * i + 2]);
    }

    void update(ll x, ll val) {
        x += (n - 1);
        node[x] = val;
        while (x > 0) {
            x = (x - 1) / 2;
            node[x] = max(node[2 * x + 1], node[2 * x + 2]);
        }
    }

    ll getmax(ll a, ll b, ll k = 0, ll l = 0, ll r = -1) {
        if (r < 0) r = n;
        if (r <= a || b <= l) return INF;
        if (a <= l && r <= b) return node[k];

        ll vl = getmax(a, b, 2 * k + 1, l, (l + r) / 2);
        ll vr = getmax(a, b, 2 * k + 2, (l + r) / 2, r);
        return max(vl, vr);
    }
};

int main() {
    ll N;
    cin>>N;
  	ll H[N],A[N];
  	rep(i,N){
    	cin>>H[i];
    }
  	rep(i,N){
    	cin>>A[i];
    }
  ll dp[N+1];
    SegmentTree seg(vector<ll>(1<<24, INF));
    for (int i = 0; i < N; i++) {
      ll gg=seg.getmax(0,H[i])+A[i];
      seg.update(H[i],gg);
    }
  cout<<seg.getmax(0,1<<23);
}

Measured memory_bytes: 396544
import math
n = int(input())
#n = 127
inf = float('inf')

dp = [inf]*(n+100000)
dp[0]=0
#print(dp)
#print(len(dp))

def motome(target):
    tmp = []
    for i in range(10):
        if 9**i <= n:
            tmp.append(9**i)
        if 6**i <= n:
            tmp.append(6**i)
    #print(tmp) 
    #[1, 6, 36, 1, 9, 81]
    #print(dp)
    for k in range(target+1):
        for t in sorted(list(set(tmp))):
            if k-t>=0:
                dp[k] = min(dp[k],1 + dp[k-t])
                #dp[k] = min([dp[k-t] for t in tmp])
                '''
                try:
                    dp[k] = min(dp[k],1 + min([dp[k-t] for t in tmp]))
                except:
                    print(len(dp),dp[k-t],dp[k])
                    pass
                '''
        #print(k)
        #print([t for t in tmp])
        #print([dp[k-t] for t in tmp])

motome(n)
#print(dp[n-1])
print(dp[n])
#print(dp)
#print(dp[n+2])
#print(dp[n-1])
#print(dp[n])

Measured memory_bytes: 4596
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, N) for(int i = 0; i < N; i++)
#define rep2(i, N, a, b) for(int i = a; i < N; i += b)

int main(){
	int N, M;
	cin >> N;

	vector<int> T(N);
	int sum = 0;
	rep(i, N){
		cin >> T.at(i);
		sum += T.at(i);
	}
	cin >> M;

	vector<pair<int, int>> drink(M);
	rep(i, M) cin >> drink.at(i).first >> drink.at(i).second;
	rep(i, M){
		int ans = sum;
		ans -= T.at(drink.at(i).first - 1) - drink.at(i).second;
		cout << ans << endl;
	}
}

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

int main() {
    int n;
    cin >> n;
    vector<long long> a;
    for (int i = 0; i < n; ++i) {
        long long tmp;
        std::cin >> tmp;
        a.push_back(tmp);
    }
    map<long long, long long> sm{};
    long long sum = 0;
    sm[0]++;

    long long ans = 0;
    for (int j = 0; j < n; ++j) {
        sum += a[j];
        long long ct = sm[sum]++;
        if(ct > 0){
            ans += ct;
        }
    }


    cout << ans << endl;

}

Measured memory_bytes: 14320
#include<bits/stdc++.h>
#define FastIO ios_base::sync_with_stdio(false), cin.tie(NULL)

typedef long long ll;

using namespace std;

int main()
{
	FastIO;
	int a, b;
	cin >> a >> b;

	if(a > 8 || b > 8) cout << ":(\n";
	else cout << "Yay!\n";
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

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


Measured memory_bytes: 3544
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
using pil = pair<int, ll>;
using uint = unsigned int;
using matrix = vector<vector<uint>>;
template <typename T>
using Graph = vector<vector<T>>;
const int MOD = 1e9 + 7;

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

    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            char c;
            cin >> c;
            if (i == j)
                cout << c;
        }
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 256
/*
Sample Input 1
Sample Output 1
Yes
Sample Input 2
chokudai
redcoder
Sample Output 2
No
Sample Input 3
appzl
azzlp
*/
#include<iostream>
#include<string>
#include<map>
#include<cstring>
using namespace std;
string s,t;
char a[200],b[200]; 
int main(){
	memset(a,'~',sizeof(a));
	memset(b,'~',sizeof(b));
	cin>>s>>t;
	for(int i=0;i<s.size();i++){
		if((a[s[i]]!='~'&&a[s[i]]!=t[i])||(b[t[i]]!='~'&&b[t[i]]!=s[i])){
			cout<<"No";
			return 0;
		}
		else{
			a[s[i]]=t[i]; 
			b[t[i]]=s[i];
		}
	}
	cout<<"Yes";
	return 0;
} 

Measured memory_bytes: 776