akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>

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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

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

  vector<int> p(N);
  rep(i, N) cin >> p[i];

  if (N == 0)
  {
    cout << X << endl;
  }
  else
  {
    int mn = 101;
    int mn_num = X;

    for (int i = 0; i <= 101; i++)
    {
      if (std::find(p.begin(), p.end(), i) != p.end())
        continue;

      int diff = std::abs(i - X);
      if (mn > diff)
      {
        mn = diff;
        mn_num = i;
      }
      else if (mn == diff)
      {
        mn_num = std::min(i, mn_num);
      }
    }
    cout << mn_num << endl;
  }

  return 0;
}


Measured memory_bytes: 3636
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    K = INT()

    gcdf = lambda *numbers: reduce(gcd, numbers)
    ans = 0
    for t in list(combinations_with_replacement(range(K), 3)):
        k = 3
        if t[0] == t[1] and t[1] == t[2] and t[2] == t[0]:
            k = 1
        elif t[0] != t[1] and t[1] != t[2] and t[2] != t[0]:
            k = 6

        ans += k * gcdf(t[0] + 1, t[1] + 1, t[2] + 1)

    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 198584
a = STDIN.gets.chomp.split('').select{|s| s != 'a'}
b = STDIN.gets.chomp.split('').select{|s| s != 'b'}
c = STDIN.gets.chomp.split('').select{|s| s != 'c'}

ary = a
loop do
        s = ary.shift
        break if s == nil
        case s
        when 'a'
                ary = a
        when 'b'
                ary = b
        when 'c'
                ary = c
        end
end
puts 'A' if ary.equal? a
puts 'B' if ary.equal? b
puts 'C' if ary.equal? c


Measured memory_bytes: 1788
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <numeric>
#include <set>
#include <unordered_set>
#include <queue>
#include <boost/math/constants/constants.hpp>
#include <boost/math/common_factor_rt.hpp>

using namespace std;
#define ll long long
#define rep(i, n) for(int i = 0;i < n;i++)
#define FOR(i, n, m) for(int i=n; i<m; ++i)

int main() {
  double A, B;
  cin >> A >> B;
  
  int i_sita;
  
  double sita = max(A/0.08, B/0.1);
  double ue = min((A+1)/0.08, (B+1)/0.1);
  
  i_sita = ceil(sita);
  
  if(i_sita < ue){
	cout << i_sita << endl;
  }else{
    cout << -1 << endl;
  }
}

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

#define ln '\n'
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define FOR(i, a, b) for (int i = (a); i <= (int)(b); ++i)
#define FORR(i, a, b) for (int i = (a); i >= (int)(b); --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef vector<P> VP;
typedef vector<PL> VPL;
typedef vector<string> VS;

const int MOD = (int)1e9 + 7;

class Combination {
   private:
    VL _fact;
    VL _invfact;

    ll power(ll x, ll n) {
        if (n == 0)
            return 1;
        else if (n == 1)
            return x % MOD;
        else if (n % 2 == 0) {
            ll buf = power(x, n / 2);
            return buf * buf % MOD;
        } else {
            ll buf = power(x, n / 2);
            return (buf * buf % MOD) * x % MOD;
        }
    }

   public:
    Combination(int n) : _fact(n + 1), _invfact(n + 1) {
        // init fact
        _fact[0] = 1;
        REP(i, n) _fact[i + 1] = _fact[i] * (ll)(i + 1) % MOD;
        // init invfact
        REP(i, n + 1) _invfact[i] = power(_fact[i], MOD - 2);
    }

