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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define VIN(v) for(auto&elem_: (v) )cin>>elem_
#define VOUT(v, sep) for(_loop_int idx=0; idx<(_loop_int)v.size(); idx++) {cout<<v[idx]; if(idx<(_loop_int)v.size()-1) cout<<sep;} cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(debugidx,v.size())cout<<" "<<v[debugidx];cout<<endl
#define DEBUG_ARR(v,n) cout<<#v<<":";REP(debugidx,n)cout<<" "<<v[debugidx];cout<<endl

const ll MOD = 1000000007ll;
const int IINF = numeric_limits<int>::max()/2-1;
const ll LINF = numeric_limits<ll>::max()/2-1;

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

#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}

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

    string s,t;
    cin>>s>>t;
    int n = s.size();
    map<char,int> mps;
    vi v(n);
    REP(i,n){
        if(mps[s[i]]==0){
            mps[s[i]]=i+1;
        }
        v[mps[s[i]]-1]++;
    }

    map<char,int> mpt;
    bool flg= true;

    REP(i,n){
        if(mpt[t[i]]==0){
            mpt[t[i]]=i+1;
        }

        v[mpt[t[i]]-1]--;
        if(v[mpt[t[i]]-1]<0) {

            flg = false;
        }
    }



    if(flg) yn;
    return 0;
}

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

using namespace std;


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



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long LL;
typedef long double ld;
typedef vector<ll>VI;
typedef pair<ll,ll>P;
#define VV(T) vector<vector<T>>
#define sz(x) int(x.size())
#define PI 3.1415926535897932384626433832795
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define reprev(i,n) for (ll i=(ll)n-1;i>=0;i--)
#define ALL(a)  (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
#define c_max(a, b) (((ll)a)>((ll)b)?(a):(b))
#define c_min(a,b) (((ll)a)<((ll)b)?(a):(b))
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; }
#define vmax(v) *max_element(ALL(v))
#define vmin(v) *min_element(ALL(v))
#define $(x) {cout<<#x<<" = " <<(x)<<endl;}
#define fi first
#define se second
#define MAX 100100//5
#define MAX2 200100
#define MAX6 1001001//6
#define MAX7 10010010//7
#define SENTINEL 2000000000//9
#define INF 1<<30
#define INFTY 1LL<<61
#define MAX_INT INT_MAX
#define Endl '\n'
#define CLR(mat) memset(mat, 0, sizeof(mat))
inline ll GCD(ll a,ll b){return b?GCD(b,a%b):a;}//最大公約数
inline ll lcm(ll a,ll b){return a*b/GCD(a,b);}//最小公倍数
template<class T> bool contain(const std::string& s, const T& v) {
   return s.find(v) != std::string::npos;
}
const int MOD = 1000000007;
//const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
// vector型から重複を削除 list.erase(unique(ALL(list)),list.end());
// g++ -o a a.cpp -Wall -lm -std=c++17
//push_back -> emplace_back
int main(){
   int x;cin>>x;
   cout<<(!x)<<endl;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;

void solve(long long P, long long Q, long long R){
	cout << min(min(P+Q, Q+R), R+P) << endl;
}

int main(){	
	long long Q;
	long long P;
	long long R;
	scanf("%lld",&P);
	scanf("%lld",&Q);
	scanf("%lld",&R);
	solve(P, Q, R);
	return 0;
}



Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let s: Vec<char> = read::<String>().chars().collect();
    let mut v = vec![0, 0]; // 0101..., 1010...
    for (i, &c) in s.iter().enumerate() {
        if i % 2 == 0 {
            if c == '1' { v[0] += 1; }
            if c == '0' { v[1] += 1; }
        }
        else {
            if c == '1' { v[1] += 1; }
            if c == '0' { v[0] += 1; }
        }
    }
    println!("{}", if v[0] < v[1] { v[0] } else { v[1] });
}


Measured memory_bytes: 4352
#include<iostream>
#include<map>
#include<cstring>
#include<string>
using namespace std;
map<string,int>M;
int main()
{
	string t;
	int n;
	cin>>n;
	getchar();
	for(int i=1;i<=n;++i)
	{
		getline(cin,t);
		if(M.count(t)==0)  M[t]=1;
	}
	cout<<M.size();
	return 0;
 } 

Measured memory_bytes: 19264
#include <stdio.h>
#include <algorithm>
using namespace std;

int main() {
	int n, a, count[100001] = { 0 };
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a);
		count[a]++;
	}

	int max_v = 0;
	for (int i = 1; i <= 99999; i++)
		max_v = max(max_v, count[i - 1] + count[i] + count[i + 1]);

	printf("%d\n", max_v);
}

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

using namespace std;

template <long long Mod> struct ModInt { /* {{{ */
  long long v;
  constexpr ModInt(const long long x = 0) {
    v = x % Mod;
    if (v < 0) {
      v += Mod;
    }
  }
  constexpr ModInt operator+(const ModInt rhs) const { return ModInt(*this) += rhs; }
  constexpr ModInt operator-(const ModInt rhs) const { return ModInt(*this) -= rhs; }
  constexpr ModInt operator*(const ModInt rhs) const { return ModInt(*this) *= rhs; }
  constexpr ModInt operator/(const ModInt rhs) const { return ModInt(*this) /= rhs; }
  const ModInt &operator+=(const ModInt rhs) {
    v += rhs.v;
    if (v >= Mod) {
      v -= Mod;
    }
    return *this;
  }
  constexpr ModInt &operator-=(const ModInt rhs) {
    if (v < rhs.v) {
      v += Mod;
    }
    v -= rhs.v;
    return *this;
  }
  constexpr ModInt &operator*=(const ModInt rhs) {
    v = v * rhs.v % Mod;
    return *this;
  }
  constexpr ModInt &operator/=(ModInt rhs) {
    long long exp = Mod - 2;
    while (exp) {
      if (exp & 1) {
        *this *= rhs;
      }
      rhs *= rhs;
      exp >>= 1;
    }
    return *this;
  }
  friend ostream &operator<<(ostream &s, ModInt<Mod> m) {
    s << m.v;
    return s;
  }
  friend istream &operator>>(istream &s, ModInt<Mod> m) {
    s >> m.v;
    return s;
  }
}; /* }}} */

