akhauriyash/Code-Regression huggingface dataset:
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::Read;
#[allow(dead_code)]
fn getline() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok().unwrap();
    ret
}
fn get_word() -> String {
    let mut stdin = std::io::stdin();
    let mut u8b: [u8; 1] = [0];
    loop {
        let mut buf: Vec<u8> = Vec::with_capacity(16);
        loop {
            let res = stdin.read(&mut u8b);
            if res.unwrap_or(0) == 0 || u8b[0] <= b' ' {
                break;
            } else {
                buf.push(u8b[0]);
            }
        }
        if buf.len() >= 1 {
            let ret = String::from_utf8(buf).unwrap();
            return ret;
        }
    }
}

#[allow(dead_code)]
fn get<T: std::str::FromStr>() -> T { get_word().parse().ok().unwrap() }

fn solve() {
    let n = get();
    let mut a: Vec<i64> = (0 .. 3 * n).map(|_| get()).collect();
    a.sort();
    a.reverse();
    let mut tot = 0;
    for i in 0 .. n {
        tot += a[2 * i + 1];
    }
    println!("{}", tot);
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


Measured memory_bytes: 12668
// B.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include<string>

using namespace std;

int main()
{
    string s;
    bool judge = true;
    cin >> s;

    for (int i = 0; i < s.size(); i++) {
        if (i % 2 == 0) {
            if (s[i] == 'L') {
                judge = false;
                break;
            }
        }
        else {
            if (s[i] == 'R') {
                judge = false;
                break;
            }
        }
    }

    if (judge) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    return 0;
    
}



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

#define int long long
const double PI = 3.14159265358979323846;
typedef vector<int> vint;
typedef pair<int, int> pint;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int N;
int T[110000],A[110000];
bool sw[110000];
int mod=1e9+7;

signed main() {
    cin>>N;
    for(int i=0;i<N;i++)cin>>T[i];
    for(int i=0;i<N;i++)cin>>A[i];
    int ans=1;
    sw[0]=true;
    for(int i=1;i<N;i++){
        if(T[i]>T[i-1]){
            if(T[i]>A[i])ans=0;
            sw[i]=true;
        }
    }
    for(int i=N-2;i>=0;i--){
        if(A[i]>A[i+1]){
            if(A[i]>T[i])ans=0;
        }else if(!sw[i])(ans*=min(T[i],A[i]))%=mod;
    }
    if(T[N-1]!=A[0])ans=0;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1920
Program Tenka2019A

integer a,b,c

read(*,*) a,b,c

if (a<b) then
 if (a<c .and. c<b) then
  write(*,*) 'Yes'
 else
  write(*,*) 'No'
 end if
else
 if (b<c .and. c<a) then
  write(*,*) 'Yes'
 else
  write(*,*) 'No'
 end if
end if

stop
end

Measured memory_bytes: 768
import sys
import numpy as np
from numba import njit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

@njit('(i8,i4[::1])', cache=True)
def solve(dep, T):
    if dep == 0:
        return np.array([0], np.int32)
    A = np.empty(3**dep, np.int32)
    for d in range(3):
        TT = np.empty_like(T)
        p = 0
        x = d
        for t in T:
            if t == 0:
                x = 3 - x if x else 0
                if p > 0 and TT[p - 1] == 0:
                    p -= 1
                else:
                    TT[p] = 0
                    p += 1
            else:
                x = x + 1
                if x == 3:
                    x = 0
                    TT[p] = 1
                    p += 1
        TT = TT[:p]
        A[d::3] = 3 * solve(dep - 1, TT) + x
    return A

N = int(readline())
T = np.frombuffer(read().rstrip(), 'S1')

T = ((T == b'R') * 1).astype(np.int32)

ans = solve(N, T)
print(' '.join(ans.astype(str)))

Measured memory_bytes: 193452
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<functional>
#include<queue>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
typedef long long int ll;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<signed(n);i++)
#define EREP(i,n) for(int i=1;i<=signed(n);i++)
#define ALL(a) (a).begin(),(a).end()
using namespace std;
//#define EVEL 1
#ifdef EVEL
#define DEB(X) cout << #X <<":" <<X<<" " ;
#define TF(f) f ? cout<<"true  " : cout<<"false ";
#define END cout<<"\n";
#else
#define DEB(X) {}
#define TF(f) {}
#define END {}
#endif
const ll MOD = 1000000007;
const ll INF = 9e14;
typedef std::pair<ll,ll> P;
struct edge{ int to,cost; };
#define VMAX 100000

ll N,M,X,K,Q;
ll A,B,C,D;

ll ans;
bool F=false;

int main(){
    cin>>K>>A>>B;
    for(int i=A;i<=B;i++){
        if(i%K==0)F=true;
    }
    cout<<(F?"OK":"NG")<<endl;



    //cout<<ans<<endl;
}


Measured memory_bytes: 3680
#include<iostream>
#include<stdio.h>
int main(void){
	int A,B,C;
	std::cin >> A >> B >> C;
    if((A == B) && (B == C))
    	printf("No");
    if((A == B) && (B != C))
    	printf("Yes");
    if((A != B) && (B == C))
    	printf("Yes");
    if((A != B) && (A == C))
    	printf("Yes");
    if((A != B) && (A != C) && (B != C))
    	printf("No");
        }


Measured memory_bytes: 256
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;

bool match(const string &number, const string &lottery) {
	for(unsigned i = 0; i < number.size(); ++i) {
		if(number[i] != '*' && number[i] != lottery[i]) {
			return false;
		}
	}
	return true;
}

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

	for(int n, m; cin >> n >> m && n;) {
		vector<pair<int, string>> winning_numbers(n);
		for(auto &e : winning_numbers) cin >> e.second >> e.first;
		sort(winning_numbers.rbegin(), winning_numbers.rend());

		int ans = 0;
		while(m--) {
			string lottery;
			cin >> lottery;

			for(auto &e : winning_numbers) {
				if(match(e.second, lottery)) {
					ans += e.first;
					break;
				}
			}
		}
		cout << ans << endl;
	}

	return EXIT_SUCCESS;
}