    ll operator()(int n, int k) {
        if (n < k or k < 0) return 0;
        return (_fact[n] * _invfact[n - k] % MOD) * _invfact[k] % MOD;
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    Combination comb(2000);
    FOR(i, 1, k) {
        ll devide_cnt = comb(k - 1, i - 1);
        ll ans = devide_cnt * comb(n - k + 1, i) % MOD;
        cout << ans << ln;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define ff first
#define ss second
#define mp make_pair
 
using namespace std;
 
typedef long long ll;

int main() {
	int x;
	scanf("%d", &x);

	int q = x/100;
	int r = x%100;

	if(q*5 >= r) printf("1\n");
	else printf("0\n");

    return 0;
}

Measured memory_bytes: 384
if __name__ == '__main__':
    s = input()
    if s == "SUN":
        print(7)
    if s == "MON":
        print(6)
    if s == "TUE":
        print(5)
    if s == "WED":
        print(4)
    if s == "THU":
        print(3)
    if s == "FRI":
        print(2)
    if s == "SAT":
        print(1)


Measured memory_bytes: 3060
#include <iostream>

using namespace std;

int main(){
    int n, y; cin >> n >> y;
    y/=1000;
    for(int i10=0; i10<=n; ++i10){
        for(int i5=0; i10+i5<=n; ++i5){
            int i1=n-(i10+i5);
            if(i10*10+i5*5+i1==y){
                cout << i10 << " " << i5 << " " << i1 << endl;
                return 0;
            }
        }
    }
    cout << "-1 -1 -1\n";
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
int main(void){
    // Your code here!
    long long int N,M,H,W,x,i,j,k,ans,count,cost,tmp;
    long long int S[300000];
    long long int T[300000];
    long long int U[300000];
    //long long int Ssum[300000];
    //string T,U,V,ans2;
    bool flag;
    count=0;
    ans=std::pow(10,18);
    ans=0;
    flag=false;
        cin >> N;
        //count=0;
    for (i=1;i<100;i++){
        for (j=1;j<100;j++){
            for (k=1;k<100;k++){
                x=i*i+j*j+k*k+i*j+j*k+k*i;
                if (x<10050  ){
                    S[x]+=1;
                    
                    
                }
                
            }
        }
    }
    //cout << count<<endl;
    for (j=1;j<=N;j++){
        count=0;
 
        cout << S[j]<<endl;
    }
    
    
    
    //cout << ans<<endl;

    return 0;
    
}


Measured memory_bytes: 3704
n, m = map(int, input().split())

l = [0] * (m+1)
for i in range(n):
  inp = list(map(int, input().split()))
  for j in range(1, inp[0]+1):
    l[inp[j]] += 1
ans = 0
#print(l, n)
for i in range(1, m+1):
  if l[i] == n:
    ans += 1
print(ans)

Measured memory_bytes: 62440
#include <bits/stdc++.h>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;

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

int taro[110];
int hana[110];

int main(){
	while(1){
		int n,m;
		scanf("%d %d",&n,&m);
		if(n + m == 0) break;
		int sumtaro = 0,sumhana = 0;
		for(int i = 0;i < n;i++){ 
			scanf("%d",&taro[i]);
			sumtaro += taro[i];
		}
		for(int i = 0;i < m;i++) {
			scanf("%d",&hana[i]);
			sumhana += hana[i];
		}
		int anstaro = 10000,anshana = 10000;
		for(int i = 0;i < n;i++){
			for(int j = 0;j < m;j++){
				if( (sumtaro-taro[i]+hana[j]) == (sumhana-hana[j]+taro[i]) && anstaro + anshana > taro[i]+hana[j]){
					anstaro = taro[i];
					anshana = hana[j];
				}   
			}
		}
		if(anstaro == 10000){
			printf("-1\n");
		}else{
			printf("%d %d\n",anstaro,anshana);
		}


	}
}


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

typedef long long ll;

const int Maxn = 100005;

int n, k;
int a[Maxn];
ll sum[Maxn];
ll L[Maxn], R[Maxn];
ll res;

int main()
{
    scanf("%d %d", &n, &k);
    for (int i = 1; i <= n; i++) {
        scanf("%d", &a[i]);
        sum[i] = sum[i - 1] + a[i];
    }
    L[0] = 0;
    for (int i = 1; i <= n; i++)
        L[i] = L[i - 1] + (a[i] > 0? a[i]: 0ll);
    R[n + 1] = 0;
    for (int i = n; i > 0; i--)
        R[i] = R[i + 1] + (a[i] > 0? a[i]: 0ll);
    for (int i = 1; i + k <= n + 1; i++)
        res = max(res, max(0ll, sum[i + k - 1] - sum[i - 1]) + R[i + k] + L[i - 1]);
    printf("%lld\n", res);
    return 0;
}


Measured memory_bytes: 2944
#include <bits/stdc++.h> 
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
int main(){
  ll n,k,q;
  cin>>n>>k>>q;
  vector<int> a(q),p(n);
  rep(i,q){cin>>a[i];}
  rep(i,q){p[a[i]-1]++;}//p[i]==No.(i+1)の正解回数
  rep(i,n){
    if(q-p[i]<k){cout<<"Yes"<<endl;}
    else cout<<"No"<<endl;}
}

Measured memory_bytes: 1408
//AOJ 0579: Hot days
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
typedef pair<int, int> P;
const int INF = 10000000;
int n, d, ans, c[201][61], save[3], dt[201], plan[200][2], s[200][101];
void solve(){
	for (int i = 1; i < d; i++){
		if (plan[i][0] == plan[i][1]){
			s[i][plan[i][0]] = max(s[i - 1][plan[i - 1][0]] + abs(plan[i][0] - plan[i - 1][0]), s[i - 1][plan[i - 1][1]] + abs(plan[i][0] - plan[i - 1][1]));
		}

		else{
			s[i][plan[i][0]] = max(s[i - 1][plan[i - 1][0]] + abs(plan[i][0] - plan[i - 1][0]), s[i - 1][plan[i - 1][1]] + abs(plan[i][0] - plan[i - 1][1]));
			s[i][plan[i][1]] = max(s[i - 1][plan[i - 1][0]] + abs(plan[i][1] - plan[i - 1][0]), s[i - 1][plan[i - 1][1]] + abs(plan[i][1] - plan[i - 1][1]));
		}
	}
	ans = max(s[d - 1][plan[d - 1][0]], s[d - 1][plan[d - 1][1]]);
}
int main(){
	cin >> d >> n;
	for (int i = 0; i < d; i++){
		cin >> dt[i];
	}
	for (int i = 0; i < n; i++){
		for (int j = 0; j<61; j++){
			c[i][j] = -1;
		}
	}
	for (int i = 0; i < n; i++){
		cin >> save[0] >> save[1] >> save[2];
		for (int j = save[0]; j <= save[1]; j++){
			c[i][j] = save[2];
		}
	}
	for (int i = 0; i<d; i++){
		plan[i][0] = INF;
	}
	for (int i = 0; i < d; i++){
		for (int j = 0; j < n; j++){
			if (c[j][dt[i]] != -1){
				plan[i][0] = min(c[j][dt[i]], plan[i][0]);
				plan[i][1] = max(c[j][dt[i]], plan[i][1]);
			}
		}
	}
	solve();
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1288
//package src.com.jetman.atcoder;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

/**
 * @description:
 * @author: Jetman
 * @create: 2020-08-29 14:39
 **/
public class Main {

    Scanner sc = new Scanner(System.in);

    long MOD = 1000000000 + 7;
    boolean[] judge;
    List<Integer> prime ;

    void initial(int bound) {
        judge[0] = false;
        judge[1] = false;
        for (int i = 2; i <= bound; i++) {
            judge[i] = true;
        }

        for (int i = 2; i <= bound; i++) {
            if (judge[i]) {
                prime.add(i);
                //倍数不是
                for (int j = 2 * i; j <= bound; j += i) {
                    judge[j] = false;
                }
            }
        }
    }



    List<Integer> divide(int n){
        if (judge[n]) {
            return Arrays.asList(n);
        }
        int tmp = (int) Math.sqrt(n);
        List<Integer> ans = new ArrayList<>();
        int i = 0;
        while (prime.get(i) <= tmp && prime.get(i) <= n){
            int k = prime.get(i);
            if(n%k==0){
                ans.add(k);
                while(n%k==0){
                    n/=k;
                }
            }
            i++;
        }
        if(n>1){
            ans.add(n);
        }
        return ans;
    }

    private void slove() {

        int n = sc.nextInt();

        judge = new boolean[1000002];
        prime = new ArrayList<>();
        initial(1000000);

        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        int[] flag = new int[1000002];
        int ans = 1;
        for (int i = 0; i < n ; i++) {
            List<Integer> prime = divide(a[i]);
            for (int j = 0; j < prime.size(); j++) {
                if (ans == 1 && flag[prime.get(j)] > 0) {
                    ans++;
                }
                flag[prime.get(j)]++;
            }
        }
        if (ans == 1) {
            System.out.println("pairwise coprime");
            return ;
        }
        boolean f = Arrays.stream(flag).anyMatch(p -> p >= n);
        System.out.println(f?"not coprime":"setwise coprime");



    }

    public static void main(String[] args) {
        new Main().slove();
    }
}


Measured memory_bytes: 70352
#include <iostream>
#include <bits/stdc++.h>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <math.h>
#include <algorithm>
#include <string.h>
#include <tuple>
#include <time.h>
#include <random>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;

long long int INF = 1e18;
double Pi = 3.1415926535897932384626;

vector<ll> G[500005];
//vector<P> tree[500010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop

int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//ll bit[500005];
//↓,→,↑,←


#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<(x)<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define line cout << "----------" << endl;


ll mod = 1000000007;
ll rui(ll number1,ll number2){

    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
ll gcd(ll number1,ll number2){

    if(number1 > number2){
        swap(number1,number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1,number1);
    }
}
void YES(bool condition){

    if(condition){
        p("YES");
    }else{
        p("NO");
    }
    return;
}
void Yes(bool condition){

    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}
void Yay(bool condition){

    if(condition){
        p("Yay!");
    }else{
        p(":(");
    }
    return;
}

//ll fact[800005],rfact[800005];
/*
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<=800000; i++){
        fact[i] = (fact[i-1]*i) % mod;
    }
	rfact[800000] = rui(fact[800000],mod - 2);
	for(ll i=800000; i>=1; i--){
	   rfact[i-1] = rfact[i] * i;
	   rfact[i-1] %= mod;
	}
	return;}
ll c3(ll n,ll r){
    return (((fact[n] * rfact[r]) % mod) * rfact[n-r]) % mod;}
*/

ll n,m,num,ans,a,b,c,d,e,g,h,w,i,j,k,q;
ll x[300005],y[300005],z[100005];
ll dp[105][1000005];

ll sum;

int main(){
	cin >> n >> k;
	
	c = 1;
	while(1){
		// n を割ったら商がcになるようなものを集めていく
		a = n / (c + 1) + 1;
		b = n / c;
		//pe(a);p(b);
		x[i] = a;
		y[i] = b;
		i++;
		if(a == 1)break;
		c = n / (a - 1);
	}
	ll size = i;
	dp[0][size-1] = 1;
	for(i=1;i<=k;i++){
		sum = 0;
		for(j=0;j<size;j++){
			sum += dp[i-1][size - 1 - j];
			dp[i][j] = sum * (y[j] - x[j] + 1);
			sum %= mod;
			dp[i][j] %= mod;
			//pe(dp[i][j]);
		}
		//el;
	}
	for(i=0;i<size;i++){
		ans += dp[k][i];
		ans %= mod;
	}
	p(ans)
	return 0;
}


Measured memory_bytes: 274560
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    string S;
    int i;
    int a = 0;
    int b = 0;
    int c = 0;
    int d = 0;
    cin >> S;
 
    for (i = 0; i < S.size(); i++){
      if(i % 2 == 1){
        if(S[i] == '1'){
          a++;
        }else{
          b++;
        }
      }else{
        if(S[i] == '0'){
          a++;//0
        }else{
          b++;
        }
      }
    }
    cout << min(a, b) << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INFLL LLONG_MAX // 9223372036854775807
#define EPS 1e-9
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
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; }
using namespace std;

int main(){
    Init();
    ll n, ans = INFLL; string s;
    cin >> n >> s;

    // i番目以降を黒に変える場合の個数
    vi chgcnt(n+1, 0);
    for(ll i=n-1; i>=0; i--){
        chgcnt[i] = chgcnt[i+1];
        if(s[i] == '.') chgcnt[i]++;
    }

    ll cnt = 0;
    rep(i, n){
        if(s[i] == '#') cnt++;
        chmin(ans, cnt+chgcnt[i+1]);
    }

    // 黒のとなりに白があったら黒に変えるパターン
    cnt = 0;
    rep(i, n){
        if(s[i] == '#' && i != n-1){
            if(s[i+1] == '.'){
                s[i+1] = '#';
                cnt++;
            }
        }
    }
    cout << min(ans, cnt) << endl;
}

Measured memory_bytes: 5200
//Keep Working Hard
  // I__Like__Food
  #include<bits/stdc++.h>
  #include <ext/pb_ds/assoc_container.hpp> 
  #include <ext/pb_ds/tree_policy.hpp>
  #pragma comment(linker, "/stack:200000000")
  #define rep(i,a,b) for(int i = a; i <=b; i++)
  #define rep2(i,a,b) for(int i = a; i>=b; i--)
  #pragma GCC optimize("O3")
  #pragma GCC optimize("Ofast") 
  #pragma GCC optimize("unroll-loops")
  using namespace std;
  using namespace __gnu_pbds;
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define endl "\n"
  #define int long long
  #define all(v) v.begin(),v.end()
  #define PB push_back
  #define MP make_pair
  #define double long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  #define MOD 998244353
  #define N 305
  #define INF 1e16
  const double PI = acos(-1);

int32_t main()
{

    int x;
    cin >> x;


     double ans =(double) (x * x * x)/(double)(27);


    cout << fixed << setprecision(12) << ans;

  return 0;
} 

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

    int a, b, c;

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

    if (a < b && b < c) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }

    return 0;
}


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

 public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] list = new int[n];
        for(int i=0;i<n;i++){
            list[i] = sc.nextInt();
        }
        Arrays.sort(list);

        for(int i=0;i<n;i++){
        }
        double result = (double)list[0];
        for(int j=1;j<n;j++){
            result = (double)((result + list[j]) /2);
        }
        System.out.println(result);
    }

}

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