const int mod = 1e9 + 7;
using modint = ModInt<mod>;

int main() {
  int N, K;
  cin >> N >> K;
  vector<modint> accum(N + 5);
  for (int i = 1; i <= N; i++) {
    accum[i] = accum[i - 1] + i;
  }
  modint ans = 0;
  for (int k = K; k <= N + 1; k++) {
    if (k == N + 1) {
      ans += 1;
    } else {
      ans += accum[N] - accum[N - k] - accum[k - 1] + 1;
    }
  }
  cout << ans << endl;

  return 0;
}
/* vim:set fdm=marker: */


Measured memory_bytes: 4832
hoge = str(input())
list_hoge = list(hoge)
n = list_hoge.count("N")
s = list_hoge.count("S")
e = list_hoge.count("E")
w = list_hoge.count("W")
ans = "Yes"
if n+s != 0:
    if n == 0 or s == 0:
        ans ="No"
    else:
         pass
else:
    pass

if e+w != 0:
    if e == 0 or w == 0:
        ans = "No"
    else:
        pass
else:
    pass

print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) if(a){cout<<"Yes"<<endl;}else cout<<"No"<<endl;//条件によってYes、Noを出力する

int main(){
    int64_t n,a,b;
    cin>>n>>a>>b;
    int64_t sum=0;
    sum += n/(a+b) * a;
    n -= (n/(a+b))*(a+b);
    sum += min(n,a);
    cout<<sum<<endl;
}

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

int a[100100];
long long dp[100100];

int main() {
	int n, k;
	cin >> n >> k;

	for (int i = 0; i < n; i++) cin >> a[i];
	for (int i = 0; i < n; i++) dp[i] = 1e18;
	dp[0] = 0;
	for (int i = 1; i < n; i++) {
		for (int j = k; j > 0; j--)
			if (i - j >= 0) dp[i] = min(dp[i], dp[i - j] + abs(a[i] - a[i - j]));
	}

	cout << dp[n - 1];

	return 0;
}

Measured memory_bytes: 1408
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>

using namespace std;


void solve() {
    string T; cin >> T;
    for (int i = 0; i < T.length(); i++) {
        if (T[i] == '?') T[i] = 'D';
    }

    cout << T << endl;
}


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

Measured memory_bytes: 3756
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=2000000000;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll p=880301;
//const ll P=31;
/*
ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		else a=a*a%MOD;
		b>>=1;
	}
	return res;
}
*/
int main()
{
	IOS;
	int n;
	cin>>n;
	int cnt=0;
	REP(i,n){
		int x;
		cin>>x;
		cnt+=x%2;
	}
	if(cnt%2) cout<<"NO\n";
	else cout<<"YES\n";
	return 0;   
}


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

using namespace std;

int64_t DP[101][4][4][4];
int A = 0, C = 1, G = 2, T = 3;

bool is_AGC(int a, int b, int c){
    return a == A and b == C and c == G;
}

bool check(int a, int b, int c, int d){
    if (is_AGC(b, c, d) or is_AGC(c, b, d) or is_AGC(b, d, c))
        return true;
    if (is_AGC(a, b, d) or is_AGC(a, c, d))
        return true;
    return false;
}

int main(){
    int n, p = int(1e9 + 7);
    cin >> n;
    int64_t ans = 0;
    DP[0][T][T][T] = 1;
    for (int i = 0; i < n; i++){
        for (int a = 0; a < 4; a++){
            for (int b = 0; b < 4; b++){
                for (int c = 0; c < 4; c++){
                    for (int d = 0; d < 4; d++){
                        if (check(a, b, c, d))
                            continue;
                        DP[i + 1][b][c][d] += DP[i][a][b][c];
                        DP[i + 1][b][c][d] %= p;
                    }
                }
            }
        }
    }

    for (int a = 0; a < 4; a++){
        for (int b = 0; b < 4; b++){
            for (int c = 0; c < 4; c++){
                ans += DP[n][a][b][c];
                ans %= p;
            }
        }
    }

    cout << ans << endl;

}

Measured memory_bytes: 256
n,a,b,c=map(int,input().split())
l=[]
for _ in range(n):
        l.append(int(input()))
        

def dfs(depth,aa,bb,cc):
        if depth==n:
                #最初の1本の合体コストは無しなので30減らしておく
                ret=abs(a-aa)+abs(b-bb)+abs(c-cc)-30
                if min(aa,bb,cc)>0:
                        return ret
                else:
                        return 10**9+7
        ause=dfs(depth+1,aa+l[depth],bb,cc)+10
        buse=dfs(depth+1,aa,bb+l[depth],cc)+10
        cuse=dfs(depth+1,aa,bb,cc+l[depth])+10
        nonuse=dfs(depth+1,aa,bb,cc)
        return min(ause,buse,cuse,nonuse)

print(dfs(0,0,0,0))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define maxn 200005

ll fastpower (ll b , ll p){
    ll k= p%2 ? b : 1 ;
    return p==0 ? 1 : k*(fastpower(b*b,p/2));
}

//int v1[105],v2[105];

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll t=1;
	//cin>>t;
	while(t--){
		ll n;
		cin>>n;
		if(n<30) cout<<"No\n";
		else cout<<"Yes\n";
	}
}