Measured memory_bytes: 1224
R=range;(N,A),(*X,)=(map(int,input().split())for _ in R(2));C=[51*N*[0]for _ in R(N+1)];C[0][0]=1
for I in R(N):
	for J in R(N)[::-1]:
		for K in R(50*N)[::-1]:
			if C[J][K]:C[J+1][K+X[I]]+=C[J][K]
print(sum(C[I][I*A]for I in R(1,N+1)))

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

int main(){
    string s;
    cin >> s;
    unsigned long ans{0}, As{0}, BCs{0};
    bool lb = false;
    for(const auto &c : s){
        if(c == 'A'){
            if(lb)As = BCs = 0;
            ++As;
        }else if(c == 'B'){
            if(lb)As = BCs = 0;
        }else{
            if(lb)++BCs, ans += As;
            else As = BCs = 0;
        }
        lb = c == 'B';
    }
    cout << ans << endl;
    return 0;
}

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

int main()
{
	long long N;

	cin >> N;

	long long sum = 0;

	for (long long iN = 1; iN <= N - 1; iN++) {
		sum += iN;
	}

	cout << sum << endl;
}

//int main()
//{
//	long long N;
//
//	cin >> N;
//	
//	vector<long long> H;
//
//	for (long long iN = 0; iN < N; iN++)
//	{
//		long long val;
//
//		cin >> val;
//		H.push_back(val);
//	}
//
//	long long max_down = 0;
//
//	//TLE
//	//for (long long iN = 0; iN < N; iN++)
//	//{
//	//	long long down = 0;
//
//	//	for (long long iR = iN; iR < N - 1; iR++)
//	//	{
//	//		if (H[iR] >= H[iR + 1]) {
//	//			down++;
//	//		}
//	//		else {
//	//			break;
//	//		}
//	//	}
//
//	//	max_down = std::max(down, max_down);
//	//}
//
//	long long now = 100000000001;
//	long long up = 0;
//	for (long long iN = N - 1; iN >= 0; iN--) {
//		if (H[iN] >= now) {
//			up++;
//		}
//		else {
//			max_down = std::max(up, max_down);
//			up = 0;
//		}
//
//		now = H[iN];
//	}
//
//	max_down = std::max(up, max_down);
//
//	cout << max_down << endl;
//}

//int main()
//{
//	int A, B;
//
//	cin >> A >> B;
//
//	long long socket = 1;
//	long long count = 0;
//
//	while (socket < B)
//	{
//		socket = socket - 1 + A;
//		count++;
//	}
//
//	cout << count << endl;
//}

//int main()
//{
//	string S, T;
//
//	cin >> S >> T;
//
//	int hit = 0;
//
//	for (long long iS = 0; iS < 3; iS++)
//	{
//		if (S[iS] == T[iS])
//		{
//			hit++;
//		}
//	}
//
//	cout << hit << endl;
//}


Measured memory_bytes: 256
n = int(input())
x = list(map(int, input().split()))

MaxNum = max(x)

SumEnergy = 0
ans = (100**2)*100

for p in range(-MaxNum, MaxNum+1):
    for a in range(n):
        SumEnergy += (x[a] - p)**2
    ans = min(ans, SumEnergy)
    SumEnergy = 0

print(ans)


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>

using namespace std;
using ll = long long int;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;

bool include(vector<vector<int>> open,vector<int> node){
    for(int i=0;i<open.size();i++){
        if(open[i][0]==node[0] &&open[i][1]==node[1]) return true;
    }
    return false;
}

int main(){
    ll H,W;
    cin>>H>>W;
    vector<vector<bool>> S(H,vector<bool>(W));//space
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            char c;
            cin>>c;
            if(c=='#') S[i][j]=false;
            else S[i][j]=true;
        }
    }
    
    int ans=0;
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(!S[i][j]) continue;
            vector<vector<int>> a(H,vector<int>(W,-1));
            vector<vector<int>> open;
            vector<int> start={i,j,0};
            open.push_back(start);
            while(open.size()>0){
                vector<int> node=open[0];
                open.erase(open.begin());
                if(node[0]>0 && S[node[0]-1][node[1]] && a[node[0]-1][node[1]]==-1 &&!include(open,vector<int>{node[0]-1,node[1],node[2]+1}))
                    open.push_back(vector<int>{node[0]-1,node[1],node[2]+1});
                
                if(node[0]<H-1 && S[node[0]+1][node[1]] && a[node[0]+1][node[1]]==-1&&!include(open,vector<int>{node[0]+1,node[1],node[2]+1}))
                    open.push_back(vector<int>{node[0]+1,node[1],node[2]+1});
                
                if(node[1]>0 && S[node[0]][node[1]-1] && a[node[0]][node[1]-1]==-1&&!include(open,vector<int>{node[0],node[1]-1,node[2]+1}))
                    open.push_back(vector<int>{node[0],node[1]-1,node[2]+1});
                
                if(node[1]<W-1 && S[node[0]][node[1]+1] && a[node[0]][node[1]+1]==-1&&!include(open,vector<int>{node[0],node[1]+1,node[2]+1}))
                    open.push_back(vector<int>{node[0],node[1]+1,node[2]+1});
                a[node[0]][node[1]]=node[2];
                //printf("(%d,%d):%d\n",node[0],node[1],node[2]);
                if(node[2]>ans) ans=node[2];
            }
        }
    }
    
    cout<<ans<<endl;
    
    return 0;
}