#include <cstdlib>  // abs() for integer 絶対値求めやつ

#include <cmath>    // abs() for float, and fabs()

#include <algorithm>
#include <vector>
#define rep(i,n) for(int i = 0; i< (n);i++)

#define sort(a) sort((a).begin(),(a).end());

#define che(a,string) cout<<string<<":"<<(a)<<endl;

#define ch(a,string) cout<<string<<":"<<(a)<<" ";

using namespace std;

typedef pair<int,int> p;

int main(){
  	string s;
	cin>>s;
	rep(i,10){
		if(i!=3){
		cout<<s[i];}
		else{
			cout<<8;
		  }
	  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define f(i, a, b) for(ll i=a; i<b; i++)
#define fr(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define LB lower_bound
#define UB upper_bound
#define endl "\n"
#define PI 3.141592653589793
using namespace std;

bool sortbysec(const pair<ll,ll> &a, 
              const pair<ll,ll> &b) 
{ 
    return (a.second < b.second); 
} 

ll maxSubArraySum(ll a[], ll size) 
{ 
    ll max_so_far = INT_MIN, max_ending_here = 0; 
  
    for (ll i = 0; i < size; i++) 
    { 
        max_ending_here = max_ending_here + a[i]; 
        if (max_so_far < max_ending_here) 
            max_so_far = max_ending_here; 
  
        if (max_ending_here < 0) 
            max_ending_here = 0; 
    } 
    return max_so_far; 
} 

ll findSubarraySum(ll arr[], ll n, ll sum = 0) 
{
    unordered_map<ll, ll> prevSum;
    ll res = 0;
    ll currsum = 0;
    for (ll i = 0; i < n; i++)
    {
        currsum += arr[i];
        if (currsum == sum) res++;
        if (prevSum.find(currsum - sum) != prevSum.end()) res += (prevSum[currsum - sum]);
        prevSum[currsum]++;
    }
    return res; 
} 
ll gcd(ll a, ll b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
  
ll powmp(ll x, ll y, ll p) 
{ 
    ll res = 1;     x = x % p;   
    while (y > 0) 
    {  
        if (y & 1)  res = (res*x) % p; 
        y = y>>1; 
        x = (x*x) % p;   
    } 
    return res; 
} 

int main()
{
    FAST
    ll n;cin>>n;
    ll s[n],f[n];
    f(i,0,n) cin>>s[i]>>f[i];
    sort(s,s+n);
    sort(f,f+n);
    if(n&1LL)
    {
        ll l,r;
        l=s[n/2],r=f[n/2];
        cout<<r-l+1<<endl;
    }
    else
    {
        ll l1,r1,l2,r2;
        l1=s[n/2-1];l2=s[n/2];
        r1=f[n/2-1];r2=f[n/2];
        cout<<r2-l2+1 + r1-l1<<endl;
    }
    
}


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

using namespace std;
using llong = long long;
using P = pair<llong, llong>;

#define BE(x) x.begin(), x.end()

const llong inf = llong(1e18)+7;
const llong mod = 1e9+7;

int main(){
	int K,S;

	cin >> K >> S;

	int ans = 0;
	for(int x = 0; x <= K; x++)
		for(int y = 0; y <= K; y++){
			int z = S - x - y;
			if(0 <= z && z <= K)
				ans++;
		}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, c) for(ll i = 1; i <= (ll)c; i++)
#define ll long long
#define upd_max(maxer, updater) if (maxer < updater) maxer = updater;
#define upd_min(miner, updater) if (miner > updater) miner = updater;
const int inf = 1000000000; // 10^9

int main(){
    ll n, k, mod, cnt = 0;
    cin >> n >> k;

    mod = 1000000007;

    for(ll i = k; i <= n + 1; i++){
        cnt += i * (n + 1) - i * i + 1;
        cnt %= mod;
    }

    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 3636
//
//  main.cpp
//  leetcode
//
//  Created by caokai on 2016/11/23.
//  Copyright © 2016年 caokai. All rights reserved.
//

#include <cstdlib>
#include <algorithm>
#include <list>
#include <string>
#include <vector>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
    string res;
    cin >> res;
    int sum = 0;
    auto it1 = res.begin();
    auto it2 = res.begin();
    while (++it2 != res.end()) {
        sum += *it1++ != * it2;
    }
    cout << sum << endl;
        return 0;
}


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

typedef std::pair<int, int> ipair;
#define pb push_back
#define ff first
#define ss second
#define fr(i, j, k) for (int i = j; i < k; i++)
#define rf(i, j, k) for (int i = j; i >= k;i--)
#define int long long
#define ld long double
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(),x.rend()
#define mp make_pair

const int mod = 1000000007;
const ld pi = acos(-1);
const int maxn = 2001;

template<class T> ostream& operator <<(ostream &out,vector<T> &A){for(auto x:A) out<<x<<" ";return out;}
template <class T1,class T2>T1 powr(T1 a,T2 b){T1 res = 1;fr(i,1,b+1)res = res*a;return res;}
#define IOS  std::ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int32_t main(){
  int n,p,m;  cin>>n>>p>>m;
  vector<int>A(n,p);
  fr(i,0,m){
    int x;  cin>>x;
    A[--x]++;
  }
  int ans = 0;
  for(auto x : A){
    x-=m;
    puts((x<=0)?"No":"Yes");
  }
}


Measured memory_bytes: 1408
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <string>
#define INF 100000000000
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define LOOP(i,N) for(int i=0;i<N;i++)
typedef pair<int,int> P;
// #define int long long
/* define/include */

int main(){
  int A,B,C;
  cin >> A >> B >>C;
  if(A==B){
    cout<<C;
  }else{
    if(A==C){
      cout<<B;
    }else{
      cout<<A;
    }
  }
  cout<<endl;
  return 0;
  
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm> 
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
template<class T> inline bool chmax(T& a, T b) {
 if (a < b) { a = b; return true; } return false; 
 }
template<class T> inline bool chmin(T& a, T b) {
 if (a > b) { a = b; return true; } return false; 
 }
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll x,y,a,b,c;
  cin>>x>>y>>a>>b>>c;
  vll p(a),q(b),r(c);
  rep(i,a) cin>>p[i];
  rep(i,b) cin>>q[i];
  rep(i,c) cin>>r[i];
  ll ans=0;
  PQR pp;
  PQR qq;
  sort(rall(p));
  sort(rall(q));
  sort(rall(r));
  rep(i,x){
    pp.pu(p[i]);
  }
  rep(i,y){
    qq.pu(q[i]);
  }
  rep(i,c){
    ll mpp=pp.top();
    pp.pop();
    ll mqq=qq.top();
    qq.pop();
    if(mpp<mqq&&mpp<r[i]){
      qq.pu(mqq);
      pp.pu(r[i]);
    }
    else if(mpp>=mqq&&mqq<r[i]){
      qq.pu(r[i]);
      pp.pu(mpp);
    }
    else {
      pp.pu(mpp);
      qq.pu(mqq);
    }
  }
  while(sz(pp)){
    ll k=pp.top();
    pp.pop();
    ans+=k;
  }
  while(sz(qq)){
    ll k=qq.top();
    qq.pop();
    ans+=k;
  }
  COUT(ans);
}

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

const ll M = 1000000007;
ll f[100010];

int main(){
	int n, m;
	scanf("%d%d", &n, &m);
	f[0] = 1;
	for(int i = 1; i <= 100000; i++) f[i] = f[i - 1] * i % M;
	if(n == m) printf("%lld\n", 2 * f[n] * f[m] % M);
	else if(abs(n - m) == 1) printf("%lld\n", f[n] * f[m] % M);
	else puts("0");
}

Measured memory_bytes: 1024
#include <iostream> 
#include<vector>
#include<algorithm>
#include<map>
#include<string>
#include<iomanip>
#include<set>
#include<queue>
#include<deque>
#include<sstream>
#include<cmath>
#include<bitset>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define req(i,n) for(int i = 1;i <=  n; i++)
#define rrep(i,n) for(int i = n-1;i >= 0;i--)
#define ALL(obj) begin(obj), end(obj)
#define RALL(a) rbegin(a),rend(a)
typedef long long int ll;
typedef long double ld;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T& val) {
    std::fill((T*)array, (T*)(array + N), val);
}
const int inf = 1<<31-1;
const ll MOD = 1000000007;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int n;
void prime(int i,vector<int> &pri) {
    int j = i;
    while (i % 2 == 0) {
        i /= 2; pri[2]++;
    }for (int t = 3; t * t <= j; t += 2) {
        while (i % t == 0) {
            i /= t; pri[t]++;
        }
    }if (i * i > j)pri[i]++;
}
int main(void) {
    cin >> n; vector<int> p(1000, 0);
    ll ans = 1;
    if (n == 1) {
        cout << 1 << endl;
        return 0;
    }
    for (int i = 2; i <= n; i++) {
        prime(i,p);
    }rep(i, 1000) {
        ans *= (p[i] + 1);
        ans %= MOD;
    }cout << ans << endl;
}

Measured memory_bytes: 3592
import java.util.*;

public class Main {
	public static void main (String[] args)  {
		Scanner sc = new Scanner(System.in);
		long x = sc.nextLong();
		long y = sc.nextLong();
		if (Math.abs(x - y) <= 1) {
			System.out.println("Brown");
		} else {
			System.out.println("Alice");
		}
	}
}


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

int main(){
	int n, a, min = 10000;
	cin >> n;
	for(int i=0; i < n; i++) {
		int count = 0;
		cin >> a;
		while(!(a % 2)) {
			a /= 2;
			count++;
		}
		if(min > count)
			min = count;
	}
	cout << min << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (int64_t)(n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

int main() {
  int64_t Q, H, S, D, N;
  cin >> Q >> H >> S >> D >> N;

  H = min(H, 2 * Q);
  S = min(S, 2 * H);
  D = min(D, 2 * S);

  cout << N / 2 * D + N % 2 * S << endl;
  return 0;
}

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

int n;
int a[200005];

int main(){

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

    cin>>n;
    int s=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        s^=a[i];
    }
    for(int i=0;i<n;i++){
        cout<<(s^a[i])<<' ';
    }

    return 0;
}

Measured memory_bytes: 4360
n=int(input())
s=input()
ans=0
for i in range(n-1):
    a=set()
    b=set()
    for j in range(i):
        a.add(s[j])
    for j in range(i,n):
        b.add(s[j])
    ans=max(ans,len(a&b))
print(ans)

Measured memory_bytes: 9116
import numpy as np
N, M = map(int, input().split())

Node = [[] for _ in range(N)]

for i in range(M):
    a, b = map(int, input().split())
    Node[a-1].append(b-1)
    Node[b-1].append(a-1)

# print(Node)
Check = [0]*N
Check[0] = 1
ans = 0

def TreeSearch(x):
    # print('x={}:  '.format(x), end='')
    for i in Node[x]:
        # print('i={} '.format(i), end='')
        if Check[i] == 0:
            Check[i] = 1
            # print('  Check =', Check)
            if np.prod(Check) == 1:
                global ans
                ans += 1
                # print('ans=', ans)
                # print()
            TreeSearch(i)
            Check[i] = 0
            # print('modori from {}:  Check = {}'.format(i, Check))
           
TreeSearch(0)
print(ans)


Measured memory_bytes: 12436
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr=input.trim().split("\n");
while(true){
   var wh=arr.shift();
   if(wh=="0 0")break;
   wh=wh.split(" ").map(Number);
   var w=wh[0];
   var h=wh[1];
   var xy=[0,1,1];
   while(true){
      var ary=arr.shift().split(" ");
      if(ary.length==2)ary[1]=ary[1]-0;
      if(ary[0]=="STOP")break;
      if(ary[0]=="RIGHT"){xy[0]++;if(xy[0]==4)xy[0]=0;}
      if(ary[0]=="LEFT"){xy[0]--;if(xy[0]==-1)xy[0]=3;}
      if(ary[0]=="FORWARD"){
         while(ary[1]--){
            if(xy[0]==0)xy[2]++;
            if(xy[0]==1)xy[1]++;
            if(xy[0]==2)xy[2]--;
            if(xy[0]==3)xy[1]--;
         }
      }
      if(ary[0]=="BACKWARD"){
         while(ary[1]--){
            if(xy[0]==0)xy[2]--;
            if(xy[0]==1)xy[1]--;
            if(xy[0]==2)xy[2]++;
            if(xy[0]==3)xy[1]++;
         }
      }
      if(xy[1]<1)xy[1]=1;
      if(xy[2]<1)xy[2]=1;
      if(xy[1]>w)xy[1]=w;
      if(xy[2]>h)xy[2]=h;
   }
   xy.shift();
   console.log(xy.join(" "));
}

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

using namespace std;

const int MAXN=2e5+1;

int n,maxv=0;
string s[MAXN];
vector<int> vote;

int main() {
	scanf("%d",&n);
	for(int i=1; i<=n; ++i) cin>>s[i];
	sort(s+1,s+1+n);
	for(int i=1,j; i<=n; i=j+1) {
		for(j=i; j<n && s[j]==s[j+1]; ++j);
		if(j-i+1>maxv) maxv=j-i+1;
	}
	for(int i=1,j; i<=n; i=j+1) {
		for(j=i; j<n && s[j]==s[j+1]; ++j);
		if(j-i+1==maxv) cout<<s[i]<<endl;
	}
	return 0;
}

Measured memory_bytes: 14208
x = int(input())

if x >= 400 and x <= 599:
    print('8')
elif x >= 600 and x <= 799:
    print('7')
elif x >= 800 and x <= 999:
    print('6')
elif x >= 1000 and x <= 1199:
    print('5')
elif x >= 1200 and x <= 1399:
    print('4')
elif x >= 1400 and x <= 1599:
    print('3')
elif x >= 1600 and x <= 1799:
    print('2')
else:
    print('1')


Measured memory_bytes: 9180
fun main(args: Array<String>) {
    val c= readLine()!!.toInt()
    val array= mutableListOf<List<Int>>()
    for(i in 0 until c){
        val array2= readLine()!!.split(" ").map { it.toInt() }
        array.add(array2)
    }
    val pl=Array(100001,{true})
    pl[0]=false
    pl[1]=false
    for(i in 2..100000){
        if(pl[i]){
            for(j in i+i..100000 step i){
                pl[j]=false
            }
        }
    }
    val pl2=Array(100001,{0})
    var count=0
    for(i in 3..100000){
        if(pl[i]&&pl[(i+1)/2])count++
        pl2[i]=count
    }
    for(i in array){
        var k= pl2[i[1]]-pl2[i[0]]
        if(pl2[i[0]]>pl2[i[0]-1])k++
        println(k)
    }
}

Measured memory_bytes: 73052
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};

vector<int> d(1001);

void solve() {
	ll n;
	cin >> n;
	for (int i = 2; i <= n; i++) {
		int cur = i;
		for (int j = 2; j * j <= cur; j++) {
			while (cur % j == 0) {
				d[j]++;
				cur /= j;
			}
		}
		if (cur != 1) d[cur]++;
	}
	ll ans = 1;
	for (int i = 2; i <= n; i++) {
		ll temp = (d[i] + 1);
		temp %= MOD;
		ans *= temp;
		ans %= MOD;
	}
	cout << ans << endl;
}

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

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

#define debug(x) cout <<"DEBUG"<<" "<< #x << ":" << x << '\n'

//↓0-originか1-originでn回繰り返し
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   //0-origin昇順
#define rep1(i,n) for(int i = 1; i <= ((int)(n)); i++) //1-origin昇順
#define rrep(i,n) for(int i = ((int)(n)-1); i >= 0; i--)  //0-origin降順
#define rrep1(i,n) for(int i = ((int)(n)); i >= 1; i--)   //1-origin降順
//rep2 -> 第二引数 m から n 回繰り返し ex) m=5 n=3 なら i=5,i=6,i=7 まで
#define rep2(i,m,n) for(int i = ((int)(m)); i < ((int)(n))+((int)(m)); i++)
#define SIZE(x) ((int)((x).size()))
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii; //2次元配列
typedef vector<ll> vll;
typedef vector<string> vs;
typedef pair<int, int> PII;
template<class T,class U> inline bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U> inline bool chmin(T &a, const U &b){if(a>b){a=b;return 1;}return 0;}

/* 円周率は M_PI を使おうね */
const ll infll = (1LL<<62)-1;
const int inf = (1<<30)-1;
int mod = 1000000007;

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

/*最長増加or減少部分列----------*/
/*第一引数 : 対象となるvector
  第二引数 : true:狭義 false:広義  デフォルト:0
  第三引数 : true:増加 false:減少  デフォルト:1
*/
template<class T>
std::vector<T> lis(const vector<T> &a, bool strict=0, bool UporNot=1) {
    std::vector<T> lis;
    if(UporNot) {
        for(auto &p : a) {
            typename std::vector<T>::iterator iter;
            //using iter = std::vector<T>::iterator;
            if(strict) iter = std::lower_bound(lis.begin(), lis.end(), p);
            else iter = std::upper_bound(lis.begin(), lis.end(), p);
            if(lis.end()==iter) lis.emplace_back(p);
            else *iter = p;
        }
    }else {
        vector<T> rev = a;
        reverse(rev.begin(), rev.end());
        for(auto &p : rev) {
            typename std::vector<T>::iterator iter;
            //using iter = std::vector<T>::iterator;
            if(strict) iter = std::lower_bound(lis.begin(), lis.end(), p);
            else iter = std::upper_bound(lis.begin(), lis.end(), p);
            if(lis.end()==iter) lis.emplace_back(p);
            else *iter = p;
        }
    }
    return lis;
}

/*------------------------------*/

/*MAIN==================================================*/
signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
    //cout << fixed << setprecision(10);

    int n; cin >> n;
    vi a(n); rep(i,n) cin >> a[i];
    vi ret = lis(a, 0, 0);
    cout << ret.size() << '\n';
}