Measured memory_bytes: 3580
#include<stdio.h>
int main(void)
{
	int W,H,x,y,r;
	scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
	if(x-r >= 0 && x+r <= W){
		if(y-r >= 0 && y+r <= H){
			printf("Yes\n");
		}else{
			printf("No\n");
		}
	}else{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 584
var toInt = x=>parseInt(x,10);
var toIntArr = arr=>arr.map(x=>toInt(x));
var abs = x=>x>0?x:-x;
function min(){var rest=arguments,v=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]<v)v=rest[i];return v}
function max(){var rest=arguments,v=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]>v)v=rest[i];return v}
function gcd(){var rest=arguments,v=rest[0],temp=(a,b)=>b?temp(b,a%b):a;for(var i=1;i<rest.length;i++)v=temp(v,rest[i]);return v}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
 
function Main(input){
	var input = input.split('\n');
	var n = toInt(input[0]);
	var vs = toIntArr(input[1].split(' '));
	var odd = [];
	var even = [];
	for(var i = 0; i < n; i++){
		if(i%2===1){
			even[vs[i]] = !even[vs[i]]? 1: even[vs[i]] + 1; 
		}else{
			odd[vs[i]] = !odd[vs[i]]? 1: odd[vs[i]] + 1; 
		}
	}
	var xs = odd.map((e,ind,arr)=>({el:e,ind:ind})).filter(el=>el.el>0).sort((a,b)=>b.el-a.el);
	var ys = even.map((e,ind,arr)=>({el:e,ind:ind})).filter(el=>el.el>0).sort((a,b)=>b.el-a.el);
	var ans = 0;
	if(xs[0].ind === ys[0].ind){
		if(xs.length === 1){
			if(ys.length === 1){
				ans = n/2;
			}else{
				ans = n/2 - ys[1].el;
			}
		}else{
			if(ys.length === 1){
				ans = n/2 - xs[1].el;
			}else{
				ans = min(n - xs[0].el - ys[1].el, n - xs[1].el - ys[0].el);
			}
		}
	}else{
		ans = n - xs[0].el - ys[0].el;
	}

	console.log(ans);
	return 0;
}



Measured memory_bytes: 44916
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/*Atcoder用
 * 		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] tmp = br.readLine().split(" ");
		int a = Integer.parseInt(tmp[0]);
		int b = Integer.parseInt(tmp[1]);
		int c = Integer.parseInt(tmp[2]);


		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String get = br.readLine();
		char[] s = get.toCharArray();
		for(char c:s)System.out.println(c);

		List<Integer> ls = new ArrayList<Integer>();
		String[] tmp = br.readLine().split(" ");
		for (int n = 0; n < N; n++) {
			ls.add(Integer.parseInt(tmp[n]));
		}
 */

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String tmp = br.readLine();
		int a = Integer.parseInt(tmp);

		List<Integer> ls = new ArrayList<Integer>();
		String[] tmp2 = br.readLine().split(" ");
		for (int n = 0; n < tmp2.length; n++) {
			ls.add(Integer.parseInt(tmp2[n]));
		}
		int i = Collections.max(ls) - Collections.min(ls);

		System.out.println(i);
	}
}

Measured memory_bytes: 23124
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int p[] = new int[N];

		for (int i=0; i<N; i++){
			p[i] = sc.nextInt();
		}

		if (judge(p)){
			System.out.println("YES");
			return;
		}

		for (int i=0; i<N; i++){
			for (int j=i+1; j<N; j++){
				if (p[i] > p[j]){
					if (judge(swap(i, j, p))){
						System.out.println("YES");
						return;
					}
				}
			}
		}
		System.out.println("NO");
	}

	public static boolean judge(int[] p){
		boolean result = true;
		for (int i=0; i<p.length-1; i++){
			if (p[i] > p[i+1]){
				result = false;
				break;
			}
		}
		return result;
	}

	public static int[] swap(int a, int b, int[]p){
		int result[] = p.clone();
		result[a] = p[b];
		result[b] = p[a];
		return result;
	}

}

Measured memory_bytes: 21844
N, K = map(int, input().split())
a = []
for _ in range(N):
    a.append(int(input())-K)
    
su = 0
v = [(0, 0)]
for i in range(N):
    su += a[i]
    v.append((su, i+1))
v = sorted(v)

data = [0]*(N+5)

def sumation(i):
    s = 0
    while i > 0:
        s += data[i]
        i -= i & -i
    return s
    
def add(i, x):
    while i <= N+2:
        data[i] += x
        i += i & -i
ans = 0
for e, i in v:
    ans += sumation(i+1)
    add(i+1, 1)
    
print(ans)

Measured memory_bytes: 42276
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  long long L[100];
  long long answer=0;
  for(int i=0;i<N;i++) cin>>L[i];
  for(int i=0;i<N-2;i++){
    for(int j=i+1;j<N-1;j++){
      for(int k=j+1;k<N;k++){
        if(L[i]!=L[j]&&L[j]!=L[k]&&L[k]!=L[i]){
          if(L[i]+L[j]>L[k]&&L[j]+L[k]>L[i]&&L[k]+L[i]>L[j]) answer++;
        }
      }
    }
  }
  cout<<answer<<endl;
  
  return 0;
}

Measured memory_bytes: 3196
#include <bits/stdc++.h>
#define REP(i, a, b) for (ll i = (a); i < (b); ++i)

using namespace std;
using ll = long long;

/**
 * main
 */