Measured memory_bytes: 256
import math
k = int(input())

def gcds(x,y,z):
    n1 = math.gcd(x,y)
    n2= math.gcd(n1,z)
    return n2
total =0
for i in range(1,k+1):
    for j in range(1,k+1):
        if math.gcd(i,j) == 1:
            total += k
        else:
            for t in range(1,k+1):
                total += gcds(i,j,t)
print(total)


Measured memory_bytes: 9172
n = int(input())
a = list(map(int,input().split()))

a.sort()

ans = 0

for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if a[i] + a[j] > a[k] and a[i] != a[j] and a[i] != a[k] and a[j] != a[k]:
                ans += 1

print(ans)

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

int main() {
	ll k, ans = 1;
	cin >> k;
	int seven = 7;
	if(k % 2 == 0) {
		cout << "-1";
		return 0;
	}
	while(seven % k != 0) {
		seven = (seven*10+7) % k;
		ans++;
		if(ans > 1000000) {
			cout << "-1";
					return 0;
		}
	}
	cout << ans;
	return 0;
}


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

class Solve
{
	const int mod = 1000000007;
	static void Main(string[] args)
	{
		string s = Console.ReadLine();
		int N = s.Length;
		long[,] dp = new long[N+1, 13];
		dp[0, 0] = 1;

        for(int i = 0; i < N; i++)
		{
			if (s[i] != '?')
			{
				int sint = s[i] - '0';
                for(int j = 0; j < 13; j++)
				{
					dp[i + 1, (10 * j + sint) % 13] = dp[i, j] % mod;
				}
			}
			else
			{
                for(int j = 0; j <=9; j++)
				{
                    for(int k = 0; k < 13; k++)
					{
						dp[i + 1, (10 * k + j) % 13] += dp[i, k];
						dp[i + 1, (10 * k + j) % 13] %= mod;
					}
				}
			}
		}
		Console.WriteLine(dp[N, 5]);

	}
}

Measured memory_bytes: 21472
import sys
sys.setrecursionlimit(10**6)
MOD=10**9+7
def dfs(v,p):
    if seen[v]:
        return dp[v]
    seen[v]=1
    b,w=1,1
    for nv in G[v]:
        if(nv==p):
            continue
        bw=dfs(nv,v)
        w*=sum(bw);w%=MOD
        b*=bw[1];b%=MOD
    dp[v]=(b,w)
    return (b,w)
    
N=int(input())
G,dp,seen=[],[],[]
for i in range(N):
    G.append([]);dp.append([0,0]);seen.append(0)
for i in range(N-1):
    x,y=map(lambda x:int(x)-1,input().split())
    G[x].append(y)
    G[y].append(x)
print(sum(dfs(0,-1))%MOD)

Measured memory_bytes: 110872
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdint>
#include <bitset>
#include <vector>
#include <thread>
#include <stack>
#include <map>


using namespace std;

int main()
{
	int n, l;
	cin >> n >> l;
	vector<string> vs(n);
	for (int i = 0; i < n; i++)
	{
		cin >> vs[i];
	}
	sort(vs.begin(), vs.end());
	for (auto s : vs)
		cout << s;
}

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