Measured memory_bytes: 1660
n, m = list(map(int, input().split()))
broken = [False] * (n + 1)
for _ in range(m):
    broken[int(input())] = True

dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1 if not broken[1] else 0
MOD = 10 ** 9 + 7

for i in range(2, n + 1):
    if broken[i]:
        continue
    dp[i] = (dp[i - 1] + dp[i - 2]) % MOD

print(dp[n])


Measured memory_bytes: 13536
#include <bits/stdc++.h>
using namespace std;
int a[100005];
int N, K;
int gcd(int a, int b) {
  while(b) {
    int tmp = a % b;
    a = b;
    b = tmp;
  }
  return a;
}
int main () {
  ios::sync_with_stdio(false);
  cin >> N >> K;
  for(int i = 0; i < N; ++i) cin >> a[i];
  sort(a, a + N);

  int com = a[0];
  for(int i = 0; i < N - 1; ++i) {
    int cc = gcd(a[i], a[i + 1]);
    com = gcd(cc, com);
    if (com == 1) break;
  }

  if (com == 1 && a[N - 1] >= K) {
    cout << "POSSIBLE" << endl;
    return 0;
  }

  for(int i = 0; i < N; ++i) {
    if (a[i] >= K && ((a[i] - K) % com) == 0) {
      cout << "POSSIBLE" << endl;
      return 0;
    }
  }

  cout << "IMPOSSIBLE" << endl;

}