int main () {
  ll X; cin >> X;
  ll Y; cin >> Y;
  ll A; cin >> A;
  ll B; cin >> B;
  ll C; cin >> C;

  priority_queue<ll> P;
  priority_queue<ll> Q;
  priority_queue<ll> R;

  REP(i, 0, A) {
    ll input; cin >> input;
    P.push(input);
  }

  REP(i, 0, B) {
    ll input; cin >> input;
    Q.push(input);
  }

  REP(i, 0, C) {
    ll input; cin >> input;
    R.push(input);
  }

  vector<ll> v;

  REP(i, 0, X) {
    v.push_back(P.top()); P.pop();
  }

  REP(i, 0, Y) {
    v.push_back(Q.top()); Q.pop();
  }

  while (!R.empty()) {
    v.push_back(R.top()); R.pop();
  }

  sort(v.begin(), v.end(), greater<ll>());

  ll ans = 0;

  REP(i, 0, X + Y) ans += v.at(i);

  cout << ans << endl;
}


Measured memory_bytes: 8560
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <cassert>
#define rep(i, n) for(i = 0; i < n; i++)
#define int long long
using namespace std;

signed main() {
	int a, b, c, d, k;
	cin >> a >> b >> c >> d >> k;
	
	int m1 = a * 60 + b;
	int m2 = c * 60 + d;
	cout << m2 - m1 - k << endl;
	
	return 0;
}

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

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

    cout << ceil((a + b) / 2.0) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <algorithm>
#include <cassert>

using namespace std;


bool solve(){
	int dx1[] = {0, 1, 0, -1, 0};
	int dy1[] = {0, 0, 1, 0, -1};
	int dx2[] = {0, 0, 0, 1, 1, 1, -1, -1, -1};
	int dy2[] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
	int dx3[] = {0, 0, 0, 0, 0, 1, 1, 1, 2, -1, -1, -1, -2};
	int dy3[] = {-2, -1, 0, 1, 2, -1, 0, 1, 0, -1, 0, 1, 0};

	int a[14][14] = {0};
	int x, y, size;
	char c[2];
	while(cin>>x){
		cin>> c[0]>> y>> c[1]>> size;
		x += 2;
		y += 2;
		switch(size){
			case 1:
				for(int i=0;i<5;i++){
					a[x+dx1[i]][y+dy1[i]]++;
				}
				break;
			case 2:
				for(int i=0;i<9;i++){
					a[x+dx2[i]][y+dy2[i]]++;
				}
				break;
			case 3:
				for(int i=0;i<13;i++){
					a[x+dx3[i]][y+dy3[i]]++;
				}
				break;
			default: 
				cout<< "default"<< endl;
				break;
		}
	}
	int ans = 0;
	int ans2 = 0;
	for(int i=2;i<12;i++){
		for(int j=2;j<12;j++){
			if(a[i][j] == 0) ans++;
			ans2 = max(ans2, a[i][j]);
		}
	}
	cout<< ans<< endl;
	cout<< ans2<< endl;
	
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	solve();

	return 0;
}

 

Measured memory_bytes: 1164
def main():
  a, b, c, d = tuple([int(e) for e in input().split()])

  s = [b, d]
  h = [c, a]
  idx = 0
  while h[0] > 0 and h[1] > 0:
    h[idx] -= s[idx]
    idx ^= 1
  
  if h[1] > 0:
    print('Yes')
  else:
    print('No')
  return 0

main()

Measured memory_bytes: 61872
answer = 0


def main():
    n, m, q = map(int, input().split())
    a = []
    b = []
    c = []
    d = []
    for i in range(q):
        aa, bb, cc, dd = map(int, input().split())
        a.append(aa)
        b.append(bb)
        c.append(cc)
        d.append(dd)

    global answer

    def dfs(seq):
        if len(seq) == n + 1:
            global answer
            now = 0
            for i in range(q):
                if seq[b[i]] - seq[a[i]] == c[i]:
                    now += d[i]
            answer = max(answer, now)
            return
        else:
            for i in range(seq[-1], m + 1):
                dfs(seq + [i])

    dfs([1])
    global answer
    print(answer)


if __name__ == '__main__':
    main()



Measured memory_bytes: 9188
n=int(input())
b=[]
r=[]
for i in range(n):
    b.append(input())

m=int(input())
for i in range(m):
    r.append(input())

ans=0
for word in b:
    tmp=0
    for j in range(len(b)):
        if b[j]==word:
            tmp+=1
    for j in range(len(r)):
        if r[j]==word:
            tmp-=1
    if tmp>ans:
        ans=tmp
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define rep(i, n)   for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main(){
    int x, y;
    cin >> x >> y;
    int a = 4*x-y;
    int b = y-2*x;
    if(a >= 0 && b >= 0 && a%2 == 0 && b%2 == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}


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

long long GCD(long long a, long long b) 
{ 
    if(b==0) 
        return a; 
    return GCD(b, a%b);  
      
}

long long LCM(long long a, long long b)
{
    long long gcd=GCD(a,b);
     return (a*b)/gcd;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    long long i, j, k, n, m, t, x, y, z, s=0, c=0, l;
    cin >> n;
    for(i=1; i<=n; i++)
    {
        cin >> x;
        if(i%2==1 && x%2==1)
            s++;
    }
    cout << s << endl;
}


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

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

using ll = long long;

using namespace std;

int main() {
  in(int, n, k);
  in(string, s);
  vector<pair<bool, int>> v;
  int l = -1;
  dbg(s);
  rep(i, n) if (i + 1 == n || s[i] != s[i + 1]) {
    bool zero = s[i] == '0';
    v.push_back({zero, i - l});
    l = i;
    // dbg(v.back());
  }
  queue<pair<bool, int>> q;
  int sum = 0;
  int ans = 0;
  for (auto [zero, cnt] : v) {
    sum += cnt;
    if (zero) --k;
    q.push({zero, cnt});
    while (k < 0) {
      auto [z, c] = q.front();
      q.pop();
      sum -= c;
      if (z) ++k;
    }
    ans = max(ans, sum);
  }
  out(ans);
}


Measured memory_bytes: 4544
#include<stdio.h>
int main(void)
{
	int i,n,a[101],m[10],y,z;
	scanf("%d",&n);
	y=0;
	z=0;
	for(i=0;i<8;i++) m[i]=0;
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		if(a[i]>=1 && a[i]<400){
			if(m[0]==0) z++;
			m[0]=1;
		}
		else if(a[i]>=400 && a[i]<800){
			if(m[1]==0) z++;
			m[1]=1;
		}
		else if(a[i]>=800 && a[i]<1200){
			if(m[2]==0) z++;
			m[2]=1;
		}
		else if(a[i]>=1200 && a[i]<1600){
			if(m[3]==0) z++;
			m[3]=1;
		}
		else if(a[i]>=1600 && a[i]<2000){
			if(m[4]==0) z++;
			m[4]=1;
		}
		else if(a[i]>=2000 && a[i]<2400){
			if(m[5]==0) z++;
			m[5]=1;
		}
		else if(a[i]>=2400 && a[i]<2800){
			if(m[6]==0) z++;
			m[6]=1;
		}
		else if(a[i]>=2800 && a[i]<3200){
			if(m[7]==0) z++;
			m[7]=1;
		}
		else if(a[i]>=3200){
			y++;
		}
	}
	if(z==0 && y>=1){
		y=y+z;
		z=1;
	}
	else y=y+z;
	printf("%d %d\n",z,y);
	return 0;
}