int main(){
	int N, M, C; cin >> N >> M >> C;
	vector<int> B(M);
	vector<vector<int>> A(N, vector<int>(M));
	for(int i = 0; i < M; ++i) cin >> B[i];
	for(int i = 0; i < N; ++i){
		for(int j = 0; j < M; ++j){
			cin >> A[i][j];
		}
	}
	int cnt = 0;
	for(int i = 0; i < N; ++i){
		int ans = C;
		for(int j = 0; j < M; ++j){
			ans += A[i][j] * B[j];
		}
		if(ans > 0) cnt++;
	}
	cout << cnt << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define int long long
#define INF 1000000000000000000
using namespace std;

#define ANS(f) if(f) cout << "YES" << endl; else cout << "NO" << endl;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int, int> Pii;

template<typename T>
void readv(vector<T> &a){ REP(i, a.size()) cin >> a[i]; }
void readi(vector<int> &a){ REP(i, a.size()){cin >> a[i]; a[i]--;} }
void debug(mat m){REP(i, m.size()){ REP(j, m[0].size()){ cout << m[i][j] << ","; } cout << endl; }}

signed main(){

    int N, K; cin >> N >> K;
    vec h(N); readv(h);
    SORT(h);
    int ans = INF;
    REP(i, N - K + 1) ans = min(ans, h[i + K - 1] - h[i]);

    cout << ans;
    
    return 0;
}

Measured memory_bytes: 1024
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<unordered_map>
#include<random>
#include<array>
#include<cassert>
using namespace std;
#define INF ((1<<30)-1)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()




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

	int n;
	cin >> n;
	int ans = 0;
	rep(i, n) {
		int a;
		cin >> a;
		if (i % 2 == 0 && a % 2 == 1)ans++;
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3596
import java.util.Scanner;
import java.math.BigInteger;
public class Main
{
	public static void main( String args[] )
	{
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int m = input.nextInt();
		int l = input.nextInt();
		BigInteger s = BigInteger.valueOf(0);
		int[][] a = new int[111][111];
		int[][] b = new int[111][111];
		for(int i = 0; i < n; i++)
			for(int k = 0; k < m; k++)
				a[i][k] = input.nextInt();
		for(int i = 0; i < m; i++)
			for(int k = 0; k < l; k++)
				b[i][k] = input.nextInt();

		for (int i = 0; i < n; i++){
			for (int k = 0; k < l; k++){
				s = BigInteger.valueOf(0);
				for(int j = 0; j < m; j++){
					s = s.add(BigInteger.valueOf(a[i][j] * b[j][k]));
				}

				if(k == l-1)
					System.out.println(s);
				else
					System.out.print(s + " ");
			}
		}
	}
}

Measured memory_bytes: 105956
#include <iostream>

int main(void){
	int a, b, c, ret;
	std::cin >> a >> b >> c;
	if(a < b){
		if(b < c){ // a < b < c
			ret = a + b;
		}else{	//	a < c < b
			ret = a + c;
		}
	}else{
		if(a < c){ // b < a < c
			ret = a + b;
		}else{	//	b < c < a
			ret = b + c;
		}
	}
	std::cout << ret << '\n';

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std ;
int main()
{
    string s ;
    cin >> s ;
    int f=0;
    for(int i=0;i<2;i++)
    {
        if(s[i]!=s[i+1]){f=1;}
    }
    if(f==1)
    {
        cout << "Yes" << endl;
    }
    else{cout << "No" << endl;}
    return 0 ;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	int n; cin >> n;
	int maxP, minP, maxS, minS;
	maxP = maxS = INT_MIN;
	minP = minS = INT_MAX;
	while (n--) {
		int x, y; cin >> x >> y;
		maxP = max(maxP, x + y);
		minP = min(minP, x + y);
		maxS = max(maxS, x - y);
		minS = min(minS, x - y);
	}
	cout << max(maxP - minP, maxS - minS) << '\n';
    return 0;
}


Measured memory_bytes: 3572
#include <bits/stdc++.h>
#define itn int
#define REP(i, n) for (int i = 0; i < n; i++)
#define IREP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPEACH(i,k) for(auto& i:k)
#define all(a) a.begin(),a.end()
#define MOD 1000000007
using namespace std;
typedef long long ll;

const ll INF = 1LL << 60;


signed main() {
	int n;
	cin >> n;
	vector<int> h(n);
	REP(i,n){
		cin >> h[i];
	}
	reverse(h.begin(),h.end());
	int count=0;
	int ans=0;
	bool now;
	REP(i,n){
		if(h[i]<=h[i+1]){
			count++;
			ans=max(ans,count);
		}
		else{
			count=0;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 640
#include<iostream>
using namespace std;
int main(){
	int a[1001],b[1001];
	long long n,resa=1,resb=1,biggist;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i]>>b[i];
		if((resb+b[i]-1)/b[i]>=(resa+a[i]-1)/a[i]){
			biggist=(resb+b[i]-1)/b[i];
		}else{
			biggist=(resa+a[i]-1)/a[i];
		}
		resa=a[i]*biggist;
		resb=b[i]*biggist;
	}
	cout<<resa+resb;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

using std::string;
using std::vector;
using std::set;
using std::multiset;
using std::unordered_set;
using std::map;
using std::multimap;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>> cpp_dec_float_1000;

constexpr char LF    = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;

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; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }

void solve(void)
{
  string s; cin >> s;
  s[5] = ' ';
  s[13] = ' ';
  cout << s << std::endl;
  return;
}

int main(void)
{
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);

  solve();

  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>

const int nmax = 100005;
std::array<std::vector<int>, nmax> fr;
std::array<std::vector<int>, nmax> block;
std::array<int, nmax> color;
std::vector<int> color_size;

int N, M, K;

void dfs(int u, int group)
{
  std::stack<int> stk;
  stk.push(u);
  color[u] = group;
  color_size.push_back(1);

  while (!stk.empty())
    {
      u = stk.top();
      stk.pop();

      for (int i=0; i<fr[u].size(); ++i)
        {
          auto v = fr[u][i];
          if (color[v] == 0)
            {
              color[v] = group;
              color_size[group]++;
              stk.push(v);
            }
        }
    }
}
void con_comp()
{
  color.fill(0);
  color_size.push_back(0);
  int group = 1;
  for (int i=1; i<=N; ++i)
    {
      if (color[i] == 0)
        {
          dfs(i, group);
          ++group;
        }
    }
}

int fr_cand(int u)
{
  auto cl = color[u];
  auto ans = color_size[cl] - 1;
  for (int i = 0; i < fr[u].size(); ++i) {
    if (color[fr[u][i]] == cl)
      ans--;
  }
  for (int i=0; i<block[u].size(); ++i){
    if (color[block[u][i]] == cl)
      ans--;
  }
  return ans;
}

int main ()
{
  std::cin >> N >> M >> K;

  int a, b;
  for (int i=0; i<M; ++i){
    std::cin >> a >> b;
    fr[a].push_back(b);
    fr[b].push_back(a);
  }

  int c, d;
  for (int i=0; i<K; ++i){
    std::cin >> c >> d;
    block[c].push_back(d);
    block[d].push_back(c);
  }

  con_comp();

  for (int i=1; i<N; ++i)
    std::cout << fr_cand(i) << " ";
  std::cout << fr_cand(N) << std::endl;
}


Measured memory_bytes: 12664
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <utility>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
typedef long long int ll;

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


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sum accumulate
#define keta fixed<<setprecision
#define vvector(name,t,m,n,a)vector<vector<t> > name(m,vector<t> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<int>(n,a)));
int main(){
  int n,m;
  std::cin >> n;
  if(n%2==1){
    std::cout << "No" << std::endl;
    exit(0);
  }else{
    string s;
    std::cin >> s;
    string a,b;
    a=s.substr(0,s.size()/2);
    b=s.substr(s.size()/2,s.size()/2);
    if(a==b)std::cout << "Yes" << std::endl;
    else std::cout << "No" << std::endl;
  }
  
}

Measured memory_bytes: 256
n = gets.to_i
as = gets.chomp.split.map(&:to_i)
flag = true
as.each do |a|
  if a.even?
    if !(a % 3 == 0 || a % 5 == 0)
      flag = false
      break
    end
  end
end
puts flag ? "APPROVED" : "DENIED"

Measured memory_bytes: 1788
n = 2000
mod = 10 ** 9 + 7

fact = [1]
fact_inv = [0] * (n+1)
for i in range(n):
    fact.append(fact[-1] * (i+1) % mod)
fact_inv[-1] = pow(fact[-1], mod-2, mod)
for i in range(n-1, -1, -1):
    fact_inv[i] = fact_inv[i+1] * (i+1) % mod

def mod_comb_k(n, k):
    return fact[n] * fact_inv[k] * fact_inv[n-k] % mod


N, K = map(int, input().split())

for i in range(1, K+1):
    blue = mod_comb_k(K-1, i-1)

    if N - K < i - 1:
        red = 0
    elif N - K == i - 1:
        red = 1
    elif N - K == i:
        if i == 1:
            red = 2
        else:
            red = (mod_comb_k(N-K-1, i-2) + 2) % mod
    else:
        if i == 1:
            red = (2 * mod_comb_k(N-K-1, i-1) % mod + mod_comb_k(N-K-1, i)) % mod
        else:
            red = (mod_comb_k(N-K-1, i-2) + 2 * mod_comb_k(N-K-1, i-1) % mod + mod_comb_k(N-K-1, i)) % mod

    print(blue * red % mod)

Measured memory_bytes: 44016
#include <iostream>
#include <cstdio>
#include <vector>
#define _USE_MATH_DEFINES
#include <math.h>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <stdlib.h>
#include <functional>
#include <string>
#include <list>
#include <fstream>
#include <iomanip>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <chrono>
#include <bitset>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) ((a) <= (x) && (x) <= (b))
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define MODU 1000000007
#define bitcheck(a,b)   ((a >> b) & 1)
#define bitset(a,b)      ( a |= (1 << b))
#define bitunset(a,b)    (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int

#include <nmmintrin.h>
#ifdef _MSC_VER

#define __builtin_popcount _mm_popcnt_u32
#define __builtin_popcountll _mm_popcnt_u64
#endif
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
	std::fill((T*)array, (T*)(array + N), val);
}

struct Edge {
	int from, to;
};

int main() {
	int n, root = 0;
	cin >> n;
	vector<ll> num(n), cn(n);
	vector<vector<Edge>> g(n);
	REP(i, n) {
		scnaf("%lld", &num[i]);
		cn[i] = num[i];
	}
	REP(i, n-1) {
		int a, b;
		scnaf("%d %d", &a, &b);
		a--, b--;
		g[a].push_back({ a,b });
		g[b].push_back({ b,a });
		if (g[a].size() > 1) root = a;
		if (g[b].size() > 1) root = b;
	}

	if (n == 2) {
		if (cn[0] == cn[1]) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
		return 0;
	}

	function<ll(int, int)> imo = [&](int c, int p) {
		ll sum = 0;
		if (g[c].size() == 1) {
			sum = num[c];
		}
		for (auto itr : g[c]) {
			if (itr.to == p) continue;
			sum += imo(itr.to, c);
		}
		cn[c] -= sum;
		return sum;
	};

	imo(root, -1);

	function<pll(int, int)> dfs = [&](int c, int p) {
		ll es = 0;

		if (g[c].size() == 1) {
			return make_pair( num[c], 0LL );
		}
		vector<ll> up;
		for (auto itr : g[c]) {
			if (itr.to == p) continue;
			pll cc;
			cc = dfs(itr.to, c);
			up.push_back(cc.first);
			es += cc.second;
			cn[c] += cc.second * 2;
		}
		ll be = -cn[c];
		ll en = -cn[c], mt = 0;
		if(be < 0) {
			cout << "NO" << endl;
			exit(0);
		}
		ll mx = 0, sm = 0;
		for (auto itr : up) {
			mx = max(mx, itr);
			sm += itr;
		}
		if (mx > sm / 2)
			mx = sm - mx;
		else
			mx = sm/2;

		if (mx < be) {
			cout << "NO" << endl;
			exit(0);
		}

		mt = sm - be * 2;

		return MP(mt, es + be);
	};

	pll ret = dfs(root, -1);

	if (ret.first != 0) {
		cout << "NO" << endl;
	}
	else {
		cout << "YES" << endl;
	}


	return 0;
}

Measured memory_bytes: 21376
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;

int main() {        
    int n, m;
    cin >> n >> m;
    vector<string> a, b;
    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;
        a.push_back(s);
    }
    for (int i = 0; i < m; i++) {
        string s;
        cin >> s;
        b.push_back(s);
    }
    for (int i = 0; i + m - 1 < n; i++) {
        for (int j = 0; j + m - 1 < n; j++) {
            int flag = 1;
            for (int x = 0; x < m; x++) {
                for (int y = 0; y < m; y++) {
                    if (b[x][y] != a[i + x][j + y]) {
                        flag = 0;
                        break;
                    }
                }
            }
            if (flag == 1) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
}


Measured memory_bytes: 3588
import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val a = sc.nextInt()
  val b = sc.nextInt()
  val c = sc.nextInt()

  val tmp = b / a
  if (tmp > c) {
    println(c)
    return
  }
  println(tmp)
}


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

int main()
{
    int n;
    std::cin >> n;
    std::vector<int> a(n);
    for (int i =0;i<n;i++) {
        int tmp;
        std::cin >> tmp;
        a[i] = tmp -1;
    }

    int next = 0;
    int cnt = 0;
    while (1) {
        int now = next;
        if (next == 1) {
            std::cout << cnt << std::endl;
            break;
        }
        if (a[now] >= 0) {
            cnt++;
            next = a[now];
            a[now] = -1;
        } else {
            std::cout << -1 << std::endl;
            break;
        }
    }
    return 0;
}


Measured memory_bytes: 640
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = (l); i < (r); i++)
#define ALL(x) (x).begin(), (x).end()     //昇順
#define RALL(x) (x).rbegin(), (x).rend()  // 降順
const long long mod = 1e9 + 7;
typedef long long ll;
typedef priority_queue<int> PQ;
typedef vector<long long> VL;
typedef vector<bool> VB;
typedef vector<int> VI;  // VI a(n);
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<VS> VSS;
typedef vector<VC> VCC;
typedef vector<VI> VII;  // VII a(n,vector<int>(m)) n * m
typedef vector<VL> VLL;
typedef pair<int, int> PII;
typedef map<int, int> MP;  // MP a;
typedef vector<pair<ll, ll>> PS;

template <class T, class U> bool chmax(T &a, U b) { if (a <= b) {a = b; return 1;} return 0; }
template <class T, class U>  bool chmin(T &a, U b) { if (a > b) { a = b; return 1; } return 0; }
template <typename T>  ostream &operator<<(ostream &os, vector<T> &v) { os << "{"; rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); } os << "}"; return os; }