Measured memory_bytes: 640
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let mut iter = buf.split_whitespace();

    let n: usize = iter.next().unwrap().parse().unwrap();
    let k: usize = iter.next().unwrap().parse().unwrap();
    let a: Vec<(usize)> = (0..n)
        .map(|_| (iter.next().unwrap().parse().unwrap()))
        .collect();

    for i in 0..n - k {
        if a[i] < a[i + k] {
            println!("Yes");
        } else {
            println!("No");
        }
    }
}


Measured memory_bytes: 5644
using System;
using System.Linq;
using System.Collections.Generic;

/* Dictionaryの練習 */

namespace ABC061
{
    class B
    {
        static void Main(string[] args)
        {

            int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int N = input[0];
            int M = input[1];

            Dictionary<int, int> dict = new Dictionary<int, int>();

            int a = 0;
            int b = 0;

            for (int i = 0; i < M; i++)
            {
                input = Console.ReadLine().Split().Select(int.Parse).ToArray();

                a = input[0];
                b = input[1];

                if (!dict.ContainsKey(a)) { dict.Add(a, 0); }
                if (!dict.ContainsKey(b)) { dict.Add(b, 0); }

                if (dict.ContainsKey(a)) { dict[a]++; }
                if (dict.ContainsKey(b)) { dict[b]++; }

            }

            var res = dict.OrderBy(x => x.Key);

            for (int i = 1; i <= N; i++)
            {
                if (!dict.ContainsKey(i)) Console.WriteLine(0);
                else Console.WriteLine(dict[i]);
            }
        }
    }
}