Measured memory_bytes: 128
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rrep(i, n) for (ll i = n - 1; i >= 0; i--)
#define Rep(i, r, n) for (ll i = r; i < n; i++)
#define RRep(i, r, n) for (ll i = n - 1; i <= r; i--)
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define int long long
#define pb push_back
#define mp make_pair
const int dx[] = {0, -1, 0, 1};
const int dy[] = {1, 0, -1, 0};
const int MOD = (1000000007);
//const int MOD = (998244353);
//const int INF = (1 << 30)-1;
const int INF = (1LL << 60)-1;
const double EPS = (1 >> 30);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}

using Graph = vector<vector<pair<int, int>>>;
using Ki = vector<vector<int>>;
using Vi = vector<int>;

int bar[51];
int par[51];

int saiki(int n,int x,int ans){
    //debug(n);
    //debug(x);
    //debug(ans);
    //debug(bar[n]);
    //ans%=MOD;
    if(n==1){
        if(x==1) return ans;
        else if(x==2) return ans+1;
        else if(x==3) return ans+2;
        else if(x==4) return ans+3;
        else if(x==5) return ans+3;
    }
    if(x==1){
        return ans;
    }
    else if(x==bar[n]){
        ans+=2*par[n-1]+1;
        return ans;
    }
    else if(x==bar[n]/2+1){
        ans+=par[n-1]+1;
        return ans;
    }
    else if(x<bar[n]/2+1){
        x--;
    }
    else{
        ans+=par[n-1]+1;
        x-=bar[n]/2+1;
    }
    n--;
    return saiki(n,x,ans);
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
    //---------------------------------------------
    
    int n,x;
    cin>>n>>x;
    bar[0]=1;
    for(int i=1;i<=50;i++){
        bar[i]=1+bar[i-1]+1+bar[i-1]+1;
    }
    par[0]=1;
    for(int i=1;i<=50;i++){
        par[i]=par[i-1]*2+1;
    }
    int ans=0;
    int memo = saiki(n,x,ans);
    cout<<memo<<endl;
}


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

void showVector(std::vector<int> readVec){
    int size = readVec.size();
    for(int i = 0; i < size; ++i){
        std::cout << readVec.at(i);
        if(size - 1 != i){
            std::cout << " ";
        }else{
            std::cout << std::endl;
        }
    }
}

int selectionSort(std::vector<int> &readVec){
    int n = readVec.size();
    int index, count = 0;
    for(int i = 0; i < n; ++i){
        int index = i;
        for(int j = i; j < n; ++j){
            if(readVec.at(j) < readVec.at(index)){
                index = j;
            }
        }

        if(index != i){
            readVec.at(i) += readVec.at(index);
            readVec.at(index) = readVec.at(i) - readVec.at(index);
            readVec.at(i) = readVec.at(i) - readVec.at(index);
            ++count;
        }
    }
    
    return count;
}


int main(){
    int n;
    std::cin >> n;

    std::vector<int> a(n);
    for(int i = 0; i < n; ++i){
        std::cin >> a.at(i);
    }

    int count = selectionSort(a);
    showVector(a);
    std::cout << count << std::endl;

    return 0;
}



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

namespace AtCoders {
	class Program {
		static void Main(string[] args) {
var stationStrings = Console.ReadLine();
			if(stationStrings.Length != 3) {
				Console.WriteLine("invalid input");
				return;
			}

			var numB = stationStrings.Length - stationStrings.Replace("B", "").Length;

			if(numB == 0 | numB == 3){
				Console.WriteLine("No");
			}else{
				Console.WriteLine("Yes");

			}


		}
	}
}


Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define eps 1e-9
#define maxp 100000000000000000000
#define mod 1000000007
#define pi 3.141592653589793238
#define sin(s) scanf("%lld",&s);
#define sout(s) printf("%lld\n",s);
#define in(s) cin>>s
#define in2(a,b) cin>>a>>b
#define in3(a,b,c) cin>>a>>b>>c
#define vll vector<ll>
#define out(s) cout<<s
#define outs(s,a) cout<<s<<a
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define gear_change ios_base::sync_with_stdio(false),cin.tie(0)
#define nfl(i,n) for(i=0;i<n;i++)
#define sfl(i,s,e) for(i=s;i<e;i++)
#define ufl(i,n) for(i=n-1;i>=0;i--)
void solve(){
	ll n,i;
	in(n);
	map<string,ll>mp;
	ll mx=INT_MIN;
	nfl(i,n){
		string str;
		in(str);
		mp[str]++;
		mx=max(mx,mp[str]);
	}
	vector<string>vec;
	for(auto it:mp){
		if(it.S==mx){
			vec.pb(it.F);
		}
	}
	sort(vec.begin(), vec.end());
	for(auto it:vec){
		cout<<it<<"\n";
	}
}	
int main(){
	clock_t t1=clock();
	gear_change;
	ll test=1;
	// in(test);
	while(test--){
		solve();
	}
	clock_t t2=clock();
	cerr<<"Time elapsed:- "<<(double)(t2-t1)/CLOCKS_PER_SEC<<'\n';
}	