// g++ -std=c++11 prac.cpp
// operator << (cout,a);
// chmin(min,a)
     
ll n,ans = 0;

void dfs(ll x, ll a, ll b, ll c){
  if(x > n) return;  //終了
  if(a && b && c) ans++; 

  //3,5,7を後ろにつなげていく。
  dfs(x*10+3,1,b,c);
  dfs(x*10+5,a,1,c);
  dfs(x*10+7,a,b,1);
}

int main() {
  ll x=0,y=0,z=0,k,m,h,w,sum=0,Max=-1,Min=1e9+1;
  bool ok = true;
  string t;
  cin >> n;
  dfs(0,0,0,0);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,n) for(int i = 0;i < (int)(n);i++)
#define ALL(a) a.begin(),a.end()
template<class T>inline bool CHMAX(T&a,T b){if(a<b){a = b;return true;}return false;}

signed main(){
	int N;
	cin >> N;
	vector<pair<int,int>>p(N);
	REP(i,N){
		cin>>p[i].first>>p[i].second;
	}
	vector<int>id(N);
	iota(ALL(id),0);
	sort(ALL(id),[&](int a,int b){return atan2(p[a].second,p[a].first)<atan2(p[b].second,p[b].first);});
	int ma = 0;
	REP(i,N){
		int x = 0,y = 0;
		REP(j,N){
			int nj = (i+j)%N;
			x+=p[id[nj]].first;
			y+=p[id[nj]].second;
			CHMAX(ma,x*x+y*y);
		}
	}
	printf("%.20lf\n",sqrt(ma));
}