Measured memory_bytes: 13280
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,i,j,k;
    cin>>n;
    long long a[n];
    for(i=0;i<n;i++)
    { 
        cin>>a[i];
        }
    long long b=0;
     for(i=0;i<n-2;i++)
         {
       for(j=i+1;j<n-1;j++){
            for(k=j+1;k<n;k++){
   if(a[i]+a[j]>a[k]&&a[j]+a[k]>a[i]&&a[i]+a[k]>a[j]&&a[j]!=a[i]&&a[k]!=a[i]&&a[k]!=a[j])
        b++;
                }
            }
            }
        cout<<b<<endl;
    }
           

Measured memory_bytes: 3624
# 同じカードが3枚以上ある場合は2枚ずつ減らせる
# 3枚以上で奇数の場合->1枚残る
# 3枚以上で偶数の場合->2枚残る

# 同じカードが2枚の場合
# 2枚のペアが２つ存在する場合
# 片方のペアから2枚選べば、両方の数字を1にできる
# ペアの数を2で割った数（切り捨て）*2のカードを減らせる

# 2枚のペアが1つ残ったとき
# そのときの全体数-2が答え

# 2枚のペアが残ってなければそのまま答え

N=int(input())
A=sorted(list(map(int,input().split())))
card=N
pairs=0
import itertools
for key,g in itertools.groupby(A):
  num=len(list(g))
  if num>2:
    if num&1:
      card-=(num-1)
    else:
      card-=(num-2)
      pairs+=1
  elif num==2:
    pairs+=1