Measured memory_bytes: 25584
//****************************//
/**********  main *************/
//****************************//
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
#include <math.h> 

using namespace std;
typedef long long ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define REP(i, n) for (i = 0; i < n; i++)
#define FOR(i, a, b) for (i = a; i < b; i++)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())

int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

int main()
{

    std::cin.tie(0);

    int n ;
    int res;
    cin >> n ;

    res = n%10;
    
    if(res==2 || res==4 || res==5 || res==7 || res==9) (cout<< "hon" << endl);
    if(res==0 || res==1 || res==6 || res==8) (cout<< "pon" << endl);
    if(res==3) (cout<< "bon" << endl);

    return 0;

}



Measured memory_bytes: 3636
import sys
from heapq import heappush, heappop
stdin = sys.stdin

 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())


def dijkstra(graph:list, node:int, start:int) -> list:
    # 未探索のノードは距離INF
    INF = float("inf")
    dist = [INF]*node
    
    # 始点ノードの距離を0とし、dfsのためのpriority queを作成
    dist[start] = 0
    heap = [(0,start)]
    
    # 未探索のノードをpriority queueに入れる
    while heap:
        cost, cur_node = heappop(heap)
        
        for nex_cost, nex_node in graph[cur_node]:
            dist_cand = dist[cur_node] + nex_cost
            if dist_cand < dist[nex_node]:
                dist[nex_node] = dist_cand
                heappush(heap, (dist[nex_node], nex_node))
    
    return dist

h,w = li()
graph = [[] for _ in range(10)]

for i in range(10):
    d = list(li())
    for j,dj in enumerate(d):
        graph[i].append((dj,j))
        
a = [list(li()) for _ in range(h)]

dist = [0]*10
for i in range(10):
    dist[i] = dijkstra(graph,10,i)[1]

ans = 0
for row in range(h):
    for col in range(w):
        if a[row][col] != -1:
            ans += dist[a[row][col]]
            
print(ans)

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

#define lint long long
#define P pair<int, int>
#define LLP pair<long long, long long>
#define REP(i, x, n) for(int i = (x), i##_len = int(n) ; i < i##_len ; ++i)
#define rep(i, n) for(int i = 0, i##_len = int(n) ; i < i##_len ; ++i)
#define reps(i, n) for(int i = 1, i##_len = int(n) ; i <= i##_len ; ++i)
#define rrep(i, n) for(int i = int(n) - 1 ; i >= 0 ; --i)
#define rreps(i, n) for(int i = int(n) ; i > 0 ; --i)
#define SORT(x) sort((x).begin(), (x).end())
#define SORT_INV(x) sort((x).rbegin(), (x).rend())

const int IINF = (1 << 30) - 1;
const long long LLINF = 1LL << 61;
const long long MOD = 1000000007LL;
const int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};
const double EPS = 1e-8;

template<typename T>
bool chmax(T &_a, T _b){
    if(_a < _b){
        _a = _b;
        return true;
    }else{
        return false;
    }
}

template<typename T>
T gcd(T _x, T _y){
    T _r = _x % _y;
    while(_r != (T)0){
        _x = _y;
        _y = _r;
        _r = _x % _y;
    }
    return _y;
}

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

    int n;
    cin >> n;

    vector<lint> s(n);
    rep(i, n){
        cin >> s[i];
    }

    lint ans = 0;

    vector<int> flag(n, 0);
    REP(k, 1, n){
        lint val = 0;
        int left = k, right = n + ~k, st = 1;
        while(left < n){
            if(flag[left] == k || flag[right] == k || left == right){
                break;
            }
            flag[left] = k;
            flag[right] = k;
            val += s[left] + s[right];
            int a = right, b = a - k;
            if(a > b && b > 0){
                chmax(ans, val);
            }
            left += k;
            right -= k;
            ++st;
        }
    }

    cout << ans << endl;

    return 0;
}

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

int A,B;

int main(){
	
  	cin >> A >> B;
	
	if(A == 1) A += 13;
	if(B == 1) B += 13;  	

	if( A < B )cout << "Bob" << endl;
    else if( A == B)cout << "Draw" << endl;
    else cout << "Alice" << endl;

}

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

using namespace std;

int main()
{
    int n;

    int max_gcd = 0, part;

    cin >> n;
    
    vector<int> a(n), l(n+1), r(n+1);

    for(int i=0; i<n; i++) cin >> a[i];

    for(int i=0; i<n; i++)
    {
        l[i+1] = __gcd(l[i],a[i]);
    }

    for(int i=n-1; i>=0; i--)
    {
        r[i] = __gcd(r[i+1],a[i]);
    }

    for(int i=0; i<n; i++)
    {
        part = __gcd(l[i],r[i+1]);

        max_gcd = max(max_gcd,part);
    }

    cout << max_gcd << endl;
}


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

class Proc{
public:
    string nam;
    int tim;
    Proc(){nam="";tim==0;}
};
Proc Q[100001];