Measured memory_bytes: 512
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int k= 1;
        HashMap<String,Integer> hashMap = new HashMap<>();
        hashMap.put("SUN",7);
        hashMap.put("MON",6);
        hashMap.put("TUE",5);
        hashMap.put("WED",4);
        hashMap.put("THU",3);
        hashMap.put("FRI",2);
        hashMap.put("SAT",1);
        String s1;
        String s2;
        int a,b;
        double n;
        while(k-->0){
            a=s.nextInt();
            System.out.println(a*a*a);
        }
    }

    private static int binary_search(
            int arr[], int l,
            int h, int x)
    {
        while (l <= h) {
            int mid = (l + h) / 2;
            if (arr[mid] <= x)
                l = mid + 1;
            else
                h = mid - 1;
        }
        return h;
    }
    static int gcd(int a, int b)
    {
        if(b==0) {
            return a;
        }
        return gcd(b,a%b);
    }
    private static boolean isPrime(int n) {
        if (n == 2)
            return true;
        else if ((n % 2 == 0 && n > 2) || n < 2)
            return false;
        else {
            for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {
                if (n % i == 0)
                    return false;
            }
            return true;
        }


    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}

Measured memory_bytes: 27024
using System;

class P
{
  static void Main()
  {
    var a = Console.ReadLine().Split(' ');
    int W = int.Parse(a[0]), H = int.Parse(a[1]), x = int.Parse(a[2]), y = int.Parse(a[3]), r = int.Parse(a[4]);
    Console.WriteLine(x - r < 0 || x + r > W || y - r < 0 || y + r > H ? "No" : "Yes");
  }
}


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