if pairs>1:
  card-=(pairs//2)*2

if pairs&1:
  card-=2
  
print(card)

Measured memory_bytes: 14396
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int n=cin.nextInt();
		for(int r=0;r<n;r++){
			int x=cin.nextInt();
			System.out.println(max(x)-min(x));
		}
	}
	static int max(int x){
		int ans=0;
		int[] a=new int[10];
		for(int q=0;q<9;q++){
			a[q]=0;
		}
		for(int i=0;i<8;i++){
			a[x%10]=a[x%10]+1;
			x=x/10;
		}
		for(int w=9;w>=0;w--){
			for(int p=0;p<a[w];p++){
			ans=ans*10;
			ans+=w;
			}
		}
		return ans;
	}
	static int min(int x){
		int ans=0;
		int[] a=new int[10];
		for(int q=0;q<9;q++){
			a[q]=0;
		}
		for(int i=0;i<8;i++){
			a[x%10]=a[x%10]+1;
			x=x/10;
		}
		for(int w=0;w<=9;w++){
			for(int p=0;p<a[w];p++){
			ans=ans*10;
			ans+=w;
			}
		}
		return ans;
	}
}

Measured memory_bytes: 17164
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int cnt[100010] = {};
    rep(i, N) {
        int a; cin >> a;
        cnt[a]++;
        cnt[a + 1]++;
        cnt[a + 2]++;
    }
    int ans = 0;
    rep(i, 100010) ans = max(ans, cnt[i]);
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 4004
import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    
    System.out.println( (a % 2 == 0) || (b % 2 == 0) ? "Even" : "Odd");
  }
}