class Queue{
private:
    int fp,rp;
public:
    Queue()                 {fp=0;rp=0;}
    int next(int p) const   {return (p+1)%100001;}
    bool isFull()   const   {return (next(rp)==fp);}
    bool isEmpty()  const   {return (rp==fp);}
    void push(Proc d);
    Proc front();
    void pop();
};
void Queue::push(Proc d){
    if(isFull()){return;}
    Q[rp]=d;
    rp=next(rp);
}
Proc Queue::front(){
    if(isEmpty()){
        Proc er;
        er.tim=-1;
        return er;
    }
    return Q[fp];
}
void Queue::pop(){
    if(isEmpty()){return;}
    fp=next(fp);
}

int main(){
    Queue que;
    int n,q;
    cin>>n>>q;
    for(int i=0;i<n;i++){
        Proc p;
        cin>>p.nam>>p.tim;
        que.push(p);
    }
    int total_tim=0;
    while(!que.isEmpty()){
        Proc p=que.front();   que.pop();
        if(p.tim<=q){
            total_tim+=p.tim;
            cout<<p.nam<<" "<<total_tim<<endl;
        }else{
            total_tim+=q;
            p.tim-=q;
            que.push(p);
        }
    }
    return 0;
}


Measured memory_bytes: 6908
n, k = map(int, input().split())
p = list(map(int, input().split()))
l = [(i + 1) / 2 for i in p]
now = ans = sum(l[:k])

for i in range(1, n - k + 1):
    now += l[i + k - 1] - l[i - 1]
    ans = max(ans, now)

print(ans)

Measured memory_bytes: 32164
#C問題

#ループ処理をスキップするコード→break,continue,return(関数方式)
x, n = map(int, input().split())
P = list(map(int, input().split()))
xm = x 
xM = x

for i in range(0,100):
    if n == 0:
        print(x)
        break
    xm = x - i
    xM = x + i
    mcounter = 0
    Mcounter = 0
    for j in range(len(P)):
        if xm == P[j]:
            mcounter += 1000
        if xM == P[j]:
            Mcounter += 1000
    if mcounter < 1000:
        print(xm)
        break
    if Mcounter < 1000:
        print(xM)
        break

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

int main() {
    ll N, M;
    cin >> N >> M;
    ll MOD = pow(10, 9) + 7;
    ll res = 1;
    if (abs(N - M) == 1) {
        ll maxn = max(N, M);
        ll minn = min(N, M);
        while (minn >= 1) {
            res *= (maxn * minn) % MOD;
            maxn--;
            minn--;
            res %= MOD;
        }
    } else if (abs(N - M) == 0) {
        while (N >= 1) {
            res *= (N * M) % MOD;
            N--;
            M--;
            res %= MOD;
        }
        res = (res * 2) % MOD;
    } else {
        res = 0;
    }

    cout << res << endl;
}

Measured memory_bytes: 256
// 2020-09-27 19:14:18
// clang-format off
#include <bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = long long;
using ld = long double;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
using P = pair<int, int>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }
// #include <atcoder/convolution>
// #include <atcoder/dsu>
// #include <atcoder/fenwicktree>
// #include <atcoder/lazysegtree>
// #include <atcoder/math>
// #include <atcoder/maxflow>
// #include <atcoder/mincostflow>
// #include <atcoder/modint>
// #include <atcoder/scc>
// #include <atcoder/segtree>
// #include <atcoder/string>
// #include <atcoder/twosat>
// #include <atcoder/all>
// using namespace atcoder;

// clang-format on
void answer() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n + 1);
  rep(i, n) cin >> a[i + 1];
  REPC(i, k + 1, n) {
    if (a[i - k] < a[i]) {
      cout << "Yes" << '\n';
    } else {
      cout << "No" << '\n';
    }
  }
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

Measured memory_bytes: 3984
package main
 
import (
	"bufio"
	"fmt"
	"os"
)
 