const int N = 50;
int a[N], b[N], c[N], d[N], w[N];
int ans = 0;
int n, m, q;

void rec(int i, int last) {
    if (i == n) {
        int cur = 0;
        for (int i = 0; i < q; i++) {
            if (w[b[i]] - w[a[i]] == c[i])
                cur += d[i];
        }
        ans = max(ans, cur);
    }
    else {
        for (int j = last; j <= m; j++) {
            w[i] = j;
            rec(i + 1, j);
        }
    }
}

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

    cin >> n >> m >> q;

    for (int i = 0; i < q; i++) {
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        a[i]--;
        b[i]--;
    }

    rec(0, 1);

    cout << ans;
    
    return 0;
}

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

using namespace std;
using ll = long long;

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

ll bits[64];
vector<ll> a;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    ll ans = 0;
    cin>>n;
    a.resize(n+5);
    for(int i=0;i<n;i++){
        cin>>a[i];
        ll tmp = a[i];
        int cnt = 0;
        while (tmp > 0) {
            bits[cnt] += tmp % 2;
            tmp /= 2;
            cnt++;
        }
    }
    for(int i=0;i<n;i++) {
        ll tmp = a[i];
        int cnt = 0;
        while (cnt<61) {
            if (tmp % 2) {
                ans += (((1LL << cnt) % MOD) * (n - bits[cnt])) % MOD;
                ans %= MOD;
            } else {
                ans += (((1LL << cnt) % MOD) * (bits[cnt])) % MOD;
                ans %= MOD;
            }
            tmp /= 2;
            cnt++;
        }
    }
    ll diff = MOD-2;
    ll div2 = 1;
    ll crit = 2;
    while(diff>0){
        if(diff%2){
            div2 *= crit;
            div2 %= MOD;
        }
        diff/=2;
        crit = crit * crit;
        crit %= MOD;
    }


    cout<<ans * div2 % MOD;

    return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;
typedef long long ll;

int main(){
  ll x[5];
  ll cnt = 0;
  rep(i,5) cin >> x[i];
  rep(i,5) if(x[i] == 0) cout << i+1 << endl; 
  return 0;
}

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

int n;
struct per
{
	int idx;
	int cnt;
	
	bool operator < (const per& t) const
	{
		return cnt<t.cnt;
	}
}p[500010];

int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>p[i].cnt;
		p[i].idx=i;
	}
	sort(p+1,p+1+n);
	for(int i=1;i<=n;i++)
	{
		if(i!=n)
			cout<<p[i].idx<<" ";
		else
			cout<<p[i].idx<<"\n";	
	}	
	
	return 0;
}

Measured memory_bytes: 1664
//  ROAD TO GREEN
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>
#include <queue>
#include <set>
#include <bitset>

#define ll long long
#define uint unsigned int
#define ull unsigned ll
#define mp make_pair
#define pb push_back
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define speedhack() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);


using namespace std;
const ll MAXN = 2e9+2;
const ll SIZE = 2e5+2;
const ll mod = 1e9+7;
int p[SIZE];