Measured memory_bytes: 21844
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
s = [None]*n
for i in range(n):
    s[i] = input()
    
def sub(i):
#     res = True
#     for j in range(n):
#         if not all(s[(i+j)%n][(j+k)%n]==s[(i+j+k)%n][j] for k in range(n)):
#             res = False
#             break
    res = all(all(s[(i+j)%n][(j+k)%n]==s[(i+j+k)%n][j] for k in range(n)) for j in range(n))
    return res
ans = 0
for i in range(n):
    if sub(i):
        ans += n
print(ans)

Measured memory_bytes: 69024
s=list(input())
n=int(input())
for i in range(n):
	l=input().split()
	if l[0]=="replace":
		a=int(l[1])
		b=int(l[2])
		s[a:b+1]=list(l[3])
	elif l[0]=="reverse":
		a=int(l[1])
		b=int(l[2])
		c=s[a:b+1][::-1]
		s[a:b+1]=c
	else:
		a=int(l[1])
		b=int(l[2])
		print("".join(s[a:b+1]))

Measured memory_bytes: 7636
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); i++)
#define ct(string) cout << string << endl
#define all(vec) vec.begin(), vec.end()

int main() {
    int n, d;
    cin >> n >> d;
    vector<vector<int> > point(n, vector<int>(d));
    rep(i,n) rep(j,d) cin >> point.at(i).at(j);
    int ans = 0;
    rep(i,n) {
        for (int j=i+1; j<n; j++) {
            if (i == j) continue;
            int SA = 0;
            rep(k,d) {
                int a = point.at(i).at(k) - point.at(j).at(k);
                SA += a*a;
            }
            bool ok = false;
            rep(k,SA+1) {
                if (k*k == SA) ok = true;
            }
            if (ok) ans++;
        }
    }
    ct(ans);
}

Measured memory_bytes: 256
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <map>
#include <string>
#include <utility>
#include <vector>

int main() {
  size_t n;
  scanf("%zu", &n);

  std::vector<intmax_t> a(n), b(n);
  for (size_t i = 0; i < n; ++i) {
    scanf("%jd %jd", &a[i], &b[i]);
  }

  auto ok_ll = [&](intmax_t x, size_t k) {
    size_t m = 0;
    for (size_t i = 0; i < n; ++i) {
      if (a[i] <= x) ++m;
    }
    return m < k;
  };
  auto ok_lr = [&](intmax_t x, size_t k) {
    size_t m = 0;
    for (size_t i = 0; i < n; ++i) {
      if (b[i] <= x) ++m;
    }
    return m < k;
  };
  auto ok_rl = [&](intmax_t x, size_t k) {
    size_t m = 0;
    for (size_t i = 0; i < n; ++i) {
      if (x <= a[i]) ++m;
    }
    return m < k;
  };
  auto ok_rr = [&](intmax_t x, size_t k) {
    size_t m = 0;
    for (size_t i = 0; i < n; ++i) {
      if (x <= b[i]) ++m;
    }
    return m < k;
  };

  intmax_t l0, r0, l1, r1;
  {
    intmax_t lb = 0, ub = 1e9+1;
    while (ub-lb > 1) {
      intmax_t mid = (lb+ub) / 2;
      (ok_ll(mid, (n+1)/2)? lb: ub) = mid;
    }
    l0 = ub;
  }
  {
    intmax_t lb = 0, ub = 1e9+1;
    while (ub-lb > 1) {
      intmax_t mid = (lb+ub) / 2;
      (ok_lr(mid, (n+1)/2)? lb: ub) = mid;
    }
    r0 = ub;
  }
  {
    intmax_t lb = 0, ub = 1e9+1;
    while (ub-lb > 1) {
      intmax_t mid = (lb+ub) / 2;
      (ok_rl(mid, (n+1)/2)? ub: lb) = mid;
    }
    l1 = lb;
  }
  {
    intmax_t lb = 0, ub = 1e9+1;
    while (ub-lb > 1) {
      intmax_t mid = (lb+ub) / 2;
      (ok_rr(mid, (n+1)/2)? ub: lb) = mid;
    }
    r1 = lb;
  }

  fprintf(stderr, "[%jd, %jd]\n", l0, r0);
  fprintf(stderr, "[%jd, %jd]\n", l1, r1);

  if (n % 2 == 1) {
    printf("%jd\n", r0-l0+1);
  } else {
    printf("%jd\n", (r1+r0)-(l1+l0)+1);
  }
}


Measured memory_bytes: 5940