func main() {
	var scanner = bufio.NewScanner(os.Stdin)
 	buf := make([]byte, 0)
	scanner.Buffer(buf, 1000000009)
	scanner.Split(bufio.ScanWords)
 
	var s, t string
	if scanner.Scan() {
		s = scanner.Text()
	}
	if scanner.Scan() {
		t = scanner.Text()
	}
 
	c := 1
	m1 := map[byte]int{}
	m2 := map[byte]int{}
 
	for i := 0; i < len(s); i++ {
		if m1[s[i]] == 0 {
			if m2[t[i]] == 0 {
				m1[s[i]] = c
				m2[t[i]] = c
				c++
			} else {
				fmt.Println("No")
				return
			}
		} else {
			if m1[s[i]] != m2[t[i]] {
				fmt.Println("No")
				return
			}
		}
	}
	fmt.Println("Yes")
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
//#pragma GCC optimize "-O3"
typedef unsigned long long ull;
typedef unsigned int ui;
typedef unsigned short us;
typedef long long ll;
typedef long double ld;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll infll=(1ull<<63)-1,mod=1e9+7;
const int inf=(1ull<<31)-1;
int n;
string a;

int main()
{
	//freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
	ios_base::sync_with_stdio(false); cin.tie(0);cout.precision(18);
	cin>>n>>a;
	for (int i=0;i<a.size();i++){
		int t=a[i]-'0'+n;
		if (t>42)
			t-=26;
		cout<<(char)(t+'0');
	}
	return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main
{
    PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer tok;

    public void go() throws IOException
    {
        boolean[] isPrime = new boolean[1001000];
        Arrays.fill(isPrime, true);
        isPrime[0] = false;
        isPrime[1] = false;
        for (int i = 2; i < isPrime.length; i++)
        {
            if (!isPrime[i])
            {
                continue;
            }
            for (int j = i*2; j < isPrime.length; j += i)
            {
                isPrime[j] = false;
            }
        }
        int p = 0;
        int[] primes = new int[100000];
        for (int i = 0; i < isPrime.length; i++)
        {
            if (isPrime[i])
            {
                primes[p] = i;
                p++;
            }
        }

        ntok();
        long a = lpar();
        long b = lpar();
        long gcd = gcd(a, b);
        // out.println(gcd);
        long count = 0;
        HashSet<Long> set = new HashSet<>();
        long[] freq = new long[100000];
        for (int i = 0; i < p; i++)
        {
            while (gcd % primes[i] == 0)
            {
                freq[i]++;
                count++;
                set.add((long)primes[i]);
                gcd /= primes[i];
            }
        }
        set.add(1L);
        set.add(gcd);
        long sum = count * (count + 1) / 2;
        for (int i = 0; i < freq.length; i++)
        {
            sum -= freq[i] * (freq[i]-1) / 2;
        }
        out.println(set.size());

        out.flush();
        in.close();
    }

    public long gcd(long a, long b)
    {
        if (b == 0)
        {
            return a;
        }
        return gcd(b, a%b);
    }

    public void ntok() throws IOException
    {
        tok = new StringTokenizer(in.readLine());
    }

    public int ipar()
    {
        return Integer.parseInt(tok.nextToken());
    }

    public int[] iapar(int n)
    {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++)
        {
            arr[i] = ipar();
        }
        return arr;
    }

    public long lpar()
    {
        return Long.parseLong(tok.nextToken());
    }

    public long[] lapar(int n)
    {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++)
        {
            arr[i] = lpar();
        }
        return arr;
    }

    public double dpar()
    {
        return Double.parseDouble(tok.nextToken());
    }

    public String spar()
    {
        return tok.nextToken();
    }

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


Measured memory_bytes: 24532
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

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

typedef int long long ll;
using namespace std;
typedef pair<int, int> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;
static const int MAX = 100;
static const int INF = (1 << 23);

int main() {
    int n;
    cin>>n;
    vector<ll> a(n);



    rep(i,n){
        cin>>a[i];
    }



    bool t = false;
    bool f = false;
    bool eq = false;

    int i = 0;
    int ans=0;


    while(i<n-1){
        if(a[i]<a[i+1]){
             if(t){

             }else{
                 if(f){
                     f = false;
                 }else {
                     t = true;
                     f = false;
                     ans++;
                 }
             }

        }else if(a[i]>a[i+1]){
            if(f){

            }else{
                if(t){
                    t=false;
                }else {
                    t = false;
                    f = true;
                    ans++;
                }
            }
        }else{

        }

        i++;

    }
    if(!t&&!f)ans++;

    cout<<ans<<endl;






    return 0;
}


Measured memory_bytes: 1024
#include<cstdio>
#include<cctype>
#include<algorithm>
#include<vector>
#include<cstring>
using namespace std;
const int N=1e5;
int n,a[N+2],b[N+1];
int cnt,mp[N*2+2];
vector<int>e[N*2+2];
bool vis[N*2+2];
int res;
int read()
{
	int ret=0;
	char c=getchar();
	while(!isdigit(c)) {
		c=getchar();
	}
	while(isdigit(c)) {
		ret=ret*10+c-'0';
		c=getchar();
	}
	return ret;
}
bool contain(int x[],int y[])
{
	static int buc[N*2+2];
	for(int i=1;i<=n+1;++i) {
		++buc[x[i]];
	}
	for(int i=1;i<=n;++i) {
		if(--buc[y[i]]<0) {
			return false;
		}
	}
	return true;
}
void dfs(int u)
{
	vis[u]=true;
	for(int v:e[u]) {
		if(!vis[v]) {
			dfs(v);
		}
	}
	return;
}
int main()
{
	n=read();
	for(int i=1;i<=n;++i) {
		a[i]=read();
		a[n+1]^=a[i],mp[i]=a[i];
	}
	for(int i=1;i<=n;++i) {
		b[i]=read();
		mp[n+i]=b[i];
	}
	mp[n*2+1]=a[n+1];
	sort(mp+1,mp+n*2+2);
	cnt=unique(mp+1,mp+n*2+2)-mp-1;
	for(int i=1;i<=n;++i) {
		a[i]=lower_bound(mp+1,mp+cnt+1,a[i])-mp;
		b[i]=lower_bound(mp+1,mp+cnt+1,b[i])-mp;
	}
	a[n+1]=lower_bound(mp+1,mp+cnt+1,a[n+1])-mp;
	if(!contain(a,b)) {
		puts("-1");
		return 0;
	}
	for(int i=1;i<=n;++i) {
		if(a[i]==b[i]) {
			continue;
		}
		e[a[i]].push_back(b[i]),e[b[i]].push_back(a[i]);
		++res;
	}
	for(int i=1;i<=cnt;++i) {
		if(!e[i].empty()&&!vis[i]) {
			dfs(i);
			++res;
		}
	}
	if(!e[a[n+1]].empty()) {
		--res;
	}
	printf("%d\n",res);
	return 0;
}


Measured memory_bytes: 16096
/**
 * Author : Dhakad_123
 * Created:05.07.2020
 **/

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


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


	int n; 
	cin >> n;


	int sum = 1000;
	bool Ok = true;


	while(Ok){

		if(sum >= n){
			cout << abs(sum - n) << "\n";
			Ok = false;
		}
		else{
			sum += 1000;
		}
	}

	return 0;
}




Measured memory_bytes: 3600
n, m, x = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(n)]
ans = 1e18
for i in range(1 << n):
    b = [0] * m
    c = 0
    for j in range(n):
        if i & (1 << j):
            c += a[j][0]
            for k in range(m): b[k] += a[j][k + 1]
    for j in range(m):
        if b[j] < x: c = 1e18
    ans = min(ans, c)
print(-1 if ans == 1e18 else ans)


Measured memory_bytes: 9072