int main(){ 
	speedhack()
	string s; cin >> s;
	int b = (s[2]-'0')*10+(s[3]-'0');
	int a = (s[0]-'0')*10+(s[1]-'0');
	if(a <= 12 && b <= 12 && a >= 1 && b >= 1){
		cout << "AMBIGUOUS" << endl;
	}else if(a <= 12 && a >= 1){
		cout << "MMYY" << endl;
	}else if(b <= 12 && b >= 1){
		cout << "YYMM" << endl;
	}else{
		cout << "NA" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VV(T, a, b, c) vector<vector<T>>(a, vector<T>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define VVV(T, a, b, c, d)                                                     \
  vector<vector<vector<T>>>(a, vector<vector<T>>(b, vector<T>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll N, K;
  cin >> N >> K;
  vl A(N);
  REP(i, N) cin >> A[i];
  // long double po=0;
  FOR(i, K, N) {
    if (A[i - K] < A[i])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 4780
#include<iostream>


using namespace std;

int main(){
    int N;
    cin >> N;
    
    int n = 1;
    while(1){
      n *= 2;
      if(n >= N) break;
    }
    if(n == N) cout << n << endl;
    else cout << n/2 << endl;
    return 0;
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 1000000009
typedef long long ll;
typedef pair<int,int> P;
#define YES(s) s?cout << "YES" << endl:cout << "NO" << endl
#define Yes(s) s?cout << "Yes" << endl:cout << "No" << endl
#define Taka(s) s?cout << "Takahashi" << endl:cout << "Aoki" << endl
#define int ll

signed main(void){
    int N;
    int P[214514];
    cin >> N;
    REP(i,N){
        cin >> P[i];
        if(P[i]>i){
            cout << -1 << endl;
            return 0;
        }
        if(i!=0 && P[i]-P[i-1]>1){
            cout << -1 << endl;
            return 0;
        }
    }
    int Ans=0;
    REP(i,N-1){
        if(P[i]>=P[i+1]){
            Ans+=P[i];
        }
    }
    Ans+=P[N-1];
    cout << Ans << endl;
  return 0;
}


Measured memory_bytes: 1792
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        a: u32,
        b: u32,
        c: u32,
        x: u32,
        y: u32,
    };
    println!(
        "{}",
        (0..if x > y { 2 * x + 1 } else { 2*y + 1 })
            .map(|n| {
                (if x > n / 2 { x - n / 2 } else { 0 }) * a + (if y > n / 2 { y - n / 2 } else { 0 }) * b + n * c
            })
            .min()
            .unwrap()
    );
}


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

using namespace std;

#define pb push_back
#define fi first
#define se second
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define RREP(i, n) FOR(i, n, 0)
#define MFOR(i, m) for(auto i=(m).begin();i!=(m).end();i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())

typedef long long int ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;

const double eps = 1e-10;
const int MOD = 1000000007;

template<typename T>
void printv(vector<T> const& s) {
  REP(i, s.size()) {
    cout << s[i] << " ";
  }
  cout << endl;
}

int main () {
  cin.tie(0);
  cout << setprecision(10);

  int h, w; cin >> h >> w;
  vector<vector<char>> s(h);
  int su = 0;
  REP(i, h) {
    s[i].resize(w);
    REP(j, w) {
      cin >> s[i][j];
      if(s[i][j] == '#') su++;
    }
  }

  vector<vector<int>> d(h);
  REP(i, h) {
    d[i].resize(w, 10000000);
  }
  d[0][0] = 1;

  queue<P> q;
  vector<vector<bool>> upd(h);
  REP(i, h) upd[i].resize(w, false);
  P tmp;
  vector<P> dxy = {P(1, 0), P(-1, 0), P(0, 1), P(0, -1)};
  q.push(P(0, 0));
  while(!q.empty()) {
    tmp = q.front(); q.pop();
    if(upd[tmp.fi][tmp.se]) continue;
    upd[tmp.fi][tmp.se] = true;
    // cout << tmp.fi << ":" << tmp.se << endl;
    int nowx = tmp.fi, nowy = tmp.se;
    int tmpx = 0, tmpy = 0;
    REP(i, 4) {
      tmpx = nowx + dxy[i].fi;
      tmpy = nowy + dxy[i].se;
      if(0 <= tmpx && tmpx <= h-1 &&
         0 <= tmpy && tmpy <= w-1 &&
         s[tmpx][tmpy] == '.') {
        d[tmpx][tmpy] = min(d[tmpx][tmpy], d[nowx][nowy] + 1);
        // cout << tmpx << ":" << tmpy << ":" << d[tmpx][tmpy] << endl;
        q.push(P(tmpx, tmpy));
      }
    }
  }

  if(d[h-1][w-1] == 10000000) cout << -1 << endl;
  else cout << h*w - su - d[h-1][w-1] << endl;
  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  vector<string> v={"Sunny", "Cloudy", "Rainy"};
  string s;
  cin>>s;
  for(int i=0; i<3; i++){
    if(s==v[i]){
      cout<<v[(i+1)%3]<<endl;
    }
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll; 
typedef long double ld;
typedef pair<ll, ll> pll;

const ll N = 2e5 + 30, Mod = 1e9 + 7;
const ll SQ = 330;

int main () {
    ios::sync_with_stdio(0), cin.tie(0);
    ll n, k;
    cin >> n >> k;
    //n = 1e9, k = 3;
   	if (n % k == 0) {
   		return cout << 0, 0;
	}
	while (2 * n >= k) {
		if (n >= k) n %= k;
		else n = abs(n - k);
	}
	cout << n;
    return (0);
}

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

string s;
int n;
int main( ) {
    
    // scanf("%c", &s); 
    // s = getchar();
    cin >> s;
    // n = strlen(s);
    n = s.length();
    // printf("%d\n", n);
    // cout << s.substr(0, (n-1)/2) << endl;
    // cout << s.substr((n+1)/2, n-1) << endl;
    if (s.substr(0, (n-1)/2) == s.substr(((n+1)/2), n-1)){
        // cout << 'Yes' << endl;
        printf("Yes");
    }
    else{
        // cout << 'No' << endl;
        printf("No");
    }
    
    
    
    
    // cout << s << endl;
    // cout << n << endl;
    // cout << s.substr(1, (n-1)/2) << endl;

    return 0;
}

Measured memory_bytes: 256